9
3

OverseerMelkia.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --[[
  2. Script Name : SpawnScripts/Stonestair/OverseerMelkia.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.02 06:10:18
  5. Script Purpose :
  6. :
  7. --]]
  8. local Welcome = 5859
  9. require "SpawnScripts/Generic/DialogModule"
  10. local CalloutTimer = false
  11. function spawn(NPC)
  12. ProvidesQuest(NPC,Welcome)
  13. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  14. end
  15. function InRange(NPC, Spawn) --Quest Callout
  16. if GetFactionAmount(Spawn,12)<0 then
  17. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  18. FaceTarget(NPC, Spawn)
  19. else
  20. if GetRace(Spawn)== 3 or GetRace(Spawn) == 11 then
  21. if CanReceiveQuest(Spawn, Welcome) or HasQuest(Spawn,5758) then
  22. PlayFlavor(NPC,"voiceover/english/overseer_melkia/fprt_hood02/qst_overseer_melkia_callout2_e5f9b75f.mp3","New refugees are required to speak with me immediately!","nod",566743467,1453719370,Spawn)
  23. elseif CalloutTimer == false then
  24. CalloutTimer = true
  25. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  26. Talk(NPC,Spawn)
  27. end
  28. elseif CalloutTimer == false then
  29. CalloutTimer = true
  30. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  31. Talk(NPC,Spawn)
  32. end
  33. end
  34. end
  35. function ResetCallout(NPC,Spawn)
  36. CalloutTimer = false
  37. end
  38. function hailed(NPC, Spawn)
  39. if GetFactionAmount(Spawn,12)<0 then
  40. PlayFlavor(NPC,"","","shame",0,0,Spawn)
  41. else
  42. if GetRace(Spawn)== 3 or GetRace(Spawn) == 11 then
  43. if not HasQuest(Spawn, Welcome) and not HasCompletedQuest(Spawn,Welcome)then
  44. FaceTarget(NPC, Spawn)
  45. Dialog.New(NPC, Spawn)
  46. Dialog.AddDialog("You are wise to listen to your superiors. You are in the great city of Freeport, and you will do as your superiors say. Do you understand, or should I speak more slowly?")
  47. Dialog.AddVoiceover("voiceover/english/overseer_melkia/fprt_hood02/overseer_melkia001.mp3", 2219821898, 2979719473)
  48. PlayFlavor(NPC,"","","scold",0,0,Spawn)
  49. Dialog.AddOption("What do you need of me?","Dialog1")
  50. Dialog.AddOption("I... will return shortly.")
  51. Dialog.Start()
  52. else
  53. Talk(NPC,Spawn)
  54. end
  55. else
  56. Talk(NPC,Spawn)
  57. end
  58. end
  59. end
  60. function Talk(NPC,Spawn)
  61. FaceTarget(NPC, Spawn)
  62. local choice = MakeRandomInt(1,2)
  63. if choice == 1 then
  64. PlayFlavor(NPC,"voiceover/english/overseer_melkia/fprt_hood02/qst_overseer_melkia_callout1_8dc5a24e.mp3","You disgusting little creature! How dare you address me?","lookaway",256372118,1746198863,Spawn)
  65. elseif choice == 2 then
  66. PlayFlavor(NPC,"voiceover/english/overseer_melkia/fprt_hood02/qst_overseer_melkia_callout2_e5f9b75f.mp3","New refugees are required to speak with me immediately!","nod",566743467,1453719370,Spawn)
  67. end
  68. end
  69. function respawn(NPC)
  70. spawn(NPC)
  71. end
  72. function Dialog1(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. Dialog.New(NPC, Spawn)
  75. Dialog.AddDialog("Awww ... how cute, it asked me a question. Good little refugee. What I need, is for you to answer my questions, not ask them. Perhaps your pitiful intellect prevents you from comprehending these simple instructions. Maybe you'd like to meet with the Overlord's administrators of justice. Is this what you want, lowly refugee?")
  76. PlayFlavor(NPC,"","","ponder",0,0,Spawn)
  77. Dialog.AddVoiceover("voiceover/english/overseer_melkia/fprt_hood02/overseer_melkia002.mp3", 2859416423, 1015957689)
  78. Dialog.AddOption("...", "Dialog2")
  79. Dialog.Start()
  80. end
  81. function Dialog2(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. Dialog.New(NPC, Spawn)
  84. Dialog.AddDialog("Ahhh ... Now it's clear. You damaged your brain before arriving here. I'll speak down to your level, so try to follow along. You are in Stonestair Byway, the district populated by Erudites and Kerran. The Overlord gave you a house. Can you say, \"house?\" Now, try it with me ... hooousssee...")
  85. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  86. Dialog.AddVoiceover("voiceover/english/overseer_melkia/fprt_hood02/overseer_melkia003.mp3", 1377639509, 4180092382)
  87. Dialog.AddOption("...House...?", "QuestStart")
  88. Dialog.Start()
  89. end
  90. function QuestStart(NPC,Spawn)
  91. FaceTarget(NPC, Spawn)
  92. OfferQuest(NPC,Spawn,Welcome)
  93. end