pileofbones.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/Edgewater/pileofbones.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.05 07:07:17
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheCoinofBattle = 5290
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, TheCoinofBattle) and not HasCompletedQuest(Spawn, TheCoinofBattle) then
  14. AddPrimaryEntityCommand(Spawn, NPC, "examine pile of bones", 5, "examine pile of bones", "", 100)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. SpawnSet(NPC, "display_hand_icon", 1)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'examine pile of bones' then
  21. OfferQuest(NPC, Spawn, TheCoinofBattle)
  22. SetAccessToEntityCommand(Spawn,NPC,"examine pile of bones", 0)
  23. SpawnSet(NPC, "show_command_icon", 0)
  24. SpawnSet(NPC, "display_hand_icon", 0)
  25. AddTimer(NPC, 10000, "check", 1, Spawn)
  26. end
  27. end
  28. function check(NPC, Spawn)
  29. if not HasQuest(Spawn, TheCoinofBattle) and not HasCompletedQuest(Spawn, TheCoinofBattle) then
  30. SpawnSet(NPC, "show_command_icon", 1)
  31. SpawnSet(NPC, "display_hand_icon", 1)
  32. SetAccessToEntityCommand(Spawn,NPC,"examine pile of bones", 1)
  33. end
  34. end
  35. function respawn(NPC)
  36. spawn(NPC)
  37. end