aGraystoneGuildbruiserDojoFair.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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,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. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  36. end
  37. function Hair(NPC)
  38. local Type = GetModelType(NPC)
  39. local HairType = 0
  40. if Type == 132 or Type == 134 then
  41. HairType = MakeRandomInt(1121,1140)
  42. SpawnSet(NPC, "hair_type", HairType)
  43. elseif Type == 110 or Type == 112 or Type == 121 or Type == 122 then
  44. HairType = MakeRandomInt(1133,1140)
  45. SpawnSet(NPC, "hair_type", HairType)
  46. elseif Type == 109 then
  47. HairType = MakeRandomInt(1135,1140)
  48. SpawnSet(NPC, "hair_type", HairType)
  49. else
  50. HairType = MakeRandomInt(1136,1140)
  51. SpawnSet(NPC, "hair_type", HairType)
  52. end
  53. end
  54. function Face(NPC)
  55. local Type = GetModelType(NPC)
  56. local FaceHairType = 0
  57. if Type == 134 then
  58. local FaceHairType = MakeRandomInt(1164,1191)
  59. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  60. elseif Type == 110 then
  61. local FaceHairType = MakeRandomInt(1164,1170)
  62. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  63. else
  64. local FaceHairType = MakeRandomInt(1166,1175)
  65. SpawnSet(NPC, "facial_hair_type", FaceHairType)
  66. end
  67. end
  68. function hailed(NPC, Spawn)
  69. FaceTarget(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", "", "hello", 0, 0, Spawn)
  95. end
  96. function respawn(NPC)
  97. spawn(NPC)
  98. end
  99. function EmoteLoop(NPC)
  100. PlayAnimation(NPC, 11150)
  101. AddTimer(NPC, math.random(10000,15000), "EmoteLoop")
  102. end