9
3

aGraystoneGuildbruiserDojo.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/aGraystoneGuildbruiserDojo.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. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  67. end
  68. function Hair(NPC)
  69. local Type = GetModelType(NPC)
  70. local HairType = 0
  71. if Type == 132 or Type == 134 then
  72. HairType = MakeRandomInt(1121,1140)
  73. SpawnSet(NPC, "hair_type", HairType)
  74. SpawnSet(NPC, "soga_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. SpawnSet(NPC, "soga_hair_type", HairType)
  79. elseif Type == 109 then
  80. HairType = MakeRandomInt(1135,1140)
  81. SpawnSet(NPC, "hair_type", HairType)
  82. SpawnSet(NPC, "soga_hair_type", HairType)
  83. else
  84. HairType = MakeRandomInt(1136,1140)
  85. SpawnSet(NPC, "hair_type", HairType)
  86. SpawnSet(NPC, "soga_hair_type", HairType)
  87. end
  88. end
  89. function Face(NPC)
  90. local Type = GetModelType(NPC)
  91. local FaceHairType = 0
  92. if Type == 134 then
  93. local FaceHairType = MakeRandomInt(1164,1191)
  94. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  95. SpawnSet(NPC, "soga_facial_hair_type", FaceHairType)
  96. elseif Type == 110 then
  97. local FaceHairType = MakeRandomInt(1164,1170)
  98. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  99. SpawnSet(NPC, "soga_facial_hair_type", FaceHairType)
  100. elseif Type == 112 then
  101. local FaceHairType = MakeRandomInt(1185,1189)
  102. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  103. SpawnSet(NPC, "soga_facial_hair_type", FaceHairType)
  104. else
  105. local FaceHairType = MakeRandomInt(1166,1175)
  106. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  107. SpawnSet(NPC, "soga_facial_hair_type", FaceHairType)
  108. end
  109. end
  110. function hailed(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. local type = GetModelType(NPC)
  113. local voice = MakeRandomInt(1,3)
  114. local spawnvoice = 0
  115. if type == 132 then
  116. spawnvoice = 1011
  117. elseif type == 134 then
  118. spawnvoice = 1054
  119. elseif type >= 91 and type <= 96 then
  120. spawnvoice = 1047
  121. elseif type >= 97 and type <= 102 then
  122. spawnvoice = 1048
  123. elseif type == 109 then
  124. spawnvoice = 1059
  125. elseif type == 110 then
  126. spawnvoice = 1004
  127. elseif type == 122 then
  128. spawnvoice = 1023
  129. elseif type == 121 then
  130. spawnvoice = 1024
  131. elseif type == 111 then
  132. spawnvoice = 1003
  133. elseif type == 112 then
  134. spawnvoice = 1004
  135. end
  136. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_"..voice.."_"..spawnvoice..".mp3", "", "hello", 0, 0, Spawn)
  137. end
  138. function respawn(NPC)
  139. spawn(NPC)
  140. end
  141. function EmoteLoop(NPC)
  142. PlayAnimation(NPC, 11150)
  143. AddTimer(NPC, math.random(10000,15000), "EmoteLoop")
  144. end