Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Player.h

    r268 r272  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1919 */ 
    2020 
     
    3434#include "WorldSession.h" 
    3535#include "Pet.h" 
    36 #include "MapReference.h" 
    3736#include "Util.h"                                           // for Tokens typedef 
    3837 
     
    781780 
    782781/// Type of environmental damages 
    783 enum EnviromentalDamage 
     782enum EnvironmentalDamageType 
    784783{ 
    785784    DAMAGE_EXHAUSTED = 0, 
     
    898897        void AddToWorld(); 
    899898        void RemoveFromWorld(); 
     899        // always active 
     900        void setActive(bool) {} 
    900901 
    901902        void SetViewport(uint64 guid, bool movable); 
     
    11241125        uint32 GetArmorProficiency() const { return m_ArmorProficiency; } 
    11251126        bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; } 
    1126         bool IsUseEquipedWeapon( bool mainhand ) const 
     1127        bool IsUseEquippedWeapon( bool mainhand ) const 
    11271128        { 
    11281129            // disarm applied only to mainhand weapon 
     
    13061307                SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0); 
    13071308            else 
    1308                 SetMoney (GetMoney() < uint32(MAX_MONEY_AMOUNT - d) ? GetMoney() + d : MAX_MONEY_AMOUNT); 
     1309                SetMoney (GetMoney() < MAX_MONEY_AMOUNT - d ? GetMoney() + d : MAX_MONEY_AMOUNT); 
    13091310 
    13101311            // "At Gold Limit" 
     
    14281429        PlayerSpellMap const& GetSpellMap() const { return m_spells; } 
    14291430        PlayerSpellMap      & GetSpellMap()       { return m_spells; } 
     1431        ActionButtonList const& GetActionButtonList() const { return m_actionButtons; } 
    14301432 
    14311433        void AddSpellMod(SpellModifier* mod, bool apply); 
     
    15171519        void SendUpdateToOutOfRangeGroupMembers(); 
    15181520 
    1519         void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); Player::SetUInt32ValueInDB(PLAYER_GUILDID, GuildId, GetGUID()); } 
    1520         void SetRank(uint32 rankId){ SetUInt32Value(PLAYER_GUILDRANK, rankId); Player::SetUInt32ValueInDB(PLAYER_GUILDRANK, rankId, GetGUID()); } 
     1521        void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); Player::SetUInt32ValueInDB(PLAYER_GUILDID, GuildId, this->GetGUID()); } 
     1522        void SetRank(uint32 rankId){ SetUInt32Value(PLAYER_GUILDRANK, rankId); Player::SetUInt32ValueInDB(PLAYER_GUILDRANK, rankId, this->GetGUID()); } 
    15211523        void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } 
    15221524        uint32 GetGuildId() { return GetUInt32Value(PLAYER_GUILDID);  } 
     
    15311533        { 
    15321534            SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * 6), ArenaTeamId); 
    1533             SetUInt32ValueInDB(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * 6), ArenaTeamId, GetGUID()); 
     1535            SetUInt32ValueInDB(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * 6), ArenaTeamId, this->GetGUID()); 
    15341536        } 
    15351537        uint32 GetArenaTeamId(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * 6)); } 
     
    16071609        void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); 
    16081610 
    1609         //Low Level Packets 
     1611                //Low Level Packets 
    16101612        void PlaySound(uint32 Sound, bool OnlySelf); 
    16111613        //notifiers 
     
    16391641        void KillPlayer(); 
    16401642        uint32 GetResurrectionSpellId(); 
    1641         void ResurrectPlayer(float restore_percent, bool applySickness = false); 
     1643        void ResurrectPlayer(float restore_percent, bool updateToWorld = true, bool applySickness = false); 
    16421644        void BuildPlayerRepop(); 
    16431645        void RepopAtGraveyard(); 
     
    17611763        void SetRegularAttackTime(); 
    17621764        void SetBaseModValue(BaseModGroup modGroup, BaseModType modType, float value) { m_auraBaseMod[modGroup][modType] = value; } 
    1763         void HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply); 
     1765        void HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply, bool affectStats = true); 
    17641766        float GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const; 
    17651767        float GetTotalBaseModValue(BaseModGroup modGroup) const; 
     
    17681770        void _RemoveAllStatBonuses(); 
    17691771 
    1770         void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply); 
     1772        void _ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply); 
    17711773        void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply); 
    17721774        void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply); 
     
    19331935 
    19341936        /*********************************************************/ 
    1935         /***              ENVIROMENTAL SYSTEM                  ***/ 
    1936         /*********************************************************/ 
    1937  
    1938         void EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage); 
     1937        /***              ENVIRONMENTAL SYSTEM                  ***/ 
     1938        /*********************************************************/ 
     1939 
     1940        void EnvironmentalDamage(uint64 guid, EnvironmentalDamageType type, uint32 damage); 
    19391941 
    19401942        /*********************************************************/ 
     
    20612063 
    20622064        GridReference<Player> &GetGridRef() { return m_gridRef; } 
    2063         MapReference &GetMapRef() { return m_mapRef; } 
    2064  
    20652065        bool isAllowedToLoot(Creature* creature); 
    20662066 
     
    23082308 
    23092309        GridReference<Player> m_gridRef; 
    2310         MapReference m_mapRef; 
    23112310}; 
    23122311