9
3

TheWordsofZebuxoruk.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/TheWordsofZebuxoruk.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.05 04:06:56
  5. Script Purpose :
  6. :
  7. --]]
  8. local ZebBook = 21491
  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,ZebBook,1) 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. SetAccessToEntityCommand(Spawn,NPC,"Take Book", 1)
  23. SpawnSet(NPC, "show_command_icon", 1)
  24. SpawnSet(NPC, "display_hand_icon", 1)
  25. end
  26. end
  27. function Check(NPC,Spawn)
  28. if HasItem(Spawn,ZebBook,1) then
  29. SpawnSet(NPC, "show_command_icon", 0)
  30. SpawnSet(NPC, "display_hand_icon", 0)
  31. SetAccessToEntityCommand(Spawn,NPC,"Take Book", 0)
  32. else
  33. SetAccessToEntityCommand(Spawn,NPC,"Take Book", 1)
  34. SpawnSet(NPC, "show_command_icon", 1)
  35. SpawnSet(NPC, "display_hand_icon", 1)
  36. end
  37. end
  38. function casted_on(NPC, Spawn, SpellName)
  39. if SpellName == 'Take Book' then
  40. SummonItem(Spawn,ZebBook,1)
  41. Check(NPC,Spawn)
  42. end
  43. end