aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-03-29 11:30:49 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-29 11:30:49 +0200
commitd611925dc7ab2b3f19c5ee9e0f75b8dfb6de1291 (patch)
tree4428ac0728c043ca1cb4fc55427f87268ab4860c /src/server/scripts/EasternKingdoms
parentc02b829788cb274a68b125aee4dab35b9a56a2b8 (diff)
Core/Units: Reduce differences between branches part 1 - unit updatefield accessors
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp46
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp26
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp34
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp22
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp4
44 files changed, 203 insertions, 211 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
index b16a28afc8f..7641143d621 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
@@ -159,9 +159,9 @@ class boss_doomrel : public CreatureScript
me->SetImmuneToPC(true);
if (_instance->GetData(DATA_GHOSTKILL) >= 7)
- me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
else
- me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
void JustEngagedWith(Unit* /*who*/) override
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
index e2e22704f2a..4bdaea4afad 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -77,7 +77,7 @@ struct boss_pyroguard_emberseer : public BossAI
void Reset() override
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetImmuneToPC(true);
events.Reset();
// Apply auras on spawn and reset
@@ -140,7 +140,7 @@ struct boss_pyroguard_emberseer : public BossAI
me->CastSpell(me, SPELL_EMBERSEER_FULL_STRENGTH);
Talk(EMOTE_FREE_OF_BONDS);
Talk(YELL_FREE_OF_BONDS);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetImmuneToPC(false);
events.ScheduleEvent(EVENT_ENTER_COMBAT, 2s);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index b02c6558c83..193fd6ad699 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -185,7 +185,7 @@ struct boss_victor_nefarius : public BossAI
me->SetVisible(true);
me->SetPhaseMask(1, true);
- me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->SetFaction(FACTION_FRIENDLY);
me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR);
me->RemoveAura(SPELL_NEFARIANS_BARRIER);
@@ -204,7 +204,7 @@ struct boss_victor_nefarius : public BossAI
Talk(SAY_GAMESBEGIN_2);
me->SetFaction(FACTION_DRAGONFLIGHT_BLACK);
- me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
DoCast(me, SPELL_NEFARIANS_BARRIER);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetImmuneToPC(false);
@@ -220,7 +220,7 @@ struct boss_victor_nefarius : public BossAI
if (summon->GetEntry() != NPC_NEFARIAN)
{
summon->UpdateEntry(NPC_BONE_CONSTRUCT);
- summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ summon->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
summon->SetReactState(REACT_PASSIVE);
summon->SetStandState(UNIT_STAND_STATE_DEAD);
}
@@ -561,7 +561,7 @@ struct boss_nefarian : public BossAI
{
(*itr)->Respawn();
DoZoneInCombat((*itr));
- (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ (*itr)->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
(*itr)->SetReactState(REACT_AGGRESSIVE);
(*itr)->SetStandState(UNIT_STAND_STATE_STAND);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
index b854edacdca..dfc591f591d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
@@ -69,9 +69,9 @@ struct boss_vaelastrasz : public BossAI
boss_vaelastrasz(Creature* creature) : BossAI(creature, DATA_VAELASTRAZ_THE_CORRUPT)
{
Initialize();
- creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ creature->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
creature->SetFaction(FACTION_FRIENDLY);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ creature->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
}
void Initialize()
@@ -108,7 +108,7 @@ struct boss_vaelastrasz : public BossAI
void BeginSpeech(Unit* target)
{
PlayerGUID = target->GetGUID();
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
events.ScheduleEvent(EVENT_SPEECH_1, 1s);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 6980cc0073f..d4af2951a09 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -160,7 +160,7 @@ struct boss_majordomo : public BossAI
{
case EVENT_OUTRO_1:
me->NearTeleportTo(RagnarosTelePos.GetPositionX(), RagnarosTelePos.GetPositionY(), RagnarosTelePos.GetPositionZ(), RagnarosTelePos.GetOrientation());
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
break;
case EVENT_OUTRO_2:
instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
@@ -179,7 +179,7 @@ struct boss_majordomo : public BossAI
{
if (action == ACTION_START_RAGNAROS)
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_SUMMON_MAJ);
events.ScheduleEvent(EVENT_OUTRO_2, 8s);
events.ScheduleEvent(EVENT_OUTRO_3, 24s);
@@ -187,7 +187,7 @@ struct boss_majordomo : public BossAI
else if (action == ACTION_START_RAGNAROS_ALT)
{
me->SetFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
index 915b8a20078..ebd9f7e8403 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
@@ -82,7 +82,7 @@ struct boss_ragnaros : public BossAI
Initialize();
_introState = 0;
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
SetCombatMovement(false);
}
@@ -98,7 +98,7 @@ struct boss_ragnaros : public BossAI
{
BossAI::Reset();
Initialize();
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->SetEmoteState(EMOTE_ONESHOT_NONE);
}
void JustEngagedWith(Unit* victim) override
@@ -156,7 +156,7 @@ struct boss_ragnaros : public BossAI
break;
case EVENT_INTRO_5:
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
_introState = 2;
break;
@@ -172,8 +172,8 @@ struct boss_ragnaros : public BossAI
//Become unbanished again
me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_MONSTER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetEmoteState(EMOTE_ONESHOT_NONE);
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
AttackStart(target);
@@ -250,8 +250,8 @@ struct boss_ragnaros : public BossAI
//Root self
//DoCast(me, 23973);
me->SetFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetEmoteState(EMOTE_STATE_SUBMERGED);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
instance->SetData(DATA_RAGNAROS_ADDS, 0);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
index 057f5384dfe..69c28424726 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
@@ -163,7 +163,7 @@ public:
_scheduler.Schedule(Seconds(2), [this](TaskContext /*context*/)
{
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
DoZoneInCombat();
});
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index e85a7d205a8..35394225430 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -158,7 +158,7 @@ public:
events.SetPhase(PHASE_INTRO);
me->setActive(true);
me->SetFarVisible(true);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->GetMotionMaster()->MoveAlongSplineChain(POINT_INTRO_START, SPLINE_CHAIN_INTRO_START, false);
HandleTerraceDoors(false);
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 9bd1c87cd1a..9360d3200ee 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -158,7 +158,7 @@ public:
if (spellInfo->Id == SPELL_INFERNAL_RELAY)
{
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
HellfireTimer = 4000;
CleanupTimer = 170000;
}
@@ -449,7 +449,7 @@ public:
Creature* axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
if (axe)
{
- axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ axe->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
axe->SetFaction(me->GetFaction());
axes[i] = axe->GetGUID();
if (target)
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index 40f82077314..f06c6246569 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -246,7 +246,7 @@ public:
else FrostCooldown = 0;
}
- if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
+ if (!Drinking && me->GetMaxPower(POWER_MANA) && me->GetPowerPct(POWER_MANA) < 20.f)
{
Drinking = true;
me->InterruptNonMeleeSpells(false);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 9ca1f23d69f..2e6314c1748 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -182,7 +182,7 @@ public:
void AttackStart(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -191,7 +191,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -203,7 +203,7 @@ public:
{
if (AggroTimer <= diff)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -347,7 +347,7 @@ public:
void AttackStart(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -356,7 +356,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -403,7 +403,7 @@ public:
{
if (AggroTimer <= diff)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -481,7 +481,7 @@ public:
void AttackStart(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -490,7 +490,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -514,7 +514,7 @@ public:
{
if (AggroTimer <= diff)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -585,7 +585,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -593,7 +593,7 @@ public:
void AttackStart(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -627,7 +627,7 @@ public:
{
if (AggroTimer <= diff)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -683,7 +683,7 @@ public:
// Anyway, I digress.
// @todo This line below is obviously a hack. Duh. I'm just coming in here to hackfix the encounter to actually be completable.
// It needs a rewrite. Badly. Please, take good care of it.
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
CycloneTimer = 30000;
ChainLightningTimer = 10000;
@@ -1019,7 +1019,7 @@ void PretendToDie(Creature* creature)
creature->InterruptNonMeleeSpells(true);
creature->RemoveAllAuras();
creature->SetHealth(0);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ creature->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
creature->GetMotionMaster()->Clear();
creature->GetMotionMaster()->MoveIdle();
creature->SetStandState(UNIT_STAND_STATE_DEAD);
@@ -1027,7 +1027,7 @@ void PretendToDie(Creature* creature)
void Resurrect(Creature* target)
{
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ target->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
target->SetFullHealth();
target->SetStandState(UNIT_STAND_STATE_STAND);
target->CastSpell(target, SPELL_RES_VISUAL, true);
@@ -1115,7 +1115,7 @@ public:
void AttackStart(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -1124,7 +1124,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1252,11 +1252,11 @@ public:
{
if (Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID)))
{
- Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ Julianne->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
Julianne->GetMotionMaster()->Clear();
Julianne->setDeathState(JUST_DIED);
Julianne->CombatStop(true);
- Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ Julianne->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
}
@@ -1292,7 +1292,7 @@ public:
void MoveInLineOfSight(Unit* who) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1380,7 +1380,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
if (AggroYellTimer <= diff)
{
Talk(SAY_JULIANNE_AGGRO);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetFaction(FACTION_MONSTER_2);
AggroYellTimer = 0;
} else AggroYellTimer -= diff;
@@ -1521,11 +1521,11 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32& dama
{
if (Creature* Romulo = (ObjectAccessor::GetCreature((*me), RomuloGUID)))
{
- Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ Romulo->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
Romulo->GetMotionMaster()->Clear();
Romulo->setDeathState(JUST_DIED);
Romulo->CombatStop(true);
- Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ Romulo->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index cfcaae42b14..206c8b2646e 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -196,7 +196,7 @@ public:
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1min))
{
- spotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ spotlight->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
spotlight->CastSpell(spotlight, SPELL_SPOTLIGHT, false);
m_uiSpotlightGUID = spotlight->GetGUID();
}
@@ -272,11 +272,7 @@ public:
float PosX = Spawns[index][1];
if (Creature* creature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 2h))
- {
- // In case database has bad flags
- creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
+ creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
RaidWiped = false;
@@ -467,7 +463,7 @@ public:
void Reset() override
{
Initialize();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if (instance->GetGuidData(DATA_IMAGE_OF_MEDIVH).IsEmpty())
{
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index ca3a96f9497..d0a6cee6b06 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -283,7 +283,7 @@ struct boss_felblood_kaelthas : public BossAI
{
case EVENT_TALK_INTRO_1:
Talk(SAY_INTRO_1);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ me->SetEmoteState(EMOTE_STATE_TALK);
events.ScheduleEvent(EVENT_TALK_INTRO_2, 20s + 600ms, 0, PHASE_INTRO);
events.ScheduleEvent(EVENT_LAUGH_EMOTE, 15s + 600ms, 0, PHASE_INTRO);
break;
@@ -295,7 +295,7 @@ struct boss_felblood_kaelthas : public BossAI
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH_NO_SHEATHE);
break;
case EVENT_FINISH_INTRO:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ me->SetEmoteState(EMOTE_ONESHOT_NONE);
me->SetImmuneToPC(false);
break;
case EVENT_FIREBALL:
@@ -412,7 +412,7 @@ struct npc_felblood_kaelthas_phoenix : public ScriptedAI
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
me->RemoveAllAuras();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
DoCastSelf(SPELL_EMBER_BLAST);
// DoCastSelf(SPELL_SUMMON_PHOENIX_EGG); -- We do a manual summon for now. Feel free to move it to spelleffect_dbc
if (Creature* egg = DoSummon(NPC_PHOENIX_EGG, me->GetPosition(), 0s))
@@ -469,7 +469,7 @@ struct npc_felblood_kaelthas_phoenix : public ScriptedAI
_isInEgg = false;
DoCastSelf(SPELL_FULL_HEAL);
DoCastSelf(SPELL_BURN);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
_events.ScheduleEvent(EVENT_ATTACK_PLAYERS, 2s);
break;
default:
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index 8a8dcd29a8f..1747d99f3db 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
@@ -242,10 +242,7 @@ public:
if (instance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
instance->SetBossState(DATA_PRIESTESS_DELRISSA, DONE);
else
- {
- if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
+ me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
void UpdateAI(uint32 diff) override
@@ -424,8 +421,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
//time to make her lootable and complete event if she died before lackeys
if (!delrissa->IsAlive())
{
- if (!delrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
- delrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ delrissa->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
instance->SetBossState(DATA_PRIESTESS_DELRISSA, DONE);
}
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
index 98bd562cb22..8cb2c5e0d10 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
@@ -153,7 +153,7 @@ class boss_selin_fireheart : public CreatureScript
Unit* CrystalChosen = ObjectAccessor::GetUnit(*me, CrystalGUID);
if (CrystalChosen && CrystalChosen->IsAlive())
{
- CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ CrystalChosen->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true);
events.ScheduleEvent(EVENT_EMPOWER, 10s, PHASE_DRAIN);
}
@@ -222,7 +222,7 @@ class boss_selin_fireheart : public CreatureScript
return;
}
- if (me->GetPower(POWER_MANA) * 100 / me->GetMaxPower(POWER_MANA) < 10)
+ if (me->GetPowerPct(POWER_MANA) < 10.f)
{
if (events.IsInPhase(PHASE_NORMAL) && !_scheduledEvents)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 4d6065bb503..587f4a67d43 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -569,7 +569,7 @@ public:
me->RestoreFaction();
CombatAI::Reset();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CAN_SWIM);
+ me->SetUnitFlag(UNIT_FLAG_CAN_SWIM);
}
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
@@ -661,7 +661,7 @@ public:
return true;
me->SetImmuneToPC(false);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CAN_SWIM);
+ me->RemoveUnitFlag(UNIT_FLAG_CAN_SWIM);
player->CastSpell(me, SPELL_DUEL, false);
player->CastSpell(player, SPELL_DUEL_FLAG, true);
@@ -884,7 +884,7 @@ class spell_deliver_stolen_horse : public SpellScript
Unit* caster = GetCaster();
caster->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE);
- caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ caster->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
caster->SetFaction(FACTION_FRIENDLY);
caster->CastSpell(caster, SPELL_CALL_DARK_RIDER, true);
@@ -926,8 +926,8 @@ public:
return;
deathcharger->RestoreFaction();
- deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ deathcharger->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
+ deathcharger->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
if (!me->GetVehicle() && deathcharger->IsVehicle() && deathcharger->GetVehicleKit()->HasEmptySeat(0))
me->EnterVehicle(deathcharger);
}
@@ -940,8 +940,8 @@ public:
if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle())
{
- deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ deathcharger->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
+ deathcharger->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
deathcharger->SetFaction(FACTION_SCARLET_CRUSADE_2);
}
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 539150de929..f50d6c03f3a 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -138,9 +138,9 @@ struct npc_koltira_deathweaver : public ScriptedAI
void Reset() override
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_DEAD);
+ me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
me->RemoveAllAuras();
_events.Reset();
@@ -164,14 +164,14 @@ struct npc_koltira_deathweaver : public ScriptedAI
switch (eventId)
{
case EVENT_INTRO_0:
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_SIT);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_KOLTIRA_0);
_events.ScheduleEvent(EVENT_INTRO_1, 5s);
break;
case EVENT_INTRO_1:
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
Talk(SAY_KOLTIRA_1);
_events.ScheduleEvent(EVENT_INTRO_2, 2s);
@@ -190,7 +190,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
case EVENT_INTRO_4:
DoCastSelf(SPELL_KOLTIRA_TRANSFORM);
me->LoadEquipment(POINT_ID_1);
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
me->GetMotionMaster()->MovePoint(POINT_ID_2, koltiraPos[2], true, 3.839724f);
break;
@@ -202,8 +202,8 @@ struct npc_koltira_deathweaver : public ScriptedAI
break;
case EVENT_INTRO_6:
Talk(SAY_KOLTIRA_3);
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_KNEEL);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
_eventGossip = true;
break;
@@ -240,8 +240,8 @@ struct npc_koltira_deathweaver : public ScriptedAI
break;
case EVENT_OUTRO_1:
me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE);
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_KOLTIRA_8);
_events.ScheduleEvent(EVENT_OUTRO_2, 7s);
@@ -259,7 +259,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
break;
case EVENT_OUTRO_4:
me->SetWalk(false);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
DoCastSelf(SPELL_HERO_AGGRO);
me->GetMotionMaster()->MovePath(NPC_KOLTIRA, false);
@@ -290,7 +290,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
{
if (pointId == POINT_ID_1)
{
- me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_KNEEL);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
FakeValrothTalk(SAY_VALROTH_0);
_events.ScheduleEvent(EVENT_SPAWN_WAVE_1, 1s);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 9b33e002de8..b5d5607ac09 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -526,7 +526,7 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
{
temp->SetWalk(true);
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
+ temp->SetEmoteState(EMOTE_STATE_READY2H);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
@@ -566,7 +566,7 @@ public:
JumpToNextStep(2000);
break;
case 8:
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP));
+ me->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID))
me->CastSpell(temp, SPELL_ASHBRINGER, true);
Talk(EMOTE_LIGHT_OF_DAWN14);
@@ -600,7 +600,7 @@ public:
//UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 1);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
JumpToNextStep(3000);
break;
@@ -758,7 +758,7 @@ public:
case 15: // summon gate
if (Creature* temp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min))
{
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ temp->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
temp->CastSpell(temp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true);
temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN06);
uiAlexandrosGUID = temp->GetGUID();
@@ -769,7 +769,7 @@ public:
case 16: // Alexandros out
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiAlexandrosGUID))
{
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ temp->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23]);
temp->AI()->Talk(SAY_LIGHT_OF_DAWN32);
}
@@ -974,7 +974,7 @@ public:
if (fLichPositionX && fLichPositionY)
{
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10s);
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
+ temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->SetFaction(me->GetFaction());
@@ -982,7 +982,7 @@ public:
uiDefenderGUID[0] = temp->GetGUID();
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10s);
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
+ temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->SetFaction(me->GetFaction());
@@ -991,7 +991,7 @@ public:
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
+ temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
@@ -999,7 +999,7 @@ public:
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
+ temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED);
@@ -1007,7 +1007,7 @@ public:
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
+ temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
@@ -1022,21 +1022,21 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ temp->SetEmoteState(EMOTE_ONESHOT_NONE);
temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ temp->SetEmoteState(EMOTE_ONESHOT_NONE);
temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID))
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ temp->SetEmoteState(EMOTE_ONESHOT_NONE);
temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17]);
@@ -1086,7 +1086,7 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID))
{
temp->SetStandState(UNIT_STAND_STATE_STAND);
- temp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING));
+ temp->SetVirtualItem(0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING));
temp->CastSpell(temp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false);
}
JumpToNextStep(1000);
@@ -1131,7 +1131,7 @@ public:
{
temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN16);
temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
+ temp->SetEmoteState(EMOTE_STATE_READY2H);
temp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2]);
@@ -1186,7 +1186,7 @@ public:
temp->CastSpell(temp, SPELL_TELEPORT_VISUAL, false);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion
{
- temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ temp->SetEmoteState(EMOTE_ONESHOT_NONE);
temp->SetSpeedRate(MOVE_RUN, 1.0f);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6]);
}
@@ -1378,7 +1378,7 @@ public:
if (Creature* temp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].GetPositionWithOffset({ 0.0f, 0.0f, 0.0f, 1.528f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10min))
{
temp->SetFaction(me->GetFaction());
- temp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP));
+ temp->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
temp->AI()->Talk(SAY_LIGHT_OF_DAWN25);
uiTirionGUID = temp->GetGUID();
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 74b4410b45e..9bb3b7c0a00 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -199,7 +199,7 @@ struct npc_headless_horseman_head : public PassiveAI
void HandleInitialSetup()
{
DoCastSelf(SPELL_HEADLESS_HORSEMAN_C_HEAD_STUN);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
_phase = PHASE_1;
_events.SetPhase(PHASE_1);
}
@@ -256,7 +256,7 @@ struct npc_headless_horseman_head : public PassiveAI
{
me->RemoveAurasDueToSpell(SPELL_HEADLESS_HORSEMAN_C_HEAD_STUN);
DoCastSelf(SPELL_HEADLESS_HORSEMAN_C_HEAD_VISUAL, true);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->GetMotionMaster()->MoveRandom(30.0f);
switch (_phase)
@@ -311,11 +311,11 @@ struct npc_headless_horseman_head : public PassiveAI
DoCast(horseman, SPELL_HEADLESS_HORSEMAN_C_RETURN_HEAD, true);
me->RemoveAllAttackers();
me->GetMotionMaster()->Clear();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
break;
case EVENT_RAIN_OF_TREATS:
DoCastSelf(SPELL_RAIN_OF_TREATS);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
_instance->SetData(DATA_PREPARE_RESET, 0);
if (GameObject* pumpkin = me->SummonGameObject(GO_PUMPKIN_SHRINE, GOPumpkinSpawnPosition, GOPumpkinSpawnQuat, 7_days))
me->RemoveGameObject(pumpkin, false);
@@ -707,8 +707,8 @@ struct npc_sir_thomas : public PassiveAI
void Reset() override
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
DoCastSelf(SPELL_HEADLESS_HORSEMAN_WISP_INVIS);
_scheduler.Schedule(9s, [this](TaskContext /*context*/)
@@ -721,8 +721,8 @@ struct npc_sir_thomas : public PassiveAI
{
if (spellInfo->Id == SPELL_HEADLESS_HORSEMAN_WISP_FLIGHT_PORT)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->RemoveAurasDueToSpell(SPELL_HEADLESS_HORSEMAN_WISP_INVIS);
DoCastSelf(SPELL_HEADLESS_HORSEMAN_C_GHOST_VISUAL, true);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
index 0b9ebe6b2ce..e81e35e53e5 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -96,7 +96,7 @@ public:
_killYellTimer.Reset(0s);
DoCastSelf(SPELL_RETRIBUTION_AURA, true);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetReactState(REACT_AGGRESSIVE);
@@ -170,7 +170,7 @@ public:
me->ClearComboPointHolders();
me->RemoveAllAuras();
me->ClearAllReactives();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetReactState(REACT_PASSIVE); // prevent Mograine from attacking while fake death
@@ -192,7 +192,7 @@ public:
// Say text
Talk(SAY_MO_RESURRECTED);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
});
@@ -203,7 +203,7 @@ public:
events.ScheduleEvent(EVENT_HAMMER_OF_JUSTICE, 10s, 15s);
// We can now die
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
_canDie = true;
DoCastSelf(SPELL_RETRIBUTION_AURA, true);
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
index 3c84527a48e..97a0d1fa435 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
@@ -90,14 +90,14 @@ public:
break;
case EVENT_ILLUSION:
DoCast(SPELL_ILLUSION);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetDisplayId(11686); // Invisible Model
ModifyThreatByPercent(me->GetVictim(), -99);
events.ScheduleEvent(EVENT_SET_VISIBILITY, 3s);
events.ScheduleEvent(EVENT_ILLUSION, 25s);
break;
case EVENT_SET_VISIBILITY:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetDisplayId(11073); //Jandice Model
break;
default:
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
index 63cc9e551a1..05ec449e8d1 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
@@ -129,7 +129,7 @@ class boss_kirtonos_the_herald : public CreatureScript
events.ScheduleEvent(INTRO_1, 500ms);
me->SetDisableGravity(true);
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
Talk(EMOTE_SUMMONED);
}
@@ -178,8 +178,8 @@ class boss_kirtonos_the_herald : public CreatureScript
break;
case INTRO_5:
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
+ me->SetVirtualItem(0, uint32(WEAPON_KIRTONOS_STAFF));
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
me->SetReactState(REACT_AGGRESSIVE);
events.ScheduleEvent(INTRO_6, 5s);
break;
@@ -233,13 +233,13 @@ class boss_kirtonos_the_herald : public CreatureScript
if (me->HasAura(SPELL_KIRTONOS_TRANSFORM))
{
me->RemoveAura(SPELL_KIRTONOS_TRANSFORM);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
+ me->SetVirtualItem(0, uint32(0));
me->SetCanFly(false);
}
else
{
DoCast(me, SPELL_KIRTONOS_TRANSFORM);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
+ me->SetVirtualItem(0, uint32(WEAPON_KIRTONOS_STAFF));
me->SetCanFly(true);
}
events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 16s, 18s);
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
index fbf53d96f7d..8531267112a 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
@@ -101,7 +101,7 @@ struct boss_apothecary_hummel : public BossAI
{
if (menuId == GOSSIP_MENU_HUMMEL && gossipListId == GOSSIP_OPTION_START)
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
CloseGossipMenuFor(player);
DoAction(ACTION_START_EVENT);
}
@@ -150,7 +150,7 @@ struct boss_apothecary_hummel : public BossAI
_isDead = true;
me->RemoveAurasDueToSpell(SPELL_ALLURING_PERFUME);
DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH, true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
Talk(SAY_HUMMEL_DEATH);
}
}
@@ -171,7 +171,7 @@ struct boss_apothecary_hummel : public BossAI
Talk(SAY_HUMMEL_DEATH);
events.Reset();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
instance->SetBossState(DATA_APOTHECARY_HUMMEL, DONE);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
@@ -302,7 +302,7 @@ struct npc_apothecary_genericAI : public ScriptedAI
void MovementInform(uint32 type, uint32 pointId) override
{
if (type == POINT_MOTION_TYPE && pointId == 1)
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
+ me->SetEmoteState(EMOTE_STATE_USE_STANDING);
}
protected:
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index 5e624ae41e4..c4a2df94fe2 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -170,7 +170,7 @@ class instance_stratholme : public InstanceMapScript
break;
case NPC_YSIDA:
ysidaGUID = creature->GetGUID();
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ creature->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
break;
}
}
@@ -278,7 +278,7 @@ class instance_stratholme : public InstanceMapScript
ysida->CastSpell(nullptr, SPELL_YSIDA_SAVED, true);
ysida->SetWalk(true);
ysida->AI()->Talk(SAY_YSIDA_SAVED);
- ysida->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ ysida->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
ysida->GetClosePoint(x, y, z, ysida->GetObjectScale() / 3, 4.0f);
ysida->GetMotionMaster()->MovePoint(1, x, y, z);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 549797c12fb..ee0104f9b0f 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -158,7 +158,7 @@ public:
IsIntro = true;
Madrigosa->SetMaxHealth(me->GetMaxHealth());
Madrigosa->SetHealth(me->GetMaxHealth());
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->Attack(Madrigosa, true);
Madrigosa->Attack(me, true);
}
@@ -172,7 +172,7 @@ public:
void EndIntro()
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
Intro = false;
IsIntro = false;
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index 09062b079fd..4a40289eb12 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
@@ -158,7 +158,7 @@ public:
instance->SetBossState(DATA_EREDAR_TWINS, DONE);
}
else
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
@@ -438,7 +438,7 @@ public:
instance->SetBossState(DATA_EREDAR_TWINS, DONE);
}
else
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index e75f3860926..ebaf536ccdb 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -147,8 +147,8 @@ public:
events.Reset();
me->SetDisableGravity(true);
- me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
- me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
+ me->SetBoundingRadius(10);
+ me->SetCombatReach(10);
DespawnSummons(NPC_VAPOR_TRAIL);
me->setActive(false);
@@ -560,7 +560,7 @@ public:
{
DoCast(me, SPELL_TRAIL_TRIGGER, true);
me->SetTarget(me->GetGUID());
- me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01f); // core bug
+ me->SetBoundingRadius(0.01f); // core bug
}
void Reset() override { }
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 4ed378da0b7..7b2e2ef6fcf 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -263,7 +263,7 @@ public:
{
Initialize();
me->SetDisableGravity(true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->setActive(true);
me->SetFarVisible(true);
@@ -443,8 +443,8 @@ public:
void InitializeAI() override
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->AddUnitState(UNIT_STATE_STUNNED);
ScriptedAI::InitializeAI();
@@ -589,7 +589,7 @@ public:
if (Creature* pKalec = instance->GetCreature(DATA_KALECGOS_KJ))
pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
- me->SetFloatValue(UNIT_FIELD_COMBATREACH, 12);
+ me->SetCombatReach(12);
summons.DespawnAll();
}
@@ -616,8 +616,8 @@ public:
{
if (summoned->GetEntry() == NPC_ARMAGEDDON_TARGET)
{
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summoned->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ summoned->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
// summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals
}
else
@@ -1037,7 +1037,7 @@ public:
void Reset() override
{
Initialize();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE|UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE|UNIT_FLAG_NON_ATTACKABLE);
}
void JustSummoned(Creature* summoned) override
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 27609a0688c..83ddf0563af 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -233,7 +233,7 @@ struct boss_muru : public BossAI
{
_Reset();
Initialize();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetVisible(true);
}
@@ -280,7 +280,7 @@ struct boss_muru : public BossAI
_phase = PHASE_TWO;
me->RemoveAllAuras();
DoCast(me, SPELL_OPEN_ALL_PORTALS, true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
scheduler.Schedule(Seconds(6), [this](TaskContext /*context*/)
{
@@ -372,7 +372,7 @@ struct npc_dark_fiend : public ScriptedAI
_scheduler.Schedule(Seconds(2), [this](TaskContext /*context*/)
{
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
if (Creature* _summoner = ObjectAccessor::GetCreature(*me, _summonerGUID))
if (Unit* target = _summoner->AI()->SelectTarget(SelectTargetMethod::Random, 0))
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 316cc7524c8..116a555c2e5 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -101,7 +101,7 @@ class boss_archaedas : public CreatureScript
instance->SetData(0, 5); // respawn any dead minions
me->SetFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->AddAura(SPELL_FREEZE_ANIM, me);
}
@@ -114,7 +114,7 @@ class boss_archaedas : public CreatureScript
{
DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag);
minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
- minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ minion->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
minion->SetControlled(false, UNIT_STATE_ROOT);
minion->SetFaction(FACTION_MONSTER);
minion->RemoveAura(SPELL_MINION_FREEZE_ANIM);
@@ -124,7 +124,7 @@ class boss_archaedas : public CreatureScript
void JustEngagedWith(Unit* /*who*/) override
{
me->SetFaction(FACTION_MONSTER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(false, UNIT_STATE_ROOT);
}
@@ -264,7 +264,7 @@ class npc_archaedas_minions : public CreatureScript
Initialize();
me->SetFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->RemoveAllAuras();
me->AddAura(SPELL_MINION_FREEZE_ANIM, me);
@@ -274,7 +274,7 @@ class npc_archaedas_minions : public CreatureScript
{
me->SetFaction(FACTION_MONSTER);
me->RemoveAllAuras();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(false, UNIT_STATE_ROOT);
bAmIAwake = true;
}
@@ -353,7 +353,7 @@ class npc_stonekeepers : public CreatureScript
void Reset() override
{
me->SetFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->RemoveAllAuras();
me->AddAura(SPELL_MINION_FREEZE_ANIM, me);
@@ -362,7 +362,7 @@ class npc_stonekeepers : public CreatureScript
void JustEngagedWith(Unit* /*who*/) override
{
me->SetFaction(FACTION_MONSTER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetControlled(false, UNIT_STATE_ROOT);
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 399a13d7e1a..ec21f8fddc5 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -151,7 +151,7 @@ class instance_uldaman : public InstanceMapScript
{
creature->SetFaction(FACTION_FRIENDLY);
creature->RemoveAllAuras();
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ creature->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
creature->SetControlled(true, UNIT_STATE_ROOT);
creature->AddAura(SPELL_MINION_FREEZE_ANIM, creature);
}
@@ -185,7 +185,7 @@ class instance_uldaman : public InstanceMapScript
continue;
target->SetControlled(false, UNIT_STATE_ROOT);
target->SetFaction(FACTION_MONSTER);
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ target->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
return; // only want the first one we find
@@ -208,7 +208,7 @@ class instance_uldaman : public InstanceMapScript
if (!target || !target->IsAlive() || target->GetFaction() == FACTION_MONSTER)
continue;
target->SetControlled(false, UNIT_STATE_ROOT);
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ target->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
target->SetFaction(FACTION_MONSTER);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
@@ -263,7 +263,7 @@ class instance_uldaman : public InstanceMapScript
archaedas->RemoveAura(SPELL_FREEZE_ANIM);
archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN, false);
archaedas->SetFaction(FACTION_TITAN);
- archaedas->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ archaedas->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
whoWokeuiArchaedasGUID = target;
}
}
@@ -276,7 +276,7 @@ class instance_uldaman : public InstanceMapScript
ironaya->SetFaction(FACTION_TITAN);
ironaya->SetControlled(false, UNIT_STATE_ROOT);
- ironaya->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ ironaya->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
ironaya->GetMotionMaster()->Clear();
ironaya->GetMotionMaster()->MovePoint(0, IronayaPoint);
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
index 7cdbd1eacd8..ad5f9e9588c 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
@@ -191,7 +191,7 @@ class boss_akilzon : public CreatureScript
trigger->SetFaction(FACTION_FRIENDLY);
trigger->SetMaxHealth(100000);
trigger->SetHealth(100000);
- trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ trigger->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
if (Cloud)
{
CastSpellExtraArgs args;
@@ -291,7 +291,7 @@ class boss_akilzon : public CreatureScript
Cloud->SetFaction(FACTION_FRIENDLY);
Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999);
- Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ Cloud->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
}
StormCount = 1;
events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 1min); // 60 seconds(bosskillers)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
index eeb31d4ccc3..7a2eeef610a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
@@ -184,7 +184,7 @@ class boss_halazzi : public CreatureScript
if (Unit* pLynx = ObjectAccessor::GetUnit(*me, LynxGUID))
{
Talk(SAY_MERGE);
- pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pLynx->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
pLynx->GetMotionMaster()->Clear();
pLynx->GetMotionMaster()->MoveFollow(me, 0, 0);
me->GetMotionMaster()->Clear();
@@ -371,7 +371,7 @@ class npc_halazzi_lynx : public CreatureScript
void AttackStart(Unit* who) override
{
- if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
ScriptedAI::AttackStart(who);
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index 5c3d213f2cc..3a5dc9f3e87 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -429,7 +429,7 @@ class boss_hexlord_malacrass : public CreatureScript
else
{
trigger->SetDisplayId(11686);
- trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ trigger->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
trigger->GetMotionMaster()->MoveChase(me);
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index 195750663a0..ec661a69469 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
@@ -278,9 +278,9 @@ class boss_janalai : public CreatureScript
{
if (Unit* FireBomb = ObjectAccessor::GetUnit(*me, FireBombGUIDs[BombCount]))
{
- FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ FireBomb->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true);
- FireBomb->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ FireBomb->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
}
++BombCount;
if (BombCount == 40)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 8d44c4b3c74..09be494a80c 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
@@ -132,8 +132,8 @@ class boss_nalorakk : public CreatureScript
if (MoveEvent)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
inMove = false;
waitTimer = 0;
me->SetSpeedRate(MOVE_RUN, 2);
@@ -225,8 +225,8 @@ class boss_nalorakk : public CreatureScript
Talk(YELL_NALORAKK_WAVE4);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
MoveEvent = false;
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
index 2a38d1e586e..e1c4f20c7fd 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
@@ -197,7 +197,7 @@ class boss_zuljin : public CreatureScript
Initialize();
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 33975);
+ me->SetVirtualItem(0, 33975);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
@@ -226,7 +226,7 @@ class boss_zuljin : public CreatureScript
Talk(YELL_DEATH);
if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[3]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
+ Temp->SetStandState(UNIT_STAND_STATE_DEAD);
}
void AttackStart(Unit* who) override
@@ -267,8 +267,8 @@ class boss_zuljin : public CreatureScript
if (Creature* creature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].pos, TEMPSUMMON_DEAD_DESPAWN))
{
creature->CastSpell(creature, SPELL_SPIRIT_AURA, true);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
+ creature->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
SpiritGUID[i] = creature->GetGUID();
}
}
@@ -302,14 +302,14 @@ class boss_zuljin : public CreatureScript
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
ResetThreatList();
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ me->SetVirtualItem(0, 0);
me->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(me, Transform[Phase].spell);
Talk(Transform[Phase].text);
if (Phase > 0)
{
if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[Phase - 1]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
+ Temp->SetStandState(UNIT_STAND_STATE_DEAD);
}
if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[NextPhase - 1]))
Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index 9a755e05246..736cdd27286 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -161,8 +161,8 @@ class instance_zulaman : public InstanceMapScript
{
if (Unit* hostage = player->SummonCreature(HostageInfo[num].npc, HostageInfo[num].pos, TEMPSUMMON_DEAD_DESPAWN))
{
- hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ hostage->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
+ hostage->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index 879ecdc4dc4..d0bb49544f0 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -71,10 +71,10 @@ class npc_zulaman_hostage : public CreatureScript
if (action == GOSSIP_ACTION_INFO_DEF + 1)
CloseGossipMenuFor(player);
- if (!me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ if (!me->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
//uint8 progress = instance->GetData(DATA_CHESTLOOTED);
instance->SetData(DATA_CHESTLOOTED, 0);
@@ -198,7 +198,7 @@ class npc_harrison_jones : public CreatureScript
{
CloseGossipMenuFor(player);
me->SetFacingToObject(player);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_HARRISON_0);
_gongEvent = GONG_EVENT_1;
_gongTimer = 4000;
@@ -214,8 +214,8 @@ class npc_harrison_jones : public CreatureScript
me->SetEntry(NPC_HARRISON_JONES_2);
me->SetDisplayId(MODEL_HARRISON_JONES_2);
me->SetTarget(ObjectGuid::Empty);
- me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_DEAD);
- me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
+ me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
instance->SetData(DATA_GONGEVENT, DONE);
}
}
@@ -237,7 +237,7 @@ class npc_harrison_jones : public CreatureScript
me->SetFacingTo(6.235659f);
Talk(SAY_HARRISON_1);
DoCast(me, SPELL_BANGING_THE_GONG);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_MACE));
+ me->SetVirtualItem(0, uint32(WEAPON_MACE));
me->SetSheath(SHEATH_STATE_MELEE);
_gongEvent = GONG_EVENT_3;
_gongTimer = 4000;
@@ -278,7 +278,7 @@ class npc_harrison_jones : public CreatureScript
_gongEvent = GONG_EVENT_6;
break;
case GONG_EVENT_6:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
+ me->SetEmoteState(EMOTE_STATE_USE_STANDING);
Talk(SAY_HARRISON_3);
_gongTimer = 7000;
_gongEvent = GONG_EVENT_7;
@@ -291,7 +291,7 @@ class npc_harrison_jones : public CreatureScript
{
if (target->GetPositionX() > 120)
{
- target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR));
+ target->SetVirtualItem(0, uint32(WEAPON_SPEAR));
target->SetImmuneToPC(true);
target->SetReactState(REACT_PASSIVE);
target->AI()->SetData(0, 1);
@@ -312,8 +312,8 @@ class npc_harrison_jones : public CreatureScript
}
case GONG_EVENT_8:
DoCast(me, SPELL_STEALTH);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ me->SetVirtualItem(0, uint32(0));
+ me->SetEmoteState(EMOTE_ONESHOT_NONE);
me->GetMotionMaster()->MovePath(HARRISON_MOVE_3, false);
_gongTimer = 1000;
_gongEvent = 0;
@@ -329,7 +329,7 @@ class npc_harrison_jones : public CreatureScript
_gongTimer = 6000;
break;
case GONG_EVENT_11:
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
instance->SetData(DATA_GONGEVENT, NOT_STARTED);
_gongEvent = 0;
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
index f6fb41230ec..02150827d45 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
@@ -108,8 +108,8 @@ struct boss_arlokk : public BossAI
me->ApplyStatPctModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, DamageDecrease); // hack
_Reset();
Initialize();
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
+ me->SetVirtualItem(0, uint32(WEAPON_DAGGER));
+ me->SetVirtualItem(1, uint32(WEAPON_DAGGER));
me->SetWalk(false);
me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]);
}
@@ -228,8 +228,8 @@ struct boss_arlokk : public BossAI
case EVENT_TRANSFORM:
{
DoCast(me, SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP));
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP));
+ me->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
+ me->SetVirtualItem(1, uint32(EQUIP_UNEQUIP));
/*
CreatureTemplate const* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
@@ -239,7 +239,7 @@ struct boss_arlokk : public BossAI
me->AttackStop();
ResetThreatList();
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
DoCast(me, SPELL_VANISH_VISUAL);
DoCast(me, SPELL_VANISH);
events.ScheduleEvent(EVENT_VANISH, 1s, 0, PHASE_ONE);
@@ -258,7 +258,7 @@ struct boss_arlokk : public BossAI
break;
case EVENT_VISIBLE:
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_UNINTERACTIBLE);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
AttackStart(target);
me->RemoveAura(SPELL_SUPER_INVIS);
@@ -276,8 +276,8 @@ struct boss_arlokk : public BossAI
{
me->RemoveAura(SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
DoCast(me, SPELL_VANISH_VISUAL);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
+ me->SetVirtualItem(0, uint32(WEAPON_DAGGER));
+ me->SetVirtualItem(1, uint32(WEAPON_DAGGER));
/*
CreatureTemplate const* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg));
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
index 3ddb4e8360b..284fc8937a7 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
@@ -64,7 +64,7 @@ struct boss_renataki : public BossAI
me->InterruptSpell(CURRENT_GENERIC_SPELL);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->SetDisplayId(11686);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
_invisible = true;
_invisibleTimer = urand(15000, 30000);
}
@@ -95,7 +95,7 @@ struct boss_renataki : public BossAI
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->SetDisplayId(15268);
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE);
+ me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
_invisible = false;
_visibleTimer = 4000;
}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
index 30b0347095d..473de6c9cfa 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
@@ -129,7 +129,7 @@ struct boss_thekal : public BossAI
_Reset();
Initialize();
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
}
void JustDied(Unit* /*killer*/) override
@@ -301,7 +301,7 @@ struct boss_thekal : public BossAI
// Trigger phase change
_isChangingPhase = false;
DoCastSelf(SPELL_TIGER_FORM);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->ApplyStatPctModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, DamageIncrease);
ResetThreatList();
me->SetControlled(false, UNIT_STATE_ROOT);
@@ -401,7 +401,7 @@ struct npc_zealot_lorkhan : public ScriptedAI
{
_events.Reset();
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
@@ -499,7 +499,7 @@ struct npc_zealot_zath : public ScriptedAI
{
_events.Reset();
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
index 2e1b8db6887..fd1b09f4bf8 100644
--- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
@@ -141,7 +141,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
{
if (action == ACTION_START_QUEST)
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
if (Creature* thalorien = me->SummonCreature(NPC_THALORIEN_DAWNSEEKER, thalorienSummon, TEMPSUMMON_CORPSE_DESPAWN))
_thalorienGUID = thalorien->GetGUID();
@@ -153,7 +153,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
void Reset() override
{
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
_summons.DespawnAll();
_playerGUID.Clear();
_morlenGUID.Clear();
@@ -258,7 +258,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
{
thalorien->SetWalk(true);
thalorien->GetMotionMaster()->MovePoint(0, thalorienFight);
- thalorien->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
+ thalorien->SetEmoteState(EMOTE_STATE_READY2H);
thalorien->SetHomePosition(thalorienFight);
}
@@ -320,7 +320,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
creature->GetEntry() == NPC_MORLEN_GOLDGRIP)
continue;
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
if (Creature* thalorien = ObjectAccessor::GetCreature(*me, _thalorienGUID))
creature->AI()->AttackStart(thalorien);
}
@@ -334,7 +334,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
case EVENT_MORLEN_ATTACK:
if (Creature* morlen = ObjectAccessor::GetCreature(*me, _morlenGUID))
{
- morlen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ morlen->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
if (Creature* thalorien = ObjectAccessor::GetCreature(*me, _thalorienGUID))
morlen->AI()->AttackStart(thalorien);
}
@@ -374,7 +374,7 @@ struct npc_thalorien_dawnseeker : public ScriptedAI
thalorien->DespawnOrUnsummon(5s);
}
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
break;
}
diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
index 1f990fcb29d..b06667b2ea9 100644
--- a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
@@ -105,7 +105,7 @@ public:
_events.ScheduleEvent(EVENT_SET_QUESTGIVER_FLAG, 12s);
break;
case EVENT_SET_QUESTGIVER_FLAG:
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
_events.ScheduleEvent(EVENT_STAND, 3s);
break;
case EVENT_STAND:
@@ -128,7 +128,7 @@ public:
me->SetFaction(FACTION_ENEMY);
me->SetImmuneToPC(false);
AttackStart(player);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
}
}