Спелл
http://ru.wowhead.com/spell=1462 должен отображать подробности об нпц или игроке в формах животных только для кастера.
Патч:
Код:
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 2dfa981..728555e 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -637,17 +637,45 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
*data << (m_uint32Values[index] & ~UNIT_FLAG_NOT_SELECTABLE);
}
// hide lootable animation for unallowed players
- else if (index == UNIT_DYNAMIC_FLAGS && GetTypeId() == TYPEID_UNIT)
+ else if (index == UNIT_DYNAMIC_FLAGS)
{
- if (!target->isAllowedToLoot((Creature*)this))
- *data << (m_uint32Values[index] & ~(UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED_BY_PLAYER));
- else
+ uint32 appendValue = m_uint32Values[index];
+
+ // checking SPELL_AURA_EMPATHY and caster
+ if (((Unit*)this)->isAlive())
{
- // flag only for original loot recipent
- if (target->GetObjectGuid() == ((Creature*)this)->GetLootRecipientGuid())
- *data << m_uint32Values[index];
+ bool bIsEmpathy = false;
+ bool bIsCaster = false;
+ Unit::AuraList const& mAuraEmpathy = ((Unit*)this)->GetAurasByType(SPELL_AURA_EMPATHY);
+ for(Unit::AuraList::const_iterator i = mAuraEmpathy.begin(); i != mAuraEmpathy.end(); ++i)
+ {
+ bIsEmpathy = true;
+ if ((*i)->GetCasterGuid() == target->GetObjectGuid())
+ {
+ bIsCaster = true;
+ break;
+ }
+ }
+ if (bIsEmpathy && !bIsCaster)
+ appendValue &= ~UNIT_DYNFLAG_SPECIALINFO;
+ }
+
+ if (GetTypeId() == TYPEID_UNIT)
+ {
+ if (!target->isAllowedToLoot((Creature*)this))
+ *data << (appendValue & ~(UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED_BY_PLAYER));
else
- *data << (m_uint32Values[index] & ~(UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER));
+ {
+ // flag only for original loot recipent
+ if (target->GetObjectGuid() == ((Creature*)this)->GetLootRecipientGuid())
+ *data << appendValue;
+ else
+ *data << (appendValue & ~(UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER));
+ }
+ }
+ else
+ {
+ *data << appendValue;
}
}
else
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index bcedb01..dc89c6c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3066,6 +3066,14 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
Unit *target = GetTarget();
+ // remove SPELL_AURA_EMPATHY
+ Unit::AuraList const& mAuraEmpathy = target->GetAurasByType(SPELL_AURA_EMPATHY);
+ for(Unit::AuraList::const_iterator i = mAuraEmpathy.begin(); i != mAuraEmpathy.end(); ++i)
+ {
+ target->RemoveAurasByCasterSpell((*i)->GetId(), (*i)->GetCasterGUID());
+ i = mAuraEmpathy.begin();
+ }
+
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
if (!ssEntry)
{
@@ -6475,12 +6483,10 @@ void Aura::HandleShapeshiftBoosts(bool apply)
void Aura::HandleAuraEmpathy(bool apply, bool /*Real*/)
{
- if(GetTarget()->GetTypeId() != TYPEID_UNIT)
+ if (GetTarget()->GetTypeId() != TYPEID_UNIT && GetTarget()->GetTypeId() != TYPEID_PLAYER)
return;
- CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(GetTarget()->GetEntry());
- if(ci && ci->type == CREATURE_TYPE_BEAST)
- GetTarget()->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
+ GetTarget()->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
}
void Aura::HandleAuraUntrackable(bool apply, bool /*Real*/)
Код:
Creature Type Mask = 0x00000001 (BEAST)
Skill (Id 50) "Beast Mastery"