Jump to content
  • 0

[REQ] Can't add buffer - won't import quest


Question

Posted

Every 9999_NPCBuffer (quest/jython buffer) I insert won't load.

Tried everything. Browsed the net and tried all "solutions" they offered.

 

Is there some trick I missed?

 

I run the latest Archid pack (with custom buffers which I don't like)

 

Thanks

6 answers to this question

Recommended Posts

  • 0
Posted

Screen from GS error:

 

error.jpg

 

The __init__.py file from jscript/custom:

__all__ = [
'3995_echo',
'4000_ShadowWeapons',
'7000_HeroItems',
'8000_RaidbossInfo',
'6050_KetraOrcSupport',
'6051_VarkaSilenosSupport',
'9999_NPCBuffer'
]
print ""
print "importing custom data ..."
for name in __all__ :
   try :
       __import__('data.jscript.custom.'+name,globals(), locals(), ['__init__'], -1)
   except:
       print "failed to import quest : ",name
print "... done"
print ""

Do you also need the __init__.py inside the 9999_NPCBuffer ???

 

import sys
from com.l2jarchid.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jarchid.gameserver.datatables import SkillTable
from com.l2jarchid.gameserver.model.quest import State
from com.l2jarchid.gameserver.model.quest import QuestState
from com.l2jarchid.gameserver.model.quest.jython import QuestJython as JQuest

qn = "9999_NPCBuffer"

NPC=[40006]
ADENA_ID=57
QuestId     = 9999
QuestName   = "NPCBuffer"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "importing custom: 9999: NPCBuffer"

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)
	if count < 10000  or st.getPlayer().getLevel() < 0 :
		htmltext = "<html><head><body>You dont have enought Adena</body></html>"
	else:
		st.takeItems(ADENA_ID,10000)
		st.getPlayer().setTarget(st.getPlayer())

		#Wind Walk
		if event == "1":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1204,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

		#Acumen
		if event == "2":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1085,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

		#Agility
		if event == "3": 
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1087,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

		#Berserker Spirit
		if event == "4":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1062,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

                       		#Bless Shield
		if event == "5":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1243,1),False,False)	
			st.getPlayer().restoreHPMP()
			return "1.htm"			
			st.setState(COMPLETED)

		#Blessed Body
		if event == "6":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1045,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Blessed Soul
		if event == "7":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1048,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Concentration
		if event == "8":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1078,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Death Whisper
		if event == "9":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1242,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Empower
		if event == "10":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1059,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Focus
		if event == "11":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1077,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Guidance
		if event == "12":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1240,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Haste
		if event == "13":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1086,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Magic Barrier
		if event == "14":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1036,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Mental Shield
		if event == "15":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1035,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Might
		if event == "16":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1068,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Resist Shock
		if event == "17":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1259,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Shield
		if event == "18":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1040,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Vampiric Rage
		if event == "19":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1268,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

		#Dance of Aqua Guard
		if event == "30":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(307,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Concentration
		if event == "31":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(276,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Earth Guard
		if event == "32":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(309,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Fire
		if event == "33":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(274,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Fury
		if event == "34":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(275,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Inspiration
		if event == "35":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(272,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Light
		if event == "36":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(277,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of the Mystic
		if event == "37":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(273,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of Protection
		if event == "38":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(311,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Siren's Dance
		if event == "39":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(365,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of the Vampire
		if event == "40":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(310,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Dance of the Warrior
		if event == "41":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(271,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Champion
		if event == "50":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(364,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Earth
		if event == "51":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(264,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Flame Guard
		if event == "52":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(306,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Hunter
		if event == "53":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(269,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Invocation
		if event == "54":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(270,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Life
		if event == "55":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(265,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Meditation
		if event == "56":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(363,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Renewal
		if event == "57":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(349,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Storm Guard
		if event == "58":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(308,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Vengeance
		if event == "59":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(305,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Vitality
		if event == "60":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(304,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Warding
		if event == "61":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(267,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Water
		if event == "62":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(266,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Song of Wind
		if event == "63":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(268,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Greater Might
		if event == "64":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1388,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Greater Shield
		if event == "65":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1389,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Chant of Victory
		if event == "66":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1363,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Prophecy of Fire
		if event == "67":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1356,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Prophecy of Water
		if event == "68":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1355,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Prophecy of Wind
		if event == "69":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1357,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#Cancellation
		if event == "70":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1056,1),False,False)
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		#MPreg
		if event == "71":
			st.takeItems
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)	

		if event == "73":
			st.takeItems
			st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

        		#Chant of Magnus
		if event == "74":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(9952,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

       		#Wild Magic
		if event == "75":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1303,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

       		#Vampiric Rage
		if event == "76":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1268,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)


		if htmltext != event:
			st.setState(COMPLETED)
			st.exitQuest(1)
	return htmltext


def onTalk (self,npc,player):
   st = player.getQuestState(qn)
   htmltext = "<html><head><body>I have nothing to say to you</body></html>"
   st.setState(STARTED)
   return InitialHtml

QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED=State('Start',QUEST)
STARTED=State('Started',QUEST)
COMPLETED=State('Completed',QUEST)

QUEST.setInitialState(CREATED)

for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

  • 0
Posted

I got the quest loaded but the script seems bugged :/

 

_______________________________________________

UPDATE:

 

I've read that a buffer script should allways start with an " if event == 2 "

In this case there is:

 

if event == "1":

 

Could this be the problem?

Just asking before I rewrite the script and htm's  :P

 

_______________________________________________

UPDATE 2:

 

All seems to be working fine except I get an error.

It has to do something with restoring my hp/mp after a buff.

Because of the error I won't get back to the initial html.

 

The code I use is:

 

			#Wind Walk
		if event == "2":
			st.takeItems
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1204,1),False,False)
			st.getPlayer().restoreHPMP()				
			return "1.htm"
			st.setState(COMPLETED)

 

And this following part causes me troubles:

 

st.getPlayer().restoreHPMP()	

Guest
This topic is now closed to further replies.


×
×
  • Create New...