mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
@@ -84,12 +84,12 @@ public:
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
_modelId = GetUnitOwner()->GetDisplayId();
|
||||
_hasFlag = GetUnitOwner()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
_hasFlag = GetUnitOwner()->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
_itemId.at(i) = GetUnitOwner()->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i);
|
||||
|
||||
GetUnitOwner()->SetDisplayId(11686);
|
||||
GetUnitOwner()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, 0);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
{
|
||||
GetUnitOwner()->SetDisplayId(_modelId);
|
||||
if (!_hasFlag)
|
||||
GetUnitOwner()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, _itemId.at(i));
|
||||
}
|
||||
@@ -1803,8 +1803,8 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->SetReactState(REACT_PASSIVE);
|
||||
@@ -1814,8 +1814,8 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -2867,7 +2867,7 @@ class spell_gen_mounted_charge : public SpellScript
|
||||
}
|
||||
|
||||
// If target isn't a training dummy there's a chance of failing the charge
|
||||
if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
|
||||
if (!target->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
|
||||
spellId = SPELL_CHARGE_MISS_EFFECT;
|
||||
|
||||
if (Unit* vehicle = GetCaster()->GetVehicleBase())
|
||||
|
||||
Reference in New Issue
Block a user