9
3

TrellyGreenfoot.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/TrellyGreenfoot.lua
  3. Script Purpose : Trelly Greenfoot
  4. Script Author : Scatman
  5. Script Date : 2009.09.15
  6. Script Notes : Updated by Jabantiz (4/22/2017)
  7. --]]
  8. local WOOD_ELF = 15
  9. local DARK_ELF = 1
  10. local WOOD_ELF_QUEST_4 = 216
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 10, "InRange")
  13. MovementLoopAddLocation(NPC, 809.94, -20.32, -622.21, 2)
  14. MovementLoopAddLocation(NPC, 825.57, -20.47, -622.01, 2, 15)
  15. MovementLoopAddLocation(NPC, 827.49, -20.27, -615.30, 2)
  16. MovementLoopAddLocation(NPC, 833.85, -21.46, -611.10, 2, 90)
  17. MovementLoopAddLocation(NPC, 835.92, -21.04, -606.67, 2)
  18. MovementLoopAddLocation(NPC, 838.36, -20.84, -604.75, 2)
  19. MovementLoopAddLocation(NPC, 844.63, -21.09, -605.69, 2)
  20. MovementLoopAddLocation(NPC, 851.91, -20.38, -609.75, 2)
  21. MovementLoopAddLocation(NPC, 860.75, -19.17, -609.59, 2)
  22. MovementLoopAddLocation(NPC, 870.01, -18.46, -603.19, 2, 60)
  23. MovementLoopAddLocation(NPC, 862.12, -18.97, -606.58, 2)
  24. MovementLoopAddLocation(NPC, 853.15, -20.23, -610.54, 2)
  25. MovementLoopAddLocation(NPC, 849.14, -21.05, -618.29, 2, 120)
  26. MovementLoopAddLocation(NPC, 844.49, -21.70, -625.31, 2)
  27. MovementLoopAddLocation(NPC, 841.65, -22.48, -633.37, 2)
  28. MovementLoopAddLocation(NPC, 844.45, -21.69, -645.01, 2, 60)
  29. MovementLoopAddLocation(NPC, 837.38, -21.06, -646.00, 2)
  30. MovementLoopAddLocation(NPC, 824.73, -20.57, -650.46, 2)
  31. MovementLoopAddLocation(NPC, 812.28, -21.11, -650.56, 2)
  32. MovementLoopAddLocation(NPC, 806.82, -21.08, -631.67, 2, 30)
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. Talk(NPC, Spawn)
  40. end
  41. function InRange(NPC, Spawn)
  42. if math.random(0, 25) <= 25 then
  43. Talk(NPC)
  44. end
  45. end
  46. function Talk(NPC, Spawn)
  47. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_4) then
  48. PlayFlavor(NPC, "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_status_gf_80ffe645.mp3", "You have proven yourself among all those who doubt the Feir'Dal's worth. Well done!", "", 670005551, 4229139858, Spawn)
  49. else
  50. voice_overs = {}
  51. voice_overs[1] = {}
  52. voice_overs[1].file = "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_hail_gf_3e59423a.mp3"
  53. voice_overs[1].text = "The blessing of Tunare is the highest blessing of all."
  54. voice_overs[1].key1 = 853299003
  55. voice_overs[1].key2 = 3297095439
  56. voice_overs[2] = {}
  57. voice_overs[2].file = "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_hail_gf_50387146.mp3"
  58. voice_overs[2].text = "To be among the highest leaves and branches of a tree is to feel free."
  59. voice_overs[2].key1 = 1191446540
  60. voice_overs[2].key2 = 711911709
  61. local size = 2
  62. if GetRace(Spawn) == DARK_ELF then
  63. size = size + 1
  64. voice_overs[size]= {}
  65. voice_overs[size].file = "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_darkelf_gf_894a567a.mp3"
  66. voice_overs[size].text = "The Feir`Dal will not let this traitor of the elven race reside within these city walls. Expect no more than a short welcome here."
  67. voice_overs[size].key1 = 26640370
  68. voice_overs[size].key2 = 1478096414
  69. elseif GetRace(Spawn) == WOOLD_ELF then
  70. size = size + 1
  71. voice_overs[size] = {}
  72. voice_overs[size].file = "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_woodelf_gf_5621269a.mp3"
  73. voice_overs[size].text = "I too long for my home in Faydark. Someday Tunare will answer us, I'm sure."
  74. voice_overs[size].key1 = 3953058409
  75. voice_overs[size].key2 = 3176959607
  76. size = size + 1
  77. voice_overs[size] = {}
  78. voice_overs[size].file = "voiceover/english/woodelf_eco_race_good/ft/eco/good/woodelf_eco_race_good_woodelf_gf_601050b5.mp3"
  79. voice_overs[size].text = "May Tunare's blessings be with you and yours."
  80. voice_overs[size].key1 = 3511142094
  81. voice_overs[size].key2 = 3935712685
  82. end
  83. local choice = math.random(1, size)
  84. if spawn == nil then
  85. PlayFlavor(NPC, voice_overs[choice].file, voice_overs[choice].text, "", voice_overs[choice].key1, voice_overs[choice].key2, Spawn)
  86. else
  87. PlayFlavor(NPC, voice_overs[choice].file, voice_overs[choice].text, "", voice_overs[choice].key1, voice_overs[choice].key2)
  88. end
  89. end
  90. end