aGraystoneGuildbruiserDojo.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. elseif Type == 110 or Type == 112 or Type == 121 or Type == 122 then
  75. HairType = MakeRandomInt(1133,1140)
  76. SpawnSet(NPC, "hair_type", HairType)
  77. elseif Type == 109 then
  78. HairType = MakeRandomInt(1135,1140)
  79. SpawnSet(NPC, "hair_type", HairType)
  80. else
  81. HairType = MakeRandomInt(1136,1140)
  82. SpawnSet(NPC, "hair_type", HairType)
  83. end
  84. end
  85. function Face(NPC)
  86. local Type = GetModelType(NPC)
  87. local FaceHairType = 0
  88. if Type == 134 then
  89. local FaceHairType = MakeRandomInt(1164,1191)
  90. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  91. elseif Type == 110 then
  92. local FaceHairType = MakeRandomInt(1164,1170)
  93. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  94. elseif Type == 112 then
  95. local FaceHairType = MakeRandomInt(1185,1189)
  96. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  97. else
  98. local FaceHairType = MakeRandomInt(1166,1175)
  99. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  100. end
  101. end
  102. function hailed(NPC, Spawn)
  103. FaceTarget(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", "", "hello", 0, 0, Spawn)
  129. end
  130. function respawn(NPC)
  131. spawn(NPC)
  132. end
  133. function EmoteLoop(NPC)
  134. PlayAnimation(NPC, 11150)
  135. AddTimer(NPC, math.random(10000,15000), "EmoteLoop")
  136. end