Jump to content
  • 0

Question

Posted (edited)

Hi guys i saw i post from elfo : http://www.maxcheaters.com/topic/181446-just-another-buffer/?hl=buffer

And i want to make my buffer when it gives buffs to show buff effects like elfo's.
I use python buffer for l2jfrozen. Please give me an example on this code:

 

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


 

Edited by Rio

Recommended Posts

  • 0
Posted

You better start reading initial post, twice :troll:

 

Back in the days, python 'era', there was buffers that casted animation, but I don't remember that code line :P

  • 0
Posted

 

You could use onAdvEvent() instead of onEvent(). It takes an npc reference as a parameter. ^^

 

Ups, not a good idea... :lol:

You do better obtain a reference through the onTalk() method. Less painful for you... :D

 

Change the constructor to:

def __init__(self,id,name,descr):
    JQuest.__init__(self,id,name,descr)
    self.npc_obj = None

Then, at the onTalk() method add this line:

def onTalk (self,npc,player):
    self.npc_obj = npc

Now you should be able to use

getEffects(self.npc_obj, st.getPlayer())

gives me error:

 

Error on: C:\l2server\gameserver\data\scripts\custom\95999_NPCBuffer\__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('__init__.py', 24, 9, '        JQuest.__init__(self,id,name,descr)'))

  • 0
Posted

Paste the entire code after the modification.


print "importing custom: 95999: NPCBuffer"

class Quest (JQuest) :

	def __init__(self,id,name,descr):
        JQuest.__init__(self,id,name,descr)
        self.npc_obj = None

	def onEvent(self,event,st):
        def onTalk (self,npc,player):
        self.npc_obj = npc
		htmltext = event
		count=st.getQuestItemsCount(ADENA_ID)
		if count < 1000  or st.getPlayer().getLevel() < 1 :
			htmltext = "<html><head><body>You dont have enough Adena!<br> You have to pay me 1000 adenas for every single buff.</body></html>"
		else:
			st.takeItems(ADENA_ID,0)
			st.getPlayer().setTarget(st.getPlayer())
			
			#Wind Walk
			if event == "2":
				st.takeItems(ADENA_ID,1000)
                                getEffects(self.npc_obj(), st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1204,2),False,False)
				SkillTable.getInstance().getInfo(1204,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)
  • 0
Posted (edited)

First: In Python the proper indention is required, so:

def __init__(self, id, name, descr):
    JQuest.__init__(self, id, name, descr)
    self.npc_obj = None

Second: You can't define a method in method, so remove the two lines you have added to onEvent().

Third: You already have onTalk() method, the only thing you should do is to add to it:

self.npc_obj = npc
Edited by Tessa
  • 0
Posted

 

First: In Python the proper indention is required, so:

def __init__(self, id, name, descr):
    JQuest.__init__(self, id, name, descr)
    self.npc_obj = None

Second: You can't define a method in method, so remove the two lines you have added to onEvent().

Third: You already have onTalk() method, the only thing you should do is to add to it:

self.npc_obj = npc

 

can you please edit my code? i'm bit confused and cannot understand how to make it work, everything i try i get errors :/

class Quest (JQuest) :

	def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.npc_obj = None


	def onEvent(self,event,st):
		htmltext = event
		count=st.getQuestItemsCount(ADENA_ID)
		if count < 1000  or st.getPlayer().getLevel() < 1 :
			htmltext = "<html><head><body>You dont have enough Adena!<br> You have to pay me 1000 adenas for every single buff.</body></html>"
		else:
			st.takeItems(ADENA_ID,0)
			st.getPlayer().setTarget(st.getPlayer())
			
			#Wind Walk
			if event == "2":
				st.takeItems(ADENA_ID,1000)
                                st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1204,2),False,False)
				SkillTable.getInstance().getInfo(1204,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)
  • 0
Posted

You better start reading initial post, twice :troll:

 

Back in the days, python 'era', there was buffers that casted animation, but I don't remember that code line :P

 

From backsteen reshare

broadcastPacket(new MagicSkillUser(this, player, buffid, bufflevel, 500, 0));

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

    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • https://jumpshare.com/share/L45ApA5PVrGN2O5Ua5pQ   Skill synchronization with the server: Launching and synchronizing animations, launching and synchronizing effects. All of this is tied to the server's timing  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..