mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core/Auras): Implement Roc form (#13959)
Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com> Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user