diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3133aea22..eab51874b 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2808,6 +2808,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo return; Unit* target = aurApp->GetTarget(); + Unit* caster = GetCaster(); if (apply) { @@ -2822,6 +2823,19 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo creatureEntry = 15665; } + // Festive Brewfest Mount + if (!GetBase()->HasEffectType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && target->HasAura(FRESH_BREWFEST_HOPS)) + { + if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) + { + creatureEntry = GREAT_BREWFEST_KODO; + } + else + { + creatureEntry = BREWFEST_KODO; + } + } + CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry); if (!ci) { @@ -5365,6 +5379,36 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } } break; + case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount + if (target->HasAuraType(SPELL_AURA_MOUNTED) && !target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + { + uint32 creatureEntry = 0; + + if (apply) + { + if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) + { + creatureEntry = GREAT_BREWFEST_KODO; + } + else + { + creatureEntry = BREWFEST_KODO; + } + } + else + { + creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue(); + } + + if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry)) + { + uint32 displayID = ObjectMgr::ChooseDisplayId(creatureInfo); + sObjectMgr->GetCreatureModelRandomGender(&displayID); + + target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID); + } + } + break; } break; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index ab49681fc..290aea429 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -28,6 +28,13 @@ class SpellInfo; typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uint8 mode, bool apply) const; +enum BrewfestEntries +{ + BREWFEST_KODO = 30507, + GREAT_BREWFEST_KODO = 27707, + FRESH_BREWFEST_HOPS = 66052 +}; + class AuraEffect { friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32* baseAmount);