9
3

MrBurpbellySkeleton.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/MrBurpbellySkeleton.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.07 09:07:46
  5. Script Purpose :
  6. :
  7. --]]
  8. local LostFriendInFallenGate = 5305
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, LostFriendInFallenGate) or HasCompletedQuest(Spawn, LostFriendInFallenGate) then
  14. SpawnSet(NPC, "show_command_icon", 0)
  15. SpawnSet(NPC, "display_hand_icon", 0)
  16. SetAccessToEntityCommand(Spawn,NPC,"Examine skeleton", 0)
  17. elseif HasQuest(Spawn, LostFriendInFallenGate) then
  18. SpawnSet(NPC, "show_command_icon", 1)
  19. SpawnSet(NPC, "display_hand_icon", 1)
  20. SetAccessToEntityCommand(Spawn,NPC,"Examine skeleton", 1)
  21. end
  22. end
  23. function casted_on(NPC, Spawn, SpellName)
  24. if SpellName == 'Examine skeleton' then
  25. if GetQuestStep(Spawn, LostFriendInFallenGate) == 1 then
  26. SetStepComplete(Spawn, LostFriendInFallenGate, 1)
  27. SendMessage(Spawn, "You take the necklace off the stewing skeleton.")
  28. elseif GetQuestStep(Spawn, LostFriendInFallenGate) == 2 then
  29. SendMessage(Spawn, "You've already taken the necklace.", 20)
  30. end
  31. end
  32. end
  33. function respawn(NPC)
  34. spawn(NPC)
  35. end