Jump to content
  • 0

My buffer can't heal .. why ?


Question

Posted

Hello guys . I downloaded a buffer from here in forum and i have this problem.... Buffer can use CpRestore to heal CP but HpRestore to heal Hp doesn't work!!! :(

 

Here is my code in _init_.py from my buffer :

 

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

qn = "20701_NPCBuffer"

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

print "============> Buffer Free: LOADED"

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>Voce nao tem Adena,<br> Ou esta com level muito baixo. Tem que ter level 40 ou mais.</body></html>"
	else:
		st.takeItems(ADENA_ID,0)
		st.getPlayer().setTarget(st.getPlayer())

		if event == "2":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().stopAllEffects()
			SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4345,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4352,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4354,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4360,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4358,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4357,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4359,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1032,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1397,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(267,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(269,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(271,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(274,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(275,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(310,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1363,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1323,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)

		if event == "3": 
			st.takeItems(ADENA_ID,0)
			st.getPlayer().stopAllEffects()
			SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4353,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4355,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4356,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4352,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1303,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1397,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1044,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4351,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(267,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(269,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(273,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(276,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(365,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1413,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1323,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)

		if event == "4":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().stopAllEffects()
			SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4345,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4352,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4354,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4360,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4358,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4357,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4359,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1032,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1397,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(267,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(269,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(271,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(274,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(275,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(310,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1363,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1323,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)
                        
		if event == "5":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().stopAllEffects()
			SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4345,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1388,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4352,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4360,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4358,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4357,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4359,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1032,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1397,3).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(267,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(269,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(271,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(274,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(275,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1363,1).getEffects(st.getPlayer(),st.getPlayer())
			SkillTable.getInstance().getInfo(1323,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"			
			st.setState(COMPLETED)

		if event == "6":
			st.takeItems(ADENA_ID,0)
			return "1.htm"		
			st.setState(COMPLETED)

		#Wind Walk
		if event == "7":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"		
			st.setState(COMPLETED)
                                                
                        #Gift of Seraphim
		if event == "97":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(4703,3).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)
                        
                        #Chant of Spirit
		if event == "65":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(1362,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)

		#Chant of Victory
		if event == "66":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(1363,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)

		#chant of magnus
		if event == "67":
			st.takeItems(ADENA_ID,0)
			SkillTable.getInstance().getInfo(1413,1).getEffects(st.getPlayer(),st.getPlayer())
			return "1.htm"
			st.setState(COMPLETED)	

		#Cancel
		if event == "98": 
			st.getPlayer().stopAllEffects()
			return "1.htm"
			st.setState(COMPLETED)

		#CPHEAL
		if event == "69":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().restoreCP()
			return "1.htm"		
			st.setState(COMPLETED)	
                        
            #Restore CP
		if event == "100":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().restoreCP()
			return "1.htm"
			st.setState(State.COMPLETED)	

            #Restore HP
		if event == "101":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().restoreHP()
			return "1.htm"
			st.setState(State.COMPLETED)

            #Restore MP
		if event == "102":
			st.takeItems(ADENA_ID,0)
			st.getPlayer().restoreMP()
			return "1.htm"
			st.setState(State.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)

 

Any ideas ?

 

EDIT : cp,hp,mp restore skills are at the end of the file :P I tell that so you dont need to search :P

 

 

 

 

NOTE : I deleted some buffs from the code i posted because the message was above 25000 characters and i couldnt post it -.-

5 answers to this question

Recommended Posts

  • 0
Posted

Make sure that the if event number is correct for your heal - check htm. If it's fine try below.

 

Replace this line

 

st.getPlayer().restoreHP()

 

to

 

st.getPlayer().getMaxHp()

  • 0
Posted

Make sure that the if event number is correct for your heal - check htm. If it's fine try below.

 

Replace this line

 

st.getPlayer().restoreHP()

 

to

 

st.getPlayer().getMaxHp()

 

Still nothing :( By the way it is an Interlude server with l2jfrozen pack

 

  • 0
Posted

Make sure that the if event number is correct for your heal - check htm. If it's fine try below.

 

Replace this line

 

st.getPlayer().restoreHP()

 

to

 

st.getPlayer().getMaxHp()

 

LOL not like that....

it should be

 

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

 

setCurrentCp/setCurrentMp

Guest
This topic is now closed to further replies.


×
×
  • Create New...