diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 77b261f5716..b7cb5aaaaa4 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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 @@ -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()) {