Page 1 of 2

Problem in GS (Gatekeeper)

Posted: Fri Oct 22, 2010 9:28 pm
by ElessarMS
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:

Image

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)
Thanks in advance.

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 2:45 am
by Hitokiri
Have you edited something before this error happened? How u got it? And can u give the full screen of the error?
Need more information and than we will see where is the problem.

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 8:22 am
by ElessarMS
No, nothing has been edited, and the screen has on it the whole error, there is no more information about it.

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 9:45 am
by Hitokiri
ElessarMS wrote:No, nothing has been edited, and the screen has on it the whole error, there is no more information about it.
Ok i dont have on my svn a 958_DeluxGatekeeper/__init__.py so show me the source code of your __init__.py

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 10:12 am
by ElessarMS
The init is up, under the picture...

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 10:38 am
by Hitokiri
ElessarMS wrote:The init is up, under the picture...
Oops sorry just was in night club tonight am little drunk. :mrgreen: Ok i checked the script, can i see this one now
data/html/teleporter/gatekeeper/confirmation.htm Have u it? :roll: Think something is missing i think.

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 11:18 am
by Edelvez
Hitokiri at the exit of club :lol:
Image

Show us all the html that has the script.

To me that's what you need an html

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 11:35 am
by Hitokiri
Edelvez wrote:Hitokiri at the exit of club :lol:


Show us all the html that has the script.

To me that's what you need an html
U wanna see my html? :D

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 11:46 am
by Edelvez
You must have an error in the html, which presents the error...

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 12:09 pm
by ElessarMS
This is the html you asked, btw I'll be glad if someone tells me how to change that, because everytime, when the player wants to go somewhere, is clicking the place, and after that a window with the confirmation is appearing and I think is really annoying:

Code: Select all

<html><head><title>Global Gatekeeper</title></head><body><center><img src="L2UI_CH3.herotower_deco" width=256 height=32><br><br><font color="303030">Gatekeeper</font><br><img src="L2UI.SquareGray" width=250 height=1><br><table width=260 border=0 bgcolor=444444><tr><td><br></td></tr><tr><td align="center">You have chosen:<br><font color="FF0000">%place%<br1></font></td></tr><tr><td align="center"><br1><font color="LEVEL">Do you want to continue?</td></tr><tr><td></td></tr></table><br><img src="L2UI.SquareGray" width=250 height=1><br><br><button value="Confirm" action="bypass -h Quest 958_DeluxGatekeeper %event%" width=80 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><button value="Back" action="bypass -h npc_%objectId%_Link teleporter/gatekeeper/teleports.htm" width=80 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </center></body></html>  

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 12:20 pm
by Edelvez
In the html replace this line:

Code: Select all

<button value="Confirm" action="bypass -h Quest 958_DeluxGatekeeper %event%" width=80 height=25
this

Code: Select all

<button value="Confirm" action="bypass -h npc_%objectId%_Quest 958_DeluxGatekeeper %event%" width=80 height=25

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 12:24 pm
by jurchiks
the problem is here:
str(getitemname(int(varSplit[3]))))

it tries to get INTEGER value of varSplit[3], but according to error it's a string ("Floor")
so most probably a typo in htm, but you should make the script more foolproof...

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 12:57 pm
by Hitokiri
jurchiks wrote:the problem is here:
str(getitemname(int(varSplit[3]))))

it tries to get INTEGER value of varSplit[3], but according to error it's a string ("Floor")
so most probably a typo in htm, but you should make the script more foolproof...
Ok think i found it, try now

Code: Select all

<html><head><title>Global Gatekeeper</title></head><body><center><img src="L2UI_CH3.herotower_deco" width=256 height=32><br><br><font color="303030">Gatekeeper</font><br><img src="L2UI.SquareGray" width=250 height=1><br><table width=260 border=0 bgcolor=444444><tr><td><br></td></tr><tr><td align="center">You have chosen:<br><font color="FF0000">%place%<br1></font></td></tr><tr><td align="center"><font color="FF0000">Price: <font color="LEVEL">%reqitem% %itemName%<br></td></tr> <tr><td align="center"><br1><font color="LEVEL">Do you want to continue?</td></tr><tr><td></td></tr></table><br><img src="L2UI.SquareGray" width=250 height=1><br><br><button value="Confirm" action="bypass -h Quest 958_DeluxGatekeeper %event%" width=80 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><button value="Back" action="bypass -h npc_%objectId%_Link teleporter/gatekeeper/teleports.htm" width=80 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </center></body></html>
I added one more line in it so now it should work
Also u can use your old code but u need to delete this ones from the __init__.py

Code: Select all

html.replace("%itemName%", str(getitemname(int(varSplit[3])))) html.replace("%reqitem%", varSplit[4])

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 1:22 pm
by janiii
no no, we need your teleport.htm because the problem is there where you defined the bypasses for the teleport. check the teleport bypass where you have "Floor" written. probably on wrong place, check this description of the bypasses, you have problem on the 3rd place:
Allengc wrote: Dentro de los html de teleport veran algo como esto.
(1) (2) (3) (4) X Y Z
action="bypass -h Quest 958_DeluxGatekeeper gototeleport[Baium][1][3481][5] 56900 220125 -3225"

Donde:

(1) Nombre del citio a donde uno sera teleportado, este sera el nombre que aparecera en pantalla pidiendonos que aceptemos el destino, en la foto se aprecia. Los espacios en blanco debes ser cambiado por "-" Ejm Ant Queen -> Ant-Queen.
(2) Si colocamos 0 el teleport estara disponible para todos los usuarios, si es 1 solo nobles podran usar esa coordenada.
(3) Este es el item que nos solicitara el npc para teleportarnos, en la mayoria de los htmls encontraran el id 57 (adena) pero en algunos como el de los raidbosses veran otro, pueden editarlo con el id que deseen.
(4) Es la cantidad de los items anteriores, que tendremos que ofrecer (X,Y,Z) Son las coordenadas del lugar al que nos teleportaremos.

Re: Problem in GS (Gatekeeper)

Posted: Sat Oct 23, 2010 1:42 pm
by Hitokiri
Think it would be something like that

Code: Select all

 <tr><td align=center><button action="bypass -h npc_%objectId%_Link teleporter/gatekeeper/Floor.htm" value="Floor" width=120 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td></tr> 
And if there are no Floor.htm or the link is wrong it can crash too. U need to fix it or delete the whole line :roll:
U needed to put all your Global GK files from the begining so we could correct the whole script