mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Auras: Implemented SPELL_AURA_ADV_FLYING
This commit is contained in:
@@ -24560,18 +24560,15 @@ void Player::SendInitialPacketsAfterAddToMap()
|
||||
// set some aura effects that send packet to player client after add player to map
|
||||
// SendMessageToSet not send it to player not it map, only for aura that not changed anything at re-apply
|
||||
// same auras state lost at far teleport, send it one more time in this case also
|
||||
static const AuraType auratypes[] =
|
||||
static constexpr AuraType auratypes[] =
|
||||
{
|
||||
SPELL_AURA_MOD_FEAR, SPELL_AURA_TRANSFORM, SPELL_AURA_WATER_WALK,
|
||||
SPELL_AURA_FEATHER_FALL, SPELL_AURA_HOVER, SPELL_AURA_SAFE_FALL,
|
||||
SPELL_AURA_FLY, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_NONE
|
||||
SPELL_AURA_FLY, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_ADV_FLYING
|
||||
};
|
||||
for (AuraType const* itr = &auratypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr)
|
||||
{
|
||||
Unit::AuraEffectList const& auraList = GetAuraEffectsByType(*itr);
|
||||
if (!auraList.empty())
|
||||
for (AuraType auraType : auratypes)
|
||||
if (Unit::AuraEffectList const& auraList = GetAuraEffectsByType(auraType); !auraList.empty())
|
||||
auraList.front()->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true);
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_MOD_STUN) || HasAuraType(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY))
|
||||
SetRooted(true);
|
||||
|
||||
@@ -8216,8 +8216,12 @@ void Unit::UpdateMountCapability()
|
||||
if (!aurEff->GetAmount())
|
||||
aurEff->GetBase()->Remove();
|
||||
else if (MountCapabilityEntry const* capability = sMountCapabilityStore.LookupEntry(aurEff->GetAmount())) // aura may get removed by interrupt flag, reapply
|
||||
{
|
||||
SetFlightCapabilityID(capability->FlightCapabilityID, true);
|
||||
|
||||
if (!HasAura(capability->ModSpellAuraID))
|
||||
CastSpell(this, capability->ModSpellAuraID, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -537,7 +537,7 @@ enum AuraType : uint32
|
||||
SPELL_AURA_MOD_LEECH = 443, // NYI
|
||||
SPELL_AURA_444 = 444,
|
||||
SPELL_AURA_445 = 445,
|
||||
SPELL_AURA_446 = 446,
|
||||
SPELL_AURA_ADV_FLYING = 446,
|
||||
SPELL_AURA_MOD_XP_FROM_CREATURE_TYPE = 447,
|
||||
SPELL_AURA_448 = 448,
|
||||
SPELL_AURA_449 = 449,
|
||||
|
||||
@@ -515,7 +515,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleNULL, //443 SPELL_AURA_MOD_LEECH
|
||||
&AuraEffect::HandleNULL, //444
|
||||
&AuraEffect::HandleNULL, //445
|
||||
&AuraEffect::HandleNULL, //446
|
||||
&AuraEffect::HandleModAdvFlying, //446 SPELL_AURA_ADV_FLYING
|
||||
&AuraEffect::HandleNoImmediateEffect, //447 SPELL_AURA_MOD_XP_FROM_CREATURE_TYPE implemented in KillRewarder::_RewardXP
|
||||
&AuraEffect::HandleNULL, //448
|
||||
&AuraEffect::HandleNULL, //449
|
||||
@@ -2795,8 +2795,13 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
|
||||
|
||||
// cast speed aura
|
||||
if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)
|
||||
{
|
||||
if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
|
||||
{
|
||||
target->SetFlightCapabilityID(mountCapability->FlightCapabilityID, true);
|
||||
target->CastSpell(target, mountCapability->ModSpellAuraID, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2813,6 +2818,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
|
||||
// remove speed aura
|
||||
if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
|
||||
target->RemoveAurasDueToSpell(mountCapability->ModSpellAuraID, target->GetGUID());
|
||||
|
||||
target->SetFlightCapabilityID(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2941,6 +2948,17 @@ void AuraEffect::HandleAuraCanTurnWhileFalling(AuraApplication const* aurApp, ui
|
||||
target->SetCanTurnWhileFalling(apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModAdvFlying(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
|
||||
return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
target->SetCanDoubleJump(apply || target->HasAura(SPELL_DH_DOUBLE_JUMP));
|
||||
target->SetCanFly(apply);
|
||||
target->SetCanAdvFly(apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleIgnoreMovementForces(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
|
||||
|
||||
@@ -186,6 +186,7 @@ class TC_GAME_API AuraEffect
|
||||
void HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraCanTurnWhileFalling(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModAdvFlying(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleIgnoreMovementForces(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleDisableInertia(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleSetCantSwim(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
Reference in New Issue
Block a user