commit
51ca512b61
@ -462,6 +462,22 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* u
|
||||
if (send_value & UNIT_DYNFLAG_TAPPED && is_tapped)
|
||||
{ send_value = send_value & ~UNIT_DYNFLAG_TAPPED; }
|
||||
|
||||
// Checking SPELL_AURA_EMPATHY and caster
|
||||
if (send_value & UNIT_DYNFLAG_SPECIALINFO && ((Unit*)this)->IsAlive())
|
||||
{
|
||||
bool bIsEmpathy = false;
|
||||
bool bIsCaster = false;
|
||||
Unit::AuraList const& mAuraEmpathy = ((Unit*)this)->GetAurasByType(SPELL_AURA_EMPATHY);
|
||||
for (Unit::AuraList::const_iterator itr = mAuraEmpathy.begin(); !bIsCaster && itr != mAuraEmpathy.end(); ++itr)
|
||||
{
|
||||
bIsEmpathy = true; // Empathy by aura set
|
||||
if ((*itr)->GetCasterGuid() == target->GetObjectGuid())
|
||||
bIsCaster = true; // target is the caster of an empathy aura
|
||||
}
|
||||
if (bIsEmpathy && !bIsCaster) // Empathy by aura, but target is not the caster
|
||||
send_value &= ~UNIT_DYNFLAG_SPECIALINFO;
|
||||
}
|
||||
|
||||
*data << send_value;
|
||||
}
|
||||
else
|
||||
|
@ -1507,6 +1507,10 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
|
||||
Powers PowerType = POWER_MANA;
|
||||
Unit* target = GetTarget();
|
||||
|
||||
// remove SPELL_AURA_EMPATHY
|
||||
target->RemoveSpellsCausingAura(SPELL_AURA_EMPATHY);
|
||||
|
||||
|
||||
switch (form)
|
||||
{
|
||||
case FORM_CAT:
|
||||
@ -4108,12 +4112,12 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
||||
|
||||
void Aura::HandleAuraEmpathy(bool apply, bool /*Real*/)
|
||||
{
|
||||
if (GetTarget()->GetTypeId() != TYPEID_UNIT)
|
||||
{ return; }
|
||||
Unit* target = GetTarget();
|
||||
|
||||
CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(GetTarget()->GetEntry());
|
||||
if (ci && ci->CreatureType == CREATURE_TYPE_BEAST)
|
||||
{ GetTarget()->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply); }
|
||||
// This aura is expected to only work with CREATURE_TYPE_BEAST or players
|
||||
CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(target->GetEntry());
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || (target->GetTypeId() == TYPEID_UNIT && ci && ci->CreatureType == CREATURE_TYPE_BEAST))
|
||||
target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraUntrackable(bool apply, bool /*Real*/)
|
||||
|
Loading…
x
Reference in New Issue
Block a user