Jump to content
  • 0

Quest Understanding


Question

Posted

i addapt a quest but i cant understand what i must edit so it works properly:

# -*- coding: cp1251 -*-
import sys
from com.l2jfrozen import Config
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 = "50000_NewbieZone"
#NPC ID
Starter = 30549


class Quest (JQuest):
    def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

    def onKill (self,npc,player,isPet):
        npcId = npc.getNpcId()
        st = player.getQuestState(qn)
        if npc.getNpcId() in [Monsters] :
            if st.getEnchantLevel(int(st.getItemEquipped(4))) >= 7575:
                return
            else:
                if st.getRandom(100) == 100:
                    st.giveItems(136,1)
                elif st.getRandom(100) == 98 or st.getRandom(100) == 95 :
                    
                    st.giveItems(6577,2)
                elif st.getRandom(100) == 95 or st.getRandom(100) == 90 or st.getRandom(100) == 85 :
                    st.giveItems(6578,3)
                elif st.getRandom(1) == 1 :
                    st.giveItems(57,100000)                    
        else :

            return
            

    def onTalk (self,npc,player):
        if st:
           npcId = npc.getNpcId()
           id = st.getState()
           cond = st.getInt("cond")
           #item id can not be used
           if st.getEnchantLevel(int(st.getItemEquipped(10))) >= 10 :
               htmltext = "2.htm"
           else :
               if st.getRandom(2) == 0 :
                   st.getPlayer().teleToLocation(15516,251107,-1967)
                   
               if st.getRandom(2) == 1 :
                   st.getPlayer().teleToLocation(20912,253588,-2018)
                   
               if st.getRandom(2) == 2 :
                   st.getPlayer().teleToLocation(20334,250761,-2017)
                   
               
        return htmltext
    def onAttack (self,npc,player,damage,isPet):
        st = player.getQuestState(qn)
        npcId = npc.getNpcId()
        if not st : return
        #Monsters will participate in event
        if npcId == 27191:
            if st.getEnchantLevel(int(st.getItemEquipped(9))) >= 7575 :
                st.getPlayer().teleToLocation(154336,121232,-3809)
                #How much karm will be added when you dont have requirements
                st.getPlayer().setKarma(st.getPlayer().getKarma() +444)
                htmltext = "4.htm"
            return
               
QUEST       = Quest(50000, qn, "NewbieZone")

QUEST.addStartNpc(Starter)
QUEST.addTalkId(Starter)
#Монстры которые участвует в квесте, указать ИД.
#Таблица монстров, пример вноса ИД в таблицу:
#[1234, 33345, 3435]
for Monsters in [27191]:
    QUEST.addKillId(Monsters)
QUEST.addAttackId(27191)    

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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