9
3

OrianDRak.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. --[[
  2. Script Name : SpawnScripts/LongshadowAlley/OrianDRak.lua
  3. Script Purpose : Orian D`Rak
  4. Script Author : torsten
  5. Script Date : 2022.07.18
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local OgreWatch = 5676
  10. local InformationGatheringFromaFishmonger = 5677
  11. function spawn(NPC)
  12. ProvidesQuest(NPC, OgreWatch)
  13. ProvidesQuest(NPC, InformationGatheringFromaFishmonger)
  14. SetPlayerProximityFunction(NPC, 11, "InRange", "LeaveRange")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn)
  20. if GetFactionAmount(Spawn,12) <0 then
  21. FaceTarget(NPC, Spawn)
  22. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  23. else
  24. if not HasCompletedQuest(Spawn, OgreWatch) and not HasQuest(Spawn, OgreWatch) then
  25. if MakeRandomInt(0, 100) <= 100 then
  26. FaceTarget(NPC, Spawn)
  27. PlayFlavor(NPC, "", "How dare you barge into my house! Who do you think you are, fool?", "frustrated", 0, 0, Spawn, 0)
  28. end
  29. elseif HasCompletedQuest(Spawn, OgreWatch) and not HasCompletedQuest(Spawn, InformationGatheringFromaFishmonger) and not HasQuest(Spawn, InformationGatheringFromaFishmonger) then
  30. if MakeRandomInt(0, 100) <= 85 then
  31. FaceTarget(NPC, Spawn)
  32. PlayFlavor(NPC, "", "Get out before I call the Militia, you disrespectful worm!", "shakefist", 0, 0, Spawn, 0)
  33. end
  34. end
  35. end
  36. end
  37. function hailed(NPC, Spawn)
  38. if GetFactionAmount(Spawn,12) <0 then
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  41. elseif CanReceiveQuest(Spawn, OgreWatch) then
  42. Dialog1(NPC,Spawn)
  43. elseif HasQuest(Spawn, OgreWatch) and GetQuestStep(Spawn,OgreWatch) ==1 then
  44. Dialog2(NPC,Spawn)
  45. elseif CanReceiveQuest(Spawn, InformationGatheringFromaFishmonger) then
  46. Dialog3 (NPC,Spawn)
  47. elseif HasQuest(Spawn, InformationGatheringFromaFishmonger) then
  48. Dialog4 (NPC,Spawn)
  49. else
  50. Dialog1(NPC,Spawn)
  51. end
  52. end
  53. function Dialog1(NPC,Spawn)
  54. FaceTarget(NPC, Spawn)
  55. Dialog.New(NPC, Spawn)
  56. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  57. Dialog.AddDialog("What on Norrath are you doing here? Get out of my house this instant!")
  58. Dialog.AddVoiceover("voiceover/english/master_malvonicus/tutorial_island02/mastermalvonicus001.mp3", 2916930572, 3452710584)
  59. if CanReceiveQuest(Spawn, OgreWatch) then
  60. Dialog.AddOption("What happened here? It's a mess!","Dialog1a")
  61. end
  62. Dialog.AddOption("Yeesh! Okay, I'm leaving.")
  63. Dialog.Start()
  64. end
  65. function Dialog1a(NPC,Spawn)
  66. FaceTarget(NPC, Spawn)
  67. Dialog.New(NPC, Spawn)
  68. Dialog.AddDialog("Well apparently a group of undesirables, I can only assume ogres by the damage, decided to tear up my place while I was out! My house! I don't even know where to start! Oh, some of these heirlooms from Neriak were irreplaceable! ...and now YOU appear. What do you want?!")
  69. PlayFlavor(NPC, "", "", "grumble", 0, 0, Spawn)
  70. Dialog.AddOption("I'm just looking to make a few coins.","Dialog2a")
  71. Dialog.AddOption("Well that IS too bad. Good luck with... whatever.")
  72. Dialog.Start()
  73. end
  74. function Dialog2a(NPC,Spawn)
  75. FaceTarget(NPC, Spawn)
  76. Dialog.New(NPC, Spawn)
  77. Dialog.AddDialog("Hmmm... perahps I could make use of you. Is your brain matter solid enough to make a deilvery and not lose it? I have a plan to discover what happened here that requires this message to be delievered in ONE piece... unlike these broken furniture pieces you see strewn about.")
  78. if CanReceiveQuest(Spawn, OgreWatch) then
  79. Dialog.AddOption("I'm sure I can deliver your letter in one piece.","Offer1")
  80. end
  81. Dialog.AddOption("Nope. NO time for that.")
  82. Dialog.Start()
  83. end
  84. function Offer1(NPC,Spawn)
  85. OfferQuest(NPC, Spawn, OgreWatch)
  86. end
  87. function Offer2(NPC,Spawn)
  88. OfferQuest(NPC, Spawn, InformationGatheringFromaFishmonger)
  89. end
  90. function Dialog2(NPC,Spawn)
  91. FaceTarget(NPC, Spawn)
  92. Dialog.New(NPC, Spawn)
  93. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  94. Dialog.AddDialog("Why haven't you delivered my letter? Azreana must know of my plan!")
  95. Dialog.AddOption("I'm going!")
  96. Dialog.Start()
  97. end
  98. function Dialog3(NPC,Spawn)
  99. FaceTarget(NPC, Spawn)
  100. Dialog.New(NPC, Spawn)
  101. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  102. Dialog.AddDialog("Ah... It is only you again. I've recieved word Azreana has recieved my package as I requrested. Nice work... Perhaps these ogres will keep their noses out of my buisness!")
  103. Dialog.AddOption("She said the raid on your home was a ruse for a bigger plot in the districts.","Offer2")
  104. Dialog.AddOption("And I'll stay out of your buisness as well...")
  105. Dialog.Start()
  106. end
  107. function Dialog4(NPC,Spawn)
  108. FaceTarget(NPC, Spawn)
  109. Dialog.New(NPC, Spawn)
  110. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  111. Dialog.AddDialog("Did you find Tilzak N'lim? I must know that fishmonger's true motives!")
  112. if GetQuestStep(Spawn,InformationGatheringFromaFishmonger) ==2 then
  113. Dialog.AddOption("He is no ordinary fishmonger. He works undercover for the Overlord and is planning to entrap the fools who started all this!","Dialog4a")
  114. end
  115. Dialog.AddOption("And I'll stay out of your buisness as well...")
  116. Dialog.Start()
  117. end
  118. function Dialog4a(NPC,Spawn)
  119. FaceTarget(NPC, Spawn)
  120. Dialog.New(NPC, Spawn)
  121. PlayFlavor(NPC, "", "", "pout", 0, 0, Spawn)
  122. Dialog.AddDialog("Well then... this does change things. If you claim the fishmonger is an agent of the Overlord... can he be trusted?")
  123. Dialog.AddOption("He seemed honest enough?","Dialog4b")
  124. Dialog.AddOption("Perhaps you shouldn't?","Dialog4b")
  125. Dialog.Start()
  126. end
  127. function Dialog4b(NPC,Spawn)
  128. FaceTarget(NPC, Spawn)
  129. Dialog.New(NPC, Spawn)
  130. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  131. Dialog.AddDialog("Better yet, can YOU be trusted?! How do I know you're speaking the truth!? Are you part of this whole plot?!?")
  132. Dialog.AddOption("You'll just have to take my word for it.","Dialog4c")
  133. Dialog.AddOption("You see this face? How can you not trust this face?","Dialog4c")
  134. Dialog.AddOption("[Lie] The Overlord's agents told me you might not see reason.","Dialog4c")
  135. Dialog.Start()
  136. end
  137. function Dialog4c(NPC,Spawn)
  138. SetStepComplete(Spawn, InformationGatheringFromaFishmonger, 2)
  139. FaceTarget(NPC, Spawn)
  140. Dialog.New(NPC, Spawn)
  141. PlayFlavor(NPC, "", "", "grumble", 0, 0, Spawn)
  142. Dialog.AddDialog("...Fine! Take these things and get out of my sight. If I find out you're behind any of this, I will make you pay! I can't take ANYMORE FOOLISHNESS!")
  143. Dialog.AddOption("Thanks, and good luck resolving all of... 'this'.")
  144. Dialog.Start()
  145. end