__init__.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # by disKret
  2. import sys
  3. from net.sf.l2j.gameserver.model.quest import State
  4. from net.sf.l2j.gameserver.model.quest import QuestState
  5. from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
  6. #NPC
  7. ABERCROMBIE = 8555
  8. FORGOTTEN_MONUMENT_1,FORGOTTEN_MONUMENT_2,FORGOTTEN_MONUMENT_3,FORGOTTEN_MONUMENT_4,CORPSE_OF_DWARF = range(8661,8666)
  9. #ITEMS
  10. KRORINS_JOURNAL = 7252
  11. #MESSAGES
  12. default = "<html><head><body>I have nothing to say you</body></html>"
  13. class Quest (JQuest) :
  14. def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
  15. def onEvent (self,event,st) :
  16. id = st.getState()
  17. cond = st.getInt("cond")
  18. htmltext = event
  19. if event == "8555-1.htm" and id == CREATED:
  20. st.set("cond","1")
  21. st.setState(STARTED)
  22. st.playSound("ItemSound.quest_accept")
  23. elif event == "8665-1.htm" and cond == 1:
  24. st.set("cond","2")
  25. st.playSound("ItemSound.quest_itemget")
  26. st.giveItems(KRORINS_JOURNAL,1)
  27. elif event == "8555-4.htm" and cond == 2:
  28. st.set("cond","3")
  29. elif event == "8661-1.htm" and cond == 3:
  30. st.set("cond","4")
  31. elif event == "8662-1.htm" and cond == 4:
  32. st.set("cond","5")
  33. elif event == "8663-1.htm" and cond == 5:
  34. st.set("cond","6")
  35. elif event == "8664-1.htm" and cond == 6:
  36. st.set("cond","7")
  37. st.playSound("ItemSound.quest_middle")
  38. elif event == "8555-7.htm" and cond == 7:
  39. st.takeItems(KRORINS_JOURNAL,-1)
  40. st.addExpAndSp(130000,0)
  41. st.giveItems(57,40000)
  42. st.playSound("ItemSound.quest_finish")
  43. st.setState(COMPLETED)
  44. elif event <> "8663-0a.htm":
  45. htmltext = default
  46. return htmltext
  47. def onTalk (Self,npc,st):
  48. htmltext = default
  49. npcId = npc.getNpcId()
  50. id = st.getState()
  51. cond = st.getInt("cond")
  52. if id == COMPLETED :
  53. htmltext = "<html><head><body>This quest have already been completed.</body></html>"
  54. elif npcId == ABERCROMBIE :
  55. if cond == 0 :
  56. if st.getPlayer().getLevel() >= 66 :
  57. htmltext = "8555-0.htm"
  58. else :
  59. htmltext = "8555-0a.htm"
  60. st.exitQuest(1)
  61. elif cond == 1 :
  62. htmltext = "8555-2.htm"
  63. elif cond == 2 :
  64. htmltext = "8555-3.htm"
  65. elif cond == 3 :
  66. htmltext = "8555-5.htm"
  67. elif cond == 7 :
  68. htmltext = "8555-6.htm"
  69. elif npcId == CORPSE_OF_DWARF :
  70. if cond == 1 :
  71. htmltext = "8665-0.htm"
  72. elif cond == 2 :
  73. htmltext = "8665-2.htm"
  74. elif npcId == FORGOTTEN_MONUMENT_1 :
  75. if cond == 3 :
  76. htmltext = "8661-0.htm"
  77. elif cond > 3 :
  78. htmltext = "8661-2.htm"
  79. elif npcId == FORGOTTEN_MONUMENT_2:
  80. if cond == 4 :
  81. htmltext = "8662-0.htm"
  82. elif cond > 4 :
  83. htmltext = "8662-2.htm"
  84. elif npcId == FORGOTTEN_MONUMENT_3 :
  85. if cond == 5 :
  86. htmltext = "8663-0.htm"
  87. elif cond > 5 :
  88. htmltext = "8663-2.htm"
  89. elif npcId == FORGOTTEN_MONUMENT_4 :
  90. if cond == 6 :
  91. htmltext = "8664-0.htm"
  92. elif cond > 6 :
  93. htmltext = "8664-2.htm"
  94. return htmltext
  95. QUEST = Quest(31,"31_SecretBuriedInTheSwamp","Secret Buried In The Swamp")
  96. CREATED = State('Start', QUEST)
  97. STARTED = State('Started', QUEST)
  98. COMPLETED = State('Completed', QUEST)
  99. QUEST.setInitialState(CREATED)
  100. QUEST.addStartNpc(ABERCROMBIE)
  101. CREATED.addTalkId(ABERCROMBIE)
  102. STARTED.addTalkId(ABERCROMBIE)
  103. COMPLETED.addTalkId(ABERCROMBIE)
  104. for i in range(8661,8666):
  105. STARTED.addTalkId(i)
  106. STARTED.addQuestDrop(ABERCROMBIE,KRORINS_JOURNAL,1)
  107. print "importing quests: 31: Secret Buried In The Swamp"