Jump to content
  • 0

[HELP]Whit NPCBuffer Code


Question

Posted

Hi Everyone, i'am posting here because i need help whit this code from npcbuffer, well i need to know what i need to change in the code to make the NPC cast the buffs, or what I need to edit for see an animation when i press the buff button??

 

import sys
from net.sf.l2j.gameserver.model.actor.instance	import L2PcInstance
from java.util import Iterator
from net.sf.l2j.gameserver.datatables	import SkillTable
from net.sf.l2j		import L2DatabaseFactory
from net.sf.l2j.gameserver.model.quest        import State
from net.sf.l2j.gameserver.model.quest        import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

qn = "9977_NPCBuffer"

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

print "importing custom: 9977: 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 < 15000 or st.getPlayer().getLevel() < 2 :
		htmltext = "<html><head><body>No Tienes Adena.<br></body></html>"
	else:
		st.takeItems(ADENA_ID,0)
		st.getPlayer().setTarget(st.getPlayer())

		if event == "1":
			st.takeItems(ADENA_ID,1000)
                               st.getPlayer().useMagic(SkillTable.getInstance().getInfo(9951,5),False,False)
                               st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

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

		#Arcane Protection
		if event == "3":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1354,1).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Shield
		if event == "4":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1040,3).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Might
		if event == "5":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1068,3).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Mental Shield
		if event == "6":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1035,4).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.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>No Tengo Nada que decirte.</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)

 

with nothing more to say, thank you very much for the help ....

Francisko ^^*!

 

PD: i just post a part of the code, because the other repeats

4 answers to this question

Recommended Posts

  • 0
Posted

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 = "9977_NPCBuffer"

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

print "importing custom: 9977: 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 < 15000 or st.getPlayer().getLevel() < 2 :
		htmltext = "<html><head><body>No Tienes Adena.<br></body></html>"
	else:
		st.takeItems(ADENA_ID,0)
		st.getPlayer().setTarget(st.getPlayer())

		if event == "1":
			st.takeItems(ADENA_ID,1000)
                                st.getPlayer().useMagic(SkillTable.getInstance().getInfo(9951,5),False,False)
                                st.getPlayer().restoreHPMP()
			return "1.htm"		
			st.setState(COMPLETED)

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

		#Arcane Protection
		if event == "3":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1354,1).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Shield
		if event == "4":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1040,3).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Might
		if event == "5":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1068,3).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.htm"		
			st.setState(COMPLETED)

		#Mental Shield
		if event == "6":
			st.takeItems(ADENA_ID,10000)
			SkillTable.getInstance().getInfo(1035,4).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().restoreHPMP()
			return "2.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>No Tengo Nada que decirte.</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)

 

Paste this inside your init_py.

  • 0
Posted

Well, after reading your code, not to me, because what you did was to change the routes of the libraries, but what do I need to make the NPC CAST THE buffs, not only is the icon that appears on the bar the buff ... greetings and thanks for helping me anyway ...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...