[7661] Fixed problem with not remove health regeneration from polymorph. Author: False.Genesis
Also fixed problem with remembering transform spell in case possible stacked negative and positive transforms. --HG-- branch : trunk
This commit is contained in:
+18
-15
@@ -3082,10 +3082,10 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real)
|
|||||||
if(GetMiscValue()==0)
|
if(GetMiscValue()==0)
|
||||||
{
|
{
|
||||||
// player applied only
|
// player applied only
|
||||||
if(m_target->GetTypeId()!=TYPEID_PLAYER)
|
if (m_target->GetTypeId()!=TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch(GetId())
|
switch (GetId())
|
||||||
{
|
{
|
||||||
// Orb of Deception
|
// Orb of Deception
|
||||||
case 16739:
|
case 16739:
|
||||||
@@ -3161,16 +3161,19 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real)
|
|||||||
if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED).empty())
|
if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED).empty())
|
||||||
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
|
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
|
||||||
}
|
}
|
||||||
m_target->setTransForm(GetId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update active transform spell only not set or not overwriting negative by positive case
|
||||||
|
if (!m_target->getTransForm() || !IsPositiveSpell(GetId()) || IsPositiveSpell(m_target->getTransForm()))
|
||||||
|
m_target->setTransForm(GetId());
|
||||||
|
|
||||||
// polymorph case
|
// polymorph case
|
||||||
if( Real && m_target->GetTypeId() == TYPEID_PLAYER && m_target->IsPolymorphed())
|
if (Real && m_target->GetTypeId() == TYPEID_PLAYER && m_target->IsPolymorphed())
|
||||||
{
|
{
|
||||||
// for players, start regeneration after 1s (in polymorph fast regeneration case)
|
// for players, start regeneration after 1s (in polymorph fast regeneration case)
|
||||||
// only if caster is Player (after patch 2.4.2)
|
// only if caster is Player (after patch 2.4.2)
|
||||||
if(IS_PLAYER_GUID(GetCasterGUID()) )
|
if (IS_PLAYER_GUID(GetCasterGUID()) )
|
||||||
((Player*)m_target)->setRegenTimer(1000);
|
((Player*)m_target)->setRegenTimer(1*IN_MILISECONDS);
|
||||||
|
|
||||||
//dismount polymorphed target (after patch 2.4.2)
|
//dismount polymorphed target (after patch 2.4.2)
|
||||||
if (m_target->IsMounted())
|
if (m_target->IsMounted())
|
||||||
@@ -3179,20 +3182,20 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// ApplyModifier(true) will reapply it if need
|
||||||
|
m_target->setTransForm(0);
|
||||||
|
m_target->SetDisplayId(m_target->GetNativeDisplayId());
|
||||||
|
|
||||||
|
// re-aplly some from still active with preference negative cases
|
||||||
Unit::AuraEffectList const& otherTransforms = m_target->GetAurasByType(SPELL_AURA_TRANSFORM);
|
Unit::AuraEffectList const& otherTransforms = m_target->GetAurasByType(SPELL_AURA_TRANSFORM);
|
||||||
if(otherTransforms.empty())
|
if (!otherTransforms.empty())
|
||||||
{
|
|
||||||
m_target->SetDisplayId(m_target->GetNativeDisplayId());
|
|
||||||
m_target->setTransForm(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// look for other transform auras
|
// look for other transform auras
|
||||||
AuraEffect* handledAura = *otherTransforms.begin();
|
AuraEffect* handledAura = *otherTransforms.begin();
|
||||||
for(Unit::AuraEffectList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
|
for(Unit::AuraEffectList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
|
||||||
{
|
{
|
||||||
// negative auras are preferred
|
// negative auras are preferred
|
||||||
if(!IsPositiveSpell((*i)->GetSpellProto()->Id))
|
if (!IsPositiveSpell((*i)->GetSpellProto()->Id))
|
||||||
{
|
{
|
||||||
handledAura = *i;
|
handledAura = *i;
|
||||||
break;
|
break;
|
||||||
@@ -3202,9 +3205,9 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dragonmaw Illusion (restore mount model)
|
// Dragonmaw Illusion (restore mount model)
|
||||||
if(GetId()==42016 && m_target->GetMountID()==16314)
|
if (GetId()==42016 && m_target->GetMountID()==16314)
|
||||||
{
|
{
|
||||||
if(!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
|
if (!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
|
||||||
{
|
{
|
||||||
uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
|
uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
|
||||||
if(CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
|
if(CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
|
||||||
|
|||||||
Reference in New Issue
Block a user