still fly bug

This commit is contained in:
luis
2026-03-17 22:08:21 -03:00
parent 4341bcc1cd
commit b06857173c
3 changed files with 25 additions and 42 deletions
+1 -2
View File
@@ -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;
@@ -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
+18 -5
View File
@@ -3353,11 +3353,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
const_cast<SpellInfo&>(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&>(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<SpellInfo&>(s);