All pastes #591927 Raw Edit

Stuff

public text v1 · immutable
#591927 ·published 2007-06-27 14:20 UTC
rendered paste body
#Made by DooMIta ethernaly@email.it
import sys
from net.sf.l2j import Config
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

qn = "5999_lordcrown"

#NPC
CROWNMANAGER   = 70004

#ITEM
CROWN  = 6841

class Quest (JQuest) :

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

 def onTalk (self,npc,player):
   st = player.getQuestState(qn)
   if not st : return htmltext    
   npcId=npc.getNpcId()
   htmltext="<html><head><body>I have nothing to say you</body></html>"
   id = st.getState()
   if id == CREATED :
     if st.getPlayer().isClanLeader() == 1 and st.getQuestItemsCount(CROWN) == 0 and st.getPlayer().getClan().getHasCastle() > 0 :
       htmltext = "0.htm"
       st.giveItems(CROWN,1)
       st.playSound("ItemSound.quest_fanfare_2")
       st.setState(COMPLETED)
       st.exitQuest(0)
     else:
       st.exitQuest(1)
       htmltext = "<html><head><body>Only a Castle's Lord can take this Crown!</body></html>"
     return htmltext
    
QUEST=Quest(110,qn,"custom")
CREATED=State('Start', QUEST)
STARTED     = State('Started', QUEST) #this is not necessary I think
COMPLETED=State('Completed', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(CROWNMANAGER)
QUEST.addTalkId (CROWNMANAGER)

print "importing custom data: 5999: lordcrown"