mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Core/Spells): Item Fresh Brewfest Hops (#8010)
This commit is contained in:
committed by
GitHub
parent
faa4035de7
commit
92b3617f63
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user