DeathRow
Nombre de messages : 10 Localisation : Nord de la France Date d'inscription : 29/04/2009
| Sujet: Erreur Script Python 07/12/09, 12:15 pm | |
| Bonjour, j'aurai besoin de votre aide pour un NPC buffer que je fais pour Pet/Summon sous la rev 7440 de L2jfree ( Gracia Final ) Cependant après avoir réalisé le script en python et l'avoir mis et tester, les buff s'appliquent bien a mon summon mais j'obtiens quand même une erreur après chaque action dans la fenetre donc il ne retourne pas au htm voulut Voici le script : - Code:
-
import sys from com.l2jfree.gameserver.model.actor.instance import L2PcInstance from java.util import Iterator from com.l2jfree.gameserver.datatables import SkillTable from com.l2jfree import L2DatabaseFactory from com.l2jfree.gameserver.model.quest import State from com.l2jfree.gameserver.model.quest import QuestState from com.l2jfree.gameserver.model.quest.jython import QuestJython as JQuest
qn = "90000_Pet"
NPC = 90000 ADENA_ID_PET = 57 InitialHtml = "1-pet.htm"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(ADENA_ID_PET) if not st.getPlayer().getPet() : return "no-pet.htm" else: if st.getPlayer().getLevel() > 62 : htmltext = "no.htm"
else: st.getPlayer().getPet().setTarget(st.getPlayer().getPet())
#Wind Walk if event == "2": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED)
#Shield if event == "4": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED)
#Might if event == "5": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4345,3).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED)
#Bless the Body if event == "7": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED)
#Vampiric Rage if event == "14": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4354,4).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED)
#Haste if event == "17": st.takeItems(ADENA_ID_PET,0) SkillTable.getInstance().getInfo(4357,2).getEffects(st.getPlayer().getPet(),st.getPlayer().getPet()) st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "2-pet.htm" st.setState(COMPLETED) #Cancellation if event == "78": st.takeItems(ADENA_ID_PET,0) st.getPlayer().getPet().stopAllEffects() st.getPlayer().getPet()(st.getPlayer().getPet(), st.getPlayer().getPet()) return "1-pet.htm" st.setState(COMPLETED) if htmltext != event: st.setState(COMPLETED) st.exitQuest(1) return htmltext
def onTalk (self,npc,player): st = player.getQuestState(qn) if not st: return "away.htm" st.setState(State.STARTED) return InitialHtml
QUEST = Quest(90000,qn,"custom")
QUEST.addStartNpc(NPC) QUEST.addTalkId(NPC)
et l'erreur qui s'affiche IG - Code:
-
WARNING [07 déc. 11:58:43,232] com.l2jfree.gameserver.model.quest.Quest.showError(): /game/data/scripts/custom/90000_Pet/__init__.py Traceback (innermost last): File "__init__.py", line 35, in onEvent TypeError: getInfo(): expected 3 args; got 2
at org.python.core.Py.TypeError(Unknown Source) at org.python.core.PyReflectedFunction.throwError(Unknown Source) at org.python.core.PyReflectedFunction.throwArgCountError(Unknown Source) at org.python.core.PyReflectedFunction.throwError(Unknown Source) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyObject.invoke(Unknown Source) at org.python.pycode.serializable._pyx1260178335003.onEvent$3(__init__.py:35) at org.python.pycode.serializable._pyx1260178335003.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$449.onEvent(Unknown Source) at com.l2jfree.gameserver.model.quest.Quest.onAdvEvent(Quest.java:631) at com.l2jfree.gameserver.model.quest.Quest.notifyEvent(Quest.java:405) at com.l2jfree.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1627) at com.l2jfree.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:170) at com.l2jfree.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:88) at com.l2jfree.util.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:59) at com.l2jfree.gameserver.threadmanager.FIFORunnableQueue.removeAndExecuteFirst(FIFORunnableQueue.java:28) at com.l2jfree.gameserver.threadmanager.FIFOExecutableQueue.run(FIFOExecutableQueue.java:73) at com.l2jfree.util.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:59) at com.l2jfree.util.concurrent.ExecuteWrapper.run(ExecuteWrapper.java:40) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
WARNING [07 déc. 11:58:49,046] com.l2jfree.gameserver.model.quest.Quest.showError():/game/data/scripts/custom/90000_Pet/__init__.py Traceback (innermost last): File "__init__.py", line 45, in onEvent AttributeError: 'javainstance' object has no attribute '__call__'
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.core.PyInstance.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.pycode.serializable._pyx1260178335003.onEvent$3(__init__.py:45) at org.python.pycode.serializable._pyx1260178335003.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$449.onEvent(Unknown Source) at com.l2jfree.gameserver.model.quest.Quest.onAdvEvent(Quest.java:631) at com.l2jfree.gameserver.model.quest.Quest.notifyEvent(Quest.java:405) at com.l2jfree.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1627) at com.l2jfree.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:170) at com.l2jfree.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:88) at com.l2jfree.util.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:59) at com.l2jfree.gameserver.threadmanager.FIFORunnableQueue.removeAndExecuteFirst(FIFORunnableQueue.java:28) at com.l2jfree.gameserver.threadmanager.FIFOExecutableQueue.run(FIFOExecutableQueue.java:73) at com.l2jfree.util.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:59) at com.l2jfree.util.concurrent.ExecuteWrapper.run(ExecuteWrapper.java:40) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
Désole de la taille immense du post et Merci d'avance a ceux qui voudront et pourront m'aider Cordialement DeathRow | |
|
Hizin
Nombre de messages : 501 Age : 35 Localisation : Le Mans, Sarthe Date d'inscription : 08/04/2007
| Sujet: Re: Erreur Script Python 08/12/09, 12:20 pm | |
| Pour la première, sans chercher : - Code:
-
TypeError: getInfo(): expected 3 args; got 2 getInfo() attends 3 arguments, tu lui en donnes 2. Première erreur réglée =) | |
|