ulinirgravestone01.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. Script Notes : Updated by Jabantiz (4/21/2017)
  7. --]]
  8. local WOODELF_MENTOR_QUEST_5 = 217 -- A Tribute for Ulinir
  9. function spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function hailed(NPC, Spawn)
  15. end
  16. function casted_on(NPC, Spawn, SpellName)
  17. conversation = CreateConversation()
  18. if HasQuest(Spawn, WOODELF_MENTOR_QUEST_5) and SpellName == "Read Gravestone" then
  19. AddConversationOption(conversation, "Place the Tribute.", "PlaceTribute")
  20. end
  21. AddConversationOption(conversation, "Leave.", "CheckRace")
  22. StartDialogConversation(conversation, 1, NPC, Spawn, "Ulinir\n\nOf the Pine\n\nNature's Strength")
  23. end
  24. function CheckRace(NPC, Spawn)
  25. if HasCompletedQuest(Spawn, WOODELF_MENTOR_QUEST_5) then
  26. MakeIlaenTalk(NPC, Spawn)
  27. CloseConversation(NPC, Spawn)
  28. else
  29. CloseConversation(NPC, Spawn)
  30. end
  31. end
  32. function MakeIlaenTalk(NPC, Spawn)
  33. local ilaen_lilac = GetSpawn(Spawn, 1960059)
  34. if ilaen_lilac ~= nil then
  35. FaceTarget(ilaen_lilac, Spawn)
  36. 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)
  37. end
  38. end
  39. function PlaceTribute(NPC, Spawn)
  40. SetStepComplete(Spawn, WOODELF_MENTOR_QUEST_5, 1)
  41. -- Tribute for Ulinir
  42. while HasItem(Spawn, 14667) do
  43. RemoveItem(Spawn, 14667)
  44. end
  45. local tribute = GetSpawn(Spawn, 1960152)
  46. if tribute == nil then
  47. local flower1 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.417, -17.0745, -820.883, 159.344)
  48. local flower2 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.54, -17.0745, -821.211, 159.344)
  49. local flower3 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.604, -17.0745, -820.813, 159.344)
  50. local flower4 = SpawnMob(GetZone(Spawn), 1960140, 0, 967.727, -17.0745, -821.14, 159.344)
  51. tribute = SpawnMob(GetZone(Spawn), 1960152, 0, 967.581, -17.0745, -821.035, 159.344)
  52. Despawn(tribute, 300000)
  53. Despawn(flower1, 300000)
  54. Despawn(flower2, 300000)
  55. Despawn(flower3, 300000)
  56. Despawn(flower4, 300000)
  57. end
  58. MakeIlaenTalk(NPC, Spawn)
  59. end