All pastes #79154 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-05 00:18 UTC
rendered paste body
C:\server\L2j\Kingdom of Kings server\gameserver\data\jscript\custom\__init__.py

__all__ = [
'1006_tattoos',
'3995_echo',
'5000_crystal',
'5005_scroll',
'12535_WakeBaium',
'7000_HeroItems',
'npcbuff'
'9987_aa'
]
print ""
print "importing custom data ..."
from data.jscript.custom import *
print "... done"
print ""


C:\server\L2j\Kingdom of Kings server\gameserver\data\jscript\custom\9987_aa\__init__.py

print "CustomManager: Importing 9987: Ancient Adena Exchange ...done"
import sys
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

NPC=[8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8168,8169,8126]

class Quest (JQuest) :

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

 def onTalk (Self,npc,st):
   npcId = npc.getNpcId()
   if npcId in NPC:
     st.setState(STARTED)
     st.set("cond","0")
     stoneblue=st.getQuestItemsCount(6360)
     stonegreen=st.getQuestItemsCount(6361)
     stonered=st.getQuestItemsCount(6362)
     giveaa=stoneblue*3 + stonegreen*5 + stonered*10
     if giveaa > 0 :
       st.takeItems(6360,stoneblue)
       st.takeItems(6361,stonegreen)
       st.takeItems(6362,stonered)
       st.giveItems(5575,giveaa)
       htmltext = "Exchange ended succesfully."
     else :
       htmltext = "You don't have enough stones."
   st.setState(COMPLETED)
   st.exitQuest(1)
   return htmltext


QUEST       = Quest(9987,"9987_aa","custom")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)


for item in NPC:
### Quest NPC starter initialization
   QUEST.addStartNpc(item)
### Quest NPC initialization
   STARTED.addTalkId(item)