9
3

afallenbranch.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/afallenbranch.lua
  3. Script Author : Shatou
  4. Script Date : 2020.01.24 09:01:12
  5. Script Purpose :
  6. :
  7. --]]
  8. local FAVORS_QUEST_ID = 521
  9. local A_FALLEN_BRANCH_SOUTH_OUTSIDE = 1960178
  10. local A_FALLEN_BRANCH_NORTH_OUTSIDE = 1960190
  11. local A_FALLEN_BRANCH_SOUTH_INSIDE = 1960179
  12. local A_FALLEN_BRANCH_NORTH_INSIDE = 1960189
  13. function spawn(NPC)
  14. if GetSpawnID(NPC) == A_FALLEN_BRANCH_SOUTH_OUTSIDE then
  15. SetRequiredQuest(NPC, FAVORS_QUEST_ID, 3,1)
  16. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_NORTH_OUTSIDE then
  17. SetRequiredQuest(NPC, FAVORS_QUEST_ID, 4,1)
  18. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_SOUTH_INSIDE then
  19. SetRequiredQuest(NPC, FAVORS_QUEST_ID, 5,1)
  20. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_NORTH_INSIDE then
  21. SetRequiredQuest(NPC, FAVORS_QUEST_ID, 6,1)
  22. end
  23. end
  24. function hailed(NPC, Spawn)
  25. FaceTarget(NPC, Spawn)
  26. end
  27. function respawn(NPC)
  28. end
  29. function casted_on(NPC, Spawn, Message)
  30. if HasQuest(Spawn, FAVORS_QUEST_ID) then
  31. if Message == "harvest" then
  32. if GetSpawnID(NPC) == A_FALLEN_BRANCH_SOUTH_OUTSIDE then
  33. SetStepComplete(Spawn, FAVORS_QUEST_ID, 3)
  34. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_NORTH_OUTSIDE then
  35. SetStepComplete(Spawn, FAVORS_QUEST_ID, 4)
  36. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_SOUTH_INSIDE then
  37. SetStepComplete(Spawn, FAVORS_QUEST_ID, 5)
  38. elseif GetSpawnID(NPC) == A_FALLEN_BRANCH_NORTH_INSIDE then
  39. SetStepComplete(Spawn, FAVORS_QUEST_ID, 6)
  40. end
  41. end
  42. end
  43. end