questtomefroglokwartome01.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/questtomefroglokwartome01.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.05 12:06:54
  5. Script Purpose :
  6. :
  7. --]]
  8. local FrogBook = 6340
  9. local FrogQuest = 5582
  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,FrogBook,1) or HasCompletedQuest(Spawn,FrogQuest) then
  19. SetAccessToEntityCommand(Spawn,NPC,"Search Books", 0)
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. end
  23. end
  24. function Check(NPC,Spawn)
  25. if HasItem(Spawn,FrogBook,1) or HasCompletedQuest(Spawn,FrogQuest) then
  26. SpawnSet(NPC, "show_command_icon", 0)
  27. SpawnSet(NPC, "display_hand_icon", 0)
  28. SetAccessToEntityCommand(Spawn,NPC,"Search Books", 0)
  29. end
  30. end
  31. function casted_on(NPC, Spawn, SpellName)
  32. if SpellName == 'Search Books' then
  33. SummonItem(Spawn,FrogBook,1)
  34. Check(NPC,Spawn)
  35. end
  36. end