Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag

Port From (https://github.com/TrinityCore/TrinityCore/commit/b47185cabfbdeeaf492bf2303635db07ce703785)
This commit is contained in:
hondacrx
2022-05-30 16:12:11 -04:00
parent f53c4cb009
commit 442da7511f
43 changed files with 188 additions and 185 deletions
+2 -2
View File
@@ -189,7 +189,7 @@ namespace Game.BattleFields
// Update faction of relic, only attacker can click on
relic.SetFaction(WGConst.WintergraspFaction[GetAttackerTeam()]);
// Set in use (not allow to click on before last door is broken)
relic.AddFlag(GameObjectFlags.InUse | GameObjectFlags.NotSelectable);
relic.SetFlag(GameObjectFlags.InUse | GameObjectFlags.NotSelectable);
m_titansRelicGUID = relic.GetGUID();
}
else
@@ -576,7 +576,7 @@ namespace Game.BattleFields
{
HandlePromotion(killer, victim);
// Allow to Skin non-released corpse
victim.AddUnitFlag(UnitFlags.Skinnable);
victim.SetUnitFlag(UnitFlags.Skinnable);
}
// @todo Recent PvP activity worldstate
+1 -1
View File
@@ -82,7 +82,7 @@ namespace Scripts.Pets
return;
// Stop Fighting
me.AddUnitFlag(UnitFlags.NonAttackable);
me.SetUnitFlag(UnitFlags.NonAttackable);
// Sanctuary
me.CastSpell(me, SpellIds.Sanctuary, true);
+9 -9
View File
@@ -1705,9 +1705,9 @@ namespace Scripts.Spells.Generic
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.AddDynamicFlag(UnitDynFlags.Dead);
target.AddUnitFlag2(UnitFlags2.FeignDeath);
target.AddUnitFlag(UnitFlags.PreventEmotesFromChatText);
target.SetDynamicFlag(UnitDynFlags.Dead);
target.SetUnitFlag2(UnitFlags2.FeignDeath);
target.SetUnitFlag(UnitFlags.PreventEmotesFromChatText);
Creature creature = target.ToCreature();
if (creature != null)
@@ -1740,8 +1740,8 @@ namespace Scripts.Spells.Generic
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.AddUnitFlag2(UnitFlags2.FeignDeath);
target.AddUnitFlag(UnitFlags.PreventEmotesFromChatText);
target.SetUnitFlag2(UnitFlags2.FeignDeath);
target.SetUnitFlag(UnitFlags.PreventEmotesFromChatText);
Creature creature = target.ToCreature();
if (creature != null)
@@ -1772,8 +1772,8 @@ namespace Scripts.Spells.Generic
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.AddDynamicFlag(UnitDynFlags.Dead);
target.AddUnitFlag2(UnitFlags2.FeignDeath);
target.SetDynamicFlag(UnitDynFlags.Dead);
target.SetUnitFlag2(UnitFlags2.FeignDeath);
Creature creature = target.ToCreature();
if (creature != null)
@@ -2382,7 +2382,7 @@ namespace Scripts.Spells.Generic
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.AddUnitFlag(UnitFlags.PreventEmotesFromChatText);
target.SetUnitFlag(UnitFlags.PreventEmotesFromChatText);
}
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
@@ -3514,7 +3514,7 @@ namespace Scripts.Spells.Generic
player.CombatStop();
if (player.IsNonMeleeSpellCast(true))
player.InterruptNonMeleeSpells(true);
player.AddUnitFlag(UnitFlags.NonAttackable);
player.SetUnitFlag(UnitFlags.NonAttackable);
// if player class = hunter || warlock Remove pet if alive
if ((player.GetClass() == Class.Hunter) || (player.GetClass() == Class.Warlock))
+2 -2
View File
@@ -1307,8 +1307,8 @@ namespace Scripts.Spells.Quest
void HandleApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.AddDynamicFlag(UnitDynFlags.Dead);
target.AddUnitFlag2(UnitFlags2.FeignDeath);
target.SetDynamicFlag(UnitDynFlags.Dead);
target.SetUnitFlag2(UnitFlags2.FeignDeath);
Creature creature = target.ToCreature();
if (creature != null)
+1 -1
View File
@@ -453,7 +453,7 @@ namespace Scripts.World.EmeraldDragons
_shades += (byte)SpellIds.TaerarShadeSpells.Length;
DoCast(SpellIds.Shade);
me.AddUnitFlag(UnitFlags.Uninteractible | UnitFlags.NonAttackable);
me.SetUnitFlag(UnitFlags.Uninteractible | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Passive);
++_stage;
+13 -13
View File
@@ -577,7 +577,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Chicken:
if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.None && RandomHelper.Rand32() % 30 == 1)
{
me.AddNpcFlag(NPCFlags.QuestGiver);
me.SetNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(Misc.FactionFriendly);
Talk(player.GetTeam() == Team.Horde ? TextIds.EmoteHelloH : TextIds.EmoteHelloA);
}
@@ -585,7 +585,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Cheer:
if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.Complete)
{
me.AddNpcFlag(NPCFlags.QuestGiver);
me.SetNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(Misc.FactionFriendly);
Talk(TextIds.EmoteCluck);
}
@@ -835,7 +835,7 @@ namespace Scripts.World.NpcSpecial
}
Event = true;
me.AddUnitFlag(UnitFlags.Uninteractible);
me.SetUnitFlag(UnitFlags.Uninteractible);
}
public void PatientDied(Position point)
@@ -932,7 +932,7 @@ namespace Scripts.World.NpcSpecial
if (Patient)
{
//303, this flag appear to be required for client side item.spell to work (TARGET_SINGLE_FRIEND)
Patient.AddUnitFlag(UnitFlags.PlayerControlled);
Patient.SetUnitFlag(UnitFlags.PlayerControlled);
Patients.Add(Patient.GetGUID());
((npc_injured_patient)Patient.GetAI()).DoctorGUID = me.GetGUID();
@@ -995,7 +995,7 @@ namespace Scripts.World.NpcSpecial
me.RemoveUnitFlag(UnitFlags.Uninteractible);
//no regen health
me.AddUnitFlag(UnitFlags.InCombat);
me.SetUnitFlag(UnitFlags.InCombat);
//to make them lay with face down
me.SetStandState(UnitStandStateType.Dead);
@@ -1038,7 +1038,7 @@ namespace Scripts.World.NpcSpecial
}
//make not selectable
me.AddUnitFlag(UnitFlags.Uninteractible);
me.SetUnitFlag(UnitFlags.Uninteractible);
//regen health
me.RemoveUnitFlag(UnitFlags.InCombat);
@@ -1075,9 +1075,9 @@ namespace Scripts.World.NpcSpecial
if (me.IsAlive() && me.GetHealth() <= 6)
{
me.RemoveUnitFlag(UnitFlags.InCombat);
me.AddUnitFlag(UnitFlags.Uninteractible);
me.SetUnitFlag(UnitFlags.Uninteractible);
me.SetDeathState(DeathState.JustDied);
me.AddDynamicFlag(UnitDynFlags.Dead);
me.SetDynamicFlag(UnitDynFlags.Dead);
if (!DoctorGUID.IsEmpty())
{
@@ -1232,7 +1232,7 @@ namespace Scripts.World.NpcSpecial
public override void Reset()
{
me.AddUnitFlag(UnitFlags.NonAttackable);
me.SetUnitFlag(UnitFlags.NonAttackable);
}
public override void JustEngagedWith(Unit who) { }
@@ -1439,7 +1439,7 @@ namespace Scripts.World.NpcSpecial
player.RemovePlayerFlag(PlayerFlags.NoXPGain); // turn on XP gain
break;
case eTradeskill.GossipActionInfoDef + 2:// XP OFF selected
player.AddPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
player.SetPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
break;
}
@@ -1936,7 +1936,7 @@ namespace Scripts.World.NpcSpecial
{
case GossipMenus.OptionIdBank:
{
me.AddNpcFlag(NPCFlags.Banker);
me.SetNpcFlag(NPCFlags.Banker);
uint _bankAura = IsArgentSquire() ? SpellIds.AuraBankS : SpellIds.AuraBankG;
if (!me.HasAura(_bankAura))
DoCastSelf(_bankAura);
@@ -1947,7 +1947,7 @@ namespace Scripts.World.NpcSpecial
}
case GossipMenus.OptionIdShop:
{
me.AddNpcFlag(NPCFlags.Vendor);
me.SetNpcFlag(NPCFlags.Vendor);
uint _shopAura = IsArgentSquire() ? SpellIds.AuraShopS : SpellIds.AuraShopG;
if (!me.HasAura(_shopAura))
DoCastSelf(_shopAura);
@@ -1958,7 +1958,7 @@ namespace Scripts.World.NpcSpecial
}
case GossipMenus.OptionIdMail:
{
me.AddNpcFlag(NPCFlags.Mailbox);
me.SetNpcFlag(NPCFlags.Mailbox);
player.GetSession().SendShowMailBox(me.GetGUID());
uint _mailAura = IsArgentSquire() ? SpellIds.AuraPostmanS : SpellIds.AuraPostmanG;