agratifiedmerchant.lua 932 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : SpawnScripts/Antonica/agratifiedmerchant.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.07.12 05:07:10
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 15, "InRange")
  10. end
  11. function InRange(NPC, Spawn)
  12. RandomGreeting(NPC, Spawn)
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. RandomGreeting(NPC, Spawn)
  17. end
  18. function RandomGreeting(NPC, Spawn)
  19. local choice = MakeRandomInt(1,2)
  20. if choice == 1 then
  21. PlayFlavor(NPC, "", "Thank you for your help. I need to leave soon, but I'd be willing to make some purchases to save you some time if you'd like.", "smile", 0, 0, Spawn, 0)
  22. elseif choice == 2 then
  23. PlayFlavor(NPC, "", "That was very brave of you! I need to leave soon, but I can offer my services in the meantime.", "applaude", 0, 0, Spawn, 0)
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end