Jump to content
  • 0

[Help]Npc buffer probblem with script.


Question

Posted

Hello Mxc Members....

 

Well two days i am trying to fix the npc buffer i use .

Everything ok ,except Button "Heal" and "Cancel".

 

In the first page when you click on Npc buffer as .htm file for heal button and canel button is this :

 

<table>

<tr>

<td><button action="bypass -h Quest 60551_NPCBuffer 71" value="Heal" width=120 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>

<td><button action="bypass -h Quest 60551_NPCBuffer 71" value="Cancel Buffs" width=120 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>

<td></td>

</tr>

</table>

 

 

Now as about : scripts/custom/60551_NPCBuffer/_init_.py    :

 

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 = "60551_NPCBuffer"
NPCS=[60551]
ADENA_ID=57
QuestId     = 60551
QuestName   = "NPCBuffer"
QuestDesc   = "custom"

print "Loaded: Buffer by Myxoske [version 0.5]"

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 < 0 or st.getPlayer().getLevel() < 1 :
		htmltext = "<html><head><body>Come back later.<br></body></html>"
	else:
		st.takeItems(ADENA_ID,0)
		st.getPlayer().setTarget(st.getPlayer())

		if event == "1":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(4094,12).getEffects(st.getPlayer(),st.getPlayer())
			st.getPlayer().stopAllEffects()
			return "1.htm"
			st.setState(State.COMPLETED)

		if event == "71":
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(90001,1),False,False)
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(90002,1),False,False)
			st.getPlayer().useMagic(SkillTable.getInstance().getInfo(90003,1),False,False)
			return "1.htm"		
			st.setState(State.COMPLETED)

			if htmltext != event:
			st.setState(State.COMPLETED)
			st.exitQuest(1)
	return htmltext
      
def onTalk (self,npc,player):
	return "1.htm"

QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

for npcId in NPCS:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

 

 

 

and at stats/skills  i made a .xml file named Heal with the following :

 

 

 

<?xml version='1.0' encoding='utf-8'?>
<list>
<skill id="90001" levels="1" name="Mega CP Heal">
  <set name="mpConsume" val="0"/>
  <set name="power" val="65535"/>
  <set name="target" val="TARGET_SELF"/>
  <set name="hitTime" val="1"/>
  <set name="reuseDelay" val="1"/>
  <set name="skillType" val="COMBATPOINTHEAL"/>
  <set name="isMagic" val="true"/>
  <set name="operateType" val="OP_ACTIVE"/>
  <set name="castRange" val="-1"/>
</skill>
<skill id="90002" levels="1" name="Mega HP Heal">
  <set name="mpConsume" val="0"/>
  <set name="power" val="65535"/>
  <set name="target" val="TARGET_SELF"/>
  <set name="reuseDelay" val="1"/>
  <set name="hitTime" val="1"/>
  <set name="skillType" val="HEAL"/>
  <set name="isMagic" val="true"/>
  <set name="operateType" val="OP_ACTIVE"/>
  <set name="castRange" val="-1"/>
</skill>
<skill id="90003" levels="1" name="Mega MP Heal">
  <set name="mpConsume" val="0"/>
  <set name="power" val="65535"/>
  <set name="target" val="TARGET_SELF"/>
  <set name="reuseDelay" val="1"/>
  <set name="hitTime" val="1"/>
  <set name="skillType" val="MANARECHARGE"/>
  <set name="isMagic" val="true"/>
  <set name="operateType" val="OP_ACTIVE"/>
  <set name="castRange" val="-1"/>
</skill>
</list>

 

 

 

 

But when i click at Heal and at Cancle button ingame,nothing happened.What i am doing wrong?

Plz help me,i can't any more this shit :/

 

 

Recommended Posts

  • 0
Posted

Try This


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 = "60551_NPCBuffer"
NPCS=[60551]
ADENA_ID=57
QuestId     = 60551
QuestName   = "NPCBuffer"
QuestDesc   = "custom"

print "Loaded: Buffer"

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 < 0 or st.getPlayer().getLevel() < 1 :
		htmltext = "<html><head><body>Come back later.<br></body></html>"
	else:
		st.takeItems(ADENA_ID,0)
		st.getPlayer().setTarget(st.getPlayer())

		if event == "100":
			st.getPlayer().stopAllEffects()
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

		if event == "101":
			st.getPlayer().restoreHPMP()
			return "1.htm"
			st.setState(COMPLETED)

			if htmltext != event:
			st.setState(State.COMPLETED)
			st.exitQuest(1)
	return htmltext
      
def onTalk (self,npc,player):
   st = player.getQuestState(qn)
   htmltext = "<html><head><body><center>ERROR<br1>Please, contact the administrator.</center></body></html>"
   st.setState(State.STARTED)
   return InitialHtml

QUEST		= Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

for npcId in NPCS:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)


 

 

  • 0
Posted

No again nothing.....aff i cant believe it....it is annoying this.

 

Can someone use remote assistance with me to see whats wrong.Pm me :/

  • 0
Posted

This must work

 

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

NPC=[60551]
QuestId     = 60551
QuestName   = "NPCBuffer"
QuestDesc   = "custom"
InitialHtml = "Npcbuffer.htm"

print "Loaded: Buffer"

class Quest (JQuest) :

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


def onEvent(self,event,st):
	htmltext = event



	if event == "100":
		st.getPlayer().restoreHPMP()
		return "Npcbuffer.htm"
		st.setState(COMPLETED)


	if event == "101":
		st.getPlayer().stopAllEffects()
		st.getPlayer().restoreHPMP()
		return "Npcbuffer.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><center>ERROR<br1>Please, contact the administrator.</center></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)

  • 0
Posted

OMG Still nothing....

 

Lol dont pass me for idiot :/ ..

I show you my files and what all of you tell me that i did,nothing else. :(

I am desperate

  • 0
Posted

jeeez you guys always can show me something i never seen before...how your stupid script supposed to read the button when you have it in the mods html folder ohh my god how stupid can some guy be...

 

1st you need a htm in the default folder linking to your script

2nd your script call a main htm window with the action buttons

3rd you click on the action and done

 

seriously guys that made my day i going to laugh for weeks on this...

  • 0
Posted

1st you need a htm in the default folder linking to your script

2nd your script call a main htm window with the action buttons

3rd you click on the action and done

 

The 1st i understand it,but then what you mean with action buttons?you mean ingame right?

 

  • 0
Posted

The 1st i understand it,but then what you mean with action buttons?you mean ingame right?

 

 

read a how to make a buffer guide and you will understand it

  • 0
Posted

Man, i read a guide for making a buffer but i didnt find anywhere about "action buttons".So,you mean for ingame buttons or smth else?

Or at least give me this link you have in your mind.

It's not first time i add buffer,but just this time i can't configure what's wrong.

  • 0
Posted

Man, i read a guide for making a buffer but i didnt find anywhere action buttons.So,you mean for ingame buttons or smth else?

Or at least give me this link you have in your mind.

It's not first time i add buffer,but just this time i can't configure what's wrong.

 

okay than i try to explain(still its a huge failure of all of you you guys never learn + google skills = 0)

 

when you add a python buffer you have a html in the default folder(for noobs named with the ID of the npc you have in sql)this html have a link which is start the script, than the script starts and the scripts(in this case buffer)html pop up here you have your buttons used in the scripts

 

crystal clear?

  • 0
Posted

No...Nothing just the chat window of NpcBuffer dissapear... Damn i hate this!!!

Try thisss !! <<

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

 

NPC=[60551]

ADENA_ID=57

QuestId     = 60551

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 < 0 or st.getPlayer().getLevel() < 1 :

htmltext = "Come back later."

else:

st.takeItems(ADENA_ID,0)

st.getPlayer().setTarget(st.getPlayer())

 

#MPHPCPreg

if event == "1":

st.takeItems(ADENA_ID,0)

st.getPlayer().setCurrentHp(st.getPlayer().getMaxHp())

st.getPlayer().setCurrentMp(st.getPlayer().getMaxMp())

st.getPlayer().setCurrentCp(st.getPlayer().getMaxCp())

return "1.htm"

st.setState(COMPLETED)

 

#CANCEL BUFF

if event == "2":

st.takeItems(ADENA_ID,0)

st.getPlayer().stopAllEffects()

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)

Guest
This topic is now closed to further replies.



  • Posts

    • For the first time in thousands of posts I've read on this forum, I’ve actually found a message that is enriching on both a personal and professional level. I’ll take your advice to heart: I’m going to start creating more and stop overthinking things that get me nowhere. I totally agree about the toxic community; it's a shame. Time to keep working. Thanks a lot for your input.   Exactly, that’s why the Scryde method and their merge system work so well. People don't lose their progress and can still keep rushing new servers. Obviously, gameplay has mutated into something much faster-paced, but obviously, this happens in real life too, everyone is more accelerated and on edge. Thanks to social media and mental conditioning. But, well, it’s something we have to accept. Don't even get me started on gambling and online casinos; that’s a whole other topic regarding all the P2W servers.   Really, amen bro.
    • Hello, the server lifespan isn't something that only affects Argentina; just look at the South American and European communities. Those distant days you mentioned, when we were younger, which I completely agree with, are long gone. Today, the community plays RUSH for 30 or 60 days and seeks the adrenaline rush of starting over. As for free or paid packs, there are many options, but in all of them, you'll have to create your own unique style.  
    • Introducing: NimeraCP V2! What's New: Realtime Tickets (Receive + Send messages without refreshing page, instant delivery to player) Powered by WebSockets Realtime Rankings/Stats (Receive instant updates without refreshing page) Powered by WebSockets - PvP/Boss Rankings/Clan Rankings etc... oAuth Login + Register (VK, Discord, Google) Two Factor Authentication (Authenticator App) Passkey coming soon! Theme Editor New Arcade Game: Rock Paper Scissors Let players gamble wagering their topped up wallet balance! Discord Webhooks: Receive messages to discord via Bot or Webhook for certain events New Player registration New Payment received New Ticket Opened and more Complete UI Overhaul NimeracCP V2 is now fully multilangual supporting the following languages: English Ελληνικά Português / Brasileiro Español Русский Українська 한국어 Onboarding: Easy installation wizard via /onboarding on first use of the panel for easy installation. Feature Flags: You have full control over the UI. Disable/Enable pages + features via Admin CP CloudFlare R2 Bucket integration: The panel comes with Bucket storage integration for all kinds of assets uploaded to the panel.   A new website shop at https://nimeracp.com/ is also coming soon, including full installation docs.  You can join the discord for further updates/questions: https://discord.nimeracp.com/
    • thanks for choosing me ! 
  • 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..

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