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.


  • Posts

    • I wouldn't expect something less, since you work with Psadek (or I maybe mistake you with NightW0lf from itopz, in that case soz) Let's throw rocks at Java Golds and elevate "original L2OFF Golds", no?
    • We are delighted to announce our partnership with the leading resource, Active Anticheat, specializing in protection against bot programs, clickers, and additional modules for the game client that enhance the experience for both you and the players!   When you purchase Active Anticheat for our product, you will also receive a $50 discount.   Here's a brief overview of the features of Active Anticheat: Best protection against bots, including private and premium versions. Window limitation. HWID spoofing protection. Virtual machine protection. File hash protection for client files, preventing players from modifying them (e.g., interface files). Encryption of any game files. Integration with Discord to attract new players! Additional plugins: - Window with saved player logins/passwords. Players no longer need to enter them every time! - HWID sending to the game server. - Game window optimizer for quick switching. - Background FPS adjustment. - Window name customization in the format "%character_name% - %server_name%". - Ctrl+C/V permission. - Login and password saving (for Interlude -> High Five). - Launching the browser via server packets. - Launching interface events via server packets. - Interlude: fixing a known game bug (History: UpdateAnimation <- AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- UpdateWorld <- MainLoop). - Interlude: debuff feature. 9) All of this is available without modifying the game server code (some plugins may require minor changes). Take note of newest plugin, which is highly useful: Guides section
    • The Lucera2 Multiprotocol is an advanced server branch for Lineage 2 that enables seamless support for multiple client versions on a single server instance. This allows players to connect and play using either the legacy (old) client or the newer Classic client simultaneously, without any compatibility issues or loss of functionality. Key Benefits Dual Client Support: Both the old Interlude client and Classic: Secret of Empire 2.6 client can run concurrently on the same server. All features from the Classic client (e.g., enhanced UI, new mechanics) remain fully available, while the old client retains its alternative features (e.g., simplified interfaces for lower-end hardware). Expanded Player Base: Ideal for regions with limited access to modern gaming setups, as it accommodates a wider range of devices and preferences, merging Legacy and Classic communities into one forum section for unified discussions. No Functionality Gaps: Extensive testing ensures zero disruptions—players on either client experience complete game integrity, including quests, PvP, raids, and custom Lucera2 subsystems. You can fully test and explore all aspects of Multiprotocol on the dedicated Test Server. Supported Protocols C6 (Old Client): Protocol versions 740–770. Classic Client (Secret of Empire 2.6): Protocol versions 166–192.
    • Connect to the server you need to >>>download<<< game client launch from /system_en/. Login server setup on auto registration, admin rights in game by default . Or you can use a patch specifying the l2.ini Connect to address classic.lucera2.com if you already have a game client Download updated patch All major/minor subsystems operate in a proper view. Absolutely ready to combat the server.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock