questblartonbait.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/Antonica/questblartonbait.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.08.13 08:08:53
  5. Script Purpose :
  6. :
  7. --]]
  8. local FishingForBait = 5339
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if HasQuest(Spawn, FishingForBait) then
  14. if GetQuestStep(Spawn, FishingForBait) == 1 then
  15. SetAccessToEntityCommand(Spawn,NPC,"Grab the tin of bait", 1)
  16. SpawnSet(NPC, "show_command_icon", 1)
  17. SpawnSet(NPC, "display_hand_icon", 1)
  18. end
  19. elseif QuestStepIsComplete(Spawn, FishingForBait, 1) then
  20. SetAccessToEntityCommand(Spawn,NPC,"Grab the tin of bait", 0)
  21. SpawnSet(NPC, "show_command_icon", 0)
  22. SpawnSet(NPC, "display_hand_icon", 0)
  23. end
  24. end
  25. function casted_on(NPC, Spawn, SpellName)
  26. if SpellName == 'Grab the tin of bait' then
  27. if GetQuestStep(Spawn,FishingForBait) == 1 then
  28. SetStepComplete(Spawn, FishingForBait, 1)
  29. end
  30. SetAccessToEntityCommand(Spawn,NPC,"look in the urn", 0)
  31. SpawnSet(NPC, "show_command_icon", 0)
  32. SpawnSet(NPC, "display_hand_icon", 0)
  33. end
  34. end
  35. function respawn(NPC)
  36. spawn(NPC)
  37. end