Changeset 174 for trunk/src/game/Unit.h

Show
Ignore:
Timestamp:
11/19/08 13:43:15 (17 years ago)
Author:
yumileroy
Message:

[svn] Implemented player on player and player on creature possession:
* Implemented packet and vision forwarding through possessed units
* Added new OnPossess? script call alerting scripts on when possession is applied/removed
* Moved fall damage and fall under map calculations into the Player class
* Added new PossessedAI that is applied only while possession on creature is active
* Implemented summon possessed spell effect
* Fixed Eyes of the Beast

Original author: gvcoman
Date: 2008-11-05 20:51:05-06:00

Files:
1 modified

Legend:

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

    r161 r174  
    990990        void SetPet(Pet* pet); 
    991991        void SetCharm(Unit* pet); 
     992        void SetPossessedTarget(Unit* target) 
     993        { 
     994            if (!target) return; 
     995            SetCharm(target); 
     996            target->SetCharmerGUID(GetGUID()); 
     997            target->m_isPossessed = true; 
     998        } 
     999        void RemovePossessedTarget() 
     1000        { 
     1001            if (!GetCharm()) return; 
     1002            GetCharm()->SetCharmerGUID(0); 
     1003            GetCharm()->m_isPossessed = false; 
     1004            SetCharm(0); 
     1005        } 
     1006 
    9921007        bool isCharmed() const { return GetCharmerGUID() != 0; } 
     1008        bool isPossessed() const { return m_isPossessed; } 
     1009        bool isPossessedByPlayer() const { return m_isPossessed && IS_PLAYER_GUID(GetCharmerGUID()); } 
     1010        bool isPossessing() const { return GetCharm() && GetCharm()->isPossessed(); } 
     1011        bool isPossessing(Unit* u) const { return u->isPossessed() && GetCharmGUID() == u->GetGUID(); } 
     1012        bool isPossessingCreature() const { return isPossessing() && IS_CREATURE_GUID(GetCharmGUID()); } 
    9931013 
    9941014        CharmInfo* GetCharmInfo() { return m_charmInfo; } 
    9951015        CharmInfo* InitCharmInfo(Unit* charm); 
     1016        void UncharmSelf(); 
     1017        void UnpossessSelf(bool attack); 
    9961018 
    9971019        Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); 
     
    13171339 
    13181340        CharmInfo *m_charmInfo; 
     1341        bool m_isPossessed; 
    13191342 
    13201343        virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;