9
3

ClassSkillCheckNew.lua 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. --[[
  2. Script Name : SpawnScripts/Generic/ClassSkillCheck.lua
  3. Script Author : Dorbin & Neveruary
  4. Script Date : 2023.05.23 12:05:54
  5. Script Purpose : Check & re-check skills for classic choices below level 10.
  6. Script Notes : Re-wrote function to use table loops instead of multiple if statements.
  7. --]]
  8. fighterSkills = {
  9. Martial = 1408356869,
  10. Crushing = 3421494576,
  11. Slashing = 418532101,
  12. ["Dual Wield"] = 1852383242,
  13. Focus = 2638198038
  14. }
  15. priestSkills = {
  16. Inspirations = 2463145248,
  17. Crushing = 3421494576,
  18. Disruption = 613995491,
  19. Ministration = 366253016,
  20. Ordination = 3587918036,
  21. Subjugation = 882983852,
  22. Focus = 2638198038
  23. }
  24. mageSkills = {
  25. Evocations = 3820670534,
  26. Piercing = 3048574950,
  27. Crushing = 3421494576,
  28. Disruption = 613995491,
  29. Ministration = 366253016,
  30. Ordination = 3587918036,
  31. Subjugation = 882983852,
  32. Focus = 2638198038
  33. }
  34. scoutSkills = {
  35. Reconnaissance = 1921433074,
  36. Tracking = 1468243427,
  37. ["Disarm Trap"] = 2200201799,
  38. Ranged = 1756482397,
  39. Piercing = 3048574950,
  40. Slashing = 418532101,
  41. ["Dual Wield"] = 1852383242,
  42. ["Thrown Weapon"] = 2650425026,
  43. Focus = 2638198038
  44. }
  45. fighterWeapons = {
  46. ["Light Armor"] = 2897193374,
  47. Buckler = 4037812502,
  48. Roundshield = 3173504370,
  49. Axe = 2476073427,
  50. ["Great Axe"] = 2954459351,
  51. Sword = 1696217328,
  52. ["Great Sword"] = 2292577688,
  53. Mace = 770311065,
  54. Hammer = 554333641,
  55. ["Great Hammer"] = 1653482350,
  56. Staff = 3180399725
  57. }
  58. priestWeapons = {
  59. Buckler = 4037812502,
  60. Symbol = 545043066,
  61. Mace = 770311065,
  62. Hammer = 554333641,
  63. ["Great Hammer"] = 1653482350,
  64. Staff = 3180399725
  65. }
  66. mageWeapons = {
  67. Buckler = 4037812502,
  68. Symbol = 545043066,
  69. Dagger = 887279616,
  70. Staff = 3180399725
  71. }
  72. scoutWeapons = {
  73. ["Light Armor"] = 2897193374,
  74. Buckler = 4037812502,
  75. Roundshield = 3173504370,
  76. Spear = 1616998748,
  77. Dagger = 887279616,
  78. Bow = 1743366740,
  79. Axe = 2476073427,
  80. Mace = 770311065,
  81. Rapier = 641561514,
  82. Sword = 1696217328
  83. }
  84. fighterRemovedWeapons = {
  85. 887279616, --Dagger
  86. 570458645, --Tower Shield
  87. 3048574950, --Piercing
  88. 1756482397, --Ranged
  89. 540022425, --Parry
  90. 1743366740, --Bow
  91. 2650425026, --Thrown Weapon
  92. 366253016, --Ministration
  93. 613995491, --Disruption
  94. 882983852, --Subjigation
  95. 3587918036 --Ordination
  96. }
  97. priestRemovedWeapons = {
  98. 2897193374, --Light Armor
  99. 887279616, --Dagger
  100. 1696217328, --Sword
  101. 2292577688, --Great Sword
  102. 2476073427, --Axe
  103. 2954459351, --Great Axe
  104. 1616998748, --Spear
  105. 1653482350, --Great Spear
  106. 3173504370, --Roundshield
  107. 570458645, --Tower Shield
  108. 3048574950, --Piercing
  109. 1756482397, --Ranged
  110. 1743366740, --Bow
  111. 2650425026 --Thrown Weapon
  112. }
  113. mageRemovedWeapons = {
  114. 2897193374, --Light Armor
  115. 554333641, --Hammer
  116. 1653482350, --Great Hammer
  117. 1696217328, --Sword
  118. 2292577688, --Great Sword
  119. 2476073427, --Axe
  120. 2954459351, --Great Axe
  121. 1616998748, --Spear
  122. 1653482350, --Great Spear
  123. 3173504370, --Roundshield
  124. 570458645, --Tower Shield
  125. 3048574950, --Piercing
  126. 1756482397, --Ranged
  127. 1743366740, --Bow
  128. 2650425026 --Thrown Weapon
  129. }
  130. scoutRemovedWeapons = {
  131. 2292577688, --Great Sword
  132. 2954459351, --Great Axe
  133. 1616998748, --Spear
  134. 1653482350, --Great Spear
  135. 570458645, --Tower Shield
  136. 366253016, --Ministration
  137. 613995491, --Disruption
  138. 882983852, --Subjigation
  139. 3587918036 --Ordination
  140. }
  141. removedSkills = {
  142. 1124719197, --Tactics/Warrior
  143. 433335062, --Berserk/Berserker
  144. 1209716810, --Protection/Guardian
  145. 3856706740, --Brawl/Brawling
  146. 2011726342, --Tranquility/Monk
  147. 3067436248, --Physicality/Bruiser
  148. 3809066846, --Faith/Crusader
  149. 90523872, --Determined Faith/Paladin
  150. 2741805322, --Determined Zeal/Shadowknight
  151. 1311635100, --Melodies/Bard
  152. 296246391, --Ballads/Troubador
  153. 340921594, --Dirges/Dirge
  154. 1514256692, --Skulldugery/Rogue
  155. 2663054519, --Swashbuckling/Swashbuckler
  156. 1519965519, --Banditry/Brigand
  157. 3167106577, --Stalking/Predator
  158. 1400160844, --Archery/Ranger
  159. 2711101135, --Assassination/Assassin
  160. 3341842907, --Theurgy/Cleric
  161. 2581053277, --Regimens/Templar
  162. 1829443087, --Inquisitions/Inquisitor
  163. 3282420779, --Archegenesis/Druid
  164. 1624274802, --Nature's Reckoning/Fury
  165. 1040683335, --Nature's Refuge/Warden
  166. 3343700951, --Talismans/Shaman
  167. 3467160477, --Fetichisms/Mystic
  168. 3191839982, --Vehemence/Defiler
  169. 287643040, --Enchantments/Enchanter
  170. 2898101972, --Hallucinations/Illusionist
  171. 2950599749, --Protean/Coecerer
  172. 2533124061, --Sorcery/Sorcerer
  173. 2662430630, --Elemental Mastery/Wizard
  174. 193411854, --Noctivagance/Warlock
  175. 2120065377, --Legerdemain/Summoner
  176. 2042842194, --Conjurations/Conjurer
  177. 289471519, --Sepulchers/Necromancer
  178. 1553857724, --Investigation
  179. 3429135390, --Mystical Destruction
  180. 2246237129, --Medium Armor
  181. 241174330, --Heavy Armor
  182. 3177806075, --Fists
  183. 2608320658, --Kite Shield
  184. 570458645, --Tower Shield
  185. 540022425 --Parry
  186. }
  187. harvestingSkills = {
  188. 1970131346, --Transmuting
  189. 3659699625, --Mining
  190. 688591146, --Foresting
  191. 1048513601, --Gathering
  192. 4158365743, --Trapping
  193. 2319450178 --Fishing
  194. }
  195. function hailed(NPC, Spawn)
  196. changeSkills(NPC, Spawn)
  197. end
  198. function changeSkills(NPC, Spawn)
  199. local level = GetLevel(Spawn)*5
  200. local class = GetClass(Spawn)
  201. --FIGHTER
  202. if class == 1 then -- fighter value
  203. Say(NPC,"Starting Skill Check for Fighter")
  204. RemoveSkill(Spawn, 2463145248) -- Inspirations/Priest
  205. RemoveSkill(Spawn, 3820670534) -- Evocations/Mage
  206. RemoveSkill(Spawn, 1921433074) -- Reconnaissance/Scout
  207. RemoveSkill(Spawn, 2200201799) -- Disarm Trap
  208. for k,v in ipairs(fighterSkills) do
  209. SendMessage(Spawn, "Skill ID: " .. v .. ", Level: " .. level, "yellow")
  210. if not HasSkill(Spawn, v) then
  211. AddSkill(Spawn, v, 1, level)
  212. DisplayText(Spawn, 34, "You have learned the " .. k .. " skill")
  213. SendMessage(Spawn,"You have learned the " .. k .. " skill")
  214. end
  215. end
  216. for k,v in ipairs(fighterWeapons) do
  217. if not HasSkill(Spawn, v) then
  218. AddSkill(Spawn, v,1, level)
  219. DisplayText(Spawn, 34, "You are now more proficient with a " .. k)
  220. SendMessage(Spawn,"You are now more proficient with a " .. k)
  221. end
  222. end
  223. for k,v in ipairs(fighterRemovedWeapons) do
  224. RemoveSkill(Spawn, v)
  225. end
  226. --PRIEST
  227. elseif class == 11 then -- priest value
  228. Say(NPC,"Starting Skill Check for Priest")
  229. RemoveSkill(Spawn, 1408356869) -- Martial/Fighter
  230. RemoveSkill(Spawn, 3820670534) -- Evocations/Mage
  231. RemoveSkill(Spawn, 1921433074) -- Reconnaissance/Scout
  232. RemoveSkill(Spawn, 2200201799) -- Disarm Trap
  233. for k,v in ipairs(priestSkills) do
  234. SendMessage(Spawn, "Skill ID: " .. v .. ", Level: " .. level, "yellow")
  235. if not HasSkill(Spawn, v) then
  236. AddSkill(Spawn, v, 1, level)
  237. DisplayText(Spawn, 34, "You have learned the " .. k .. " skill")
  238. SendMessage(Spawn,"You have learned the " .. k .. " skill")
  239. end
  240. end
  241. for k,v in ipairs(priestWeapons) do
  242. if not HasSkill(Spawn, v) then
  243. AddSkill(Spawn, v, 1, level)
  244. DisplayText(Spawn, 34, "You are now more proficient with a " .. k)
  245. SendMessage(Spawn,"You are now more proficient with a " .. k)
  246. end
  247. end
  248. for k,v in ipairs(priestRemovedWeapons) do
  249. RemoveSkill(Spawn, v)
  250. end
  251. --MAGE
  252. elseif class == 21 then -- mage value
  253. Say(NPC,"Starting Skill Check for Mage")
  254. RemoveSkill(Spawn, 1921433074) -- Reconnaissance/Scout
  255. RemoveSkill(Spawn, 1408356869) -- Martial/Fighter
  256. RemoveSkill(Spawn, 2463145248) -- Inspirations/Priest
  257. RemoveSkill(Spawn, 2200201799) -- Disarm Trap
  258. for k,v in ipairs(mageSkills) do
  259. if not HasSkill(Spawn, v) then
  260. AddSkill(Spawn, v, 1, level)
  261. DisplayText(Spawn, 34, "You have learned the " .. k .. " skill")
  262. SendMessage(Spawn,"You have learned the " .. k .. " skill")
  263. end
  264. end
  265. for k,v in ipairs(mageWeapons) do
  266. if not HasSkill(Spawn, v) then
  267. AddSkill(Spawn, v, 1, level)
  268. DisplayText(Spawn, 34, "You are now more proficient with a " .. k)
  269. SendMessage(Spawn,"You are now more proficient with a " .. k)
  270. end
  271. end
  272. for k,v in ipairs(mageRemovedWeapons) do
  273. RemoveSkill(Spawn, v)
  274. end
  275. --SCOUT
  276. elseif class == 31 then -- scout value
  277. Say(NPC,"Starting Skill Check for Scout")
  278. RemoveSkill(Spawn, 1408356869) -- Martial/Fighter
  279. RemoveSkill(Spawn, 2463145248) -- Inspirations/Priest
  280. RemoveSkill(Spawn, 3820670534) -- Evocations/Mage
  281. for k,v in ipairs(scoutSkills) do
  282. if not HasSkill(Spawn, v) then
  283. AddSkill(Spawn, v, 1, level)
  284. DisplayText(Spawn, 34, "You have learned the " .. k .. " skill")
  285. SendMessage(Spawn,"You have learned the " .. k .. " skill")
  286. end
  287. end
  288. for k,v in ipairs(scoutWeapons) do
  289. if not HasSkill(Spawn, v) then
  290. AddSkill(Spawn, v, 1, level)
  291. DisplayText(Spawn, 34, "You are now more proficient with a " .. k)
  292. SendMessage(Spawn,"You are now more proficient with a " .. k)
  293. end
  294. end
  295. for k,v in ipairs(scoutRemovedWeapons) do
  296. RemoveSkill(Spawn, v)
  297. end
  298. else
  299. Say(NPC, "Classic class not detected. Stopping.")
  300. end
  301. --ADD HARVESTING & REMOVE SUBCLASSES
  302. for k,v in ipairs(harvestingSkills) do
  303. if not HasSkill(Spawn, v) then
  304. AddSkill(Spawn, v,1,level)
  305. end
  306. end
  307. for k,v in ipairs(removedSkills) do
  308. RemoveSkill(Spawn, v)
  309. end
  310. end