FeredirNaDuath.lua 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/FeredirNaDuath.lua
  3. Script Purpose : Feredir Na'Duath
  4. Script Author : Scatman
  5. Script Date : 2009.09.15
  6. Script Notes :
  7. --]]
  8. local WOOD_ELF = 15
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. MovementLoopAddLocation(NPC, 806.83, -21.08, -631.66, 2, 1)
  12. MovementLoopAddLocation(NPC, 806.83, -21.08, -631.66, 2, math.random(10, 30),"Action")
  13. MovementLoopAddLocation(NPC, 809.40, -20.58, -624.21, 2)
  14. MovementLoopAddLocation(NPC, 824.93, -20.36, -621.53, 2)
  15. MovementLoopAddLocation(NPC, 828.00, -20.14, -613.99, 2)
  16. MovementLoopAddLocation(NPC, 834.82, -21.40, -616.09, 2, 1)
  17. MovementLoopAddLocation(NPC, 834.82, -21.40, -616.09, 2, math.random(15, 40),"Action")
  18. MovementLoopAddLocation(NPC, 836.63, -21.13, -607.60, 2)
  19. MovementLoopAddLocation(NPC, 837.98, -20.93, -605.67, 2)
  20. MovementLoopAddLocation(NPC, 840.11, -20.88, -604.95, 2)
  21. MovementLoopAddLocation(NPC, 842.86, -21.05, -605.55, 2)
  22. MovementLoopAddLocation(NPC, 848.78, -20.96, -608.04, 2)
  23. MovementLoopAddLocation(NPC, 856.05, -19.93, -609.18, 2)
  24. MovementLoopAddLocation(NPC, 861.92, -18.97, -608.21, 2)
  25. MovementLoopAddLocation(NPC, 870.01, -18.46, -604.19, 2, 1)
  26. MovementLoopAddLocation(NPC, 870.01, -18.46, -604.19, 2, math.random(30, 120),"Action")
  27. MovementLoopAddLocation(NPC, 870.36, -20.88, -613.71, 2)
  28. MovementLoopAddLocation(NPC, 875.97, -21.14, -624.37, 2)
  29. MovementLoopAddLocation(NPC, 874.31, -20.19, -629.96, 2)
  30. MovementLoopAddLocation(NPC, 867.43, -20.63, -639.17, 2)
  31. MovementLoopAddLocation(NPC, 855.45, -20.85, -646.91, 2)
  32. MovementLoopAddLocation(NPC, 852.47, -20.56, -655.13, 2)
  33. MovementLoopAddLocation(NPC, 846.62, -20.62, -662.08, 2, 1)
  34. MovementLoopAddLocation(NPC, 846.62, -20.62, -662.08, 2, math.random(30, 90),"Action")
  35. MovementLoopAddLocation(NPC, 834.48, -20.89, -661.77, 2)
  36. MovementLoopAddLocation(NPC, 832.38, -20.31, -654.53, 2)
  37. MovementLoopAddLocation(NPC, 829.19, -20.26, -651.75, 2)
  38. MovementLoopAddLocation(NPC, 811.79, -21.20, -649.09, 2)
  39. end
  40. function Action(NPC)
  41. local choice = MakeRandomInt(1, 4)
  42. if choice == 1 then
  43. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  44. elseif choice == 2 then
  45. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  46. elseif choice == 3 then
  47. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  48. elseif choice == 4 then
  49. PlayFlavor(NPC, "", "", "yawn", 0, 0, Spawn)
  50. end
  51. end
  52. function respawn(NPC)
  53. spawn(NPC)
  54. end
  55. function InRange(NPC, Spawn)
  56. if math.random(0, 100) <= 25 then
  57. FaceTarget(NPC, Spawn)
  58. local choice = math.random(1, 2)
  59. if choice == 1 then
  60. PlayFlavor(NPC, "", "The city is not the most beautiful place in Norrath, but it is at least familiar.", "", 1689589577, 4560189, Spawn)
  61. elseif choice == 2 then
  62. Say(NPC, "I've often wondered whether a kerra tail would be a help or hindrance in life amongst the treetops.", Spawn)
  63. end
  64. end
  65. if GetRace(Spawn) == WOOD_ELF and math.random(0, 100) <= 50 then
  66. SendMessage(Spawn, GetName(NPC) .. " greets you.")
  67. end
  68. end
  69. function LeaveRange(NPC, Spawn)
  70. end
  71. function hailed(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. local choice = math.random(1, 5)
  74. if choice == 1 then
  75. PlayFlavor(NPC, "", "To be among the highest leaves and branches of a tree is to feel free.", "", 1689589577, 4560189, Spawn)
  76. elseif choice == 2 then
  77. PlayFlavor(NPC, "", "I too long for my home in Faydark. Someday I am sure Tunare will answer us.", "", 1689589577, 4560189, Spawn)
  78. elseif choice == 3 then
  79. PlayFlavor(NPC, "", "With the help of Feir'Dal such as you, I know we will be able to rebuild our homes and live in peace among the trees.", "", 1689589577, 4560189, Spawn)
  80. elseif choice == 4 then
  81. Say(NPC, "The blessing of Tunare is the highest blessing of all.", Spawn)
  82. elseif choice == 5 then
  83. Say(NPC, "I've often wondered whether a kerra tail would be a help or hindrance in life amongst the treetops.", Spawn)
  84. end
  85. end