tomemasteryelementalwidget.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/tomemasteryelementalwidget.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.05 12:06:19
  5. Script Purpose :
  6. :
  7. --]]
  8. local Elemental = 5402
  9. function spawn(NPC)
  10. Check(NPC,Spawn)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if HasItem(Spawn,13581,1) or HasCompletedQuest(Spawn,Elemental) then
  18. SetAccessToEntityCommand(Spawn,NPC,"Take Book", 0)
  19. SpawnSet(NPC, "show_command_icon", 0)
  20. SpawnSet(NPC, "display_hand_icon", 0)
  21. else
  22. end
  23. end
  24. function Check(NPC,Spawn)
  25. if HasItem(Spawn,13581,1) or HasCompletedQuest(Spawn,Elemental) then
  26. SpawnSet(NPC, "show_command_icon", 0)
  27. SpawnSet(NPC, "display_hand_icon", 0)
  28. SetAccessToEntityCommand(Spawn,NPC,"Take Book", 0)
  29. else
  30. end
  31. end
  32. function casted_on(NPC, Spawn, SpellName)
  33. if SpellName == 'Take Book' then
  34. SummonItem(Spawn,13581,1)
  35. AddTimer(NPC, 100, "Check", 1, Spawn)
  36. end
  37. end