Jump to content

12 Anos Online! 🎂



Anúncios Patrocinados








  • 0

Quest não Starta


Just4You

Question

Fala miguxos, tudo bem?

 

Estou tentando criar uma quest, mas ela simplesmente não inicia.

Diz que o NPC não possui nenhuma quest.

Ja fiz tudo que imaginava para tentar corrigir, mas não consigo.

Ela não apresenta nenhum erro na hora de abrir o servidor, e ja esta no arquivo scripts.cfg.

 

Rev utilizada Frozen

Abaixo o arquivo __init__

import sys
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

# variable definition part
NPC_START = 10118
KILL_LIST = 57
ALLIGATOR = 10146
FIELD_OF_WHISPER = 10147
FIELD_OF_SILENCE = 10148
GARDEN_OF_EVA = 10149
NPC_ALLIGATOR = 20135
NPC_FIELD_OF_WHISPER = 20792
NPC_FIELD_OF_SILENCE = 21642
NPC_GARDEN_OF_EVA = 20994
CHANCE_ITEM = 5000
EWS = 959
EAS = 960

# Count Code part
def getCount_10146(st) :
  return st.getQuestItemsCount(ALLIGATOR)

def getCount_10147(st) :
  return st.getQuestItemsCount(FIELD_OF_WHISPER)
  
def getCount_10148(st) :
  return st.getQuestItemsCount(FIELD_OF_SILENCE)
  
def getCount_10149(st) :
  return st.getQuestItemsCount(GARDEN_OF_EVA)

# Complete code part
def completed(st) :
  st.setState(COMPLETED)
  st.clearQuestDrops()
  st.takeItems(ALLIGATOR,-1)
  st.takeItems(FIELD_OF_WHISPER,-1)
  st.takeItems(FIELD_OF_SILENCE,-1)
  st.takeItems(GARDEN_OF_EVA,-1)
  st.giveItems(EWS,1)
  st.giveItems(EAS,2)
  st.exitQuest(True)
  return

def check(st) :
  if getCount_10146(st) >= 10 and  getCount_10147(st) >= 10 and getCount_10148(st) >= 10 and getCount_10149(st) >= 10 : 
    completed(st)
    return "<HTML><BODY>You''ve got all items, here is your reward</BODY></HTML>"
  return "<HTML><BODY>You don''t have enough item, continue your quest</BODY></HTML>"
# Condition check for the Quest
def st_check(st) :
  if st.getPlayer().getLevel() < 75 :
    st.exitQuest(True)
    return "<HTML><BODY>Sorry, your level is too low for this quest</BODY></HTML>"
  return "Start.htm"

# Main Quest Code
class Quest (JQuest):

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

  def onEvent (self,event,st):
    id = st.getState()
    if   id == CREATED  :
      if event == "agree" :
        st.setState(STARTED)
        st.set("cnt","0")
        return "<HTML><BODY>Quest initialized</BODY></HTML>"
      return st_check(st)
    elif id == COMPLETED: pass
    elif id == STARTED  :
      return check(st)
      return

  def onTalk (self,npcid,st):
    if npcid == NPC_START : 
        st.giveItems(KILL_LIST,1)
    return

# Quest class and state definition
QUEST     = Quest(10118,"Better Version", "Better Version")
CREATED   = State('Start',     QUEST)
STARTED   = State('Started',   QUEST)
COMPLETED = State('Completed', QUEST)
# Quest initialization
QUEST.setInitialState(CREATED)

# Quest NPC starter initialization
QUEST.addStartNpc(NPC_START)

# Quest Item Drop initialization
STARTED.addQuestDrop(NPC_ALLIGATOR,ALLIGATOR,CHANCE_ITEM)
STARTED.addQuestDrop(NPC_FIELD_OF_SILENCE,FIELD_OF_SILENCE,CHANCE_ITEM)
STARTED.addQuestDrop(NPC_FIELD_OF_WHISPER,FIELD_OF_WHISPER,CHANCE_ITEM)
STARTED.addQuestDrop(NPC_GARDEN_OF_EVA,GARDEN_OF_EVA,CHANCE_ITEM)

# Quest mob initialization
QUEST.addKillId(NPC_ALLIGATOR)
QUEST.addKillId(NPC_FIELD_OF_SILENCE)
QUEST.addKillId(NPC_FIELD_OF_WHISPER)
QUEST.addKillId(NPC_GARDEN_OF_EVA)

# Quest NPC initialization
QUEST.addTalkId(NPC_START)

 

Abaixo o caminho que o NPC indica:

<html><body>Daily Quest Master:<br>
Hello adventure!!<br>
I have a proposition for you... If you accept, you can earn some items!!<br>
<a action="bypass -h npc_%objectId%_Quest">I Accept! </a><br>
</body></html>

 

A Vida é uma eterna lição...

Estamos sempre aprendendo...

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...