Jump to content
  • 0

[HELP]PailakaDevilsLegacy


Question

Posted

It missing from reward for the vitality lvl 4...

 

# author - RosT

import sys

from com.l2jserver.gameserver.model.actor.instance  import L2PcInstance

from com.l2jserver.gameserver.instancemanager       import InstanceManager

from com.l2jserver.gameserver.model.entity         import Instance

from com.l2jserver.gameserver.model.quest           import State

from com.l2jserver.gameserver.model.quest           import QuestState

from com.l2jserver.gameserver.model.quest.jython    import QuestJython as JQuest

from com.l2jserver.gameserver.network.serverpackets import PlaySound

 

qn = "129_PailakaDevilsLegacy"

 

#NPC

DISURVIVOR   = 32498

SUPPORTER    = 32501

DADVENTURER  = 32508

DADVENTURER2 = 32511

Pailaka2nd   = [18623,18624,18625,18626,18627]

CHEST        = 32495

#BOSS

KAMS    = 18629

HIKORO  = 18630

ALKASO  = 18631

GERBERA = 18632

LEMATAN = 18633

#ITEMS

SWORD     = 13042

ENCHSWORD = 13043

LASTSWORD = 13044

KDROP     = 13046

ADROP     = 13047

HERBS     = [8601,8602,8604,8605]

CHESTDROP = [13033,13048,13049,13059]

#REWARDS

PBRACELET = 13295

PERING    = 13293

 

AMOUNTS1  = [1,2]

AMOUNTS2  = [1,2,3,4,5,6,7,8,9,10]

 

def isWithinLevel(player):

if player.getLevel() > 67:

return False

if player.getLevel() < 61:

return False

return True

 

class Quest (JQuest):

 

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

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

    self.questItemIds = [KDROP,ADROP,SWORD,ENCHSWORD,LASTSWORD,13033,13032,13048,13049,13059,13150]

    self.currentWorld = 0

 

def onEvent (self,event,st):

    cond = st.getInt("cond")

    htmltext = event

    if event == "32498-02.htm":

    st.set("cond","1")

    st.setState(State.STARTED)

    st.playSound("ItemSound.quest_accept")

    if event == "32498-05.htm":

    st.set("cond","2")

    st.playSound("ItemSound.quest_accept")

    if event == "32501-03.htm":

st.set("cond","3")

st.playSound("ItemSound.quest_middle")

st.giveItems(SWORD,1)

    return htmltext

 

 

def onTalk (self,npc,player):

    npcId = npc.getNpcId()

    htmltext = "32498-01.htm"

    st = player.getQuestState(qn)

    if not st: return htmltext

    id = st.getState()

    cond = st.getInt("cond")

    if id == State.CREATED:

        st.set("cond","0")

    if npcId == DISURVIVOR:

    if cond == 0:

    if not isWithinLevel(player):

    htmltext = "32498-no.htm"

    st.exitQuest(1)

    else:

    return htmltext

    elif id == State.COMPLETED:

    htmltext = "32498-no.htm"

    elif cond == 1 or cond == 2:

    htmltext = "32498-06.htm"

    else:

    htmltext = "32498-07.htm"

    elif npcId == SUPPORTER:

    if cond == 1 or cond == 2:

    htmltext = "32501-01.htm"

    else:

    htmltext = "32501-04.htm"

    elif npcId == DADVENTURER:

    if st.getQuestItemsCount(SWORD) > 0 and st.getQuestItemsCount(KDROP) == 0: htmltext = "32508-01.htm"

    if st.getQuestItemsCount(ENCHSWORD) > 0 and st.getQuestItemsCount(ADROP) == 0: htmltext = "32508-01.htm"

    if st.getQuestItemsCount(SWORD) == 0 and st.getQuestItemsCount(KDROP) > 0: htmltext = "32508-05.htm"

    if st.getQuestItemsCount(ENCHSWORD) == 0 and st.getQuestItemsCount(ADROP) > 0: htmltext = "32508-05.htm"

    if st.getQuestItemsCount(SWORD) == 0 and st.getQuestItemsCount(ENCHSWORD) == 0: htmltext = "32508-05.htm"

    if st.getQuestItemsCount(KDROP) == 0 and st.getQuestItemsCount(ADROP) == 0: htmltext = "32508-01.htm"

    if player.getPet() != None: htmltext = "32508-04.htm"

    if st.getQuestItemsCount(SWORD) > 0 and st.getQuestItemsCount(KDROP) > 0:

    st.takeItems(SWORD,1)

    st.takeItems(KDROP,1)

    st.giveItems(ENCHSWORD,1)

    htmltext = "32508-02.htm"

    if st.getQuestItemsCount(ENCHSWORD) > 0 and st.getQuestItemsCount(ADROP) > 0:

    st.takeItems(ENCHSWORD,1)

    st.takeItems(ADROP,1)

    st.giveItems(LASTSWORD,1)

    htmltext = "32508-03.htm"

    if st.getQuestItemsCount(LASTSWORD) > 0: htmltext = "32508-03.htm"

    elif npcId == DADVENTURER2:

    if cond == 4:

    if player.getPet() != None:

    htmltext = "32511-03.htm"

    elif player.getPet() == None:

    st.takeItems(SWORD,st.getQuestItemsCount(SWORD))

    st.takeItems(ENCHSWORD,st.getQuestItemsCount(ENCHSWORD))

    st.takeItems(LASTSWORD,st.getQuestItemsCount(LASTSWORD))

    st.giveItems(736,1)

    st.takeItems(13033,st.getQuestItemsCount(13033))

    st.takeItems(13048,st.getQuestItemsCount(13048))

    st.takeItems(13049,st.getQuestItemsCount(13049))

    st.takeItems(13059,st.getQuestItemsCount(13059))

    st.giveItems(PBRACELET,1)

    st.addRewardExpAndSp(10810000, 950000)

    st.set("cond","5")

    st.setState(State.COMPLETED)

    st.playSound("ItemSound.quest_finish")

    st.exitQuest(False)

    instanceObj = InstanceManager.getInstance().getInstance(player.getInstanceId())

    instanceObj.setDuration(300000)

    htmltext = "32511-01.htm"

    player.getVitalityManagement().setVitalityPoints(20000,true)

    elif id == State.COMPLETED:

    htmltext = "32511-02.htm"

    return htmltext

 

def onKill(self,npc,player,isPet):

    st = player.getQuestState(qn)

    if not st: return

    npcId = npc.getNpcId()

    cond = st.getInt("cond")

    if npcId == KAMS and st.getQuestItemsCount(KDROP) == 0:

    st.giveItems(KDROP,1)

    elif npcId == ALKASO and st.getQuestItemsCount(ADROP) == 0:

    st.giveItems(ADROP,1)

    elif npcId == LEMATAN:

    st.set("cond","4")

    st.playSound("ItemSound.quest_middle")

    Dwarf = self.addSpawn(DADVENTURER2,84990,-208376,-3342,55000,False,0,False,npc.getInstanceId())

    elif npcId in Pailaka2nd:

    if st.getRandom(100) < 80:

    st.dropItem(npc,player,HERBS[st.getRandom(len(HERBS))],AMOUNTS1[st.getRandom(len(AMOUNTS1))])

    elif npcId == CHEST:

    if st.getRandom(100) < 80:

    st.dropItem(npc,player,CHESTDROP[st.getRandom(len(CHESTDROP))],AMOUNTS2[st.getRandom(len(AMOUNTS2))])

    else:

    st.dropItem(npc,player,13150,1)

 

QUEST       = Quest(129,qn,"Pailaka Devil's Legacy")

 

QUEST.addStartNpc(DISURVIVOR)

QUEST.addTalkId(DISURVIVOR)

QUEST.addTalkId(SUPPORTER )

QUEST.addTalkId(DADVENTURER)

QUEST.addTalkId(DADVENTURER2)

QUEST.addKillId(KAMS)

QUEST.addKillId(ALKASO)

QUEST.addKillId(LEMATAN)

QUEST.addKillId(CHEST)

for i in Pailaka2nd:

   QUEST.addKillId(i)

2 answers to this question

Recommended Posts

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...