Clone of UAS2 @ https://github.com/drudgedance/uas2

Avatar.h 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. /*
  2. * This file is part of UAS2.
  3. *
  4. * UAS2 is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * UAS2 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 UASv1; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. /**
  18. * @file Avatar.h
  19. */
  20. #ifndef __AVATAR_H
  21. #define __AVATAR_H
  22. #include <algorithm>
  23. #include "Object.h"
  24. #define ACID_MODEL 102;
  25. #define BLADE_MODEL 97;
  26. #define FLAME_MODEL 85;
  27. #define FORCE_MODEL 91;
  28. #define FROST_MODEL 74;
  29. #define LIGHTNING_MODEL 80;
  30. #define SHOCK_MODEL 69;
  31. class cAvatar : public cBiotic
  32. {
  33. friend class cAllegiance;
  34. friend class cClient;
  35. friend class cDatabase;
  36. friend class cFellowship;
  37. friend class cPortalDat;
  38. friend class cCommandParser;
  39. friend class cMonsterServer;
  40. friend class cNPC;
  41. friend class cWorldManager;
  42. friend class cWeapon;
  43. friend class cWorldServer;
  44. public:
  45. float m_flTargetHeading;
  46. cAvatar( cLocation *pcLoc = NULL )
  47. : m_wCurAnim ( 5 ),
  48. m_wMeleeSequence( 0 ),
  49. m_wMoveCount ( 0 ),
  50. m_wPortalCount ( 1 ),
  51. m_pcCombatTarget( NULL ),
  52. cBiotic ( pcLoc ),
  53. m_bStatSequence ( 0 )
  54. {
  55. m_PreviousLocation.m_dwLandBlock = NULL;
  56. m_wNumLogins = 0;
  57. m_wState = 0;
  58. m_dwPingCount = 0;
  59. m_wLifeStone = 0;
  60. m_wMarketplace = 0;
  61. m_wHouseRecall = 0;
  62. m_bFlagCount = 0;
  63. m_wPKlite = 0;
  64. }
  65. cAvatar( DWORD guid, cLocation *pcLoc = NULL )
  66. : m_wCurAnim ( 5 ),
  67. m_wMoveCount ( 0 ),
  68. m_wMeleeSequence( 0 ),
  69. m_wPortalCount ( 0 ),
  70. m_pcCombatTarget( NULL ),
  71. cBiotic ( pcLoc ),
  72. m_bStatSequence ( 0 )
  73. {
  74. m_dwGUID = guid;
  75. m_wNumLogins = 0;
  76. m_wState = 0;
  77. m_dwPingCount = 0;
  78. m_wLifeStone = 0;
  79. m_wMarketplace = 0;
  80. m_wHouseRecall = 0;
  81. m_bFlagCount = 0;
  82. m_wPKlite = 0;
  83. m_wHouseID = NULL;
  84. }
  85. ~cAvatar( )
  86. {
  87. while ( !m_lstInventory.empty( ) )
  88. {
  89. SAFEDELETE( m_lstInventory.front( ) )
  90. m_lstInventory.pop_front( );
  91. }
  92. }
  93. cMessage Portal ( DWORD dwLandblock, float flX, float flY, float flZ, float flA, float flW );
  94. /*agentsparrow - Spell routines*/
  95. static int cAvatar::CastMain ( LPVOID wp, LPVOID lp );
  96. static int cAvatar::WarAnimation1 ( LPVOID wp, LPVOID lp );
  97. static int cAvatar::WarAnimation2 ( LPVOID wp, LPVOID lp );
  98. static int cAvatar::WarAnimation3 ( LPVOID wp, LPVOID lp );
  99. static void cAvatar::CastWar ( LPVOID wp );
  100. static void cAvatar::CastLife ( LPVOID wp );
  101. static void cAvatar::CastCreature ( LPVOID wp );
  102. static void cAvatar::CastItem ( LPVOID wp );
  103. DWORD GetHealValue ( DWORD dwLevel );
  104. DWORD GetStaminaValue ( DWORD dwLevel );
  105. float GetRegenIncValue ( DWORD dwLevel );
  106. float GetRegenDecValue ( DWORD dwLevel );
  107. float GetProtValue ( DWORD dwLevel );
  108. float GetVulnValue ( DWORD dwLevel );
  109. float GetArmorValue ( DWORD dwLevel );
  110. float GetTransferValue ( DWORD dwLevel );
  111. cMessage LocationPacket ( );
  112. cMessage SetPosition ( );
  113. void SetOptions ( DWORD optionsMask );
  114. inline cMessage Particle ( DWORD dwParticleID );
  115. cMessage Animation ( WORD wAnim, float flPlaySpeed = 1.0f );
  116. cMessage WarAnim ( WORD wAnim, float flPlaySpeed = 1.0f );
  117. cMessage SoundEffect ( DWORD dwSound, float flPlaySpeed = 1.0f );
  118. cMessage CreatePacket ( );
  119. cMessage CreateLoginPacket ( DWORD F7B0seq );
  120. cMessage SetPackContents ( DWORD F7B0seq );
  121. cMessage AllegianceInfo ( DWORD F7B0seq );
  122. cMessage HousingInfo ( DWORD F7B0seq );
  123. cMessage LoginCharacter ( );
  124. void LogoutCharacter ( );
  125. void Assess ( cClient *pcAssesser );
  126. void Action ( cClient *who ) {}
  127. //Find the weapon the PC has equipped
  128. cMessage ChangeCombatMode ( BOOL fMode, BYTE WieldType );
  129. cMessage ChangeSpellMode ( BOOL fMode );
  130. cMessage ChangeMissileMode ( BOOL fMode, WORD AmmoType);
  131. float GetRange ( DWORD dwLandblock, float flX, float flY, float flZ, DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ );
  132. float GetHeadingTarget ( DWORD dwLandblock, float flX, float flY, float flZ, DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ );
  133. cMessage RunToAnimation ( DWORD dwGUID, DWORD dwTarget );
  134. cMessage CombatAnimation ( DWORD dwTarget );
  135. cMessage TurnToTarget ( float flHeading, DWORD dwTargetGUID );
  136. cMessage DoDamageMessage ( DWORD F7B0seq, std::string target, DWORD damagetype, double severity, DWORD amount );
  137. cMessage RecieveDamageMessage ( DWORD F7B0seq, std::string giver, DWORD damagetype, double severity, DWORD amount, DWORD location );
  138. cMessage DecrementHealth ( WORD amount, signed int &newhealth );
  139. cMessage DecrementStamina ( WORD amount, signed int &newstamina );
  140. cMessage DecrementMana ( WORD amount, signed int &newmana );
  141. cMessage AddEnchant ( DWORD F7B0seq, DWORD dwSpellID, WORD wEnchantLayer, WORD wSpellFamily, DWORD dwDifficulty, double dDuration, DWORD dwCasterGUID, double dTime, DWORD dwFlags, DWORD dwKey, float flValue );
  142. cMessage RemoveEnchant ( DWORD F7B0seq, DWORD dwSpellID, WORD wEnchantLayer );
  143. /* Statistic (burden, xp, rank, etc.) functions */
  144. void UpdateHuntingExp ( DWORD amount );
  145. void UpdateFellowshipExp ( DWORD amount );
  146. cMessage UpdateUnassignedExp ( DWORD amount );
  147. cMessage UpdateTotalExp ( DWORD amount );
  148. cMessage UpdateSkillExp ( DWORD amount, BYTE skill );
  149. cMessage UpdateLevel ( );
  150. cMessage UpdateBurden ( DWORD amount, int action );
  151. cMessage UpdateRank ( DWORD amount );
  152. cMessage UpdatePyreals ( DWORD amount, int positive );
  153. cMessage UpdateDeaths ( DWORD amount );
  154. cMessage UpdateAge ( DWORD amount );
  155. //k109: Implementation of removing experience.
  156. cMessage DecrementUnassignedExp ( DWORD amount );
  157. /* Attribute functions */
  158. cMessage UpdateStrength ( DWORD exp );
  159. cMessage UpdateEndurance ( DWORD exp );
  160. cMessage UpdateQuickness ( DWORD exp );
  161. cMessage UpdateCoordination ( DWORD exp );
  162. cMessage UpdateFocus ( DWORD exp );
  163. cMessage UpdateSelf ( DWORD exp );
  164. /* Vital functions */
  165. void CalcVital ( WORD vitalID );
  166. cMessage RaiseHealth ( DWORD exp );
  167. cMessage RaiseStamina ( DWORD exp );
  168. cMessage RaiseMana ( DWORD exp );
  169. cMessage AdjustHealthBar (DWORD dwGUID, DWORD F7B0Sequence );
  170. /* Skill functions */
  171. void CalcSkill ( DWORD skillID );
  172. cMessage UpdateSkill ( DWORD skillID, DWORD exp );
  173. cMessage AttackCompleteMessage ( DWORD F7B0seq );
  174. cMessage AttackBeginMessage ( DWORD F7B0seq, DWORD pcGUID );
  175. cMessage SetHealth ( DWORD dwNewHealth );
  176. cMessage SetStamina ( DWORD dwNewStamina );
  177. cMessage SetMana ( DWORD dwNewMana );
  178. cMessage UpdateHealth ( WORD amount, signed int &newvalue );
  179. cMessage UpdateStamina ( WORD amount, signed int &newvalue );
  180. cMessage UpdateMana ( WORD amount, signed int &newvalue );
  181. cMessage HouseAbandon ( DWORD F7B0seq );
  182. void HouseGuestAdd ( char strGuestName[50] );
  183. void HouseGuestRemoveName ( char strGuestName[50] );
  184. void HouseOpenClose ( DWORD IsOpen );
  185. void HouseStorage ( char strGuestName[50], DWORD dwStorageSet );
  186. void HouseBootName ( char strGuestName[50] );
  187. void HouseStorageRemoveAll ( );
  188. cMessage HouseGuestList ( DWORD F7B0seq );
  189. DWORD CalculateDamage ( cObject *pcWeapon, float flPower, float flResistance );
  190. cMessage WindupAnimation ( WORD wAnim1, float flPlaySpeed );
  191. cMessage WarAnimation ( WORD wAnim1, float flPlaySpeed );
  192. cMessage WarAnimation2 ( float flPlaySpeed );
  193. void SetLifestone ( cLocation myLifestone );
  194. cMessage LifestoneRecall ( );
  195. cMessage LSAnimate ( );
  196. cMessage LSMessage ( );
  197. cMessage MarketplaceRecall ( );
  198. cMessage MPAnimate ( );
  199. cMessage MPMessage ( );
  200. cMessage HouseRecall ( );
  201. cMessage HRAnimate ( );
  202. cMessage HRMessage ( );
  203. cMessage ConfirmPanelRequest ( DWORD F7B0seq, DWORD type, DWORD ConfirmSeq, std::string targetName );
  204. void SetIsPK_DB ( );
  205. inline DWORD GetAllegianceID ( ) { return m_dwAllegianceID; }
  206. inline DWORD GetFellowshipID ( ) { return m_dwFellowshipID; }
  207. inline WORD GetGender ( ) { return m_wGender; }
  208. inline WORD GetRace ( ) { return m_wRace; }
  209. inline WORD GetRank ( ) { return m_wRank; }
  210. //Cube: We should have some functions that get the avatars current attributes values
  211. inline DWORD GetTotalStrength ( ) { return m_cStats.m_lpcAttributes[0].m_dwCurrent; }
  212. inline DWORD GetTotalEndurance ( ) { return m_cStats.m_lpcAttributes[1].m_dwCurrent; }
  213. inline DWORD GetTotalQuickness ( ) { return m_cStats.m_lpcAttributes[2].m_dwCurrent; }
  214. inline DWORD GetTotalCoordination ( ) { return m_cStats.m_lpcAttributes[3].m_dwCurrent; }
  215. inline DWORD GetTotalFocus ( ) { return m_cStats.m_lpcAttributes[4].m_dwCurrent; }
  216. inline DWORD GetTotalSelf ( ) { return m_cStats.m_lpcAttributes[5].m_dwCurrent; }
  217. inline WORD GetTotalHealth ( ) { return m_cStats.m_lpcVitals[0].m_dwCurrent; }
  218. inline WORD GetTotalStamina ( ) { return m_cStats.m_lpcVitals[1].m_dwCurrent; }
  219. inline WORD GetTotalMana ( ) { return m_cStats.m_lpcVitals[2].m_dwCurrent; }
  220. inline WORD GetTotalLoyalty ( ) { return m_cStats.m_lpcSkills[36].m_dwTotal; }
  221. inline WORD GetTotalLeadership ( ) { return m_cStats.m_lpcSkills[35].m_dwTotal; }
  222. inline void SetAllegianceID ( DWORD newAllegianceID ) { m_dwAllegianceID = newAllegianceID; }
  223. inline void SetFellowshipID ( DWORD newFellowshipID ) { m_dwFellowshipID = newFellowshipID; }
  224. //Functions for SQL updates
  225. void UpdateQuestCompletedTable ( DWORD dwAvatarGUID, DWORD quest_id );
  226. void SaveToDB ( );
  227. void UpdateAllegianceDB ( );
  228. void UpdateAvatarLocation ( );
  229. void AddItemToInvDB ( DWORD dwAvatarGUID, cObject *pcObject );
  230. void DeleteItemFromInvDB ( DWORD dwAvatarGUID, cObject *pcObject );
  231. void UpdateUnassignedXPDB ( cClient *who, DWORD exp );
  232. void UpdateTotalXPDB ( cClient *who, DWORD exp );
  233. void UpdateLevelDB ( cClient *who );
  234. //Change Model
  235. cMessage UpdateAvatarPalette ( );
  236. cMessage UpdateAvatarTexture ( );
  237. cMessage UpdateAvatarModel ( );
  238. //Allegiances
  239. DWORD GetAllegianceFromDB ( );
  240. void BreakAllegiance ( );
  241. void SwearAllegiance ( std::string szTargetName, DWORD dwReply, DWORD dwSenderGUID );
  242. void SwearAllegianceReply ( std::string szTargetName, DWORD dwReply );
  243. void BreakAllegiance ( DWORD dwMemberGUID );
  244. void BreakAllegianceReply ( std::string szMemberName );
  245. //Fellowships
  246. void CreateFellowship ( DWORD F7B0Sequence, char strFellowName[50] );
  247. void DisbandFellowship ( );
  248. void OpenCloseFellowship ( DWORD dwOpen );
  249. void FellowshipLeader ( DWORD dwNewLeaderGUID );
  250. void FellowshipRecruitSend ( std::string szTargetName, DWORD dwReply, DWORD dwReceiptGUID );
  251. void FellowshipRecruitRecv ( std::string szTargetName, DWORD dwReply, DWORD dwSenderGUID );
  252. void FellowshipDismiss ( DWORD dwMemberGUID );
  253. //Total Experience
  254. inline DWORD AwardTotalExp(DWORD txpamount)
  255. {
  256. if (m_dwTotalXP < 4294967295)
  257. m_dwTotalXP = m_dwTotalXP + txpamount;
  258. else if (m_dwTotalXP > 4294967295)
  259. m_dwTotalXP = 4294967295;
  260. else if (m_dwTotalXP == 4294967295)
  261. m_dwTotalXP += 0;
  262. return m_dwTotalXP;
  263. }
  264. //k109: Changed these functions to increase and decrease.
  265. //Unassigend Experience Increase
  266. inline DWORD AwardUnassignedXP(DWORD uxpamount)
  267. {
  268. if (m_dwUnassignedXP < 4294967295)
  269. m_dwUnassignedXP = m_dwUnassignedXP + uxpamount;
  270. else if (m_dwUnassignedXP > 4294967295)
  271. m_dwUnassignedXP = 4294967295;
  272. else if (m_dwUnassignedXP == 4294967295)
  273. m_dwUnassignedXP += 0;
  274. return m_dwUnassignedXP;
  275. }
  276. //Unassigend Experience Decrease
  277. inline int SpendUnassignedXP(int uxpamount)
  278. {
  279. m_dwUnassignedXP = m_dwUnassignedXP - uxpamount;
  280. return m_dwUnassignedXP;
  281. }
  282. //Add Burden
  283. inline int AddBurden(int amount)
  284. {
  285. m_dwBurden = m_dwBurden + amount;
  286. return m_dwBurden;
  287. }
  288. //Remove Burden
  289. inline int RemoveBurden(int amount)
  290. {
  291. m_dwBurden = m_dwBurden - amount;
  292. return m_dwBurden;
  293. }
  294. //Add Pyreals
  295. inline DWORD AddPyreals(DWORD amount)
  296. {
  297. m_dwPyreals = m_dwPyreals + amount;
  298. return m_dwPyreals;
  299. }
  300. //Remove Pyreals
  301. inline DWORD RemovePyreals(DWORD amount)
  302. {
  303. m_dwPyreals = m_dwPyreals - amount;
  304. return m_dwPyreals;
  305. }
  306. inline int EatStaminaFood(int amount)
  307. {
  308. int update = amount;
  309. return update;
  310. }
  311. /* Cubem0j0: Add damage reduction based on AL */
  312. inline int ALDamageReduction( DWORD alvalue )
  313. {
  314. float dam_reduce = (1/1+alvalue/60);
  315. return dam_reduce;
  316. }
  317. inline void SetCombatTarget( cObject *pcObject )
  318. {
  319. m_pcCombatTarget = pcObject;
  320. }
  321. inline void AddInventory( cObject *pcObject )
  322. {
  323. m_lstInventory.push_back( pcObject );
  324. pcObject->m_fIsOwned = TRUE;
  325. pcObject->m_dwContainer = m_dwGUID;
  326. }
  327. inline void RemoveInventory( cObject *pcObject )
  328. {
  329. iterObject_lst itObject = std::find( m_lstInventory.begin( ), m_lstInventory.end( ), pcObject );
  330. if ( itObject != m_lstInventory.end( ) )
  331. m_lstInventory.erase( itObject );
  332. pcObject->m_fIsOwned = FALSE;
  333. pcObject->m_dwContainer = NULL;
  334. }
  335. inline cObject *FindInventory( DWORD dwGUID )
  336. {
  337. for ( iterObject_lst itObject = m_lstInventory.begin( ); itObject != m_lstInventory.end( ); ++itObject )
  338. {
  339. if ( dwGUID == (*itObject)->GetGUID( ) )
  340. return *itObject;
  341. }
  342. return NULL;
  343. }
  344. //k109: AL :p
  345. inline DWORD SetArmorLevel (DWORD AL)
  346. {
  347. Armor_Level = AL;
  348. return AL;
  349. }
  350. inline DWORD GetLevel(DWORD totalxp)
  351. {
  352. unsigned long level = floor(pow((double)9 * totalxp + 7776,(float)1/5) - 6) + 1;
  353. return level;
  354. }
  355. inline void DeleteFromInventory( cObject *pcObject )
  356. {
  357. iterObject_lst itObject = std::find( m_lstInventory.begin( ), m_lstInventory.end( ), pcObject );
  358. if ( itObject != m_lstInventory.end( ) )
  359. m_lstInventory.erase( itObject );
  360. }
  361. void CreateChildren( cClient *pcClientDestination );
  362. WORD m_wCurAnim;
  363. WORD m_wMeleeSequence;
  364. WORD m_wPortalCount;
  365. WORD m_wMoveCount;
  366. BYTE m_bStatSequence;
  367. WORD m_wModelSequenceType;
  368. WORD m_wModelSequence;
  369. WORD m_wModelNum;
  370. float m_flAScale;
  371. BYTE m_bAccessLevel;
  372. WORD m_wState;
  373. DWORD m_dwPingCount;
  374. WORD m_wLifeStone;
  375. WORD m_wMarketplace;
  376. WORD m_wHouseRecall;
  377. WORD m_wHouseID;
  378. WORD m_wPKlite;
  379. WORD m_wTimedEvent;
  380. DWORD m_dwNumFollowers;
  381. DWORD m_dwNumDeaths;
  382. BYTE m_bFlagCount;
  383. // Spell Variables
  384. WORD m_wSpellCount;
  385. DWORD m_dwSpellUnknown;
  386. cSpellBook m_SpellBook[100];
  387. cSpellTab m_SpellTabs[7];
  388. DWORD m_dwInventoryCount;
  389. cInventory m_Inventory[300];
  390. vInventory m_vInventory[300];
  391. //Cube: Array to hold inventory item GUIDs
  392. DWORD m_InvGUIDs[300];
  393. cLocation m_PreviousLocation;
  394. cStats m_cStats;
  395. BYTE m_fIsPK;
  396. DWORD m_CorpseTarget;
  397. DWORD m_DmgTypeEquipped;
  398. //Fellowship stuff
  399. bool inFellow;
  400. //Character Option Flag
  401. DWORD m_dwOptions;
  402. std::list< cObject * > m_lstInventory;
  403. std::string sAccount_Name;
  404. cWeapon *myWeapon;
  405. cShield *myShield;
  406. cAmmo *myAmmo;
  407. private:
  408. char m_strCharacterName[32];
  409. DWORD m_dwBurden;
  410. DWORD m_dwPyreals;
  411. DWORD m_dwTotalXP;
  412. DWORD m_dwUnassignedXP;
  413. WORD m_wRank;
  414. BYTE m_bTotalSkillCredits;
  415. BYTE m_bSkillCredits;
  416. DWORD m_dwDeaths;
  417. DWORD m_dwBirth;
  418. DWORD m_dwNumLogins;
  419. //Cubem0j0: Add support for Avatar armor level.
  420. DWORD Armor_Level;
  421. DWORD m_dwTotal_exp_spent_strength;
  422. cObject *m_pcCombatTarget;
  423. WORD m_wRace;
  424. WORD m_wGender;
  425. WORD m_wClass;
  426. char m_strRaceName[20];
  427. char m_strSexName[20];
  428. char m_strClassName[20];
  429. double m_dblSkinShade;
  430. WORD m_wHairColor;
  431. double m_dblHairShade;
  432. WORD m_wHairStyle;
  433. WORD m_wEyeColor;
  434. WORD m_wHead;
  435. WORD m_wNose;
  436. WORD m_wChin;
  437. WORD m_wPaletteCode;
  438. //k109: Added this for books.
  439. //k109: Struct for palette:
  440. struct PaletteChange
  441. {
  442. WORD m_wNewPalette;
  443. BYTE m_ucOffset;
  444. BYTE m_ucLength;
  445. } pc;
  446. //k109: Struct for Texture Change
  447. #pragma pack( push, 1 )
  448. struct TextureChange
  449. {
  450. BYTE m_bModelIndex;
  451. WORD m_wOldTexture;
  452. WORD m_wNewTexture;
  453. } tc;
  454. #pragma pack(pop)
  455. //k109: Struct for Model Change
  456. #pragma pack( push, 1 )
  457. struct ModelChange
  458. {
  459. BYTE m_bModelIndex;
  460. WORD m_wNewModel;
  461. } mc;
  462. #pragma pack(pop)
  463. //k109: variables for holding Base Attributes
  464. int base_strength;
  465. int base_endurance;
  466. int base_coordination;
  467. int base_quickness;
  468. int base_focus;
  469. int base_self;
  470. //k109: variables for holding base Vitals
  471. int base_health;
  472. int base_stamina;
  473. int base_mana;
  474. //also need vars to hold current exp spent on Attributes
  475. DWORD strength_exp_cost;
  476. DWORD endurance_exp_cost;
  477. DWORD coordination_exp_cost;
  478. DWORD quickness_exp_cost;
  479. DWORD focus_exp_cost;
  480. DWORD self_exp_cost;
  481. //Vitals exp spent
  482. DWORD health_exp_cost;
  483. DWORD stamina_exp_cost;
  484. DWORD mana_exp_cost;
  485. /*
  486. //Base skills
  487. int base_axe;
  488. int base_bow;
  489. int base_crossbow;
  490. int base_dagger;
  491. int base_mace;
  492. int base_meleed;
  493. int base_missiled;
  494. int base_spear;
  495. int base_staff;
  496. int base_sword;
  497. int base_tweapons;
  498. int base_unarmed;
  499. int base_arcane;
  500. int base_magicd;
  501. int base_manac;
  502. int base_itemtink;
  503. int base_assess_person;
  504. int base_deception;
  505. int base_healing;
  506. int base_jump;
  507. int base_lockpick;
  508. int base_run;
  509. int base_assess_creature;
  510. int base_weapontink;
  511. int base_armortink;
  512. int base_mitink;
  513. int base_creature;
  514. int base_item;
  515. int base_life;
  516. int base_war;
  517. int base_leadership;
  518. int base_loyalty;
  519. int base_fletching;
  520. int base_alchemy;
  521. int base_cooking;
  522. int base_salvage;
  523. //Skills experience spent
  524. DWORD axe_exp_spent;
  525. DWORD bow_exp_spent;
  526. DWORD crossbow_exp_spent;
  527. DWORD dagger_exp_spent;
  528. DWORD mace_exp_spent;
  529. DWORD meleed_exp_spent;
  530. DWORD missiled_exp_spent;
  531. DWORD spear_exp_spent;
  532. DWORD staff_exp_spent;
  533. DWORD sword_exp_spent;
  534. DWORD tweapons_exp_spent;
  535. DWORD unarmed_exp_spent;
  536. DWORD arcane_exp_spent;
  537. DWORD magicd_exp_spent;
  538. DWORD manac_exp_spent;
  539. DWORD itemtink_exp_spent;
  540. DWORD assess_person_exp_spent;
  541. DWORD deception_exp_spent;
  542. DWORD healing_exp_spent;
  543. DWORD jump_exp_spent;
  544. DWORD lockpick_exp_spent;
  545. DWORD run_exp_spent;
  546. DWORD assess_creature_exp_spent;
  547. DWORD weapontink_exp_spent;
  548. DWORD armortink_exp_spent;
  549. DWORD mitink_exp_spent;
  550. DWORD creature_exp_spent;
  551. DWORD item_exp_spent;
  552. DWORD life_exp_spent;
  553. DWORD war_exp_spent;
  554. DWORD leadership_exp_spent;
  555. DWORD loyalty_exp_spent;
  556. DWORD fletching_exp_spent;
  557. DWORD alchemy_exp_spent;
  558. DWORD cooking_exp_spent;
  559. DWORD salvage_exp_spent;
  560. */
  561. BYTE m_bBasicPaletteChange;
  562. DWORD m_wBasicPaletteVector;
  563. sPaletteChange m_BasicVectorPal[255];
  564. BYTE m_bBasicTextureChange;
  565. DWORD m_wBasicTextureVector;
  566. sTextureChange m_BasicVectorTex[255];
  567. BYTE m_bBasicModelChange;
  568. DWORD m_wBasicModelVector;
  569. sModelChange m_BasicVectorMod[255];
  570. //Cube: Change model variables
  571. BYTE m_bPaletteChange;
  572. DWORD m_wPaletteVector;
  573. sPaletteChange m_vectorPal[255];
  574. BYTE m_bTextureChange;
  575. DWORD m_wTextureVector;
  576. sTextureChange m_vectorTex[255];
  577. BYTE m_bModelChange;
  578. DWORD m_wModelVector;
  579. sModelChange m_vectorMod[255];
  580. DWORD m_dwAllegianceID;
  581. DWORD m_dwFellowshipID;
  582. };
  583. //Inline Functions
  584. //================
  585. inline cMessage cAvatar::Particle( DWORD dwParticleID )
  586. {
  587. cMessage cParticle;
  588. cParticle << 0xF755L << m_dwGUID << dwParticleID << 0x3F2B4E94L;
  589. return cParticle;
  590. }
  591. inline cMessage cAvatar::SoundEffect(DWORD dwSound, float flPlaySpeed )
  592. {
  593. cMessage cParticle;
  594. cParticle << 0xF750L << m_dwGUID << dwSound << flPlaySpeed;
  595. return cParticle;
  596. }
  597. inline void cAvatar::SetLifestone( cLocation myLifestone )
  598. {
  599. m_LSLoc.m_dwLandBlock = myLifestone.m_dwLandBlock;
  600. m_LSLoc.m_flX = myLifestone.m_flX;
  601. m_LSLoc.m_flY = myLifestone.m_flY;
  602. m_LSLoc.m_flZ = myLifestone.m_flZ;
  603. m_LSLoc.m_flA = myLifestone.m_flA;
  604. m_LSLoc.m_flB = myLifestone.m_flB;
  605. m_LSLoc.m_flC = myLifestone.m_flC;
  606. m_LSLoc.m_flW = myLifestone.m_flW;
  607. }
  608. #endif // #ifndef __AVATAR_H