A Project for Chronicle 4 based on L2JServer.


    Quest-501 Proof Of Clan Alliance

    Share
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 2nd November 2014, 16:48

    This quest get error:


    Traceback (innermost last):
    (no code object) at line 0
    SyntaxError: ('invalid syntax', ('__init__.py', 275, 20, ' if timer != None : timer.cancel()'))
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Quest-501 Proof Of Clan Alliance

    Post  Karakan on 3rd November 2014, 18:26

    If you post the .py file of that quest.
    We can help you better Smile
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 3rd November 2014, 19:03

    # Made by QuestDevs Team: DraX, DrLecter, Rolarga
    # With invaluable support from: [TI]Blue, warrax
    # v0.1.r0 2005.12.05

    import sys
    from java.util import Iterator
    from net.sf.l2j.gameserver.datatables import SkillTable
    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
    from net.sf.l2j.gameserver.serverpackets import CreatureSay

    qn="501_ProofOfClanAlliance"
    qd="Proof of Clan Alliance"

    # Quest Npcs
    SIR_KRISTOF_RODEMAI = 7756
    STATUE_OF_OFFERING = 7757
    WITCH_ATHREA = 7758
    WITCH_KALIS = 7759

    # Quest Items
    HERB_OF_HARIT = 3832
    HERB_OF_VANOR = 3833
    HERB_OF_OEL_MAHUM = 3834
    BLOOD_OF_EVA = 3835
    SYMBOL_OF_LOYALTY = 3837
    PROOF_OF_ALLIANCE = 3874
    VOUCHER_OF_FAITH = 3873
    ANTIDOTE_RECIPE = 3872
    POTION_OF_RECOVERY= 3889

    #Quest mobs, drop, rates and prices
    CHESTS=range(5173,5178)
    CHEST_LOCS = [
    [102273,103433,-3512],
    [102190,103379,-3524],
    [102107,103325,-3533],
    [102024,103271,-3500],
    [102327,103350,-3511],
    [102244,103296,-3518],
    [102161,103242,-3529],
    [102078,103188,-3500],
    [102381,103267,-3538],
    [102298,103213,-3532],
    [102215,103159,-3520],
    [102132,103105,-3513],
    [102435,103184,-3515],
    [102352,103130,-3522],
    [102269,103076,-3533],
    [102186,103022,-3541]
    ]

    MOBS=[[685,HERB_OF_VANOR],[644,HERB_OF_HARIT],[576,HERB_OF_OEL_MAHUM]]
    RATE=35
    #stackable items paid to retry chest game: (default 10k adena)
    RETRY_ITEMS=57
    RETRY_PRICE=10000

    def leader(player) :
    leaderst = None
    clan = player.getClan()
    if clan :
    leader = clan.getLeader().getPlayerInstance()
    if leader :
    leaderst = leader.getQuestState(qn)
    return leaderst

    def randomize_chests(leaderst) :
    chests = [ 1,0,0,1,1,0]
    for i in range(len(chests)-1, 0, -1) :
    j = leaderst.getRandom(5)
    chests[i], chests[j] = chests[j], chests[i]
    for i in range(len(chests)): chests[i]=str(chests[i])
    leaderst.set("chests"," ".join(chests))
    return

    class Quest (JQuest) :

    def __init__(self,id,name,descr):
    JQuest.__init__(self,id,name,descr)
    # a hashtable tracking this quest's (chest) spawns, indexed by leaderST
    self.spawn_tracker = {}

    def chest_game(self,leaderst,command) :
    if command == "start" :
    leaderst.set("chest_game","1")
    leaderst.set("chest_count","0")
    attempts = leaderst.getInt("chest_try")
    leaderst.set("chest_try",str(attempts+1))
    randomize_chests(leaderst)
    tempList = []
    for x,y,z in CHEST_LOCS :
    rand = leaderst.getRandom(5)
    tempList.append(leaderst.addSpawn(5173+rand,x,y,z,0,0,60000))
    self.spawn_tracker[leaderst]=tempList
    leaderst.startQuestTimer("chest_timer",60000)
    elif command == "stop" :
    try:
    leaderst.set("chest_game","0")
    if self.spawn_tracker.has_key(leaderst) :
    trackedSpawns = self.spawn_tracker.pop(leaderst)
    for chest in trackedSpawns :
    chest.decayMe()
    except: pass

    def onAdvEvent (self,event,npc,player):
    leaderst = 0
    if player.isClanLeader() == 1 :
    leaderst = player.getQuestState(qn)
    else :
    leaderst = leader(player)
    if not leaderst: return

    htmltext = event
    ##### Leaders area ######
    if event == "7756-03.htm" :
    leaderst.setState(PART2)
    leaderst.set("cond","1")
    leaderst.playSound("ItemSound.quest_accept")
    elif event == "7759-03.htm" :
    leaderst.setState(PART3)
    leaderst.set("cond","2")
    leaderst.set("dead_list"," ")
    elif event == "7759-07.htm" :
    leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
    leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
    leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
    leaderst.giveItems(ANTIDOTE_RECIPE,1)
    leaderst.setState(PART4)
    leaderst.set("cond","3")
    leaderst.set("ingredients","0 0 0")
    leaderst.set("chest_count","0")
    leaderst.set("chest_game","0")
    leaderst.set("chest_try","0")
    skill = SkillTable.getInstance().getInfo(4082,1)
    skill.getEffects(player, player, False)
    leaderst.addNotifyOfDeath(player)
    elif event == "chest_timer" :
    htmltext = ""
    self.chest_game(leaderst,"stop")
    ##### Members area ######
    elif event == "7757-04.htm" :
    deadlist = leaderst.get("dead_list").split()
    deadlist.append(str(player.getObjectId()))
    leaderst.set("dead_list"," ".join(deadlist))
    player.doDie(player)
    leaderst.giveItems(player,SYMBOL_OF_LOYALTY,1,0)
    leaderst.playSound(player,"ItemSound.quest_accept")
    if player.getQuestState(qn) :
    player.getQuestState(qn).exitQuest(1)
    elif event == "7758-03.htm" :
    self.chest_game(leaderst,"start")
    elif event == "7758-07.htm" :
    if leaderst.getQuestItemsCount(player,RETRY_ITEMS) < RETRY_PRICE :
    htmltext = "7758-06.htm"
    else :
    leaderst.takeItems(player,RETRY_ITEMS,RETRY_PRICE)
    return htmltext

    def onTalk (self,npc,st):
    htmltext = "no_quest.htm"
    leaderst = leader(st.getPlayer())
    if not leaderst : return htmltext
    npcId = npc.getNpcId()
    if npcId == SIR_KRISTOF_RODEMAI:
    if st.getPlayer().getClan() == None or st.getPlayer().isClanLeader() == 0:
    st.exitQuest(1)
    htmltext = "7756-10.htm"
    else :
    if st.getPlayer().getClan().getLevel() <= 2 :
    st.exitQuest(1)
    htmltext = "7756-08.htm"
    elif st.getPlayer().getClan().getLevel() >= 4 :
    st.exitQuest(1)
    htmltext = "7756-09.htm"
    elif st.getState() == PART5 and st.getQuestItemsCount(VOUCHER_OF_FAITH):
    st.playSound("ItemSound.quest_fanfare_2")
    st.takeItems(VOUCHER_OF_FAITH,1)
    st.giveItems(PROOF_OF_ALLIANCE,1)
    st.addExpAndSp(0,120000)
    htmltext="7756-07.htm"
    st.exitQuest(1)
    elif st.getState() in [PART2,PART3] :
    htmltext = "7756-06.htm"
    elif st.getQuestItemsCount(PROOF_OF_ALLIANCE) == 0 :
    st.set("cond","0")
    htmltext = "7756-01.htm"
    else :
    st.exitQuest(1)
    elif npcId == WITCH_KALIS:
    if st.getPlayer().getClan() == None :
    st.exitQuest(1)
    else:
    if st.getPlayer().isClanLeader() == 1 :
    if st.getState() == PART2 :
    htmltext = "7759-01.htm"
    elif st.getState() == PART3 :
    htmltext = "7759-05.htm"
    if st.getQuestItemsCount(SYMBOL_OF_LOYALTY) == 3 :
    try : deads=len(st.get("dead_list").split())
    finally :
    if deads == 3 :
    htmltext = "7759-06.htm"
    elif st.getState() == PART4:
    if st.getQuestItemsCount(HERB_OF_HARIT) and \
    st.getQuestItemsCount(HERB_OF_VANOR) and \
    st.getQuestItemsCount(HERB_OF_OEL_MAHUM) and \
    st.getQuestItemsCount(BLOOD_OF_EVA) and \
    st.getQuestItemsCount(ANTIDOTE_RECIPE) and \
    st.getInt("chest_game") == 3 :
    st.takeItems(ANTIDOTE_RECIPE,1)
    st.takeItems(HERB_OF_HARIT,1)
    st.takeItems(HERB_OF_VANOR,1)
    st.takeItems(HERB_OF_OEL_MAHUM,1)
    st.takeItems(BLOOD_OF_EVA,1)
    st.set("cond","4")
    st.setState(PART5)
    st.giveItems(POTION_OF_RECOVERY,1)
    st.giveItems(VOUCHER_OF_FAITH,1)
    htmltext = "7759-08.htm"
    st.playSound("ItemSound.quest_finish")
    elif st.getQuestItemsCount(VOUCHER_OF_FAITH)==0:
    htmltext = "7759-10.htm"
    else :
    st.exitQuest(1)
    else :
    try :
    if leaderst.getState() == PART4 :
    htmltext = "7759-11.htm"
    st.exitQuest(1)
    except :
    st.exitQuest(1)
    elif npcId == STATUE_OF_OFFERING:
    if st.getPlayer().getClan() == None :
    st.exitQuest(1)
    else :
    if st.getPlayer().isClanLeader() == 1 :
    if leaderst.getState() in [PART2,PART3,PART4,PART5] :
    htmltext = "7757-03.htm"
    else :
    if st.getPlayer().getLevel() <= 39 :
    htmltext = "7757-02.htm"
    st.exitQuest(1)
    elif leaderst.getState() == PART3 :
    dlist=[]
    deads=3
    dlist=leaderst.get("dead_list").split()
    deads = len(dlist)
    if deads < 3 :
    if str(st.getPlayer().getObjectId()) not in dlist :
    if not leaderst.getQuestItemsCount(st.getPlayer(),SYMBOL_OF_LOYALTY) :
    htmltext = "7757-01.htm"
    else :
    htmltext = "7757-06.htm"
    else :
    htmltext = "You cannot die again!"
    st.exitQuest(1)
    elif npcId == WITCH_ATHREA :
    if st.getPlayer().getClan() == None :
    st.exitQuest(1)
    else :
    if st.getPlayer().isClanLeader() == 0 :
    if leaderst :
    if leaderst.getState() == PART4 :
    game_state=leaderst.getInt("chest_game")
    if game_state == 0 :
    if leaderst.getInt("chest_try") == 0 :
    htmltext="7758-01.htm"
    else :
    htmltext="7758-05.htm"
    elif game_state == 1 :
    htmltext="7758-09.htm"
    elif game_state == 2 : timer=leaderst.getQuestTimer("chest_timer")
    if timer != None : timer.cancel()
    self.chest_game(leaderst,"stop")
    leaderst.set("chest_game","3")
    leaderst.giveItems(st.getPlayer(),BLOOD_OF_EVA,1,0) leaderst.playSound(st.getPlayer(),"ItemSound.quest_middle")
    htmltext="7758-08.htm"
    st.exitQuest(1)
    return htmltext

    def onKill(self,npc,player,isPet) :
    if player.isClanLeader() == 1 :
    return
    leaderst = leader(player)
    ### first part, general checking
    npcId=npc.getNpcId()
    if not leaderst :
    return "Quest clan leader not available."
    elif leaderst.getInt("cond") > 2 :
    ingredients = []
    try :
    ingredients = leaderst.get("ingredients").split()
    finally :
    ### second part, herbs gathering
    if len(ingredients) :
    for m in range(len(MOBS)) :
    if not int(ingredients[m]) :
    if npcId == MOBS[m][0] :
    if leaderst.getQuestItemsCount(player,MOBS[m][1]) == 0 :
    if leaderst.getRandom(100) < RATE :
    leaderst.giveItems(player,MOBS[m][1],1,0)
    ingredients[m]='1'
    leaderst.set("ingredients"," ".join(ingredients))
    leaderst.playSound(player,"ItemSound.quest_middle")
    return
    ### third part, chest game
    if npcId in CHESTS :
    timer=leaderst.getQuestTimer("chest_timer")
    #if timer == None : self.chest_game(leaderst,"stop");return "Time is up!"
    chests = leaderst.get("chests").split()
    for i in range(len(chests)) :
    if npcId == 5173+i and chests[i] == '1' :
    npc.broadcastPacket(CreatureSay(npc.getObjectId(),0,npc.getName(),"###### BINGO! ######"))
    count=leaderst.getInt("chest_count")
    if count < 4 :
    count+=1
    leaderst.set("chest_count",str(count))
    if count == 4 :
    leaderst.getQuestTimer("chest_timer").cancel()
    self.chest_game(leaderst,"stop")
    leaderst.set("chest_game","2") leaderst.playSound(player,"ItemSound.quest_middle")
    else :
    leaderst.playSound(player,"ItemSound.quest_itemget")
    return

    def onDeath(self, npc, pc, st) :
    if st.getPlayer() == pc :
    timer=st.getQuestTimer("chest_timer")
    if timer != None : timer.cancel()
    st.exitQuest(1)

    QUEST = Quest(501,qn,qd)
    CREATED = State('Start', QUEST)
    PART2 = State('Part2', QUEST)
    PART3 = State('Part3', QUEST)
    PART4 = State('Part4', QUEST)
    PART5 = State('Part5', QUEST)
    COMPLETED = State('Completed', QUEST)

    QUEST.setInitialState(CREATED)

    QUEST.addStartNpc(SIR_KRISTOF_RODEMAI)
    QUEST.addStartNpc(STATUE_OF_OFFERING)
    QUEST.addStartNpc(WITCH_ATHREA)

    QUEST.addTalkId(SIR_KRISTOF_RODEMAI)
    QUEST.addTalkId(STATUE_OF_OFFERING)
    QUEST.addTalkId(WITCH_ATHREA)
    QUEST.addTalkId(WITCH_KALIS)

    for i in range(len(MOBS)) :
    QUEST.addKillId(MOBS[i][0])
    CREATED.addQuestDrop(MOBS[i][0],MOBS[i][1],1)

    for i in CHESTS :
    QUEST.addKillId(i)

    PART3.addQuestDrop(STATUE_OF_OFFERING,SYMBOL_OF_LOYALTY,1)
    PART4.addQuestDrop(WITCH_KALIS,ANTIDOTE_RECIPE,1)
    PART5.addQuestDrop(WITCH_KALIS,VOUCHER_OF_FAITH,1)
    PART5.addQuestDrop(WITCH_KALIS,POTION_OF_RECOVERY,1)
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Quest-501 Proof Of Clan Alliance

    Post  Karakan on 3rd November 2014, 20:25

    Did you tried to replace the file with the one from the latest revision ?

    Btw please use the code function :

    Code:
     the quest codes here 

    So i can check for wrong spaces and stuff.....jython is very case sensitive.

    Regards^^
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Quest-501 Proof Of Clan Alliance

    Post  Karakan on 3rd November 2014, 20:28

    Thats how it should look like.
    Use Notepad++ ...very good program to check for java/jython errors.
    Plus itll show all the spaces and line breaks in a code.

    Code:
    # Made by QuestDevs Team: DraX, DrLecter, Rolarga
    # With invaluable support from: [TI]Blue, warrax
    # v0.1.r0 2005.12.05

    import sys
    from java.util                                import Iterator
    from net.sf.l2j.gameserver.datatables        import SkillTable
    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
    from net.sf.l2j.gameserver.serverpackets      import CreatureSay

    qn="501_ProofOfClanAlliance"
    qd="Proof of Clan Alliance"

    # Quest Npcs
    SIR_KRISTOF_RODEMAI  = 7756
    STATUE_OF_OFFERING  = 7757
    WITCH_ATHREA        = 7758
    WITCH_KALIS          = 7759

    # Quest Items
    HERB_OF_HARIT    = 3832
    HERB_OF_VANOR    = 3833
    HERB_OF_OEL_MAHUM = 3834
    BLOOD_OF_EVA      = 3835
    SYMBOL_OF_LOYALTY = 3837
    PROOF_OF_ALLIANCE = 3874
    VOUCHER_OF_FAITH  = 3873
    ANTIDOTE_RECIPE  = 3872
    POTION_OF_RECOVERY= 3889

    #Quest mobs, drop, rates and prices
    CHESTS=range(5173,5178)
    CHEST_LOCS = [
      [102273,103433,-3512],
      [102190,103379,-3524],
      [102107,103325,-3533],
      [102024,103271,-3500],
      [102327,103350,-3511],
      [102244,103296,-3518],
      [102161,103242,-3529],
      [102078,103188,-3500],
      [102381,103267,-3538],
      [102298,103213,-3532],
      [102215,103159,-3520],
      [102132,103105,-3513],
      [102435,103184,-3515],
      [102352,103130,-3522],
      [102269,103076,-3533],
      [102186,103022,-3541]
      ]

    MOBS=[[685,HERB_OF_VANOR],[644,HERB_OF_HARIT],[576,HERB_OF_OEL_MAHUM]]
    RATE=35
    #stackable items paid to retry chest game: (default 10k adena)
    RETRY_ITEMS=57
    RETRY_PRICE=10000

    def leader(player) :
        leaderst = None
        clan = player.getClan()
        if clan :
          leader = clan.getLeader().getPlayerInstance()
          if leader : 
              leaderst = leader.getQuestState(qn) 
        return leaderst

    def randomize_chests(leaderst) :
        chests = [ 1,0,0,1,1,0]
        for i in range(len(chests)-1, 0, -1) :
            j = leaderst.getRandom(5)
            chests[i], chests[j] = chests[j], chests[i]
        for i in range(len(chests)): chests[i]=str(chests[i])
        leaderst.set("chests"," ".join(chests))
        return

    class Quest (JQuest) :

     def __init__(self,id,name,descr):
        JQuest.__init__(self,id,name,descr)
        # a hashtable tracking this quest's (chest) spawns, indexed by leaderST
        self.spawn_tracker = {}

     def chest_game(self,leaderst,command) :
        if command == "start" :
          leaderst.set("chest_game","1")
          leaderst.set("chest_count","0")
          attempts = leaderst.getInt("chest_try")
          leaderst.set("chest_try",str(attempts+1))
          randomize_chests(leaderst)
          tempList = []
          for x,y,z in CHEST_LOCS :
            rand = leaderst.getRandom(5)
            tempList.append(leaderst.addSpawn(5173+rand,x,y,z,0,0,60000))
          self.spawn_tracker[leaderst]=tempList
          leaderst.startQuestTimer("chest_timer",60000)
        elif command == "stop" :
          try:
              leaderst.set("chest_game","0")
              if self.spawn_tracker.has_key(leaderst) :
                  trackedSpawns = self.spawn_tracker.pop(leaderst)
                  for chest in trackedSpawns :
                      chest.decayMe()
          except: pass

     def onAdvEvent (self,event,npc,player):
      leaderst = 0
      if player.isClanLeader() == 1 :
        leaderst = player.getQuestState(qn)
      else :
        leaderst = leader(player)
      if not leaderst: return

      htmltext = event
    #####  Leaders area  ######
      if event == "7756-03.htm" :
        leaderst.setState(PART2)
        leaderst.set("cond","1")
        leaderst.playSound("ItemSound.quest_accept")
      elif event == "7759-03.htm" :
        leaderst.setState(PART3)
        leaderst.set("cond","2")
        leaderst.set("dead_list"," ")
      elif event == "7759-07.htm" :
        leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
        leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
        leaderst.takeItems(SYMBOL_OF_LOYALTY,1)
        leaderst.giveItems(ANTIDOTE_RECIPE,1)
        leaderst.setState(PART4)
        leaderst.set("cond","3")
        leaderst.set("ingredients","0 0 0")
        leaderst.set("chest_count","0")
        leaderst.set("chest_game","0")
        leaderst.set("chest_try","0")
        skill = SkillTable.getInstance().getInfo(4082,1)
        skill.getEffects(player, player, False)
        leaderst.addNotifyOfDeath(player)
      elif event == "chest_timer" :
        htmltext = ""
        self.chest_game(leaderst,"stop")
    #####  Members area  ######
      elif event == "7757-04.htm" :
        deadlist = leaderst.get("dead_list").split()
        deadlist.append(str(player.getObjectId()))
        leaderst.set("dead_list"," ".join(deadlist))
        player.doDie(player)
        leaderst.giveItems(player,SYMBOL_OF_LOYALTY,1,0)
        leaderst.playSound(player,"ItemSound.quest_accept")
        if player.getQuestState(qn) :
            player.getQuestState(qn).exitQuest(1)
      elif event == "7758-03.htm" :
        self.chest_game(leaderst,"start")
      elif event == "7758-07.htm" :
        if leaderst.getQuestItemsCount(player,RETRY_ITEMS) < RETRY_PRICE :
            htmltext = "7758-06.htm"
        else :
            leaderst.takeItems(player,RETRY_ITEMS,RETRY_PRICE)
      return htmltext

     def onTalk (self,npc,st):
      htmltext = "no_quest.htm"
      leaderst = leader(st.getPlayer())
      if not leaderst : return htmltext
      npcId = npc.getNpcId()
      if npcId == SIR_KRISTOF_RODEMAI:
        if st.getPlayer().getClan() == None or st.getPlayer().isClanLeader() == 0:
          st.exitQuest(1)
          htmltext = "7756-10.htm"
        else :
          if st.getPlayer().getClan().getLevel() <= 2 :
            st.exitQuest(1)
            htmltext =  "7756-08.htm"
          elif st.getPlayer().getClan().getLevel() >= 4 :
            st.exitQuest(1)
            htmltext =  "7756-09.htm"
          elif st.getState() == PART5 and st.getQuestItemsCount(VOUCHER_OF_FAITH):
              st.playSound("ItemSound.quest_fanfare_2")
              st.takeItems(VOUCHER_OF_FAITH,1)
              st.giveItems(PROOF_OF_ALLIANCE,1)
              st.addExpAndSp(0,120000)
              htmltext="7756-07.htm"
              st.exitQuest(1)
          elif st.getState() in [PART2,PART3] :
            htmltext =  "7756-06.htm"
          elif st.getQuestItemsCount(PROOF_OF_ALLIANCE) == 0 :
            st.set("cond","0")
            htmltext =  "7756-01.htm"
          else :
            st.exitQuest(1)
      elif npcId == WITCH_KALIS:
        if st.getPlayer().getClan() == None :
          st.exitQuest(1)
        else:
          if st.getPlayer().isClanLeader() == 1 :
            if st.getState() == PART2 :
              htmltext =  "7759-01.htm"
            elif st.getState() == PART3 :
              htmltext = "7759-05.htm" 
              if st.getQuestItemsCount(SYMBOL_OF_LOYALTY) == 3 :
                  try : deads=len(st.get("dead_list").split())
                  finally :
                    if deads == 3 :
                        htmltext = "7759-06.htm"
            elif st.getState() == PART4:
              if st.getQuestItemsCount(HERB_OF_HARIT) and \
                  st.getQuestItemsCount(HERB_OF_VANOR) and \
                  st.getQuestItemsCount(HERB_OF_OEL_MAHUM) and \
                  st.getQuestItemsCount(BLOOD_OF_EVA) and \
                  st.getQuestItemsCount(ANTIDOTE_RECIPE) and \
                  st.getInt("chest_game") == 3 :
                st.takeItems(ANTIDOTE_RECIPE,1)
                st.takeItems(HERB_OF_HARIT,1)
                st.takeItems(HERB_OF_VANOR,1)
                st.takeItems(HERB_OF_OEL_MAHUM,1)
                st.takeItems(BLOOD_OF_EVA,1)
                st.set("cond","4")
                st.setState(PART5)
                st.giveItems(POTION_OF_RECOVERY,1)
                st.giveItems(VOUCHER_OF_FAITH,1)
                htmltext = "7759-08.htm"
                st.playSound("ItemSound.quest_finish")
              elif st.getQuestItemsCount(VOUCHER_OF_FAITH)==0:
                htmltext = "7759-10.htm"
            else :
              st.exitQuest(1)
          else :
            try :
              if leaderst.getState() == PART4 :
                  htmltext = "7759-11.htm"
              st.exitQuest(1)
            except :
              st.exitQuest(1)
      elif npcId == STATUE_OF_OFFERING:
        if st.getPlayer().getClan() == None :
          st.exitQuest(1)
        else :
          if st.getPlayer().isClanLeader() == 1 :
            if leaderst.getState() in [PART2,PART3,PART4,PART5] :
              htmltext = "7757-03.htm"
          else :
            if st.getPlayer().getLevel() <= 39 :
              htmltext = "7757-02.htm"
              st.exitQuest(1)
            elif leaderst.getState() == PART3 :
              dlist=[]
              deads=3
              dlist=leaderst.get("dead_list").split()
              deads = len(dlist)
              if deads < 3 :
                if str(st.getPlayer().getObjectId()) not in dlist :
                    if not leaderst.getQuestItemsCount(st.getPlayer(),SYMBOL_OF_LOYALTY) :
                      htmltext =  "7757-01.htm"
                    else :
                      htmltext =  "7757-06.htm"
                else :
                    htmltext = "You cannot die again!"
                    st.exitQuest(1)
      elif npcId == WITCH_ATHREA :
        if st.getPlayer().getClan() == None :
          st.exitQuest(1)
        else :
          if st.getPlayer().isClanLeader() == 0 :
              if leaderst :
                if leaderst.getState() == PART4 :
                    game_state=leaderst.getInt("chest_game") 
                    if game_state == 0 : 
                      if leaderst.getInt("chest_try") == 0 : 
                          htmltext="7758-01.htm" 
                      else : 
                          htmltext="7758-05.htm" 
                    elif game_state == 1 : 
                      htmltext="7758-09.htm" 
                    elif game_state == 2 : 

                      timer=leaderst.getQuestTimer("chest_timer")
                      if timer != None : timer.cancel()
                      self.chest_game(leaderst,"stop")
                      leaderst.set("chest_game","3")
                      leaderst.giveItems(st.getPlayer(),BLOOD_OF_EVA,1,0)

                      leaderst.playSound(st.getPlayer(),"ItemSound.quest_middle")
                      htmltext="7758-08.htm"
                      st.exitQuest(1)
      return htmltext

     def onKill(self,npc,player,isPet) :
      if player.isClanLeader() == 1 :
        return
      leaderst = leader(player)
      ### first part, general checking
      npcId=npc.getNpcId()
      if not leaderst :
        return "Quest clan leader not available."
      elif leaderst.getInt("cond") > 2 :
        ingredients = []
        try :
            ingredients = leaderst.get("ingredients").split()
        finally :
        ### second part, herbs gathering
            if len(ingredients) :
              for m in range(len(MOBS)) :
                  if not int(ingredients[m]) :
                    if npcId == MOBS[m][0] :
                        if leaderst.getQuestItemsCount(player,MOBS[m][1]) == 0 :
                          if leaderst.getRandom(100) < RATE :
                              leaderst.giveItems(player,MOBS[m][1],1,0)
                              ingredients[m]='1'
                              leaderst.set("ingredients"," ".join(ingredients))
                              leaderst.playSound(player,"ItemSound.quest_middle")
                              return
        ### third part, chest game
        if npcId in CHESTS :
            timer=leaderst.getQuestTimer("chest_timer")
            #if timer == None : self.chest_game(leaderst,"stop");return "Time is up!"
            chests = leaderst.get("chests").split()
            for i in range(len(chests)) :
                if npcId == 5173+i and chests[i] == '1' :
                  npc.broadcastPacket(CreatureSay(npc.getObjectId(),0,npc.getName(),"###### BINGO! ######"))
                  count=leaderst.getInt("chest_count")
                  if count < 4 :
                      count+=1
                      leaderst.set("chest_count",str(count))
                      if count == 4 :
                        leaderst.getQuestTimer("chest_timer").cancel()
                        self.chest_game(leaderst,"stop")
                        leaderst.set("chest_game","2")

                        leaderst.playSound(player,"ItemSound.quest_middle")
                      else :
                        leaderst.playSound(player,"ItemSound.quest_itemget")
      return

     def onDeath(self, npc, pc, st) :
        if st.getPlayer() == pc :
          timer=st.getQuestTimer("chest_timer")
          if timer != None : timer.cancel()
        st.exitQuest(1)

    QUEST      = Quest(501,qn,qd)
    CREATED    = State('Start',    QUEST)
    PART2      = State('Part2',    QUEST)
    PART3      = State('Part3',    QUEST)
    PART4      = State('Part4',    QUEST)
    PART5      = State('Part5',    QUEST)
    COMPLETED  = State('Completed', QUEST)

    QUEST.setInitialState(CREATED)

    QUEST.addStartNpc(SIR_KRISTOF_RODEMAI)
    QUEST.addStartNpc(STATUE_OF_OFFERING)
    QUEST.addStartNpc(WITCH_ATHREA)

    QUEST.addTalkId(SIR_KRISTOF_RODEMAI)
    QUEST.addTalkId(STATUE_OF_OFFERING)
    QUEST.addTalkId(WITCH_ATHREA)
    QUEST.addTalkId(WITCH_KALIS)

    for i in range(len(MOBS)) :
        QUEST.addKillId(MOBS[i][0])
        CREATED.addQuestDrop(MOBS[i][0],MOBS[i][1],1)

    for i in CHESTS :
        QUEST.addKillId(i)

    PART3.addQuestDrop(STATUE_OF_OFFERING,SYMBOL_OF_LOYALTY,1)
    PART4.addQuestDrop(WITCH_KALIS,ANTIDOTE_RECIPE,1)
    PART5.addQuestDrop(WITCH_KALIS,VOUCHER_OF_FAITH,1)
    PART5.addQuestDrop(WITCH_KALIS,POTION_OF_RECOVERY,1)
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 3rd November 2014, 22:47

    Thank you so much.
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 3rd November 2014, 23:02

    another error :-(

    Error on: /Lisvus/gameserver/data/scripts/quests/501_ProofOfClanAlliance/__init__.py.error.log
    Line: -1 - Column: -1

    Traceback (innermost last):
    (no code object) at line 0
    SyntaxError: ('invalid syntax', ('__init__.py', 80, 1, 'def __init__(self,id,name,descr):'))
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Quest-501 Proof Of Clan Alliance

    Post  Karakan on 4th November 2014, 19:09

    Looks like the format is wrong in your file.

    Did you replaced the file (__init__.py) with the one from the svn or did you copy paste from the code i posted yesterday ?

    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 5th November 2014, 00:13

    copy paste
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 5th November 2014, 00:58

    I try change diffrent file py but problém still error: Line: -1 - Column: -1

    Traceback (innermost last):
    (no code object) at line 0
    SyntaxError: ('invalid syntax', ('__init__.py', 80, 1, 'def __init__(self,id,name,descr):'))
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 7th November 2014, 12:17

    Does anyone Function py. code please?
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 16th November 2014, 21:10

    close it please problém was fix in rev. 505 :-)
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 19th November 2014, 12:54

    again problém...

    Lisvus/gameserver/data/scripts/quests/501_ProofOfClanAlliance/__init__.py
    Traceback (innermost last):
    File "__init__.py", line 298, in onKill
    AttributeError: 'NoneType' object has no attribute 'split'

    at org.python.core.Py.AttributeError(Unknown Source)
    at org.python.core.PyObject.noAttributeError(Unknown Source)
    at org.python.core.PyObject.__getattr__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at org.python.pycode.serializable._pyx1416322289751.onKill$8(__init__.py:298)
    at org.python.pycode.serializable._pyx1416322289751.call_function(__init__.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject._jcallexc(Unknown Source)
    at org.python.core.PyObject._jcall(Unknown Source)
    at org.python.proxies.main$Quest$311.onKill(Unknown Source)
    at net.sf.l2j.gameserver.model.quest.Quest.notifyKill(Quest.java:344)
    at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:437)
    at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:206)
    at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:180)
    at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:49)
    at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:5966)
    at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:379)
    at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:356)
    at net.sf.l2j.gameserver.model.L2Character.onHitTimer(L2Character.java:4659)
    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onHitTimer(L2PcInstance.java:3895)
    at net.sf.l2j.gameserver.model.L2Character$HitTask.run(L2Character.java:1809)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Quest-501 Proof Of Clan Alliance

    Post  ProDev on 19th November 2014, 17:40

    Its something like a NullPointerException, but in py-script Smile That means you get None (like null in java) object, for example, here:

    Code:

    deadlist = leaderst.get("dead_list").split()

    So, it should be checked for None value.

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Quest-501 Proof Of Clan Alliance

    Post  ProDev on 19th November 2014, 17:41

    By the way, please, post steps to reproduce that issue.

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Quest-501 Proof Of Clan Alliance

    Post  ProDev on 19th November 2014, 18:42

    Try this one: http://cl.ly/code/200i1S360c1H

    Patch:

    Code:

    Index: Lisvus_DataPack/data/scripts/quests/501_ProofOfClanAlliance/__init__.py
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    ===================================================================
    --- Lisvus_DataPack/data/scripts/quests/501_ProofOfClanAlliance/__init__.py   (revision 9531a95dafba17760db68895edcad75b5a9d0093)
    +++ Lisvus_DataPack/data/scripts/quests/501_ProofOfClanAlliance/__init__.py   (revision )
    @@ -294,8 +294,9 @@
          return "Quest clan leader not available."
        elif leaderst.getInt("cond") > 2 :
          ingredients = []
    -    try :
    +    try :
    +        if leaderst.get("ingredients") is not None :
    -        ingredients = leaderst.get("ingredients").split()
    +            ingredients = leaderst.get("ingredients").split()
          finally :
          ### second part, herbs gathering
            if len(ingredients) :
    \ No newline at end of file
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 21st November 2014, 13:48

    thanks
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Quest-501 Proof Of Clan Alliance

    Post  Karakan on 21st November 2014, 13:57

    Did it fix it ?
    avatar
    DanielaCZ

    Posts : 507
    Join date : 2013-01-07
    Age : 27
    Location : Newcastle Upon Tyne

    Re: Quest-501 Proof Of Clan Alliance

    Post  DanielaCZ on 21st November 2014, 15:24

    yes

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Quest-501 Proof Of Clan Alliance

    Post  ProDev on 21st November 2014, 19:06

    You are welcome! Thanks for testing, cause it was a static analysis and fix, I had no test instance to check it. So its ok, we'll put it to master branch Wink

    Sponsored content

    Re: Quest-501 Proof Of Clan Alliance

    Post  Sponsored content


      Current date/time is 22nd November 2017, 05:50