9
3

aBlackshieldpirate.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity/aBlackshieldpirate.lua
  3. Script Purpose : a Blackshield pirate
  4. Script Author : Scatman
  5. Script Date : 2009.08.01
  6. Script Notes :
  7. --]]
  8. local MALE = 1
  9. local FEMALE = 2
  10. local DARK_ELF = 1
  11. local OGRE = 12
  12. local TROLL = 14
  13. local spoke = false
  14. function spawn(NPC)
  15. spoke = false
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. end
  23. function aggro(NPC, Spawn)
  24. local chance = math.random(1, 100)
  25. if chance <= 25 then
  26. if GetGender(NPC) == MALE then
  27. if GetRace(NPC) == DARK_ELF then
  28. local choice = math.random(1, 4)
  29. if choice == 1 then
  30. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_aggro_gm_10fd87eb.mp3", "There is no escape for you now!", "", 2989643101, 2260454555)
  31. elseif choice == 2 then
  32. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_aggro_gm_beacbb30.mp3", "I hope you put your affairs in order.", "", 799093996, 16617637)
  33. elseif choice == 3 then
  34. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_aggro_gm_fe18133.mp3", "Look what strolled into the spider's web!", "", 4178015902, 2202039151)
  35. elseif choice == 4 then
  36. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_3_aggro_gm_10fd87eb.mp3", "There is no escape for you now!", "", 3427660043, 2534456197)
  37. end
  38. elseif GetRace(NPC) == OGRE then
  39. elseif GetRace(NPC) == TROLL then
  40. end
  41. elseif GetGender(NPC) == FEMALE then
  42. if GetRace(NPC) == DARK_ELF then
  43. local choice = math.random(1, 4)
  44. if choice == 1 then
  45. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_1_aggro_gf_10fd87eb.mp3", "There is no escape for you now!", "", 3641868496, 1960514853)
  46. elseif choice == 2 then
  47. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_aggro_gf_8e7390a8.mp3", "Welcome to torment and destruction!", "", 3770648926, 2897017212)
  48. elseif choice == 3 then
  49. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_aggro_gf_ded507db.mp3", "More intruders to deal with? Stop them!", "", 338410258, 2808797910)
  50. elseif choice == 4 then
  51. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_aggro_gf_fb890c79.mp3", "I have no time for meddlers. Destroy them!", "", 1947039155, 2094447273)
  52. end
  53. elseif GetRace(NPC) == OGRE then
  54. PlayFlavor(NPC, "voiceover/english/optional3/ogre_base_2/ft/ogre/ogre_base_2_1_aggro_gf_d4cfd470.mp3", "Feel the might of Rallos!", "", 760635308, 455953200)
  55. elseif GetRace(NPC) == TROLL then
  56. local choice = math.random(1, 2)
  57. if choice == 1 then
  58. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_aggro_gf_d1a345c7.mp3", "I'm gonna give you a smile like ol' one tooth!", "", 1201784314, 2598207561)
  59. elseif choice == 2 then
  60. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_2/ft/troll/troll_base_2_1_aggro_gf_62fd0e82.mp3", "What smells so good?", "", 3335229907, 713747453)
  61. end
  62. end
  63. end
  64. end
  65. end
  66. function healthchanged(NPC, Spawn)
  67. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  68. if hp_percent <= 0.50 and spoke == false then
  69. spoke = true
  70. if GetGender(NPC) == MALE then
  71. if GetRace(NPC) == DARK_ELF then
  72. local choice = math.random(1, 3)
  73. if choice == 1 then
  74. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_halfhealth_gm_577ab333.mp3", "You'll pay for that one, peon!", "", 1420508530, 39058961)
  75. elseif choice == 2 then
  76. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_halfhealth_gm_9e244d19.mp3", "How dare you!", "", 3305445355, 1846155898)
  77. elseif choice == 3 then
  78. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_3_halfhealth_gm_9e244d19.mp3", "How dare you!", "", 2287743179, 1322949627)
  79. end
  80. elseif GetRace(NPC) == OGRE then
  81. local choice = math.random(1, 4)
  82. if choice == 1 then
  83. PlayFlavor(NPC, "voiceover/english/ogre_base_1/ft/ogre/ogre_base_1_1_halfhealth_gm_581c2926.mp3", "You'll pay for that!", "", 2366218696, 2114997045)
  84. elseif choice == 2 then
  85. PlayFlavor(NPC, "voiceover/english/ogre_base_1/ft/ogre/ogre_base_1_1_halfhealth_gm_aff2b15d.mp3", "Now I'm really angry!", "", 1599348947, 4096819162)
  86. elseif choice == 3 then
  87. PlayFlavor(NPC, "voiceover/english/optional3/ogre_base_2/ft/ogre/ogre_base_2_1_halfhealth_gm_1ad2d46f.mp3", "Your petty weapons are no match for me!", "", 2269900119, 3290320421)
  88. elseif choice == 4 then
  89. PlayFlavor(NPC, "voiceover/english/optional3/ogre_base_2/ft/ogre/ogre_base_2_1_halfhealth_gm_5a6c112c.mp3", "Agggggh! There is no pain only death and failure!", "", 2051650869, 1276361533)
  90. end
  91. elseif GetRace(NPC) == TROLL then
  92. local choice = math.random(1, 2)
  93. if choice == 1 then
  94. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gm_aa145f4d.mp3", "Neat, that'll leave a pretty scar", "", 675684950, 4088135432)
  95. elseif choice == 2 then
  96. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gm_f462f6ff.mp3", "Is this supposed to hurt?", "", 4202180867, 1393988988)
  97. end
  98. end
  99. elseif GetGender(NPC) == FEMALE then
  100. if GetRace(NPC) == DARK_ELF then
  101. local choice = math.random(1, 5)
  102. if choice == 1 then
  103. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_1_halfhealth_gf_577ab333.mp3", "You'll pay for that one, peon!", "", 2534123849, 501758946)
  104. elseif choice == 2 then
  105. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_1_halfhealth_gf_9e244d19.mp3", "How dare you!", "", 2905660023, 2043697886)
  106. elseif choice == 3 then
  107. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_1/ft/darkelf/darkelf_base_1_2_halfhealth_gf_9e244d19.mp3", "How dare you!", "", 2263865273, 2956956838)
  108. elseif choice == 4 then
  109. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_halfhealth_gf_8d198fee.mp3", "You may escape, but we will find you!", "", 1924616636, 4174763308)
  110. elseif choice == 5 then
  111. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_halfhealth_gf_d3fcd4c5.mp3", "How dare you strike me!", "", 1224879133, 2564393271)
  112. end
  113. elseif GetRace(NPC) == OGRE then
  114. local choice = math.random(1, 3)
  115. if choice == 1 then
  116. PlayFlavor(NPC, "voiceover/english/ogre_base_1/ft/ogre/ogre_base_1_1_halfhealth_gf_581c2926.mp3", "You'll pay for that!", "", 480032723, 3225416629)
  117. elseif choice == 2 then
  118. PlayFlavor(NPC, "voiceover/english/ogre_base_1/ft/ogre/ogre_base_1_1_halfhealth_gf_aff2b15d.mp3", "Now I'm really angry!", "", 3362643729, 1907494922)
  119. elseif choice == 3 then
  120. PlayFlavor(NPC, "voiceover/english/optional3/ogre_base_2/ft/ogre/ogre_base_2_1_halfhealth_gf_1ad2d46f.mp3", "Your petty weapons are no match for me!", "", 2285469219, 3359769172)
  121. end
  122. elseif GetRace(NPC) == TROLL then
  123. local choice = math.random(1, 4)
  124. if choice == 1 then
  125. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gf_aa145f4d.mp3", "Neat, that'll leave a pretty scar", "", 70455099, 2953679351)
  126. elseif choice == 2 then
  127. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_halfhealth_gf_f462f6ff.mp3", "Is this supposed to hurt?", "", 216769747, 692696120)
  128. elseif choice == 3 then
  129. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_2/ft/troll/troll_base_2_1_halfhealth_gf_5ba543d6.mp3", "That'll grow back.", "", 4062170117, 809175527)
  130. elseif choice == 4 then
  131. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_2/ft/troll/troll_base_2_1_halfhealth_gf_9e239695.mp3", "I can taste my own blood.", "", 630688016, 620713228)
  132. end
  133. end
  134. end
  135. AddTimer(NPC, 30000, "ResetSpoke")
  136. end
  137. end
  138. function ResetSpoke(NPC)
  139. spoke = false
  140. end
  141. function killed(NPC, Spawn)
  142. local chance = math.random(1, 100)
  143. if chance <= 25 then
  144. if GetGender(NPC) == MALE then
  145. if GetRace(NPC) == DARK_ELF then
  146. local choice = math.random(1, 3)
  147. if choice == 1 then
  148. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_victory_gm_dff26fa.mp3", "It is a shame we must end it this way ... I could have used you.", "", 1363661737, 942201815)
  149. elseif choice == 2 then
  150. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_victory_gm_f4fc7cf8.mp3", "Did you really think you had a chance?", "", 607143583, 3133144305)
  151. elseif choice == 3 then
  152. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_victory_gm_f5088778.mp3", "Get up! Death isn't good enough for you!", "", 3381713633, 2145918189)
  153. end
  154. elseif GetRace(NPC) == OGRE then
  155. PlayFlavor(NPC, "voiceover/english/optional3/ogre_base_2/ft/ogre/ogre_base_2_1_victory_gm_1de29528.mp3", "Death was your only escape from me, coward!", "", 3626940960, 2890932770)
  156. elseif GetRace(NPC) == TROLL then
  157. PlayFlavor(NPC, "voiceover/english/optional3/troll_base_1/ft/troll/troll_base_1_1_victory_gm_ae6d66e3.mp3", "Teach you to mess with the best.", "", 927528340, 2751002174)
  158. end
  159. elseif GetGender(NPC) == FEMALE then
  160. if GetRace(NPC) == DARK_ELF then
  161. elseif GetRace(NPC) == OGRE then
  162. elseif GetRace(NPC) == TROLL then
  163. end
  164. end
  165. end
  166. end
  167. function death(NPC, Spawn)
  168. spoke = false
  169. local chance = math.random(1, 100)
  170. if chance <= 25 then
  171. if GetGender(NPC) == MALE then
  172. if GetRace(NPC) == DARK_ELF then
  173. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_death_gm_8d7bb2b9.mp3", "Hold them and I'll return with help!", "", 2338278515, 1160150777)
  174. elseif GetRace(NPC) == OGRE then
  175. elseif GetRace(NPC) == TROLL then
  176. end
  177. elseif GetGender(NPC) == FEMALE then
  178. if GetRace(NPC) == DARK_ELF then
  179. local choice = math.random(1, 2)
  180. if choice == 1 then
  181. PlayFlavor(NPC, "voiceover/english/ghost_darkelf_base_1/ft/ghost/ghost_darkelf_base_1_1_death_gf_b5958785.mp3", "Hold them and I'll return with others like us!", "", 3769472925, 2964757475)
  182. elseif choice == 2 then
  183. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_death_gf_8bbec3e3.mp3", "No matter what I promise, you will not survive!", "", 2832420662, 2950405548)
  184. end
  185. elseif GetRace(NPC) == OGRE then
  186. PlayFlavor(NPC, "voiceover/english/optional3/ghost_ogre_base_2/ft/ghost/ghost_ogre_base_2_1_death_gf_198e9f92.mp3", "Release comes to the favored.", "", 1658205865, 949237847)
  187. elseif GetRace(NPC) == TROLL then
  188. end
  189. end
  190. end
  191. end