9
3

aGraystoneGuildbruiserDojoFightingFair.lua 4.8 KB

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