Exemplo n.º 1
0
    def onAdvEvent(self, event, npc, player):
        if not TOKEN_ENABLED: return
        st = player.getQuestState(qn)
        newbie = player.getNewbie()
        level = player.getLevel()
        occupation_level = player.getClassId().level()
        pkkills = player.getPkKills()
        if event == "newbie_give_weapon_coupon":
            #@TODO: check if this is the very first character for this account
            #would need a bit of SQL, or a core method to determine it.
            #This condition should be stored by the core in the account_data table
            #upon character creation.
            if 6 <= level <= 39 and not pkkills and occupation_level == 0:
                # check the player state against this quest newbie rewarding mark.
                if newbie | WEAPON_REWARD != newbie:
                    player.setNewbie(newbie | WEAPON_REWARD)
                    st.giveItems(COUPON_ONE, 5)
                    st1 = player.getQuestState("7003_NewbieHelper")
                    if not st1: return "2.htm"
                    st1.set("cond", "4")
                    player.sendPacket(
                        ExShowScreenMessage(QuestMessage.Q1201_mess1.get(),
                                            4000))
                    return "2.htm"  #here's the coupon you requested
                else:
                    return "3.htm"  #you got a coupon already!
            else:
                return "4.htm"  #you're not eligible to get a coupon (level caps, pkkills or already changed class)

        elif event == "newbie_show_weapon":
            if 6 <= level <= 39 and not pkkills and occupation_level == 0:
                L2Multisell.getInstance().separateAndSend(
                    WEAPON_MULTISELL, player, 0, 0)
            else:
                return "5.htm"  #you're not eligible to use warehouse

        elif event == "newbie_give_armor_coupon":
            #@TODO: check if this is the very first character for this account
            #would need a bit of SQL, or a core method to determine it.
            #This condition should be stored by the core in the account_data table
            #upon character creation.
            if 6 <= level <= 39 and not pkkills and occupation_level > 0:
                # check the player state against this quest newbie rewarding mark.
                if newbie | ARMOR_REWARD != newbie:
                    player.setNewbie(newbie | ARMOR_REWARD)
                    st.giveItems(COUPON_TWO, 1)
                    return "6.htm"  #here's the coupon you requested
                else:
                    return "7.htm"  #you got a coupon already!
            else:
                return "8.htm"  #you're not eligible to get a coupon (level caps, pkkills or already changed class)

        elif event == "newbie_show_armor":
            if 6 <= level <= 39 and not pkkills and occupation_level > 0:
                L2Multisell.getInstance().separateAndSend(
                    ARMOR_MULTISELL, player, 0, 0)
            else:
                return "9.htm"  #you're not eligible to use warehouse
Exemplo n.º 2
0
  def onAdvEvent (self, event, npc, player) :
    if not TOKEN_ENABLED : return
    st = player.getQuestState(qn)
    newbie = player.getNewbie()
    level = player.getLevel()
    occupation_level = player.getClassId().level()
    pkkills = player.getPkKills()
    if event == "newbie_give_weapon_coupon" :
       #@TODO: check if this is the very first character for this account
       #would need a bit of SQL, or a core method to determine it.
       #This condition should be stored by the core in the account_data table
       #upon character creation.
       if 6 <= level <= 39 and not pkkills and occupation_level == 0 :
          # check the player state against this quest newbie rewarding mark.
          if newbie | WEAPON_REWARD != newbie :
             player.setNewbie(newbie|WEAPON_REWARD)
             st.giveItems(COUPON_ONE, 5)
             st1 = player.getQuestState("7003_NewbieHelper")
             if not st1 : return "2.htm"
             st1.set("cond","4");
             player.sendPacket(ExShowScreenMessage(QuestMessage.Q1201_mess1.get(), 4000))
             return "2.htm" #here's the coupon you requested
          else :
             return "3.htm" #you got a coupon already!
       else :
          return "4.htm" #you're not eligible to get a coupon (level caps, pkkills or already changed class)

    elif event == "newbie_show_weapon" :
       if 6 <= level <= 39 and not pkkills and occupation_level == 0 :
          L2Multisell.getInstance().separateAndSend(WEAPON_MULTISELL, player, 0, 0);
       else :
          return "5.htm" #you're not eligible to use warehouse

    elif event == "newbie_give_armor_coupon" :
       #@TODO: check if this is the very first character for this account
       #would need a bit of SQL, or a core method to determine it.
       #This condition should be stored by the core in the account_data table
       #upon character creation.
       if 6 <= level <= 39 and not pkkills and occupation_level > 0 :
          # check the player state against this quest newbie rewarding mark.
          if newbie | ARMOR_REWARD != newbie :
             player.setNewbie(newbie|ARMOR_REWARD)
             st.giveItems(COUPON_TWO, 1)
             return "6.htm" #here's the coupon you requested
          else :
             return "7.htm" #you got a coupon already!
       else :
          return "8.htm" #you're not eligible to get a coupon (level caps, pkkills or already changed class)

    elif event == "newbie_show_armor" :
       if 6 <= level <= 39 and not pkkills and occupation_level > 0 :
          L2Multisell.getInstance().separateAndSend(ARMOR_MULTISELL, player, 0, 0);
       else :
          return "9.htm" #you're not eligible to use warehouse
Exemplo n.º 3
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     has_d = st.getQuestItemsCount(D_COUPON)
     has_c = st.getQuestItemsCount(C_COUPON)
     if has_d or has_c:
         multisell = 306893003
         if not has_d:
             multisell = 306893002
         elif not has_c:
             multisell = 306893001
         L2Multisell.getInstance().separateAndSend(multisell, player, 0, 0)
         st.exitQuest(1)
         return
     else:
         htmltext = "exchange-no.htm"
         st.exitQuest(1)
     return htmltext
Exemplo n.º 4
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     has_d = st.getQuestItemsCount(D_COUPON)
     has_c = st.getQuestItemsCount(C_COUPON)
     if has_d or has_c:
         multisell = 306893003
         if not has_d:
             multisell = 306893002
         elif not has_c:
             multisell = 306893001
         L2Multisell.getInstance().separateAndSend(multisell, player, 0, 0)
         st.exitQuest(1)
         return
     else:
         htmltext = "exchange-no.htm"
         st.exitQuest(1)
     return htmltext