Jump to content

Question

Posted (edited)

Good evening. I downloaded the script for "olympiad rank" by "RedHot" . I want to be visible or accessable only from vip players, i tried several things but without success .
well here is the _init_

Spoiler

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.actor.appearance import PcAppearance
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.actor.appearance import PcAppearance
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

qn          = "20012_OlyRank"
NPC         = [47]
QuestId     = 20012
QuestName   = "OlyRank"
QuestDesc   = "custom"
InitialHtml = "1.htm"

class Quest (JQuest) :

    def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

    def onTalk (self,npc,player):
            return InitialHtml

    def onEvent(self,event,st):
        htmltext = event

        # Duelist
        if event == "88" :

            INITIAL_HTML = "<html><head><title>Grand Olympiad Ranking</title></head><body><center><font color=66cc00>Olympiad Ranking Online System</font></center><br><center><img src=\"L2UI.SquareWhite\" width=300 height=1><img src=\"L2UI.SquareBlank\" width=1 height=3></center><table width=300 border=0 bgcolor=\"000000\"><tr><td>Position</td><center><td>|</td></center><td><center>Name</center></td><center><td>|</td></center><td><center>Points</center></td><center><td>|</td></center><td><center>Matches</center></td></tr>"
            HTML_INFO =""            
            POSITION_VALUE_INITIAL = 0
            CONNECTION = L2DatabaseFactory.getInstance().getConnection()
            pts = CONNECTION.prepareStatement("SELECT char_name, olympiad_points, competitions_done from olympiad_nobles where class_id=88 and competitions_done>=9 order by olympiad_points desc, competitions_done desc");
            rs = pts.executeQuery()
            while (rs.next()) :
                CHAR_NAME = rs.getString("char_name")
                POINTS = rs.getString("olympiad_points")
                COMP_DONE = rs.getString("competitions_done")
                POSITION_VALUE_INITIAL = POSITION_VALUE_INITIAL + 1
                STRING_POSITION = str(POSITION_VALUE_INITIAL)
                HTML_INFO = HTML_INFO + "<tr><td><center>" + STRING_POSITION + "</td><center><td></td></center><td><center>" + CHAR_NAME +"</center></td><center><td></td></center><td><center>" + POINTS + "</center></td><center><td></td></center><td><center>" + COMP_DONE + "</center></td></tr>"
            HTML_END = "</table></body></html>


in l2jfrozen vip  member in java is ~> .isDonator()

2.html= an html i created which contains to non vip members.

i tried to add:

====================

    def onTalk (self,npc,player):
+  st = player.getQuestState(qn)
 return InitialHtml

 

    def onEvent(self,event,st):
        htmltext = event

+ if st.getPlayer().isVip() < 1 :        <~Also tried with "isDonator()"

+ htmltext ="2.htm"

+ else:
+ st.getPlayer().setTarget(st.getPlayer())


any help ?

 

 

EDIT:  I managed to do that only for vip with just add:

    def onTalk (self,npc,player):
+  if player.isDonator()==1:
 return InitialHtml


But i feel isn't right that way :/ 

Edited by Irrelevant

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • 📢 ¡ATENCIÓN JUGADORES DE LINEAGE 2! 📢   ¡L2 Crest Converter ha llegado! El programa creado por PulserX para obtener crests de clan (banderas) que realmente funciona, programado y distribuido de manera gratuita a todo el mundo por su humilde servidor.   ¿Cansado de que el viejo CrestMaker falle y arruine tus imágenes en Windows 10/11? Hemos creado una solución actualizada.   ✅ Optimizado para Windows 10/11 ✅ Convierte PNG/JPG perfectamente ✅ Adiós a las imágenes cuadriculadas   L2 Crest Converter es la herramienta que garantiza que tu crest se vea tal como la diseñaste. Descárgalo y velo en acción aquí: 👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE 👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE 👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE    
    • New update! A gift coupon system has been added. Now you can activate gift coupons directly in the bot: Open "My Profile" Tap "Activate gift coupon" Enter the coupon code The balance will be topped up automatically. Received a coupon? Activate it and top up your balance. Buy Telegram Stars with maximum benefit in our bot
    • New update! A gift coupon system has been added. Now you can activate gift coupons directly in the bot: Open "My Profile" Tap "Activate gift coupon" Enter the coupon code The balance will be topped up automatically. Received a coupon? Activate it and top up your balance. Buy Telegram Stars with maximum benefit in our bot
    • New update! A gift coupon system has been added. Now you can activate gift coupons directly in the bot: Open "My Profile" Tap "Activate gift coupon" Enter the coupon code The balance will be topped up automatically. Received a coupon? Activate it and top up your balance. Buy Telegram Stars with maximum benefit in our bot
    • Dear users! We are happy to announce a major update of our bot! What’s new: Long-term number rental You can now rent virtual numbers for a long period (hours, days, or months)! This is perfect for those who need constant access to a number to receive SMS from various services. Number history A new feature allows you to view all your rented numbers in one place! You can: • See the full history of all numbers (instant and long-term) • View all received SMS codes • Return to active numbers to receive additional SMS • See the status of each number Gift coupon system You can now activate gift coupons directly in the bot! Just go to your profile and click “Activate gift coupon” — your balance will be topped up automatically! Chinese language Full support for the Chinese language has been added! The bot is now available in three languages: Russian, English, and Chinese. Switching languages has become even more convenient. Improved rental process Before purchasing a number, detailed service information is now displayed: • Service name • Ability to receive repeated SMS • Rental duration • Cost This will help you make a more informed decision before renting. Quick rental The “Virtual numbers (SMS)” button has now been renamed to “Quick rental” for greater clarity and convenience. Go to the SMS service
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock