Jump to content
  • 0

One more problem


WhyIsLife
 Share

Question

Mporei kapios na mou simplirwsei afto????

import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from net.sf.l2j.gameserver             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

NPC=[1234]
ADENA_ID=57
MIN_LEVEL=1
QuestId     = 999
QuestName   = "Buffer"
QuestDesc   = "quest"
InitialHtml = "7180.htm"
print "importing " + "quest" + ": " + str(999) + ": " + "Buffer" + ": " + "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(57)
  level=st.getPlayer().getLevel()                
  if count < 200000 and level  < 1 :
   htmltext = "<html><head><body>You dont have enough adena or your level is lower than st.getPlayer().getLevel().</body></html>"
  else:
   st.getPlayer().setTarget(st.getPlayer())

	#Chant of Battle
	if event == "1":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1007,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Shielding
	if event == "2":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1009,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Fire
	if event == "3":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1006,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Flame
	if event == "4":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1002,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Life
	if event == "5":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1229,18),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Fury
	if event == "6":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1251,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Evasion
	if event == "7":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1252,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Rage
	if event == "8":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1253,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Revenge
	if event == "9":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1284,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Vampire
	if event == "10":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1310,4),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Eagle
	if event == "11":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1309,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Predator
	if event == "12":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1308,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Spirit
	if event == "13":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1362,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Chant of Victory
	if event == "14":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1363,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-chants.htm"
		st.setState(COMPLETED)

	#Song of Earth
	if event == "15":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(264,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Life
	if event == "16":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(265,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Water
	if event == "17":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(266,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Warding
	if event == "18":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(267,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Wind
	if event == "19":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(268,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Hunter
	if event == "20":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(269,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Invocation
	if event == "21":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(270,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Meditation
	if event == "22":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(363,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Renewal
	if event == "23":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(349,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Champion
	if event == "24":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(364,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Vitality
	if event == "25":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(304,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Vengeance
	if event == "26":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(305,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Flame Guard
	if event == "27":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(306,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Song of Storm Guard
	if event == "28":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(308,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-songs.htm"
		st.setState(COMPLETED)

	#Shield
	if event == "29":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1040,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Might
	if event == "30":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1068,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Bless Shield
	if event == "31":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1243,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Guidance
	if event == "32":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1240,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Bless the Body
	if event == "33":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1045,6),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Bless the Soul
	if event == "34":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1048,6),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Focus
	if event == "35":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1077,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Magic Barrier
	if event == "36":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1036,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Berserker Spirit
	if event == "37":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1062,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Regeneration
	if event == "38":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1044,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Mental Shield
	if event == "39":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1035,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Greater Empower
	if event == "40":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1059,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Death Whisper
	if event == "41":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1242,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Greater Concentration
	if event == "42":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1078,6),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Haste
	if event == "43":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1086,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Greater Acumen
	if event == "44":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1085,3),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Wind Walk
	if event == "45":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1204,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Wild Magic
	if event == "46":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1303,2),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Arcane Protection
	if event == "47":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1354,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Body of Avatar
	if event == "48":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1311,6),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Prophecy of Fire
	if event == "49":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1356,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Prophecy of Water
	if event == "50":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1355,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Prophecy of Wind
	if event == "51":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1357,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-buffs.htm"
		st.setState(COMPLETED)

	#Dance of Warrior
	if event == "52":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(271,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Inspiration
	if event == "53":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(272,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Mystic
	if event == "54":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(273,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Fire
	if event == "55":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(274,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Fury
	if event == "56":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(275,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Concentration
	if event == "57":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(276,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Light
	if event == "58":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(277,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Aqua Guard
	if event == "59":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(307,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Earth Guard
	if event == "60":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(309,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Vampire
	if event == "61":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(310,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

	#Dance of Protection
	if event == "62":		
		st.getPlayer().useMagic(SkillTable.getInstance().getInfo(311,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-dance.htm"
		st.setState(COMPLETED)

                #Recover my CP
	if event == "63":		
                        st.getPlayer().useMagic(SkillTable.getInstance().getInfo(10001,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,100000)
		return "7180-CP.htm"
		st.setState(COMPLETED)

                #Blessing of Noblesse
	if event == "64":		
                        st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1323,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-CP.htm"
		st.setState(COMPLETED)

                #Greater Might
	if event == "65":		
                        st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1388,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-CP.htm"
		st.setState(COMPLETED)

                #Greater Sheild
	if event == "66":		
                        st.getPlayer().useMagic(SkillTable.getInstance().getInfo(1389,1),False,False)
                        st.getPlayer().restoreHPMP()
		st.takeItems(57,1000000)
		return "7180-CP.htm"
		st.setState(COMPLETED)








   if htmltext != event:
    st.setState(COMPLETED)
    st.exitQuest(1)
  return htmltext

        def onTalk (self,npc,st):
    htmltext = "<html><head><body>I have nothing to say to you</body></html>"
    st.setState(STARTED)
           return "7180.htm"

QUEST       = Quest(997,str(997) + "_" + "Buffer","quest")
CREATED=State('Start',QUEST)
STARTED=State('Started',QUEST)
COMPLETED=State('Completed',QUEST)

QUEST.setInitialState(CREATED)
for npcId in NPC:
QUEST.addStartNpc(7180)
STARTED.addTalkId(7180)
print "...done"

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share



×
×
  • 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