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 ...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • We will help you pass verification on any service or application you need! Fast, reliable, and secure. Pay for the first verification and get a 10% discount on the second one. Learn more: Go to
    • Long-term rental of virtual numbers — maximum control and convenience. No need to change numbers every time or worry about losing access anymore. Now you can rent virtual numbers for hours, days, or months and use them as permanent ones: — stable SMS reception from popular services — permanent access to accounts — an ideal solution for registration, verification, and repeated logins — one number — full control for the entire rental period This is the choice for those who value reliability, uninterrupted access, and predictable results. Important: even many top SMS services are unable to offer such an exclusive long-term rental option. Go to the SMS service
    • We are looking for partners and account suppliers for cooperation We are open to partnerships with reliable account suppliers for the following dating services: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating We are considering long-term cooperation, stable volumes, and mutually beneficial terms. If you have any offers, we will be glad to discuss the details. Contact us using the details below. ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We are looking for partners and account suppliers for cooperation We are open to partnerships with reliable account suppliers for the following dating services: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating We are considering long-term cooperation, stable volumes, and mutually beneficial terms. If you have any offers, we will be glad to discuss the details. Contact us using the details below. ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We are looking for partners and account suppliers for cooperation We are open to partnerships with reliable account suppliers for the following dating services: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating We are considering long-term cooperation, stable volumes, and mutually beneficial terms. If you have any offers, we will be glad to discuss the details. Contact us using the details below. ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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