diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ab8a0b2b3..95f67a636 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16870,11 +16870,11 @@ void Unit::RestoreDisplayId() AuraEffect* handledAura = nullptr; AuraEffect* handledAuraForced = nullptr; // try to receive model from transform auras - Unit::AuraEffectList const& transforms = GetAuraEffectsByType(SPELL_AURA_TRANSFORM); + AuraEffectList const& transforms = GetAuraEffectsByType(SPELL_AURA_TRANSFORM); if (!transforms.empty()) { // iterate over already applied transform auras - from newest to oldest - for (Unit::AuraEffectList::const_reverse_iterator i = transforms.rbegin(); i != transforms.rend(); ++i) + for (auto i = transforms.rbegin(); i != transforms.rend(); ++i) { if (AuraApplication const* aurApp = (*i)->GetBase()->GetApplicationOfTarget(GetGUID())) { @@ -16899,14 +16899,19 @@ void Unit::RestoreDisplayId() handledAura = *i; } + AuraEffectList const& shapeshiftAura = GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT); + // xinef: order of execution is important! // first forced transform auras, then shapeshifts, then normal transform // transform aura was found if (handledAuraForced) handledAuraForced->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); - // we've found shapeshift - else if (uint32 modelId = GetModelForForm(GetShapeshiftForm())) - SetDisplayId(modelId); + else if (!shapeshiftAura.empty()) // we've found shapeshift + { + // only one such aura possible at a time + if (uint32 modelId = GetModelForForm(GetShapeshiftForm(), shapeshiftAura.front()->GetId())) + SetDisplayId(modelId); + } else if (handledAura) handledAura->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); // no auras found - set modelid to default @@ -19253,8 +19258,19 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c return CalculatePct(damage, percent); } -uint32 Unit::GetModelForForm(ShapeshiftForm form) const +uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const { + // Hardcoded cases + switch (spellId) + { + case 7090: // Bear form + return 29414; + case 35200: // Roc form + return 4877; + default: + break; + } + if (GetTypeId() == TYPEID_PLAYER) { switch (form) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 547e62b14..739bab585 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2332,7 +2332,7 @@ public: void CastPetAura(PetAura const* aura); bool IsPetAura(Aura const* aura); - [[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form) const; + [[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const; uint32 GetModelForTotem(PlayerTotemType totemType); // Redirect Threat diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1da935955..997e7e5bf 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1896,7 +1896,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo LOG_ERROR("spells.aura.effect", "Auras: Unknown Shapeshift Type: {}", GetMiscValue()); } - modelid = target->GetModelForForm(form); + modelid = target->GetModelForForm(form, GetId()); if (apply) { @@ -2135,7 +2135,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, if (apply) { // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case - if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm()) || !GetSpellInfo()->IsPositive()) + if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm(), GetId()) || !GetSpellInfo()->IsPositive()) { // special case (spell specific functionality) if (GetMiscValue() == 0)