9
3

questbendikgear04.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/Edgewater/questbendikgear04.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.06 05:07:16
  5. Script Purpose :
  6. :
  7. --]]
  8. local InsideTheEdgewaterDrains = 5303
  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 respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if not HasQuest(Spawn, InsideTheEdgewaterDrains) or HasCompletedQuest(Spawn, InsideTheEdgewaterDrains) then
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. SetAccessToEntityCommand(Spawn,NPC,"Search", 0)
  23. elseif HasQuest(Spawn, InsideTheEdgewaterDrains) and not QuestStepIsComplete(Spawn, InsideTheEdgewaterDrains, 4) then -- length of corroded chain
  24. SpawnSet(NPC, "show_command_icon", 1)
  25. SpawnSet(NPC, "display_hand_icon", 1)
  26. SetAccessToEntityCommand(Spawn,NPC,"Search", 1)
  27. end
  28. end
  29. function casted_on(NPC, Spawn, SpellName)
  30. if SpellName == 'Search' then
  31. SendMessage(Spawn, "You search through the rubble and find set of length of corroded chain")
  32. SetStepComplete(Spawn, InsideTheEdgewaterDrains, 4)
  33. SetAccessToEntityCommand(Spawn,NPC,"Search", 0)
  34. SpawnSet(NPC, "show_command_icon", 0)
  35. SpawnSet(NPC, "display_hand_icon", 0)
  36. end
  37. end