afallenegg.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/afallenegg.lua
  3. Script Purpose : a fallen egg
  4. Script Author : Scatman
  5. Script Date : 2009.09.20
  6. Script Notes :
  7. --]]
  8. -- a fallen bird egg
  9. local HALF_ELF_MENTOR_QUEST_1 = 218
  10. function spawn(NPC)
  11. local spawn_location_id = GetSpawnLocationID(NPC)
  12. -- docks (step 5)
  13. if spawn_location_id == 558481 then
  14. SetRequiredQuest(NPC, HALF_ELF_MENTOR_QUEST_1, 5)
  15. -- inn roof (step 4)
  16. elseif spawn_location_id == 1585292 then
  17. SetRequiredQuest(NPC, HALF_ELF_MENTOR_QUEST_1, 4)
  18. -- forest ruins (step 6)
  19. elseif spawn_location_id == 558483 then
  20. SetRequiredQuest(NPC, HALF_ELF_MENTOR_QUEST_1, 6)
  21. end
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function hailed(NPC, Spawn)
  27. end
  28. function casted_on(NPC, Spawn)
  29. if HasQuest(Spawn, HALF_ELF_MENTOR_QUEST_1) and GetQuestStep(Spawn, HALF_ELF_MENTOR_QUEST_1) >= 4 and GetQuestStep(Spawn, HALF_ELF_MENTOR_QUEST_1) <= 6 then
  30. local spawn_location_id = GetSpawnLocationID(NPC)
  31. -- docks (step 5)
  32. if spawn_location_id == 558481 then
  33. SetStepComplete(Spawn, HALF_ELF_MENTOR_QUEST_1, 5)
  34. Despawn(NPC)
  35. -- inn roof (step 4)
  36. elseif spawn_location_id == 1585292 then
  37. SetStepComplete(Spawn, HALF_ELF_MENTOR_QUEST_1, 4)
  38. Despawn(NPC)
  39. -- forest ruins (step 6)
  40. elseif spawn_location_id == 558483 then
  41. SetStepComplete(Spawn, HALF_ELF_MENTOR_QUEST_1, 6)
  42. Despawn(NPC)
  43. end
  44. end
  45. end