aGraystoneGuildbruiserDojoFighting.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/aGraystoneGuildbruiserDojoFighting.lua
  3. Script Author : Rylec
  4. Script Date : 2021.02.17 12:02:26
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local model = MakeRandomInt(1,10)
  10. if model == 1 then
  11. SetModelType(NPC, "132") -- human female
  12. SpawnSet(NPC, "soga_model_type", "132")
  13. SpawnSet(NPC, "chest_type", "5529")
  14. SpawnSet(NPC, "legs_type", "5530")
  15. elseif model == 2 then
  16. SetModelType(NPC, "134") -- human male
  17. SpawnSet(NPC, "soga_model_type", "134")
  18. SpawnSet(NPC, "chest_type", "5533")
  19. SpawnSet(NPC, "legs_type", "5534")
  20. elseif model == 3 then
  21. local KerraFemale = MakeRandomInt(91,96)
  22. SetModelType(NPC, KerraFemale) -- kerra female
  23. SpawnSet(NPC, "soga_model_type", KerraFemale)
  24. SpawnSet(NPC, "chest_type", "5545")
  25. SpawnSet(NPC, "legs_type", "5546")
  26. elseif model == 4 then
  27. local KerraMale = MakeRandomInt(97,102)
  28. SetModelType(NPC, KerraMale) -- kerra male
  29. SpawnSet(NPC, "soga_model_type", KerraMale)
  30. SpawnSet(NPC, "chest_type", "5549")
  31. SpawnSet(NPC, "legs_type", "5550")
  32. elseif model == 5 then
  33. SetModelType(NPC, "109") -- dwarf female
  34. SpawnSet(NPC, "soga_model_type", "109")
  35. SpawnSet(NPC, "chest_type", "5473")
  36. SpawnSet(NPC, "legs_type", "5474")
  37. elseif model == 6 then
  38. SetModelType(NPC, "110") -- dwarf male
  39. SpawnSet(NPC, "soga_model_type", "110")
  40. SpawnSet(NPC, "chest_type", "5477")
  41. SpawnSet(NPC, "legs_type", "5478")
  42. elseif model == 7 then
  43. SetModelType(NPC, "122") -- gnome female
  44. SpawnSet(NPC, "soga_model_type", "122")
  45. SpawnSet(NPC, "chest_type", "5497")
  46. SpawnSet(NPC, "legs_type", "5498")
  47. elseif model == 8 then
  48. SetModelType(NPC, "121") -- gnome male
  49. SpawnSet(NPC, "soga_model_type", "121")
  50. SpawnSet(NPC, "chest_type", "5501")
  51. SpawnSet(NPC, "legs_type", "5502")
  52. elseif model == 9 then
  53. SetModelType(NPC, "111") -- barbarian female
  54. SpawnSet(NPC, "soga_model_type", "111")
  55. SpawnSet(NPC, "chest_type", "5457")
  56. SpawnSet(NPC, "legs_type", "5458")
  57. else
  58. local BarbarianMale = MakeRandomInt(1467,1471)
  59. SetModelType(NPC, "112") -- barbarian male
  60. SpawnSet(NPC, "soga_model_type", "112")
  61. SpawnSet(NPC, "chest_type", "5461")
  62. SpawnSet(NPC, "legs_type", "5462")
  63. end
  64. Hair(NPC)
  65. Face(NPC)
  66. SpawnSet(NPC, "action_state", 372)
  67. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  68. end
  69. function Hair(NPC)
  70. local Type = GetModelType(NPC)
  71. local HairType = 0
  72. if Type == 132 or Type == 134 then
  73. HairType = MakeRandomInt(1121,1140)
  74. SpawnSet(NPC, "hair_type", HairType)
  75. elseif Type == 110 or Type == 112 or Type == 121 or Type == 122 then
  76. HairType = MakeRandomInt(1133,1140)
  77. SpawnSet(NPC, "hair_type", HairType)
  78. elseif Type == 109 then
  79. HairType = MakeRandomInt(1135,1140)
  80. SpawnSet(NPC, "hair_type", HairType)
  81. else
  82. HairType = MakeRandomInt(1136,1140)
  83. SpawnSet(NPC, "hair_type", HairType)
  84. end
  85. end
  86. function Face(NPC)
  87. local Type = GetModelType(NPC)
  88. local FaceHairType = 0
  89. if Type == 134 then
  90. local FaceHairType = MakeRandomInt(1164,1191)
  91. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  92. elseif Type == 110 then
  93. local FaceHairType = MakeRandomInt(1164,1170)
  94. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  95. elseif Type == 112 then
  96. local FaceHairType = MakeRandomInt(1185,1189)
  97. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  98. else
  99. local FaceHairType = MakeRandomInt(1166,1175)
  100. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  101. end
  102. end
  103. function hailed(NPC, Spawn)
  104. local type = GetModelType(NPC)
  105. local voice = MakeRandomInt(1,3)
  106. local spawnvoice = 0
  107. if type == 132 then
  108. spawnvoice = 1011
  109. elseif type == 134 then
  110. spawnvoice = 1054
  111. elseif type >= 91 and type <= 96 then
  112. spawnvoice = 1047
  113. elseif type >= 97 and type <= 102 then
  114. spawnvoice = 1048
  115. elseif type == 109 then
  116. spawnvoice = 1059
  117. elseif type == 110 then
  118. spawnvoice = 1004
  119. elseif type == 122 then
  120. spawnvoice = 1023
  121. elseif type == 121 then
  122. spawnvoice = 1024
  123. elseif type == 111 then
  124. spawnvoice = 1003
  125. elseif type == 112 then
  126. spawnvoice = 1004
  127. end
  128. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_"..voice.."_"..spawnvoice..".mp3", "", "", 0, 0, Spawn)
  129. end
  130. function respawn(NPC)
  131. spawn(NPC)
  132. end
  133. function EmoteLoop(NPC)
  134. SpawnSet(NPC, "action_state", 0)
  135. local choice = MakeRandomInt(1,8)
  136. if choice == 1 then
  137. PlayAnimation(NPC, 1644)
  138. AddTimer(NPC, 1550, "Idle")
  139. elseif choice == 2 then
  140. PlayAnimation(NPC, 1646)
  141. AddTimer(NPC, 2100, "Idle")
  142. elseif choice == 3 then
  143. PlayAnimation(NPC, 10783)
  144. AddTimer(NPC, 2050, "Idle")
  145. elseif choice == 4 then
  146. PlayAnimation(NPC, 12036)
  147. AddTimer(NPC, 2100, "Idle")
  148. elseif choice == 5 then
  149. PlayAnimation(NPC, 12048)
  150. AddTimer(NPC, 1450, "Idle")
  151. elseif choice == 6 then
  152. PlayAnimation(NPC, 12050)
  153. AddTimer(NPC, 1550, "Idle")
  154. elseif choice == 7 then
  155. PlayAnimation(NPC, 12054)
  156. AddTimer(NPC, 3400, "Idle")
  157. else
  158. PlayAnimation(NPC, 12074)
  159. AddTimer(NPC, 2300, "Idle")
  160. end
  161. end
  162. function Idle(NPC)
  163. PlayAnimation(NPC, 372)
  164. SpawnSet(NPC, "action_state", 372)
  165. local timer = MakeRandomInt(500,2500)
  166. AddTimer(NPC, timer, "EmoteLoop")
  167. end