9
3

questbendikgear02.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/Edgewater/questbendikgear02.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.06 05:07:12
  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, 2) then -- some copper wire
  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 some copper wire")
  32. SetStepComplete(Spawn, InsideTheEdgewaterDrains, 2)
  33. SetAccessToEntityCommand(Spawn,NPC,"Search", 0)
  34. SpawnSet(NPC, "show_command_icon", 0)
  35. SpawnSet(NPC, "display_hand_icon", 0)
  36. end
  37. end