*Merge.
--HG-- branch : trunk
This commit is contained in:
+10
-14
@@ -7346,19 +7346,19 @@ bool ChatHandler::HandlePossessCommand(const char* args)
|
||||
if(!pUnit)
|
||||
return false;
|
||||
|
||||
// Don't allow unlimited possession of players
|
||||
if (pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
return false;
|
||||
|
||||
pUnit->SetCharmedOrPossessedBy(m_session->GetPlayer(), true);
|
||||
|
||||
m_session->GetPlayer()->CastSpell(pUnit, 530, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnPossessCommand(const char* args)
|
||||
{
|
||||
// Use this command to also unpossess ourselves
|
||||
m_session->GetPlayer()->RemoveCharmedOrPossessedBy(NULL);
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
if(!pUnit) pUnit = m_session->GetPlayer();
|
||||
|
||||
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
|
||||
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
|
||||
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7368,11 +7368,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args)
|
||||
if (!pUnit)
|
||||
return false;
|
||||
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
pUnit->AddPlayerToVision(m_session->GetPlayer());
|
||||
|
||||
m_session->GetPlayer()->CastSpell(pUnit, 6277, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7381,6 +7377,6 @@ bool ChatHandler::HandleUnbindSightCommand(const char* args)
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
m_session->GetPlayer()->RemoveFarsightTarget();
|
||||
m_session->GetPlayer()->StopCastingBindSight();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1490,7 +1490,7 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
|
||||
pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
else
|
||||
return;
|
||||
sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetFarSight(), _player->GetGUIDLow());
|
||||
sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetFarSightGUID(), _player->GetGUIDLow());
|
||||
break;
|
||||
default:
|
||||
sLog.outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply);
|
||||
|
||||
+2
-12
@@ -161,12 +161,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
p->setDeathState(CORPSE);
|
||||
}
|
||||
else // charmed or possessed
|
||||
{
|
||||
if (_player->isPossessing())
|
||||
_player->RemovePossess(true);
|
||||
else
|
||||
_player->Uncharm();
|
||||
}
|
||||
_player->Uncharm();
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.\n", flag, spellid);
|
||||
@@ -501,12 +496,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
||||
_player->RemovePet((Pet*)pet,PET_SAVE_AS_DELETED);
|
||||
}
|
||||
else if(pet->GetGUID() == _player->GetCharmGUID())
|
||||
{
|
||||
if (_player->isPossessing())
|
||||
_player->RemovePossess(true);
|
||||
else
|
||||
_player->Uncharm();
|
||||
}
|
||||
_player->Uncharm();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-93
@@ -506,9 +506,6 @@ Player::~Player ()
|
||||
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
|
||||
itr->second.save->RemovePlayer(this);
|
||||
|
||||
if (m_uint32Values && isPossessing())
|
||||
RemovePossess(false);
|
||||
|
||||
delete m_declinedname;
|
||||
delete m_runes;
|
||||
}
|
||||
@@ -1378,12 +1375,6 @@ void Player::setDeathState(DeathState s)
|
||||
RemoveMiniPet();
|
||||
RemoveGuardians();
|
||||
|
||||
// remove possession
|
||||
if(isPossessing())
|
||||
RemovePossess(false);
|
||||
else
|
||||
RemoveFarsightTarget();
|
||||
|
||||
// save value before aura remove in Unit::setDeathState
|
||||
ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL);
|
||||
|
||||
@@ -1622,18 +1613,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
|
||||
SetSemaphoreTeleport(true);
|
||||
|
||||
// Remove any possession on the player before teleporting
|
||||
if (isPossessedByPlayer())
|
||||
((Player*)GetCharmer())->RemovePossess();
|
||||
|
||||
// Remove player's possession before teleporting
|
||||
if (isPossessing())
|
||||
RemovePossess(false);
|
||||
|
||||
// Empty vision list and clear farsight (if it hasn't already been cleared by RemovePossess) before teleporting
|
||||
RemoveAllFromVision();
|
||||
RemoveFarsightTarget();
|
||||
|
||||
// The player was ported to another map and looses the duel immediatly.
|
||||
// We have to perform this check before the teleport, otherwise the
|
||||
// ObjectAccessor won't find the flag.
|
||||
@@ -1860,12 +1839,13 @@ void Player::RemoveFromWorld()
|
||||
if(IsInWorld())
|
||||
{
|
||||
///- Release charmed creatures, unsummon totems and remove pets/guardians
|
||||
RemovePossess(false);
|
||||
Uncharm();
|
||||
StopCastingCharm();
|
||||
StopCastingBindSight();
|
||||
RemoveCharmAuras();
|
||||
RemoveBindSightAuras();
|
||||
UnsummonAllTotems();
|
||||
RemoveMiniPet();
|
||||
RemoveGuardians();
|
||||
RemoveFarsightTarget();
|
||||
}
|
||||
|
||||
for(int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; i++)
|
||||
@@ -5520,17 +5500,17 @@ void Player::SaveRecallPosition()
|
||||
|
||||
void Player::SendMessageToSet(WorldPacket *data, bool self, bool to_possessor)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageBroadcast(this, data, self, to_possessor);
|
||||
GetMap()->MessageBroadcast(this, data, self, to_possessor);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self, to_possessor);
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self, to_possessor);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor, bool own_team_only)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self, to_possessor, own_team_only);
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self, to_possessor, own_team_only);
|
||||
}
|
||||
|
||||
void Player::SendDirectMessage(WorldPacket *data)
|
||||
@@ -5972,7 +5952,7 @@ bool Player::ModifyOneFactionReputation(FactionEntry const* factionEntry, int32
|
||||
|
||||
SetFactionVisible(&itr->second);
|
||||
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
if(uint32 questid = GetQuestSlotQuestId(i))
|
||||
{
|
||||
@@ -12643,7 +12623,7 @@ void Player::SendPreparedQuest( uint64 guid )
|
||||
if( pCreature )
|
||||
{
|
||||
uint32 textid = pCreature->GetNpcTextId();
|
||||
GossipText * gossiptext = objmgr.GetGossipText(textid);
|
||||
GossipText const* gossiptext = objmgr.GetGossipText(textid);
|
||||
if( !gossiptext )
|
||||
{
|
||||
qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote
|
||||
@@ -13773,7 +13753,7 @@ void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject
|
||||
|
||||
void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if ( questid == 0 )
|
||||
@@ -13815,7 +13795,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
|
||||
|
||||
void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13858,7 +13838,7 @@ void Player::KilledMonster( uint32 entry, uint64 guid )
|
||||
{
|
||||
uint32 addkillcount = 1;
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13913,7 +13893,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
|
||||
bool isCreature = IS_CREATURE_GUID(guid);
|
||||
|
||||
uint32 addCastCount = 1;
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13980,7 +13960,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
|
||||
void Player::TalkedToCreature( uint32 entry, uint64 guid )
|
||||
{
|
||||
uint32 addTalkCount = 1;
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -14035,7 +14015,7 @@ void Player::TalkedToCreature( uint32 entry, uint64 guid )
|
||||
|
||||
void Player::MoneyChanged( uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if (!questid)
|
||||
@@ -16149,23 +16129,6 @@ void Player::SaveToDB()
|
||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||
if(Pet* pet = GetPet())
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
|
||||
//to prevent access to DB we should cache some data, which is used very often
|
||||
/*CachePlayerInfoMap::iterator _iter = objmgr.m_mPlayerInfoMap.find(GetGUIDLow());
|
||||
if(_iter != objmgr.m_mPlayerInfoMap.end())//skip new players
|
||||
{
|
||||
_iter->second->unLevel = getLevel();
|
||||
|
||||
_iter->second->unArenaInfoSlot0 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 0 * 6 + 5);
|
||||
_iter->second->unArenaInfoSlot1 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 * 6 + 5);
|
||||
_iter->second->unArenaInfoSlot2 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 2 * 6 + 5);
|
||||
|
||||
_iter->second->unfield = GetUInt32Value(UNIT_FIELD_BYTES_0);
|
||||
|
||||
_iter->second->unArenaInfoId0 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (0 * 6));
|
||||
_iter->second->unArenaInfoId1 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (1 * 6));
|
||||
_iter->second->unArenaInfoId2 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (2 * 6));
|
||||
}*/
|
||||
m_achievementMgr.SaveToDB();
|
||||
}
|
||||
|
||||
@@ -16988,6 +16951,8 @@ void Player::Uncharm()
|
||||
return;
|
||||
|
||||
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
|
||||
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
|
||||
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
|
||||
}
|
||||
|
||||
void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const
|
||||
@@ -19884,41 +19849,6 @@ void Player::HandleFallUnderMap()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::RemovePossess(bool attack)
|
||||
{
|
||||
if(Unit *u = GetCharm())
|
||||
u->RemoveCharmedOrPossessedBy(this);
|
||||
|
||||
/*else if (target->isAlive())
|
||||
{
|
||||
// If we're still hostile to our target, continue attacking otherwise reset threat and go home
|
||||
if (Unit* victim = target->getVictim())
|
||||
{
|
||||
FactionTemplateEntry const* t_faction = target->getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* v_faction = victim->getFactionTemplateEntry();
|
||||
// Unit::IsHostileTo will always return true since the unit is always hostile to its victim
|
||||
if (t_faction && v_faction && !t_faction->IsHostileTo(*v_faction))
|
||||
{
|
||||
// Stop combat and remove the target from the threat lists of all its victims
|
||||
target->CombatStop();
|
||||
target->getHostilRefManager().deleteReferences();
|
||||
target->DeleteThreatList();
|
||||
target->GetMotionMaster()->Clear();
|
||||
target->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->GetMotionMaster()->Clear();
|
||||
target->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
// Add high amount of threat on the player
|
||||
if(attack)
|
||||
target->AddThreat(this, 1000000.0f);
|
||||
}*/
|
||||
}
|
||||
|
||||
/*void Player::SetViewport(uint64 guid, bool moveable)
|
||||
{
|
||||
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, 8+1);
|
||||
@@ -19939,24 +19869,23 @@ void Player::SetBindSight(Unit *target)
|
||||
WorldObject* Player::GetFarsightTarget() const
|
||||
{
|
||||
// Players can have in farsight field another player's guid, a creature's guid, or a dynamic object's guid
|
||||
if(uint64 guid = GetFarSight())
|
||||
if(uint64 guid = GetFarSightGUID())
|
||||
return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_FARSIGHTOBJ);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Player::RemoveFarsightTarget()
|
||||
void Player::StopCastingBindSight()
|
||||
{
|
||||
if (WorldObject* target = GetFarsightTarget())
|
||||
{
|
||||
if (target->isType(TYPEMASK_PLAYER | TYPEMASK_UNIT))
|
||||
((Unit*)target)->RemovePlayerFromVision(this);
|
||||
((Unit*)target)->RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
|
||||
}
|
||||
ClearFarsight();
|
||||
}
|
||||
|
||||
void Player::ClearFarsight()
|
||||
{
|
||||
if(GetFarSight())
|
||||
if(GetFarSightGUID())
|
||||
{
|
||||
SetFarSightGUID(0);
|
||||
WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
|
||||
@@ -19970,7 +19899,7 @@ void Player::SetFarsightTarget(WorldObject* obj)
|
||||
return;
|
||||
|
||||
// Remove the current target if there is one
|
||||
RemoveFarsightTarget();
|
||||
StopCastingBindSight();
|
||||
|
||||
SetFarSightGUID(obj->GetGUID());
|
||||
}
|
||||
|
||||
+3
-12
@@ -2022,23 +2022,14 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void EnterVehicle(Vehicle *vehicle);
|
||||
void ExitVehicle(Vehicle *vehicle);
|
||||
|
||||
//void SetViewport(uint64 guid, bool movable);
|
||||
void SetMover(Unit* target) { m_mover = target ? target : this; }
|
||||
void RemovePossess(bool attack = true);
|
||||
void StopCharmOrPossess()
|
||||
{
|
||||
if(isPossessing())
|
||||
RemovePossess(true);
|
||||
else if(GetCharm())
|
||||
Uncharm();
|
||||
}
|
||||
|
||||
uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); }
|
||||
void StopCastingCharm() { Uncharm(); }
|
||||
void StopCastingBindSight();
|
||||
uint64 GetFarSightGUID() const { return GetUInt64Value(PLAYER_FARSIGHT); }
|
||||
void SetFarSightGUID(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); }
|
||||
void SetBindSight(Unit *target);
|
||||
WorldObject* GetFarsightTarget() const;
|
||||
void ClearFarsight();
|
||||
void RemoveFarsightTarget();
|
||||
void SetFarsightTarget(WorldObject* target);
|
||||
// Controls if vision is currently on farsight object, updated in FAR_SIGHT opcode
|
||||
void SetFarsightVision(bool apply) { m_farsightVision = apply; }
|
||||
|
||||
+5
-2
@@ -2071,7 +2071,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::cancel(bool report)
|
||||
void Spell::cancel()
|
||||
{
|
||||
if(m_spellState == SPELL_STATE_FINISHED)
|
||||
return;
|
||||
@@ -2101,7 +2101,7 @@ void Spell::cancel(bool report)
|
||||
m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
|
||||
SendChannelUpdate(0);
|
||||
SendInterrupted(0);
|
||||
SendCastResult(report ? SPELL_FAILED_INTERRUPTED : SPELL_FAILED_DONT_REPORT);
|
||||
SendCastResult(SPELL_FAILED_INTERRUPTED);
|
||||
} break;
|
||||
|
||||
default:
|
||||
@@ -5580,6 +5580,9 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
|
||||
// another non-melee non-delayed spell is casted now, abort
|
||||
m_Spell->cancel();
|
||||
}
|
||||
// Check if target of channeled spell still in range
|
||||
else if (m_Spell->CheckRange(false))
|
||||
m_Spell->cancel();
|
||||
else
|
||||
{
|
||||
// do the action (pass spell to channeling state)
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ class Spell
|
||||
~Spell();
|
||||
|
||||
void prepare(SpellCastTargets const* targets, Aura* triggeredByAura = NULL);
|
||||
void cancel(bool report = true);
|
||||
void cancel();
|
||||
void update(uint32 difftime);
|
||||
void cast(bool skipCheck = false);
|
||||
void finish(bool ok = true);
|
||||
|
||||
@@ -2240,11 +2240,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||
{
|
||||
Creature *totem = ObjectAccessor::GetCreature(*caster, guid);
|
||||
if (totem && totem->isTotem())
|
||||
totem->AddPlayerToVision((Player*)caster);
|
||||
((Player*)caster)->CastSpell(totem, 6277, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
((Player*)caster)->RemoveFarsightTarget();
|
||||
((Player*)caster)->StopCastingBindSight();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -6296,8 +6296,8 @@ void Spell::EffectKnockBack(uint32 i)
|
||||
float dy = unitTarget->GetPositionY() - y;
|
||||
float dist = sqrt((dx*dx) + (dy*dy));
|
||||
|
||||
float vsin = dx / dist;
|
||||
float vcos = dy / dist;
|
||||
float vcos = dx / dist;
|
||||
float vsin = dy / dist;
|
||||
float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
|
||||
float speedz = float(damage/-10);
|
||||
|
||||
|
||||
@@ -172,10 +172,6 @@ void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
|
||||
|
||||
void TemporarySummon::UnSummon()
|
||||
{
|
||||
RemoveCharmedOrPossessedBy(NULL);
|
||||
|
||||
CombatStop();
|
||||
|
||||
CleanupsBeforeDelete();
|
||||
AddObjectToRemoveList();
|
||||
|
||||
|
||||
+12
-24
@@ -4142,8 +4142,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
&& AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
|
||||
//don't stop channeling of scripted spells (this is actually a hack)
|
||||
{
|
||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(false);
|
||||
channeled = true;
|
||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4180,14 +4179,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
|
||||
delete Aur;
|
||||
|
||||
if(channeled)
|
||||
{
|
||||
//if target is not caster remove auras also on caster
|
||||
if (caster!=this)
|
||||
caster->RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
|
||||
RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
|
||||
}
|
||||
|
||||
if(statue)
|
||||
statue->UnSummon();
|
||||
|
||||
@@ -7677,22 +7668,25 @@ void Unit::RemovePlayerFromVision(Player* plr)
|
||||
plr->ClearFarsight();
|
||||
}
|
||||
|
||||
void Unit::RemoveAllFromVision()
|
||||
void Unit::RemoveBindSightAuras()
|
||||
{
|
||||
while (!m_sharedVision.empty())
|
||||
/*while (!m_sharedVision.empty())
|
||||
{
|
||||
Player* plr = *m_sharedVision.begin();
|
||||
m_sharedVision.erase(m_sharedVision.begin());
|
||||
plr->ClearFarsight();
|
||||
}
|
||||
}*/
|
||||
RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
|
||||
}
|
||||
|
||||
void Unit::UncharmSelf()
|
||||
void Unit::RemoveCharmAuras()
|
||||
{
|
||||
if (!GetCharmer())
|
||||
return;
|
||||
|
||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
|
||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
|
||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
|
||||
}
|
||||
|
||||
void Unit::UnsummonAllTotems()
|
||||
@@ -9756,10 +9750,6 @@ void Unit::setDeathState(DeathState s)
|
||||
RemoveAllAurasOnDeath();
|
||||
UnsummonAllTotems();
|
||||
|
||||
// Possessed unit died, restore control to possessor
|
||||
RemoveCharmedOrPossessedBy(NULL);
|
||||
RemoveAllFromVision();
|
||||
|
||||
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
|
||||
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
|
||||
// remove aurastates allowing special moves
|
||||
@@ -10716,15 +10706,13 @@ void Unit::CleanupsBeforeDelete()
|
||||
{
|
||||
if(m_uint32Values) // only for fully created object
|
||||
{
|
||||
RemoveCharmedOrPossessedBy(NULL);
|
||||
RemoveAllFromVision();
|
||||
RemoveAllAuras();
|
||||
InterruptNonMeleeSpells(true);
|
||||
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
|
||||
CombatStop();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
getHostilRefManager().setOnlineOfflineState(false);
|
||||
RemoveAllAuras();
|
||||
RemoveAllGameObjects();
|
||||
RemoveAllDynObjects();
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
@@ -12384,14 +12372,14 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
|
||||
|
||||
// Charmer stop charming
|
||||
if(charmer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)charmer)->StopCharmOrPossess();
|
||||
((Player*)charmer)->StopCastingCharm();
|
||||
|
||||
// Charmed stop charming
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->StopCharmOrPossess();
|
||||
((Player*)this)->StopCastingCharm();
|
||||
|
||||
// Charmed stop being charmed
|
||||
RemoveCharmedOrPossessedBy(NULL);
|
||||
RemoveCharmAuras();
|
||||
|
||||
// Set charmed
|
||||
charmer->SetCharm(this);
|
||||
|
||||
+7
-6
@@ -1192,10 +1192,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
CharmInfo* GetCharmInfo() { return m_charmInfo; }
|
||||
CharmInfo* InitCharmInfo(Unit* charm);
|
||||
SharedVisionList const& GetSharedVisionList() { return m_sharedVision; }
|
||||
void RemoveBindSightAuras();
|
||||
void RemoveCharmAuras();
|
||||
void AddPlayerToVision(Player* plr);
|
||||
void RemovePlayerFromVision(Player* plr);
|
||||
void RemoveAllFromVision();
|
||||
void UncharmSelf();
|
||||
|
||||
Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0);
|
||||
|
||||
@@ -1481,10 +1481,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void SetUnitMovementFlags(uint32 f) { m_unit_movement_flags = f; }
|
||||
|
||||
void SetControlled(bool apply, UnitState state);
|
||||
void SetFeared(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/);
|
||||
void SetConfused(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/);
|
||||
void SetStunned(bool apply);
|
||||
void SetRooted(bool apply);
|
||||
|
||||
void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); }
|
||||
void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); }
|
||||
@@ -1591,6 +1587,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 cooldown);
|
||||
bool HandleMeandingAuraProc(Aura* triggeredByAura);
|
||||
|
||||
void SetFeared(bool apply);
|
||||
void SetConfused(bool apply);
|
||||
void SetStunned(bool apply);
|
||||
void SetRooted(bool apply);
|
||||
|
||||
uint32 m_state; // Even derived shouldn't modify
|
||||
uint32 m_CombatTimer;
|
||||
uint32 m_lastManaUse; // msecs
|
||||
|
||||
@@ -249,14 +249,6 @@ void WorldSession::LogoutPlayer(bool Save)
|
||||
|
||||
if (_player)
|
||||
{
|
||||
// Unpossess the current possessed unit of player
|
||||
_player->StopCharmOrPossess();
|
||||
|
||||
// Remove any possession of this player on logout
|
||||
_player->RemoveCharmedOrPossessedBy(NULL);
|
||||
|
||||
//_player->DestroyForNearbyPlayers();
|
||||
|
||||
if (uint64 lguid = GetPlayer()->GetLootGUID())
|
||||
DoLootRelease(lguid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user