ArmsdealerSilentblade.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/ArmsdealerSilentblade.lua
  3. Script Purpose : Armsdealer Silentblade
  4. Script Author : torsten
  5. Script Date : 2022.07.15
  6. Script Notes :
  7. --]]
  8. local FreeWaresforSilentblade = 5654
  9. local GetRichQuick = 5655
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, FreeWaresforSilentblade)
  12. ProvidesQuest(NPC, GetRichQuick)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. if not HasQuest(Spawn, FreeWaresforSilentblade) and not HasCompletedQuest(Spawn, FreeWaresforSilentblade) then
  19. OfferQuest(NPC, Spawn, FreeWaresforSilentblade)
  20. end
  21. if HasCompletedQuest(Spawn, FreeWaresforSilentblade) then
  22. if not HasQuest(Spawn, GetRichQuick) and not HasCompletedQuest(Spawn, GetRichQuick) then
  23. OfferQuest(NPC, Spawn, GetRichQuick)
  24. end
  25. end
  26. if GetQuestStep(Spawn, FreeWaresforSilentblade) == 2 then
  27. SetStepComplete(Spawn, FreeWaresforSilentblade, 2)
  28. end
  29. if GetQuestStep(Spawn, GetRichQuick) == 2 then
  30. SetStepComplete(Spawn, GetRichQuick, 2)
  31. end
  32. RandomGreeting(NPC, Spawn)
  33. end
  34. function RandomGreeting(NPC, Spawn)
  35. local choice = MakeRandomInt(1,3)
  36. if choice == 1 then
  37. PlayFlavor(NPC, "", "Need adventuring gear? Look no further. I've everything you could possibly want.", "", 0, 0, Spawn, 0)
  38. elseif choice == 2 then
  39. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", 0, 0, Spawn)
  40. elseif choice == 3 then
  41. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1022.mp3", 0, 0, Spawn)
  42. end
  43. end