Changeset 174 for trunk/src/game/Unit.h
- Timestamp:
- 11/19/08 13:43:15 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Unit.h
r161 r174 990 990 void SetPet(Pet* pet); 991 991 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 992 1007 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()); } 993 1013 994 1014 CharmInfo* GetCharmInfo() { return m_charmInfo; } 995 1015 CharmInfo* InitCharmInfo(Unit* charm); 1016 void UncharmSelf(); 1017 void UnpossessSelf(bool attack); 996 1018 997 1019 Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); … … 1317 1339 1318 1340 CharmInfo *m_charmInfo; 1341 bool m_isPossessed; 1319 1342 1320 1343 virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;