Advertisement
Guest User

____init___.py

a guest
Nov 19th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.37 KB | None | 0 0
  1. import sys
  2. from com.dream.game.model.quest import State
  3. from com.dream.game.model.quest import QuestState
  4. from com.dream.game.model.quest.jython import QuestJython as JQuest
  5.  
  6. qn = "255_Tutorial"
  7.  
  8. # table for Quest Timer ( Ex == -2 ) [voice, html]
  9. QTEXMTWO = {
  10. 0 : ["tutorial_voice_001a","tutorial_human_fighter001.htm"],
  11. 10 : ["tutorial_voice_001b","tutorial_human_mage001.htm"],
  12. 18 : ["tutorial_voice_001c","tutorial_elven_fighter001.htm"],
  13. 25 : ["tutorial_voice_001d","tutorial_elven_mage001.htm"],
  14. 31 : ["tutorial_voice_001e","tutorial_delf_fighter001.htm"],
  15. 38 : ["tutorial_voice_001f","tutorial_delf_mage001.htm"],
  16. 44 : ["tutorial_voice_001g","tutorial_orc_fighter001.htm"],
  17. 49 : ["tutorial_voice_001h","tutorial_orc_mage001.htm"],
  18. 53 : ["tutorial_voice_001i","tutorial_dwarven_fighter001.htm"],
  19. }
  20. # table for Client Event Enable (8) [html, x, y, z]
  21. CEEa = {
  22. 0 : ["tutorial_human_fighter007.htm",-71424,258336,-3109],
  23. 10 : ["tutorial_human_mage007.htm",-91036,248044,-3568],
  24. 18 : ["tutorial_elf007.htm",46112,41200,-3504],
  25. 25 : ["tutorial_elf007.htm",46112,41200,-3504],
  26. 31 : ["tutorial_delf007.htm",28384,11056,-4233],
  27. 38 : ["tutorial_delf007.htm",28384,11056,-4233],
  28. 44 : ["tutorial_orc007.htm",-56736,-113680,-672],
  29. 49 : ["tutorial_orc007.htm",-56736,-113680,-672],
  30. 53 : ["tutorial_dwarven_fighter007.htm",108567,-173994,-406],
  31. }
  32. # table for Question Mark Clicked (9 & 11) learning skills [html, x, y, z]
  33. QMCa = {
  34. 0 : ["tutorial_fighter017.htm",-83165,242711,-3720],
  35. 10 : ["tutorial_mage017.htm",-85247,244718,-3720],
  36. 18 : ["tutorial_fighter017.htm",45610,52206,-2792],
  37. 25 : ["tutorial_mage017.htm",45610,52206,-2792],
  38. 31 : ["tutorial_fighter017.htm",10344,14445,-4242],
  39. 38 : ["tutorial_mage017.htm",10344,14445,-4242],
  40. 44 : ["tutorial_fighter017.htm",-46324,-114384,-200],
  41. 49 : ["tutorial_fighter017.htm",-46305,-112763,-200],
  42. 53 : ["tutorial_fighter017.htm",115447,-182672,-1440],
  43. }
  44. # table for Question Mark Clicked (24) newbie lvl [html]
  45. QMCb = {
  46. 0 : "tutorial_human009.htm",
  47. 10 : "tutorial_human009.htm",
  48. 18 : "tutorial_elf009.htm",
  49. 25 : "tutorial_elf009.htm",
  50. 31 : "tutorial_delf009.htm",
  51. 38 : "tutorial_delf009.htm",
  52. 44 : "tutorial_orc009.htm",
  53. 49 : "tutorial_orc009.htm",
  54. 53 : "tutorial_dwarven009.htm",
  55. }
  56. # table for Question Mark Clicked (35) 1st class transfer [html]
  57. QMCc = {
  58. 0 : "tutorial_21.htm",
  59. 10 : "tutorial_21a.htm",
  60. 18 : "tutorial_21b.htm",
  61. 25 : "tutorial_21c.htm",
  62. 31 : "tutorial_21g.htm",
  63. 38 : "tutorial_21h.htm",
  64. 44 : "tutorial_21d.htm",
  65. 49 : "tutorial_21e.htm",
  66. 53 : "tutorial_21f.htm"
  67. }
  68. # table for Tutorial Close Link (26) 2nd class transfer [html]
  69. TCLa = {
  70. 1 : "tutorial_22w.htm",
  71. 4 : "tutorial_22.htm",
  72. 7 : "tutorial_22b.htm",
  73. 11 : "tutorial_22c.htm",
  74. 15 : "tutorial_22d.htm",
  75. 19 : "tutorial_22e.htm",
  76. 22 : "tutorial_22f.htm",
  77. 26 : "tutorial_22g.htm",
  78. 29 : "tutorial_22h.htm",
  79. 32 : "tutorial_22n.htm",
  80. 35 : "tutorial_22o.htm",
  81. 39 : "tutorial_22p.htm",
  82. 42 : "tutorial_22q.htm",
  83. 45 : "tutorial_22i.htm",
  84. 47 : "tutorial_22j.htm",
  85. 50 : "tutorial_22k.htm",
  86. 54 : "tutorial_22l.htm",
  87. 56 : "tutorial_22m.htm"
  88. }
  89. # table for Tutorial Close Link (23) 2nd class transfer [html]
  90. TCLb = {
  91. 4 : "tutorial_22aa.htm",
  92. 7 : "tutorial_22ba.htm",
  93. 11 : "tutorial_22ca.htm",
  94. 15 : "tutorial_22da.htm",
  95. 19 : "tutorial_22ea.htm",
  96. 22 : "tutorial_22fa.htm",
  97. 26 : "tutorial_22ga.htm",
  98. 32 : "tutorial_22na.htm",
  99. 35 : "tutorial_22oa.htm",
  100. 39 : "tutorial_22pa.htm",
  101. 50 : "tutorial_22ka.htm"
  102. }
  103. # table for Tutorial Close Link (24) 2nd class transfer [html]
  104. TCLc = {
  105. 4 : "tutorial_22ab.htm",
  106. 7 : "tutorial_22bb.htm",
  107. 11 : "tutorial_22cb.htm",
  108. 15 : "tutorial_22db.htm",
  109. 19 : "tutorial_22eb.htm",
  110. 22 : "tutorial_22fb.htm",
  111. 26 : "tutorial_22gb.htm",
  112. 32 : "tutorial_22nb.htm",
  113. 35 : "tutorial_22ob.htm",
  114. 39 : "tutorial_22pb.htm",
  115. 50 : "tutorial_22kb.htm"
  116. }
  117. class Quest (JQuest) :
  118.  
  119. def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
  120.  
  121. def onAdvEvent(self,event,npc,player):
  122. st = player.getQuestState(qn)
  123. classId = int(st.getPlayer().getClassId().getId())
  124. string = event[0:2]
  125. htmltext = ""
  126. # USER CONNECTED #
  127.  
  128. if string == "UC" :
  129. playerLevel = player.getLevel()
  130. if playerLevel < 6 and st.getInt("onlyone") == 0 :
  131. uc = st.getInt("ucMemo")
  132. if uc == 0 :
  133. st.set("ucMemo","0")
  134. st.startQuestTimer("QT",5000)
  135. st.set("ucMemo","0")
  136. st.set("Ex","-2")
  137. elif uc == 1 :
  138. st.showQuestionMark(1)
  139. st.playTutorialVoice("tutorial_voice_006")
  140. st.playSound("ItemSound.quest_tutorial")
  141. elif uc == 2 :
  142. if st.getInt("Ex") == 2 :
  143. st.showQuestionMark(3)
  144. st.playSound("ItemSound.quest_tutorial")
  145. if st.getQuestItemsCount(6353) == 1 :
  146. st.showQuestionMark(5)
  147. st.playSound("ItemSound.quest_tutorial")
  148. elif uc == 3 :
  149. st.showQuestionMark(12)
  150. st.playSound("ItemSound.quest_tutorial")
  151. st.onTutorialClientEvent(0)
  152. else :
  153. return
  154.  
  155.  
  156. # QUEST TIMER #
  157.  
  158. elif string == "QT" :
  159. Ex = st.getInt("Ex")
  160. if Ex == -2 :
  161. if classId in QTEXMTWO.keys():
  162. voice, htmltext = QTEXMTWO[classId]
  163. st.playTutorialVoice(voice)
  164. if st.getQuestItemsCount(5588) == 0 :
  165. st.giveItems(5588,1)
  166. st.startQuestTimer("QT",30000)
  167. st.set("Ex","-3")
  168. elif Ex == -3 :
  169. st.playTutorialVoice("tutorial_voice_002")
  170. st.set("Ex","0")
  171. elif Ex == -4 :
  172. st.playTutorialVoice("tutorial_voice_008")
  173. st.set("Ex","-5")
  174.  
  175. # TUTORIAL CLOSE [N] #
  176.  
  177. elif string == "TE" :
  178. if event[2:].isdigit() :
  179. event_id = int(event[2:])
  180. if event_id == 0 :
  181. st.closeTutorialHtml()
  182. elif event_id == 1 :
  183. st.closeTutorialHtml()
  184. st.playTutorialVoice("tutorial_voice_006")
  185. st.showQuestionMark(1)
  186. st.playSound("ItemSound.quest_tutorial")
  187. st.startQuestTimer("QT",30000)
  188. st.set("Ex","-4")
  189. elif event_id == 2 :
  190. st.playTutorialVoice("tutorial_voice_003")
  191. htmltext = "tutorial_02.htm"
  192. st.onTutorialClientEvent(1)
  193. st.set("Ex","-5")
  194. elif event_id == 3 :
  195. htmltext = "tutorial_03.htm"
  196. st.onTutorialClientEvent(2)
  197. elif event_id == 5 :
  198. htmltext = "tutorial_05.htm"
  199. st.onTutorialClientEvent(8)
  200. elif event_id == 7 :
  201. htmltext = "tutorial_100.htm"
  202. st.onTutorialClientEvent(0)
  203. elif event_id == 8 :
  204. htmltext = "tutorial_101.htm"
  205. st.onTutorialClientEvent(0)
  206. elif event_id == 10 :
  207. htmltext = "tutorial_103.htm"
  208. st.onTutorialClientEvent(0)
  209. elif event_id == 12 :
  210. st.closeTutorialHtml()
  211. elif event_id == 23 :
  212. if classId in TCLb.keys():
  213. htmltext = TCLb[classId]
  214. elif event_id == 24 :
  215. if classId in TCLc.keys():
  216. htmltext = TCLc[classId]
  217. elif event_id == 25 :
  218. htmltext = "tutorial_22cc.htm"
  219. elif event_id == 26 :
  220. if classId in TCLa.keys():
  221. htmltext = TCLa[classId]
  222. elif event_id == 27 :
  223. htmltext = "tutorial_29.htm"
  224. elif event_id == 28 :
  225. htmltext = "tutorial_28.htm"
  226. # CLIENT EVENT ENABLE [N] #
  227.  
  228. elif string == "CE" :
  229. if event[2:].isdigit() :
  230. event_id = int(event[2:])
  231. playerLevel = player.getLevel()
  232. if event_id == 1 :
  233. if playerLevel < 6 :
  234. st.playTutorialVoice("tutorial_voice_004")
  235. htmltext = "tutorial_03.htm"
  236. st.playSound("ItemSound.quest_tutorial")
  237. st.onTutorialClientEvent(2)
  238. elif event_id == 2 :
  239. if playerLevel < 6 :
  240. st.playTutorialVoice("tutorial_voice_005")
  241. htmltext = "tutorial_05.htm"
  242. st.playSound("ItemSound.quest_tutorial")
  243. st.onTutorialClientEvent(8)
  244. elif event_id == 8 :
  245. if playerLevel < 6 :
  246. if classId in CEEa.keys():
  247. htmltext, x, y, z = CEEa[classId]
  248. st.playSound("ItemSound.quest_tutorial")
  249. st.addRadar(x,y,z)
  250. st.playTutorialVoice("tutorial_voice_007")
  251. st.set("ucMemo","1")
  252. st.set("Ex","-5")
  253. elif event_id == 30 :
  254. if playerLevel < 6 and st.getInt("Die") == 0:
  255. st.playTutorialVoice("tutorial_voice_016")
  256. st.playSound("ItemSound.quest_tutorial")
  257. st.set("Die","1")
  258. st.showQuestionMark(8)
  259. st.onTutorialClientEvent(0)
  260. elif event_id == 800000 :
  261. if playerLevel < 6 and st.getInt("sit") == 0:
  262. st.playTutorialVoice("tutorial_voice_018")
  263. st.playSound("ItemSound.quest_tutorial")
  264. st.set("sit","1")
  265. st.onTutorialClientEvent(0)
  266. htmltext = "tutorial_21z.htm"
  267. elif event_id == 40 :
  268. if playerLevel == 5 and player.getClassId().level() == 0:
  269. if st.getInt("lvl") < 5 :
  270. if not player.getClassId().isMage() or classId == 49:
  271. st.playTutorialVoice("tutorial_voice_014")
  272. st.showQuestionMark(9)
  273. st.playSound("ItemSound.quest_tutorial")
  274. st.set("lvl","5")
  275. elif playerLevel == 6 and st.getInt("lvl") < 6 and player.getClassId().level() == 0:
  276. st.playTutorialVoice("tutorial_voice_020")
  277. st.playSound("ItemSound.quest_tutorial")
  278. st.showQuestionMark(24)
  279. st.set("lvl","6")
  280. elif playerLevel == 7 and player.getClassId().isMage() and classId != 49:
  281. if st.getInt("lvl") < 7 and player.getClassId().level() == 0:
  282. st.playTutorialVoice("tutorial_voice_019")
  283. st.playSound("ItemSound.quest_tutorial")
  284. st.set("lvl","7")
  285. st.showQuestionMark(11)
  286. elif playerLevel == 10 :
  287. if st.getInt("lvl") < 10:
  288. st.playTutorialVoice("tutorial_voice_030")
  289. st.playSound("ItemSound.quest_tutorial")
  290. st.set("lvl","10")
  291. st.showQuestionMark(27)
  292. elif playerLevel == 15 :
  293. if st.getInt("lvl") < 15:
  294. st.playSound("ItemSound.quest_tutorial")
  295. st.set("lvl","15")
  296. st.showQuestionMark(17)
  297. elif playerLevel == 19 :
  298. if st.getInt("lvl") < 19:
  299. race = st.getPlayer().getRace().ordinal()
  300. if race != 5 and player.getClassId().level() == 0 :
  301. if classId in [0,10,18,25,31,38,44,49,52]:
  302. #st.playTutorialVoice("tutorial_voice_???")
  303. st.playSound("ItemSound.quest_tutorial")
  304. st.set("lvl","19")
  305. st.showQuestionMark(35)
  306. elif playerLevel == 35 :
  307. if st.getInt("lvl") < 35:
  308. race = st.getPlayer().getRace().ordinal()
  309. if race != 5 and player.getClassId().level() == 1 :
  310. if classId in [1,4,7,11,15,19,22,26,29,32,35,39,42,45,47,50,54,56]:
  311. #st.playTutorialVoice("tutorial_voice_???")
  312. st.playSound("ItemSound.quest_tutorial")
  313. st.set("lvl","35")
  314. st.showQuestionMark(34)
  315. elif event_id == 45 :
  316. if playerLevel < 6 :
  317. if st.getInt("HP") == 0:
  318. st.playTutorialVoice("tutorial_voice_017")
  319. st.playSound("ItemSound.quest_tutorial")
  320. st.set("HP","1")
  321. st.showQuestionMark(10)
  322. st.onTutorialClientEvent(800000)
  323. elif event_id == 57 :
  324. if playerLevel < 6 and st.getInt("Adena") == 0:
  325. st.playTutorialVoice("tutorial_voice_012")
  326. st.playSound("ItemSound.quest_tutorial")
  327. st.set("Adena","1")
  328. st.showQuestionMark(23)
  329. elif event_id == 6353 :
  330. if playerLevel < 6 and st.getInt("Gemstone") == 0:
  331. st.playTutorialVoice("tutorial_voice_013")
  332. st.playSound("ItemSound.quest_tutorial")
  333. st.set("Gemstone","1")
  334. st.showQuestionMark(5)
  335.  
  336.  
  337. # QUESTION MARK CLICKED [N] #
  338.  
  339. elif string == "QM" :
  340. if event[2:].isdigit() :
  341. MarkId = int(event[2:])
  342. if MarkId == 1 :
  343. st.playTutorialVoice("tutorial_voice_007")
  344. st.set("Ex","-5")
  345. if classId in CEEa.keys():
  346. htmltext, x, y, z = CEEa[classId]
  347. st.addRadar(x,y,z)
  348. elif MarkId == 3 :
  349. htmltext = "tutorial_09.htm"
  350. elif MarkId == 5 :
  351. if classId in CEEa.keys():
  352. htmltext, x, y, z = CEEa[classId]
  353. st.addRadar(x,y,z)
  354. htmltext = "tutorial_11.htm"
  355. elif MarkId == 7 :
  356. htmltext = "tutorial_15.htm"
  357. st.set("ucMemo","3")
  358. elif MarkId == 8 :
  359. htmltext = "tutorial_18.htm"
  360. elif MarkId == 9 :
  361. if classId in QMCa.keys():
  362. htmltext, x, y, z = QMCa[classId]
  363. st.addRadar(x,y,z)
  364. elif MarkId == 10 :
  365. htmltext = "tutorial_19.htm"
  366. elif MarkId == 11 :
  367. if classId in QMCa.keys():
  368. htmltext, x, y, z = QMCa[classId]
  369. st.addRadar(x,y,z)
  370. elif MarkId == 12 :
  371. htmltext = "tutorial_15.htm"
  372. st.set("ucMemo","4")
  373. elif MarkId == 13 :
  374. htmltext = "tutorial_30.htm"
  375. elif MarkId == 17 :
  376. htmltext = "tutorial_27.htm"
  377. elif MarkId == 23 :
  378. htmltext = "tutorial_24.htm"
  379. elif MarkId == 24 :
  380. if classId in QMCb.keys():
  381. htmltext = QMCb[classId]
  382. elif MarkId == 26 :
  383. if st.getPlayer().getClassId().isMage() and classId != 49 :
  384. htmltext = "tutorial_newbie004b.htm"
  385. else :
  386. htmltext = "tutorial_newbie004a.htm"
  387. elif MarkId == 27 :
  388. htmltext = "tutorial_20.htm"
  389. elif MarkId == 34 :
  390. htmltext = "tutorial_28.htm"
  391. elif MarkId == 35 :
  392. if classId in QMCc.keys():
  393. htmltext = QMCc[classId]
  394. if htmltext == "": return
  395. st.showTutorialHTML(str(htmltext))
  396. return
  397.  
  398. QUEST = Quest(255,qn,"Tutorial")
  399.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement