9
3

tomemasteryshadowmanwidget.lua 1.1 KB

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