SubClassToCommoner.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. --[[
  2. Script Name : SpawnScripts/Generic/SubClassToCommoner.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.11 04:09:45
  5. Script Purpose : For converting to a Commoner (naked) from a starting character's subclass. Newer clients start as subclasses.
  6. :
  7. --]]
  8. function RemoveGear(NPC,player)
  9. if HasItem(player,20903) then
  10. RemoveItem(player,20903,1)
  11. end
  12. if HasItem(player,20921) then
  13. RemoveItem(player,20921,1)
  14. end
  15. UnequipSlot(player,0)
  16. UnequipSlot(player,1)
  17. UnequipSlot(player,3)
  18. UnequipSlot(player,6)
  19. UnequipSlot(player,7)
  20. UnequipSlot(player,8)
  21. UnequipSlot(player,16)
  22. UnequipSlot(player,17)
  23. UnequipSlot(player,20)
  24. UnequipSlot(player,22)
  25. UnequipSlot(player, 23)
  26. Qeynos = GetFactionAmount(player, 11)
  27. Freeport = GetFactionAmount(player, 12)
  28. Neriak = GetFactionAmount(player, 13)
  29. Kelethin = GetFactionAmount(player, 14)
  30. Halas = GetFactionAmount(player, 16)
  31. Gorowyn = GetFactionAmount(player, 17)
  32. alignment = GetAlignment(player)
  33. if GetRace(player) == 0 or GetRace(player) == 3 or GetRace(player) == 5 or GetRace(player) == 6 or GetRace(player) == 9 or GetRace(player) == 11 or GetRace(player) == 20 then
  34. SetAlignment(player, 2)
  35. end
  36. if Qeynos >0 then ChangeFaction(player, 11, -Qeynos)
  37. elseif Qeynos <0 then ChangeFaction(player, 11, (Qeynos*-1))
  38. end
  39. if Freeport >0 then ChangeFaction(player, 12, -Freeport)
  40. elseif Freeport <0 then ChangeFaction(player, 12, (Freeport*-1))
  41. end
  42. if Neriak >0 then ChangeFaction(player, 13, -Neriak)
  43. elseif Neriak <0 then ChangeFaction(player, 13, (Neriak*-1))
  44. end
  45. if Kelethin >0 then ChangeFaction(player, 14, -Kelethin)
  46. elseif Kelethin <0 then ChangeFaction(player, 14, (Kelethin*-1))
  47. end
  48. if Halas >0 then ChangeFaction(player, 16, -Halas)
  49. elseif Halas <0 then ChangeFaction(player, 16, (Halas*-1))
  50. end
  51. if Gorowyn >0 then ChangeFaction(player, 17, -Gorowyn)
  52. elseif Gorowyn <0 then ChangeFaction(player, 17, (Gorowyn*-1))
  53. end
  54. --[[
  55. Qfighters = GetFactionAmount(player,214)
  56. Qpriests = GetFactionAmount(player,155)
  57. Qscouts = GetFactionAmount(player, 243)
  58. Qmages = GetFactionAmount(player, 136)
  59. FPfighters = GetFactionAmount(player,102)
  60. FPpriests = GetFactionAmount(player,105)
  61. FPscouts = GetFactionAmount(player, 103)
  62. FPmages = GetFactionAmount(player, 104)
  63. if Qfighters >0 then ChangeFaction(player, 214, -Qfighters)
  64. else ChangeFaction(player, 214, (Qfighters*-1))
  65. end
  66. if Qpriests >0 then ChangeFaction(player, 155, -Qpriests)
  67. else ChangeFaction(player, 155, (Qpriests*-1))
  68. end
  69. if Qscouts >0 then ChangeFaction(player, 243, -Qscouts)
  70. else ChangeFaction(player, 243, (Qscouts*-1))
  71. end
  72. if Qmages >0 then ChangeFaction(player, 102, -Qmages)
  73. else ChangeFaction(player, 102, (Qmages*-1))
  74. end
  75. if FPfighters >0 then ChangeFaction(player, 16, -FPfighters)
  76. else ChangeFaction(player, 16, (FPfighters*-1))
  77. end
  78. if FPpriests >0 then ChangeFaction(player, 105, -FPpriests)
  79. else ChangeFaction(player, 105, (FPpriests*-1))
  80. end
  81. if FPscouts >0 then ChangeFaction(player, 103, -FPscouts)
  82. else ChangeFaction(player, 103, (FPscouts*-1))
  83. end
  84. if FPmages >0 then ChangeFaction(player, 104, -FPmages)
  85. else ChangeFaction(player, 104, (FPmages*-1))
  86. end
  87. ]]--
  88. AddTimer(NPC,500,"Removal",1,player)
  89. AddTimer(NPC,1000,"SkillSwitch",1,player)
  90. end
  91. function Removal(NPC,player)
  92. if HasItem(player,134899) then
  93. RemoveItem(player,134899,1)
  94. end
  95. if HasItem(player,71041) then
  96. RemoveItem(player,71041,1)
  97. end
  98. if HasItem(player,134900) then
  99. RemoveItem(player,134900,1)
  100. end
  101. if HasItem(player,134901) then
  102. RemoveItem(player,134901,1)
  103. end
  104. if HasItem(player,186964) then
  105. RemoveItem(player,186964,1)
  106. end
  107. if HasItem(player,89436) then
  108. RemoveItem(player,89436,1)
  109. end
  110. if HasItem(player,36211) then
  111. RemoveItem(player,36211,20)
  112. end
  113. if HasItem(player,144517) then
  114. RemoveItem(player,144517,1)
  115. end
  116. if HasItem(player,144516) then
  117. RemoveItem(player,144516,1)
  118. end
  119. if HasItem(player,184887) then
  120. RemoveItem(player,184887,1)
  121. end
  122. if HasItem(player,184889) then
  123. RemoveItem(player,184889,1)
  124. end
  125. if HasItem(player,184886) then
  126. RemoveItem(player,184886,1)
  127. end
  128. if HasItem(player,88905) then
  129. RemoveItem(player,88905,1)
  130. end
  131. if HasItem(player,154403) then
  132. RemoveItem(player,154403,1)
  133. end
  134. if HasItem(player,154402) then
  135. RemoveItem(player,154402,1)
  136. end
  137. if HasItem(player,154401) then
  138. RemoveItem(player,154401,1)
  139. end
  140. if HasItem(player,79258) then
  141. RemoveItem(player,79258,1)
  142. end
  143. if HasItem(player,160641) then
  144. RemoveItem(player,160641,1)
  145. end
  146. if HasItem(player,20921) then
  147. RemoveItem(player,20921,1)
  148. end
  149. if HasItem(player,160638) then
  150. RemoveItem(player,160638,1)
  151. end
  152. if HasItem(player,83260) then
  153. RemoveItem(player,83260,1)
  154. end
  155. if HasItem(player,189954) then
  156. RemoveItem(player,189954,1)
  157. end
  158. if HasItem(player,189955) then
  159. RemoveItem(player,189955,1)
  160. end
  161. if HasItem(player,189953) then
  162. RemoveItem(player,189953,1)
  163. end
  164. if HasItem(player,90087) then
  165. RemoveItem(player,90087,1)
  166. end
  167. if HasItem(player,139787) then
  168. RemoveItem(player,139787,1)
  169. end
  170. if HasItem(player,139788) then
  171. RemoveItem(player,139788,1)
  172. end
  173. if HasItem(player,139789) then
  174. RemoveItem(player,139789,1)
  175. end
  176. if HasItem(player,73251) then
  177. RemoveItem(player,73251,1)
  178. end
  179. if HasItem(player,158994) then
  180. RemoveItem(player,158994,1)
  181. end
  182. if HasItem(player,158995) then
  183. RemoveItem(player,158995,1)
  184. end
  185. if HasItem(player,158996) then
  186. RemoveItem(player,158996,1)
  187. end
  188. if HasItem(player,80159) then
  189. RemoveItem(player,80159,1)
  190. end
  191. if HasItem(player,164838) then
  192. RemoveItem(player,164838,1)
  193. end
  194. if HasItem(player,164839) then
  195. RemoveItem(player,164839,1)
  196. end
  197. if HasItem(player,164841) then
  198. RemoveItem(player,164841,1)
  199. end
  200. if HasItem(player,43203) then
  201. RemoveItem(player,43203,1)
  202. end
  203. if HasItem(player,84307) then
  204. RemoveItem(player,84307,1)
  205. end
  206. if HasItem(player,84307) then
  207. RemoveItem(player,84307,1)
  208. end
  209. if HasItem(player,20530) then
  210. RemoveItem(player,20530,1)
  211. end
  212. if HasItem(player,160639) then
  213. RemoveItem(player,160639,1)
  214. end
  215. if HasItem(player,86297) then
  216. RemoveItem(player,86297,1)
  217. end
  218. if HasItem(player,176518) then
  219. RemoveItem(player,176518,1)
  220. end
  221. if HasItem(player,176519) then
  222. RemoveItem(player,176519,1)
  223. end
  224. if HasItem(player,176520) then
  225. RemoveItem(player,176520,1)
  226. end
  227. if HasItem(player,54189) then
  228. RemoveItem(player,54189,1)
  229. end
  230. if HasItem(player,36684) then
  231. RemoveItem(player,36684,1)
  232. end
  233. if HasItem(player,157226) then
  234. RemoveItem(player,157226,1)
  235. end
  236. if HasItem(player,157229) then
  237. RemoveItem(player,157229,1)
  238. end
  239. if HasItem(player,157225) then
  240. RemoveItem(player,157225,1)
  241. end
  242. if HasItem(player,79782) then
  243. RemoveItem(player,79782,1)
  244. end
  245. if HasItem(player,52601) then
  246. RemoveItem(player,52601,1)
  247. end
  248. if HasItem(player,137308) then
  249. RemoveItem(player,137308,1)
  250. end
  251. if HasItem(player,137307) then
  252. RemoveItem(player,137307,1)
  253. end
  254. if HasItem(player,137306) then
  255. RemoveItem(player,137306,1)
  256. end
  257. if HasItem(player,40228) then
  258. RemoveItem(player,40228,1)
  259. end
  260. if HasItem(player,20538) then
  261. RemoveItem(player,20538,1)
  262. end
  263. if HasItem(player,72751) then
  264. RemoveItem(player,72751,1)
  265. end
  266. if HasItem(player,135223) then
  267. RemoveItem(player,135223,1)
  268. end
  269. if HasItem(player,135225) then
  270. RemoveItem(player,135225,1)
  271. end
  272. if HasItem(player,135227) then
  273. RemoveItem(player,135227,1)
  274. end
  275. if HasItem(player,71059) then
  276. RemoveItem(player,71059,1)
  277. end
  278. if HasItem(player,43528) then
  279. RemoveItem(player,43528,1)
  280. end
  281. if HasItem(player,20527) then
  282. RemoveItem(player,20527,1)
  283. end
  284. if HasItem(player,168902) then
  285. RemoveItem(player,168902,1)
  286. end
  287. if HasItem(player,168903) then
  288. RemoveItem(player,168903,1)
  289. end
  290. if HasItem(player,168904) then
  291. RemoveItem(player,168904,1)
  292. end
  293. if HasItem(player,85113) then
  294. RemoveItem(player,85113,1)
  295. end
  296. if HasItem(player,53700) then
  297. RemoveItem(player,53700,1)
  298. end
  299. if HasItem(player,144058) then
  300. RemoveItem(player,144058,1)
  301. end
  302. if HasItem(player,144059) then
  303. RemoveItem(player,144059,1)
  304. end
  305. if HasItem(player,144060) then
  306. RemoveItem(player,144060,1)
  307. end
  308. if HasItem(player,75400) then
  309. RemoveItem(player,75400,1)
  310. end
  311. if HasItem(player,165131) then
  312. RemoveItem(player,165131,1)
  313. end
  314. if HasItem(player,165132) then
  315. RemoveItem(player,165132,1)
  316. end
  317. if HasItem(player,165135) then
  318. RemoveItem(player,165135,1)
  319. end
  320. if HasItem(player,84347) then
  321. RemoveItem(player,84347,1)
  322. end
  323. if HasItem(player,191144) then
  324. RemoveItem(player,191144,1)
  325. end
  326. if HasItem(player,191145) then
  327. RemoveItem(player,191145,1)
  328. end
  329. if HasItem(player,191146) then
  330. RemoveItem(player,191146,1)
  331. end
  332. if HasItem(player,90320) then
  333. RemoveItem(player,90320,1)
  334. end
  335. if HasItem(player,165457) then
  336. RemoveItem(player,165457,1)
  337. end
  338. if HasItem(player,84367) then
  339. RemoveItem(player,84367,1)
  340. end
  341. if HasItem(player,189973) then
  342. RemoveItem(player,189973,1)
  343. end
  344. if HasItem(player,189974) then
  345. RemoveItem(player,189974,1)
  346. end
  347. if HasItem(player,189975) then
  348. RemoveItem(player,189975,1)
  349. end
  350. if HasItem(player,90096) then
  351. RemoveItem(player,90096,1)
  352. end
  353. if HasItem(player,140141) then
  354. RemoveItem(player,140141,1)
  355. end
  356. if HasItem(player,140142) then
  357. RemoveItem(player,140142,1)
  358. end
  359. if HasItem(player,140143) then
  360. RemoveItem(player,140143,1)
  361. end
  362. if HasItem(player,73663) then
  363. RemoveItem(player,73663,1)
  364. end
  365. if HasItem(player,183463) then
  366. RemoveItem(player,183463,1)
  367. end
  368. if HasItem(player,183464) then
  369. RemoveItem(player,183464,1)
  370. end
  371. if HasItem(player,183465) then
  372. RemoveItem(player,183465,1)
  373. end
  374. if HasItem(player,88681) then
  375. RemoveItem(player,88681,1)
  376. end
  377. if HasItem(player,43534) then
  378. RemoveItem(player,43534,1)
  379. end
  380. if HasItem(player,20535) then
  381. RemoveItem(player,20535,1)
  382. end
  383. if HasItem(player,75509) then
  384. RemoveItem(player,75509,1)
  385. end
  386. if HasItem(player,43528) then
  387. RemoveItem(player,43528,1)
  388. end
  389. if HasItem(player,43528) then
  390. RemoveItem(player,43528,1)
  391. end
  392. if HasItem(player,20527) then
  393. RemoveItem(player,20527,1)
  394. end
  395. if HasItem(player,133757) then
  396. RemoveItem(player,133757,1)
  397. end
  398. if HasItem(player,133760) then
  399. RemoveItem(player,133760,1)
  400. end
  401. if HasItem(player,133761) then
  402. RemoveItem(player,133761,1)
  403. end
  404. if HasItem(player,70875) then
  405. RemoveItem(player,70875,1)
  406. end
  407. if HasItem(player,40189) then
  408. RemoveItem(player,40189,1)
  409. end
  410. if HasItem(player,20527) then
  411. RemoveItem(player,20527,1)
  412. end
  413. if HasItem(player,47635) then
  414. RemoveItem(player,47635,1)
  415. end
  416. if HasItem(player,47836) then
  417. RemoveItem(player,47836,1)
  418. end
  419. if HasItem(player,137128) then
  420. RemoveItem(player,137128,1)
  421. end
  422. if HasItem(player,137129) then
  423. RemoveItem(player,137129,1)
  424. end
  425. if HasItem(player,137130) then
  426. RemoveItem(player,137130,1)
  427. end
  428. if HasItem(player,72648) then
  429. RemoveItem(player,72648,1)
  430. end
  431. if HasItem(player,172484) then
  432. RemoveItem(player,172484,1)
  433. end
  434. if HasItem(player,172486) then
  435. RemoveItem(player,172486,1)
  436. end
  437. if HasItem(player,172487) then
  438. RemoveItem(player,172487,1)
  439. end
  440. if HasItem(player,85697) then
  441. RemoveItem(player,85697,1)
  442. end
  443. if HasItem(player,42288) then
  444. RemoveItem(player,42288,1)
  445. end
  446. end
  447. function SkillSwitch(NPC,player)
  448. if HasSkill(player, 366253016) then --Ministration
  449. RemoveSkill(player, 366253016)
  450. end
  451. if HasSkill(player, 613995491) then -- Disruption
  452. RemoveSkill(player, 613995491)
  453. end
  454. if HasSkill(player, 882983852) then -- Subjigation
  455. RemoveSkill(player, 882983852)
  456. end
  457. if HasSkill(player, 3587918036) then -- Ordination
  458. RemoveSkill(player, 3587918036)
  459. end
  460. if HasSkill(player, 2638198038) then -- Focus
  461. RemoveSkill(player, 2638198038)
  462. end
  463. if HasSkill(player, 723762198) then -- Aggression
  464. RemoveSkill(player, 723762198)
  465. end
  466. if HasSkill(player, 540022425) then -- Parry
  467. RemoveSkill(player, 540022425)
  468. end
  469. if HasSkill(player, 1852383242) then -- Dual Wield
  470. RemoveSkill(player, 1852383242)
  471. end
  472. if HasSkill(player, 3421494576) then -- Crushing
  473. RemoveSkill(player, 3421494576)
  474. end
  475. if HasSkill(player, 1756482397) then -- Ranged
  476. RemoveSkill(player, 1756482397)
  477. end
  478. if HasSkill(player, 3048574950) then -- Piercing
  479. RemoveSkill(player, 3048574950)
  480. end
  481. if HasSkill(player, 418532101) then -- Slashing
  482. RemoveSkill(player, 418532101)
  483. end
  484. if HasSkill(player, 609880714) then -- Defense
  485. RemoveSkill(player, 609880714)
  486. end
  487. if HasSkill(player, 540022425) then -- Parry
  488. RemoveSkill(player, 540022425)
  489. end
  490. if HasSkill(player, 2897193374) then -- Light Armor
  491. RemoveSkill(player, 2897193374)
  492. end
  493. if HasSkill(player, 2246237129) then -- Medium Armor
  494. RemoveSkill(player, 2246237129)
  495. end
  496. if HasSkill(player, 241174330) then -- Heavy Armor
  497. RemoveSkill(player, 241174330)
  498. end
  499. if HasSkill(player, 3659699625) then -- Mining
  500. RemoveSkill(player, 3659699625)
  501. end
  502. if HasSkill(player, 688591146) then -- Foresting
  503. RemoveSkill(player, 688591146)
  504. end
  505. if HasSkill(player, 1048513601) then -- Gathering
  506. RemoveSkill(player, 1048513601)
  507. end
  508. if HasSkill(player, 4158365743) then -- Trapping
  509. RemoveSkill(player, 4158365743)
  510. end
  511. if HasSkill(player, 2319450178) then -- Fishing
  512. RemoveSkill(player, 2319450178)
  513. end
  514. if HasSkill(player, 1970131346) then -- Transmuting
  515. RemoveSkill(player, 1970131346)
  516. end
  517. if HasSkill(player, 3429135390) then -- Mystical Destruction
  518. RemoveSkill(player, 3429135390)
  519. end
  520. --COMMONER GAINED SKILLS
  521. if not HasSkill(player, 2072844078) then -- Magic Affinity
  522. AddSkill(player, 2072844078,1,5)
  523. end
  524. if not HasSkill(player, 3539032716) then -- Very Light Armor
  525. AddSkill(player, 3539032716,1,5)
  526. end
  527. if not HasSkill(player, 2383540775) then -- Spell Avoidance
  528. AddSkill(player, 2383540775,30,30)
  529. end
  530. if not HasSkill(player, 609880714) then -- Defense
  531. AddSkill(player, 609880714,30,30)
  532. end
  533. end