feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
parent
54c06eb72e
commit
856aed6fc6
243 changed files with 1205 additions and 1191 deletions
|
|
@ -934,7 +934,7 @@ public:
|
|||
|
||||
Event = false;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void BeginEvent(Player* player)
|
||||
|
|
@ -959,7 +959,7 @@ public:
|
|||
}
|
||||
|
||||
Event = true;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void PatientDied(Location* point)
|
||||
|
|
@ -1061,10 +1061,10 @@ public:
|
|||
Coord = nullptr;
|
||||
|
||||
//no select
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//no regen health
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
me->SetUnitFlag(UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
//to make them lay with face down
|
||||
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
|
|
@ -1103,10 +1103,10 @@ public:
|
|||
CAST_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, player, Coord);
|
||||
|
||||
//make not selectable
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//regen health
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
//stand up
|
||||
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
|
||||
|
|
@ -1139,8 +1139,8 @@ public:
|
|||
|
||||
if (me->IsAlive() && me->GetHealth() <= 6)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
|
||||
|
||||
|
|
@ -1193,7 +1193,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 diff)
|
|||
if (Creature* Patient = me->SummonCreature(patientEntry, point->x, point->y, point->z, point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
{
|
||||
//303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND)
|
||||
Patient->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
Patient->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
|
||||
Patients.push_back(Patient->GetGUID());
|
||||
CAST_AI(npc_injured_patient::npc_injured_patientAI, Patient->AI())->DoctorGUID = me->GetGUID();
|
||||
|
|
@ -1449,7 +1449,7 @@ public:
|
|||
|
||||
void Reset() override
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue