Entity.h 78 KB

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