9
3

aGraystoneGuildbruiserDojoBarbarian.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/aGraystoneGuildbruiserDojoBarbarian.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,2)
  10. if model == 1 then
  11. SetModelType(NPC, "111") -- barbarian female
  12. SpawnSet(NPC, "soga_model_type", "111")
  13. SpawnSet(NPC, "chest_type", "5457")
  14. SpawnSet(NPC, "legs_type", "5458")
  15. else
  16. local BarbarianMale = MakeRandomInt(1467,1471)
  17. SetModelType(NPC, "112") -- barbarian male
  18. SpawnSet(NPC, "soga_model_type", "112")
  19. SpawnSet(NPC, "chest_type", "5461")
  20. SpawnSet(NPC, "legs_type", "5462")
  21. end
  22. Hair(NPC)
  23. Face(NPC)
  24. SpawnSet(NPC, "action_state", 372)
  25. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  26. end
  27. function Hair(NPC)
  28. local Type = GetModelType(NPC)
  29. local HairType = 0
  30. if Type == 132 or Type == 134 then
  31. HairType = MakeRandomInt(1121,1140)
  32. SpawnSet(NPC, "hair_type", HairType)
  33. elseif Type == 110 or Type == 112 or Type == 121 or Type == 122 then
  34. HairType = MakeRandomInt(1133,1140)
  35. SpawnSet(NPC, "hair_type", HairType)
  36. elseif Type == 109 then
  37. HairType = MakeRandomInt(1135,1140)
  38. SpawnSet(NPC, "hair_type", HairType)
  39. else
  40. HairType = MakeRandomInt(1136,1140)
  41. SpawnSet(NPC, "hair_type", HairType)
  42. end
  43. end
  44. function Face(NPC)
  45. local Type = GetModelType(NPC)
  46. local FaceHairType = 0
  47. if Type == 134 then
  48. local FaceHairType = MakeRandomInt(1164,1191)
  49. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  50. elseif Type == 110 then
  51. local FaceHairType = MakeRandomInt(1164,1170)
  52. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  53. elseif Type == 112 then
  54. local FaceHairType = MakeRandomInt(1185,1189)
  55. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  56. else
  57. local FaceHairType = MakeRandomInt(1166,1175)
  58. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  59. end
  60. end
  61. function hailed(NPC, Spawn)
  62. local type = GetModelType(NPC)
  63. local voice = MakeRandomInt(1,3)
  64. local spawnvoice = 0
  65. if type == 132 then
  66. spawnvoice = 1011
  67. elseif type == 134 then
  68. spawnvoice = 1054
  69. elseif type >= 91 and type <= 96 then
  70. spawnvoice = 1047
  71. elseif type >= 97 and type <= 102 then
  72. spawnvoice = 1048
  73. elseif type == 109 then
  74. spawnvoice = 1059
  75. elseif type == 110 then
  76. spawnvoice = 1004
  77. elseif type == 122 then
  78. spawnvoice = 1023
  79. elseif type == 121 then
  80. spawnvoice = 1024
  81. elseif type == 111 then
  82. spawnvoice = 1003
  83. elseif type == 112 then
  84. spawnvoice = 1004
  85. end
  86. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_"..voice.."_"..spawnvoice..".mp3", "", "", 0, 0, Spawn)
  87. end
  88. function respawn(NPC)
  89. spawn(NPC)
  90. end
  91. function EmoteLoop(NPC)
  92. SpawnSet(NPC, "action_state", 0)
  93. local choice = MakeRandomInt(1,8)
  94. if choice == 1 then
  95. PlayAnimation(NPC, 1644)
  96. AddTimer(NPC, 1550, "Idle")
  97. elseif choice == 2 then
  98. PlayAnimation(NPC, 1646)
  99. AddTimer(NPC, 2100, "Idle")
  100. elseif choice == 3 then
  101. PlayAnimation(NPC, 10783)
  102. AddTimer(NPC, 2050, "Idle")
  103. elseif choice == 4 then
  104. PlayAnimation(NPC, 12036)
  105. AddTimer(NPC, 2100, "Idle")
  106. elseif choice == 5 then
  107. PlayAnimation(NPC, 12048)
  108. AddTimer(NPC, 1450, "Idle")
  109. elseif choice == 6 then
  110. PlayAnimation(NPC, 12050)
  111. AddTimer(NPC, 1550, "Idle")
  112. elseif choice == 7 then
  113. PlayAnimation(NPC, 12054)
  114. AddTimer(NPC, 3400, "Idle")
  115. else
  116. PlayAnimation(NPC, 12074)
  117. AddTimer(NPC, 2300, "Idle")
  118. end
  119. end
  120. function Idle(NPC)
  121. PlayAnimation(NPC, 372)
  122. SpawnSet(NPC, "action_state", 372)
  123. local timer = MakeRandomInt(500,2500)
  124. AddTimer(NPC, timer, "EmoteLoop")
  125. end