- Main Page
- Classes
- Files

- File List
- File Members

# E:/uas2/Server/Avatar.h

Go to the documentation of this file.

    00001 /*
    00002 * This file is part of UAS2.
    00003 *
    00004 * UAS2 is free software; you can redistribute it and/or modify
    00005 * it under the terms of the GNU General Public License as published by
    00006 * the Free Software Foundation; either version 2 of the License, or
    00007 * (at your option) any later version.
    00008 *
    00009 * UAS2 is distributed in the hope that it will be useful,
    00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012 * GNU General Public License for more details.
    00013
    00014 * You should have received a copy of the GNU General Public License
    00015 * along with UASv1; if not, write to the Free Software
    00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00017 */
    00018
    00023 #ifndef __AVATAR_H
    00024 #define __AVATAR_H
    00025
    00026 #include <algorithm>
    00027
    00028 #include "Object.h"
    00029
    00030 #define ACID_MODEL 102;
    00031 #define BLADE_MODEL 97;
    00032 #define FLAME_MODEL 85;
    00033 #define FORCE_MODEL 91;
    00034 #define FROST_MODEL 74;
    00035 #define LIGHTNING_MODEL 80;
    00036 #define SHOCK_MODEL 69;
    00037
    00038 class cAvatar : public cBiotic
    00039 {
    00040         friend class cAllegiance;
    00041         friend class cClient;
    00042         friend class cDatabase;
    00043         friend class cFellowship;
    00044         friend class cPortalDat;
    00045         friend class cCommandParser;
    00046         friend class cMonsterServer;
    00047         friend class cNPC;
    00048         friend class cWorldManager;
    00049         friend class cWeapon;
    00050         friend class cWorldServer;
    00051
    00052 public:
    00053         float m_flTargetHeading;
    00054         cAvatar( cLocation *pcLoc = NULL )
    00055                 :       m_wCurAnim              ( 5 ),
    00056                         m_wMeleeSequence( 0 ),
    00057                         m_wMoveCount    ( 0 ),
    00058                         m_wPortalCount  ( 1 ),
    00059                         m_pcCombatTarget( NULL ),
    00060                         cBiotic                 ( pcLoc ),
    00061                         m_bStatSequence ( 0 )
    00062         {
    00063                 m_PreviousLocation.m_dwLandBlock = NULL;
    00064                 m_wNumLogins    = 0;
    00065                 m_wState                = 0;
    00066                 m_dwPingCount   = 0;
    00067                 m_wLifeStone    = 0;
    00068                 m_wMarketplace  = 0;
    00069                 m_wHouseRecall  = 0;
    00070                 m_bFlagCount    = 0;
    00071                 m_wPKlite               = 0;
    00072         }
    00073
    00074         cAvatar( DWORD guid, cLocation *pcLoc = NULL )
    00075                 :       m_wCurAnim              ( 5 ),
    00076                         m_wMoveCount    ( 0 ),
    00077                         m_wMeleeSequence( 0 ),
    00078                         m_wPortalCount  ( 0 ),
    00079                         m_pcCombatTarget( NULL ),
    00080                         cBiotic                 ( pcLoc ),
    00081                         m_bStatSequence ( 0 )
    00082         {
    00083                 m_dwGUID                = guid;
    00084                 m_wNumLogins    = 0;
    00085                 m_wState                = 0;
    00086                 m_dwPingCount   = 0;
    00087                 m_wLifeStone    = 0;
    00088                 m_wMarketplace  = 0;
    00089                 m_wHouseRecall  = 0;
    00090                 m_bFlagCount    = 0;
    00091                 m_wPKlite               = 0;
    00092                 m_wHouseID              = NULL;
    00093         }
    00094
    00095         ~cAvatar( )
    00096         {
    00097                 while ( !m_lstInventory.empty( ) )
    00098                 {
    00099                         SAFEDELETE( m_lstInventory.front( ) )
    00100                         m_lstInventory.pop_front( );
    00101                 }
    00102         }
    00103
    00104         cMessage                Portal                                  ( DWORD dwLandblock, float flX, float flY, float flZ, float flA, float flW );
    00105
    00106         /*agentsparrow - Spell routines*/
    00107         static int              cAvatar::CastMain               ( LPVOID wp, LPVOID lp );
    00108         static int              cAvatar::WarAnimation1  ( LPVOID wp, LPVOID lp );
    00109         static int              cAvatar::WarAnimation2  ( LPVOID wp, LPVOID lp );
    00110         static int              cAvatar::WarAnimation3  ( LPVOID wp, LPVOID lp );
    00111         static void             cAvatar::CastWar                ( LPVOID wp );
    00112         static void             cAvatar::CastLife               ( LPVOID wp );
    00113         static void             cAvatar::CastCreature   ( LPVOID wp );
    00114         static void             cAvatar::CastItem               ( LPVOID wp );
    00115         DWORD                   GetHealValue                    ( DWORD dwLevel );
    00116         DWORD                   GetStaminaValue                 ( DWORD dwLevel );
    00117         float                   GetRegenIncValue                ( DWORD dwLevel );
    00118         float                   GetRegenDecValue                ( DWORD dwLevel );
    00119         float                   GetProtValue                    ( DWORD dwLevel );
    00120         float                   GetVulnValue                    ( DWORD dwLevel );
    00121         float                   GetArmorValue                   ( DWORD dwLevel );
    00122         float                   GetTransferValue                ( DWORD dwLevel );
    00123
    00124         cMessage                LocationPacket                  ( );
    00125         cMessage                SetPosition                             ( );
    00126         void                    SetOptions                              ( DWORD optionsMask );
    00127         inline cMessage Particle                                ( DWORD dwParticleID );
    00128         cMessage                Animation                               ( WORD wAnim, float flPlaySpeed = 1.0f );
    00129         cMessage                WarAnim                                 ( WORD wAnim, float flPlaySpeed = 1.0f );
    00130         cMessage                SoundEffect                             ( DWORD dwSound, float flPlaySpeed = 1.0f );
    00131         cMessage                CreatePacket                    ( );
    00132         cMessage                CreateLoginPacket               ( DWORD F7B0seq );
    00133         cMessage                SetPackContents                 ( DWORD F7B0seq );
    00134         cMessage                AllegianceInfo                  ( DWORD F7B0seq );
    00135         cMessage                HousingInfo                             ( DWORD F7B0seq );
    00136         cMessage                LoginCharacter                  ( );
    00137         void                    LogoutCharacter                 ( );
    00138         void                    Assess                                  ( cClient *pcAssesser );
    00139         void                    Action                                  ( cClient *who )         {}
    00140         //Find the weapon the PC has equipped
    00141         cMessage                ChangeCombatMode                ( BOOL fMode, BYTE WieldType );
    00142         cMessage                ChangeSpellMode                 ( BOOL fMode );
    00143         cMessage                ChangeMissileMode               ( BOOL fMode, WORD AmmoType);
    00144
    00145         float                   GetRange                                ( DWORD dwLandblock, float flX, float flY, float flZ, DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ );
    00146         float                   GetHeadingTarget                ( DWORD dwLandblock, float flX, float flY, float flZ, DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ );
    00147         cMessage                RunToAnimation                  ( DWORD dwGUID, DWORD dwTarget );
    00148         cMessage                CombatAnimation                 ( DWORD dwTarget );
    00149         cMessage                TurnToTarget                    ( float flHeading, DWORD dwTargetGUID );
    00150
    00151         cMessage                DoDamageMessage                 ( DWORD F7B0seq, std::string target, DWORD damagetype, double severity, DWORD amount );
    00152         cMessage                RecieveDamageMessage    ( DWORD F7B0seq, std::string giver, DWORD damagetype, double severity, DWORD amount, DWORD location );
    00153
    00154         cMessage                DecrementHealth                 ( WORD amount, signed int &newhealth );
    00155         cMessage                DecrementStamina                ( WORD amount, signed int &newstamina );
    00156         cMessage                DecrementMana                   ( WORD amount, signed int &newmana );
    00157         cMessage                AddEnchant                              ( DWORD F7B0seq, DWORD dwSpellID, WORD wEnchantLayer, WORD wSpellFamily, DWORD dwDifficulty, double dDuration, DWORD dwCasterGUID, double dTime, DWORD dwFlags, DWORD dwKey, float flValue );
    00158         cMessage                RemoveEnchant                   ( DWORD F7B0seq, DWORD dwSpellID, WORD wEnchantLayer );
    00159
    00160         /* Statistic (burden, xp, rank, etc.) functions */
    00161         void                    UpdateHuntingExp                ( DWORD amount );
    00162         void                    UpdateFellowshipExp             ( DWORD amount );
    00163         cMessage                UpdateUnassignedExp             ( DWORD amount );
    00164         cMessage                UpdateTotalExp                  ( DWORD amount );
    00165         cMessage                UpdateSkillExp                  ( DWORD amount, BYTE skill );
    00166         cMessage                UpdateLevel                             ( );
    00167         cMessage                UpdateBurden                    ( DWORD amount, int action );
    00168         cMessage                UpdateRank                              ( DWORD amount );
    00169         cMessage                UpdatePyreals                   ( DWORD amount, int positive );
    00170         cMessage                UpdateDeaths                    ( DWORD amount );
    00171         cMessage                UpdateAge                               ( DWORD amount );
    00172
    00173         //k109:  Implementation of removing experience.
    00174         cMessage                DecrementUnassignedExp  ( DWORD amount );
    00175
    00176         /* Attribute functions  */
    00177         cMessage                UpdateStrength                  ( DWORD exp );
    00178         cMessage                UpdateEndurance                 ( DWORD exp );
    00179         cMessage                UpdateQuickness                 ( DWORD exp );
    00180         cMessage                UpdateCoordination      ( DWORD exp );
    00181         cMessage                UpdateFocus                             ( DWORD exp );
    00182         cMessage                UpdateSelf                              ( DWORD exp );
    00183
    00184         /* Vital functions */
    00185         void                    CalcVital                               ( WORD vitalID );
    00186         cMessage                RaiseHealth                             ( DWORD exp );
    00187         cMessage                RaiseStamina                    ( DWORD exp );
    00188         cMessage                RaiseMana                               ( DWORD exp );
    00189
    00190         cMessage                AdjustHealthBar                 (DWORD dwGUID, DWORD F7B0Sequence );
    00191
    00192         /* Skill functions */
    00193         void                    CalcSkill                               ( DWORD skillID );
    00194         cMessage                UpdateSkill                             ( DWORD skillID, DWORD exp );
    00195
    00196         cMessage                AttackCompleteMessage   ( DWORD F7B0seq );
    00197         cMessage                AttackBeginMessage              ( DWORD F7B0seq, DWORD pcGUID );
    00198
    00199         cMessage                SetHealth                               ( DWORD dwNewHealth );
    00200         cMessage                SetStamina                              ( DWORD dwNewStamina );
    00201         cMessage                SetMana                                 ( DWORD dwNewMana );
    00202
    00203         cMessage                UpdateHealth                    ( WORD amount, signed int &newvalue );
    00204         cMessage                UpdateStamina                   ( WORD amount, signed int &newvalue );
    00205         cMessage                UpdateMana                              ( WORD amount, signed int &newvalue );
    00206
    00207         cMessage                HouseAbandon                    ( DWORD F7B0seq );
    00208         void                    HouseGuestAdd                   ( char strGuestName[50] );
    00209         void                    HouseGuestRemoveName    ( char strGuestName[50] );
    00210         void                    HouseOpenClose                  ( DWORD IsOpen );
    00211         void                    HouseStorage                    ( char strGuestName[50], DWORD dwStorageSet );
    00212         void                    HouseBootName                   ( char strGuestName[50] );
    00213         void                    HouseStorageRemoveAll   ( );
    00214         cMessage                HouseGuestList                  ( DWORD F7B0seq );
    00215
    00216         DWORD                   CalculateDamage                 ( cObject *pcWeapon, float flPower, float flResistance );
    00217         cMessage                WindupAnimation                 ( WORD wAnim1, float flPlaySpeed );
    00218         cMessage                WarAnimation                    ( WORD wAnim1, float flPlaySpeed );
    00219         cMessage                WarAnimation2                   ( float flPlaySpeed );
    00220         void                    SetLifestone                    ( cLocation myLifestone );
    00221         cMessage                LifestoneRecall                 ( );
    00222         cMessage                LSAnimate                               ( );
    00223         cMessage                LSMessage                               ( );
    00224         cMessage                MarketplaceRecall               ( );
    00225         cMessage                MPAnimate                               ( );
    00226         cMessage                MPMessage                               ( );
    00227         cMessage                HouseRecall                             ( );
    00228         cMessage                HRAnimate                               ( );
    00229         cMessage                HRMessage                               ( );
    00230         cMessage                ConfirmPanelRequest             ( DWORD F7B0seq, DWORD type, DWORD ConfirmSeq, std::string targetName );
    00231
    00232         void                    SetIsPK_DB                              ( );
    00233
    00234         inline  DWORD   GetAllegianceID                 ( )     { return m_dwAllegianceID; }
    00235         inline  DWORD   GetFellowshipID                 ( )     { return m_dwFellowshipID; }
    00236         inline  WORD    GetGender                               ( )     { return m_wGender; }
    00237         inline  WORD    GetRace                                 ( )     { return m_wRace; }
    00238         inline  WORD    GetRank                                 ( )     { return m_wRank; }
    00239
    00240         //Cube:  We should have some functions that get the avatars current attributes values
    00241         inline  DWORD   GetTotalStrength                ( ) { return m_cStats.m_lpcAttributes[0].m_dwCurrent; }
    00242         inline  DWORD   GetTotalEndurance               ( ) { return m_cStats.m_lpcAttributes[1].m_dwCurrent; }
    00243         inline  DWORD   GetTotalQuickness               ( ) { return m_cStats.m_lpcAttributes[2].m_dwCurrent; }
    00244         inline  DWORD   GetTotalCoordination    ( ) { return m_cStats.m_lpcAttributes[3].m_dwCurrent; }
    00245         inline  DWORD   GetTotalFocus                   ( ) { return m_cStats.m_lpcAttributes[4].m_dwCurrent; }
    00246         inline  DWORD   GetTotalSelf                    ( ) { return m_cStats.m_lpcAttributes[5].m_dwCurrent; }
    00247
    00248         inline  WORD    GetTotalHealth                  ( ) { return m_cStats.m_lpcVitals[0].m_dwCurrent; }
    00249         inline  WORD    GetTotalStamina                 ( ) { return m_cStats.m_lpcVitals[1].m_dwCurrent; }
    00250         inline  WORD    GetTotalMana                    ( ) { return m_cStats.m_lpcVitals[2].m_dwCurrent; }
    00251
    00252         inline  WORD    GetTotalLoyalty                 ( )     { return m_cStats.m_lpcSkills[36].m_dwTotal; }
    00253         inline  WORD    GetTotalLeadership              ( )     { return m_cStats.m_lpcSkills[35].m_dwTotal; }
    00254
    00255         inline  void    SetAllegianceID                 ( DWORD newAllegianceID )       { m_dwAllegianceID = newAllegianceID; }
    00256         inline  void    SetFellowshipID                 ( DWORD newFellowshipID )       { m_dwFellowshipID = newFellowshipID; }
    00257
    00258         //Functions for SQL updates
    00259         void UpdateQuestCompletedTable                  ( DWORD dwAvatarGUID, DWORD quest_id );
    00260         void SaveToDB                                                   ( );
    00261         void UpdateAllegianceDB                                 ( );
    00262         void UpdateAvatarLocation                               ( );
    00263
    00264         void AddItemToInvDB                                             ( DWORD dwAvatarGUID, cObject *pcObject );
    00265         void DeleteItemFromInvDB                                ( DWORD dwAvatarGUID, cObject *pcObject );
    00266         void UpdateUnassignedXPDB                               ( cClient *who, DWORD exp );
    00267         void UpdateTotalXPDB                                    ( cClient *who, DWORD exp );
    00268         void UpdateLevelDB                                              ( cClient *who );
    00269
    00270         //Change Model
    00271         cMessage UpdateAvatarPalette                    ( );
    00272         cMessage UpdateAvatarTexture                    ( );
    00273         cMessage UpdateAvatarModel                              ( );
    00274
    00275         //Allegiances
    00276         DWORD   GetAllegianceFromDB                             ( );
    00277         void    BreakAllegiance                                 ( );
    00278         void    SwearAllegiance                                 ( std::string szTargetName, DWORD dwReply, DWORD dwSenderGUID );
    00279         void    SwearAllegianceReply                    ( std::string szTargetName, DWORD dwReply );
    00280         void    BreakAllegiance                                 ( DWORD dwMemberGUID );
    00281         void    BreakAllegianceReply                    ( std::string szMemberName );
    00282
    00283         //Fellowships
    00284         void    CreateFellowship                                ( DWORD F7B0Sequence, char strFellowName[50] );
    00285         void    DisbandFellowship                               ( );
    00286         void    OpenCloseFellowship                             ( DWORD dwOpen );
    00287         void    FellowshipLeader                                ( DWORD dwNewLeaderGUID );
    00288         void    FellowshipRecruitSend                   ( std::string szTargetName, DWORD dwReply, DWORD dwReceiptGUID );
    00289         void    FellowshipRecruitRecv                   ( std::string szTargetName, DWORD dwReply, DWORD dwSenderGUID );
    00290         void    FellowshipDismiss                               ( DWORD dwMemberGUID );
    00291
    00292         //Total Experience
    00293         inline DWORD AwardTotalExp(DWORD txpamount)
    00294         {
    00295                 if (m_dwTotalXP < 4294967295)
    00296                         m_dwTotalXP = m_dwTotalXP + txpamount;
    00297                 else if (m_dwTotalXP > 4294967295)
    00298                         m_dwTotalXP = 4294967295;
    00299                 else if (m_dwTotalXP == 4294967295)
    00300                         m_dwTotalXP += 0;
    00301
    00302                 return m_dwTotalXP;
    00303         }
    00304
    00305         //k109:  Changed these functions to increase and decrease.
    00306
    00307         //Unassigend Experience Increase
    00308         inline DWORD AwardUnassignedXP(DWORD uxpamount)
    00309         {
    00310                 if (m_dwUnassignedXP < 4294967295)
    00311                         m_dwUnassignedXP = m_dwUnassignedXP + uxpamount;
    00312                 else if (m_dwUnassignedXP > 4294967295)
    00313                         m_dwUnassignedXP = 4294967295;
    00314                 else if (m_dwUnassignedXP == 4294967295)
    00315                         m_dwUnassignedXP += 0;
    00316
    00317                 return m_dwUnassignedXP;
    00318         }
    00319
    00320         //Unassigend Experience Decrease
    00321         inline int SpendUnassignedXP(int uxpamount)
    00322         {
    00323                 m_dwUnassignedXP = m_dwUnassignedXP - uxpamount;
    00324                 return m_dwUnassignedXP;
    00325         }
    00326
    00327         //Add Burden
    00328         inline int AddBurden(int amount)
    00329         {
    00330                 m_dwBurden = m_dwBurden + amount;
    00331                 return m_dwBurden;
    00332         }
    00333
    00334         //Remove Burden
    00335         inline int RemoveBurden(int amount)
    00336         {
    00337                 m_dwBurden = m_dwBurden - amount;
    00338                 return m_dwBurden;
    00339         }
    00340
    00341         //Add Pyreals
    00342         inline DWORD AddPyreals(DWORD amount)
    00343         {
    00344                 m_dwPyreals = m_dwPyreals + amount;
    00345                 return m_dwPyreals;
    00346         }
    00347
    00348         //Remove Pyreals
    00349         inline DWORD RemovePyreals(DWORD amount)
    00350         {
    00351                 m_dwPyreals = m_dwPyreals - amount;
    00352                 return m_dwPyreals;
    00353         }
    00354
    00355         inline int EatStaminaFood(int amount)
    00356         {
    00357                 int update = amount;
    00358                 return update;
    00359         }
    00360
    00361         /* Cubem0j0: Add damage reduction based on AL */
    00362         inline int ALDamageReduction( DWORD alvalue )
    00363         {
    00364                 float dam_reduce = (1/1+alvalue/60);
    00365                 return dam_reduce;
    00366         }
    00367
    00368         inline void SetCombatTarget( cObject *pcObject )
    00369         {
    00370                 m_pcCombatTarget = pcObject;
    00371         }
    00372
    00373         inline void AddInventory( cObject *pcObject )
    00374         {
    00375                 m_lstInventory.push_back( pcObject );
    00376                 pcObject->m_fIsOwned = TRUE;
    00377                 pcObject->m_dwContainer = m_dwGUID;
    00378         }
    00379
    00380         inline void RemoveInventory( cObject *pcObject )
    00381         {
    00382                 iterObject_lst itObject = std::find( m_lstInventory.begin( ), m_lstInventory.end( ), pcObject );
    00383
    00384                 if ( itObject != m_lstInventory.end( ) )
    00385                         m_lstInventory.erase( itObject );
    00386                 pcObject->m_fIsOwned = FALSE;
    00387                 pcObject->m_dwContainer = NULL;
    00388         }
    00389
    00390         inline cObject *FindInventory( DWORD dwGUID )
    00391         {
    00392                 for ( iterObject_lst itObject = m_lstInventory.begin( ); itObject != m_lstInventory.end( ); ++itObject )
    00393                 {
    00394                         if ( dwGUID == (*itObject)->GetGUID( ) )
    00395                                 return *itObject;
    00396                 }
    00397                 return NULL;
    00398         }
    00399
    00400         //k109:  AL :p
    00401         inline DWORD SetArmorLevel (DWORD AL)
    00402         {
    00403                 Armor_Level = AL;
    00404                 return AL;
    00405         }
    00406
    00407         inline DWORD GetLevel(DWORD totalxp)
    00408         {
    00409                 unsigned long level = floor(pow((double)9 * totalxp + 7776,(float)1/5) - 6) + 1;
    00410                 return level;
    00411         }
    00412
    00413         inline void DeleteFromInventory( cObject *pcObject )
    00414         {
    00415                 iterObject_lst itObject = std::find( m_lstInventory.begin( ), m_lstInventory.end( ), pcObject );
    00416
    00417                 if ( itObject != m_lstInventory.end( ) )
    00418                         m_lstInventory.erase( itObject );
    00419         }
    00420
    00421         void CreateChildren( cClient *pcClientDestination );
    00422
    00423         WORD            m_wCurAnim;
    00424         WORD            m_wMeleeSequence;
    00425         WORD            m_wPortalCount;
    00426         WORD            m_wMoveCount;
    00427         BYTE            m_bStatSequence;
    00428         WORD            m_wModelSequenceType;
    00429         WORD            m_wModelSequence;
    00430         WORD            m_wModelNum;
    00431         float           m_flAScale;
    00432         BYTE            m_bAccessLevel;
    00433         WORD            m_wState;
    00434         DWORD           m_dwPingCount;
    00435         WORD            m_wLifeStone;
    00436         WORD            m_wMarketplace;
    00437         WORD            m_wHouseRecall;
    00438         WORD            m_wHouseID;
    00439         WORD            m_wPKlite;
    00440         WORD            m_wTimedEvent;
    00441         DWORD           m_dwNumFollowers;
    00442         DWORD           m_dwNumDeaths;
    00443         BYTE            m_bFlagCount;
    00444
    00445         // Spell Variables
    00446         WORD            m_wSpellCount;
    00447         DWORD           m_dwSpellUnknown;
    00448         cSpellBook      m_SpellBook[100];
    00449         cSpellTab       m_SpellTabs[7];
    00450         DWORD           m_dwInventoryCount;
    00451         cInventory      m_Inventory[300];
    00452         vInventory      m_vInventory[300];
    00453
    00454         //Cube:  Array to hold inventory item GUIDs
    00455         DWORD m_InvGUIDs[300];
    00456
    00457         cLocation       m_PreviousLocation;
    00458         cStats          m_cStats;
    00459         BYTE            m_fIsPK;
    00460         DWORD           m_CorpseTarget;
    00461         DWORD           m_DmgTypeEquipped;
    00462
    00463         //Fellowship stuff
    00464         bool            inFellow;
    00465
    00466         //Character Option Flag
    00467         DWORD           m_dwOptions;
    00468
    00469         std::list< cObject * >  m_lstInventory;
    00470         std::string sAccount_Name;
    00471
    00472         cWeapon *myWeapon;
    00473         cShield *myShield;
    00474         cAmmo   *myAmmo;
    00475
    00476 private:
    00477         char            m_strCharacterName[32];
    00478
    00479         DWORD           m_dwBurden;
    00480         DWORD           m_dwPyreals;
    00481         DWORD           m_dwTotalXP;
    00482         DWORD           m_dwUnassignedXP;
    00483         WORD            m_wRank;
    00484         BYTE            m_bTotalSkillCredits;
    00485         BYTE            m_bSkillCredits;
    00486         DWORD           m_dwDeaths;
    00487         DWORD           m_dwBirth;
    00488         DWORD           m_dwNumLogins;
    00489
    00490         //Cubem0j0: Add support for Avatar armor level.
    00491         DWORD           Armor_Level;
    00492         DWORD           m_dwTotal_exp_spent_strength;
    00493
    00494         cObject         *m_pcCombatTarget;
    00495
    00496         WORD            m_wRace;
    00497         WORD            m_wGender;
    00498         WORD            m_wClass;
    00499
    00500         char            m_strRaceName[20];
    00501         char            m_strSexName[20];
    00502         char            m_strClassName[20];
    00503
    00504         double          m_dblSkinShade;
    00505         WORD            m_wHairColor;
    00506         double          m_dblHairShade;
    00507         WORD            m_wHairStyle;
    00508         WORD            m_wEyeColor;
    00509
    00510         WORD            m_wHead;
    00511         WORD            m_wNose;
    00512         WORD            m_wChin;
    00513
    00514         WORD            m_wPaletteCode;
    00515
    00516         //k109:  Added this for books.
    00517
    00518
    00519         //k109:  Struct for palette:
    00520         struct PaletteChange
    00521         {
    00522                 WORD m_wNewPalette;
    00523                 BYTE m_ucOffset;
    00524                 BYTE m_ucLength;
    00525         } pc;
    00526
    00527         //k109: Struct for Texture Change
    00528         #pragma pack( push, 1 )
    00529         struct TextureChange
    00530         {
    00531                 BYTE m_bModelIndex;
    00532                 WORD m_wOldTexture;
    00533                 WORD m_wNewTexture;
    00534         } tc;
    00535         #pragma pack(pop)
    00536
    00537         //k109: Struct for Model Change
    00538         #pragma pack( push, 1 )
    00539         struct ModelChange
    00540         {
    00541                 BYTE m_bModelIndex;
    00542                 WORD m_wNewModel;
    00543         } mc;
    00544         #pragma pack(pop)
    00545
    00546
    00547         //k109: variables for holding Base Attributes
    00548         int base_strength;
    00549         int base_endurance;
    00550         int base_coordination;
    00551         int base_quickness;
    00552         int base_focus;
    00553         int base_self;
    00554
    00555         //k109: variables for holding base Vitals
    00556         int base_health;
    00557         int base_stamina;
    00558         int base_mana;
    00559
    00560         //also need vars to hold current exp spent on Attributes
    00561         DWORD strength_exp_cost;
    00562         DWORD endurance_exp_cost;
    00563         DWORD coordination_exp_cost;
    00564         DWORD quickness_exp_cost;
    00565         DWORD focus_exp_cost;
    00566         DWORD self_exp_cost;
    00567
    00568         //Vitals exp spent
    00569         DWORD health_exp_cost;
    00570         DWORD stamina_exp_cost;
    00571         DWORD mana_exp_cost;
    00572
    00573         /*
    00574         //Base skills
    00575         int base_axe;
    00576         int base_bow;
    00577         int base_crossbow;
    00578         int base_dagger;
    00579         int base_mace;
    00580         int base_meleed;
    00581         int base_missiled;
    00582         int base_spear;
    00583         int base_staff;
    00584         int base_sword;
    00585         int base_tweapons;
    00586         int base_unarmed;
    00587         int base_arcane;
    00588         int base_magicd;
    00589         int base_manac;
    00590         int base_itemtink;
    00591         int base_assess_person;
    00592         int base_deception;
    00593         int base_healing;
    00594         int base_jump;
    00595         int base_lockpick;
    00596         int base_run;
    00597         int base_assess_creature;
    00598         int base_weapontink;
    00599         int base_armortink;
    00600         int base_mitink;
    00601         int base_creature;
    00602         int base_item;
    00603         int base_life;
    00604         int base_war;
    00605         int base_leadership;
    00606         int base_loyalty;
    00607         int base_fletching;
    00608         int base_alchemy;
    00609         int base_cooking;
    00610         int base_salvage;
    00611
    00612         //Skills experience spent
    00613         DWORD axe_exp_spent;
    00614         DWORD bow_exp_spent;
    00615         DWORD crossbow_exp_spent;
    00616         DWORD dagger_exp_spent;
    00617         DWORD mace_exp_spent;
    00618         DWORD meleed_exp_spent;
    00619         DWORD missiled_exp_spent;
    00620         DWORD spear_exp_spent;
    00621         DWORD staff_exp_spent;
    00622         DWORD sword_exp_spent;
    00623         DWORD tweapons_exp_spent;
    00624         DWORD unarmed_exp_spent;
    00625         DWORD arcane_exp_spent;
    00626         DWORD magicd_exp_spent;
    00627         DWORD manac_exp_spent;
    00628         DWORD itemtink_exp_spent;
    00629         DWORD assess_person_exp_spent;
    00630         DWORD deception_exp_spent;
    00631         DWORD healing_exp_spent;
    00632         DWORD jump_exp_spent;
    00633         DWORD lockpick_exp_spent;
    00634         DWORD run_exp_spent;
    00635         DWORD assess_creature_exp_spent;
    00636         DWORD weapontink_exp_spent;
    00637         DWORD armortink_exp_spent;
    00638         DWORD mitink_exp_spent;
    00639         DWORD creature_exp_spent;
    00640         DWORD item_exp_spent;
    00641         DWORD life_exp_spent;
    00642         DWORD war_exp_spent;
    00643         DWORD leadership_exp_spent;
    00644         DWORD loyalty_exp_spent;
    00645         DWORD fletching_exp_spent;
    00646         DWORD alchemy_exp_spent;
    00647         DWORD cooking_exp_spent;
    00648         DWORD salvage_exp_spent;
    00649         */
    00650
    00651         BYTE                    m_bBasicPaletteChange;
    00652         DWORD                   m_wBasicPaletteVector;
    00653         sPaletteChange  m_BasicVectorPal[255];
    00654
    00655         BYTE                    m_bBasicTextureChange;
    00656         DWORD                   m_wBasicTextureVector;
    00657         sTextureChange  m_BasicVectorTex[255];
    00658
    00659         BYTE                    m_bBasicModelChange;
    00660         DWORD                   m_wBasicModelVector;
    00661         sModelChange    m_BasicVectorMod[255];
    00662
    00663         //Cube:  Change model variables
    00664         BYTE                    m_bPaletteChange;
    00665         DWORD                   m_wPaletteVector;
    00666         sPaletteChange  m_vectorPal[255];
    00667
    00668         BYTE                    m_bTextureChange;
    00669         DWORD                   m_wTextureVector;
    00670         sTextureChange  m_vectorTex[255];
    00671
    00672         BYTE                    m_bModelChange;
    00673         DWORD                   m_wModelVector;
    00674         sModelChange    m_vectorMod[255];
    00675
    00676         DWORD                   m_dwAllegianceID;
    00677         DWORD                   m_dwFellowshipID;
    00678 };
    00679
    00680 //Inline Functions
    00681 //================
    00682
    00683 inline cMessage cAvatar::Particle( DWORD dwParticleID )
    00684 {
    00685         cMessage cParticle;
    00686         cParticle << 0xF755L << m_dwGUID << dwParticleID << 0x3F2B4E94L;
    00687
    00688         return cParticle;
    00689 }
    00690
    00691 inline cMessage cAvatar::SoundEffect(DWORD dwSound, float flPlaySpeed )
    00692 {
    00693         cMessage cParticle;
    00694         cParticle << 0xF750L << m_dwGUID << dwSound << flPlaySpeed;
    00695
    00696         return cParticle;
    00697 }
    00698
    00699 inline void cAvatar::SetLifestone( cLocation myLifestone )
    00700 {
    00701         m_LSLoc.m_dwLandBlock   = myLifestone.m_dwLandBlock;
    00702         m_LSLoc.m_flX                   = myLifestone.m_flX;
    00703         m_LSLoc.m_flY                   = myLifestone.m_flY;
    00704         m_LSLoc.m_flZ                   = myLifestone.m_flZ;
    00705         m_LSLoc.m_flA                   = myLifestone.m_flA;
    00706         m_LSLoc.m_flB                   = myLifestone.m_flB;
    00707         m_LSLoc.m_flC                   = myLifestone.m_flC;
    00708         m_LSLoc.m_flW                   = myLifestone.m_flW;
    00709 }
    00710
    00711 #endif  // #ifndef __AVATAR_H