Jump to content

Question

Posted

hello how can i make this buffer not to heal dead players and players when they are in combat?

 

here is the script

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

NPC=[9999]
ADENA_ID=57
QuestId     = 9999
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 = "<html><head><body>You dont have enough Adena,<br> or your level is too low. You must be 40 or higher.</body></html>"
		else:
			st.takeItems(ADENA_ID,0)
			st.getPlayer().setTarget(st.getPlayer())
			
			#Wind Walk
			if event == "2":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5242,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Decrease Weight
			if event == "3":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5217,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Shield
			if event == "4":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5238,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Might
			if event == "5":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5231,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Mental Shield
			if event == "6":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5230,4).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Bless the Body
			if event == "7":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5212,6).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Bless the Soul
			if event == "8":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5213,6).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Magic Barrier
			if event == "9":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5229,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Concentration
			if event == "10":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5215,6).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Berserker Spirit
			if event == "11":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5210,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Bless Shield
			if event == "12":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5211,6).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Vampiric Rage
			if event == "13":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5240,4).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Acumen
			if event == "14":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5206,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Empower
			if event == "15":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5220,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

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

			#Guidance
			if event == "17":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5224,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Focus
			if event == "18":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5221,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Death Whisper
			if event == "19":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5216,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

            #Agility
			if event == "20":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5208,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)	
                                                
            #Clarity
			if event == "21":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5214,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)	
                                                
            #Advanced Block
			if event == "22":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5207,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)	
                                                
			#Kiss of Eva
			if event == "23":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5228,2).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)	
                                                
            #Greater Shield
			if event == "24":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5223,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)	
                                               
            #Wild Magic
			if event == "25":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5241,1).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"
				st.setState(COMPLETED)

			#Regeneration
			if event == "26":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5232,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Holy Weapon
			if event == "27":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5227,1).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Greather Might
			if event == "28":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5222,3).getEffects(st.getPlayer(),st.getPlayer())
				return "2.htm"		
				st.setState(COMPLETED)

			#Chant of battle
			if event == "30":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5270,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Shielding
			if event == "31":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5281,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Fire
			if event == "32":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5274,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Flame
			if event == "33":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5275,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Fury
			if event == "34":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5276,2).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Evasion
			if event == "35":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5273,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Rage
			if event == "36":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5279,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Revenge
			if event == "37":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5280,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Vampire
			if event == "38":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5283,4).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Eagle
			if event == "39":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5271,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Predator
			if event == "40":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5278,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of Spirit
			if event == "41":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5282,1).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

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

			#Chant of Magnus
			if event == "43":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5277,1).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#War Chant
			if event == "44":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5284,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Earth Chant
			if event == "45":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5272,3).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Chant of life
			if event == "46":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5305,1).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Body Avatar
			if event == "47":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5306,6).getEffects(st.getPlayer(),st.getPlayer())
				return "3.htm"		
				st.setState(COMPLETED)

			#Profecy of Fire
			if event == "48":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5285,1).getEffects(st.getPlayer(),st.getPlayer())
				return "4.htm"		
				st.setState(COMPLETED)

			#Profecy of Wather
			if event == "49":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5286,1).getEffects(st.getPlayer(),st.getPlayer())
				return "4.htm"		
				st.setState(COMPLETED)

			#profecy of Wind
			if event == "50":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5287,1).getEffects(st.getPlayer(),st.getPlayer())
				return "4.htm"		
				st.setState(COMPLETED)

			#Blessing of Queen
			if event == "51":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5300,3).getEffects(st.getPlayer(),st.getPlayer())
				return "5.htm"		
				st.setState(COMPLETED)

			#Blessing of Seraphim
			if event == "52":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5301,3).getEffects(st.getPlayer(),st.getPlayer())
				return "5.htm"		
				st.setState(COMPLETED)

			#Gifth Queen
			if event == "53":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5302,3).getEffects(st.getPlayer(),st.getPlayer())
				return "5.htm"		
				st.setState(COMPLETED)

			#Gifth Seraphim
			if event == "54":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5303,3).getEffects(st.getPlayer(),st.getPlayer())
				return "5.htm"		
				st.setState(COMPLETED)

			#Holy Resistance
			if event == "55":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5226,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Unholy Resistance
			if event == "56":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5239,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Resist Aqua
			if event == "57":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5233,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Resist Wind
			if event == "58":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5235,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Resist Fire
			if event == "59":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5234,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Resist Poison
			if event == "60":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5236,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Elemetal Protection
			if event == "61":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5219,1).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Arcane Protection
			if event == "62":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5209,1).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Divine Protection
			if event == "63":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5218,1).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Invigor
			if event == "64":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5307,3).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Resist Shock
			if event == "65":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5237,4).getEffects(st.getPlayer(),st.getPlayer())
				return "6.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Gifth
			if event == "66":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5292,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Blessing
			if event == "67":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5289,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Glory
			if event == "68":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5293,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Tact
			if event == "69":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5297,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Wisdom
			if event == "70":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5308,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Protection
			if event == "71":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5304,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Rage
			if event == "72":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5295,2).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Vision
			if event == "73":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5299,3).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Haste
			if event == "74":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5294,2).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Eye
			if event == "75":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5291,1).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Soul
			if event == "76":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5296,1).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Emblem
			if event == "77":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5290,1).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Fist
			if event == "78":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5288,1).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Pa'agrio Victory
			if event == "79":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5298,1).getEffects(st.getPlayer(),st.getPlayer())
				return "7.htm"		
				st.setState(COMPLETED)

			#Dance of Warrior
			if event == "80":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5243,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Inspiration
			if event == "81":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5249,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Mystic
			if event == "82":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5251,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Fire
			if event == "83":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5247,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Fury
			if event == "84":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5248,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Concentration
			if event == "85":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5245,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Light
			if event == "86":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5250,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Aqua Guard
			if event == "87":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5244,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Earth Guard
			if event == "88":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5246,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Vampire
			if event == "89":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5254,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Dance of Protection
			if event == "90":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5252,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Siren's Dance 
			if event == "91":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5253,1).getEffects(st.getPlayer(),st.getPlayer())
				return "8.htm"		
				st.setState(COMPLETED)

			#Song of Earth
			if event == "93":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5255,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Life
			if event == "94":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5260,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Water
			if event == "95":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5267,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Warding
			if event == "96":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5266,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Wind
			if event == "97":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5268,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Hunter
			if event == "98":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5258,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Invocation
			if event == "99":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5259,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Vitality
			if event == "100":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5265,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Vengeance
			if event == "101":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5264,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Flame Guard
			if event == "102":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5257,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Storm Guard
			if event == "103":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5263,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Meditation
			if event == "104":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5261,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Champion
			if event == "105":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5256,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Song of Renewal
			if event == "106":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(5262,1).getEffects(st.getPlayer(),st.getPlayer())
				return "9.htm"		
				st.setState(COMPLETED)

			#Fighter Buffers
			if event == "107":
				st.takeItems(ADENA_ID,0)
				st.getPlayer().stopAllEffects()
				SkillTable.getInstance().getInfo(5242,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5231,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5230,4).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5229,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5238,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5240,4).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5225,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5224,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5222,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5216,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5212,6).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5292,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5210,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5208,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5269,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5280,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5288,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5221,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5237,4).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5243,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5247,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5248,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5249,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5252,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5254,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5255,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5258,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5256,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5262,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5264,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5265,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5266,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5267,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5268,1).getEffects(st.getPlayer(),st.getPlayer())
				return "1.htm"
				st.setState(COMPLETED)

			#Mage Buffers
			if event == "108":
				st.takeItems(ADENA_ID,0)
				st.getPlayer().stopAllEffects()
				SkillTable.getInstance().getInfo(5242,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5238,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5230,4).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5212,6).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5213,6).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5229,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5215,6).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5210,2).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5211,6).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5206,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5220,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5214,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5207,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5223,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5241,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5277,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5280,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5237,4).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5292,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5303,3).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5255,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5266,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5265,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5264,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5256,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5263,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5261,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5268,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5251,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5245,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5253,1).getEffects(st.getPlayer(),st.getPlayer())
				SkillTable.getInstance().getInfo(5250,1).getEffects(st.getPlayer(),st.getPlayer())
				return "1.htm"			
				st.setState(COMPLETED)

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

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

                        #Noblesse Blessing
			if event == "111":
				st.takeItems(ADENA_ID,0)
				SkillTable.getInstance().getInfo(1323,1).getEffects(st.getPlayer(),st.getPlayer())
				return "1.htm"
				st.setState(COMPLETED)	

            #Restore CP/HP/MP
			if event == "115":
			st.takeItems(ADENA_ID,0)
				st.getPlayer().setCurrentCp(st.getPlayer().getMaxCp())
				st.getPlayer().setCurrentHp(st.getPlayer().getMaxHp())
				st.getPlayer().setCurrentMp(st.getPlayer().getMaxMp())
				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)

5 answers to this question

Recommended Posts

  • 0
Posted
                if count < 0  or st.getPlayer().getLevel() < 1 :
			htmltext = "<html><head><body>You dont have enough Adena,<br> or your level is too low. You must be 40 or higher.</body></html>"
		else if st.getPlayer().isDead():
                        htmltext = "<html><head><body>You can't use buffer while you are dead.</body></html>"
                else:
			st.takeItems(ADENA_ID,0)
			st.getPlayer().setTarget(st.getPlayer())

Something like that

  • 0
Posted

Yeah because I just guessed st.getPlayer().isDead(),I have no idea if such even exists,search for something alike or maybe st.getPlayer().getCurrentHP() == 0 or something alike.Also I've never used Python but looking at the code you gave,I believe that the syntax is all right.

  • 0
Posted

Just move your buffer to java and make it example L2BufferInstance, it will be easier and better.
And your buffer is really hardcoded. Right now you can find a lot of buffers maded for various l2j packs, just search ;)

  • 0
Posted

like this?

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jfrozen.gameserver.powerpak.Buffer;

import java.util.ArrayList;
import java.util.logging.Logger;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Object;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.powerpak.Buffer.BuffTable.Buff;

public class L2BufferInstance
{
	static L2PcInstance selfBuffer;
	static L2NpcInstance npcBuffer;
	
	/**
	 * Apply Buffs onto a player.
	 * @param player
	 * @param _templateId
	 * @param efector
	 * @param paymentRequired
	 */
	public static void makeBuffs(L2PcInstance player, int _templateId, L2Object efector, boolean paymentRequired)
	{
		if (player == null)
		{
			return;
		}
		
		L2NpcInstance buffer = null;
		if (player.getTarget() != null)
		{
			if (player.getTarget() instanceof L2NpcInstance)
			{
				buffer = (L2NpcInstance) getbufferType(efector);
			}
		}
		
		if (buffer == null)
		{
			return;
		}
		
		buffer.setTarget(player);
		
		ArrayList<Buff> _templateBuffs = new ArrayList<Buff>();
		_templateBuffs = BuffTable.getInstance().getBuffsForID(_templateId);
		if ((_templateBuffs == null) || (_templateBuffs.size() == 0))
		{
			return;
		}
		int _priceTotal = 0;
		for (Buff _buff : _templateBuffs)
		{
			if (paymentRequired)
			{
				if (!_buff.checkPrice(player))
				{
					player.sendMessage("Not enough Adena");
					return;
				}
				_priceTotal += _buff._price;
			}
			
			if (_buff._force || (player.getFirstEffect(_buff._skill) == null))
			{
				buffer.setBusy(true);
				buffer.setCurrentMp(buffer.getMaxMp());
				buffer.setTarget(player);
				buffer.doCast(_buff._skill);
				buffer.setBusy(false);
			}
			else
			{
				_buff._skill.getEffects(player, player, false, false, false);
			}
			
		}
		if (paymentRequired && (_priceTotal > 0))
		{
			player.reduceAdena("NpcBuffer", _priceTotal, player.getLastFolkNPC(), true);
		}
	}
	
	private static L2Character getbufferType(L2Object efector)
	{
		if (efector instanceof L2PcInstance)
		{
			selfBuffer = (L2PcInstance) efector;
			efector = selfBuffer;
		}
		if (efector instanceof L2NpcInstance)
		{
			npcBuffer = (L2NpcInstance) efector;
			efector = npcBuffer;
		}
		return (L2Character) efector;
	}
	
	static Logger _log = Logger.getLogger(Config.class.getName());
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...