Need help with script

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
babyjason
Posts: 575
Joined: Wed Dec 02, 2009 7:59 pm

Need help with script

Post by babyjason »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:

Hello, i m using this pet buffer, but it gives me errors, when a user doesent have a pet and uses the buffer...

is there any way to give a message or smt if user doesent have a pet and uses it?

 


this is the error

Code: Select all

 com.l2jserver.gameserver.model.quest.Quest showErrorWARNING:  \gameserver\data\scripts\custom\9997_PetBuffer\__init__.pyTraceback (innermost last):  File "__init__.py", line 904, in onEventAttributeError: 'NoneType' object has no attribute 'getMaxHp' 	at org.python.core.Py.AttributeError(Unknown Source)	at org.python.core.PyObject.noAttributeError(Unknown Source)	at org.python.core.PyObject.__getattr__(Unknown Source)	at org.python.core.PyObject.invoke(Unknown Source)	at org.python.pycode.serializable._pyx1278386062828.onEvent$3(__init__.py:904)	at org.python.pycode.serializable._pyx1278386062828.call_function(__init__.py)	at org.python.core.PyTableCode.call(Unknown Source)	at org.python.core.PyTableCode.call(Unknown Source)	at org.python.core.PyTableCode.call(Unknown Source)	at org.python.core.PyFunction.__call__(Unknown Source)	at org.python.core.PyMethod.__call__(Unknown Source)	at org.python.core.PyObject.__call__(Unknown Source)	at org.python.core.PyObject._jcallexc(Unknown Source)	at org.python.core.PyObject._jcall(Unknown Source)	at org.python.proxies.main$Quest$425.onEvent(Unknown Source)	at com.l2jserver.gameserver.model.quest.Quest.onAdvEvent(Quest.java:674)	at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:405)	at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1788)	at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:229)	at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:93)	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)	at java.lang.Thread.run(Unknown Source)
Last edited by babyjason on Sat Jul 10, 2010 2:39 pm, edited 1 time in total.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Need help with script

Post by janiii »

just check other scripts that do something with pets or if you dont know which one, check for "getPet()" in the .py scripts.

Code: Select all

if not st.getPlayer().getPet():	return "<html><body>You dont have your pet summoned!</body></html>"
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
muutorpe
Posts: 2
Joined: Mon Jul 20, 2009 8:44 am

Re: Need help with script

Post by muutorpe »

Thx janiii xDD.
babyjason
Posts: 575
Joined: Wed Dec 02, 2009 7:59 pm

Re: Need help with script

Post by babyjason »

ok, i m embarassed to ask this, but where does it go? at the end?

Code: Select all

import sysfrom com.l2jserver.gameserver.model.actor.instance	import L2PcInstancefrom java.util import Iteratorfrom com.l2jserver.gameserver.datatables	import SkillTablefrom com.l2jserver		import L2DatabaseFactoryfrom com.l2jserver.gameserver.model.quest        import Statefrom com.l2jserver.gameserver.model.quest        import QuestStatefrom com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest qn = "9997_PetBuffer" NPC=[40001]QuestId     = 9997QuestName   = "PetBuffer"QuestDesc   = "custom"InitialHtml = "1.htm" class Quest (JQuest) : 	def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)  	def onEvent(self,event,st):		htmltext = event  	def onTalk (self,npc,player):	   st = player.getQuestState(qn)	   htmltext = "<html><head><body><center>ERROR<br1>Please, contact the administrator.</center></body></html>"	   st.setState(State.STARTED)	   return InitialHtml QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc) for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) print "DONE: 9997_PetBuffer"
Post Reply