CaptainSorio.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/BigBend/CaptainSorio.lua
  3. Script Purpose : Captain Sorio
  4. Script Author : torsten
  5. Script Date : 2022.07.11
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. local SorioGiantslayer = 5621
  10. local SorioDog = 5622
  11. function spawn(NPC)
  12. ProvidesQuest(NPC, SorioGiantslayer)
  13. ProvidesQuest(NPC, SorioDog)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function hailed(NPC, Spawn)
  19. FaceTarget(NPC, Spawn)
  20. if not HasQuest(Spawn, SorioGiantslayer) and not HasCompletedQuest(Spawn, SorioGiantslayer) then
  21. OfferQuest(NPC, Spawn, SorioGiantslayer)
  22. end
  23. if HasCompletedQuest(Spawn, SorioGiantslayer) then
  24. if not HasQuest(Spawn, SorioDog) and not HasCompletedQuest(Spawn, SorioDog) then
  25. OfferQuest(NPC, Spawn, SorioDog)
  26. end
  27. end
  28. if GetQuestStep(Spawn, SorioGiantslayer) == 2 then
  29. SetStepComplete(Spawn, SorioGiantslayer, 2)
  30. end
  31. if GetQuestStep(Spawn, SorioDog) == 2 then
  32. SetStepComplete(Spawn, SorioDog, 2)
  33. end
  34. RandomGreeting(NPC, Spawn)
  35. end
  36. function RandomGreeting(NPC, Spawn)
  37. local choice = MakeRandomInt(1,4)
  38. if choice == 1 then
  39. PlayFlavor(NPC, "", "What do you want?", "", 0, 0, Spawn, 0)
  40. elseif choice == 2 then
  41. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", 0, 0, Spawn)
  42. elseif choice == 3 then
  43. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1048.mp3", 0, 0, Spawn)
  44. elseif choice == 4 then
  45. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", 0, 0, Spawn)
  46. end
  47. end