tomemasterygiantwidget.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : SpawnScripts/ThunderingSteppes/tomemasterygiantwidget.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.07 03:06:28
  5. Script Purpose :
  6. :
  7. --]]
  8. local LnLQuest = 5398
  9. local Book = 8631
  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,Book,1) or HasCompletedQuest(Spawn,LnLQuest) then
  19. SetAccessToEntityCommand(Spawn,NPC,"Search Tarp", 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,Book,1) or HasCompletedQuest(Spawn,LnLQuest) then
  27. SpawnSet(NPC, "show_command_icon", 0)
  28. SpawnSet(NPC, "display_hand_icon", 0)
  29. SetAccessToEntityCommand(Spawn,NPC,"Search Tarp", 0)
  30. else
  31. SetAccessToEntityCommand(Spawn,NPC,"Search Tarp", 1)
  32. SpawnSet(NPC, "show_command_icon", 1)
  33. SpawnSet(NPC, "display_hand_icon", 1)
  34. end
  35. end
  36. function casted_on(NPC, Spawn, SpellName)
  37. if SpellName == 'Search Tarp' then
  38. SummonItem(Spawn,Book,1)
  39. AddTimer(NPC, 100, "Check", 1, Spawn)
  40. end
  41. end