Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.96 KB | None | 0 0
  1. local keywordHandler = KeywordHandler:new()
  2. local npcHandler = NpcHandler:new(keywordHandler)
  3. NpcSystem.parseParameters(npcHandler)
  4. local talkState = {}
  5.  
  6. function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
  7. function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
  8. function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
  9. function onThink() npcHandler:onThink() end
  10.  
  11. function creatureSayCallback(cid, type, msg)
  12. if(not npcHandler:isFocused(cid)) then
  13. return false
  14. end
  15.  
  16. local storageChildren = 8823 -- Storagevalue Children of the Revolution Quest (finished = 2)
  17. local storageWrath = 42324 -- Storagevalue Wrath of the Emperor (finished = )
  18. local mark1 = {x = 33356,y = 31180, z = 7} -- First mark (entrance)(Wrath)
  19. local mark2 = {x = 33173,y = 31075, z = 7} -- Second mark (Wrath)
  20.  
  21. --Josef part--
  22. local storage = getPlayerStorageValue(cid, 93800)
  23. local storagee = getPlayerStorageValue(cid, 93802)
  24. --Josef part--
  25.  
  26. if (getPlayerStorageValue(cid,storageChildren) ~= 2) then
  27. --Josef part2--
  28. if msgcontains(msg, 'mission') then
  29. if (storage ~= 1) then
  30. npcHandler:say({'Zzo you are offering your help to a lizzard? Hmm, unuzzual. I don\'t know if I can fully truzzt you yet. ...', 'You\'ll have to work to earn my truzzt.'}, cid)
  31. setPlayerStorageValue(cid, 93800, 1)
  32. elseif (storagee == 1) then
  33. npcHandler:say('What newzz do you bring? Did you find any cluezz about zzeir whereaboutzz?', cid)
  34. talkState[cid] = 3
  35. elseif (storagee == 5) then
  36. npcHandler:say({'If I\'m correct, zze portal in zze chamber beyond zze mechanizzm will lead you to zze great gate. It izz perfectly pozzible, however, zzat you will not be tranzzported directly into zze area. ...', 'You will razzer be brought to a plazze clozze by your goal. Where exzzactly, I cannot zzay. ...','Take all your courage and walk zze pazz zzrough zze portal. At leazzt TRY it - after all, I didn\'t make you my pupil for nozzing, '.. getCreatureName(cid) ..'. I hope you are prepared. ...', 'You did well on your quezzt zzo far. I hope you will reach zze great gate in time. If we are lucky, it will zztill be open. ...', 'If not, it will be already overrun by enemy zzoldierzz. Direct confrontation will be inevitable in zzat cazze, palezzkin. Now clear your mind and approach zze portal.'}, cid)
  37. setPlayerStorageValue(cid, 39721, 1)
  38. setPlayerStorageValue(cid, 93802, 7)
  39. elseif (storagee == 7) then
  40. if getPlayerStorageValue(cid, 8823) == 1 then
  41. npcHandler:say({'Too clozze, far too clozze. I felt a huge impact not long after you left. Zze war machinery of zze emperor muzzt finally have been zztarted. ...', 'I focuzzed and could only hope zzat I would reach you before everyzzing wazz too late. If I hadn\'t been able to tranzzport you here, our cauzze would have been lozzt. ...', 'I\'m afraid we cannot continue zzizz fight here today. Zze rezzizztanzze izz zztill fragile. I\'m afraid, zzere izz zztill much left to do. We\'ll have to prepare for war. ...', 'You\'ve helped uzz a great deal during zzezze dark hourzz, I\'ve got zzomezzing for you my friend. Pleazze, take zzizz zzerpent crezzt azz a zzign of my deep rezzpect. ...', 'Rezzt for now, you will need it - you have earned it.'}, cid)
  42. doPlayerAddItem(cid, 11112, 1)
  43. doPlayerAddExperience(cid, 10000)
  44. setPlayerStorageValue(cid, 8823, 2)
  45. end
  46. end
  47. elseif msgcontains(msg, 'yes') and (talkState[cid] == 3) then
  48. npcHandler:say({'Aaah, zzezze look zzertainly interezzting. Zzezze manuzzcriptzz show uzz zzeveral locationzz of zze enemy troopzz. ...', 'I\'m imprezzed, zzoftzzkin. Maybe you can be of zzome more help.'}, cid)
  49. setPlayerStorageValue(cid, 93802, 5)
  50. talkState[cid] = 0
  51. end
  52. --Josef part2--
  53. else
  54. if (getPlayerStorageValue(cid,storageWrath) == 0) then
  55.  
  56. if(msgcontains(msg, 'mission')) then
  57. npcHandler:say({'Zze attackzz have weakened our enemy zzignificantly. Yet, your quezzt continuezz. Bezzidezz zzome tazzkzz you could take, zze zzreat of zze {emperor} izz zztill hanging over our headzz like a rain cloud. ...','Zzo, are you indeed willing to continue zze fight for our cauzze?'}, cid)
  58. talkState[cid] = 1
  59.  
  60. elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
  61. npcHandler:say({'You continue to imprezz, zzoftzzkin ...','A contact of zze rezzizztanzze izz located furzzer in zze norzz of Zao ...','Zze emperor will drag hizz forzzezz to zze {great gate} now to bolzzter hizz defenzze. Zzinzze we attacked zze gate directly, he will not expect uzz taking a completely different route to reach zze norzzern territoriezz. ...','I azzume you are already geared up and ready to conquer zze norzz?'}, cid)
  62. talkState[cid] = 2
  63.  
  64. elseif(msgcontains(msg, 'yes') and talkState[cid] == 2) then
  65. npcHandler:say({'Your determination izz highly appreciated. To zzneak pazzt zze eyezz of zze enemy, you will have to uzze a diverzzion. Zzere are zzeveral old {tunnelzz}h beneazz zze zzoil of Zzao. ...','One of zzem izz uzzed azz a maintenanzze connection by enemy lizardzz. To enter it, you will have to uzze a dizzguizze. Zzomezzing like a crate perhapzz.','Mh, if you can find zzome nailzz - 3 should be enough - and 1 piezze of wood, I should be able to create an appropriate cazzing. Return to me if you found zze itemzz and we will talk about zze next zztep.'}, cid)
  66. talkState[cid] = 0
  67. setPlayerStorageValue(cid,storageWrath,1)
  68.  
  69. end
  70.  
  71. elseif (getPlayerStorageValue(cid,storageWrath) == 1) then
  72.  
  73. if(msgcontains(msg, 'mission')) then
  74. npcHandler:say({'Ah you have returned. I azzume you already found zzome itemzz to {build} a proper dizzguizze?'}, cid)
  75. talkState[cid] = 1
  76.  
  77. elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
  78. if(getPlayerItemCount(cid, 5901) >= 1 and getPlayerItemCount(cid, 8309) >= 3) then
  79. npcHandler:say({'Very good, I am confident zzizz will zzuffizze. Now I can {build} and mark a {crate} large enough for you to fit in - while zztill being able to breazze of courzze - and I will mark it in our tongue zzo it will look lezz zzuzzpizziouzz. ...','Wizz zzeir eyezz towardzz zze {gate}, your chanzzezz to zzlip zzrough have never been better. I will keep zze zzpare materialzz here wizz me, we can alwayzz {build} a new one if you need to.'}, cid)
  80. talkState[cid] = 2
  81. else
  82. npcHandler:say({'Mh, if you can find zzome nailzz - 3 should be enough - and 1 piezze of wood, I should be able to create an appropriate cazzing. Return to me if you found zze itemzz and we will talk about zze next zztep.'}, cid)
  83. end
  84. elseif(msgcontains(msg, 'crate') and talkState[cid] == 2) then
  85. npcHandler:say({'Ah I zzee. You are ready for your mizzion and waiting for me to create and mark zze crate?'}, cid)
  86. talkState[cid] = 3
  87.  
  88. elseif(msgcontains(msg, 'yes') and talkState[cid] == 3) then
  89. npcHandler:say({'Alright. Let uzz create a crate. Hm. Let me zzee.','Good. Zzat will do. ...','Zze maintenanzze tunnelzz are in zze eazzt of zze plainzz, near ze coazt. Here, I will mark zzem on your map.','Uzze zze dizzguizze wizzely, try to hide in zze dark and avoid being zzeen at all cozzt. ...','Onzze you have reached zze norzz, you can find zze rezzizztanzze hideout at zze ozzer zzpot I marked on your map. Now hurry.'}, cid)
  90. if doPlayerRemoveItem(cid,5901,1) and doPlayerRemoveItem(cid,8309,3) then
  91. doPlayerAddItem(cid,12245,1)
  92. setPlayerStorageValue(cid,storageWrath,2)
  93. doPlayerAddMapMark(cid, mark1, MAPMARK_CROSS, 'Maintenance Tunnel Entry')
  94. doPlayerAddMapMark(cid, mark2, MAPMARK_CROSS, 'Resistance Hideout')
  95. talkState[cid] = 0
  96. end
  97. end
  98. -------------------- MISSION 2 ----------------
  99. elseif (getPlayerStorageValue(cid,storageWrath) == 2) and (getPlayerStorageValue(cid,42830) == 2) then
  100.  
  101. if(msgcontains(msg, 'mission')) and (getPlayerStorageValue(cid,42830) == 2 and getPlayerStorageValue(cid,storageWrath) == 2) then
  102. npcHandler:say({'You ezztablished zze connection to zze hideout, good. But zzizz izz no time to rezzt. Your new tazzk will be quite different. ...','Zze gardenzz are plagued by a creature. Zze former keeper of zzizz garden became an abomination of madnezz zzat needzz to be zztopped. ...','He hidezz deep underground and it will be dangerouzz to challenge him in hizz lair but I am willing to rizzk it. ...','Find him, dezztroy him, bring me hizz - I uhm, mean it izz utterly nezzezzary for you to deliver me a proof of hizz deazz. ...','Now go - what are you waiting for, zzoftzzkin? Ready to finish what needzz to be finished?'}, cid)
  103. talkState[cid] = 1
  104. elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
  105. npcHandler:say({'Fine. I guezz poizzoning zzome of hizz plantzz will be enough to lure him out of hizz conzzealment. Zzizz plant poizzon here should allow you to do zzome zzignificant damage, take it. ...','You can find him eazzt of zze corrupted gardenzz. Zzere uzzed to be a zzmall domizzile zzere but it hazz probably been conzzumed by zze corruption zzo beware. And now - go.'}, cid)
  106. doPlayerAddItem(cid,12281,1)
  107. talkState[cid] = 0
  108. end
  109. -------------------- MISSION 3 ----------------
  110. elseif (getPlayerStorageValue(cid,42830) == 2 and getPlayerStorageValue(cid,storageWrath) == 3) then
  111. if(msgcontains(msg, 'mission')) then
  112. npcHandler:say({'Zzo... you finished him. Show me hizz head, will you?'}, cid)
  113. talkState[cid] = 4
  114. elseif(msgcontains(msg, 'yes') and talkState[cid] == 4 and getPlayerItemCount(cid, 12284) >= 1) then
  115. npcHandler:say({'Zzizz izz not hizz head but clearly belonged to zze keeper. I - I am imprezzed. You can go now. Leave me alone for a zzecond.'}, cid)
  116. setPlayerStorageValue(cid,storageWrath,4)
  117. doPlayerRemoveItem(cid, 12284, 1)
  118. talkState[cid] = 0
  119. end
  120.  
  121. -------------------- MISSION 4 ----------------
  122. elseif (getPlayerStorageValue(cid,42830) == 2 and getPlayerStorageValue(cid,storageWrath) == 4 and getPlayerStorageValue(cid,12288) == -1) then
  123. if(msgcontains(msg, 'mission')) then
  124. npcHandler:say({'At zze dawn of time, zze children of zze Great Zznake were numerouzz. Zzey daringly colonizzed many partzz of zze world. But all bravery did not help againzzt zze sheer number of enemiezz zzey encountered. ...','And while zze entitiezz zze unbelieverzz call godzz battled for power out of vanity, zze fazze of zze world changed violently. ...','Many zzentrezz of our magnifizzent zzivilizzation were dezztroyed and only two realmzz zzat we know of remained intact but lozzt contact to each ozzer. ...','In vizzionzz, zze Great Zznake revealed to Zalamon zze exzzizztenzze of ozzer lizzard people in a vazzt jungle in a far away land. ...','Zzough zze lizardzz of zze land failed zze Great Zznake and lozzt itzz favour, zzey are zztill in pozzezzion of ancient reliczz of immenzze power, onzze imbued by zze Great Zznake himzzelf. ...','I had vizzionzz of an - item. Yezz. It may be uzzeful for uzz - I mean you, ezzpecially you. ...','We need a zzeptre of power zzat can be found in zze underground of an ancient temple. It hazz been overrun by zzavage apezz and you will have to fight zzem and zze ancient guardianzz of zze temple azz well. Get uzz zzat zzeptre wherever it might be. ...','It wazz revealed zzat it hazz been zzplit into 3 partzz for reazzonzz zzat are of no importanzze anymore. Zzizz powerful devizze could help uzz in our battle againzzt zze emperor. ...','A shaft, a cuzzp, and an emerald form a zzeptre of zzuch power zzat zze partzz were hidden and are now guarded by vile creaturezz. ...','Find it. Retrieve it. And bring it back to me.'}, cid)
  125. setPlayerStorageValue(cid,82382,1)
  126. setPlayerStorageValue(cid,12288,1)
  127. talkState[cid] = 0
  128. end
  129.  
  130. elseif (getPlayerStorageValue(cid,42830) == 2 and getPlayerStorageValue(cid,storageWrath) == 4 and getPlayerStorageValue(cid,12288) == 1)then
  131. if(msgcontains(msg, 'mission')) then
  132. npcHandler:say({'You - azzembled zze zzeptre? Hand it out, give it to me, will you?'}, cid)
  133. talkState[cid] = 5
  134. elseif(msgcontains(msg, 'yes') and talkState[cid] == 5) then
  135. if(getPlayerItemCount(cid, 12288) >= 1 ) then
  136. npcHandler:say({'Finally. At lazzt. Zze zzeptre izz - ourzz. Ourzz of courzze. A weapon we should uzze wizzely for our cauzze. I need a zzecond or two. Do you leave me already?'}, cid)
  137. setPlayerStorageValue(cid,storageWrath,5)
  138. doPlayerRemoveItem(cid, 12288, 1)
  139. talkState[cid] = 0
  140. end
  141. -------------------- MISSION 5 ----------------
  142. elseif (getPlayerStorageValue(cid,42830) == 2 and getPlayerStorageValue(cid,storageWrath) == 5 and getPlayerStorageValue(cid,12288) == 1) then
  143. if(msgcontains(msg, 'mission')) then
  144. npcHandler:say({'Now we need to get clozzer to zze {emperor} himzzelf. A hive of beezz would defend zzeir queen wizz zzeir lives in cazze an enemy gained entranzze. Zzizz makezz a formidable defenzze line, nearly inviolable. ...','But a zztranger directly in zze midzzt of zze hive will be acczzepted - after all it izz not pozzible to overcome zzuch a formidable defenzze which izz nearly inviolable, or izz it? Ha. ...','Now zzat you overcame zzeir linezz of defenzze at zze {great gate}, you only need to find a way to enter zzeir home. ...','Head zztraight to zze entranzze of zze zzity. If you can convinzze zze guardzz to let you enter zze zzity, you should be able to reach our contact zzere wizz eazze. ...','We have alzzo forged zome paperzz for you and zzent zzem to zze zzity. Your victory in zze arena iz well known in our land. Wizz zze help of zzezze paperzz you will pretend zzat zzome of zze higher officialzz want to talk to you about your battle. ...','Zzizz way you will be able to enter zze zzity of zze dragon emperor and meet our contact zzere in zze imperial offizze. He will give you zze next inzztructionzz.'}, cid)
  145. setPlayerStorageValue(cid,23382,1)
  146. talkState[cid] = 0
  147. end
  148. end
  149. end
  150. end
  151. return true
  152. end
  153.  
  154. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  155. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement