Here is the current quest and pvp i change pvp check i try to add time check also but always
i get errors on my gameserver :/
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
htmltext = event
if event == "30078-02.htm" :
st.setState(STARTED)
st.set("cond","1")
st.playSound("ItemSound.quest_accept")
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
Pvp = player.getPvpKills()
cond = st.getInt("cond")
if id == CREATED :
if Pvp>=150 and Pvp<=400 :
htmltext = "30078-01.htm"
else:
htmltext = "<html><body>This quest can only be taken by characters PvP count is more than 150 and up to 400!</body></html>"
st.exitQuest(1)
elif cond==1 :
if st.getQuestItemsCount(BOX_OF_COOKIES)>=20 :
htmltext = "30078-04.htm"
st.giveItems(FARM_COIN,3000)
st.takeItems(BOX_OF_COOKIES,-1)
st.playSound("ItemSound.quest_finish")
st.exitQuest(1)
else :
htmltext = "30078-03.htm"
return htmltext
i add it here
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
htmltext = event
if event == "30078-02.htm" :
st.setState(STARTED)
st.set("cond","1")
st.playSound("ItemSound.quest_accept")
player.removeEnterCooldownAfter24h();
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
Pvp = player.getPvpKills()
cond = st.getInt("cond")
if id == CREATED :
if Pvp>=150 and Pvp<=400 and :
htmltext = "30078-01.htm"
else:
htmltext = "<html><body>This quest can only be taken by characters PvP count is more than 150 and up to 400!</body></html>"
st.exitQuest(1)
if (!player.canEnterQuest())
{
player.sendMessage("You must wait at least 24 hours since your last taken the quest");
return;
}
elif cond==1 :
if st.getQuestItemsCount(BOX_OF_COOKIES)>=20 :
htmltext = "30078-04.htm"
st.giveItems(FARM_COIN,3000)
st.takeItems(BOX_OF_COOKIES,-1)
st.playSound("ItemSound.quest_finish")
st.exitQuest(1)
else :
htmltext = "30078-03.htm"
return htmltext