aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-03-27 18:14:47 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-27 18:14:47 +0200
commitb47185cabfbdeeaf492bf2303635db07ce703785 (patch)
treea162947c7357e964ef991471fe5a40b44f6bbbcf /src/server/scripts/World
parent4eba9786708dd3b22d9053c1a14eac7e6d03242e (diff)
Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp6
-rw-r--r--src/server/scripts/World/npcs_special.cpp30
2 files changed, 18 insertions, 18 deletions
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index 113346f6eae..8131f134dca 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -95,7 +95,7 @@ struct emerald_dragonAI : public WorldBossAI
void Reset() override
{
WorldBossAI::Reset();
- me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE));
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
DoCast(me, SPELL_MARK_OF_NATURE_AURA, true);
events.ScheduleEvent(EVENT_TAIL_SWEEP, 4s);
@@ -633,7 +633,7 @@ class boss_taerar : public CreatureScript
_shades += count;
DoCast(SPELL_SHADE);
- me->AddUnitFlag(UnitFlags(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE));
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
++_stage;
@@ -670,7 +670,7 @@ class boss_taerar : public CreatureScript
{
_banished = false;
- me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE));
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_SHADE);
me->SetReactState(REACT_AGGRESSIVE);
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 69a06bbb433..e4c5af9010f 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -261,7 +261,7 @@ public:
case TEXT_EMOTE_CHICKEN:
if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand32() % 30 == 1)
{
- me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->SetFaction(FACTION_FRIENDLY);
Talk(player->GetTeam() == HORDE ? EMOTE_HELLO_H : EMOTE_HELLO_A);
}
@@ -269,7 +269,7 @@ public:
case TEXT_EMOTE_CHEER:
if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE)
{
- me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->SetFaction(FACTION_FRIENDLY);
Talk(EMOTE_CLUCK_TEXT);
}
@@ -661,7 +661,7 @@ public:
}
Event = true;
- me->AddUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
}
void PatientDied(Position const* point)
@@ -772,7 +772,7 @@ public:
me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
//no regen health
- me->AddUnitFlag(UNIT_FLAG_IN_COMBAT);
+ me->SetUnitFlag(UNIT_FLAG_IN_COMBAT);
//to make them lay with face down
me->SetStandState(UNIT_STAND_STATE_DEAD);
@@ -810,7 +810,7 @@ public:
ENSURE_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, player, Coord);
//make uninteractible
- me->AddUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
//regen health
me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
@@ -847,9 +847,9 @@ public:
if (me->IsAlive() && me->GetHealth() <= 6)
{
me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
- me->AddUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->setDeathState(JUST_DIED);
- me->AddDynamicFlag(UNIT_DYNFLAG_DEAD);
+ me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
if (!DoctorGUID.IsEmpty())
if (Creature* doctor = ObjectAccessor::GetCreature((*me), DoctorGUID))
@@ -900,7 +900,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 diff)
if (Creature* Patient = me->SummonCreature(patientEntry, **point, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5s))
{
//303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND)
- Patient->AddUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
+ Patient->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
Patients.push_back(Patient->GetGUID());
ENSURE_AI(npc_injured_patient::npc_injured_patientAI, Patient->AI())->DoctorGUID = me->GetGUID();
@@ -1106,7 +1106,7 @@ public:
void Reset() override
{
- me->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -1752,7 +1752,7 @@ public:
player->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN); // turn on XP gain
break;
case GOSSIP_ACTION_INFO_DEF + 2: // XP OFF selected
- player->AddPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN); // turn off XP gain
+ player->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN); // turn off XP gain
break;
}
CloseGossipMenuFor(player);
@@ -2128,8 +2128,8 @@ public:
})
.Schedule(Seconds(1), [this](TaskContext context)
{
- if ((me->HasAura(SPELL_AURA_TIRED_S) || me->HasAura(SPELL_AURA_TIRED_G)) && me->HasNpcFlag(NPCFlags(UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR)))
- me->RemoveNpcFlag(NPCFlags(UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR));
+ if ((me->HasAura(SPELL_AURA_TIRED_S) || me->HasAura(SPELL_AURA_TIRED_G)) && me->HasNpcFlag(UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR))
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR);
context.Repeat();
});
}
@@ -2140,7 +2140,7 @@ public:
{
case GOSSIP_OPTION_BANK:
{
- me->AddNpcFlag(UNIT_NPC_FLAG_BANKER);
+ me->SetNpcFlag(UNIT_NPC_FLAG_BANKER);
uint32 _bankAura = IsArgentSquire() ? SPELL_AURA_BANK_S : SPELL_AURA_BANK_G;
if (!me->HasAura(_bankAura))
DoCastSelf(_bankAura);
@@ -2151,7 +2151,7 @@ public:
}
case GOSSIP_OPTION_SHOP:
{
- me->AddNpcFlag(UNIT_NPC_FLAG_VENDOR);
+ me->SetNpcFlag(UNIT_NPC_FLAG_VENDOR);
uint32 _shopAura = IsArgentSquire() ? SPELL_AURA_SHOP_S : SPELL_AURA_SHOP_G;
if (!me->HasAura(_shopAura))
DoCastSelf(_shopAura);
@@ -2162,7 +2162,7 @@ public:
}
case GOSSIP_OPTION_MAIL:
{
- me->AddNpcFlag(UNIT_NPC_FLAG_MAILBOX);
+ me->SetNpcFlag(UNIT_NPC_FLAG_MAILBOX);
player->GetSession()->SendShowMailBox(me->GetGUID());
uint32 _mailAura = IsArgentSquire() ? SPELL_AURA_POSTMAN_S : SPELL_AURA_POSTMAN_G;