Core/Defines: define UNIT_FLAG_SWIMMING (#23630)

(cherry picked from commit c03c88d0c0)
This commit is contained in:
ForesterDev
2019-10-13 19:43:23 +04:00
committed by Shauren
parent 3da3683a90
commit 4a47e1c6be
5 changed files with 9 additions and 9 deletions

View File

@@ -11925,7 +11925,7 @@ bool Unit::CanSwim() const
return false;
if (IsPet() && HasUnitFlag(UNIT_FLAG_PET_IN_COMBAT))
return true;
return HasUnitFlag(UnitFlags(UNIT_FLAG_RENAME | UNIT_FLAG_UNK_15));
return HasUnitFlag(UnitFlags(UNIT_FLAG_RENAME | UNIT_FLAG_SWIMMING));
}
void Unit::NearTeleportTo(Position const& pos, bool casting /*= false*/)

View File

@@ -132,7 +132,7 @@ enum UnitFlags : uint32
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
UNIT_FLAG_CANNOT_SWIM = 0x00004000, // 2.0.8
UNIT_FLAG_UNK_15 = 0x00008000,
UNIT_FLAG_SWIMMING = 0x00008000, // shows swim animation in water
UNIT_FLAG_NON_ATTACKABLE_2 = 0x00010000, // removes attackable icon, if on yourself, cannot assist self but can cast TARGET_SELF spells - added by SPELL_AURA_MOD_UNATTACKABLE
UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok

View File

@@ -48,7 +48,7 @@ TC_API_EXPORT EnumText EnumUtils<UnitFlags>::ToString(UnitFlags value)
case UNIT_FLAG_PVP: return { "UNIT_FLAG_PVP", "UNIT_FLAG_PVP", "changed in 3.0.3" };
case UNIT_FLAG_SILENCED: return { "UNIT_FLAG_SILENCED", "UNIT_FLAG_SILENCED", "silenced, 2.1.1" };
case UNIT_FLAG_CANNOT_SWIM: return { "UNIT_FLAG_CANNOT_SWIM", "UNIT_FLAG_CANNOT_SWIM", "2.0.8" };
case UNIT_FLAG_UNK_15: return { "UNIT_FLAG_UNK_15", "UNIT_FLAG_UNK_15", "" };
case UNIT_FLAG_SWIMMING: return { "UNIT_FLAG_SWIMMING", "UNIT_FLAG_SWIMMING", "shows swim animation in water" };
case UNIT_FLAG_NON_ATTACKABLE_2: return { "UNIT_FLAG_NON_ATTACKABLE_2", "UNIT_FLAG_NON_ATTACKABLE_2", "removes attackable icon, if on yourself, cannot assist self but can cast TARGET_SELF spells - added by SPELL_AURA_MOD_UNATTACKABLE" };
case UNIT_FLAG_PACIFIED: return { "UNIT_FLAG_PACIFIED", "UNIT_FLAG_PACIFIED", "3.0.3 ok" };
case UNIT_FLAG_STUNNED: return { "UNIT_FLAG_STUNNED", "UNIT_FLAG_STUNNED", "3.0.3 ok" };
@@ -92,7 +92,7 @@ TC_API_EXPORT UnitFlags EnumUtils<UnitFlags>::FromIndex(size_t index)
case 12: return UNIT_FLAG_PVP;
case 13: return UNIT_FLAG_SILENCED;
case 14: return UNIT_FLAG_CANNOT_SWIM;
case 15: return UNIT_FLAG_UNK_15;
case 15: return UNIT_FLAG_SWIMMING;
case 16: return UNIT_FLAG_NON_ATTACKABLE_2;
case 17: return UNIT_FLAG_PACIFIED;
case 18: return UNIT_FLAG_STUNNED;

View File

@@ -584,7 +584,7 @@ public:
me->RestoreFaction();
CombatAI::Reset();
me->AddUnitFlag(UNIT_FLAG_UNK_15);
me->AddUnitFlag(UNIT_FLAG_SWIMMING);
}
void SpellHit(Unit* pCaster, SpellInfo const* pSpell) override
@@ -676,7 +676,7 @@ public:
return true;
me->SetImmuneToPC(false);
me->RemoveUnitFlag(UNIT_FLAG_UNK_15);
me->RemoveUnitFlag(UNIT_FLAG_SWIMMING);
player->CastSpell(me, SPELL_DUEL, false);
player->CastSpell(player, SPELL_DUEL_FLAG, true);

View File

@@ -282,10 +282,10 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
// flags taken from sniffs
if (caster->HasUnitFlag(UnitFlags(UNIT_FLAG_UNK_15 | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_UNK_6)))
if (caster->HasUnitFlag(UnitFlags(UNIT_FLAG_SWIMMING | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_UNK_6)))
{
caster->ToCreature()->SetReactState(REACT_PASSIVE);
caster->AddUnitFlag(UnitFlags(UNIT_FLAG_UNK_15 | UNIT_FLAG_UNK_6));
caster->AddUnitFlag(UnitFlags(UNIT_FLAG_SWIMMING | UNIT_FLAG_UNK_6));
caster->SetImmuneToAll(true, true);
}
}
@@ -296,7 +296,7 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
caster->ToCreature()->SetReactState(REACT_AGGRESSIVE);
caster->RemoveUnitFlag(UnitFlags(UNIT_FLAG_UNK_15 | UNIT_FLAG_UNK_6));
caster->RemoveUnitFlag(UnitFlags(UNIT_FLAG_SWIMMING | UNIT_FLAG_UNK_6));
caster->SetImmuneToAll(false);
}
}