aBrokentuskpawn.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --[[
  2. Script Name : SpawnScripts/Ruins/aBrokentuskpawn.lua
  3. Script Purpose : a Brokentusk pawn
  4. Script Author : Scatman
  5. Script Date : 2009.08.21
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/BrokentuskVoiceOvers.lua")
  9. local spoke = false
  10. function spawn(NPC)
  11. spoke = false
  12. local sli = GetSpawnLocationID(NPC)
  13. if sli == 133076 or sli == 133077 or sli == 133078 or sli == 133079 then
  14. -- The sparring pawns.
  15. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 10783, 450) -- attack
  16. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 13058, 450) -- taunt combat art
  17. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 12065, 450) -- pugilist parry
  18. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 12050, 450) -- pugilist dodge forehand
  19. elseif sli == 133054 or sli == 133055 or sli == 159761 or sli == 133058 or sli == 133070 or sli == 133071 or sli == 133064 or sli == 159762 or sli == 133061 or sli == 159768 then
  20. -- The pawns cheering on the sparring pawns.
  21. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 11150, 43918) -- cheer
  22. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 10760 , 43528) -- applaud
  23. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 10856, 43624) -- boggle
  24. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 11152, 43920) -- chuckle
  25. AddVisualStateLoop(NPC, 1000, math.random(0, 1000), 11285, 44053) -- curse
  26. elseif sli == 159746 then
  27. StartPath1(NPC)
  28. elseif sli == 133018 then
  29. StartPath2(NPC)
  30. elseif sli == 159758 then
  31. StartPath3(NPC)
  32. end
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. end
  40. function aggro(NPC, Spawn)
  41. local chance = math.random(0, 100)
  42. if chance <= 25 then
  43. generic_aggro(NPC, Spawn)
  44. end
  45. end
  46. function healthchanged(NPC, Spawn)
  47. local chance = math.random(0, 100)
  48. if chance <= 25 then
  49. local health_percent = GetHP(NPC) / GetMaxHP(NPC)
  50. if health_percent < 0.50 and spoke == false then
  51. spoke = true
  52. generic_healthchanged(NPC, Spawn)
  53. end
  54. end
  55. end
  56. function killed(NPC, Spawn)
  57. generic_killed(NPC, Spawn)
  58. end
  59. function death(NPC, Spawn)
  60. spoke = false
  61. local chance = math.random(0, 100)
  62. if chance <= 25 then
  63. generic_death(NPC, Spawn)
  64. end
  65. end
  66. function StartPath1(NPC)
  67. MovementLoopAddLocation(NPC, -120.64, -2.58, 17.04, 4, 0)
  68. MovementLoopAddLocation(NPC, -89.23, -2.69, 25, 4, 0)
  69. MovementLoopAddLocation(NPC, -53.93, -2.63, 27.08, 4, 0)
  70. MovementLoopAddLocation(NPC, -55.71, -2.52, 33.44, 4, 0)
  71. MovementLoopAddLocation(NPC, -89.93, -2.74, 36.69, 4, 0)
  72. MovementLoopAddLocation(NPC, -103.84, -2.64, 22.62, 4, 0)
  73. MovementLoopAddLocation(NPC, -120.87, -2.6, 19.65, 4, 0)
  74. MovementLoopAddLocation(NPC, -135.95, -2.61, 31.13, 4, 0)
  75. MovementLoopAddLocation(NPC, -138.46, -2.58, 23.24, 4, 0)
  76. end
  77. function StartPath2(NPC)
  78. MovementLoopAddLocation(NPC, -119.97, 2.26, 127.77, 4, 0)
  79. MovementLoopAddLocation(NPC, -123.42, 0.92, 107.14, 4, 0)
  80. MovementLoopAddLocation(NPC, -123.68, -2.62, 73.93, 4, 0)
  81. MovementLoopAddLocation(NPC, -101.58, -2.56, 63.45, 4, 0)
  82. MovementLoopAddLocation(NPC, -96.64, -2.59, 75.03, 4, 0)
  83. MovementLoopAddLocation(NPC, -119.92, -2.63, 94.64, 4, 0)
  84. MovementLoopAddLocation(NPC, -119.77, 2.26, 128.79, 4, 0)
  85. MovementLoopAddLocation(NPC, -127.08, 2.26, 141.62, 4, 0)
  86. end
  87. function StartPath3(NPC)
  88. MovementLoopAddLocation(NPC, -122.63, 2.28, 120.17, 4, 0)
  89. MovementLoopAddLocation(NPC, -123.33, -1.71, 98.13, 4, 0)
  90. MovementLoopAddLocation(NPC, -97.93, -2.42, 71.18, 4, 0)
  91. MovementLoopAddLocation(NPC, -91.85, -2.63, 52.03, 4, 0)
  92. MovementLoopAddLocation(NPC, -97.82, -2.45, 53.78, 4, 0)
  93. MovementLoopAddLocation(NPC, -118.73, -2.54, 74.65, 4, 0)
  94. MovementLoopAddLocation(NPC, -123.79, -2.62, 75.76, 4, 0)
  95. MovementLoopAddLocation(NPC, -123.07, 2.28, 120.49, 4, 0)
  96. MovementLoopAddLocation(NPC, -149.83, 2.26, 142.84, 4, 0)
  97. end