EquipmentModule.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. --[[
  2. Script Name : SpawnScripts/Generic/EquipmentModule.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2024.01.08 05:01:52
  5. Script Purpose : Equipment Appearance Presets for NPCModule
  6. :
  7. --]]
  8. function RandomWeapons(NPC, Spawn) --randomize weapons based on class
  9. local class = GetClass(NPC)
  10. if class >= 1 and class <= 4 then
  11. RandomFighterWeapons(NPC)
  12. elseif class >= 5 and class <=7 then
  13. RandomBrawlerWeapons(NPC)
  14. elseif class >= 8 and class <= 10 then
  15. RandomFighterWeapons(NPC)
  16. elseif class >= 11 and class <= 20 then
  17. RandomPriestWeapons(NPC)
  18. elseif class >= 21 and class <= 30 then
  19. RandomMageWeapons(NPC)
  20. elseif class >= 31 and class <= 40 then
  21. RandomScoutWeapons(NPC)
  22. else
  23. RandomFighterWeapons(NPC)
  24. end
  25. end
  26. function RandomFighterWeapons(NPC, Spawn)
  27. local weapon = MakeRandomInt(1,10)
  28. if weapon == 1 then
  29. SetEquipment(NPC, 0, 2228, 255, 255, 255, 255, 255, 255)
  30. elseif weapon == 2 then
  31. SetEquipment(NPC, 0, 2237, 255, 255, 255, 255, 255, 255)
  32. elseif weapon == 3 then
  33. SetEquipment(NPC, 0, 2240, 255, 255, 255, 255, 255, 255)
  34. elseif weapon == 4 then
  35. SetEquipment(NPC, 0, 2296, 255, 255, 255, 255, 255, 255)
  36. elseif weapon == 5 then
  37. SetEquipment(NPC, 0, 2319, 255, 255, 255, 255, 255, 255)
  38. elseif weapon == 6 then
  39. SetEquipment(NPC, 0, 2548, 255, 255, 255, 255, 255, 255)
  40. elseif weapon == 7 then
  41. SetEquipment(NPC, 0, 3242, 255, 255, 255, 255, 255, 255)
  42. elseif weapon == 8 then
  43. SetEquipment(NPC, 0, 2282, 255, 255, 255, 255, 255, 255)
  44. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  45. elseif weapon == 9 then
  46. SetEquipment(NPC, 0, 2409, 255, 255, 255, 255, 255, 255)
  47. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  48. elseif weapon == 10 then
  49. SetEquipment(NPC, 0, 2240, 255, 255, 255, 255, 255, 255)
  50. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  51. end
  52. end
  53. function RandomPriestWeapons(NPC, Spawn)
  54. local weapon = MakeRandomInt(1,6)
  55. if weapon == 1 then
  56. SetEquipment(NPC, 0, 3292, 255, 255, 255, 255, 255, 255)
  57. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  58. elseif weapon == 2 then
  59. SetEquipment(NPC, 0, 3843, 255, 255, 255, 255, 255, 255)
  60. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  61. elseif weapon == 3 then
  62. SetEquipment(NPC, 0, 2324, 255, 255, 255, 255, 255, 255)
  63. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  64. elseif weapon == 4 then
  65. SetEquipment(NPC, 0, 2287, 255, 255, 255, 255, 255, 255)
  66. SetEquipment(NPC, 1, 3255, 255, 255, 255, 255, 255, 255)
  67. elseif weapon == 5 then
  68. SetEquipment(NPC, 0, 2516, 255, 255, 255, 255, 255, 255)
  69. elseif weapon == 6 then
  70. SetEquipment(NPC, 0, 2396, 255, 255, 255, 255, 255, 255)
  71. end
  72. end
  73. function RandomMageWeapons(NPC, Spawn)
  74. local weapon = MakeRandomInt(1,4)
  75. if weapon == 1 then
  76. SetEquipment(NPC, 1, 3642, 255, 255, 255, 255, 255, 255)
  77. elseif weapon == 2 or weapon == 3 then
  78. SetEquipment(NPC, 1, 2426, 255, 255, 255, 255, 255, 255)
  79. elseif weapon == 4 then
  80. SetEquipment(NPC, 1, 3675, 255, 255, 255, 255, 255, 255)
  81. end
  82. end
  83. function RandomScoutWeapons(NPC, Spawn)
  84. local weapon = MakeRandomInt(1,3)
  85. if weapon == 1 then
  86. SetEquipment(NPC, 0, 2264, 255, 255, 255, 255, 255, 255)
  87. SetEquipment(NPC, 1, 2264, 255, 255, 255, 255, 255, 255)
  88. elseif weapon == 2 then
  89. SetEquipment(NPC, 0, 2312, 255, 255, 255, 255, 255, 255)
  90. SetEquipment(NPC, 1, 2312, 255, 255, 255, 255, 255, 255)
  91. elseif weapon == 3 then
  92. SetEquipment(NPC, 0, 3286, 255, 255, 255, 255, 255, 255)
  93. SetEquipment(NPC, 1, 3286, 255, 255, 255, 255, 255, 255)
  94. end
  95. end
  96. function RandomBrawlerWeapons(NPC, Spawn)
  97. local weapon = MakeRandomInt(1,4)
  98. if weapon == 1 then
  99. SetEquipment(NPC, 0, 2536, 255, 255, 255, 255, 255, 255)
  100. SetEquipment(NPC, 1, 2536, 255, 255, 255, 255, 255, 255)
  101. elseif weapon == 2 then
  102. SetEquipment(NPC, 0, 2534, 255, 255, 255, 255, 255, 255)
  103. SetEquipment(NPC, 1, 2534, 255, 255, 255, 255, 255, 255)
  104. elseif weapon == 3 then
  105. SetEquipment(NPC, 0, 2274, 255, 255, 255, 255, 255, 255)
  106. SetEquipment(NPC, 1, 2274, 255, 255, 255, 255, 255, 255)
  107. elseif weapon == 4 then
  108. SetEquipment(NPC, 0, 3290, 255, 255, 255, 255, 255, 255)
  109. SetEquipment(NPC, 1, 3290, 255, 255, 255, 255, 255, 255)
  110. end
  111. end
  112. function OrcArmorCommon(NPC, Spawn)
  113. RandomWeapons(NPC)
  114. local mismatch = MakeRandomInt(1,5)
  115. if mismatch == 1 then
  116. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  117. SetEquipment(NPC, 5, 1081, 255, 255, 255, 255, 255, 255)
  118. SetEquipment(NPC, 8, 1080, 255, 255, 255, 255, 255, 255)
  119. elseif mismatch ==2 then
  120. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  121. SetEquipment(NPC, 5, 1081, 255, 255, 255, 255, 255, 255)
  122. SetEquipment(NPC, 8, 1080, 255, 255, 255, 255, 255, 255)
  123. SetEquipment(NPC, 3, 1079, 255, 255, 255, 255, 255, 255)
  124. elseif mismatch == 3 then
  125. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  126. elseif mismatch == 4 then
  127. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  128. SetEquipment(NPC, 5, 1081, 255, 255, 255, 255, 255, 255)
  129. SetEquipment(NPC, 8, 1080, 255, 255, 255, 255, 255, 255)
  130. SetEquipment(NPC, 2, 1083, 255, 255, 255, 255, 255, 255)
  131. SetEquipment(NPC, 3, 1079, 255, 255, 255, 255, 255, 255)
  132. elseif mismatch == 5 then
  133. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  134. SetEquipment(NPC, 8, 1080, 255, 255, 255, 255, 255, 255)
  135. SetEquipment(NPC, 3, 1079, 255, 255, 255, 255, 255, 255)
  136. end
  137. end
  138. function GhostOrcArmorCommon(NPC, Spawn)
  139. local mismatch = MakeRandomInt(1,5)
  140. if mismatch == 1 then
  141. SetEquipment(NPC, 7, 3747, 255, 255, 255, 255, 255, 255)
  142. SetEquipment(NPC, 5, 3744, 255, 255, 255, 255, 255, 255)
  143. SetEquipment(NPC, 8, 3743, 255, 255, 255, 255, 255, 255)
  144. elseif mismatch ==2 then
  145. SetEquipment(NPC, 7, 3747, 255, 255, 255, 255, 255, 255)
  146. SetEquipment(NPC, 5, 3744, 255, 255, 255, 255, 255, 255)
  147. SetEquipment(NPC, 8, 3743, 255, 255, 255, 255, 255, 255)
  148. SetEquipment(NPC, 3, 3742, 255, 255, 255, 255, 255, 255)
  149. elseif mismatch == 3 then
  150. SetEquipment(NPC, 7, 3747, 255, 255, 255, 255, 255, 255)
  151. elseif mismatch == 4 then
  152. SetEquipment(NPC, 7, 3747, 255, 255, 255, 255, 255, 255)
  153. SetEquipment(NPC, 5, 3744, 255, 255, 255, 255, 255, 255)
  154. SetEquipment(NPC, 8, 3743, 255, 255, 255, 255, 255, 255)
  155. SetEquipment(NPC, 2, 3746, 255, 255, 255, 255, 255, 255)
  156. SetEquipment(NPC, 3, 3742, 255, 255, 255, 255, 255, 255)
  157. elseif mismatch == 5 then
  158. SetEquipment(NPC, 7, 3747, 255, 255, 255, 255, 255, 255)
  159. SetEquipment(NPC, 8, 3743, 255, 255, 255, 255, 255, 255)
  160. SetEquipment(NPC, 3, 3742, 255, 255, 255, 255, 255, 255)
  161. end
  162. end
  163. function FreeportGuard(NPC, Spawn)
  164. SetEquipment(NPC, 0, 2261, 255, 255, 255, 255, 255, 255)
  165. SetEquipment(NPC, 2, 932, 255, 255, 255, 255, 255, 255)
  166. SetEquipment(NPC, 3, 928, 255, 255, 255, 255, 255, 255)
  167. SetEquipment(NPC, 4, 934, 255, 255, 255, 255, 255, 255)
  168. SetEquipment(NPC, 5, 930, 255, 255, 255, 255, 255, 255)
  169. SetEquipment(NPC, 6, 931, 255, 255, 255, 255, 255, 255)
  170. SetEquipment(NPC, 7, 933, 255, 255, 255, 255, 255, 255)
  171. SetEquipment(NPC, 8, 929, 255, 255, 255, 255, 255, 255)
  172. end
  173. function QeynosGuard(NPC, Spawn)
  174. SetEquipment(NPC, 0, 3245, 255, 255, 255, 255, 255, 255)
  175. SetEquipment(NPC, 2, 713, 255, 255, 255, 255, 255, 255)
  176. SetEquipment(NPC, 3, 709, 255, 255, 255, 255, 255, 255)
  177. SetEquipment(NPC, 4, 715, 255, 255, 255, 255, 255, 255)
  178. SetEquipment(NPC, 5, 711, 255, 255, 255, 255, 255, 255)
  179. SetEquipment(NPC, 6, 712, 255, 255, 255, 255, 255, 255)
  180. SetEquipment(NPC, 7, 714, 255, 255, 255, 255, 255, 255)
  181. SetEquipment(NPC, 8, 710, 255, 255, 255, 255, 255, 255)
  182. end
  183. function OrcChainCommon(NPC, Spawn)
  184. SetEquipment(NPC, 3, 875, 50, 50, 50, 50, 50, 50)
  185. SetEquipment(NPC, 5, 877, 50, 50, 50, 50, 50, 50)
  186. SetEquipment(NPC, 7, 880, 50, 50, 50, 50, 50, 50)
  187. SetEquipment(NPC, 8, 876, 50, 50, 50, 50, 50, 50)
  188. end
  189. function TradesmanLow(NPC, Spawn)
  190. local gender = GetGender(NPC)
  191. if gender == 1 then
  192. SetEquipment(NPC, 3, 1873, 255, 255, 255, 255, 255, 255)
  193. SetEquipment(NPC, 7, 1874, 255, 255, 255, 255, 255, 255)
  194. elseif gender == 2 then
  195. SetEquipment(NPC, 3, 2507, 255, 255, 255, 255, 255, 255)
  196. SetEquipment(NPC, 7, 2508, 255, 255, 255, 255, 255, 255)
  197. end
  198. SetEquipment(NPC, 8, 1000, 255, 255, 255, 255, 255, 255)
  199. end
  200. function Beggar(NPC, Spawn)
  201. SetEquipment(NPC, 3, 5529, 255, 255, 255, 255, 255, 255)
  202. SetEquipment(NPC, 7, 5530, 255, 255, 255, 255, 255, 255)
  203. end
  204. function DervishChain(NPC, Spawn)
  205. RandomWeapons(NPC)
  206. SetEquipment(NPC, 3, 867, 255, 255, 255, 255, 255, 255)
  207. SetEquipment(NPC, 5, 869, 255, 255, 255, 255, 255, 255)
  208. SetEquipment(NPC, 6, 870, 255, 255, 255, 255, 255, 255)
  209. SetEquipment(NPC, 7, 872, 255, 255, 255, 255, 255, 255)
  210. SetEquipment(NPC, 8, 868, 255, 255, 255, 255, 255, 255)
  211. end
  212. function DervishLeather(NPC, Spawn)
  213. RandomWeapons(NPC)
  214. SetEquipment(NPC, 3, 1079, 255, 255, 255, 255, 255, 255)
  215. SetEquipment(NPC, 5, 1081, 255, 255, 255, 255, 255, 255)
  216. SetEquipment(NPC, 6, 1082, 255, 255, 255, 255, 255, 255)
  217. SetEquipment(NPC, 7, 1084, 255, 255, 255, 255, 255, 255)
  218. SetEquipment(NPC, 8, 1080, 255, 255, 255, 255, 255, 255)
  219. end
  220. function DervishRobe(NPC, Spawn)
  221. RandomWeapons(NPC)
  222. SetEquipment(NPC, 3, 782, 255, 255, 255, 255, 255, 255)
  223. SetEquipment(NPC, 2, 791, 255, 255, 255, 255, 255, 255)
  224. SetEquipment(NPC, 6,424, 255, 255, 255, 255, 255, 255)
  225. SetEquipment(NPC, 7, 790, 255, 255, 255, 255, 255, 255)
  226. SetEquipment(NPC, 8, 470, 255, 255, 255, 255, 255, 255)
  227. end
  228. function DervishThug(NPC, Spawn)
  229. RandomWeapons(NPC)
  230. SetEquipment(NPC, 3, 859, 255, 255, 255, 255, 255, 255)
  231. SetEquipment(NPC, 5, 861, 255, 255, 255, 255, 255, 255)
  232. SetEquipment(NPC, 6, 862, 255, 255, 255, 255, 255, 255)
  233. SetEquipment(NPC, 7, 864, 255, 255, 255, 255, 255, 255)
  234. SetEquipment(NPC, 8, 860, 255, 255, 255, 255, 255, 255)
  235. end