Problem in GS (Gatekeeper)
Posted: Fri Oct 22, 2010 9:28 pm
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: The Last (Freya)
L2JDP Revision Number: The Last (Freya)
Here the screen:

Hi guys, I've just an error here, it appeared today, I looked at the init.py of the GK I have and I can't understand what's the problem, here the code of the GK:
Thanks in advance.
» Find Revision
L2J Revision Number: The Last (Freya)
L2JDP Revision Number: The Last (Freya)
Here the screen:

Hi guys, I've just an error here, it appeared today, I looked at the init.py of the GK I have and I can't understand what's the problem, here the code of the GK:
Code: Select all
import sysfrom java.lang import Systemfrom com.l2jserver.gameserver.model.quest import Statefrom com.l2jserver.gameserver.model.quest import QuestStatefrom com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuestfrom com.l2jserver.gameserver.datatables import ItemTablefrom com.l2jserver.gameserver.instancemanager import TownManagerfrom com.l2jserver.gameserver.instancemanager import SiegeManagerfrom com.l2jserver.gameserver.network import SystemMessageIdfrom com.l2jserver.gameserver.network.serverpackets import SystemMessagefrom com.l2jserver.gameserver.network.serverpackets import NpcHtmlMessage ##############################ALLOW_VIP = False ###############################VIP_ACCESS_LEVEL = 0 ###############################ALLOW_KARMA_PLAYER= False ###############################FREE_TELEPORT = True ############################### npcId = 958QuestId = 958QuestName = "DeluxGatekeeper"QUEST_INFO = str(QuestId)+"_"+QuestNameQuestDesc = "custom" print "=================================="print "INFO Cargado NPC DELUXE GATEKEEPER"print "==================================" def getitemname(case): try: val =ItemTable.getInstance().createDummyItem(case).getItemName() except: val = "0" return val def getmaster(): xi="ux";xe="l";xf="e";xg="n";xa="B";xb="y";xc=" ";xd="A";xk="eeper";xh="Del";xj="Gatek";val=xa+xb+xc+xd+xe+xe+xf+xg return val def getevent(type,text) : MESSAGE = "<html><head><title>Delux Gatekeeper</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" MESSAGE += "<font color=\"LEVEL\">"+type+"</font><br>"+text+"<br>" MESSAGE += "<font color=\"303030\">"+getmaster()+"</font></center></body></html>" return MESSAGE class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onAdvEvent (self,event,npc,player) : try: st = player.getQuestState(QUEST_INFO) except: return if event[0] == "g" and event[4] == "t" and event[11] == "t": event = event.replace("]","") event = event.replace("["," ") varSplit = event.split(" ") try: noblesGK = int(varSplit[2]) except : noblesGK = 0 if st.player.isGM() == 1 : try: st.player.teleToLocation(int(varSplit[5]), int(varSplit[6]), int(varSplit[7]), True) except : st.player.sendMessage("Report to the admin that this function is not working!") return else: newevent="confteleport["+varSplit[3]+"]["+varSplit[4]+"] "+varSplit[5]+" "+varSplit[6]+" "+varSplit[7] filename = "data/html/teleporter/gatekeeper/confirmation.htm" html = NpcHtmlMessage(npc.getObjectId()) html.setFile(None,filename) html.replace("%place%", varSplit[1].replace("-"," ")) html.replace("%itemName%", str(getitemname(int(varSplit[3])))) html.replace("%reqitem%", varSplit[4]) html.replace("%event%", newevent) html.replace("%objectId%", str(npc.getObjectId())) st.player.sendPacket(html) return if event[0] == "c" and event[1] == "o" and event[4] == "t" and event[5] == "e": eventSplit = event.split(" ") event = eventSplit[0] eventParam1 = eventSplit[1] eventParam2 = eventSplit[2] eventParam3 = eventSplit[3] event = event.replace("]","") event = event.replace("["," ") GKSplit = event.split(" ") try: TELEPORT_ITEM_ID = int(GKSplit[1]); TELEPORT_PRICE = int(GKSplit[2]) except : TELEPORT_ITEM_ID = 57; TELEPORT_PRICE = 15000 if SiegeManager.getInstance().getSiege(int(eventParam1), int(eventParam2), int(eventParam3)) != None: st.player.sendPacket(SystemMessage(SystemMessageId.NO_PORT_THAT_IS_IN_SIGE)) return elif TownManager.townHasCastleInSiege(int(eventParam1), int(eventParam2)) : st.player.sendPacket(SystemMessage(SystemMessageId.NO_PORT_THAT_IS_IN_SIGE)) return elif ALLOW_KARMA_PLAYER == False and st.player.getKarma() > 0: st.player.sendMessage("Go away!, you are not welcome here.") return elif st.player.isAlikeDead(): return if FREE_TELEPORT == False : if st.getQuestItemsCount(TELEPORT_ITEM_ID) < TELEPORT_PRICE : return getevent("Im sorry","You dont have enough items:<br>Necesitaras: <font color =\"LEVEL\">"+str(TELEPORT_PRICE)+" "+str(getitemname(TELEPORT_ITEM_ID))+"!") else : st.takeItems(TELEPORT_ITEM_ID,TELEPORT_PRICE) st.player.teleToLocation(int(eventParam1), int(eventParam2), int(eventParam3), True) else: st.player.teleToLocation(int(eventParam1), int(eventParam2), int(eventParam3), True) else: return def onFirstTalk (self,npc,player): st = player.getQuestState(QUEST_INFO) if not st : st = self.newQuestState(player) st.setState(State.STARTED) if player.isGM(): filename = "data/html/teleporter/gatekeeper/teleports.htm" html = NpcHtmlMessage(npc.getObjectId()) html.setFile(None,filename) html.replace("%objectId%", str(npc.getObjectId())) st.player.sendPacket(html) if ALLOW_VIP == False or player.getAccessLevel().getLevel() == VIP_ACCESS_LEVEL and ALLOW_VIP == True: if ALLOW_KARMA_PLAYER == False and player.getKarma() > 0 : return getevent("You have too much karma!</font><br>Come back again when you dont have karma!","False") else: filename = "data/html/teleporter/gatekeeper/teleports.htm" html = NpcHtmlMessage(npc.getObjectId()) html.setFile(None,filename) html.replace("%objectId%", str(npc.getObjectId())) st.player.sendPacket(html) else: return getevent("Im sorry","This NPC is only for VIP people!<br>Contact with the administrator<br> for more information!") QUEST = Quest(QuestId,QUEST_INFO,QuestDesc) QUEST.addStartNpc(npcId)QUEST.addFirstTalkId(npcId)QUEST.addTalkId(npcId)