From b06857173c68cc79dc05db847bc68a21beeb8cda Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 17 Mar 2026 22:08:21 -0300 Subject: [PATCH] still fly bug --- src/server/game/Entities/Unit/Unit.cpp | 3 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 41 +++---------------- src/server/game/Spells/SpellMgr.cpp | 23 ++++++++--- 3 files changed, 25 insertions(+), 42 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c19624d05..01a6f0076 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8423,8 +8423,7 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_GROUND && !(mountFlags.HasFlag(AreaMountFlags::AllowGroundMounts))) continue; // Allow flying everywhere for players (private server - area flags incomplete in DB2) - if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLYING && !(mountFlags.HasFlag(AreaMountFlags::AllowFlyingMounts)) - && GetTypeId() != TYPEID_PLAYER) + if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLYING && !(mountFlags.HasFlag(AreaMountFlags::AllowFlyingMounts))) continue; if (mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT && !(mountFlags.HasFlag(AreaMountFlags::AllowSurfaceSwimmingMounts))) continue; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0c1981c9c..47ce66f87 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2769,12 +2769,13 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo { DB2Manager::MountXDisplayContainer usableDisplays; std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [target](MountXDisplayEntry const* mountDisplay) - { - if (Player* playerTarget = target->ToPlayer()) - return ConditionMgr::IsPlayerMeetingCondition(playerTarget, mountDisplay->PlayerConditionID); + { + if (Player* playerTarget = target->ToPlayer()) + if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mountDisplay->PlayerConditionID)) + return sConditionMgr->IsPlayerMeetingCondition(playerTarget, playerCondition); - return true; - }); + return true; + }); if (!usableDisplays.empty()) displayId = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->CreatureDisplayInfoID; @@ -2783,7 +2784,6 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo // TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue) //if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id)) // creatureEntry = mountVehicle->VehicleCreatureId; - if (mode & AURA_EFFECT_HANDLE_REAL && !mountEntry->GetFlags().HasFlag(MountFlags::MountEquipmentEffectsSuppressed)) { if (Player* playerTarget = target->ToPlayer()) @@ -2823,31 +2823,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount())) { target->SetFlightCapabilityID(mountCapability->FlightCapabilityID, true); - target->SetDriveCapabilityID(mountCapability->DriveCapabilityID, false); target->CastSpell(target, mountCapability->ModSpellAuraID, this); } - - // Private server: always enable flying for players with riding skills - if (Player* player = target->ToPlayer()) - { - if (player->HasSpell(90265) || player->HasSpell(34091) || player->HasSpell(34090)) - { - target->SetCanFly(true); - if (player->HasAura(404468)) // Steady Flight mode - { - target->SetCanAdvFly(false); - } - else // Skyriding mode (default) - { - target->SetCanAdvFly(true); - target->SetCanDoubleJump(true); - target->SetFlightCapabilityID(1, true); - // Cast Vigor aura - required by CasterAuraSpell check for active abilities - if (!player->HasAura(372773)) - player->CastSpell(player, 372773, true); - } - } - } } } else @@ -2870,13 +2847,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount())) target->RemoveAurasDueToSpell(mountCapability->ModSpellAuraID, target->GetGUID()); - // Clear all flight flags on dismount - target->SetCanFly(false); - target->SetCanAdvFly(false); - target->SetCanDoubleJump(false); target->SetFlightCapabilityID(0, true); - // Remove Vigor aura on dismount - target->RemoveAura(372773); } // Dragonriding updates diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 340ed9b92..1864201a5 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3353,11 +3353,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes() const_cast(spellInfo).AttributesCu |= SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED; } - // Dragonriding flight style auras - applied fresh on login, do not save - for (uint32 spellId : { 404464u, 404468u, 372773u }) - for (SpellInfo const& spellInfo : _GetSpellInfo(spellId)) - const_cast(spellInfo).AttributesCu |= SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED; - TC_LOG_INFO("server.loading", ">> Loaded SpellInfo custom attributes in {} ms", GetMSTimeDiffToNow(oldMSTime)); } @@ -5196,6 +5191,24 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELLED; }); + // Dragonriding Thrill of the Skies visual + ApplySpellFix({ 373404 }, [](SpellInfo* spellInfo) + { + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); // Infinite + }); + + // Dragonrider Energy + ApplySpellFix({ 372773 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags = SpellAuraInterruptFlags::None; + }); + + // Racing + ApplySpellFix({ 377560, 395101, 409880 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags |= SpellAuraInterruptFlags::LeaveWorld; + }); + for (SpellInfo const& s : mSpellInfoMap) { SpellInfo* spellInfo = &const_cast(s);