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

    • 🎉 **OPENING — Lineage 2 x17 MULTIPROF COMFORT SERVER!** 🔥 **October 31, 2025 at 20:00 (MSK)** (OBT starts **October 27, 2025 at 20:00**) 💎 **Multeria** invites you to join the brand-new **Multiprof server** — built with care, balance, and community feedback in mind! ⚔️ **COMFORT RATES:** • EXP ×17 (with PA ×25.5) • SP ×8.5 (with PA ×17) • Drop / Spoil ×1 (with PA ×2.5) • Adena ×1 (with PA ×2) 🚀 **WHAT’S NEW:** • New max level — **100** • **100% Craft System** for armor, weapons, belts (incl. Power Belt), bracelets & talismans • New epic accessory — **Frintezza’s Necklace** • **Mass skills cooldown reduced ×10** (Defense Instinct, Magic Impulse, Fanatic, etc.) • Fair play — HWID limits on global instances and rebirth-based party checks • **New 90+ dungeons** (60/120 min time limits) • **New PvP zones:** Varka, FoG, LoA, Stakato (battle zones active) • **Extra game window** available for in-game currency (Gold Einhasad) 💬 Everything you love about Lineage 2 — **balance, comfort, and fairness**. 🔗 More info: https://hf.multeria.world/
    • Hello everyone, we now have Adena for these projects: l2rebon signature x1 - 1kk = $0.8 l2reborn x10 - 500kk = $3.5 E-Global x Lu4 - 1kk = $1.8 ElmoreLab x5 - 1kk = $1.7 DISCORD - GODDARDSHOP
    • 新品上线! 快来抢购最优质的 GMAIL 账号,享受 超低价格,注册年份范围从 2005–2022! 老版 Gmail.com 账号(已启用 2FA 双重验证) | 使用 MIX IP 注册 | 年份:2005 至 2022(可自行选择) | 账号可能包含邮件 | 格式:email:password:submail | 无需短信验证 | 已启用 IMAP | 附带 Submail | 价格起步:$0.9 我们还提供 Outlook、Firstmail、Rambler、Onet、Gazeta.pl、GMX、Yahoo、Proton、Web.de 等邮箱账号。 立即通过我们的网站或机器人购买! 活跃链接: 数字商品商店(网站):进入 商店 Telegram 机器人:进入 – 通过 Telegram 方便快捷地访问商店。 其他服务: Telegram Stars 购买机器人:进入 – 快速又实惠地购买 Telegram Stars。 SMM 面板:进入 – 推广您的社交媒体账号。 我们为您呈现当前 促销活动 与 特别优惠,适用于购买我们的商品和服务: 1. 优惠码 OCTOBER2025(8% 折扣)适用于九月在我们的商店(网站、机器人)购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获取 $1 商店余额或 10–20% 折扣 —— 注册后在我们网站的论坛贴中按照以下格式留言:"SEND ME BONUS, MY USERNAME IS..."。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在网站(Support)中创建名为 “Get Trial Bonus” 的支持工单。 4. 每周在我们的 Telegram 频道和 Stars 购买机器人中举行 Telegram Stars 抽奖活动! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
    • 新品上线! 快来抢购最优质的 GMAIL 账号,享受 超低价格,注册年份范围从 2005–2022! 老版 Gmail.com 账号(已启用 2FA 双重验证) | 使用 MIX IP 注册 | 年份:2005 至 2022(可自行选择) | 账号可能包含邮件 | 格式:email:password:submail | 无需短信验证 | 已启用 IMAP | 附带 Submail | 价格起步:$0.9 我们还提供 Outlook、Firstmail、Rambler、Onet、Gazeta.pl、GMX、Yahoo、Proton、Web.de 等邮箱账号。 立即通过我们的网站或机器人购买! 活跃链接: 数字商品商店(网站):进入 商店 Telegram 机器人:进入 – 通过 Telegram 方便快捷地访问商店。 其他服务: Telegram Stars 购买机器人:进入 – 快速又实惠地购买 Telegram Stars。 SMM 面板:进入 – 推广您的社交媒体账号。 我们为您呈现当前 促销活动 与 特别优惠,适用于购买我们的商品和服务: 1. 优惠码 OCTOBER2025(8% 折扣)适用于九月在我们的商店(网站、机器人)购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获取 $1 商店余额或 10–20% 折扣 —— 注册后在我们网站的论坛贴中按照以下格式留言:"SEND ME BONUS, MY USERNAME IS..."。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在网站(Support)中创建名为 “Get Trial Bonus” 的支持工单。 4. 每周在我们的 Telegram 频道和 Stars 购买机器人中举行 Telegram Stars 抽奖活动! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱: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