Skip to content

Commit

Permalink
Update equipment at aura transform apply/remove for creature case
Browse files Browse the repository at this point in the history
Signed-off-by: NoFantasy <nofantasy@nf.no>

(based on commit 352d092)
  • Loading branch information
NoFantasy authored and VladimirMangos committed Apr 19, 2010
1 parent a9515a5 commit e7d587f
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/game/SpellAuras.cpp
Expand Up @@ -2940,22 +2940,26 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
}
else
{
uint32 model_id;

CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(m_modifier.m_miscvalue);
if (!ci)
{
//pig pink ^_^
m_target->SetDisplayId(16358);
model_id = 16358; // pig pink ^_^
sLog.outError("Auras: unknown creature id = %d (only need its modelid) Form Spell Aura Transform in Spell ID = %d", m_modifier.m_miscvalue, GetId());
}
else
{
// Will use the default model here
m_target->SetDisplayId(ci->DisplayID_A[0]);
model_id = ci->DisplayID_A[0]; // Will use the default model here

// Dragonmaw Illusion (set mount model also)
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->SetDisplayId(model_id);

// creature case, need to update equipment
if (ci && m_target->GetTypeId() == TYPEID_UNIT)
((Creature*)m_target)->LoadEquipment(ci->equipmentId, true);

// Dragonmaw Illusion (set mount model also)
if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED).empty())
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
}

// update active transform spell only not set or not overwriting negative by positive case
Expand All @@ -2981,7 +2985,11 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
m_target->setTransForm(0);
m_target->SetDisplayId(m_target->GetNativeDisplayId());

// re-aplly some from still active with preference negative cases
// apply default equipment for creature case
if (m_target->GetTypeId() == TYPEID_UNIT)
((Creature*)m_target)->LoadEquipment(((Creature*)m_target)->GetCreatureInfo()->equipmentId, true);

// re-apply some from still active with preference negative cases
Unit::AuraList const& otherTransforms = m_target->GetAurasByType(SPELL_AURA_TRANSFORM);
if (!otherTransforms.empty())
{
Expand Down

0 comments on commit e7d587f

Please sign in to comment.