From 164289b3b27917de9e3fd06409d78d8b61ee246f Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 11 Mar 2025 18:01:34 +0100 Subject: [PATCH] Core/Units: ported namings for UnitFlags and UnitFlags2 and added the check for forbidden flags in database --- src/server/game/Entities/Object/Object.cpp | 4 +- src/server/game/Entities/Player/Player.cpp | 4 +- src/server/game/Entities/Unit/UnitDefines.h | 147 +++++++++++------- src/server/game/Globals/ObjectMgr.cpp | 18 ++- .../FlightPathMovementGenerator.cpp | 4 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 6 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 44 +++++- .../BlackwingDescent/boss_magmaw.cpp | 4 +- .../ShadowfangKeep/boss_apothecary_hummel.cpp | 4 +- .../Kalimdor/Firelands/boss_lord_rhyolith.cpp | 2 +- .../boss_earthrager_ptah.cpp | 4 +- .../VortexPinnacle/vortex_pinnacle.cpp | 10 +- .../boss_lady_deathwhisper.cpp | 8 +- .../IcecrownCitadel/icecrown_citadel.cpp | 2 +- .../Ulduar/boss_algalon_the_observer.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 4 +- .../scripts/Northrend/zone_storm_peaks.cpp | 4 +- 18 files changed, 174 insertions(+), 99 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 758a8bdfc3..2b918c5ba7 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3039,7 +3039,7 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const } // check flags - if (unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_ATTACKABLE_2)) + if (unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_ON_TAXI | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NON_ATTACKABLE_2)) return false; Unit const* unitOrOwner = unit; @@ -3181,7 +3181,7 @@ bool WorldObject::IsValidAssistTarget(WorldObject const* target, SpellInfo const return false; // check flags for negative spells - if (isNegativeSpell && unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_ATTACKABLE_2)) + if (isNegativeSpell && unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_ON_TAXI | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NON_ATTACKABLE_2)) return false; if (isNegativeSpell || !bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_ASSIST_IMMUNE_PC)) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index effaf3e066..0455862b0b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2492,7 +2492,7 @@ void Player::InitStatsForLevel(bool reapplyMods) UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED | UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_NOT_SELECTABLE | - UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT ); + UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_ON_TAXI ); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); // must be set SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);// must be set @@ -21350,7 +21350,7 @@ void Player::CleanupAfterTaxiFlight() { m_taxi.ClearTaxiDestinations(); // not destinations, clear source node Dismount(); - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT); + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_ON_TAXI); } void Player::ContinueTaxiFlight() const diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index 403edddb81..a820aa1606 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -124,70 +124,99 @@ enum UnitRename : uint8 // Value masks for UNIT_FIELD_FLAGS enum UnitFlags : uint32 { - UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner - UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable - UNIT_FLAG_REMOVE_CLIENT_CONTROL = 0x00000004, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving) - UNIT_FLAG_PLAYER_CONTROLLED = 0x00000008, // controlled by player, use _IMMUNE_TO_PC instead of _IMMUNE_TO_NPC - UNIT_FLAG_RENAME = 0x00000010, - UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP - UNIT_FLAG_UNK_6 = 0x00000040, - UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PLAYER_CONTROLLED | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE - UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::IsValidAssistTarget - UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::IsValidAssistTarget - UNIT_FLAG_LOOTING = 0x00000400, // loot animation - UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // on player pets: whether the pet is chasing a target to attack || on other units: whether any of the unit's minions is in combat - UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3 - UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1 - UNIT_FLAG_CANT_SWIM = 0x00004000, // 2.0.8 - UNIT_FLAG_CAN_SWIM = 0x00008000, // shows swim animation in water - UNIT_FLAG_NOT_ATTACKABLE_2 = 0x00010000, - UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok - UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok - UNIT_FLAG_IN_COMBAT = 0x00080000, - UNIT_FLAG_TAXI_FLIGHT = 0x00100000, // disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag - UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip. - UNIT_FLAG_CONFUSED = 0x00400000, - UNIT_FLAG_FLEEING = 0x00800000, - UNIT_FLAG_POSSESSED = 0x01000000, // under direct client control by a player (possess or vehicle) - UNIT_FLAG_NOT_SELECTABLE = 0x02000000, - UNIT_FLAG_SKINNABLE = 0x04000000, - UNIT_FLAG_MOUNT = 0x08000000, - UNIT_FLAG_UNK_28 = 0x10000000, - UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell - UNIT_FLAG_SHEATHE = 0x40000000, - UNIT_FLAG_IMMUNE = 0x80000000, // Immune to damage - MAX_UNIT_FLAGS = 33 + UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner + UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable + UNIT_FLAG_REMOVE_CLIENT_CONTROL = 0x00000004, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving) + UNIT_FLAG_PLAYER_CONTROLLED = 0x00000008, // controlled by player, use _IMMUNE_TO_PC instead of _IMMUNE_TO_NPC + UNIT_FLAG_RENAME = 0x00000010, + UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP + UNIT_FLAG_UNK_6 = 0x00000040, + UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PLAYER_CONTROLLED | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE + UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::IsValidAssistTarget + UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::IsValidAssistTarget + UNIT_FLAG_LOOTING = 0x00000400, // loot animation + UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // on player pets: whether the pet is chasing a target to attack || on other units: whether any of the unit's minions is in combat + UNIT_FLAG_PVP_ENABLING = 0x00001000, // changed in 3.0.3 + UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1 + UNIT_FLAG_CANT_SWIM = 0x00004000, // 2.0.8 + UNIT_FLAG_CAN_SWIM = 0x00008000, // shows swim animation in water + UNIT_FLAG_NON_ATTACKABLE_2 = 0x00010000, + UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok + UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok + UNIT_FLAG_IN_COMBAT = 0x00080000, + UNIT_FLAG_ON_TAXI = 0x00100000, // disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag + UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip. + UNIT_FLAG_CONFUSED = 0x00400000, + UNIT_FLAG_FLEEING = 0x00800000, + UNIT_FLAG_POSSESSED = 0x01000000, // under direct client control by a player (possess or vehicle) + UNIT_FLAG_NOT_SELECTABLE = 0x02000000, + UNIT_FLAG_SKINNABLE = 0x04000000, + UNIT_FLAG_MOUNT = 0x08000000, + UNIT_FLAG_UNK_28 = 0x10000000, + UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT = 0x20000000, + UNIT_FLAG_SHEATHE = 0x40000000, + UNIT_FLAG_IMMUNE = 0x80000000, // Immune to damage + MAX_UNIT_FLAGS = 33, + + UNIT_FLAG_DISALLOWED = (UNIT_FLAG_SERVER_CONTROLLED | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL | + UNIT_FLAG_PLAYER_CONTROLLED | UNIT_FLAG_RENAME | UNIT_FLAG_PREPARATION | /* UNIT_FLAG_UNK_6 | */ + UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_LOOTING | UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_PVP_ENABLING | UNIT_FLAG_SILENCED | + UNIT_FLAG_CANT_SWIM | UNIT_FLAG_CAN_SWIM | UNIT_FLAG_NON_ATTACKABLE_2 | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | + UNIT_FLAG_IN_COMBAT | UNIT_FLAG_ON_TAXI | UNIT_FLAG_DISARMED | UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | + UNIT_FLAG_POSSESSED | UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_UNK_28 | + UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_SHEATHE | UNIT_FLAG_IMMUNE), // SKIP + + UNIT_FLAG_ALLOWED = (0xFFFFFFFF & ~UNIT_FLAG_DISALLOWED) // SKIP }; // Value masks for UNIT_FIELD_FLAGS_2 enum UnitFlags2 : uint32 { - UNIT_FLAG2_FEIGN_DEATH = 0x00000001, - UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip) - UNIT_FLAG2_IGNORE_REPUTATION = 0x00000004, - UNIT_FLAG2_COMPREHEND_LANG = 0x00000008, - UNIT_FLAG2_MIRROR_IMAGE = 0x00000010, - UNIT_FLAG2_INSTANTLY_APPEAR_MODEL = 0x00000020, // Unit model instantly appears when summoned (does not fade in) - UNIT_FLAG2_FORCE_MOVEMENT = 0x00000040, - UNIT_FLAG2_DISARM_OFFHAND = 0x00000080, - UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames) - UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?) - UNIT_FLAG2_REGENERATE_POWER = 0x00000800, - UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid - UNIT_FLAG2_PREVENT_SPELL_CLICK = 0x00002000, // Prevent spellclick - UNIT_FLAG2_ALLOW_ENEMY_INTERACT = 0x00004000, - UNIT_FLAG2_CANNOT_TURN = 0x00008000, - UNIT_FLAG2_UNK2 = 0x00010000, - UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death - UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000, // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL - UNIT_FLAG2_SUPPRESS_HIGHLIGHT_WHEN_TARGETED_OR_MOUSED_OVER = 0x00080000, // Suppress highlight when targeted or moused over - UNIT_FLAG2_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS = 0x00100000, // Treat as Raid Unit For Helpful Spells (Instances ONLY) - UNIT_FLAG2_LARGE_AOI = 0x00200000, // Large (AOI) - UNIT_FLAG2_GIGANTIC_AOI = 0x00400000, // Gigantic (AOI) - UNIT_FLAG2_NO_ACTIONS = 0x00800000, - UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS = 0x01000000, // AI will only swim if target swims - UNIT_FLAG2_DISABLE_UNIT_FRAME = 0x04000000, // Disables the unit frame when selecting the target - UNIT_FLAG2_IGNORE_SPELL_MIN_RANGE_RESTRICTIONS = 0x08000000 // Allows spells with a min range restriction to be cast when closer than given range value + UNIT_FLAG2_FEIGN_DEATH = 0x00000001, + UNIT_FLAG2_HIDE_BODY = 0x00000002, // TITLE Hide Body DESCRIPTION Hide unit model (show only player equip) + UNIT_FLAG2_IGNORE_REPUTATION = 0x00000004, + UNIT_FLAG2_COMPREHEND_LANG = 0x00000008, + UNIT_FLAG2_MIRROR_IMAGE = 0x00000010, + UNIT_FLAG2_DONT_FADE_IN = 0x00000020, // TITLE Don't Fade In DESCRIPTION Unit model instantly appears when summoned (does not fade in) + UNIT_FLAG2_FORCE_MOVEMENT = 0x00000040, + UNIT_FLAG2_DISARM_OFFHAND = 0x00000080, + UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames) + UNIT_FLAG2_ALLOW_CHANGING_TALENTS = 0x00000200, // Allows changing talents outside rest area + UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?) + UNIT_FLAG2_REGENERATE_POWER = 0x00000800, + UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid + UNIT_FLAG2_PREVENT_SPELL_CLICK = 0x00002000, // Prevent spellclick + UNIT_FLAG2_INTERACT_WHILE_HOSTILE = 0x00004000, // TITLE Interact while Hostile + UNIT_FLAG2_CANNOT_TURN = 0x00008000, // TITLE Cannot Turn + UNIT_FLAG2_UNK2 = 0x00010000, + UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death + UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000, // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL + UNIT_FLAG2_SUPPRESS_HIGHLIGHT_WHEN_TARGETED_OR_MOUSED_OVER = 0x00080000, // TITLE Suppress highlight when targeted or moused over + UNIT_FLAG2_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS = 0x00100000, // TITLE Treat as Raid Unit For Helpful Spells (Instances ONLY) + UNIT_FLAG2_LARGE_AOI = 0x00200000, // TITLE Large (AOI) + UNIT_FLAG2_GIGANTIC_AOI = 0x00400000, // TITLE Gigantic (AOI) + UNIT_FLAG2_NO_ACTIONS = 0x00800000, + UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS = 0x01000000, // TITLE AI will only swim if target swims + UNIT_FLAG2_DONT_GENERATE_COMBAT_LOG_WHEN_ENGAGED_WITH_NPCS = 0x02000000, // TITLE Don't generate combat log when engaged with NPC's + UNIT_FLAG2_UNTARGETABLE_BY_CLIENT = 0x04000000, // TITLE Untargetable By Client + UNIT_FLAG2_ATTACKER_IGNORES_MINIMUM_RANGES = 0x08000000, // TITLE Attacker Ignores Minimum Ranges + UNIT_FLAG2_UNINTERACTIBLE_IF_HOSTILE = 0x10000000, // TITLE Uninteractible If Hostile + UNIT_FLAG2_UNUSED_11 = 0x20000000, + UNIT_FLAG2_INFINITE_AOI = 0x40000000, // TITLE Infinite (AOI) + UNIT_FLAG2_UNUSED_13 = 0x80000000, + MAX_UNIT_FLAGS2 = 33, + + UNIT_FLAG2_DISALLOWED = (/* UNIT_FLAG2_FEIGN_DEATH | */ UNIT_FLAG2_IGNORE_REPUTATION | UNIT_FLAG2_COMPREHEND_LANG | + UNIT_FLAG2_MIRROR_IMAGE | UNIT_FLAG2_FORCE_MOVEMENT | UNIT_FLAG2_DISARM_OFFHAND | + UNIT_FLAG2_DISABLE_PRED_STATS | UNIT_FLAG2_ALLOW_CHANGING_TALENTS | UNIT_FLAG2_DISARM_RANGED | + /* UNIT_FLAG2_REGENERATE_POWER | */ UNIT_FLAG2_RESTRICT_PARTY_INTERACTION | UNIT_FLAG2_CANNOT_TURN | + UNIT_FLAG2_PREVENT_SPELL_CLICK | /* UNIT_FLAG2_INTERACT_WHILE_HOSTILE | */ /* UNIT_FLAG2_UNK2 | */ + /* UNIT_FLAG2_PLAY_DEATH_ANIM | */ UNIT_FLAG2_ALLOW_CHEAT_SPELLS | UNIT_FLAG2_SUPPRESS_HIGHLIGHT_WHEN_TARGETED_OR_MOUSED_OVER | + UNIT_FLAG2_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS | UNIT_FLAG2_LARGE_AOI | UNIT_FLAG2_GIGANTIC_AOI | UNIT_FLAG2_NO_ACTIONS | + UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS | UNIT_FLAG2_DONT_GENERATE_COMBAT_LOG_WHEN_ENGAGED_WITH_NPCS | UNIT_FLAG2_ATTACKER_IGNORES_MINIMUM_RANGES | + UNIT_FLAG2_UNINTERACTIBLE_IF_HOSTILE | UNIT_FLAG2_UNUSED_11 | UNIT_FLAG2_INFINITE_AOI | UNIT_FLAG2_UNUSED_13), // SKIP + + UNIT_FLAG2_ALLOWED = (0xFFFFFFFF & ~UNIT_FLAG2_DISALLOWED) // SKIP }; /// Non Player Character flags diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3929596219..68bb898bf9 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1115,6 +1115,18 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED; } + if (uint32 disallowedUnitFlags = (cInfo->unit_flags & ~UNIT_FLAG_ALLOWED)) + { + TC_LOG_ERROR("sql.sql", "Table `creature_template` lists creature (Entry: %u) with disallowed `unit_flags` %u, removing incorrect flag.", cInfo->Entry, disallowedUnitFlags); + const_cast(cInfo)->unit_flags &= UNIT_FLAG_ALLOWED; + } + + if (uint32 disallowedUnitFlags2 = (cInfo->unit_flags2 & ~UNIT_FLAG2_ALLOWED)) + { + TC_LOG_ERROR("sql.sql", "Table `creature_template` lists creature (Entry: %u) with disallowed `unit_flags2` %u, removing incorrect flag.", cInfo->Entry, disallowedUnitFlags2); + const_cast(cInfo)->unit_flags2 &= UNIT_FLAG2_ALLOWED; + } + const_cast(cInfo)->ModDamage *= Creature::_GetDamageMod(cInfo->rank); } @@ -2233,12 +2245,11 @@ void ObjectMgr::LoadCreatures() } } - /* if (data.unit_flags.has_value()) { if (uint32 disallowedUnitFlags = (*data.unit_flags & ~UNIT_FLAG_ALLOWED)) { - TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags` {}, removing incorrect flag.", guid, data.id, disallowedUnitFlags); + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with disallowed `unit_flags` {}, removing incorrect flag.", guid, data.id, disallowedUnitFlags); *data.unit_flags &= UNIT_FLAG_ALLOWED; } } @@ -2247,11 +2258,10 @@ void ObjectMgr::LoadCreatures() { if (uint32 disallowedUnitFlags2 = (*data.unit_flags2 & ~UNIT_FLAG2_ALLOWED)) { - TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags2` {}, removing incorrect flag.", guid, data.id, disallowedUnitFlags2); + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with disallowed `unit_flags2` %u, removing incorrect flag.", guid, data.id, disallowedUnitFlags2); *data.unit_flags2 &= UNIT_FLAG2_ALLOWED; } } - */ if (sWorld->getBoolConfig(CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA)) { diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp index b6dc776d8e..48c49426f0 100644 --- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp @@ -113,7 +113,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) uint32 taxiNodeId = player->m_taxi.GetTaxiDestination(); player->m_taxi.ClearTaxiDestinations(); player->Dismount(); - player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT); + player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_ON_TAXI); if (player->m_taxi.empty()) { @@ -137,7 +137,7 @@ void FlightPathMovementGenerator::DoReset(Player* player) { player->AddUnitState(UNIT_STATE_IN_FLIGHT); player->CombatStopWithPets(); - player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT); + player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_ON_TAXI); uint32 end = GetPathAtMapEnd(); uint32 currentNodeId = GetCurrentNode(); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b646183ea0..fd6bc78b57 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2366,7 +2366,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo if (aurApp->GetRemoveMode().HasAnyFlag()) return; - target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); // blizz like 2.0.x + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); // blizz like 2.0.x target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); // blizz like 2.0.x target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); // blizz like 2.0.x target->AddUnitState(UNIT_STATE_DIED); @@ -2381,7 +2381,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo target->SendMessageToSet(&data, true); */ - target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); // blizz like 2.0.x + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); // blizz like 2.0.x target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); // blizz like 2.0.x target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); // blizz like 2.0.x target->ClearUnitState(UNIT_STATE_DIED); @@ -2402,7 +2402,7 @@ void AuraEffect::HandleModUnattackable(AuraApplication const* aurApp, uint8 mode if (!apply && target->HasAuraType(SPELL_AURA_MOD_UNATTACKABLE)) return; - target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2, apply); + target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE_2, apply); target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE, apply); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 12e7c17805..6b4a6aa4f3 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6956,7 +6956,7 @@ SpellCastResult Spell::CheckRange(bool strict) const if (m_caster->GetExactDistSq(target) > maxRange) return SPELL_FAILED_OUT_OF_RANGE; - if (minRange > 0.0f && m_caster->GetExactDistSq(target) < minRange && !target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_SPELL_MIN_RANGE_RESTRICTIONS)) + if (minRange > 0.0f && m_caster->GetExactDistSq(target) < minRange && !target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ATTACKER_IGNORES_MINIMUM_RANGES)) return SPELL_FAILED_TOO_CLOSE; if (m_caster->IsPlayer() && m_spellInfo->FacingCasterFlags.HasFlag(SpellFacingCasterFlags::Infront)) diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index a1ce73725e..f7336cca32 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -133,15 +133,15 @@ EnumName const unitFlags[MAX_UNIT_FLAGS] = CREATE_NAMED_ENUM(UNIT_FLAG_IMMUNE_TO_NPC), CREATE_NAMED_ENUM(UNIT_FLAG_LOOTING), CREATE_NAMED_ENUM(UNIT_FLAG_PET_IN_COMBAT), - CREATE_NAMED_ENUM(UNIT_FLAG_PVP), + CREATE_NAMED_ENUM(UNIT_FLAG_PVP_ENABLING), CREATE_NAMED_ENUM(UNIT_FLAG_SILENCED), CREATE_NAMED_ENUM(UNIT_FLAG_CANT_SWIM), CREATE_NAMED_ENUM(UNIT_FLAG_CAN_SWIM), - CREATE_NAMED_ENUM(UNIT_FLAG_NOT_ATTACKABLE_2), + CREATE_NAMED_ENUM(UNIT_FLAG_NON_ATTACKABLE_2), CREATE_NAMED_ENUM(UNIT_FLAG_PACIFIED), CREATE_NAMED_ENUM(UNIT_FLAG_STUNNED), CREATE_NAMED_ENUM(UNIT_FLAG_IN_COMBAT), - CREATE_NAMED_ENUM(UNIT_FLAG_TAXI_FLIGHT), + CREATE_NAMED_ENUM(UNIT_FLAG_ON_TAXI), CREATE_NAMED_ENUM(UNIT_FLAG_DISARMED), CREATE_NAMED_ENUM(UNIT_FLAG_CONFUSED), CREATE_NAMED_ENUM(UNIT_FLAG_FLEEING), @@ -150,11 +150,47 @@ EnumName const unitFlags[MAX_UNIT_FLAGS] = CREATE_NAMED_ENUM(UNIT_FLAG_SKINNABLE), CREATE_NAMED_ENUM(UNIT_FLAG_MOUNT), CREATE_NAMED_ENUM(UNIT_FLAG_UNK_28), - CREATE_NAMED_ENUM(UNIT_FLAG_UNK_29), + CREATE_NAMED_ENUM(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT), CREATE_NAMED_ENUM(UNIT_FLAG_SHEATHE), CREATE_NAMED_ENUM(UNIT_FLAG_IMMUNE) }; +EnumName const unitFlags2[MAX_UNIT_FLAGS2] = +{ + CREATE_NAMED_ENUM(UNIT_FLAG2_FEIGN_DEATH), + CREATE_NAMED_ENUM(UNIT_FLAG2_HIDE_BODY), + CREATE_NAMED_ENUM(UNIT_FLAG2_IGNORE_REPUTATION), + CREATE_NAMED_ENUM(UNIT_FLAG2_COMPREHEND_LANG), + CREATE_NAMED_ENUM(UNIT_FLAG2_MIRROR_IMAGE), + CREATE_NAMED_ENUM(UNIT_FLAG2_DONT_FADE_IN), + CREATE_NAMED_ENUM(UNIT_FLAG2_FORCE_MOVEMENT), + CREATE_NAMED_ENUM(UNIT_FLAG2_DISARM_OFFHAND), + CREATE_NAMED_ENUM(UNIT_FLAG2_DISABLE_PRED_STATS), + CREATE_NAMED_ENUM(UNIT_FLAG2_ALLOW_CHANGING_TALENTS), + CREATE_NAMED_ENUM(UNIT_FLAG2_DISARM_RANGED), + CREATE_NAMED_ENUM(UNIT_FLAG2_REGENERATE_POWER), + CREATE_NAMED_ENUM(UNIT_FLAG2_RESTRICT_PARTY_INTERACTION), + CREATE_NAMED_ENUM(UNIT_FLAG2_PREVENT_SPELL_CLICK), + CREATE_NAMED_ENUM(UNIT_FLAG2_INTERACT_WHILE_HOSTILE), + CREATE_NAMED_ENUM(UNIT_FLAG2_CANNOT_TURN), + CREATE_NAMED_ENUM(UNIT_FLAG2_UNK2), + CREATE_NAMED_ENUM(UNIT_FLAG2_PLAY_DEATH_ANIM), + CREATE_NAMED_ENUM(UNIT_FLAG2_ALLOW_CHEAT_SPELLS), + CREATE_NAMED_ENUM(UNIT_FLAG2_SUPPRESS_HIGHLIGHT_WHEN_TARGETED_OR_MOUSED_OVER), + CREATE_NAMED_ENUM(UNIT_FLAG2_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS), + CREATE_NAMED_ENUM(UNIT_FLAG2_LARGE_AOI), + CREATE_NAMED_ENUM(UNIT_FLAG2_GIGANTIC_AOI), + CREATE_NAMED_ENUM(UNIT_FLAG2_NO_ACTIONS), + CREATE_NAMED_ENUM(UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS), + CREATE_NAMED_ENUM(UNIT_FLAG2_DONT_GENERATE_COMBAT_LOG_WHEN_ENGAGED_WITH_NPCS), + CREATE_NAMED_ENUM(UNIT_FLAG2_UNTARGETABLE_BY_CLIENT), + CREATE_NAMED_ENUM(UNIT_FLAG2_ATTACKER_IGNORES_MINIMUM_RANGES), + CREATE_NAMED_ENUM(UNIT_FLAG2_UNINTERACTIBLE_IF_HOSTILE), + CREATE_NAMED_ENUM(UNIT_FLAG2_UNUSED_11), + CREATE_NAMED_ENUM(UNIT_FLAG2_INFINITE_AOI), + CREATE_NAMED_ENUM(UNIT_FLAG2_UNUSED_13) +}; + EnumName const flagsExtra[] = { CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_INSTANCE_BIND), diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_magmaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_magmaw.cpp index 8eb2a712dd..342bc3aa6b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_magmaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_magmaw.cpp @@ -389,7 +389,7 @@ struct boss_magmaw : public BossAI break; case ACTION_ENABLE_MOUNTING: me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_ENEMY_INTERACT); + me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_INTERACT_WHILE_HOSTILE); if (Creature* head = GetBodyPart(BODY_PART_EXPOSED_HEAD_1)) head->CastSpell(head, SPELL_RIDE_VEHICLE_HEAD, true); @@ -401,7 +401,7 @@ struct boss_magmaw : public BossAI break; case ACTION_DISABLE_MOUNTING: me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_ENEMY_INTERACT); + me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_INTERACT_WHILE_HOSTILE); if (events.IsInPhase(PHASE_COMBAT)) { diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index e390b038ed..4b977808b7 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -157,7 +157,7 @@ class boss_apothecary_hummel : public CreatureScript _isDead = true; me->RemoveAurasDueToSpell(SPELL_ALLURING_PERFUME); DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH, true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); Talk(SAY_HUMMEL_DEATH); } } @@ -178,7 +178,7 @@ class boss_apothecary_hummel : public CreatureScript Talk(SAY_HUMMEL_DEATH); events.Reset(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); instance->SetBossState(DATA_APOTHECARY_HUMMEL, DONE); Map::PlayerList const& players = me->GetMap()->GetPlayers(); diff --git a/src/server/scripts/Kalimdor/Firelands/boss_lord_rhyolith.cpp b/src/server/scripts/Kalimdor/Firelands/boss_lord_rhyolith.cpp index 01b9ff2cac..80a1807ec3 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_lord_rhyolith.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_lord_rhyolith.cpp @@ -428,7 +428,7 @@ struct boss_lord_rhyolith : public BossAI if (CreatureAI* ai = controller->AI()) ai->DoAction(ACTION_STOP_MOVEMENT_CONTROL); - me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_UNIT_FRAME); + me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNTARGETABLE_BY_CLIENT); me->SetAIAnimKitId(AI_ANIM_KIT_LORD_RHYOLITH_SITTING); DoCastSelf(SPELL_IMMOLATION_1); Talk(SAY_ANNOUNCE_ARMOR_BROKEN); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 9baacc54e1..8653b01821 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -338,14 +338,14 @@ class spell_earthrager_ptah_explosion : public AuraScript void SetFlags(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_IMMUNE)); + target->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE)); target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } void RemoveFlags(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->RemoveFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_IMMUNE)); + target->RemoveFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE)); target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } diff --git a/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp b/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp index 877c35798d..ed46465bd0 100644 --- a/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp +++ b/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp @@ -487,7 +487,7 @@ class spell_vp_lurk_search_periodic : public AuraScript void HandlePeriodic(AuraEffect const* /*aurEff*/) { Unit* target = GetTarget(); - if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29)) + if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT)) { target->CastSpell(target, SPELL_LURK_SEARCH_FACING_PLAYERS, true); target->CastSpell(target, SPELL_LURK_SEARCH_SELECT_TARGET, true); @@ -533,7 +533,7 @@ class spell_vp_lurk_search : public SpellScript return !target->HasInArc(float(M_PI), caster); }); - if (!caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29) && !targets.empty()) + if (!caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT) && !targets.empty()) caster->CastSpell(caster, SPELL_FEIGN_DEATH); break; case SPELL_LURK_SEARCH_DEATH_CHECK: @@ -542,7 +542,7 @@ class spell_vp_lurk_search : public SpellScript return !target->HasInArc(float(M_PI), caster); }); - if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29) && targets.empty() && !caster->HasAura(SPELL_LURK_RESSURECT, caster->GetGUID())) + if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT) && targets.empty() && !caster->HasAura(SPELL_LURK_RESSURECT, caster->GetGUID())) caster->CastSpell(caster, SPELL_LURK_RESSURECT); break; case SPELL_LURK_SEARCH_SELECT_TARGET: @@ -603,12 +603,12 @@ class spell_vp_feign_death_AuraScript : public AuraScript { void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + GetTarget()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 22b858503d..aaa471ead9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -576,12 +576,12 @@ class npc_cult_fanatic : public CreatureScript DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH); DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS); DoCastSelf(SPELL_FULL_HEAL, true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); }) .Schedule(Seconds(6), [this](TaskContext /*context*/) { me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(me); @@ -678,12 +678,12 @@ class npc_cult_adherent : public CreatureScript DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH); DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS); DoCastSelf(SPELL_FULL_HEAL, true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); }) .Schedule(Seconds(6), [this](TaskContext /*context*/) { me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); DoCastSelf(SPELL_SHROUD_OF_THE_OCCULT); DoZoneInCombat(me); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 23d9e49dab..88f743a2c2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -782,7 +782,7 @@ class boss_sister_svalna : public CreatureScript { Talk(EMOTE_SVALNA_IMPALE, target); summon->CastSpell(target, VEHICLE_SPELL_RIDE_HARDCODED, { SPELLVALUE_BASE_POINT0, 1 }); - summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNK1 | UNIT_FLAG2_ALLOW_ENEMY_INTERACT); + summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_HIDE_BODY | UNIT_FLAG2_INTERACT_WHILE_HOSTILE); } break; default: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 4aeed248ee..d357788f74 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -350,7 +350,7 @@ class boss_algalon_the_observer : public CreatureScript { case ACTION_START_INTRO: { - me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_INSTANTLY_APPEAR_MODEL); + me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DONT_FADE_IN); me->SetDisableGravity(true); DoCast(me, SPELL_ARRIVAL, true); DoCast(me, SPELL_RIDE_THE_LIGHTNING, true); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 639c011e05..223d0fda35 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -373,7 +373,7 @@ class boss_xt002 : public CreatureScript heart->CastSpell(heart, SPELL_HEART_HEAL_TO_FULL, true); heart->CastSpell(me, SPELL_RIDE_VEHICLE_EXPOSED, true); heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); } events.CancelEvent(EVENT_SEARING_LIGHT); @@ -409,7 +409,7 @@ class boss_xt002 : public CreatureScript heart->CastSpell(me, SPELL_HEART_RIDE_VEHICLE, true); heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); heart->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART); if (!_hardMode) diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index caf0a5ca96..ad16d0e24a 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -1359,13 +1359,13 @@ class spell_falling_dragon_feign_death : public SpellScriptLoader { void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + GetTarget()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); GetTarget()->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); + GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); }