9
3

ZninkiFlatzazzle.lua 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/ZninkiFlatzazzle.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.11.01 04:11:39
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  10. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  11. local SinceTheWheel = 5919
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC,9, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC,SinceTheWheel)
  15. SetInfoStructString(NPC, "action_state", "gathering_search")
  16. end
  17. function hailed(NPC, Spawn)
  18. SetTarget(NPC,Spawn)
  19. if GetFactionAmount(Spawn,12) <0 then
  20. FaceTarget(NPC, Spawn)
  21. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  22. elseif not HasLanguage(Spawn,6) then
  23. FaceTarget(NPC, Spawn)
  24. Garbled(NPC,Spawn)
  25. else
  26. if GetQuestStep(Spawn,SinceTheWheel) ==1 then
  27. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_"..MakeRandomInt(1,3).."_1020.mp3","My tracking device does not show the Bisecter with you! Go and get it!... Please?","confused",0,0,Spawn, 6)
  28. FaceTarget(NPC, Spawn)
  29. else
  30. Dialog1(NPC,Spawn)
  31. end
  32. end
  33. end
  34. function InRange(NPC,Spawn)
  35. if GetFactionAmount(Spawn,12)<0 then
  36. FactionCheckCallout(NPC,Spawn,faction)
  37. else
  38. if not HasLanguage(Spawn,6)then
  39. if math.random(0,100)<80 then
  40. PlayFlavor(NPC, "", "", "gathering_search", 0, 0, Spawn)
  41. Garbled(NPC,Spawn)
  42. end
  43. elseif CanReceiveQuest(Spawn,SinceTheWheel) then
  44. FaceTarget(NPC, Spawn)
  45. PlayFlavor(NPC, "", "My Bread Bisector! My beautiful Bread Bisector! I'll never rest until it's returned to me!", "grumble", 0, 0, Spawn, 6)
  46. end
  47. end
  48. end
  49. function Dialog1(NPC,Spawn)
  50. SetTarget(NPC,Spawn)
  51. FaceTarget(NPC, Spawn)
  52. Dialog.New(NPC, Spawn)
  53. if CanReceiveQuest(Spawn,SinceTheWheel) then
  54. Dialog.AddDialog("Oh dear! The riff-raff that's allowed to roam free in this town. Don't just stand there. Help me locate a sprocket that can connect with this flizgig. I must hurry!")
  55. PlayFlavor(NPC, "","","frustrated",0,0, Spawn)
  56. else
  57. Dialog.AddDialog("I wonder if my next invention will ever live up to my Bisector... What if I attached rockets...")
  58. PlayFlavor(NPC, "","","ponder",0,0, Spawn)
  59. end
  60. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_"..MakeRandomInt(1,3).."_1020.mp3",0,0)
  61. Dialog.AddLanguage(6)
  62. if CanReceiveQuest(Spawn, SinceTheWheel) then
  63. Dialog.AddOption("Why do you need it?", "Dialog1a")
  64. elseif GetQuestStep(Spawn, SinceTheWheel)==2 then
  65. Dialog.AddOption("Here is the orcish sword you requested.", "Dialog2")
  66. end
  67. Dialog.AddOption("I don't have time for this.")
  68. Dialog.Start()
  69. end
  70. function Dialog1a(NPC,Spawn)
  71. SetTarget(NPC,Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Dialog.New(NPC, Spawn)
  74. Dialog.AddDialog("I need it to complete a tracking device to locate some squatter who absconded with my Bread Bisector! Ah-ha! Found one! Now I can activate the anti-theft mechanism on the Bisector ... just so ... it's a good thing I installed that Sanguine Atomizing Locator.")
  75. Dialog.AddLanguage(6)
  76. PlayFlavor(NPC, "","","ponder",0,0, Spawn)
  77. Dialog.AddOption("Sangui-what? Are you mad?", "Dialog1b")
  78. Dialog.AddOption("I have much better thing to do than listen to this!")
  79. Dialog.Start()
  80. end
  81. function Dialog1b(NPC,Spawn)
  82. SetTarget(NPC,Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Dialog.New(NPC, Spawn)
  85. Dialog.AddDialog("You've never heard of my Sanguine Atomizing Locator? It's how I keep thieves from using my inventions. See, if I clink this tuning fork like this, the Locator rockets the thief a mile into the air, where he suddenly explodes in a spectacular burst of blood ... making him much easier to locate. Ah-ha! You see that red cloud up there? That must be the vagrant who took my Bread Bisector! Oh, I simply must retrieve it!")
  86. Dialog.AddLanguage(6)
  87. PlayFlavor(NPC, "","","confused",0,0, Spawn)
  88. Dialog.AddOption("Impressive! I suppose I could try to find it for you.", "OfferQuest1")
  89. Dialog.AddOption("Potentional explosions sound too messy for me.")
  90. Dialog.Start()
  91. end
  92. function OfferQuest1(NPC,Spawn)
  93. if CanReceiveQuest(Spawn, SinceTheWheel) then
  94. OfferQuest(NPC, Spawn, SinceTheWheel)
  95. end
  96. end
  97. function Dialog2(NPC,Spawn)
  98. SetTarget(NPC,Spawn)
  99. FaceTarget(NPC, Spawn)
  100. Dialog.New(NPC, Spawn)
  101. Dialog.AddDialog("Yes! Yes! You've found it! I knew when those squatters moved in they would be trouble... Please, you must accept this prototype as payment. I'll even disable the Sanguine Atomizing Locator so you need not worry about blowing up in the future! I can envision the improvements I can make on this design!")
  102. Dialog.AddLanguage(6)
  103. PlayFlavor(NPC, "","","heelclick",0,0, Spawn)
  104. Dialog.AddOption("It just looks like a knife...","Dialog2a")
  105. Dialog.Start()
  106. end
  107. function Dialog2a(NPC,Spawn)
  108. SetTarget(NPC,Spawn)
  109. FaceTarget(NPC, Spawn)
  110. Dialog.New(NPC, Spawn)
  111. Dialog.AddDialog("It's no ordinary knife, my friend. It's the Bread Bisector! See, you take an ordinary loaf of bread and, using the Bisector, you slice it in twain! And if you adjust this little knob here, you can bisect it many many times over ... creating \"slices.\" Have you ever seen the like?")
  112. Dialog.AddLanguage(6)
  113. PlayFlavor(NPC, "","","scheme",0,0, Spawn)
  114. Dialog.AddOption("Remarkable!","Finish")
  115. Dialog.AddOption("Amazing!","Finish")
  116. Dialog.AddOption("Glorious!","Finish")
  117. Dialog.Start()
  118. end
  119. function Finish(NPC,Spawn)
  120. SetStepComplete(Spawn, SinceTheWheel, 2)
  121. end
  122. --
  123. --You've never heard of my Sanguine Atomizing Locator? It's how I keep thieves from using my inventions. See, if I clink this tuning fork like this, the Locator rockets the thief a mile into the air, where he suddenly explodes in a spectacular burst of blood ... making him much easier to locate. Ah-ha! You see that red cloud up there? That must be the goblin who took my Bread Bisector! Oh, I simply must retrieve it!
  124. --Would you? That would be most satisfactory! Why yes, I like that idea very much. I shall eagerly await the return of my ingenious device – the Bread Bisector!
  125. --I've found the Bread Bisector on one of the a Blackshield pillagers.
  126. --My Bread Bisector! My beautiful Bread Bisector! I'll never rest until it's returned to me!
  127. --I've managed to find the Bread Bisector, which looks awfully similar to a knife.
  128. --It's no ordinary knife, my friend. It's the Bread Bisector! See, you take an ordinary loaf of bread and, using the Bisector, you slice it in twain! And if you adjust this little knob here, you can bisect it many many times over ... creating "slices." Have you ever seen the like?