9
3

Spawn.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  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_SPAWN__
  17. #define __EQ2_SPAWN__
  18. #include "../common/types.h"
  19. #include "../common/EQPacket.h"
  20. #include "../common/EQ2_Common_Structs.h"
  21. #include "../common/MiscFunctions.h"
  22. #include "../common/opcodemgr.h"
  23. #include "../common/timer.h"
  24. #include "Commands/Commands.h"
  25. #include "Zone/position.h"
  26. #include "SpawnLists.h"
  27. #include <vector>
  28. #include "../common/ConfigReader.h"
  29. #include "Items/Items.h"
  30. #include "Zone/map.h"
  31. #include "../common/Mutex.h"
  32. #include <deque>
  33. #include <memory> // needed for LS to compile properly on linux
  34. #define DAMAGE_PACKET_TYPE_SIPHON_SPELL 0x41
  35. #define DAMAGE_PACKET_TYPE_SIPHON_SPELL2 0x49
  36. #define DAMAGE_PACKET_TYPE_MULTIPLE_DAMAGE 0x80
  37. #define DAMAGE_PACKET_TYPE_SIMPLE_DAMAGE 0xC0
  38. #define DAMAGE_PACKET_TYPE_SPELL_DAMAGE 0xC1
  39. #define DAMAGE_PACKET_TYPE_SIMPLE_CRIT_DMG 0xC4
  40. #define DAMAGE_PACKET_TYPE_SPELL_CRIT_DMG 0xC5
  41. #define DAMAGE_PACKET_TYPE_SPELL_DAMAGE2 0xC8
  42. #define DAMAGE_PACKET_TYPE_SPELL_DAMAGE3 0xC9
  43. #define DAMAGE_PACKET_TYPE_RANGE_DAMAGE 0xE2
  44. #define DAMAGE_PACKET_TYPE_RANGE_SPELL_DMG 0xE3
  45. #define DAMAGE_PACKET_TYPE_RANGE_SPELL_DMG2 0xEA
  46. #define DAMAGE_PACKET_RESULT_NO_DAMAGE 0
  47. #define DAMAGE_PACKET_RESULT_SUCCESSFUL 1
  48. #define DAMAGE_PACKET_RESULT_MISS 4
  49. #define DAMAGE_PACKET_RESULT_DODGE 8
  50. #define DAMAGE_PACKET_RESULT_PARRY 12
  51. #define DAMAGE_PACKET_RESULT_RIPOSTE 16
  52. #define DAMAGE_PACKET_RESULT_BLOCK 20
  53. #define DAMAGE_PACKET_RESULT_DEATH_BLOW 24
  54. #define DAMAGE_PACKET_RESULT_INVULNERABLE 28
  55. #define DAMAGE_PACKET_RESULT_RESIST 36
  56. #define DAMAGE_PACKET_RESULT_REFLECT 40
  57. #define DAMAGE_PACKET_RESULT_IMMUNE 44
  58. #define DAMAGE_PACKET_RESULT_DEFLECT 48
  59. #define DAMAGE_PACKET_RESULT_COUNTER 52
  60. #define DAMAGE_PACKET_RESULT_COUNTER_STRIKE 60
  61. #define DAMAGE_PACKET_RESULT_BASH 64
  62. #define DAMAGE_PACKET_DAMAGE_TYPE_SLASH 0
  63. #define DAMAGE_PACKET_DAMAGE_TYPE_CRUSH 1
  64. #define DAMAGE_PACKET_DAMAGE_TYPE_PIERCE 2
  65. #define DAMAGE_PACKET_DAMAGE_TYPE_HEAT 3
  66. #define DAMAGE_PACKET_DAMAGE_TYPE_COLD 4
  67. #define DAMAGE_PACKET_DAMAGE_TYPE_MAGIC 5
  68. #define DAMAGE_PACKET_DAMAGE_TYPE_MENTAL 6
  69. #define DAMAGE_PACKET_DAMAGE_TYPE_DIVINE 7
  70. #define DAMAGE_PACKET_DAMAGE_TYPE_DISEASE 8
  71. #define DAMAGE_PACKET_DAMAGE_TYPE_POISON 9
  72. #define DAMAGE_PACKET_DAMAGE_TYPE_DROWN 10
  73. #define DAMAGE_PACKET_DAMAGE_TYPE_FALLING 11
  74. #define DAMAGE_PACKET_DAMAGE_TYPE_PAIN 12
  75. #define HEAL_PACKET_TYPE_SIMPLE_HEAL 0
  76. #define HEAL_PACKET_TYPE_CRIT_HEAL 1
  77. #define HEAL_PACKET_TYPE_ABSORB 2
  78. #define HEAL_PACKET_TYPE_REGEN_ABSORB 4
  79. #define HEAL_PACKET_TYPE_SIMPLE_MANA 8
  80. #define HEAL_PACKET_TYPE_CRIT_MANA 9
  81. #define HEAL_PACKET_TYPE_SAVAGERY 16
  82. #define HEAL_PACKET_TYPE_CRIT_SAVAGERY 17
  83. #define HEAL_PACKET_TYPE_REPAIR 64
  84. #define HEAL_PACKET_TYPE_CRIT_REPAIR 65
  85. #define ARROW_COLOR_GRAY 0 // 3
  86. #define ARROW_COLOR_GREEN 1 // 1
  87. #define ARROW_COLOR_BLUE 2
  88. #define ARROW_COLOR_WHITE 3 // 3
  89. #define ARROW_COLOR_YELLOW 4 // 4
  90. #define ARROW_COLOR_ORANGE 5 // 5
  91. #define ARROW_COLOR_RED 6
  92. #define ACTIVITY_STATUS_ROLEPLAYING 1
  93. #define ACTIVITY_STATUS_ANONYMOUS 2
  94. #define ACTIVITY_STATUS_LINKDEAD 4
  95. #define ACTIVITY_STATUS_CAMPING 8
  96. #define ACTIVITY_STATUS_LFG 16
  97. #define ACTIVITY_STATUS_LFW 32
  98. #define ACTIVITY_STATUS_SOLID 64 //used by zone objects to remain solid
  99. #define ACTIVITY_STATUS_IMMUNITY_GAINED 8192
  100. #define ACTIVITY_STATUS_IMMUNITY_REMAINING 16384
  101. #define ACTIVITY_STATUS_MERCENARY_1188 1<<2
  102. #define ACTIVITY_STATUS_STATICOBJECT_1188 1<<3
  103. #define ACTIVITY_STATUS_MERCHANT_1188 1<<4
  104. #define ACTIVITY_STATUS_HIDEICON_1188 1<<9
  105. #define ACTIVITY_STATUS_INTERACTABLE_1188 1<<10
  106. #define ACTIVITY_STATUS_NOTARGET_1188 1<<11
  107. #define ACTIVITY_STATUS_ISTRANSPORT_1188 1<<12
  108. #define ACTIVITY_STATUS_SHOWHOUSEICON_1188 1<<13
  109. #define ACTIVITY_STATUS_LOOTABLE_1188 1<<14
  110. #define ACTIVITY_STATUS_INCOMBAT_1188 1<<15
  111. #define ACTIVITY_STATUS_AFK_1188 1<<16
  112. #define ACTIVITY_STATUS_ROLEPLAYING_1188 1<<17
  113. #define ACTIVITY_STATUS_ANONYMOUS_1188 1<<18
  114. #define ACTIVITY_STATUS_LINKDEAD_1188 1<<19
  115. #define ACTIVITY_STATUS_CAMPING_1188 1<<20
  116. #define ACTIVITY_STATUS_LFG_1188 1<<21
  117. #define ACTIVITY_STATUS_LFW_1188 1<<22
  118. #define ACTIVITY_STATUS_SOLID_1188 1<<23 //used by zone objects to remain solid
  119. #define ACTIVITY_STATUS_MENTORING_1188 1<<28
  120. #define ACTIVITY_STATUS_IMMUNITY_GAINED_1188 1<<30
  121. #define ACTIVITY_STATUS_IMMUNITY_REMAINING_1188 1<<31
  122. #define POS_STATE_KNEELING 64
  123. #define POS_STATE_SOLID 128 //used by most mobs to remaind solid (cant walk through them)
  124. #define POS_STATE_NOTARGET_CURSOR 256 //cant target and no cursor is displayed
  125. #define POS_STATE_CROUCHING 512
  126. #define MERCHANT_TYPE_NO_BUY 1
  127. #define MERCHANT_TYPE_NO_BUY_BACK 2
  128. #define MERCHANT_TYPE_SPELLS 4
  129. #define MERCHANT_TYPE_CRAFTING 8
  130. #define MERCHANT_TYPE_REPAIR 16
  131. #define MERCHANT_TYPE_LOTTO 32
  132. #define INFO_VIS_FLAG_INVIS 1
  133. #define INFO_VIS_FLAG_HIDE_HOOD 2
  134. #define INFO_VIS_FLAG_MOUNTED 4
  135. #define INFO_VIS_FLAG_CROUCH 8
  136. using namespace std;
  137. class Spell;
  138. class ZoneServer;
  139. class Quest;
  140. struct LUAHistory;
  141. struct Cell;
  142. struct CellInfo {
  143. Cell* CurrentCell;
  144. int CellListIndex;
  145. };
  146. struct MovementData{
  147. float x;
  148. float y;
  149. float z;
  150. float speed;
  151. int32 delay;
  152. string lua_function;
  153. };
  154. struct BasicInfoStruct{
  155. sint32 cur_hp;
  156. sint32 max_hp;
  157. sint32 hp_base;
  158. sint32 cur_power;
  159. sint32 max_power;
  160. sint32 power_base;
  161. sint32 cur_savagery;
  162. sint32 max_savagery;
  163. sint32 savagery_base;
  164. sint32 cur_dissonance;
  165. sint32 max_dissonance;
  166. sint32 dissonance_base;
  167. sint16 assigned_aa;
  168. sint16 unassigned_aa;
  169. sint16 tradeskill_aa;
  170. sint16 unassigned_tradeskill_aa;
  171. sint16 prestige_aa;
  172. sint16 unassigned_prestige_aa;
  173. sint16 tradeskill_prestige_aa;
  174. sint16 unassigned_tradeskill_prestige_aa;
  175. };
  176. struct MovementLocation{
  177. float x;
  178. float y;
  179. float z;
  180. float speed;
  181. //int32 start_time;
  182. //int32 end_time;
  183. bool attackable;
  184. string lua_function;
  185. bool mapped;
  186. int32 gridid;
  187. };
  188. struct SpawnUpdate {
  189. int32 spawn_id;
  190. bool info_changed;
  191. bool vis_changed;
  192. bool pos_changed;
  193. shared_ptr<Client> client;
  194. };
  195. struct SpawnData {
  196. Spawn* spawn;
  197. uchar* data;
  198. int32 size;
  199. };
  200. class Spawn {
  201. public:
  202. Spawn();
  203. virtual ~Spawn();
  204. template <class Field, class Value> void Set(Field* field, Value value, bool setUpdateFlags = true){
  205. if (setUpdateFlags) {
  206. changed = true;
  207. AddChangedZoneSpawn();
  208. }
  209. *field = value;
  210. }
  211. template <class Field> void Set(Field* field, const char* value, bool setUpdateFlags = true){
  212. if (setUpdateFlags) {
  213. changed = true;
  214. AddChangedZoneSpawn();
  215. }
  216. strcpy(field, value);
  217. }
  218. template <class Field, class Value> void SetPos(Field* field, Value value, bool setUpdateFlags = true){
  219. if(setUpdateFlags){
  220. position_changed = true;
  221. }
  222. Set(field, value, setUpdateFlags);
  223. }
  224. template <class Field, class Value> void SetInfo(Field* field, Value value, bool setUpdateFlags = true){
  225. if(setUpdateFlags){
  226. info_changed = true;
  227. }
  228. Set(field, value);
  229. }
  230. template <class Field, class Value> void SetVis(Field* field, Value value, bool setUpdateFlags = true){
  231. if(setUpdateFlags)
  232. vis_changed = true;
  233. Set(field, value);
  234. }
  235. template <class Field> void SetPos(Field* field, char* value, bool setUpdateFlags = true){
  236. if(setUpdateFlags){
  237. position_changed = true;
  238. }
  239. Set(field, value, setUpdateFlags);
  240. }
  241. template <class Field> void SetInfo(Field* field, char* value, bool setUpdateFlags = true){
  242. if(setUpdateFlags){
  243. info_changed = true;
  244. }
  245. Set(field, value);
  246. }
  247. EntityCommand* CreateEntityCommand(EntityCommand* old_command){
  248. EntityCommand* entity_command = new EntityCommand;
  249. entity_command->name = old_command->name;
  250. entity_command->distance = old_command->distance;
  251. entity_command->command = old_command->command;
  252. entity_command->error_text = old_command->error_text;
  253. entity_command->cast_time = old_command->cast_time;
  254. entity_command->spell_visual = old_command->spell_visual;
  255. return entity_command;
  256. }
  257. EntityCommand* CreateEntityCommand(const char* name, float distance, const char* command, const char* error_text, int16 cast_time, int32 spell_visual){
  258. EntityCommand* entity_command = new EntityCommand;
  259. entity_command->name = name;
  260. entity_command->distance = distance;
  261. entity_command->command = command;
  262. entity_command->error_text = error_text;
  263. entity_command->cast_time = cast_time;
  264. entity_command->spell_visual = spell_visual;
  265. return entity_command;
  266. }
  267. void AddChangedZoneSpawn();
  268. void AddPrimaryEntityCommand(const char* name, float distance, const char* command, const char* error_text, int16 cast_time, int32 spell_visual){
  269. primary_command_list.push_back(CreateEntityCommand(name, distance, command, error_text, cast_time, spell_visual));
  270. }
  271. void AddSecondaryEntityCommand(const char* name, float distance, const char* command, const char* error_text, int16 cast_time, int32 spell_visual){
  272. secondary_command_list.push_back(CreateEntityCommand(name, distance, command, error_text, cast_time, spell_visual));
  273. }
  274. int8 GetLockedNoLoot(){
  275. return appearance.locked_no_loot;
  276. }
  277. int16 GetEmoteState(){
  278. return appearance.emote_state;
  279. }
  280. int8 GetHideHood(){
  281. return appearance.hide_hood;
  282. }
  283. void SetLockedNoLoot(int8 new_val, bool updateFlags = true){
  284. SetVis(&appearance.locked_no_loot, new_val, updateFlags);
  285. }
  286. void SetHandFlag(int8 new_val, bool updateFlags = true){
  287. SetVis(&appearance.display_hand_icon, new_val, updateFlags);
  288. }
  289. void SetHideHood(int8 new_val, bool updateFlags = true){
  290. SetInfo(&appearance.hide_hood, new_val, updateFlags);
  291. }
  292. void SetEmoteState(int8 new_val, bool updateFlags = true){
  293. SetInfo(&appearance.emote_state, new_val, updateFlags);
  294. }
  295. void SetName(const char* new_name, bool updateFlags = true){
  296. SetInfo(appearance.name, new_name, updateFlags);
  297. }
  298. void SetPrefixTitle(const char* new_prefix_title, bool updateFlags = true) {
  299. SetInfo(appearance.prefix_title, new_prefix_title, updateFlags);
  300. }
  301. void SetSuffixTitle(const char* new_suffix_title, bool updateFlags = true) {
  302. SetInfo(appearance.suffix_title, new_suffix_title, updateFlags);
  303. }
  304. void SetSubTitle(const char* new_sub_title, bool updateFlags = true) {
  305. SetInfo(appearance.sub_title, new_sub_title, updateFlags);
  306. }
  307. void SetLastName(const char* new_last_name, bool updateFlags = true) {
  308. SetInfo(appearance.last_name, new_last_name, updateFlags);
  309. }
  310. void SetAdventureClass(int8 new_class, bool updateFlags = true) {
  311. SetInfo(&appearance.adventure_class, new_class, updateFlags);
  312. }
  313. void SetTradeskillClass(int8 new_class, bool updateFlags = true) {
  314. SetInfo(&appearance.tradeskill_class, new_class, updateFlags);
  315. }
  316. void SetSize(int16 new_size, bool updateFlags = true) {
  317. SetPos(&size, new_size, updateFlags);
  318. }
  319. void SetSpeedX(float speed_x, bool updateFlags = true) {
  320. SetPos(&appearance.pos.SpeedX, speed_x, updateFlags);
  321. }
  322. void SetSpeedY(float speed_y, bool updateFlags = true) {
  323. SetPos(&appearance.pos.SpeedY, speed_y, updateFlags);
  324. }
  325. void SetSpeedZ(float speed_z, bool updateFlags = true) {
  326. SetPos(&appearance.pos.SpeedZ, speed_z, updateFlags);
  327. }
  328. void SetX(float x, bool updateFlags = true){
  329. SetPos(&appearance.pos.X, x, updateFlags);
  330. }
  331. void SetY(float y, bool updateFlags = true, bool disableYMapFix = false);
  332. void SetZ(float z, bool updateFlags = true){
  333. SetPos(&appearance.pos.Z, z, updateFlags);
  334. }
  335. void SetHeading(sint16 dir1, sint16 dir2, bool updateFlags = true){
  336. SetPos(&appearance.pos.Dir1, dir1, updateFlags);
  337. SetPos(&appearance.pos.Dir2, dir2, updateFlags);
  338. }
  339. void SetHeading(float heading, bool updateFlags = true){
  340. last_heading_angle = heading;
  341. if (heading != 180)
  342. heading = (heading - 180) * 64;
  343. SetHeading((sint16)heading, (sint16)heading, updateFlags);
  344. }
  345. void SetPitch(sint16 pitch1, sint16 pitch2, bool updateFlags = true){
  346. SetPos(&appearance.pos.Pitch1, (sint16)pitch1, updateFlags);
  347. SetPos(&appearance.pos.Pitch2, (sint16)pitch2, updateFlags);
  348. }
  349. void SetPitch(float pitch, bool updateFlags = true){
  350. if (pitch == 0){
  351. SetPos(&appearance.pos.Pitch1, (sint16)0, updateFlags);
  352. SetPos(&appearance.pos.Pitch2, (sint16)0, updateFlags);
  353. return;
  354. }
  355. if (pitch != 180)
  356. pitch = (pitch - 180) * 64;
  357. SetPos(&appearance.pos.Pitch1, (sint16)pitch, updateFlags);
  358. SetPos(&appearance.pos.Pitch2, (sint16)pitch, updateFlags);
  359. }
  360. void SetRoll(float roll, bool updateFlags = true){
  361. if (roll == 0){
  362. SetPos(&appearance.pos.Roll, (sint16)0, updateFlags);
  363. return;
  364. }
  365. else if (roll != 180)
  366. roll = (roll - 180) * 64;
  367. SetPos(&appearance.pos.Roll, (sint16)roll, updateFlags);
  368. }
  369. void SetVisualState(int16 state, bool updateFlags = true){
  370. SetInfo(&appearance.visual_state, state, updateFlags);
  371. }
  372. void SetActionState(int16 state, bool updateFlags = true){
  373. SetInfo(&appearance.action_state, state, updateFlags);
  374. }
  375. void SetMoodState(int16 state, bool updateFlags = true){
  376. SetInfo(&appearance.mood_state, state, updateFlags);
  377. }
  378. void SetInitialState(int16 state, bool updateFlags = true){
  379. SetPos(&appearance.pos.state, state, updateFlags);
  380. }
  381. void SetActivityStatus(int16 state, bool updateFlags = true){
  382. SetInfo(&appearance.activity_status, state, updateFlags);
  383. }
  384. void SetCollisionRadius(int32 radius, bool updateFlags = true){
  385. SetPos(&appearance.pos.collision_radius, radius, updateFlags);
  386. }
  387. int16 GetCollisionRadius(){
  388. return appearance.pos.collision_radius;
  389. }
  390. int16 GetVisualState(){
  391. return appearance.visual_state;
  392. }
  393. int16 GetActionState(){
  394. return appearance.action_state;
  395. }
  396. int16 GetMoodState(){
  397. return appearance.mood_state;
  398. }
  399. int16 GetInitialState(){
  400. return appearance.pos.state;
  401. }
  402. int16 GetActivityStatus(){
  403. return appearance.activity_status;
  404. }
  405. int32 GetPrimaryCommandListID(){
  406. return primary_command_list_id;
  407. }
  408. int32 GetSecondaryCommandListID(){
  409. return secondary_command_list_id;
  410. }
  411. void SetID(int32 in_id){
  412. Set(&id, in_id);
  413. }
  414. void SetEncounterLevel(int8 enc_level, bool setUpdateFlags = true){
  415. SetInfo(&appearance.encounter_level, enc_level, setUpdateFlags);
  416. }
  417. void SetLevel(int16 level, bool setUpdateFlags = true){
  418. SetInfo(&appearance.level, level, setUpdateFlags);
  419. }
  420. void SetTSLevel(int16 tradeskill_level, bool setUpdateFlags = true){
  421. SetInfo(&appearance.tradeskill_level, tradeskill_level, setUpdateFlags);
  422. }
  423. void SetGender(int8 gender, bool setUpdateFlags = true){
  424. SetInfo(&appearance.gender, gender, setUpdateFlags);
  425. }
  426. void SetShowName(int8 new_val, bool setUpdateFlags = true){
  427. SetVis(&appearance.display_name, new_val, setUpdateFlags);
  428. }
  429. void SetShowLevel(int8 new_val, bool setUpdateFlags = true){
  430. SetVis(&appearance.show_level, new_val, setUpdateFlags);
  431. }
  432. void SetHeroic(int8 new_val, bool setUpdateFlags = true){
  433. SetInfo(&appearance.heroic_flag, new_val, setUpdateFlags);
  434. }
  435. void SetTargetable(int8 new_val, bool setUpdateFlags = true){
  436. SetVis(&appearance.targetable, new_val, setUpdateFlags);
  437. }
  438. void SetShowCommandIcon(int8 new_val, bool setUpdateFlags = true){
  439. SetVis(&appearance.show_command_icon, new_val, setUpdateFlags);
  440. }
  441. void SetShowHandIcon(int8 new_val, bool setUpdateFlags = true){
  442. SetVis(&appearance.display_hand_icon, new_val, setUpdateFlags);
  443. }
  444. void SetAttackable(int8 new_val, bool setUpdateFlags = true){
  445. SetInfo(&appearance.attackable, new_val, setUpdateFlags);
  446. }
  447. void SetLocation(int32 id, bool setUpdateFlags = true){
  448. SetPos(&appearance.pos.grid_id, id, setUpdateFlags);
  449. }
  450. void SetRace(int8 race, bool setUpdateFlags = true){
  451. SetInfo(&appearance.race, race, setUpdateFlags);
  452. }
  453. void SetIcon(int8 icon, bool setUpdateFlags = true){
  454. SetInfo(&appearance.icon, icon, setUpdateFlags);
  455. }
  456. void AddIconValue(int8 val){
  457. if(!(appearance.icon & val))
  458. SetIcon(appearance.icon+val);
  459. }
  460. void RemoveIconValue(int8 val){
  461. if((appearance.icon & val))
  462. SetIcon(appearance.icon-val);
  463. }
  464. int8 GetIconValue(){
  465. return appearance.icon;
  466. }
  467. virtual void SetSpeed(float speed){
  468. SetPos(&appearance.pos.Speed1, (int8)speed);
  469. }
  470. virtual float GetSpeed(){
  471. return (float)appearance.pos.Speed1;
  472. }
  473. virtual float GetBaseSpeed(){
  474. return (float)appearance.pos.Speed1;
  475. }
  476. void SetSpawnType(int8 new_type){
  477. SetInfo(&spawn_type, new_type);
  478. }
  479. int8 GetSpawnType(){
  480. return spawn_type;
  481. }
  482. void SetDatabaseID(int32 new_id){
  483. database_id = new_id;
  484. }
  485. int32 GetDatabaseID(){
  486. return database_id;
  487. }
  488. int8 GetShowHandIcon(){
  489. return appearance.display_hand_icon;
  490. }
  491. int32 GetLocation(){
  492. return appearance.pos.grid_id;
  493. }
  494. int8 GetAttackable(){
  495. return appearance.attackable;
  496. }
  497. int8 GetShowName(){
  498. return appearance.display_name;
  499. }
  500. int8 GetShowLevel(){
  501. return appearance.show_level;
  502. }
  503. int8 GetHeroic(){
  504. return appearance.heroic_flag;
  505. }
  506. int8 GetTargetable(){
  507. return appearance.targetable;
  508. }
  509. int8 GetShowCommandIcon(){
  510. return appearance.show_command_icon;
  511. }
  512. char* GetName(){
  513. return appearance.name;
  514. }
  515. char* GetPrefixTitle(){
  516. return appearance.prefix_title;
  517. }
  518. char* GetSuffixTitle(){
  519. return appearance.suffix_title;
  520. }
  521. char* GetSubTitle() {
  522. return appearance.sub_title;
  523. }
  524. char* GetLastName() {
  525. return appearance.last_name;
  526. }
  527. int8 GetAdventureClass() {
  528. return appearance.adventure_class;
  529. }
  530. int8 GetTradeskillClass() {
  531. return appearance.tradeskill_class;
  532. }
  533. float GetDestinationX(){
  534. return appearance.pos.X2;
  535. }
  536. float GetX() {
  537. return appearance.pos.X;
  538. }
  539. float GetSpeedX() {
  540. return appearance.pos.SpeedX;
  541. }
  542. float GetSpeedY() {
  543. return appearance.pos.SpeedY;
  544. }
  545. float GetSpeedZ() {
  546. return appearance.pos.SpeedZ;
  547. }
  548. float GetDestinationY(){
  549. return appearance.pos.Y2;
  550. }
  551. float GetY(){
  552. return appearance.pos.Y;
  553. }
  554. float GetDestinationZ(){
  555. return appearance.pos.Z2;
  556. }
  557. float GetZ(){
  558. return appearance.pos.Z;
  559. }
  560. float GetHeading(){
  561. float heading = 0;
  562. if(appearance.pos.Dir1 != 0){
  563. heading = ((float)appearance.pos.Dir1)/((float)64);
  564. if(heading >= 180)
  565. heading -= 180;
  566. else
  567. heading += 180;
  568. }
  569. return heading;
  570. }
  571. float GetPitch(){
  572. float pitch = 0;
  573. if(appearance.pos.Pitch1 != 0){
  574. pitch = ((float)appearance.pos.Pitch1)/((float)64);
  575. if(pitch >= 180)
  576. pitch -= 180;
  577. else
  578. pitch += 180;
  579. }
  580. return pitch;
  581. }
  582. float GetRoll(){
  583. float roll = 0;
  584. if(appearance.pos.Roll != 0){
  585. roll = ((float)appearance.pos.Roll)/((float)64);
  586. if(roll >= 180)
  587. roll -= 180;
  588. else
  589. roll += 180;
  590. }
  591. return roll;
  592. }
  593. int32 GetID(){
  594. return id;
  595. }
  596. float GetDistance(float x1, float y1, float z1, float x2, float y2, float z2);
  597. float GetDistance(float x, float y, float z, float radius, bool ignore_y = false);
  598. float GetDistance(float x, float y, float z, bool ignore_y = false);
  599. float GetDistance(Spawn* spawn, bool ignore_y = false, bool includeRadius=true);
  600. float GetDistance(Spawn* spawn, float x1, float y1, float z1, bool includeRadius=true);
  601. float CalculateRadius(Spawn* target);
  602. int8 GetEncounterLevel(){
  603. return appearance.encounter_level;
  604. }
  605. sint32 GetTotalPower();
  606. sint32 GetPower();
  607. sint32 GetTotalHP();
  608. sint32 GetHP();
  609. sint32 GetTotalHPBase();
  610. sint32 GetTotalPowerBase();
  611. sint32 GetTotalSavagery();
  612. sint32 GetSavagery();
  613. sint32 GetTotalDissonance();
  614. sint32 GetDissonance();
  615. sint32 GetTotalSavageryBase();
  616. sint32 GetTotalDissonanceBase();
  617. sint16 GetAssignedAA();
  618. sint16 GetUnassignedAA();
  619. sint16 GetTradeskillAA();
  620. sint16 GetUnassignedTradeskillAA();
  621. sint16 GetPrestigeAA();
  622. sint16 GetUnassignedPretigeAA();
  623. sint16 GetTradeskillPrestigeAA();
  624. sint16 GetUnassignedTradeskillPrestigeAA();
  625. void SetTotalPower(sint32 new_val);
  626. void SetTotalHP(sint32 new_val);
  627. void SetTotalSavagery(sint32 new_val);
  628. void SetTotalDissonance(sint32 new_val);
  629. void SetTotalPowerBase(sint32 new_val);
  630. void SetTotalHPBase(sint32 new_val);
  631. void SetTotalSavageryBase(sint32 new_val);
  632. void SetTotalDissonanceBase(sint32 new_val);
  633. void SetPower(sint32 power, bool setUpdateFlags = true);
  634. void SetHP(sint32 new_val, bool setUpdateFlags = true);
  635. void SetSavagery(sint32 savagery, bool setUpdateFlags = true);
  636. void SetDissonance(sint32 dissonance, bool setUpdateFlags = true);
  637. void SetAssignedAA(sint16 new_val);
  638. void SetUnassignedAA(sint16 new_val);
  639. void SetTradeskillAA(sint16 new_val);
  640. void SetUnassignedTradeskillAA(sint16 new_val);
  641. void SetPrestigeAA(sint16 new_val);
  642. void SetUnassignedPrestigeAA(sint16 new_val);
  643. void SetTradeskillPrestigeAA(sint16 new_val);
  644. void SetUnassignedTradeskillPrestigeAA(sint16 new_val);
  645. void SetPrivateQuestSpawn(bool val) {req_quests_private = val;}
  646. void SetQuestsRequiredOverride(int16 val) {req_quests_override = val;}
  647. void SetQuestsRequiredContinuedAccess(bool val) {req_quests_continued_access = val;}
  648. bool GetPrivateQuestSpawn() {return req_quests_private;}
  649. int16 GetQuestsRequiredOverride() {return req_quests_override;}
  650. bool GetQuestsRequiredContinuedAccess() {return req_quests_continued_access;}
  651. bool Alive(){ return GetHP() > 0; }
  652. int16 GetLevel(){
  653. return appearance.level;
  654. }
  655. int16 GetTSLevel(){
  656. return appearance.tradeskill_level;
  657. }
  658. int8 GetGender(){
  659. return appearance.gender;
  660. }
  661. int8 GetRace(){
  662. return appearance.race;
  663. }
  664. int8 GetLuaRaceId() {
  665. return appearance.lua_race_id;
  666. }
  667. int32 GetSize(){
  668. return size;
  669. }
  670. int32 GetDeviation(){
  671. return deviation;
  672. }
  673. void SetDeviation(int32 in_dev){
  674. deviation = in_dev;
  675. }
  676. float GetSpawnOrigHeading(){
  677. return appearance.pos.SpawnOrigHeading;
  678. }
  679. void SetSpawnOrigHeading(float val){
  680. appearance.pos.SpawnOrigHeading = val;
  681. }
  682. float GetSpawnOrigX(){
  683. return appearance.pos.SpawnOrigX;
  684. }
  685. float GetSpawnOrigY(){
  686. return appearance.pos.SpawnOrigY;
  687. }
  688. float GetSpawnOrigZ(){
  689. return appearance.pos.SpawnOrigZ;
  690. }
  691. float GetSpawnOrigPitch(){
  692. return appearance.pos.SpawnOrigPitch;
  693. }
  694. float GetSpawnOrigRoll(){
  695. return appearance.pos.SpawnOrigRoll;
  696. }
  697. void SetSpawnOrigX(float val){
  698. appearance.pos.SpawnOrigX = val;
  699. }
  700. void SetSpawnOrigY(float val){
  701. appearance.pos.SpawnOrigY = val;
  702. }
  703. void SetSpawnOrigZ(float val){
  704. appearance.pos.SpawnOrigZ = val;
  705. }
  706. void SetSpawnOrigRoll(float val){
  707. appearance.pos.SpawnOrigRoll = val;
  708. }
  709. void SetSpawnOrigPitch(float val){
  710. appearance.pos.SpawnOrigPitch = val;
  711. }
  712. void SetSogaModelType(int16 new_val, bool setUpdateFlags = true){
  713. SetInfo(&appearance.soga_model_type, new_val, setUpdateFlags);
  714. }
  715. void SetModelType(int16 model_type, bool setUpdateFlags = true){
  716. SetInfo(&appearance.model_type, model_type, setUpdateFlags);
  717. SetInfo(&appearance.soga_model_type, model_type, setUpdateFlags);
  718. }
  719. int16 GetSogaModelType(){
  720. return appearance.soga_model_type;
  721. }
  722. int16 GetModelType(){
  723. return appearance.model_type;
  724. }
  725. bool IsFlying() { return (GetInitialState() == 49156); }
  726. void SetPrimaryCommand(const char* name, const char* command, float distance = 10);
  727. void SetPrimaryCommands(vector<EntityCommand*>* commands);
  728. void SetSecondaryCommands(vector<EntityCommand*>* commands);
  729. vector<EntityCommand*>* GetPrimaryCommands() {return &primary_command_list;}
  730. vector<EntityCommand*>* GetSecondaryCommands() {return &secondary_command_list;}
  731. EntityCommand* FindEntityCommand(string command);
  732. virtual EQ2Packet* serialize(Player* player, int16 version);
  733. EQ2Packet* spawn_serialize(Player* player, int16 version);
  734. EQ2Packet* spawn_update_packet(Player* player, int16 version, bool override_changes = false, bool override_vis_changes = false);
  735. EQ2Packet* player_position_update_packet(Player* player, int16 version);
  736. uchar* spawn_info_changes(Player* spawn, int16 version);
  737. uchar* spawn_pos_changes(Player* spawn, int16 version);
  738. uchar* spawn_vis_changes(Player* spawn, int16 version);
  739. uchar* spawn_info_changes_ex(Player* spawn, int16 version);
  740. uchar* spawn_pos_changes_ex(Player* spawn, int16 version);
  741. uchar* spawn_vis_changes_ex(Player* spawn, int16 version);
  742. virtual bool EngagedInCombat(){ return false; }
  743. virtual bool IsObject(){ return false; }
  744. virtual bool IsGroundSpawn(){ return false; }
  745. virtual bool IsNPC(){ return false; }
  746. virtual bool IsEntity(){ return false; }
  747. virtual bool IsPlayer(){ return false; }
  748. virtual bool IsWidget(){ return false; }
  749. virtual bool IsSign(){ return false; }
  750. virtual bool IsBot() { return false; }
  751. bool HasInfoChanged(){ return info_changed; }
  752. bool HasPositionChanged(){ return position_changed; }
  753. bool HasTarget(){ return target ? true : false; }
  754. int32 GetRespawnTime();
  755. void SetRespawnTime(int32 time);
  756. int32 GetExpireTime() { return expire_time; }
  757. void SetExpireTime(int32 new_expire_time) { expire_time = new_expire_time; }
  758. int32 GetExpireOffsetTime();
  759. void SetExpireOffsetTime(int32 time);
  760. int32 GetSpawnLocationID();
  761. void SetSpawnLocationID(int32 id);
  762. int32 GetSpawnEntryID();
  763. void SetSpawnEntryID(int32 id);
  764. int32 GetSpawnLocationPlacementID();
  765. void SetSpawnLocationPlacementID(int32 id);
  766. float GetXOffset() { return x_offset; }
  767. void SetXOffset(float new_x_offset) { x_offset = new_x_offset; }
  768. float GetYOffset() { return y_offset; }
  769. void SetYOffset(float new_y_offset) { y_offset = new_y_offset; }
  770. float GetZOffset() { return z_offset; }
  771. void SetZOffset(float new_z_offset) { z_offset = new_z_offset; }
  772. Spawn* GetTarget();
  773. void SetTarget(Spawn* spawn);
  774. Spawn* GetLastAttacker();
  775. void SetLastAttacker(Spawn* spawn);
  776. bool TakeDamage(int32 damage);
  777. void TakeDamage(Spawn* attacker, int32 damage);
  778. ZoneServer* GetZone();
  779. virtual void SetZone(ZoneServer* in_zone);
  780. void SetFactionID(int32 val) { faction_id = val; }
  781. int32 GetFactionID(){
  782. return faction_id;
  783. }
  784. static int32 NextID() {
  785. static CriticalSection id_lock;
  786. id_lock.lock();
  787. int32 ret = ++next_id;
  788. if (next_id == 0xFFFFFFFE)
  789. next_id = 1;
  790. else if ((next_id - 255) % 256 == 0) { //we dont want it to end in 255, it will confuse/crash the client
  791. id_lock.unlock();
  792. return NextID();
  793. }
  794. id_lock.unlock();
  795. return ret;
  796. }
  797. void AddProvidedQuest(int32 val){
  798. quest_ids.push_back(val);
  799. }
  800. vector<int32>* GetProvidedQuests(){
  801. return &quest_ids;
  802. }
  803. bool HasProvidedQuests(){
  804. return (quest_ids.size() > 0);
  805. }
  806. void SetSpawnScript(string name);
  807. const char* GetSpawnScript();
  808. vector<Spawn*>* GetSpawnGroup();
  809. bool HasSpawnGroup();
  810. bool IsInSpawnGroup(Spawn* spawn);
  811. void SendSpawnChanges(bool val){ send_spawn_changes = val; }
  812. void SetSpawnGroupID(int32 id);
  813. int32 GetSpawnGroupID();
  814. void AddSpawnToGroup(Spawn* spawn);
  815. void SetSpawnGroupList(vector<Spawn*>* list, Mutex* mutex);
  816. void RemoveSpawnFromGroup(bool erase_all = false);
  817. void SetRunningTo(Spawn* spawn){ running_to = spawn->GetID(); }
  818. Spawn* GetRunningTo();
  819. void SetTempVisualState(int val, bool update = true) { SetInfo(&tmp_visual_state, val, update); }
  820. int GetTempVisualState(){ return tmp_visual_state; }
  821. void SetTempActionState(int val, bool update = true) { SetInfo(&tmp_action_state, val, update); }
  822. int GetTempActionState(){ return tmp_action_state; }
  823. void AddAllowAccessSpawn(Spawn* spawn){ allowed_access[spawn->GetID()] = 1; }
  824. void RemoveSpawnAccess(Spawn* spawn);
  825. bool IsPrivateSpawn(){ return allowed_access.size() > 0 ;}
  826. bool AllowedAccess(Spawn* spawn){ return allowed_access.count(spawn->GetID()) > 0; }
  827. void MakeSpawnPublic() { allowed_access.clear(); }
  828. void SetSizeOffset(int8 offset);
  829. int8 GetSizeOffset();
  830. void SetMerchantID(int32 val);
  831. int32 GetMerchantID();
  832. void SetMerchantType(int8 val);
  833. int8 GetMerchantType();
  834. void SetQuestsRequired(map<int32, vector<int16>* >* quests);
  835. void SetQuestsRequired(int32 quest_id, int16 quest_step);
  836. void SetRequiredHistory(int32 event_id, int32 value1, int32 value2);
  837. map<int32, vector<int16>* >* GetQuestsRequired();
  838. void SetTransporterID(int32 id);
  839. int32 GetTransporterID();
  840. bool MeetsSpawnAccessRequirements(Player* player);
  841. void InitializePosPacketData(Player* player, PacketStruct* packet, bool bSpawnUpdate = false);
  842. void InitializeInfoPacketData(Player* player, PacketStruct* packet);
  843. void InitializeVisPacketData(Player* player, PacketStruct* packet);
  844. void InitializeHeaderPacketData(Player* player, PacketStruct* packet, int16 index);
  845. void InitializeFooterPacketData(Player* player, PacketStruct* packet);
  846. void MoveToLocation(Spawn* spawn, float distance, bool immediate = true, bool isMappedLocation = false);
  847. void AddMovementLocation(float x, float y, float z, float speed, int16 delay, const char* lua_function);
  848. void ProcessMovement(bool isSpawnListLocked=false);
  849. void ResetMovement();
  850. bool IsRunning();
  851. void CalculateRunningLocation(bool stop = false);
  852. void RunToLocation(float x, float y, float z, float following_x = 0, float following_y = 0, float following_z = 0);
  853. MovementLocation* GetCurrentRunningLocation();
  854. MovementLocation* GetLastRunningLocation();
  855. bool CalculateChange();
  856. void AddRunningLocation(float x, float y, float z, float speed, float distance_away = 0, bool attackable = true, bool finished_adding_locations = true, string lua_function = "", bool isMapped=false);
  857. bool RemoveRunningLocation();
  858. void ClearRunningLocations();
  859. void CopySpawnAppearance(Spawn* spawn);
  860. bool MovementInterrupted(){ return movement_interrupted; }
  861. void MovementInterrupted(bool val) { movement_interrupted = val; }
  862. bool NeedsToResumeMovement(){ return attack_resume_needed; }
  863. void NeedsToResumeMovement(bool val) { attack_resume_needed = val; }
  864. bool HasMovementLoop(){ return movement_loop.size() > 0; }
  865. Timer* GetRunningTimer();
  866. float GetFaceTarget(float x, float z);
  867. void FaceTarget(float x, float z);
  868. void FaceTarget(Spawn* target);
  869. void SetInvulnerable(bool val);
  870. bool GetInvulnerable();
  871. bool changed;
  872. bool position_changed;
  873. bool info_changed;
  874. bool vis_changed;
  875. int16 size;
  876. int32 faction_id;
  877. int8 oversized_packet; //0xff
  878. int16 opcode;
  879. int32 id;
  880. int8 unknown1;
  881. int32 unknown2;
  882. int32 primary_command_list_id;
  883. int32 secondary_command_list_id;
  884. vector<EntityCommand*> primary_command_list;
  885. vector<EntityCommand*> secondary_command_list;
  886. int32 group_id;
  887. int8 group_len;
  888. vector<Spawn*>* spawn_group_list;
  889. AppearanceData appearance;
  890. int32 last_movement_update;
  891. int32 last_location_update;
  892. bool forceMapCheck;
  893. bool following;
  894. bool IsPet() { return is_pet; }
  895. void SetPet(bool val) { is_pet = val; }
  896. Mutex m_requiredQuests;
  897. Mutex m_requiredHistory;
  898. void SetFollowTarget(Spawn* spawn, int32 followDistance=0);
  899. Spawn* GetFollowTarget();
  900. /// <summary>Sets a user defined variable</summary>
  901. /// <param name='var'>Variable we are setting</param>
  902. /// <param name='val'>Value to set the variable to</param>
  903. void AddTempVariable(string var, string val);
  904. void AddTempVariable(string var, Spawn* val);
  905. void AddTempVariable(string var, ZoneServer* val);
  906. void AddTempVariable(string var, Quest* val);
  907. void AddTempVariable(string var, Item* val);
  908. /// <summary>Gets the value for the given variable</summary>
  909. /// <param name='var'>Variable to check</param>
  910. /// <returns>The value for the given variable, "" if variable was not set</returns>
  911. string GetTempVariable(string var);
  912. Spawn* GetTempVariableSpawn(string var);
  913. ZoneServer* GetTempVariableZone(string var);
  914. Item* GetTempVariableItem(string var);
  915. Quest* GetTempVariableQuest(string var);
  916. int8 GetTempVariableType(string var);
  917. void DeleteTempVariable(string var);
  918. void SetIllusionModel(int16 val, bool setUpdateFlags = true) {
  919. SetInfo(&m_illusionModel, val, setUpdateFlags);
  920. }
  921. int16 GetIllusionModel() { return m_illusionModel; }
  922. CellInfo Cell_Info;
  923. int32 GetSpawnAnim() { return m_spawnAnim; }
  924. void SetSpawnAnim(int32 value) { m_spawnAnim = value; }
  925. int32 GetAddedToWorldTimestamp() { return m_addedToWorldTimestamp; }
  926. void SetAddedToWorldTimestamp(int32 value) { m_addedToWorldTimestamp = value; }
  927. int16 GetSpawnAnimLeeway() { return m_spawnAnimLeeway; }
  928. void SetSpawnAnimLeeway(int16 value) { m_spawnAnimLeeway = value; }
  929. float FindDestGroundZ(glm::vec3 dest, float z_offset);
  930. float GetFixedZ(const glm::vec3& destination, int32 z_find_offset = 1);
  931. void FixZ(bool forceUpdate=false);
  932. bool CheckLoS(Spawn* target);
  933. bool CheckLoS(glm::vec3 myloc, glm::vec3 oloc);
  934. void CalculateNewFearpoint();
  935. void StopMoving() {
  936. if (movement_locations)
  937. movement_locations->clear();
  938. }
  939. int16 pos_packet_size;
  940. int16 info_packet_size;
  941. int16 vis_packet_size;
  942. protected:
  943. bool send_spawn_changes;
  944. bool invulnerable;
  945. bool attack_resume_needed;
  946. bool resume_movement;
  947. bool movement_interrupted;
  948. int32 running_timer_begin;
  949. int32 running_timer_end;
  950. vector<MovementData*> movement_loop;
  951. bool running_timer_updated;
  952. int16 movement_index;
  953. int32 last_grid_update;
  954. int32 movement_start_time;
  955. Mutex MMovementLoop;
  956. map<int32, int8> allowed_access;
  957. vector<int32> quest_ids;
  958. int32 database_id;
  959. int32 packet_num;
  960. int32 target;
  961. int8 spawn_type;
  962. int32 last_attacker;
  963. int32 merchant_id;
  964. int8 merchant_type;
  965. int32 transporter_id;
  966. map<int32, vector<int16>* > required_quests;
  967. map<int32, LUAHistory> required_history;
  968. EquipmentItemList equipment_list;
  969. private:
  970. deque<MovementLocation*>* movement_locations;
  971. Mutex* MMovementLocations;
  972. Mutex* MSpawnGroup;
  973. int8 size_offset;
  974. int tmp_visual_state;
  975. int tmp_action_state;
  976. int32 running_to;
  977. string spawn_script;
  978. static int32 next_id;
  979. ZoneServer* zone;
  980. int32 spawn_location_id;
  981. int32 spawn_entry_id;
  982. int32 spawn_location_spawns_id;
  983. int32 respawn;
  984. int32 expire_time;
  985. int32 expire_offset;
  986. float x_offset;
  987. float y_offset;
  988. float z_offset;
  989. int32 deviation;
  990. BasicInfoStruct basic_info;
  991. //string data;
  992. bool is_pet;
  993. // m_followTarget = spawn to follow around
  994. int32 m_followTarget;
  995. int32 m_followDistance;
  996. bool req_quests_private;
  997. int16 req_quests_override;
  998. bool req_quests_continued_access;
  999. float last_heading_angle;
  1000. map<string, int8> m_tempVariableTypes;
  1001. map<string, int32> m_tempVariableSpawn;
  1002. map<string, ZoneServer*> m_tempVariableZone;
  1003. map<string, Item*> m_tempVariableItem;
  1004. map<string, Quest*> m_tempVariableQuest;
  1005. // m_tempVariables = stores user defined variables from lua, will not persist through a zone
  1006. map<string, string> m_tempVariables;
  1007. int16 m_illusionModel;
  1008. int32 m_spawnAnim;
  1009. int32 m_addedToWorldTimestamp;
  1010. int16 m_spawnAnimLeeway;
  1011. Mutex m_Update;
  1012. };
  1013. #endif