ulinirgravestone01.lua 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/ulinir_gravestone01.lua
  3. Script Purpose : ulinir_gravestone01
  4. Script Author : Scatman
  5. Script Date : 2009.09.26
  6. cript Notes : Updated by Jabantiz (4/21/2017) and again by Dorbin (07.14.2022)
  7. --]]
  8. local WOODELF_MENTOR_QUEST_5 = 217 -- A Tribute for Ulinir
  9. local WOODELF_MENTOR_QUEST_6 = 5494 -- A Tribute for Ulinir
  10. function spawn(NPC)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. end
  17. function casted_on(NPC, Spawn, SpellName)
  18. conversation = CreateConversation()
  19. if HasQuest(Spawn, WOODELF_MENTOR_QUEST_5) and SpellName == "Read Gravestone" then
  20. AddConversationOption(conversation, "Place the Tribute.", "PlaceTribute")
  21. end
  22. AddConversationOption(conversation, "Leave.", "CheckRaceTimer")
  23. StartDialogConversation(conversation, 1, NPC, Spawn, "Ulinir\n\nOf the Pine\n\nNature's Strength")
  24. end
  25. function CheckRaceTimer(NPC, Spawn)
  26. CloseConversation(NPC, Spawn)
  27. AddTimer(NPC,2000,"CheckRace",1,Spawn)
  28. end
  29. function CheckRace(NPC, Spawn)
  30. if HasCompletedQuest(Spawn, WOODELF_MENTOR_QUEST_5) and not HasQuest(Spawn, WOODELF_MENTOR_QUEST_6) and not HasCompletedQuest(Spawn, WOODELF_MENTOR_QUEST_6) then
  31. MakeIlaenTalk(NPC, Spawn)
  32. CloseConversation(NPC, Spawn)
  33. else
  34. CloseConversation(NPC, Spawn)
  35. end
  36. end
  37. function MakeIlaenTalk(NPC, Spawn)
  38. local ilaen_lilac = GetSpawn(Spawn, 1960059)
  39. if ilaen_lilac ~= nil then
  40. FaceTarget(ilaen_lilac, Spawn)
  41. PlayFlavor(ilaen_lilac, "voiceover/english/tutorial_revamp/ilaen_lilac/qey_adv02_ruins_revamp/qst_woodelf_ilaen_lilac_ulinir_d84a1bb.mp3", "You are wise to know Ulinir is worth your time. Speak with me if you wish to use your wisdom for a greater good.", "", 1864539566, 4233668295, Spawn)
  42. end
  43. end
  44. function PlaceTribute(NPC, Spawn)
  45. SetStepComplete(Spawn, WOODELF_MENTOR_QUEST_5, 1)
  46. -- Tribute for Ulinir
  47. while HasItem(Spawn, 14667) do
  48. RemoveItem(Spawn, 14667)
  49. end
  50. local tribute = GetSpawn(Spawn, 1960152)
  51. if tribute == nil then
  52. local flower1 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.417, -17.0745, -820.883, 159.344)
  53. local flower2 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.54, -17.0745, -821.211, 159.344)
  54. local flower3 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.604, -17.0745, -820.813, 159.344)
  55. local flower4 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.727, -17.0745, -821.14, 159.344)
  56. tribute = SpawnMob(GetZone(Spawn), 1960152, 0, 967.581, -17.0745, -821.035, 159.344)
  57. Despawn(tribute, 300000)
  58. Despawn(flower1, 300000)
  59. Despawn(flower2, 300000)
  60. Despawn(flower3, 300000)
  61. Despawn(flower4, 300000)
  62. end
  63. MakeIlaenTalk(NPC, Spawn)
  64. end