Entity.h 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __EQ2_ENTITY__
  17. #define __EQ2_ENTITY__
  18. #include "Spawn.h"
  19. #include "../common/Mutex.h"
  20. #include "Skills.h"
  21. #include "MutexList.h"
  22. #include "MutexVector.h"
  23. #include <set>
  24. #include <mutex>
  25. #include <vector>
  26. #include <boost/function.hpp>
  27. #include <boost/lambda/bind.hpp>
  28. namespace l = boost::lambda;
  29. class Entity;
  30. class NPC;
  31. class Trade;
  32. struct LuaSpell;
  33. struct GroupMemberInfo;
  34. struct BonusValues{
  35. int32 spell_id;
  36. int8 tier;
  37. int16 type;
  38. sint32 value;
  39. int64 class_req;
  40. vector<int16> race_req;
  41. vector<int16> faction_req;
  42. LuaSpell* luaspell;
  43. };
  44. struct MaintainedEffects{
  45. char name[60]; //name of the spell
  46. int32 target;
  47. int8 target_type;
  48. int32 spell_id;
  49. int32 slot_pos;
  50. int16 icon;
  51. int16 icon_backdrop;
  52. int8 conc_used;
  53. int8 tier;
  54. float total_time;
  55. int32 expire_timestamp;
  56. LuaSpell* spell;
  57. };
  58. struct SpellEffects{
  59. int32 spell_id;
  60. Entity* caster;
  61. float total_time;
  62. int32 expire_timestamp;
  63. int16 icon;
  64. int16 icon_backdrop;
  65. int8 tier;
  66. LuaSpell* spell;
  67. };
  68. struct DetrimentalEffects {
  69. int32 spell_id;
  70. Entity* caster;
  71. int32 expire_timestamp;
  72. int16 icon;
  73. int16 icon_backdrop;
  74. int8 tier;
  75. int8 det_type;
  76. bool incurable;
  77. LuaSpell* spell;
  78. int8 control_effect;
  79. float total_time;
  80. };
  81. enum RACE_ALIGNMENT {
  82. ALIGNMENT_EVIL=0,
  83. ALIGNMENT_GOOD=1
  84. // neutral?
  85. };
  86. struct InfoStruct{
  87. InfoStruct()
  88. {
  89. name_ = std::string("");
  90. class1_ = 0;
  91. class2_ = 0;
  92. class3_ = 0;
  93. race_ = 0;
  94. gender_ = 0;
  95. level_ = 0;
  96. max_level_ = 0;
  97. effective_level_ = 0;
  98. tradeskill_level_ = 0;
  99. tradeskill_max_level_ = 0;
  100. cur_concentration_ = 0;
  101. max_concentration_ = 0;
  102. cur_attack_ = 0;
  103. attack_base_ = 0;
  104. cur_mitigation_ = 0;
  105. max_mitigation_ = 0;
  106. mitigation_base_ = 0;
  107. avoidance_display_ = 0;
  108. cur_avoidance_ = 0.0f;
  109. base_avoidance_pct_ = 0;
  110. avoidance_base_ = 0;
  111. max_avoidance_ = 0;
  112. parry_ = 0.0f;
  113. parry_base_ = 0.0f;
  114. deflection_ = 0;
  115. deflection_base_ = 0;
  116. block_ = 0;
  117. block_base_ = 0;
  118. str_ = 0.0f;
  119. sta_ = 0.0f;
  120. agi_ = 0.0f;
  121. wis_ = 0.0f;
  122. intel_ = 0.0f;
  123. str_base_ = 0.0f;
  124. sta_base_ = 0.0f;
  125. agi_base_ = 0.0f;
  126. wis_base_ = 0.0f;
  127. intel_base_ = 0.0f;
  128. heat_ = 0;
  129. cold_ = 0;
  130. magic_ = 0;
  131. mental_ = 0;
  132. divine_ = 0;
  133. disease_ = 0;
  134. poison_ = 0;
  135. disease_base_ = 0;
  136. cold_base_ = 0;
  137. divine_base_ = 0;
  138. magic_base_ = 0;
  139. mental_base_ = 0;
  140. heat_base_ = 0;
  141. poison_base_ = 0;
  142. elemental_base_ = 0;
  143. noxious_base_ = 0;
  144. arcane_base_ = 0;
  145. coin_copper_ = 0;
  146. coin_silver_ = 0;
  147. coin_gold_ = 0;
  148. coin_plat_ = 0;
  149. bank_coin_copper_ = 0;
  150. bank_coin_silver_ = 0;
  151. bank_coin_gold_ = 0;
  152. bank_coin_plat_ = 0;
  153. status_points_ = 0;
  154. deity_ = std::string("");
  155. weight_ = 0;
  156. max_weight_ = 0;
  157. tradeskill_class1_ = 0;
  158. tradeskill_class2_ = 0;
  159. tradeskill_class3_ = 0;
  160. account_age_base_ = 0;
  161. memset(account_age_bonus_,0,19);
  162. absorb_ = 0;
  163. xp_ = 0;
  164. xp_needed_ = 0;
  165. xp_debt_ = 0.0f;
  166. xp_yellow_ = 0;
  167. xp_yellow_vitality_bar_ = 0;
  168. xp_blue_vitality_bar_ = 0;
  169. xp_blue_ = 0;
  170. ts_xp_ = 0;
  171. ts_xp_needed_ = 0;
  172. tradeskill_exp_yellow_ = 0;
  173. tradeskill_exp_blue_ = 0;
  174. flags_ = 0;
  175. flags2_ = 0;
  176. xp_vitality_ = 0;
  177. tradeskill_xp_vitality_ = 0;
  178. mitigation_skill1_ = 0;
  179. mitigation_skill2_ = 0;
  180. mitigation_skill3_ = 0;
  181. mitigation_pve_ = 0;
  182. mitigation_pvp_ = 0;
  183. ability_modifier_ = 0;
  184. critical_mitigation_ = 0;
  185. block_chance_ = 0;
  186. uncontested_parry_ = 0;
  187. uncontested_block_ = 0;
  188. uncontested_dodge_ = 0;
  189. uncontested_riposte_ = 0;
  190. crit_chance_ = 0;
  191. crit_bonus_ = 0;
  192. potency_ = 0;
  193. hate_mod_ = 0;
  194. reuse_speed_ = 0;
  195. casting_speed_ = 0;
  196. recovery_speed_ = 0;
  197. spell_reuse_speed_ = 0;
  198. spell_multi_attack_ = 0;
  199. dps_ = 0;
  200. dps_multiplier_ = 0;
  201. attackspeed_ = 0;
  202. haste_ = 0;
  203. multi_attack_ = 0;
  204. flurry_ = 0;
  205. melee_ae_ = 0;
  206. strikethrough_ = 0;
  207. accuracy_ = 0;
  208. offensivespeed_ = 0;
  209. rain_ = 0;
  210. wind_ = 0;
  211. alignment_ = 0;
  212. pet_id_ = 0;
  213. pet_name_ = std::string("");
  214. pet_health_pct_ = 0.0f;
  215. pet_power_pct_ = 0.0f;
  216. pet_movement_ = 0;
  217. pet_behavior_ = 0;
  218. vision_ = 0;
  219. breathe_underwater_ = 0;
  220. biography_ = std::string("");
  221. drunk_ = 0;
  222. power_regen_ = 0;
  223. hp_regen_ = 0;
  224. power_regen_override_ = 0;
  225. hp_regen_override_ = 0;
  226. water_type_ = 0;
  227. flying_type_ = 0;
  228. no_interrupt_ = 0;
  229. interaction_flag_ = 0;
  230. tag1_ = 0;
  231. mood_ = 0;
  232. range_last_attack_time_ = 0;
  233. primary_last_attack_time_ = 0;
  234. secondary_last_attack_time_ = 0;
  235. primary_attack_delay_ = 0;
  236. secondary_attack_delay_ = 0;
  237. ranged_attack_delay_ = 0;
  238. primary_weapon_type_ = 0;
  239. secondary_weapon_type_ = 0;
  240. ranged_weapon_type_ = 0;
  241. primary_weapon_damage_low_ = 0;
  242. primary_weapon_damage_high_ = 0;
  243. secondary_weapon_damage_low_ = 0;
  244. secondary_weapon_damage_high_ = 0;
  245. ranged_weapon_damage_low_ = 0;
  246. ranged_weapon_damage_high_ = 0;
  247. wield_type_ = 0;
  248. attack_type_ = 0;
  249. primary_weapon_delay_ = 0;
  250. secondary_weapon_delay_ = 0;
  251. ranged_weapon_delay_ = 0;
  252. override_primary_weapon_ = 0;
  253. override_secondary_weapon_ = 0;
  254. override_ranged_weapon_ = 0;
  255. friendly_target_npc_ = 0;
  256. last_claim_time_ = 0;
  257. engaged_encounter_ = 0;
  258. first_world_login_ = 0;
  259. reload_player_spells_ = 0;
  260. action_state_ = std::string("");
  261. }
  262. void SetInfoStruct(InfoStruct* oldStruct)
  263. {
  264. if(!oldStruct)
  265. return;
  266. std::lock_guard<std::mutex> lk(classMutex);
  267. name_ = std::string(oldStruct->get_name());
  268. class1_ = oldStruct->get_class1();
  269. class2_ = oldStruct->get_class2();
  270. class3_ = oldStruct->get_class3();
  271. race_ = oldStruct->get_race();
  272. gender_ = oldStruct->get_gender();
  273. level_ = oldStruct->get_level();
  274. max_level_ = oldStruct->get_max_level();
  275. effective_level_ = oldStruct->get_effective_level();
  276. tradeskill_level_ = oldStruct->get_tradeskill_level();
  277. tradeskill_max_level_ = oldStruct->get_tradeskill_max_level();
  278. cur_concentration_ = oldStruct->get_cur_concentration();
  279. max_concentration_ = oldStruct->get_max_concentration();
  280. cur_attack_ = oldStruct->get_cur_attack();
  281. attack_base_ = oldStruct->get_attack_base();
  282. cur_mitigation_ = oldStruct->get_cur_mitigation();
  283. max_mitigation_ = oldStruct->get_max_mitigation();
  284. mitigation_base_ = oldStruct->get_mitigation_base();
  285. avoidance_display_ = oldStruct->get_avoidance_display();
  286. cur_avoidance_ = oldStruct->get_cur_avoidance();
  287. base_avoidance_pct_ = oldStruct->get_base_avoidance_pct();
  288. avoidance_base_ = oldStruct->get_avoidance_base();
  289. max_avoidance_ = oldStruct->get_max_avoidance();
  290. parry_ = oldStruct->get_parry();
  291. parry_base_ = oldStruct->get_parry_base();
  292. deflection_ = oldStruct->get_deflection();
  293. deflection_base_ = oldStruct->get_deflection_base();
  294. block_ = oldStruct->get_block();
  295. block_base_ = oldStruct->get_block_base();
  296. str_ = oldStruct->get_str();
  297. sta_ = oldStruct->get_sta();
  298. agi_ = oldStruct->get_agi();
  299. wis_ = oldStruct->get_wis();
  300. intel_ = oldStruct->get_intel();
  301. str_base_ = oldStruct->get_str_base();
  302. sta_base_ = oldStruct->get_sta_base();
  303. agi_base_ = oldStruct->get_agi_base();
  304. wis_base_ = oldStruct->get_wis_base();
  305. intel_base_ = oldStruct->get_intel_base();
  306. heat_ = oldStruct->get_heat();
  307. cold_ = oldStruct->get_cold();
  308. magic_ = oldStruct->get_magic();
  309. mental_ = oldStruct->get_mental();
  310. divine_ = oldStruct->get_divine();
  311. disease_ = oldStruct->get_disease();
  312. poison_ = oldStruct->get_poison();
  313. disease_base_ = oldStruct->get_disease_base();
  314. cold_base_ = oldStruct->get_cold_base();
  315. divine_base_ = oldStruct->get_divine_base();
  316. magic_base_ = oldStruct->get_magic_base();
  317. mental_base_ = oldStruct->get_mental_base();
  318. heat_base_ = oldStruct->get_heat_base();
  319. poison_base_ = oldStruct->get_poison_base();
  320. elemental_base_ = oldStruct->get_elemental_base();
  321. noxious_base_ = oldStruct->get_noxious_base();
  322. arcane_base_ = oldStruct->get_arcane_base();
  323. coin_copper_ = oldStruct->get_coin_copper();
  324. coin_silver_ = oldStruct->get_coin_silver();
  325. coin_gold_ = oldStruct->get_coin_gold();
  326. coin_plat_ = oldStruct->get_coin_plat();
  327. bank_coin_copper_ = oldStruct->get_bank_coin_copper();
  328. bank_coin_silver_ = oldStruct->get_bank_coin_silver();
  329. bank_coin_gold_ = oldStruct->get_bank_coin_gold();
  330. bank_coin_plat_ = oldStruct->get_bank_coin_plat();
  331. status_points_ = oldStruct->get_status_points();
  332. deity_ = std::string("");
  333. weight_ = oldStruct->get_weight();
  334. max_weight_ = oldStruct->get_max_weight();
  335. tradeskill_class1_ = oldStruct->get_tradeskill_class1();
  336. tradeskill_class2_ = oldStruct->get_tradeskill_class2();
  337. tradeskill_class3_ = oldStruct->get_tradeskill_class3();
  338. account_age_base_ = oldStruct->get_account_age_base();
  339. memset(account_age_bonus_,0,19);
  340. absorb_ = oldStruct->get_absorb();
  341. xp_ = oldStruct->get_xp();
  342. xp_needed_ = oldStruct->get_xp_needed();
  343. xp_debt_ = oldStruct->get_xp_debt();
  344. xp_yellow_ = oldStruct->get_xp_yellow();
  345. xp_yellow_vitality_bar_ = oldStruct->get_xp_yellow_vitality_bar();
  346. xp_blue_vitality_bar_ = oldStruct->get_xp_blue_vitality_bar();
  347. xp_blue_ = oldStruct->get_xp_blue();
  348. ts_xp_ = oldStruct->get_ts_xp();
  349. ts_xp_needed_ = oldStruct->get_ts_xp_needed();
  350. tradeskill_exp_yellow_ = oldStruct->get_tradeskill_exp_yellow();
  351. tradeskill_exp_blue_ = oldStruct->get_tradeskill_exp_blue();
  352. flags_ = oldStruct->get_flags();
  353. flags2_ = oldStruct->get_flags2();
  354. xp_vitality_ = oldStruct->get_xp_vitality();
  355. tradeskill_xp_vitality_ = oldStruct->get_tradeskill_xp_vitality();
  356. mitigation_skill1_ = oldStruct->get_mitigation_skill1();
  357. mitigation_skill2_ = oldStruct->get_mitigation_skill2();
  358. mitigation_skill3_ = oldStruct->get_mitigation_skill3();
  359. mitigation_pve_ = oldStruct->get_mitigation_pve();
  360. mitigation_pvp_ = oldStruct->get_mitigation_pvp();
  361. ability_modifier_ = oldStruct->get_ability_modifier();
  362. critical_mitigation_ = oldStruct->get_critical_mitigation();
  363. block_chance_ = oldStruct->get_block_chance();
  364. uncontested_parry_ = oldStruct->get_uncontested_parry();
  365. uncontested_block_ = oldStruct->get_uncontested_block();
  366. uncontested_dodge_ = oldStruct->get_uncontested_dodge();
  367. uncontested_riposte_ = oldStruct->get_uncontested_riposte();
  368. crit_chance_ = oldStruct->get_crit_chance();
  369. crit_bonus_ = oldStruct->get_crit_bonus();
  370. potency_ = oldStruct->get_potency();
  371. hate_mod_ = oldStruct->get_hate_mod();
  372. reuse_speed_ = oldStruct->get_reuse_speed();
  373. casting_speed_ = oldStruct->get_casting_speed();
  374. recovery_speed_ = oldStruct->get_recovery_speed();
  375. spell_reuse_speed_ = oldStruct->get_spell_reuse_speed();
  376. spell_multi_attack_ = oldStruct->get_spell_multi_attack();
  377. dps_ = oldStruct->get_dps();
  378. dps_multiplier_ = oldStruct->get_dps_multiplier();
  379. attackspeed_ = oldStruct->get_attackspeed();
  380. haste_ = oldStruct->get_haste();
  381. multi_attack_ = oldStruct->get_multi_attack();
  382. flurry_ = oldStruct->get_flurry();
  383. melee_ae_ = oldStruct->get_melee_ae();
  384. strikethrough_ = oldStruct->get_strikethrough();
  385. accuracy_ = oldStruct->get_accuracy();
  386. offensivespeed_ = oldStruct->get_offensivespeed();
  387. rain_ = oldStruct->get_rain();
  388. wind_ = oldStruct->get_wind();
  389. alignment_ = oldStruct->get_alignment();
  390. pet_id_ = oldStruct->get_pet_id();
  391. pet_name_ = std::string(oldStruct->get_pet_name());
  392. pet_health_pct_ = oldStruct->get_pet_health_pct();
  393. pet_power_pct_ = oldStruct->get_pet_power_pct();
  394. pet_movement_ = oldStruct->get_pet_movement();
  395. pet_behavior_ = oldStruct->get_pet_behavior();
  396. vision_ = oldStruct->get_vision();
  397. breathe_underwater_ = oldStruct->get_breathe_underwater();
  398. biography_ = std::string(oldStruct->get_biography());
  399. drunk_ = oldStruct->get_drunk();
  400. power_regen_ = oldStruct->get_power_regen();
  401. hp_regen_ = oldStruct->get_hp_regen();
  402. power_regen_override_ = oldStruct->get_power_regen_override();
  403. hp_regen_override_ = oldStruct->get_hp_regen_override();
  404. water_type_ = oldStruct->get_water_type();
  405. flying_type_ = oldStruct->get_flying_type();
  406. no_interrupt_ = oldStruct->get_no_interrupt();
  407. interaction_flag_ = oldStruct->get_interaction_flag();
  408. tag1_ = oldStruct->get_tag1();
  409. mood_ = oldStruct->get_mood();
  410. range_last_attack_time_ = oldStruct->get_range_last_attack_time();
  411. primary_last_attack_time_ = oldStruct->get_primary_last_attack_time();;
  412. secondary_last_attack_time_ = oldStruct->get_secondary_last_attack_time();;
  413. primary_attack_delay_ = oldStruct->get_primary_attack_delay();
  414. secondary_attack_delay_ = oldStruct->get_secondary_attack_delay();
  415. ranged_attack_delay_ = oldStruct->get_ranged_attack_delay();
  416. primary_weapon_type_ = oldStruct->get_primary_weapon_type();
  417. secondary_weapon_type_ = oldStruct->get_secondary_weapon_type();
  418. ranged_weapon_type_ = oldStruct->get_ranged_weapon_type();
  419. primary_weapon_damage_low_ = oldStruct->get_primary_weapon_damage_low();
  420. primary_weapon_damage_high_ = oldStruct->get_primary_weapon_damage_high();
  421. secondary_weapon_damage_low_ = oldStruct->get_secondary_weapon_damage_low();
  422. secondary_weapon_damage_high_ = oldStruct->get_secondary_weapon_damage_high();
  423. ranged_weapon_damage_low_ = oldStruct->get_ranged_weapon_damage_low();
  424. ranged_weapon_damage_high_ = oldStruct->get_ranged_weapon_damage_high();
  425. wield_type_ = oldStruct->get_wield_type();
  426. attack_type_ = oldStruct->get_attack_type();
  427. primary_weapon_delay_ = oldStruct->get_primary_weapon_delay();
  428. secondary_weapon_delay_ = oldStruct->get_secondary_weapon_delay();
  429. ranged_weapon_delay_ = oldStruct->get_ranged_weapon_delay();
  430. override_primary_weapon_ = oldStruct->get_override_primary_weapon();
  431. override_secondary_weapon_ = oldStruct->get_override_secondary_weapon();
  432. override_ranged_weapon_ = oldStruct->get_override_ranged_weapon();
  433. friendly_target_npc_ = oldStruct->get_friendly_target_npc();
  434. last_claim_time_ = oldStruct->get_last_claim_time();
  435. engaged_encounter_ = oldStruct->get_engaged_encounter();
  436. first_world_login_ = oldStruct->get_first_world_login();
  437. reload_player_spells_ = oldStruct->get_reload_player_spells();
  438. action_state_ = oldStruct->get_action_state();
  439. }
  440. //mutable std::shared_mutex mutex_;
  441. std::string get_name() { std::lock_guard<std::mutex> lk(classMutex); return name_; }
  442. int8 get_class1() { std::lock_guard<std::mutex> lk(classMutex); return class1_; }
  443. int8 get_class2() { std::lock_guard<std::mutex> lk(classMutex); return class2_; }
  444. int8 get_class3() { std::lock_guard<std::mutex> lk(classMutex); return class3_; }
  445. int8 get_race() { std::lock_guard<std::mutex> lk(classMutex); return race_; }
  446. int8 get_gender() { std::lock_guard<std::mutex> lk(classMutex); return gender_; }
  447. int16 get_level() { std::lock_guard<std::mutex> lk(classMutex); return level_; }
  448. int16 get_max_level() { std::lock_guard<std::mutex> lk(classMutex); return max_level_; }
  449. int16 get_effective_level() { std::lock_guard<std::mutex> lk(classMutex); return effective_level_; }
  450. int16 get_tradeskill_level() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_level_; }
  451. int16 get_tradeskill_max_level() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_max_level_; }
  452. int8 get_cur_concentration() { std::lock_guard<std::mutex> lk(classMutex); return cur_concentration_; }
  453. int8 get_max_concentration() { std::lock_guard<std::mutex> lk(classMutex); return max_concentration_; }
  454. int16 get_cur_attack() { std::lock_guard<std::mutex> lk(classMutex); return cur_attack_; }
  455. int16 get_attack_base() { std::lock_guard<std::mutex> lk(classMutex); return attack_base_; }
  456. int16 get_cur_mitigation() { std::lock_guard<std::mutex> lk(classMutex); return cur_mitigation_; }
  457. int16 get_max_mitigation() { std::lock_guard<std::mutex> lk(classMutex); return max_mitigation_; }
  458. int16 get_mitigation_base() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_base_; }
  459. int16 get_avoidance_display() { std::lock_guard<std::mutex> lk(classMutex); return avoidance_display_; }
  460. float get_cur_avoidance() { std::lock_guard<std::mutex> lk(classMutex); return cur_avoidance_; }
  461. int16 get_base_avoidance_pct() { std::lock_guard<std::mutex> lk(classMutex); return base_avoidance_pct_; }
  462. int16 get_avoidance_base() { std::lock_guard<std::mutex> lk(classMutex); return avoidance_base_; }
  463. float get_parry() { std::lock_guard<std::mutex> lk(classMutex); return parry_; }
  464. float get_parry_base() { std::lock_guard<std::mutex> lk(classMutex); return parry_base_; }
  465. int16 get_max_avoidance() { std::lock_guard<std::mutex> lk(classMutex); return max_avoidance_; }
  466. float get_deflection() { std::lock_guard<std::mutex> lk(classMutex); return deflection_; }
  467. int16 get_deflection_base() { std::lock_guard<std::mutex> lk(classMutex); return deflection_base_; }
  468. float get_block() { std::lock_guard<std::mutex> lk(classMutex); return block_; }
  469. int16 get_block_base() { std::lock_guard<std::mutex> lk(classMutex); return block_base_; }
  470. float get_str() { std::lock_guard<std::mutex> lk(classMutex); return str_; }
  471. float get_sta() { std::lock_guard<std::mutex> lk(classMutex); return sta_; }
  472. float get_agi() { std::lock_guard<std::mutex> lk(classMutex); return agi_; }
  473. float get_wis() { std::lock_guard<std::mutex> lk(classMutex); return wis_; }
  474. float get_intel() { std::lock_guard<std::mutex> lk(classMutex); return intel_; }
  475. float get_str_base() { std::lock_guard<std::mutex> lk(classMutex); return str_base_; }
  476. float get_sta_base() { std::lock_guard<std::mutex> lk(classMutex); return sta_base_; }
  477. float get_agi_base() { std::lock_guard<std::mutex> lk(classMutex); return agi_base_; }
  478. float get_wis_base() { std::lock_guard<std::mutex> lk(classMutex); return wis_base_; }
  479. float get_intel_base() { std::lock_guard<std::mutex> lk(classMutex); return intel_base_; }
  480. int16 get_heat() { std::lock_guard<std::mutex> lk(classMutex); return heat_; }
  481. int16 get_cold() { std::lock_guard<std::mutex> lk(classMutex); return cold_; }
  482. int16 get_magic() { std::lock_guard<std::mutex> lk(classMutex); return magic_; }
  483. int16 get_mental() { std::lock_guard<std::mutex> lk(classMutex); return mental_; }
  484. int16 get_divine() { std::lock_guard<std::mutex> lk(classMutex); return divine_; }
  485. int16 get_disease() { std::lock_guard<std::mutex> lk(classMutex); return disease_; }
  486. int16 get_poison() { std::lock_guard<std::mutex> lk(classMutex); return poison_; }
  487. int16 get_disease_base() { std::lock_guard<std::mutex> lk(classMutex); return disease_base_; }
  488. int16 get_cold_base() { std::lock_guard<std::mutex> lk(classMutex); return cold_base_; }
  489. int16 get_divine_base() { std::lock_guard<std::mutex> lk(classMutex); return divine_base_; }
  490. int16 get_magic_base() { std::lock_guard<std::mutex> lk(classMutex); return magic_base_; }
  491. int16 get_mental_base() { std::lock_guard<std::mutex> lk(classMutex); return mental_base_; }
  492. int16 get_heat_base() { std::lock_guard<std::mutex> lk(classMutex); return heat_base_; }
  493. int16 get_poison_base() { std::lock_guard<std::mutex> lk(classMutex); return poison_base_; }
  494. int16 get_elemental_base() { std::lock_guard<std::mutex> lk(classMutex); return elemental_base_; }
  495. int16 get_noxious_base() { std::lock_guard<std::mutex> lk(classMutex); return noxious_base_; }
  496. int16 get_arcane_base() { std::lock_guard<std::mutex> lk(classMutex); return arcane_base_; }
  497. int32 get_coin_copper() { std::lock_guard<std::mutex> lk(classMutex); return coin_copper_; }
  498. int32 get_coin_silver() { std::lock_guard<std::mutex> lk(classMutex); return coin_silver_; }
  499. int32 get_coin_gold() { std::lock_guard<std::mutex> lk(classMutex); return coin_gold_; }
  500. int32 get_coin_plat() { std::lock_guard<std::mutex> lk(classMutex); return coin_plat_; }
  501. int32 get_bank_coin_copper() { std::lock_guard<std::mutex> lk(classMutex); return bank_coin_copper_; }
  502. int32 get_bank_coin_silver() { std::lock_guard<std::mutex> lk(classMutex); return bank_coin_silver_; }
  503. int32 get_bank_coin_gold() { std::lock_guard<std::mutex> lk(classMutex); return bank_coin_gold_; }
  504. int32 get_bank_coin_plat() { std::lock_guard<std::mutex> lk(classMutex); return bank_coin_plat_; }
  505. int32 get_status_points() { std::lock_guard<std::mutex> lk(classMutex); return status_points_; }
  506. std::string get_deity() { std::lock_guard<std::mutex> lk(classMutex); return deity_; }
  507. int32 get_weight() { std::lock_guard<std::mutex> lk(classMutex); return weight_; }
  508. int32 get_max_weight() { std::lock_guard<std::mutex> lk(classMutex); return max_weight_; }
  509. //SpellEffects* & get_spell_effects() { std::lock_guard<std::mutex> lk(classMutex); return spell_effects_; }
  510. //MaintainedEffects* & get_maintained_effects() { std::lock_guard<std::mutex> lk(classMutex); return maintained_effects_; }
  511. int8 get_tradeskill_class1() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_class1_; }
  512. int8 get_tradeskill_class2() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_class2_; }
  513. int8 get_tradeskill_class3() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_class3_; }
  514. int32 get_account_age_base() { std::lock_guard<std::mutex> lk(classMutex); return account_age_base_; }
  515. int8 get_account_age_bonus(int8 field) { std::lock_guard<std::mutex> lk(classMutex); return account_age_bonus_[field]; }
  516. int16 get_absorb() { std::lock_guard<std::mutex> lk(classMutex); return absorb_; }
  517. int32 get_xp() { std::lock_guard<std::mutex> lk(classMutex); return xp_; }
  518. int32 get_xp_needed() { std::lock_guard<std::mutex> lk(classMutex); return xp_needed_; }
  519. float get_xp_debt() { std::lock_guard<std::mutex> lk(classMutex); return xp_debt_; }
  520. int16 get_xp_yellow() { std::lock_guard<std::mutex> lk(classMutex); return xp_yellow_; }
  521. int16 get_xp_yellow_vitality_bar() { std::lock_guard<std::mutex> lk(classMutex); return xp_yellow_vitality_bar_; }
  522. int16 get_xp_blue_vitality_bar() { std::lock_guard<std::mutex> lk(classMutex); return xp_blue_vitality_bar_; }
  523. int16 get_xp_blue() { std::lock_guard<std::mutex> lk(classMutex); return xp_blue_; }
  524. int32 get_ts_xp() { std::lock_guard<std::mutex> lk(classMutex); return ts_xp_; }
  525. int32 get_ts_xp_needed() { std::lock_guard<std::mutex> lk(classMutex); return ts_xp_needed_; }
  526. int16 get_tradeskill_exp_yellow() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_exp_yellow_; }
  527. int16 get_tradeskill_exp_blue() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_exp_blue_; }
  528. int32 get_flags() { std::lock_guard<std::mutex> lk(classMutex); return flags_; }
  529. int32 get_flags2() { std::lock_guard<std::mutex> lk(classMutex); return flags2_; }
  530. float get_xp_vitality() { std::lock_guard<std::mutex> lk(classMutex); return xp_vitality_; }
  531. float get_tradeskill_xp_vitality() { std::lock_guard<std::mutex> lk(classMutex); return tradeskill_xp_vitality_; }
  532. int16 get_mitigation_skill1() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_skill1_; }
  533. int16 get_mitigation_skill2() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_skill2_; }
  534. int16 get_mitigation_skill3() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_skill3_; }
  535. int16 get_mitigation_pve() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_pve_; }
  536. int16 get_mitigation_pvp() { std::lock_guard<std::mutex> lk(classMutex); return mitigation_pvp_; }
  537. float get_ability_modifier() { std::lock_guard<std::mutex> lk(classMutex); return ability_modifier_; }
  538. float get_critical_mitigation() { std::lock_guard<std::mutex> lk(classMutex); return critical_mitigation_; }
  539. float get_block_chance() { std::lock_guard<std::mutex> lk(classMutex); return block_chance_; }
  540. float get_uncontested_parry() { std::lock_guard<std::mutex> lk(classMutex); return uncontested_parry_; }
  541. float get_uncontested_block() { std::lock_guard<std::mutex> lk(classMutex); return uncontested_block_; }
  542. float get_uncontested_dodge() { std::lock_guard<std::mutex> lk(classMutex); return uncontested_dodge_; }
  543. float get_uncontested_riposte() { std::lock_guard<std::mutex> lk(classMutex); return uncontested_riposte_; }
  544. float get_crit_chance() { std::lock_guard<std::mutex> lk(classMutex); return crit_chance_; }
  545. float get_crit_bonus() { std::lock_guard<std::mutex> lk(classMutex); return crit_bonus_; }
  546. float get_potency() { std::lock_guard<std::mutex> lk(classMutex); return potency_; }
  547. float get_hate_mod() { std::lock_guard<std::mutex> lk(classMutex); return hate_mod_; }
  548. float get_reuse_speed() { std::lock_guard<std::mutex> lk(classMutex); return reuse_speed_; }
  549. float get_casting_speed() { std::lock_guard<std::mutex> lk(classMutex); return casting_speed_; }
  550. float get_recovery_speed() { std::lock_guard<std::mutex> lk(classMutex); return recovery_speed_; }
  551. float get_spell_reuse_speed() { std::lock_guard<std::mutex> lk(classMutex); return spell_reuse_speed_; }
  552. float get_spell_multi_attack() { std::lock_guard<std::mutex> lk(classMutex); return spell_multi_attack_; }
  553. float get_dps() { std::lock_guard<std::mutex> lk(classMutex); return dps_; }
  554. float get_dps_multiplier() { std::lock_guard<std::mutex> lk(classMutex); return dps_multiplier_; }
  555. float get_attackspeed() { std::lock_guard<std::mutex> lk(classMutex); return attackspeed_; }
  556. float get_haste() { std::lock_guard<std::mutex> lk(classMutex); return haste_; }
  557. float get_multi_attack() { std::lock_guard<std::mutex> lk(classMutex); return multi_attack_; }
  558. float get_flurry() { std::lock_guard<std::mutex> lk(classMutex); return flurry_; }
  559. float get_melee_ae() { std::lock_guard<std::mutex> lk(classMutex); return melee_ae_; }
  560. float get_strikethrough() { std::lock_guard<std::mutex> lk(classMutex); return strikethrough_; }
  561. float get_accuracy() { std::lock_guard<std::mutex> lk(classMutex); return accuracy_; }
  562. float get_offensivespeed() { std::lock_guard<std::mutex> lk(classMutex); return offensivespeed_; }
  563. float get_rain() { std::lock_guard<std::mutex> lk(classMutex); return rain_; }
  564. float get_wind() { std::lock_guard<std::mutex> lk(classMutex); return wind_; }
  565. sint8 get_alignment() { std::lock_guard<std::mutex> lk(classMutex); return alignment_; }
  566. int32 get_pet_id() { std::lock_guard<std::mutex> lk(classMutex); return pet_id_; }
  567. std::string get_pet_name() { std::lock_guard<std::mutex> lk(classMutex); return pet_name_; }
  568. float get_pet_health_pct() { std::lock_guard<std::mutex> lk(classMutex); return pet_health_pct_; }
  569. float get_pet_power_pct() { std::lock_guard<std::mutex> lk(classMutex); return pet_power_pct_; }
  570. int8 get_pet_movement() { std::lock_guard<std::mutex> lk(classMutex); return pet_movement_; }
  571. int8 get_pet_behavior() { std::lock_guard<std::mutex> lk(classMutex); return pet_behavior_; }
  572. int32 get_vision() { std::lock_guard<std::mutex> lk(classMutex); return vision_; }
  573. int8 get_breathe_underwater() { std::lock_guard<std::mutex> lk(classMutex); return breathe_underwater_; }
  574. std::string get_biography() { std::lock_guard<std::mutex> lk(classMutex); return biography_; }
  575. float get_drunk() { std::lock_guard<std::mutex> lk(classMutex); return drunk_; }
  576. sint16 get_power_regen() { std::lock_guard<std::mutex> lk(classMutex); return power_regen_; }
  577. sint16 get_hp_regen() { std::lock_guard<std::mutex> lk(classMutex); return hp_regen_; }
  578. int8 get_power_regen_override() { std::lock_guard<std::mutex> lk(classMutex); return power_regen_override_; }
  579. int8 get_hp_regen_override() { std::lock_guard<std::mutex> lk(classMutex); return hp_regen_override_; }
  580. int8 get_water_type() { std::lock_guard<std::mutex> lk(classMutex); return water_type_; }
  581. int8 get_flying_type() { std::lock_guard<std::mutex> lk(classMutex); return flying_type_; }
  582. int8 get_no_interrupt() { std::lock_guard<std::mutex> lk(classMutex); return no_interrupt_; }
  583. int8 get_interaction_flag() { std::lock_guard<std::mutex> lk(classMutex); return interaction_flag_; }
  584. int8 get_tag1() { std::lock_guard<std::mutex> lk(classMutex); return tag1_; }
  585. int16 get_mood() { std::lock_guard<std::mutex> lk(classMutex); return mood_; }
  586. int32 get_range_last_attack_time() { std::lock_guard<std::mutex> lk(classMutex); return range_last_attack_time_; }
  587. int32 get_primary_last_attack_time() { std::lock_guard<std::mutex> lk(classMutex); return primary_last_attack_time_; }
  588. int32 get_secondary_last_attack_time() { std::lock_guard<std::mutex> lk(classMutex); return secondary_last_attack_time_; }
  589. int16 get_primary_attack_delay() { std::lock_guard<std::mutex> lk(classMutex); return primary_attack_delay_; }
  590. int16 get_secondary_attack_delay() { std::lock_guard<std::mutex> lk(classMutex); return secondary_attack_delay_; }
  591. int16 get_ranged_attack_delay() { std::lock_guard<std::mutex> lk(classMutex); return ranged_attack_delay_; }
  592. int8 get_primary_weapon_type() { std::lock_guard<std::mutex> lk(classMutex); return primary_weapon_type_; }
  593. int8 get_secondary_weapon_type() { std::lock_guard<std::mutex> lk(classMutex); return secondary_weapon_type_; }
  594. int8 get_ranged_weapon_type() { std::lock_guard<std::mutex> lk(classMutex); return ranged_weapon_type_; }
  595. int32 get_primary_weapon_damage_low() { std::lock_guard<std::mutex> lk(classMutex); return primary_weapon_damage_low_; }
  596. int32 get_primary_weapon_damage_high() { std::lock_guard<std::mutex> lk(classMutex); return primary_weapon_damage_high_; }
  597. int32 get_secondary_weapon_damage_low() { std::lock_guard<std::mutex> lk(classMutex); return secondary_weapon_damage_low_; }
  598. int32 get_secondary_weapon_damage_high() { std::lock_guard<std::mutex> lk(classMutex); return secondary_weapon_damage_high_; }
  599. int32 get_ranged_weapon_damage_low() { std::lock_guard<std::mutex> lk(classMutex); return ranged_weapon_damage_low_; }
  600. int32 get_ranged_weapon_damage_high() { std::lock_guard<std::mutex> lk(classMutex); return ranged_weapon_damage_high_; }
  601. int8 get_wield_type() { std::lock_guard<std::mutex> lk(classMutex); return wield_type_; }
  602. int8 get_attack_type() { std::lock_guard<std::mutex> lk(classMutex); return attack_type_; }
  603. int16 get_primary_weapon_delay() { std::lock_guard<std::mutex> lk(classMutex); return primary_weapon_delay_; }
  604. int16 get_secondary_weapon_delay() { std::lock_guard<std::mutex> lk(classMutex); return secondary_weapon_delay_; }
  605. int16 get_ranged_weapon_delay() { std::lock_guard<std::mutex> lk(classMutex); return ranged_weapon_delay_; }
  606. int8 get_override_primary_weapon() { std::lock_guard<std::mutex> lk(classMutex); return override_primary_weapon_; }
  607. int8 get_override_secondary_weapon() { std::lock_guard<std::mutex> lk(classMutex); return override_secondary_weapon_; }
  608. int8 get_override_ranged_weapon() { std::lock_guard<std::mutex> lk(classMutex); return override_ranged_weapon_; }
  609. int8 get_friendly_target_npc() { std::lock_guard<std::mutex> lk(classMutex); return friendly_target_npc_; }
  610. int32 get_last_claim_time() { std::lock_guard<std::mutex> lk(classMutex); return last_claim_time_; }
  611. int8 get_engaged_encounter() { std::lock_guard<std::mutex> lk(classMutex); return engaged_encounter_; }
  612. int8 get_first_world_login() { std::lock_guard<std::mutex> lk(classMutex); return first_world_login_; }
  613. int8 get_reload_player_spells() { std::lock_guard<std::mutex> lk(classMutex); return reload_player_spells_; }
  614. std::string get_action_state() { std::lock_guard<std::mutex> lk(classMutex); return action_state_; }
  615. void set_name(std::string value) { std::lock_guard<std::mutex> lk(classMutex); name_ = value; }
  616. void set_deity(std::string value) { std::lock_guard<std::mutex> lk(classMutex); deity_ = value; }
  617. void set_class1(int8 value) { std::lock_guard<std::mutex> lk(classMutex); class1_ = value; }
  618. void set_class2(int8 value) { std::lock_guard<std::mutex> lk(classMutex); class2_ = value; }
  619. void set_class3(int8 value) { std::lock_guard<std::mutex> lk(classMutex); class3_ = value; }
  620. void set_race(int8 value) { std::lock_guard<std::mutex> lk(classMutex); race_ = value; }
  621. void set_gender(int8 value) { std::lock_guard<std::mutex> lk(classMutex); gender_ = value; }
  622. void set_level(int16 value) { std::lock_guard<std::mutex> lk(classMutex); level_ = value; }
  623. void set_max_level(int16 value) { std::lock_guard<std::mutex> lk(classMutex); max_level_ = value; }
  624. void set_effective_level(int16 value) { std::lock_guard<std::mutex> lk(classMutex); effective_level_ = value; }
  625. void set_cur_concentration(int8 value) { std::lock_guard<std::mutex> lk(classMutex); cur_concentration_ = value; }
  626. void set_max_concentration(int8 value) { std::lock_guard<std::mutex> lk(classMutex); max_concentration_ = value; }
  627. void add_cur_concentration(int8 value) { std::lock_guard<std::mutex> lk(classMutex); cur_concentration_ += value; }
  628. void add_max_concentration(int8 value) { std::lock_guard<std::mutex> lk(classMutex); max_concentration_ += value; }
  629. void set_cur_attack(int16 value) { std::lock_guard<std::mutex> lk(classMutex); cur_attack_ = value; }
  630. void set_attack_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); attack_base_ = value; }
  631. void set_cur_mitigation(int16 value) { std::lock_guard<std::mutex> lk(classMutex); cur_mitigation_ = value; }
  632. void set_max_mitigation(int16 value) { std::lock_guard<std::mutex> lk(classMutex); max_mitigation_ = value; }
  633. void set_mitigation_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_base_ = value; }
  634. void add_mitigation_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_base_ += value; }
  635. void set_avoidance_display(int16 value) { std::lock_guard<std::mutex> lk(classMutex); avoidance_display_ = value; }
  636. void set_cur_avoidance(float value) { std::lock_guard<std::mutex> lk(classMutex); cur_avoidance_ = value; }
  637. void set_base_avoidance_pct(int16 value) { std::lock_guard<std::mutex> lk(classMutex); base_avoidance_pct_ = value; }
  638. void set_avoidance_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); avoidance_base_ = value; }
  639. void set_max_avoidance(int16 value) { std::lock_guard<std::mutex> lk(classMutex); max_avoidance_ = value; }
  640. void set_parry(float value) { std::lock_guard<std::mutex> lk(classMutex); parry_ = value; }
  641. void set_parry_base(float value) { std::lock_guard<std::mutex> lk(classMutex); parry_base_ = value; }
  642. void set_deflection(int16 value) { std::lock_guard<std::mutex> lk(classMutex); deflection_ = value; }
  643. void set_deflection_base(float value) { std::lock_guard<std::mutex> lk(classMutex); deflection_base_ = value; }
  644. void set_block(float value) { std::lock_guard<std::mutex> lk(classMutex); block_ = value; }
  645. void set_block_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); block_base_ = value; }
  646. void set_str(float value) { std::lock_guard<std::mutex> lk(classMutex); str_ = value; }
  647. void set_sta(float value) { std::lock_guard<std::mutex> lk(classMutex); sta_ = value; }
  648. void set_agi(float value) { std::lock_guard<std::mutex> lk(classMutex); agi_ = value; }
  649. void set_wis(float value) { std::lock_guard<std::mutex> lk(classMutex); wis_ = value; }
  650. void set_intel(float value) { std::lock_guard<std::mutex> lk(classMutex); intel_ = value; }
  651. void add_str(float value) { std::lock_guard<std::mutex> lk(classMutex); if(str_ + value < 0.0f) str_ = 0.0f; else str_ += value; }
  652. void add_sta(float value) { std::lock_guard<std::mutex> lk(classMutex); if(sta_ + value < 0.0f) sta_ = 0.0f; else sta_ += value; }
  653. void add_agi(float value) { std::lock_guard<std::mutex> lk(classMutex); if(agi_ + value < 0.0f) agi_ = 0.0f; else agi_ += value; }
  654. void add_wis(float value) { std::lock_guard<std::mutex> lk(classMutex); if(wis_ + value < 0.0f) wis_ = 0.0f; else wis_ += value; }
  655. void add_intel(float value) { std::lock_guard<std::mutex> lk(classMutex); if(intel_ + value < 0.0f) intel_ = 0.0f; else intel_ += value; }
  656. void set_str_base(float value) { std::lock_guard<std::mutex> lk(classMutex); str_base_ = value; }
  657. void set_sta_base(float value) { std::lock_guard<std::mutex> lk(classMutex); sta_base_ = value; }
  658. void set_agi_base(float value) { std::lock_guard<std::mutex> lk(classMutex); agi_base_ = value; }
  659. void set_wis_base(float value) { std::lock_guard<std::mutex> lk(classMutex); wis_base_ = value; }
  660. void set_intel_base(float value) { std::lock_guard<std::mutex> lk(classMutex); intel_base_ = value; }
  661. void set_heat(int16 value) { std::lock_guard<std::mutex> lk(classMutex); heat_ = value; }
  662. void set_cold(int16 value) { std::lock_guard<std::mutex> lk(classMutex); cold_ = value; }
  663. void set_magic(int16 value) { std::lock_guard<std::mutex> lk(classMutex); magic_ = value; }
  664. void set_mental(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mental_ = value; }
  665. void set_divine(int16 value) { std::lock_guard<std::mutex> lk(classMutex); divine_ = value; }
  666. void set_disease(int16 value) { std::lock_guard<std::mutex> lk(classMutex); disease_ = value; }
  667. void set_poison(int16 value) { std::lock_guard<std::mutex> lk(classMutex); poison_ = value; }
  668. void add_heat(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)heat_ + value < 0) heat_ = 0; else heat_ += value; }
  669. void add_cold(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)cold_ + value < 0) cold_ = 0; else cold_ += value; }
  670. void add_magic(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)magic_ + value < 0) magic_ = 0; else magic_ += value; }
  671. void add_mental(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)mental_ + value < 0) mental_ = 0; else mental_ += value; }
  672. void add_divine(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)divine_ + value < 0) divine_ = 0; else divine_ += value; }
  673. void add_disease(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)disease_ + value < 0) disease_ = 0; else disease_ += value; }
  674. void add_poison(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)poison_ + value < 0) poison_ = 0; else poison_ += value; }
  675. void set_disease_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); disease_base_ = value; }
  676. void set_cold_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); cold_base_ = value; }
  677. void set_divine_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); divine_base_ = value; }
  678. void set_magic_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); magic_base_ = value; }
  679. void set_mental_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mental_base_ = value; }
  680. void set_heat_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); heat_base_ = value; }
  681. void set_poison_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); poison_base_ = value; }
  682. void set_elemental_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); elemental_base_ = value; }
  683. void set_noxious_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); noxious_base_ = value; }
  684. void set_arcane_base(int16 value) { std::lock_guard<std::mutex> lk(classMutex); arcane_base_ = value; }
  685. void set_tradeskill_level(int16 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_level_ = value; }
  686. void set_tradeskill_max_level(int16 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_max_level_ = value; }
  687. void set_tradeskill_class1(int8 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_class1_ = value; }
  688. void set_tradeskill_class2(int8 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_class2_ = value; }
  689. void set_tradeskill_class3(int8 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_class3_ = value; }
  690. void set_account_age_base(int32 value) { std::lock_guard<std::mutex> lk(classMutex); account_age_base_ = value; }
  691. void set_xp_vitality(float value) { std::lock_guard<std::mutex> lk(classMutex); xp_vitality_ = value; }
  692. void add_xp_vitality(float value) { std::lock_guard<std::mutex> lk(classMutex); xp_vitality_ += value; }
  693. void set_tradeskill_xp_vitality(float value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_xp_vitality_ = value; }
  694. void set_absorb(int16 value) { std::lock_guard<std::mutex> lk(classMutex); absorb_ = value; }
  695. void set_xp(int32 value) { std::lock_guard<std::mutex> lk(classMutex); xp_ = value; }
  696. void set_xp_needed(int32 value) { std::lock_guard<std::mutex> lk(classMutex); xp_needed_ = value; }
  697. void set_xp_debt(float value) { std::lock_guard<std::mutex> lk(classMutex); if(std::isnan(value)) value = 0.0f; xp_debt_ = value; }
  698. void set_xp_yellow(int16 value) { std::lock_guard<std::mutex> lk(classMutex); xp_yellow_ = value; }
  699. void set_xp_blue(int16 value) { std::lock_guard<std::mutex> lk(classMutex); xp_blue_ = value; }
  700. void set_xp_yellow_vitality_bar(int16 value) { std::lock_guard<std::mutex> lk(classMutex); xp_yellow_vitality_bar_ = value; }
  701. void set_xp_blue_vitality_bar(int16 value) { std::lock_guard<std::mutex> lk(classMutex); xp_blue_vitality_bar_ = value; }
  702. void set_ts_xp(int32 value) { std::lock_guard<std::mutex> lk(classMutex); ts_xp_ = value; }
  703. void set_ts_xp_needed(int32 value) { std::lock_guard<std::mutex> lk(classMutex); ts_xp_needed_ = value; }
  704. void set_tradeskill_exp_yellow(int16 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_exp_yellow_ = value; }
  705. void set_tradeskill_exp_blue(int16 value) { std::lock_guard<std::mutex> lk(classMutex); tradeskill_exp_blue_ = value; }
  706. void set_flags(int32 value) { std::lock_guard<std::mutex> lk(classMutex); flags_ = value; }
  707. void set_flags2(int32 value) { std::lock_guard<std::mutex> lk(classMutex); flags2_ = value; }
  708. void set_coin_plat(int32 value) { std::lock_guard<std::mutex> lk(classMutex); coin_plat_ = value; }
  709. void set_coin_gold(int32 value) { std::lock_guard<std::mutex> lk(classMutex); coin_gold_ = value; }
  710. void set_coin_silver(int32 value) { std::lock_guard<std::mutex> lk(classMutex); coin_silver_ = value; }
  711. void set_coin_copper(int32 value) { std::lock_guard<std::mutex> lk(classMutex); coin_copper_ = value; }
  712. void add_coin_plat(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)coin_plat_ + value < 0) coin_plat_ = 0; else coin_plat_ += value; }
  713. void add_coin_gold(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)coin_gold_ + value < 0) coin_gold_ = 0; else coin_gold_ += value; }
  714. void add_coin_silver(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)coin_silver_ + value < 0) coin_silver_ = 0; else coin_silver_ += value; }
  715. void add_coin_copper(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)coin_copper_ + value < 0) coin_copper_ = 0; else coin_copper_ += value; }
  716. void set_bank_coin_plat(int32 value) { std::lock_guard<std::mutex> lk(classMutex); bank_coin_plat_ = value; }
  717. void set_bank_coin_gold(int32 value) { std::lock_guard<std::mutex> lk(classMutex); bank_coin_gold_ = value; }
  718. void set_bank_coin_silver(int32 value) { std::lock_guard<std::mutex> lk(classMutex); bank_coin_silver_ = value; }
  719. void set_bank_coin_copper(int32 value) { std::lock_guard<std::mutex> lk(classMutex); bank_coin_copper_ = value; }
  720. void add_bank_coin_plat(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)bank_coin_plat_ + value < 0) bank_coin_plat_ = 0; else bank_coin_plat_ += value; }
  721. void add_bank_coin_gold(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)bank_coin_gold_ + value < 0) bank_coin_gold_ = 0; else bank_coin_gold_ += value; }
  722. void add_bank_coin_silver(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)bank_coin_silver_ + value < 0) bank_coin_silver_ = 0; else bank_coin_silver_ += value; }
  723. void add_bank_coin_copper(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)bank_coin_copper_ + value < 0) bank_coin_copper_ = 0; else bank_coin_copper_ += value; }
  724. void set_status_points(int32 value) { std::lock_guard<std::mutex> lk(classMutex); status_points_ = value; }
  725. void add_status_points(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint64)status_points_ + value < 0) status_points_ = 0; else status_points_ += value; }
  726. bool subtract_status_points(int32 value) { std::lock_guard<std::mutex> lk(classMutex); if(value > status_points_) return false; status_points_ -= value; return true; }
  727. void set_mitigation_skill1(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_skill1_ = value; }
  728. void set_mitigation_skill2(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_skill2_ = value; }
  729. void set_mitigation_skill3(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_skill3_ = value; }
  730. void set_mitigation_pve(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_pve_ = value; }
  731. void set_mitigation_pvp(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mitigation_pvp_ = value; }
  732. void add_mitigation_skill1(int16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)mitigation_skill1_ + value < 0) mitigation_skill1_ = 0; else mitigation_skill1_ += value; }
  733. void add_mitigation_skill2(int16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)mitigation_skill2_ + value < 0) mitigation_skill2_ = 0; else mitigation_skill2_ += value; }
  734. void add_mitigation_skill3(int16 value) { std::lock_guard<std::mutex> lk(classMutex); if((sint32)mitigation_skill3_ + value < 0) mitigation_skill3_ = 0; else mitigation_skill3_ += value; }
  735. void set_ability_modifier(float value) { std::lock_guard<std::mutex> lk(classMutex); ability_modifier_ = value; }
  736. void add_ability_modifier(float value) { std::lock_guard<std::mutex> lk(classMutex); if(ability_modifier_ + value < 0.0f) ability_modifier_ = 0.0f; else ability_modifier_ += value; }
  737. void set_critical_mitigation(float value) { std::lock_guard<std::mutex> lk(classMutex); critical_mitigation_ = value; }
  738. void add_critical_mitigation(float value) { std::lock_guard<std::mutex> lk(classMutex); if(critical_mitigation_ + value < 0.0f) critical_mitigation_ = 0.0f; else critical_mitigation_ += value; }
  739. void set_block_chance(float value) { std::lock_guard<std::mutex> lk(classMutex); block_chance_ = value; }
  740. void set_uncontested_parry(float value) { std::lock_guard<std::mutex> lk(classMutex); uncontested_parry_ = value; }
  741. void set_uncontested_block(float value) { std::lock_guard<std::mutex> lk(classMutex); uncontested_block_ = value; }
  742. void set_uncontested_dodge(float value) { std::lock_guard<std::mutex> lk(classMutex); uncontested_dodge_ = value; }
  743. void set_uncontested_riposte(float value) { std::lock_guard<std::mutex> lk(classMutex); uncontested_riposte_ = value; }
  744. void set_crit_chance(float value) { std::lock_guard<std::mutex> lk(classMutex); crit_chance_ = value; }
  745. void set_crit_bonus(float value) { std::lock_guard<std::mutex> lk(classMutex); crit_bonus_ = value; }
  746. void set_potency(float value) { std::lock_guard<std::mutex> lk(classMutex); potency_ = value; }
  747. void set_hate_mod(float value) { std::lock_guard<std::mutex> lk(classMutex); hate_mod_ = value; }
  748. void set_reuse_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); reuse_speed_ = value; }
  749. void set_casting_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); casting_speed_ = value; }
  750. void set_recovery_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); recovery_speed_ = value; }
  751. void set_spell_reuse_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); spell_reuse_speed_ = value; }
  752. void set_spell_multi_attack(float value) { std::lock_guard<std::mutex> lk(classMutex); spell_multi_attack_ = value; }
  753. void set_dps(float value) { std::lock_guard<std::mutex> lk(classMutex); dps_ = value; }
  754. void set_dps_multiplier(float value) { std::lock_guard<std::mutex> lk(classMutex); dps_multiplier_ = value; }
  755. void set_attackspeed(float value) { std::lock_guard<std::mutex> lk(classMutex); attackspeed_ = value; }
  756. void set_haste(float value) { std::lock_guard<std::mutex> lk(classMutex); haste_ = value; }
  757. void set_multi_attack(float value) { std::lock_guard<std::mutex> lk(classMutex); multi_attack_ = value; }
  758. void set_flurry(float value) { std::lock_guard<std::mutex> lk(classMutex); flurry_ = value; }
  759. void set_melee_ae(float value) { std::lock_guard<std::mutex> lk(classMutex); melee_ae_ = value; }
  760. void set_strikethrough(float value) { std::lock_guard<std::mutex> lk(classMutex); strikethrough_ = value; }
  761. void set_accuracy(float value) { std::lock_guard<std::mutex> lk(classMutex); accuracy_ = value; }
  762. void set_offensivespeed(float value) { std::lock_guard<std::mutex> lk(classMutex); offensivespeed_ = value; }
  763. // crash client if float values above 1.0 are sent
  764. void set_rain(float value) { std::lock_guard<std::mutex> lk(classMutex); if(value > 1.0f) value = 1.0f; else if(value < 0.0f) value = 0.0f; rain_ = value; }
  765. void set_wind(float value) { std::lock_guard<std::mutex> lk(classMutex); if(value > 1.0f) value = 1.0f; else if(value < 0.0f) value = 0.0f; wind_ = value; }
  766. void add_block_chance(float value) { std::lock_guard<std::mutex> lk(classMutex); if(block_chance_ + value < 0.0f) block_chance_ = 0.0f; else block_chance_ += value; }
  767. void add_uncontested_parry(float value) { std::lock_guard<std::mutex> lk(classMutex); if(uncontested_parry_ + value < 0.0f) uncontested_parry_ = 0.0f; else uncontested_parry_ += value; }
  768. void add_uncontested_block(float value) { std::lock_guard<std::mutex> lk(classMutex); if(uncontested_block_ + value < 0.0f) uncontested_block_ = 0.0f; else uncontested_block_ += value; }
  769. void add_uncontested_dodge(float value) { std::lock_guard<std::mutex> lk(classMutex); if(uncontested_dodge_ + value < 0.0f) uncontested_dodge_ = 0.0f; else uncontested_dodge_ += value; }
  770. void add_uncontested_riposte(float value) { std::lock_guard<std::mutex> lk(classMutex); if(uncontested_riposte_ + value < 0.0f) uncontested_riposte_ = 0.0f; else uncontested_riposte_ += value; }
  771. void add_crit_chance(float value) { std::lock_guard<std::mutex> lk(classMutex); if(crit_chance_ + value < 0.0f) crit_chance_ = 0.0f; else crit_chance_ += value; }
  772. void add_crit_bonus(float value) { std::lock_guard<std::mutex> lk(classMutex); if(crit_bonus_ + value < 0.0f) crit_bonus_ = 0.0f; else crit_bonus_ += value; }
  773. void add_potency(float value) { std::lock_guard<std::mutex> lk(classMutex); if(potency_ + value < 0.0f) potency_ = 0.0f; else potency_ += value; }
  774. void add_hate_mod(float value) { std::lock_guard<std::mutex> lk(classMutex); if(hate_mod_ + value < 0.0f) hate_mod_ = 0.0f; else hate_mod_ += value; }
  775. void add_reuse_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(reuse_speed_ + value < 0.0f) reuse_speed_ = 0.0f; else reuse_speed_ += value; }
  776. void add_casting_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(casting_speed_ + value < 0.0f) casting_speed_ = 0.0f; else casting_speed_ += value; }
  777. void add_recovery_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(recovery_speed_ + value < 0.0f) recovery_speed_ = 0.0f; else recovery_speed_ += value; }
  778. void add_spell_reuse_speed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(spell_reuse_speed_ + value < 0.0f) spell_reuse_speed_ = 0.0f; else spell_reuse_speed_ += value; }
  779. void add_spell_multi_attack(float value) { std::lock_guard<std::mutex> lk(classMutex); if(spell_multi_attack_ + value < 0.0f) spell_multi_attack_ = 0.0f; else spell_multi_attack_ += value; }
  780. void add_dps(float value) { std::lock_guard<std::mutex> lk(classMutex); if(dps_ + value < 0.0f) dps_ = 0.0f; else dps_ += value; }
  781. void add_dps_multiplier(float value) { std::lock_guard<std::mutex> lk(classMutex); if(dps_multiplier_ + value < 0.0f) dps_multiplier_ = 0.0f; else dps_multiplier_ += value; }
  782. void add_attackspeed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(attackspeed_ + value < 0.0f) attackspeed_ = 0.0f; else attackspeed_ += value; }
  783. void add_haste(float value) { std::lock_guard<std::mutex> lk(classMutex); if(haste_ + value < 0.0f) haste_ = 0.0f; else haste_ += value; }
  784. void add_multi_attack(float value) { std::lock_guard<std::mutex> lk(classMutex); if(multi_attack_ + value < 0.0f) multi_attack_ = 0.0f; else multi_attack_ += value; }
  785. void add_flurry(float value) { std::lock_guard<std::mutex> lk(classMutex); if(flurry_ + value < 0.0f) flurry_ = 0.0f; else flurry_ += value; }
  786. void add_melee_ae(float value) { std::lock_guard<std::mutex> lk(classMutex); if(melee_ae_ + value < 0.0f) melee_ae_ = 0.0f; else melee_ae_ += value; }
  787. void add_strikethrough(float value) { std::lock_guard<std::mutex> lk(classMutex); if(strikethrough_ + value < 0.0f) strikethrough_ = 0.0f; else strikethrough_ += value; }
  788. void add_accuracy(float value) { std::lock_guard<std::mutex> lk(classMutex); if(accuracy_ + value < 0.0f) accuracy_ = 0.0f; else accuracy_ += value; }
  789. void add_offensivespeed(float value) { std::lock_guard<std::mutex> lk(classMutex); if(offensivespeed_ + value < 0.0f) offensivespeed_ = 0.0f; else offensivespeed_ += value; }
  790. void add_rain(float value) { std::lock_guard<std::mutex> lk(classMutex); if(rain_ + value < 0.0f) rain_ = 0.0f; else rain_ += value; }
  791. void add_wind(float value) { std::lock_guard<std::mutex> lk(classMutex); if(wind_ + value < 0.0f) wind_ = 0.0f; else wind_ += value; }
  792. void set_alignment(int8 value) { std::lock_guard<std::mutex> lk(classMutex); alignment_ = value; }
  793. void set_pet_id(int32 value) { std::lock_guard<std::mutex> lk(classMutex); pet_id_ = value; }
  794. void set_pet_name(std::string value) { std::lock_guard<std::mutex> lk(classMutex); pet_name_ = value; }
  795. void set_pet_movement(int8 value) { std::lock_guard<std::mutex> lk(classMutex); pet_movement_ = value; }
  796. void set_pet_behavior(int8 value) { std::lock_guard<std::mutex> lk(classMutex); pet_behavior_ = value; }
  797. void set_pet_health_pct(float value) { std::lock_guard<std::mutex> lk(classMutex); pet_health_pct_ = value; }
  798. void set_pet_power_pct(float value) { std::lock_guard<std::mutex> lk(classMutex); pet_power_pct_ = value; }
  799. void set_weight(int32 value) { std::lock_guard<std::mutex> lk(classMutex); weight_ = value; }
  800. void set_max_weight(int32 value) { std::lock_guard<std::mutex> lk(classMutex); max_weight_ = value; }
  801. void set_vision(int32 value) { std::lock_guard<std::mutex> lk(classMutex); vision_ = value; }
  802. void set_breathe_underwater(int8 value) { std::lock_guard<std::mutex> lk(classMutex); breathe_underwater_ = value; }
  803. void set_drunk(float value) { std::lock_guard<std::mutex> lk(classMutex); drunk_ = value; }
  804. void set_biography(std::string value) { std::lock_guard<std::mutex> lk(classMutex); biography_ = value; }
  805. void set_power_regen(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); power_regen_ = value; }
  806. void set_hp_regen(sint16 value) { std::lock_guard<std::mutex> lk(classMutex); hp_regen_ = value; }
  807. void set_power_regen_override(int8 value) { std::lock_guard<std::mutex> lk(classMutex); power_regen_override_ = value; }
  808. void set_hp_regen_override(int8 value) { std::lock_guard<std::mutex> lk(classMutex); hp_regen_override_ = value; }
  809. void set_water_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); water_type_ = value; }
  810. void set_flying_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); flying_type_ = value; }
  811. void set_no_interrupt(int8 value) { std::lock_guard<std::mutex> lk(classMutex); no_interrupt_ = value; }
  812. void set_interaction_flag(int8 value) { std::lock_guard<std::mutex> lk(classMutex); interaction_flag_ = value; }
  813. void set_tag1(int8 value) { std::lock_guard<std::mutex> lk(classMutex); tag1_ = value; }
  814. void set_mood(int16 value) { std::lock_guard<std::mutex> lk(classMutex); mood_ = value; }
  815. void set_range_last_attack_time(int32 value) { std::lock_guard<std::mutex> lk(classMutex); range_last_attack_time_ = value; }
  816. void set_primary_last_attack_time(int32 value) { std::lock_guard<std::mutex> lk(classMutex); primary_last_attack_time_ = value; }
  817. void set_secondary_last_attack_time(int32 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_last_attack_time_ = value; }
  818. void set_primary_attack_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); primary_attack_delay_ = value; }
  819. void set_secondary_attack_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_attack_delay_ = value; }
  820. void set_ranged_attack_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); ranged_attack_delay_ = value; }
  821. void set_primary_weapon_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); primary_weapon_type_ = value; }
  822. void set_secondary_weapon_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_weapon_type_ = value; }
  823. void set_ranged_weapon_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); ranged_weapon_type_ = value; }
  824. void set_primary_weapon_damage_low(int32 value) { std::lock_guard<std::mutex> lk(classMutex); primary_weapon_damage_low_ = value; }
  825. void set_primary_weapon_damage_high(int32 value) { std::lock_guard<std::mutex> lk(classMutex); primary_weapon_damage_high_ = value; }
  826. void set_secondary_weapon_damage_low(int32 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_weapon_damage_low_ = value; }
  827. void set_secondary_weapon_damage_high(int32 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_weapon_damage_high_ = value; }
  828. void set_ranged_weapon_damage_low(int32 value) { std::lock_guard<std::mutex> lk(classMutex); ranged_weapon_damage_low_ = value; }
  829. void set_ranged_weapon_damage_high(int32 value) { std::lock_guard<std::mutex> lk(classMutex); ranged_weapon_damage_high_ = value; }
  830. void set_wield_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); wield_type_ = value; }
  831. void set_attack_type(int8 value) { std::lock_guard<std::mutex> lk(classMutex); attack_type_ = value; }
  832. void set_primary_weapon_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); primary_weapon_delay_ = value; }
  833. void set_secondary_weapon_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); secondary_weapon_delay_ = value; }
  834. void set_ranged_weapon_delay(int16 value) { std::lock_guard<std::mutex> lk(classMutex); ranged_weapon_delay_ = value; }
  835. void set_override_primary_weapon(int8 value) { std::lock_guard<std::mutex> lk(classMutex); override_secondary_weapon_ = value; }
  836. void set_override_secondary_weapon(int8 value) { std::lock_guard<std::mutex> lk(classMutex); override_secondary_weapon_ = value; }
  837. void set_override_ranged_weapon(int8 value) { std::lock_guard<std::mutex> lk(classMutex); override_ranged_weapon_ = value; }
  838. void set_friendly_target_npc(int8 value) { std::lock_guard<std::mutex> lk(classMutex); friendly_target_npc_ = value; }
  839. void set_last_claim_time(int32 value) { std::lock_guard<std::mutex> lk(classMutex); last_claim_time_ = value; }
  840. void set_engaged_encounter(int8 value) { std::lock_guard<std::mutex> lk(classMutex); engaged_encounter_ = value; }
  841. void set_first_world_login(int8 value) { std::lock_guard<std::mutex> lk(classMutex); first_world_login_ = value; }
  842. void set_reload_player_spells(int8 value) { std::lock_guard<std::mutex> lk(classMutex); reload_player_spells_ = value; }
  843. void set_action_state(std::string value) { std::lock_guard<std::mutex> lk(classMutex); action_state_ = value; }
  844. void ResetEffects(Spawn* spawn)
  845. {
  846. for(int i=0;i<45;i++){
  847. if(i<30){
  848. maintained_effects[i].spell_id = 0xFFFFFFFF;
  849. if (spawn->IsPlayer())
  850. maintained_effects[i].icon = 0xFFFF;
  851. maintained_effects[i].spell = nullptr;
  852. }
  853. spell_effects[i].spell_id = 0xFFFFFFFF;
  854. spell_effects[i].spell = nullptr;
  855. }
  856. }
  857. // maintained via their own mutex
  858. SpellEffects spell_effects[45];
  859. MaintainedEffects maintained_effects[30];
  860. private:
  861. std::string name_;
  862. int8 class1_;
  863. int8 class2_;
  864. int8 class3_;
  865. int8 race_;
  866. int8 gender_;
  867. int16 level_;
  868. int16 max_level_;
  869. int16 effective_level_;
  870. int16 tradeskill_level_;
  871. int16 tradeskill_max_level_;
  872. int8 cur_concentration_;
  873. int8 max_concentration_;
  874. int16 cur_attack_;
  875. int16 attack_base_;
  876. int16 cur_mitigation_;
  877. int16 max_mitigation_;
  878. int16 mitigation_base_;
  879. int16 avoidance_display_;
  880. float cur_avoidance_;
  881. int16 base_avoidance_pct_;
  882. int16 avoidance_base_;
  883. int16 max_avoidance_;
  884. float parry_;
  885. float parry_base_;
  886. float deflection_;
  887. int16 deflection_base_;
  888. float block_;
  889. int16 block_base_;
  890. float riposte_;
  891. float riposte_base_;
  892. float str_; //int16
  893. float sta_; //int16
  894. float agi_;//int16
  895. float wis_;//int16
  896. float intel_;//int16
  897. float str_base_;//int16
  898. float sta_base_;//int16
  899. float agi_base_;//int16
  900. float wis_base_;//int16
  901. float intel_base_;//int16
  902. int16 heat_;
  903. int16 cold_;
  904. int16 magic_;
  905. int16 mental_;
  906. int16 divine_;
  907. int16 disease_;
  908. int16 poison_;
  909. int16 disease_base_;
  910. int16 cold_base_;
  911. int16 divine_base_;
  912. int16 magic_base_;
  913. int16 mental_base_;
  914. int16 heat_base_;
  915. int16 poison_base_;
  916. int16 elemental_base_;
  917. int16 noxious_base_;
  918. int16 arcane_base_;
  919. int32 coin_copper_;
  920. int32 coin_silver_;
  921. int32 coin_gold_;
  922. int32 coin_plat_;
  923. int32 bank_coin_copper_;
  924. int32 bank_coin_silver_;
  925. int32 bank_coin_gold_;
  926. int32 bank_coin_plat_;
  927. int32 status_points_;
  928. std::string deity_;
  929. int32 weight_;
  930. int32 max_weight_;
  931. int8 tradeskill_class1_;
  932. int8 tradeskill_class2_;
  933. int8 tradeskill_class3_;
  934. int32 account_age_base_;
  935. int8 account_age_bonus_[19];
  936. int16 absorb_;
  937. int32 xp_;
  938. int32 xp_needed_;
  939. float xp_debt_;
  940. int16 xp_yellow_;
  941. int16 xp_yellow_vitality_bar_;
  942. int16 xp_blue_vitality_bar_;
  943. int16 xp_blue_;
  944. int32 ts_xp_;
  945. int32 ts_xp_needed_;
  946. int16 tradeskill_exp_yellow_;
  947. int16 tradeskill_exp_blue_;
  948. int32 flags_;
  949. int32 flags2_;
  950. float xp_vitality_;
  951. float tradeskill_xp_vitality_;
  952. int16 mitigation_skill1_;
  953. int16 mitigation_skill2_;
  954. int16 mitigation_skill3_;
  955. int16 mitigation_pve_;
  956. int16 mitigation_pvp_;
  957. float ability_modifier_;
  958. float critical_mitigation_;
  959. float block_chance_;
  960. float uncontested_parry_;
  961. float uncontested_block_;
  962. float uncontested_dodge_;
  963. float uncontested_riposte_;
  964. float crit_chance_;
  965. float crit_bonus_;
  966. float potency_;
  967. float hate_mod_;
  968. float reuse_speed_;
  969. float casting_speed_;
  970. float recovery_speed_;
  971. float spell_reuse_speed_;
  972. float spell_multi_attack_;
  973. float dps_;
  974. float dps_multiplier_;
  975. float attackspeed_;
  976. float haste_;
  977. float multi_attack_;
  978. float flurry_;
  979. float melee_ae_;
  980. float strikethrough_;
  981. float accuracy_;
  982. float offensivespeed_;
  983. float rain_;
  984. float wind_;
  985. sint8 alignment_;
  986. int32 pet_id_;
  987. std::string pet_name_;
  988. float pet_health_pct_;
  989. float pet_power_pct_;
  990. int8 pet_movement_;
  991. int8 pet_behavior_;
  992. int32 vision_;
  993. int8 breathe_underwater_;
  994. std::string biography_;
  995. float drunk_;
  996. sint16 power_regen_;
  997. sint16 hp_regen_;
  998. int8 power_regen_override_;
  999. int8 hp_regen_override_;
  1000. int8 water_type_;
  1001. int8 flying_type_;
  1002. int8 no_interrupt_;
  1003. int8 interaction_flag_;
  1004. int8 tag1_;
  1005. int16 mood_;
  1006. int32 range_last_attack_time_;
  1007. int32 primary_last_attack_time_;
  1008. int32 secondary_last_attack_time_;
  1009. int16 primary_attack_delay_;
  1010. int16 secondary_attack_delay_;
  1011. int16 ranged_attack_delay_;
  1012. int8 primary_weapon_type_;
  1013. int8 secondary_weapon_type_;
  1014. int8 ranged_weapon_type_;
  1015. int32 primary_weapon_damage_low_;
  1016. int32 primary_weapon_damage_high_;
  1017. int32 secondary_weapon_damage_low_;
  1018. int32 secondary_weapon_damage_high_;
  1019. int32 ranged_weapon_damage_low_;
  1020. int32 ranged_weapon_damage_high_;
  1021. int8 wield_type_;
  1022. int8 attack_type_;
  1023. int16 primary_weapon_delay_;
  1024. int16 secondary_weapon_delay_;
  1025. int16 ranged_weapon_delay_;
  1026. int8 override_primary_weapon_;
  1027. int8 override_secondary_weapon_;
  1028. int8 override_ranged_weapon_;
  1029. int8 friendly_target_npc_;
  1030. int32 last_claim_time_;
  1031. int8 engaged_encounter_;
  1032. int8 first_world_login_;
  1033. int8 reload_player_spells_;
  1034. std::string action_state_;
  1035. // when PacketStruct is fixed for C++17 this should become a shared_mutex and handle read/write lock
  1036. std::mutex classMutex;
  1037. };
  1038. struct WardInfo {
  1039. LuaSpell* Spell;
  1040. int32 BaseDamage;
  1041. int32 DamageLeft;
  1042. int8 WardType;
  1043. int8 DamageType;
  1044. bool keepWard;
  1045. int32 DamageAbsorptionPercentage;
  1046. int32 DamageAbsorptionMaxHealthPercent;
  1047. int32 RedirectDamagePercent;
  1048. int32 LastRedirectDamage;
  1049. int32 LastAbsorbedDamage;
  1050. int32 HitCount;
  1051. int32 MaxHitCount;
  1052. bool AbsorbAllDamage; // damage is always absorbed, usually spells based on hits, when we pass damage in AddWard as 0 this will be set to true
  1053. bool RoundTriggered;
  1054. };
  1055. #define WARD_TYPE_ALL 0
  1056. #define WARD_TYPE_PHYSICAL 1
  1057. #define WARD_TYPE_MAGICAL 2
  1058. struct Proc {
  1059. LuaSpell* spell;
  1060. Item* item;
  1061. float chance;
  1062. int32 spellid;
  1063. };
  1064. #define PROC_TYPE_OFFENSIVE 1
  1065. #define PROC_TYPE_DEFENSIVE 2
  1066. #define PROC_TYPE_PHYSICAL_OFFENSIVE 3
  1067. #define PROC_TYPE_PHYSICAL_DEFENSIVE 4
  1068. #define PROC_TYPE_MAGICAL_OFFENSIVE 5
  1069. #define PROC_TYPE_MAGICAL_DEFENSIVE 6
  1070. #define PROC_TYPE_BLOCK 7
  1071. #define PROC_TYPE_PARRY 8
  1072. #define PROC_TYPE_RIPOSTE 9
  1073. #define PROC_TYPE_EVADE 10
  1074. #define PROC_TYPE_HEALING 11
  1075. #define PROC_TYPE_BENEFICIAL 12
  1076. #define PROC_TYPE_DEATH 13
  1077. #define PROC_TYPE_KILL 14
  1078. #define PROC_TYPE_DAMAGED 15
  1079. #define PROC_TYPE_DAMAGED_MELEE 16
  1080. #define PROC_TYPE_DAMAGED_MAGIC 17
  1081. #define PROC_TYPE_RANGED_ATTACK 18
  1082. #define PROC_TYPE_RANGED_DEFENSE 19
  1083. struct ThreatTransfer {
  1084. int32 Target;
  1085. float Amount;
  1086. LuaSpell* Spell;
  1087. };
  1088. #define DET_TYPE_TRAUMA 1
  1089. #define DET_TYPE_ARCANE 2
  1090. #define DET_TYPE_NOXIOUS 3
  1091. #define DET_TYPE_ELEMENTAL 4
  1092. #define DET_TYPE_CURSE 5
  1093. #define DISPELL_TYPE_CURE 0
  1094. #define DISPELL_TYPE_DISPELL 1
  1095. #define CONTROL_EFFECT_TYPE_MEZ 1
  1096. #define CONTROL_EFFECT_TYPE_STIFLE 2
  1097. #define CONTROL_EFFECT_TYPE_DAZE 3
  1098. #define CONTROL_EFFECT_TYPE_STUN 4
  1099. #define CONTROL_EFFECT_TYPE_ROOT 5
  1100. #define CONTROL_EFFECT_TYPE_FEAR 6
  1101. #define CONTROL_EFFECT_TYPE_WALKUNDERWATER 7
  1102. #define CONTROL_EFFECT_TYPE_JUMPUNDERWATER 8
  1103. #define CONTROL_EFFECT_TYPE_INVIS 9
  1104. #define CONTROL_EFFECT_TYPE_STEALTH 10
  1105. #define CONTROL_EFFECT_TYPE_SNARE 11
  1106. #define CONTROL_EFFECT_TYPE_FLIGHT 12
  1107. #define CONTROL_EFFECT_TYPE_GLIDE 13
  1108. #define CONTROL_EFFECT_TYPE_SAFEFALL 14
  1109. #define CONTROL_MAX_EFFECTS 15 // always +1 to highest control effect
  1110. #define IMMUNITY_TYPE_MEZ 1
  1111. #define IMMUNITY_TYPE_STIFLE 2
  1112. #define IMMUNITY_TYPE_DAZE 3
  1113. #define IMMUNITY_TYPE_STUN 4
  1114. #define IMMUNITY_TYPE_ROOT 5
  1115. #define IMMUNITY_TYPE_FEAR 6
  1116. #define IMMUNITY_TYPE_AOE 7
  1117. #define IMMUNITY_TYPE_TAUNT 8
  1118. #define IMMUNITY_TYPE_RIPOSTE 9
  1119. //class Spell;
  1120. //class ZoneServer;
  1121. //The entity class is for NPCs and Players, spawns which are able to fight
  1122. class Entity : public Spawn{
  1123. public:
  1124. Entity();
  1125. virtual ~Entity();
  1126. void DeleteSpellEffects(bool removeClient = false);
  1127. void RemoveSpells();
  1128. void MapInfoStruct();
  1129. virtual float GetDodgeChance();
  1130. virtual void AddMaintainedSpell(LuaSpell* spell);
  1131. virtual void AddSpellEffect(LuaSpell* spell, int32 override_expire_time = 0);
  1132. virtual void RemoveMaintainedSpell(LuaSpell* spell);
  1133. virtual void RemoveSpellEffect(LuaSpell* spell);
  1134. virtual void AddSkillBonus(int32 spell_id, int32 skill_id, float value);
  1135. void AddDetrimentalSpell(LuaSpell* spell, int32 override_expire_timestamp = 0);
  1136. DetrimentalEffects* GetDetrimentalEffect(int32 spell_id, Entity* caster);
  1137. virtual MaintainedEffects* GetMaintainedSpell(int32 spell_id);
  1138. void RemoveDetrimentalSpell(LuaSpell* spell);
  1139. void SetDeity(int8 new_deity){
  1140. deity = new_deity;
  1141. }
  1142. int8 GetDeity(){ return deity; }
  1143. EquipmentItemList* GetEquipmentList();
  1144. EquipmentItemList* GetAppearanceEquipmentList();
  1145. bool IsEntity(){ return true; }
  1146. float CalculateSkillStatChance(char* skill, int16 item_stat, float max_cap = 0.0f, float modifier = 0.0f, bool add_to_skill = false);
  1147. float CalculateSkillWithBonus(char* skillName, int16 item_stat, bool chance_skill_increase);
  1148. float GetRuleSkillMaxBonus();
  1149. void CalculateBonuses();
  1150. void SetRegenValues(int16 effective_level);
  1151. float CalculateBonusMod();
  1152. float CalculateDPSMultiplier();
  1153. float CalculateCastingSpeedMod();
  1154. InfoStruct* GetInfoStruct();
  1155. int16 GetStr();
  1156. int16 GetSta();
  1157. int16 GetInt();
  1158. int16 GetWis();
  1159. int16 GetAgi();
  1160. int16 GetPrimaryStat();
  1161. int16 GetHeatResistance();
  1162. int16 GetColdResistance();
  1163. int16 GetMagicResistance();
  1164. int16 GetMentalResistance();
  1165. int16 GetDivineResistance();
  1166. int16 GetDiseaseResistance();
  1167. int16 GetPoisonResistance();
  1168. int16 GetStrBase();
  1169. int16 GetStaBase();
  1170. int16 GetIntBase();
  1171. int16 GetWisBase();
  1172. int16 GetAgiBase();
  1173. int16 GetHeatResistanceBase();
  1174. int16 GetColdResistanceBase();
  1175. int16 GetMagicResistanceBase();
  1176. int16 GetMentalResistanceBase();
  1177. int16 GetDivineResistanceBase();
  1178. int16 GetDiseaseResistanceBase();
  1179. int16 GetPoisonResistanceBase();
  1180. int8 GetConcentrationCurrent();
  1181. int8 GetConcentrationMax();
  1182. sint8 GetAlignment();
  1183. void SetAlignment(sint8 new_value);
  1184. bool HasMoved(bool include_heading);
  1185. void SetHPRegen(int16 new_val);
  1186. int16 GetHPRegen();
  1187. void DoRegenUpdate();
  1188. MaintainedEffects* GetFreeMaintainedSpellSlot();
  1189. SpellEffects* GetFreeSpellEffectSlot();
  1190. SpellEffects* GetSpellEffect(int32 id, Entity* caster = 0);
  1191. SpellEffects* GetSpellEffectBySpellType(int8 spell_type);
  1192. SpellEffects* GetSpellEffectWithLinkedTimer(int32 id, int32 linked_timer = 0, sint32 type_group_spell_id = 0, Entity* caster = 0);
  1193. LuaSpell* HasLinkedTimerID(LuaSpell* spell, Spawn* target = nullptr, bool stackWithOtherPlayers = true);
  1194. //flags
  1195. int32 GetFlags() { return info_struct.get_flags(); }
  1196. int32 GetFlags2() { return info_struct.get_flags2(); }
  1197. bool query_flags(int flag) {
  1198. if (flag > 63) return false;
  1199. if (flag < 32) return ((info_struct.get_flags() & (1 << flag))?true:false);
  1200. return ((info_struct.get_flags2() & (1 << (flag - 32)))?true:false);
  1201. }
  1202. float GetMaxSpeed();
  1203. void SetMaxSpeed(float val);
  1204. //combat stuff:
  1205. int32 GetRangeLastAttackTime();
  1206. void SetRangeLastAttackTime(int32 time);
  1207. int16 GetRangeAttackDelay();
  1208. int16 GetRangeWeaponDelay();
  1209. void SetRangeWeaponDelay(int16 new_delay);
  1210. void SetRangeAttackDelay(int16 new_delay);
  1211. int32 GetPrimaryLastAttackTime();
  1212. int16 GetPrimaryAttackDelay();
  1213. void SetPrimaryAttackDelay(int16 new_delay);
  1214. void SetPrimaryLastAttackTime(int32 new_time);
  1215. void SetPrimaryWeaponDelay(int16 new_delay);
  1216. int32 GetSecondaryLastAttackTime();
  1217. int16 GetSecondaryAttackDelay();
  1218. void SetSecondaryAttackDelay(int16 new_delay);
  1219. void SetSecondaryLastAttackTime(int32 new_time);
  1220. void SetSecondaryWeaponDelay(int16 new_delay);
  1221. int32 GetPrimaryWeaponMinDamage();
  1222. int32 GetPrimaryWeaponMaxDamage();
  1223. int32 GetSecondaryWeaponMinDamage();
  1224. int32 GetSecondaryWeaponMaxDamage();
  1225. int32 GetRangedWeaponMinDamage();
  1226. int32 GetRangedWeaponMaxDamage();
  1227. int8 GetPrimaryWeaponType();
  1228. int8 GetSecondaryWeaponType();
  1229. int8 GetRangedWeaponType();
  1230. int8 GetWieldType();
  1231. int16 GetPrimaryWeaponDelay();
  1232. int16 GetSecondaryWeaponDelay();
  1233. bool IsDualWield();
  1234. bool BehindTarget(Spawn* target);
  1235. bool FlankingTarget(Spawn* target);
  1236. void ChangePrimaryWeapon();
  1237. void ChangeSecondaryWeapon();
  1238. void ChangeRangedWeapon();
  1239. void UpdateWeapons();
  1240. int32 GetStrengthDamage();
  1241. virtual Skill* GetSkillByName(const char* name, bool check_update = false);
  1242. virtual Skill* GetSkillByID(int32 id, bool check_update = false);
  1243. bool AttackAllowed(Entity* target, float distance = 0, bool range_attack = false);
  1244. bool PrimaryWeaponReady();
  1245. bool SecondaryWeaponReady();
  1246. bool RangeWeaponReady();
  1247. void MeleeAttack(Spawn* victim, float distance, bool primary, bool multi_attack = false);
  1248. void RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo, bool multi_attack = false);
  1249. bool SpellAttack(Spawn* victim, float distance, LuaSpell* luaspell, int8 damage_type, int32 low_damage, int32 high_damage, int8 crit_mod = 0, bool no_calcs = false);
  1250. bool ProcAttack(Spawn* victim, int8 damage_type, int32 low_damage, int32 high_damage, string name, string success_msg, string effect_msg);
  1251. bool SpellHeal(Spawn* target, float distance, LuaSpell* luaspell, string heal_type, int32 low_heal, int32 high_heal, int8 crit_mod = 0, bool no_calcs = false, string custom_spell_name="");
  1252. int8 DetermineHit(Spawn* victim, int8 type, int8 damage_type, float ToHitBonus, bool is_caster_spell, LuaSpell* lua_spell = nullptr);
  1253. float GetDamageTypeResistPercentage(int8 damage_type);
  1254. Skill* GetSkillByWeaponType(int8 type, int8 damage_type, bool update);
  1255. bool DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_damage, int32 high_damage, const char* spell_name, int8 crit_mod = 0, bool is_tick = false, bool no_damage_calcs = false, bool ignore_attacker = false, LuaSpell* spell = 0);
  1256. float CalculateMitigation(int8 type = DAMAGE_PACKET_TYPE_SIMPLE_DAMAGE, int8 damage_type = 0, int16 attacker_level = 0, bool for_pvp = false);
  1257. void AddHate(Entity* attacker, sint32 hate);
  1258. bool CheckInterruptSpell(Entity* attacker);
  1259. bool CheckFizzleSpell(LuaSpell* spell);
  1260. void KillSpawn(Spawn* dead, int8 type = 0, int8 damage_type = 0, int16 kill_blow_type = 0);
  1261. void HandleDeathExperienceDebt(Spawn* killer);
  1262. void SetAttackDelay(bool primary = false, bool ranged = false);
  1263. float CalculateAttackSpeedMod();
  1264. virtual void ProcessCombat();
  1265. bool EngagedInCombat();
  1266. virtual void InCombat(bool val);
  1267. bool IsCasting();
  1268. void IsCasting(bool val);
  1269. void SetMount(int16 mount_id, int8 red = 0xFF, int8 green = 0xFF, int8 blue = 0xFF, bool setUpdateFlags = true)
  1270. {
  1271. if (mount_id == 0) {
  1272. EQ2_Color color;
  1273. color.red = 0;
  1274. color.green = 0;
  1275. color.blue = 0;
  1276. SetMountColor(&color);
  1277. SetMountSaddleColor(&color);
  1278. }
  1279. else
  1280. {
  1281. EQ2_Color color;
  1282. color.red = red;
  1283. color.green = green;
  1284. color.blue = blue;
  1285. SetMountColor(&color);
  1286. SetMountSaddleColor(&color);
  1287. }
  1288. SetInfo(&features.mount_model_type, mount_id, setUpdateFlags);
  1289. }
  1290. void SetEquipment(Item* item, int8 slot = 255);
  1291. void SetEquipment(int8 slot, int16 type, int8 red, int8 green, int8 blue, int8 h_r, int8 h_g, int8 h_b){
  1292. std::lock_guard<std::mutex> lk(MEquipment);
  1293. if(slot >= NUM_SLOTS)
  1294. return;
  1295. SetInfo(&equipment.equip_id[slot], type);
  1296. SetInfo(&equipment.color[slot].red, red);
  1297. SetInfo(&equipment.color[slot].green, green);
  1298. SetInfo(&equipment.color[slot].blue, blue);
  1299. SetInfo(&equipment.highlight[slot].red, h_r);
  1300. SetInfo(&equipment.highlight[slot].green, h_g);
  1301. SetInfo(&equipment.highlight[slot].blue, h_b);
  1302. }
  1303. void SetHairType(int16 new_val, bool setUpdateFlags = true){
  1304. SetInfo(&features.hair_type, new_val, setUpdateFlags);
  1305. }
  1306. void SetHairColor1(EQ2_Color new_val, bool setUpdateFlags = true){
  1307. SetInfo(&features.hair_color1, new_val, setUpdateFlags);
  1308. }
  1309. void SetHairColor2(EQ2_Color new_val, bool setUpdateFlags = true){
  1310. SetInfo(&features.hair_color2, new_val, setUpdateFlags);
  1311. }
  1312. void SetSogaHairColor1(EQ2_Color new_val, bool setUpdateFlags = true){
  1313. SetInfo(&features.soga_hair_color1, new_val, setUpdateFlags);
  1314. }
  1315. void SetSogaHairColor2(EQ2_Color new_val, bool setUpdateFlags = true){
  1316. SetInfo(&features.soga_hair_color2, new_val, setUpdateFlags);
  1317. }
  1318. void SetHairHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1319. SetInfo(&features.hair_highlight_color, new_val, setUpdateFlags);
  1320. }
  1321. void SetSogaHairHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1322. SetInfo(&features.soga_hair_highlight_color, new_val, setUpdateFlags);
  1323. }
  1324. void SetHairColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1325. SetInfo(&features.hair_type_color, new_val, setUpdateFlags);
  1326. }
  1327. void SetSogaHairColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1328. SetInfo(&features.soga_hair_type_color, new_val, setUpdateFlags);
  1329. }
  1330. void SetHairTypeHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1331. SetInfo(&features.hair_type_highlight_color, new_val, setUpdateFlags);
  1332. }
  1333. void SetSogaHairTypeHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1334. SetInfo(&features.soga_hair_type_highlight_color, new_val, setUpdateFlags);
  1335. }
  1336. void SetFacialHairType(int16 new_val, bool setUpdateFlags = true){
  1337. SetInfo(&features.hair_face_type, new_val, setUpdateFlags);
  1338. }
  1339. void SetFacialHairColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1340. SetInfo(&features.hair_face_color, new_val, setUpdateFlags);
  1341. }
  1342. void SetSogaFacialHairColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1343. SetInfo(&features.soga_hair_face_color, new_val, setUpdateFlags);
  1344. }
  1345. void SetFacialHairHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1346. SetInfo(&features.hair_face_highlight_color, new_val, setUpdateFlags);
  1347. }
  1348. void SetSogaFacialHairHighlightColor(EQ2_Color new_val, bool setUpdateFlags = true){
  1349. SetInfo(&features.soga_hair_face_highlight_color, new_val, setUpdateFlags);
  1350. }
  1351. void SetWingType(int16 new_val, bool setUpdateFlags = true){
  1352. SetInfo(&features.wing_type, new_val, setUpdateFlags);
  1353. }
  1354. void SetWingColor1(EQ2_Color new_val, bool setUpdateFlags = true){
  1355. SetInfo(&features.wing_color1, new_val, setUpdateFlags);
  1356. }
  1357. void SetWingColor2(EQ2_Color new_val, bool setUpdateFlags = true){
  1358. SetInfo(&features.wing_color2, new_val, setUpdateFlags);
  1359. }
  1360. void SetChestType(int16 new_val, bool setUpdateFlags = true){
  1361. SetInfo(&features.chest_type, new_val, setUpdateFlags);
  1362. }
  1363. void SetLegsType(int16 new_val, bool setUpdateFlags = true){
  1364. SetInfo(&features.legs_type, new_val, setUpdateFlags);
  1365. }
  1366. void SetSogaHairType(int16 new_val, bool setUpdateFlags = true){
  1367. SetInfo(&features.soga_hair_type, new_val, setUpdateFlags);
  1368. }
  1369. void SetSogaFacialHairType(int16 new_val, bool setUpdateFlags = true){
  1370. SetInfo(&features.soga_hair_face_type, new_val, setUpdateFlags);
  1371. }
  1372. void SetSogaChestType(int16 new_val, bool setUpdateFlags = true){
  1373. SetInfo(&features.soga_chest_type, new_val, setUpdateFlags);
  1374. }
  1375. void SetSogaLegType(int16 new_val, bool setUpdateFlags = true){
  1376. SetInfo(&features.soga_legs_type, new_val, setUpdateFlags);
  1377. }
  1378. void SetSkinColor(EQ2_Color color){
  1379. SetInfo(&features.skin_color, color);
  1380. }
  1381. void SetSogaSkinColor(EQ2_Color color){
  1382. SetInfo(&features.soga_skin_color, color);
  1383. }
  1384. void SetModelColor(EQ2_Color color){
  1385. SetInfo(&features.model_color, color);
  1386. }
  1387. void SetSogaModelColor(EQ2_Color color){
  1388. SetInfo(&features.soga_model_color, color);
  1389. }
  1390. void SetCombatVoice(int16 val, bool setUpdateFlags = true) {
  1391. SetInfo(&features.combat_voice, val, setUpdateFlags);
  1392. }
  1393. void SetEmoteVoice(int16 val, bool setUpdateFlags = true) {
  1394. SetInfo(&features.emote_voice, val, setUpdateFlags);
  1395. }
  1396. int16 GetCombatVoice(){ return features.combat_voice; }
  1397. int16 GetEmoteVoice(){ return features.emote_voice; }
  1398. int16 GetMount(){ return features.mount_model_type; }
  1399. void SetMountSaddleColor(EQ2_Color* color){
  1400. SetInfo(&features.mount_saddle_color, *color);
  1401. }
  1402. void SetMountColor(EQ2_Color* color){
  1403. SetInfo(&features.mount_color, *color);
  1404. }
  1405. void SetEyeColor(EQ2_Color eye_color){
  1406. SetInfo(&features.eye_color, eye_color);
  1407. }
  1408. void SetSogaEyeColor(EQ2_Color eye_color){
  1409. SetInfo(&features.soga_eye_color, eye_color);
  1410. }
  1411. int16 GetHairType(){
  1412. return features.hair_type;
  1413. }
  1414. int16 GetFacialHairType(){
  1415. return features.hair_face_type;
  1416. }
  1417. int16 GetWingType(){
  1418. return features.wing_type;
  1419. }
  1420. int16 GetChestType(){
  1421. return features.chest_type;
  1422. }
  1423. int16 GetLegsType(){
  1424. return features.legs_type;
  1425. }
  1426. int16 GetSogaHairType(){
  1427. return features.soga_hair_type;
  1428. }
  1429. int16 GetSogaFacialHairType(){
  1430. return features.soga_hair_face_type;
  1431. }
  1432. int16 GetSogaChestType(){
  1433. return features.soga_chest_type;
  1434. }
  1435. int16 GetSogaLegType(){
  1436. return features.soga_legs_type;
  1437. }
  1438. EQ2_Color* GetSkinColor(){
  1439. return &features.skin_color;
  1440. }
  1441. EQ2_Color* GetModelColor(){
  1442. return &features.model_color;
  1443. }
  1444. EQ2_Color* GetSogaModelColor(){
  1445. return &features.soga_model_color;
  1446. }
  1447. EQ2_Color* GetEyeColor(){
  1448. return &features.eye_color;
  1449. }
  1450. EQ2_Color* GetMountSaddleColor(){
  1451. return &features.mount_saddle_color;
  1452. }
  1453. EQ2_Color* GetMountColor(){
  1454. return &features.mount_color;
  1455. }
  1456. // should only be accessed through MEquipment mutex
  1457. EQ2_Equipment equipment;
  1458. CharFeatures features;
  1459. void AddSpellBonus(LuaSpell* spell, int16 type, float value, int64 class_req =0, vector<int16> race_req = vector<int16>(), vector<int16> faction_req = vector<int16>());
  1460. BonusValues* GetSpellBonus(int32 spell_id);
  1461. vector<BonusValues*>* GetAllSpellBonuses(LuaSpell* spell);
  1462. bool CheckSpellBonusRemoval(LuaSpell* spell, int16 type);
  1463. void RemoveSpellBonus(const LuaSpell* spell, bool remove_all = false);
  1464. void RemoveAllSpellBonuses();
  1465. void CalculateSpellBonuses(ItemStatsValues* stats);
  1466. void AddMezSpell(LuaSpell* spell);
  1467. void RemoveMezSpell(LuaSpell* spell);
  1468. void RemoveAllMezSpells();
  1469. bool IsMezzed();
  1470. void AddStifleSpell(LuaSpell* spell);
  1471. void RemoveStifleSpell(LuaSpell* spell);
  1472. bool IsStifled();
  1473. void AddDazeSpell(LuaSpell* spell);
  1474. void RemoveDazeSpell(LuaSpell* spell);
  1475. bool IsDazed();
  1476. void AddStunSpell(LuaSpell* spell);
  1477. void RemoveStunSpell(LuaSpell* spell);
  1478. bool IsStunned();
  1479. bool IsMezzedOrStunned() {return IsMezzed() || IsStunned();}
  1480. void AddRootSpell(LuaSpell* spell);
  1481. void RemoveRootSpell(LuaSpell* spell);
  1482. bool IsRooted();
  1483. void AddFearSpell(LuaSpell* spell);
  1484. void RemoveFearSpell(LuaSpell* spell);
  1485. bool IsFeared();
  1486. void AddSnareSpell(LuaSpell* spell);
  1487. void RemoveSnareSpell(LuaSpell* spell);
  1488. void SetSnareValue(LuaSpell* spell, float snare_val);
  1489. bool IsSnared();
  1490. float GetHighestSnare();
  1491. bool HasControlEffect(int8 type);
  1492. void HaltMovement();
  1493. void SetCombatPet(Entity* pet) { this->pet = pet; }
  1494. void SetCharmedPet(Entity* pet) { charmedPet = pet; }
  1495. void SetDeityPet(Entity* pet) { deityPet = pet; }
  1496. void SetCosmeticPet(Entity* pet) { cosmeticPet = pet; }
  1497. Entity* GetPet() { return pet; }
  1498. Entity* GetCharmedPet() { return charmedPet; }
  1499. Entity* GetDeityPet() { return deityPet; }
  1500. Entity* GetCosmeticPet() { return cosmeticPet; }
  1501. /// <summary>Check to see if the entity has a combat pet</summary>
  1502. /// <returns>True if the entity has a combat pet</returns>
  1503. bool HasPet() { return (pet || charmedPet) ? true : false; }
  1504. void HideDeityPet(bool val);
  1505. void HideCosmeticPet(bool val);
  1506. void DismissPet(Entity* pet, bool from_death = false, bool spawnListLocked = false);
  1507. void DismissAllPets(bool from_death = false, bool spawnListLocked = false);
  1508. void SetOwner(Entity* owner) { if (owner) { this->owner = owner->GetID(); } else { owner = 0; } }
  1509. Entity* GetOwner();
  1510. int8 GetPetType() { return m_petType; }
  1511. void SetPetType(int8 val) { m_petType = val; }
  1512. void SetPetSpellID(int32 val) { m_petSpellID = val; }
  1513. int32 GetPetSpellID() { return m_petSpellID; }
  1514. void SetPetSpellTier(int8 val) { m_petSpellTier = val; }
  1515. int8 GetPetSpellTier() { return m_petSpellTier; }
  1516. bool IsDismissing() { return m_petDismissing; }
  1517. void SetDismissing(bool val) { m_petDismissing = val; }
  1518. /// <summary>Creates a loot chest to drop in the world</summary>
  1519. /// <returns>Pointer to the chest</returns>
  1520. NPC* DropChest();
  1521. /// <summary>Add a ward to the entities ward list</summary>
  1522. /// <param name='spellID'>Spell id of the ward to add</param>
  1523. /// <param name='ward'>WardInfo* of the ward we are adding</parma>
  1524. void AddWard(int32 spellID, WardInfo* ward);
  1525. /// <summary>Gets ward info for the given spell id</summary>
  1526. /// <param name='spellID'>The spell id of the ward we want to get</param>
  1527. /// <returns>WardInfo for the given spell id</returns>
  1528. WardInfo* GetWard(int32 spellID);
  1529. /// <summary>Removes the ward with the given spell id</summary>
  1530. /// <param name='spellID'>The spell id of the ward to remove</param>
  1531. void RemoveWard(int32 spellID);
  1532. /// <summary>Subtracts the given damage from the wards</summary>
  1533. /// <param name='damage'>The damage to subtract from the wards</param>
  1534. /// <returns>The amount of damage left after wards</returns>
  1535. int32 CheckWards(Entity* attacker, int32 damage, int8 damage_type);
  1536. map<int16, float> stats;
  1537. /// <summary>Adds a proc to the list of current procs</summary>
  1538. /// <param name='type'>The type of proc to add</param>
  1539. /// <param name='chance'>The percent chance the proc has to go off</param>
  1540. /// <param name='item'>The item the proc is coming from if any</param>
  1541. /// <param name='spell'>The spell the proc is coming from if any</param>
  1542. void AddProc(int8 type, float chance, Item* item = 0, LuaSpell* spell = 0);
  1543. /// <summary>Removes a proc from the list of current procs</summary>
  1544. /// <param name='item'>Item the proc is from</param>
  1545. /// <param name='spell'>Spell the proc is from</param>
  1546. void RemoveProc(Item* item = 0, LuaSpell* spell = 0);
  1547. /// <summary>Cycles through the proc list and executes them if they can go off</summary>
  1548. /// <param name='type'>The proc type to check</param>
  1549. /// <param name='target'>The target of the proc if it goes off</param>
  1550. void CheckProcs(int8 type, Spawn* target);
  1551. /// <summary>Clears the entire proc list</summary>
  1552. void ClearProcs();
  1553. float GetSpeed();
  1554. float GetAirSpeed();
  1555. float GetBaseSpeed() { return base_speed; }
  1556. void SetSpeed(float val, bool override_ = false) { if ((base_speed == 0.0f && val > 0.0f) || override_) base_speed = val; speed = val; }
  1557. void SetSpeedMultiplier(float val) { speed_multiplier = val; }
  1558. void SetThreatTransfer(ThreatTransfer* transfer);
  1559. ThreatTransfer* GetThreatTransfer() { return m_threatTransfer; }
  1560. int8 GetTraumaCount();
  1561. int8 GetArcaneCount();
  1562. int8 GetNoxiousCount();
  1563. int8 GetElementalCount();
  1564. int8 GetCurseCount();
  1565. int8 GetDetTypeCount(int8 det_type);
  1566. int8 GetDetCount();
  1567. bool HasCurableDetrimentType(int8 det_type);
  1568. Mutex* GetDetrimentMutex();
  1569. Mutex* GetMaintainedMutex();
  1570. Mutex* GetSpellEffectMutex();
  1571. void ClearAllDetriments();
  1572. void CureDetrimentByType(int8 cure_count, int8 det_type, string cure_name, Entity* caster, int8 cure_level = 0);
  1573. void CureDetrimentByControlEffect(int8 cure_count, int8 det_type, string cure_name, Entity* caster, int8 cure_level = 0);
  1574. vector<DetrimentalEffects>* GetDetrimentalSpellEffects();
  1575. void RemoveEffectsFromLuaSpell(LuaSpell* spell);
  1576. virtual void RemoveSkillBonus(int32 spell_id);
  1577. virtual bool CanSeeInvis(Entity* target);
  1578. void CancelAllStealth();
  1579. bool IsStealthed();
  1580. bool IsInvis();
  1581. void AddInvisSpell(LuaSpell* spell);
  1582. void AddStealthSpell(LuaSpell* spell);
  1583. void RemoveStealthSpell(LuaSpell* spell);
  1584. void RemoveInvisSpell(LuaSpell* spell);
  1585. void AddWaterwalkSpell(LuaSpell* spell);
  1586. void AddWaterjumpSpell(LuaSpell* spell);
  1587. void RemoveWaterwalkSpell(LuaSpell* spell);
  1588. void RemoveWaterjumpSpell(LuaSpell* spell);
  1589. void AddAOEImmunity(LuaSpell* spell);
  1590. bool IsAOEImmune();
  1591. void RemoveAOEImmunity(LuaSpell* spell);
  1592. void AddStunImmunity(LuaSpell* spell);
  1593. void RemoveStunImmunity(LuaSpell* spell);
  1594. bool IsStunImmune();
  1595. void AddStifleImmunity(LuaSpell* spell);
  1596. void RemoveStifleImmunity(LuaSpell* spell);
  1597. bool IsStifleImmune();
  1598. void AddMezImmunity(LuaSpell* spell);
  1599. void RemoveMezImmunity(LuaSpell* spell);
  1600. bool IsMezImmune();
  1601. void AddRootImmunity(LuaSpell* spell);
  1602. void RemoveRootImmunity(LuaSpell* spell);
  1603. bool IsRootImmune();
  1604. void AddFearImmunity(LuaSpell* spell);
  1605. void RemoveFearImmunity(LuaSpell* spell);
  1606. bool IsFearImmune();
  1607. void AddDazeImmunity(LuaSpell* spell);
  1608. void RemoveDazeImmunity(LuaSpell* spell);
  1609. bool IsDazeImmune();
  1610. void AddImmunity(LuaSpell* spell, int16 type);
  1611. void RemoveImmunity(LuaSpell* spell, int16 type);
  1612. bool IsImmune(int16 type);
  1613. void AddFlightSpell(LuaSpell* spell);
  1614. void RemoveFlightSpell(LuaSpell* spell);
  1615. void AddSafefallSpell(LuaSpell* spell);
  1616. void RemoveSafefallSpell(LuaSpell* spell);
  1617. void AddGlideSpell(LuaSpell* spell);
  1618. void RemoveGlideSpell(LuaSpell* spell);
  1619. GroupMemberInfo* GetGroupMemberInfo() { return group_member_info; }
  1620. void SetGroupMemberInfo(GroupMemberInfo* info) { group_member_info = info; }
  1621. void UpdateGroupMemberInfo(bool inGroupMgrLock=false, bool groupMembersLocked=false);
  1622. void CustomizeAppearance(PacketStruct* packet);
  1623. Trade* trade;
  1624. // Keep track of entities that hate this spawn.
  1625. set<int32> HatedBy;
  1626. std::mutex MHatedBy;
  1627. bool IsAggroed() {
  1628. int32 size = 0;
  1629. MHatedBy.lock();
  1630. size = HatedBy.size();
  1631. MHatedBy.unlock();
  1632. return size > 0;
  1633. }
  1634. Mutex MCommandMutex;
  1635. bool HasSeeInvisSpell() { return hasSeeInvisSpell; }
  1636. void SetSeeInvisSpell(bool val) { hasSeeInvisSpell = val; }
  1637. bool HasSeeHideSpell() { return hasSeeHideSpell; }
  1638. void SetSeeHideSpell(bool val) { hasSeeHideSpell = val; }
  1639. void SetInfoStruct(InfoStruct* struct_) { info_struct.SetInfoStruct(struct_); }
  1640. std::string GetInfoStructString(std::string field);
  1641. int8 GetInfoStructInt8(std::string field);
  1642. int16 GetInfoStructInt16(std::string field);
  1643. int32 GetInfoStructInt32(std::string field);
  1644. int64 GetInfoStructInt64(std::string field);
  1645. sint8 GetInfoStructSInt8(std::string field);
  1646. sint16 GetInfoStructSInt16(std::string field);
  1647. sint32 GetInfoStructSInt32(std::string field);
  1648. sint64 GetInfoStructSInt64(std::string field);
  1649. int64 GetInfoStructUInt(std::string field);
  1650. sint64 GetInfoStructSInt(std::string field);
  1651. float GetInfoStructFloat(std::string field);
  1652. bool SetInfoStructString(std::string field, std::string value);
  1653. bool SetInfoStructUInt(std::string field, int64 value);
  1654. bool SetInfoStructSInt(std::string field, sint64 value);
  1655. bool SetInfoStructFloat(std::string field, float value);
  1656. sint32 CalculateHateAmount(Spawn* target, sint32 amt);
  1657. sint32 CalculateHealAmount(Spawn* target, sint32 amt, int8 crit_mod, bool* crit, bool skip_crit_mod = false);
  1658. sint32 CalculateDamageAmount(Spawn* target, sint32 damage, int8 base_type, int8 damage_type, LuaSpell* spell);
  1659. sint32 CalculateDamageAmount(Spawn* target, sint32 damage, int8 base_type, int8 damage_type, int8 spell_target_type);
  1660. sint32 CalculateFormulaByStat(sint32 value, int16 stat);
  1661. int32 CalculateFormulaByStat(int32 value, int16 stat);
  1662. int32 CalculateFormulaBonus(int32 value, float percent_bonus);
  1663. float GetStat(int32 item_stat) {
  1664. float item_chance_or_skill = 0.0f;
  1665. MStats.lock();
  1666. item_chance_or_skill = stats[item_stat];
  1667. MStats.unlock();
  1668. return item_chance_or_skill;
  1669. }
  1670. bool IsEngagedInEncounter(Spawn** res = nullptr);
  1671. bool IsEngagedBySpawnID(int32 id);
  1672. // when PacketStruct is fixed for C++17 this should become a shared_mutex and handle read/write lock
  1673. std::mutex MEquipment;
  1674. std::mutex MStats;
  1675. Mutex MMaintainedSpells;
  1676. Mutex MSpellEffects;
  1677. protected:
  1678. bool in_combat;
  1679. int8 m_petType;
  1680. int32 owner;
  1681. // m_petSpellID holds the spell id used to create/control this pet
  1682. int32 m_petSpellID;
  1683. int8 m_petSpellTier;
  1684. bool m_petDismissing;
  1685. private:
  1686. MutexList<BonusValues*> bonus_list;
  1687. map<int8, MutexList<LuaSpell*>*> control_effects;
  1688. map<int8, MutexList<LuaSpell*>*> immunities;
  1689. float max_speed;
  1690. int8 deity;
  1691. sint16 regen_hp_rate;
  1692. sint16 regen_power_rate;
  1693. float last_x;
  1694. float last_y;
  1695. float last_z;
  1696. float last_heading;
  1697. bool casting;
  1698. InfoStruct info_struct;
  1699. map<int8, int8> det_count_list;
  1700. Mutex MDetriments;
  1701. vector<DetrimentalEffects> detrimental_spell_effects;
  1702. // Pointers for the 4 types of pets (Summon, Charm, Deity, Cosmetic)
  1703. Entity* pet;
  1704. Entity* charmedPet;
  1705. Entity* deityPet;
  1706. Entity* cosmeticPet;
  1707. // int32 = spell id, WardInfo* = pointer to ward info
  1708. map<int32, WardInfo*> m_wardList;
  1709. // int8 = type, vector<Proc*> = list of pointers to proc info
  1710. map <int8, vector<Proc*> > m_procList;
  1711. Mutex MProcList;
  1712. /// <summary>Actually calls the lua script to cast the proc</summary>
  1713. /// <param name='proc'>Proc to be cast</param>
  1714. /// <param name='type'>Type of proc going off</type>
  1715. /// <param name='target'>Target of the proc</param>
  1716. bool CastProc(Proc* proc, int8 type, Spawn* target);
  1717. float base_speed;
  1718. float speed;
  1719. float speed_multiplier;
  1720. map<LuaSpell*, float> snare_values;
  1721. ThreatTransfer* m_threatTransfer;
  1722. GroupMemberInfo* group_member_info;
  1723. bool hasSeeInvisSpell;
  1724. bool hasSeeHideSpell;
  1725. // GETs
  1726. map<string, boost::function<float()> > get_float_funcs;
  1727. map<string, boost::function<int64()> > get_int64_funcs;
  1728. map<string, boost::function<int32()> > get_int32_funcs;
  1729. map<string, boost::function<int16()> > get_int16_funcs;
  1730. map<string, boost::function<int8()> > get_int8_funcs;
  1731. map<string, boost::function<sint64()> > get_sint64_funcs;
  1732. map<string, boost::function<sint32()> > get_sint32_funcs;
  1733. map<string, boost::function<sint16()> > get_sint16_funcs;
  1734. map<string, boost::function<sint8()> > get_sint8_funcs;
  1735. map<string, boost::function<std::string()> > get_string_funcs;
  1736. // SETs
  1737. map<string, boost::function<void(float)> > set_float_funcs;
  1738. map<string, boost::function<void(int64)> > set_int64_funcs;
  1739. map<string, boost::function<void(int32)> > set_int32_funcs;
  1740. map<string, boost::function<void(int16)> > set_int16_funcs;
  1741. map<string, boost::function<void(int8)> > set_int8_funcs;
  1742. map<string, boost::function<void(sint64)> > set_sint64_funcs;
  1743. map<string, boost::function<void(sint32)> > set_sint32_funcs;
  1744. map<string, boost::function<void(sint16)> > set_sint16_funcs;
  1745. map<string, boost::function<void(sint8)> > set_sint8_funcs;
  1746. map<string, boost::function<void(std::string)> > set_string_funcs;
  1747. };
  1748. #endif