mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
@@ -488,7 +488,7 @@ void Battlefield::HideNpc(Creature* creature)
|
||||
{
|
||||
creature->CombatStop();
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->SetPhaseMask(2, false); // pussywizard: false because UpdateObjectVisibility(true) is called below in SetVisible(), no need to have it here
|
||||
creature->DisappearAndDie();
|
||||
creature->SetVisible(false);
|
||||
@@ -498,14 +498,14 @@ void Battlefield::ShowNpc(Creature* creature, bool aggressive)
|
||||
{
|
||||
creature->SetPhaseMask(1, false); // pussywizard: false because UpdateObjectVisibility(true) is called below in SetVisible(), no need to have it here
|
||||
creature->SetVisible(true);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn(true);
|
||||
if (aggressive)
|
||||
creature->SetReactState(REACT_AGGRESSIVE);
|
||||
else
|
||||
{
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
|
||||
|
||||
// Xinef: Allow to Skin non-released corpse
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
victim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
victim->SetUnitFlag(UNIT_FLAG_SKINNABLE);
|
||||
}
|
||||
else if (victim->IsVehicle() && !killer->IsFriendlyTo(victim))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user