humanskeletonbones2.lua 937 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/SerpentSewer/humanskeletonbones2.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.01 08:07:45
  5. Script Purpose :
  6. :
  7. --]]
  8. local CrazyTalkingSkull = 5270
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if GetQuestStep(Spawn, CrazyTalkingSkull) == 1 then
  14. AddPrimaryEntityCommand(Spawn, NPC, "Gather remains", 5, "Gather remains", "", 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 == 'Gather remains' then
  21. SetStepComplete(Spawn, CrazyTalkingSkull, 1)
  22. SpawnSet(NPC, "show_command_icon", 0)
  23. SpawnSet(NPC, "display_hand_icon", 0)
  24. SetAccessToEntityCommand(Spawn,NPC,"Gather remains", 0)
  25. end
  26. end
  27. function respawn(NPC)
  28. spawn(NPC)
  29. end