tomemasteryzombiewidget.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/tomemasteryzombiewidget.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.09 08:07:48
  5. Script Purpose :
  6. :
  7. --]]
  8. local ZatirresFirstZombie = 15650
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function InRange(NPC, Spawn)
  16. if not HasItem(Spawn, ZatirresFirstZombie) then
  17. SpawnSet(NPC, "show_command_icon", 1)
  18. SpawnSet(NPC, "display_hand_icon", 1)
  19. SetAccessToEntityCommand(Spawn,NPC,"Search Urn", 1)
  20. elseif HasItem(Spawn, ZatirresFirstZombie) then
  21. SpawnSet(NPC, "show_command_icon", 0)
  22. SpawnSet(NPC, "display_hand_icon", 0)
  23. SetAccessToEntityCommand(Spawn,NPC,"Search Urn", 0)
  24. end
  25. end
  26. function casted_on(NPC, Spawn, SpellName)
  27. if SpellName == 'Search Urn' then
  28. if not HasItem(Spawn, ZatirresFirstZombie) then
  29. SendMessage(Spawn, "You find an old tattered book.")
  30. SendPopUpMessage(Spawn, "You receive Zattire's First Zombie.", 255, 255, 255)
  31. SummonItem(Spawn, ZatirresFirstZombie)
  32. elseif HasItem(Spawn, ZatirresFirstZombie) then
  33. SpawnSet(NPC, "show_command_icon", 0)
  34. SpawnSet(NPC, "display_hand_icon", 0)
  35. SetAccessToEntityCommand(Spawn,NPC,"Search Urn", 0)
  36. end
  37. end
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end