From fc2872e16c5973d2a41bb9cbf8fcdbb63b095fb2 Mon Sep 17 00:00:00 2001 From: Keader Date: Sat, 1 Apr 2017 21:16:55 -0300 Subject: Core/Scripts: Fixed Volatile Ooze/Gas Cloud issues in Professor Putricide Closes #18925 (cherry picked from commit 8d198cb36050e63811f8f7f81a3daf2a3c961950) --- .../Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index d34819efbef..a1277ae754a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -278,7 +278,7 @@ class boss_professor_putricide : public CreatureScript Talk(SAY_AGGRO); DoCast(me, SPELL_OOZE_TANK_PROTECTION, true); DoZoneInCombat(me); - + me->SetCombatPulseDelay(5); instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, IN_PROGRESS); } @@ -730,7 +730,7 @@ class npc_putricide_oozeAI : public ScriptedAI { public: npc_putricide_oozeAI(Creature* creature, uint32 auraSpellId, uint32 hitTargetSpellId) : ScriptedAI(creature), - _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0) { } + _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0), _instance(creature->GetInstanceScript()){ } void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override { @@ -740,6 +740,10 @@ class npc_putricide_oozeAI : public ScriptedAI void Reset() override { + if (_instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) != IN_PROGRESS) + me->DespawnOrUnsummon(); + + me->SetInCombatWithZone(); DoCastAOE(_auraSpellId, true); } @@ -780,6 +784,7 @@ class npc_putricide_oozeAI : public ScriptedAI uint32 _auraSpellId; uint32 _hitTargetSpellId; uint32 _newTargetSelectTimer; + InstanceScript* _instance; }; class npc_volatile_ooze : public CreatureScript -- cgit v1.2.3 From 410585361a44c94ccc08a0d40ea2dc4fd45dc644 Mon Sep 17 00:00:00 2001 From: Keader Date: Sat, 1 Apr 2017 21:18:15 -0300 Subject: Core/Scripts: Typo in last commit (cherry picked from commit a2a8ffe72328590b43481b430b9a6f281ccdd4be) --- .../scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index a1277ae754a..116843c2398 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -730,7 +730,7 @@ class npc_putricide_oozeAI : public ScriptedAI { public: npc_putricide_oozeAI(Creature* creature, uint32 auraSpellId, uint32 hitTargetSpellId) : ScriptedAI(creature), - _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0), _instance(creature->GetInstanceScript()){ } + _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0), _instance(creature->GetInstanceScript()) { } void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override { -- cgit v1.2.3 From 287ed04c8b89c7a265452576f288ec83e4fa7e7c Mon Sep 17 00:00:00 2001 From: Keader Date: Sun, 2 Apr 2017 11:08:29 -0300 Subject: Core/Scripts: Fixed Baltharus the Warborn clones *Clones not working after wipe *Changed Clone Action for a event (to check casting) (cherry picked from commit 6b8c4fb74feb2210d2fb9ea60ec23ab407ffeb39) --- .../RubySanctum/boss_baltharus_the_warborn.cpp | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index e39a01547f1..2c48fee879e 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -51,7 +51,8 @@ enum Events EVENT_CLEAVE, EVENT_ENERVATING_BRAND, EVENT_INTRO_TALK, - EVENT_SUMMONS_ATTACK + EVENT_SUMMONS_ATTACK, + EVENT_CLONE }; enum Actions @@ -73,10 +74,8 @@ class boss_baltharus_the_warborn : public CreatureScript struct boss_baltharus_the_warbornAI : public BossAI { - boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), _introDone(false) - { - _cloneCount = RAID_MODE(1, 2, 2, 2); - } + boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), + _introDone(false), _cloneCount(RAID_MODE(1, 2, 2, 2)) { } void Reset() override { @@ -85,6 +84,7 @@ class boss_baltharus_the_warborn : public CreatureScript instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetMaxHealth()); if (Creature* channelTarget = instance->GetCreature(DATA_CRYSTAL_CHANNEL_TARGET)) DoCast(channelTarget, SPELL_BARRIER_CHANNEL); + _cloneCount = RAID_MODE(1, 2, 2, 2); } void DoAction(int32 action) override @@ -100,8 +100,8 @@ class boss_baltharus_the_warborn : public CreatureScript break; case ACTION_CLONE: { - DoCastSelf(SPELL_CLEAR_DEBUFFS); - DoCastSelf(SPELL_CLONE); + DoCastSelf(SPELL_CLEAR_DEBUFFS, true); + DoCastSelf(SPELL_CLONE, true); DoCastSelf(SPELL_REPELLING_WAVE); Talk(SAY_CLONE); --_cloneCount; @@ -150,14 +150,14 @@ class boss_baltharus_the_warborn : public CreatureScript if (GetDifficulty() == DIFFICULTY_10_N) { if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1) - DoAction(ACTION_CLONE); + events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); } else { if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 2) - DoAction(ACTION_CLONE); + events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1) - DoAction(ACTION_CLONE); + events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); } if (me->GetHealth() > damage) @@ -173,19 +173,18 @@ class boss_baltharus_the_warborn : public CreatureScript void UpdateAI(uint32 diff) override { - bool introPhase = events.IsInPhase(PHASE_INTRO); - if (!introPhase && !UpdateVictim()) + if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim()) return; - if (!introPhase) + if (!events.IsInPhase(PHASE_INTRO)) me->SetHealth(instance->GetData(DATA_BALTHARUS_SHARED_HEALTH)); - events.Update(diff); - - if (!introPhase && me->HasUnitState(UNIT_STATE_CASTING)) + if (!events.IsInPhase(PHASE_INTRO) && me->HasUnitState(UNIT_STATE_CASTING)) return; + events.Update(diff); + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) @@ -210,6 +209,9 @@ class boss_baltharus_the_warborn : public CreatureScript case EVENT_SUMMONS_ATTACK: summons.DoZoneInCombat(NPC_BALTHARUS_THE_WARBORN_CLONE); break; + case EVENT_CLONE: + DoAction(ACTION_CLONE); + break; default: break; } -- cgit v1.2.3 From 14cf4c06921be90a7f5b9bba6ed110a2b8a7633c Mon Sep 17 00:00:00 2001 From: Keader Date: Sun, 2 Apr 2017 11:14:24 -0300 Subject: Core/Scripts: Fixing Carbonion/Travis (cherry picked from commit 270a6396783ccb2b8dff181fca2760adb47d2110) --- .../ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 2c48fee879e..c0aa45f1e21 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -75,7 +75,7 @@ class boss_baltharus_the_warborn : public CreatureScript struct boss_baltharus_the_warbornAI : public BossAI { boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), - _introDone(false), _cloneCount(RAID_MODE(1, 2, 2, 2)) { } + _cloneCount(RAID_MODE(1, 2, 2, 2)), _introDone(false) { } void Reset() override { -- cgit v1.2.3 From f623fea9237d1a076f55aa49128201a59cb0045b Mon Sep 17 00:00:00 2001 From: Keader Date: Mon, 3 Apr 2017 10:02:13 -0300 Subject: Core/Scripts: Baltharus the Warborn make clone count more readable *Also fixed issue that make Baltharus summons alot of clones when he is casting (cherry picked from commit 58f2e62098f2c78b77b6b3851709c83f33e1cafd) --- .../RubySanctum/boss_baltharus_the_warborn.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index c0aa45f1e21..445404ce961 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -75,7 +75,7 @@ class boss_baltharus_the_warborn : public CreatureScript struct boss_baltharus_the_warbornAI : public BossAI { boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), - _cloneCount(RAID_MODE(1, 2, 2, 2)), _introDone(false) { } + _cloneCount(0), _introDone(false) { } void Reset() override { @@ -84,7 +84,7 @@ class boss_baltharus_the_warborn : public CreatureScript instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetMaxHealth()); if (Creature* channelTarget = instance->GetCreature(DATA_CRYSTAL_CHANNEL_TARGET)) DoCast(channelTarget, SPELL_BARRIER_CHANNEL); - _cloneCount = RAID_MODE(1, 2, 2, 2); + _cloneCount = 0; } void DoAction(int32 action) override @@ -104,7 +104,6 @@ class boss_baltharus_the_warborn : public CreatureScript DoCastSelf(SPELL_CLONE, true); DoCastSelf(SPELL_REPELLING_WAVE); Talk(SAY_CLONE); - --_cloneCount; break; } default: @@ -149,15 +148,24 @@ class boss_baltharus_the_warborn : public CreatureScript { if (GetDifficulty() == DIFFICULTY_10_N) { - if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1) + if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 0) + { + _cloneCount++; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); + } } else { - if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 2) + if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 0) + { + _cloneCount++; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); + } else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1) + { + _cloneCount++; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); + } } if (me->GetHealth() > damage) -- cgit v1.2.3 From 304eeea570c153ea1b9598eb7b15b0e2ec2b8399 Mon Sep 17 00:00:00 2001 From: Keader Date: Sun, 9 Apr 2017 09:25:58 -0300 Subject: Core/Scripts: Baltharus the Warborn preincrement _cloneCount (cherry picked from commit 2921449a333ea27a62c7b21d003650421c982917) --- .../ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 445404ce961..1440f800260 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -150,7 +150,7 @@ class boss_baltharus_the_warborn : public CreatureScript { if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 0) { - _cloneCount++; + ++_cloneCount; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); } } @@ -158,12 +158,12 @@ class boss_baltharus_the_warborn : public CreatureScript { if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 0) { - _cloneCount++; + ++_cloneCount; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); } else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1) { - _cloneCount++; + ++_cloneCount; events.ScheduleEvent(EVENT_CLONE, Milliseconds(1)); } } -- cgit v1.2.3 From cf3c5dc9485d8cace0ba18e1afe1a5152f6f2ddc Mon Sep 17 00:00:00 2001 From: tkrokli Date: Sun, 23 Apr 2017 01:15:00 +0200 Subject: Core/Scripts: Willix the Importer - $n in aggro text * In the existing core script, Willix the Importer in Razorfen Kraul says "Help! Get this $n off of me!" (showing the $n part in his SAY text) instead of naming the attacker when using his 'SAY_AGGRO1' creature_text. * With this commit change, unit target is no longer missing for Talk, making Willix name the attacking unit when he shouts for help. (cherry picked from commit 6cc267d90918a0663f928db302ef1465f7952c61) --- src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index d7bb4c2b6fa..226e1e0efd7 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -114,9 +114,9 @@ public: void Reset() override { } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* who) override { - Talk(SAY_AGGRO1); + Talk(SAY_AGGRO1, who); } void JustSummoned(Creature* summoned) override -- cgit v1.2.3 From 5e32e96278757aa52ef87cb122dd99825e6c8de9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 23 Apr 2017 20:38:14 -0300 Subject: Core/Spell: define channels without movement interrupt flags as allowed move - Remove script hacks no longer needed (cherry picked from commit 3a0cb90ea994e82dd8c70888fb847082f738d5dc) --- src/server/game/Spells/SpellInfo.cpp | 2 +- .../scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp | 4 ---- .../scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 1 - src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 1 - src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp | 1 - src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 2 -- src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 1 - src/server/scripts/Outland/BlackTemple/boss_illidan.cpp | 1 - 8 files changed, 1 insertion(+), 12 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index eb37c3da5d7..bec8a653fee 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1675,7 +1675,7 @@ bool SpellInfo::IsChanneled() const bool SpellInfo::IsMoveAllowedChannel() const { - return IsChanneled() && HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING); + return IsChanneled() && (HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) || (!(ChannelInterruptFlags[0] & (AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING)))); } bool SpellInfo::NeedsComboPoints() const diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 50dcb98bcab..4e7ddbc453b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1129,10 +1129,7 @@ class npc_dark_nucleus : public CreatureScript if (Unit* victim = me->GetVictim()) { if (me->GetDistance(victim) < 15.0f && !victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID())) - { DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STATE_CASTING); - } else MoveInLineOfSight(me->GetVictim()); } @@ -1146,7 +1143,6 @@ class npc_dark_nucleus : public CreatureScript } DoCast(who, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STATE_CASTING); } void DamageTaken(Unit* attacker, uint32& /*damage*/) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 116843c2398..f21051a36b3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -933,7 +933,6 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { - GetCaster()->ClearUnitState(UNIT_STATE_CASTING); GetCaster()->DeleteThreatList(); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 94bf769b771..73877fa1ac9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -725,7 +725,6 @@ class boss_the_lich_king : public CreatureScript summon->CastSpell(summon, SPELL_ICE_SPHERE, false); summon->CastSpell(summon, SPELL_ICE_BURST_TARGET_SEARCH, false); summon->CastSpell(target, SPELL_ICE_PULSE, false); - summon->ClearUnitState(UNIT_STATE_CASTING); summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f); } else diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index d5859e27f3a..e51db2e2878 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -161,7 +161,6 @@ public: break; case EVENT_RESUME_PULSING_SHOCKWAVE: DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true); - me->ClearUnitState(UNIT_STATE_CASTING); // This flag breaks movement. DoCast(me, SPELL_PULSING_SHOCKWAVE, true); break; case EVENT_INTRO_DIALOGUE: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 5a6c4aeeef6..ec3c449f0ca 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -230,8 +230,6 @@ class boss_kologarn : public CreatureScript summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_PERIODIC, true); summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true); summon->SetReactState(REACT_PASSIVE); - // One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work - summon->ClearUnitState(UNIT_STATE_CASTING); // Victim gets 67351 if (!eyebeamTarget.IsEmpty()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index fd4d7b02229..4d9ed335279 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -1304,7 +1304,6 @@ class npc_mimiron_assault_bot : public CreatureScript { case EVENT_MAGNETIC_FIELD: DoCastVictim(SPELL_MAGNETIC_FIELD); - me->ClearUnitState(UNIT_STATE_CASTING); events.RescheduleEvent(EVENT_MAGNETIC_FIELD, 30000); break; default: diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index b41199670a9..706bc7d99eb 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -2305,7 +2305,6 @@ class spell_illidan_find_target : public SpellScriptLoader if (Creature* caster = GetCaster()->ToCreature()) { caster->CastSpell(target, SPELL_PARALYZE, true); - caster->ClearUnitState(UNIT_STATE_CASTING); caster->AI()->SetGUID(target->GetGUID(), 0); } } -- cgit v1.2.3 From 292c03ec048158c31b2e2900c6a38d57aa926342 Mon Sep 17 00:00:00 2001 From: Keader Date: Mon, 24 Apr 2017 08:48:34 -0300 Subject: Core/Scripts: Fix a typo in Blood Prince Council Thanks ariel- (cherry picked from commit 136f1e75aa8968eee9b94fa0d19e46e97332867a) --- .../scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 4e7ddbc453b..3f5bf56faf9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -788,7 +788,7 @@ class boss_prince_valanar_icc : public CreatureScript struct boss_prince_valanarAI : public BloodPrincesBossAI { - boss_prince_valanarAI(Creature* creature) : BloodPrincesBossAI(creature, DATA_PRINCE_TALDARAM) { } + boss_prince_valanarAI(Creature* creature) : BloodPrincesBossAI(creature, DATA_PRINCE_VALANAR) { } void ScheduleEvents() override { -- cgit v1.2.3 From dea71597455d3846c801cd340f0f2a6248c61800 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 25 Apr 2017 02:57:58 -0300 Subject: Core/Scripts: fix gaseous bloat proc (again) - UNIT_STATE_CASTING removal not needed for movement now, but it's needed for melee attacking (cherry picked from commit 85076dd799a76b889d1d22890771f4bc445fd7f8) --- .../scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index f21051a36b3..116843c2398 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -933,6 +933,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { + GetCaster()->ClearUnitState(UNIT_STATE_CASTING); GetCaster()->DeleteThreatList(); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff -- cgit v1.2.3 From cc148ebc4025af6727c57a83e154a02fc40f0366 Mon Sep 17 00:00:00 2001 From: Keader Date: Tue, 25 Apr 2017 11:46:38 -0300 Subject: Core/Scripts: Added a missing break in Illidan Stormrage script Thanks Jackpoz (cherry picked from commit 3194d089cbf2dd30bb3fed3a7f6f7e85730ad0cb) --- src/server/scripts/Outland/BlackTemple/boss_illidan.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 706bc7d99eb..e66584c802e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -524,6 +524,7 @@ public: events.ScheduleEvent(EVENT_SHADOW_BLAST, Seconds(1), group); events.ScheduleEvent(EVENT_FLAME_BURST, Seconds(6), group); events.ScheduleEvent(EVENT_SHADOW_DEMON, Seconds(18), Seconds(30), group); + break; case GROUP_PHASE_4: ScheduleEvents(GROUP_PHASE_3, group); events.ScheduleEvent(EVENT_FRENZY, Seconds(40), group); -- cgit v1.2.3 From f3a49059acb7b19ef95ebb7f6fe6887a123cd1c9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 26 Apr 2017 04:19:01 -0300 Subject: Core/AI: some tweaks on boundary functionality: - Moved SetBoundary to public scope to allow for greater flexibility (ie set from external script) - Extended to allow checking inverted boundaries (cherry picked from commit 6892404b270f57380ffdc9ad084e0f43d94134e0) --- src/server/game/AI/CreatureAI.cpp | 22 +++++++++------------- src/server/game/AI/CreatureAI.h | 7 ++++--- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index af9104b6c09..835f5369c9f 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -44,7 +44,7 @@ void CreatureAI::OnCharmed(bool apply) AISpellInfoType* UnitAI::AISpellInfo; AISpellInfoType* GetAISpellInfo(uint32 i) { return &UnitAI::AISpellInfo[i]; } -CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), m_MoveInLineOfSight_locked(false) +CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), m_MoveInLineOfSight_locked(false) { } @@ -364,32 +364,28 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con bool CreatureAI::CheckBoundary(Position const* who) const { + if (!_boundary) + return true; + if (!who) who = me; - if (_boundary) - for (AreaBoundary const* areaBoundary : *_boundary) - if (!areaBoundary->IsWithinBoundary(who)) - return false; - - return true; + return (CreatureAI::IsInBounds(*_boundary, who) != _negateBoundary); } -bool CreatureAI::IsInBounds(CreatureBoundary const* boundary, Position const* pos) +bool CreatureAI::IsInBounds(CreatureBoundary const& boundary, Position const* pos) { - if (!boundary) - return true; - - for (AreaBoundary const* areaBoundary : *boundary) + for (AreaBoundary const* areaBoundary : boundary) if (!areaBoundary->IsWithinBoundary(pos)) return false; return true; } -void CreatureAI::SetBoundary(CreatureBoundary const* boundary) +void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBoundaries /*= false*/) { _boundary = boundary; + _negateBoundary = negateBoundaries; me->DoImmediateBoundaryCheck(); } diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 5fe93e7675a..edc09a650c7 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -83,7 +83,6 @@ class TC_GAME_API CreatureAI : public UnitAI bool CheckBoundary(Position const* who = nullptr) const; - void SetBoundary(CreatureBoundary const* boundary); public: enum EvadeReason { @@ -211,11 +210,12 @@ class TC_GAME_API CreatureAI : public UnitAI virtual PlayerAI* GetAIForCharmedPlayer(Player* /*who*/) { return nullptr; } // intended for encounter design/debugging. do not use for other purposes. expensive. - int32 VisualizeBoundary(uint32 duration, Unit* owner=nullptr, bool fill=false) const; + int32 VisualizeBoundary(uint32 duration, Unit* owner = nullptr, bool fill = false) const; virtual bool CheckInRoom(); CreatureBoundary const* GetBoundary() const { return _boundary; } + void SetBoundary(CreatureBoundary const* boundary, bool negativeBoundaries = false); - static bool IsInBounds(CreatureBoundary const* boundary, Position const* who); + static bool IsInBounds(CreatureBoundary const& boundary, Position const* who); protected: virtual void MoveInLineOfSight(Unit* /*who*/); @@ -223,6 +223,7 @@ class TC_GAME_API CreatureAI : public UnitAI bool _EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER); CreatureBoundary const* _boundary; + bool _negateBoundary; private: bool m_MoveInLineOfSight_locked; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 9112fd9ccd2..37aa313b662 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -499,7 +499,7 @@ class npc_anubarak_anub_ar_assassin : public CreatureScript Position jumpTo; do jumpTo = GetRandomPositionAround(anubarak); - while (!CreatureAI::IsInBounds(boundary, &jumpTo)); + while (!CreatureAI::IsInBounds(*boundary, &jumpTo)); me->GetMotionMaster()->MoveJump(jumpTo, 40.0f, 40.0f); DoCastSelf(SPELL_ASSASSIN_VISUAL, true); } -- cgit v1.2.3 From 5d411e0b21b1f1a4653d274d9b1cc7fef17f232b Mon Sep 17 00:00:00 2001 From: ccrs Date: Thu, 27 Apr 2017 14:00:57 +0200 Subject: Core/CreatureAI: b6b0353bff followup (cherry picked from commit 5fc366d03bf4e5250443e0573a4c9fa4611968a4) --- src/server/game/AI/CreatureAI.cpp | 4 ++-- .../Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp | 3 ++- .../Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 835f5369c9f..7d1aaca570e 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -217,7 +217,7 @@ void CreatureAI::SetGazeOn(Unit* target) { if (me->IsValidAttackTarget(target)) { - if (!me->IsFocusing(nullptr, true)) + if (!me->IsFocusing(nullptr, true) && target != me->GetVictim()) AttackStart(target); me->SetReactState(REACT_PASSIVE); } @@ -237,7 +237,7 @@ bool CreatureAI::UpdateVictimWithGaze() } if (Unit* victim = me->SelectVictim()) - if (!me->IsFocusing(nullptr, true)) + if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim()) AttackStart(victim); return me->GetVictim() != nullptr; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 18788ac23f7..6983e745e5e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1342,7 +1342,8 @@ class npc_the_lich_king_escape_hor : public CreatureScript if (!me->HasReactState(REACT_PASSIVE)) { if (Unit* victim = me->SelectVictim()) - AttackStart(victim); + if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim()) + AttackStart(victim); return me->GetVictim() != nullptr; } else if (me->getThreatManager().getThreatList().size() < 2 && me->HasAura(SPELL_REMORSELESS_WINTER)) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 18aaf715bf3..a9ffaeb5871 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -635,7 +635,8 @@ protected: if (!me->HasReactState(REACT_PASSIVE)) { if (Unit* victim = me->SelectVictim()) - AttackStart(victim); + if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim()) + AttackStart(victim); return me->GetVictim() != nullptr; } -- cgit v1.2.3 From d1bdb8bdd3e90fc435094a8615a0cbcbf472079a Mon Sep 17 00:00:00 2001 From: Keader Date: Thu, 27 Apr 2017 09:41:07 -0300 Subject: Core/Scripts: Re-hack Boss Loken. Followup 3a0cb90ea994e82dd8c70888fb847082f738d5dc Loken still need ClearUnitState Hack to DoMeleeAttackifReady work (cherry picked from commit 4431a1149da7bc48ad1047fc8c6135ed02b2e77b) --- src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index e51db2e2878..9ac7fc0931b 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -161,6 +161,7 @@ public: break; case EVENT_RESUME_PULSING_SHOCKWAVE: DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true); + me->ClearUnitState(UNIT_STATE_CASTING); // Workaround to allow DoMeleeAttackIfReady work DoCast(me, SPELL_PULSING_SHOCKWAVE, true); break; case EVENT_INTRO_DIALOGUE: -- cgit v1.2.3 From 2d4549023a6655d19671f7f7e6b4f7c9b71ae632 Mon Sep 17 00:00:00 2001 From: ccrs Date: Thu, 27 Apr 2017 14:55:06 +0200 Subject: Core/Unit: 2170541a51 followup use true as default value since pretty much all the script calls will expect that (cherry picked from commit c7a57e2a093ada2ece7a01eac2f627aeb26b08d5) --- src/server/game/AI/CreatureAI.cpp | 4 ++-- src/server/game/Entities/Creature/Creature.cpp | 12 ++++++------ src/server/game/Entities/Unit/Unit.cpp | 9 +++++---- src/server/game/Entities/Unit/Unit.h | 4 ++-- src/server/game/Spells/SpellEffects.cpp | 6 +++--- .../scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp | 2 +- .../scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp | 2 +- src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 2 +- .../FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp | 2 +- .../scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 4 ++-- .../scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 4 ++-- .../Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp | 2 +- src/server/scripts/Northrend/VioletHold/boss_erekem.cpp | 2 +- src/server/scripts/Northrend/zone_dragonblight.cpp | 2 +- src/server/scripts/Outland/BlackTemple/boss_illidan.cpp | 6 +++--- .../scripts/Outland/BlackTemple/boss_shade_of_akama.cpp | 2 +- src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- src/server/scripts/Outland/zone_hellfire_peninsula.cpp | 2 +- 18 files changed, 35 insertions(+), 34 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 7d1aaca570e..3c65160aaf6 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -173,9 +173,9 @@ void CreatureAI::TriggerAlert(Unit const* who) const me->SendAIReaction(AI_REACTION_ALERT); // Face the unit (stealthed player) and set distracted state for 5 seconds - me->SetFacingTo(me->GetAngle(who->GetPositionX(), who->GetPositionY()), true); - me->StopMoving(); me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS); + me->StopMoving(); + me->SetFacingTo(me->GetAngle(who)); } void CreatureAI::EnterEvadeMode(EvadeReason why) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index bf309ee0089..c844767b6ba 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -681,10 +681,10 @@ void Creature::Update(uint32 diff) if (!m_suppressedTarget.IsEmpty()) { if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget)) - SetFacingToObject(objTarget); + SetFacingToObject(objTarget, false); } else - SetFacingTo(m_suppressedOrientation); + SetFacingTo(m_suppressedOrientation, false); m_shouldReacquireTarget = false; } @@ -3088,10 +3088,10 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) bool const canTurnDuringCast = !spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST); // Face the target - we need to do this before the unit state is modified for no-turn spells if (target) - SetFacingToObject(target); + SetFacingToObject(target, false); else if (!canTurnDuringCast) if (Unit* victim = GetVictim()) - SetFacingToObject(victim); // ensure orientation is correct at beginning of cast + SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast if (!canTurnDuringCast) AddUnitState(UNIT_STATE_CANNOT_TURN); @@ -3137,10 +3137,10 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay) if (!m_suppressedTarget.IsEmpty()) { if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget)) - SetFacingToObject(objTarget); + SetFacingToObject(objTarget, false); } else - SetFacingTo(m_suppressedOrientation); + SetFacingTo(m_suppressedOrientation, false); } else // tell the creature that it should reacquire its actual target after the delay expires (this is handled in ::Update) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4c0d1ef81bd..815ef9a4a62 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2027,7 +2027,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr return; // ignore ranged case if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) - SetFacingToObject(victim); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) + SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) // melee attack spell cast at main hand attack only - no normal melee dmg dealt if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL] && !extra) @@ -2108,7 +2108,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA return; // ignore ranged case if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) - SetFacingToObject(victim); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) + SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) CalcDamageInfo damageInfo; damageInfo.attacker = this; @@ -13645,7 +13645,8 @@ void Unit::SetInFront(WorldObject const* target) void Unit::SetFacingTo(float ori, bool force) { - if (!force && !IsStopped()) + // do not face when already moving + if (!force && (!IsStopped() || !movespline->Finalized())) return; Movement::MoveSplineInit init(this); @@ -13659,7 +13660,7 @@ void Unit::SetFacingTo(float ori, bool force) void Unit::SetFacingToObject(WorldObject const* object, bool force) { // do not face when already moving - if (!force && !IsStopped()) + if (!force && (!IsStopped() || !movespline->Finalized())) return; /// @todo figure out under what conditions creature will move towards object instead of facing it where it currently is. diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e098542216c..83f631311d2 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1383,8 +1383,8 @@ class TC_GAME_API Unit : public WorldObject void UpdateMovementForcesModMagnitude(); void SetInFront(WorldObject const* target); - void SetFacingTo(float ori, bool force = false); - void SetFacingToObject(WorldObject const* object, bool force = false); + void SetFacingTo(float const ori, bool force = true); + void SetFacingToObject(WorldObject const* object, bool force = true); void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference); void SendClearThreatListOpcode(); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 56a050eea65..8f77c39afe2 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2232,11 +2232,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; - unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); - unitTarget->ClearUnitState(UNIT_STATE_MOVING); - if (unitTarget->GetTypeId() == TYPEID_UNIT) unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); + + unitTarget->StopMoving(); + unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); } void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index da6aebea818..c5366285de7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -328,7 +328,7 @@ public: DoResetThreat(); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { - me->SetFacingToObject(target, true); + me->SetFacingToObject(target); DoCast(target, SPELL_RAIN_OF_BONES); } break; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 607a89fabb7..334e3ebb26c 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -199,7 +199,7 @@ public: { case 4: SetEscortPaused(true); - me->SetFacingTo(1.775791f, true); + me->SetFacingTo(1.775791f); me->AddNpcFlag(UNIT_NPC_FLAG_GOSSIP); Talk(SAY_MORRIDUNE_2); break; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index a7daac95144..2deec5fa15e 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -249,7 +249,7 @@ public: me->SetCanFly(true); me->SetDisableGravity(true); me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); - me->SetFacingTo(me->GetOrientation() + float(M_PI), true); + me->SetFacingTo(me->GetOrientation() + float(M_PI)); if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN)) triggerGUID = trigger->GetGUID(); me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating); diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 5a4532be849..265db80d353 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -309,7 +309,7 @@ class boss_devourer_of_souls : public CreatureScript case EVENT_WAILING_SOULS_TICK: beamAngle += beamAngleDiff; - me->SetFacingTo(beamAngle, true); + me->SetFacingTo(beamAngle); me->StopMoving(); DoCast(me, SPELL_WAILING_SOULS); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 590291c6e30..e1cc3c12f54 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -735,7 +735,7 @@ class npc_spinestalker : public CreatureScript me->SetDisableGravity(false); me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHomePosition(SpinestalkerLandPos); - me->SetFacingTo(SpinestalkerLandPos.GetOrientation(), true); + me->SetFacingTo(SpinestalkerLandPos.GetOrientation()); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_AGGRESSIVE); } @@ -872,7 +872,7 @@ class npc_rimefang : public CreatureScript me->SetDisableGravity(false); me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHomePosition(RimefangLandPos); - me->SetFacingTo(RimefangLandPos.GetOrientation(), true); + me->SetFacingTo(RimefangLandPos.GetOrientation()); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 73877fa1ac9..7f6b970e42e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -819,7 +819,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO); break; case POINT_CENTER_1: - me->SetFacingTo(0.0f, true); + me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, MUSIC_SPECIAL); DoCast(me, SPELL_REMORSELESS_WINTER_1); @@ -835,7 +835,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO); break; case POINT_CENTER_2: - me->SetFacingTo(0.0f, true); + me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, MUSIC_SPECIAL); DoCast(me, SPELL_REMORSELESS_WINTER_2); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 1884efd8916..e70769ffd11 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -444,7 +444,7 @@ class boss_algalon_the_observer : public CreatureScript me->SetDisableGravity(false); else if (pointId == POINT_ALGALON_OUTRO) { - me->SetFacingTo(1.605703f, true); + me->SetFacingTo(1.605703f); events.ScheduleEvent(EVENT_OUTRO_3, 1200); events.ScheduleEvent(EVENT_OUTRO_4, 2400); events.ScheduleEvent(EVENT_OUTRO_5, 8500); diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 5a4c90451f4..5b7eabe4f00 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -78,7 +78,7 @@ class boss_erekem : public CreatureScript void MovementInform(uint32 type, uint32 pointId) override { if (type == EFFECT_MOTION_TYPE && pointId == POINT_INTRO) - me->SetFacingTo(4.921828f, true); + me->SetFacingTo(4.921828f); } void JustReachedHome() override diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 74d5af9f484..f2c59c76c1d 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -174,7 +174,7 @@ class npc_commander_eligor_dawnbringer : public CreatureScript { if (id == 1) { - me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation(), true); + me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation()); TurnAudience(); switch (talkWing) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index e66584c802e..c92e304152c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -865,7 +865,7 @@ public: events.ScheduleEvent(EVENT_FLY_TO_RANDOM_PILLAR, Seconds(2), GROUP_PHASE_ALL); break; case EVENT_CHANGE_ORIENTATION: - me->SetFacingTo(_orientation, true); + me->SetFacingTo(_orientation); break; case EVENT_FLY: ChangeOrientation(3.137039f); @@ -882,7 +882,7 @@ public: case EVENT_FACE_MIDDLE: { float angle = me->GetAngle(IllidanMiddlePoint); - me->SetFacingTo(angle, true); + me->SetFacingTo(angle); break; } case EVENT_EYE_BLAST: @@ -1299,7 +1299,7 @@ public: me->SetEmoteState(EMOTE_STATE_READY1H); break; case EVENT_CHANGE_ORIENTATION: - me->SetFacingTo(_orientation, true); + me->SetFacingTo(_orientation); break; case EVENT_HEALING_POTION: if (me->HealthBelowPct(20)) diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 4a868084e41..610d12a377b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -499,7 +499,7 @@ public: _events.Repeat(Seconds(3), Seconds(7)); break; case EVENT_START_SOUL_RETRIEVE: - me->SetFacingTo(FACE_THE_DOOR, true); + me->SetFacingTo(FACE_THE_DOOR); DoCast(SPELL_AKAMA_SOUL_RETRIEVE); _events.ScheduleEvent(EVENT_START_BROKEN_FREE, Seconds(15)); break; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 9ba6a1cefc9..e08071fc475 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -597,7 +597,7 @@ class boss_kaelthas : public CreatureScript events.ScheduleEvent(EVENT_TRANSITION_1, 1000); break; case POINT_TRANSITION_CENTER_ASCENDING: - me->SetFacingTo(float(M_PI), true); + me->SetFacingTo(float(M_PI)); Talk(SAY_PHASE5_NUTS); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetDisableGravity(true); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index b69d42244b0..3a3902a5668 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -957,7 +957,7 @@ public: void StartFight(Player* player) { me->Dismount(); - me->SetFacingToObject(player, true); + me->SetFacingToObject(player); me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); _playerGUID = player->GetGUID(); _events.ScheduleEvent(EVENT_TALK, Seconds(2)); -- cgit v1.2.3 From 104e745edfb89f95e34cad7840eae0b6e183bf94 Mon Sep 17 00:00:00 2001 From: ccrs Date: Thu, 27 Apr 2017 15:34:01 +0200 Subject: Core/Misc: cleanup SetInFront uses Set in front modifies only the serverside orientation, use with care. Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick) (cherry picked from commit 229444b74a7e2176db142e0446d4268995c5aad6) --- src/server/game/AI/CoreAI/TotemAI.cpp | 3 +-- src/server/game/Entities/Creature/Creature.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 8 +++++--- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Handlers/PetHandler.cpp | 6 ++++-- .../scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp | 4 ++-- src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp | 4 ++-- src/server/scripts/Northrend/zone_zuldrak.cpp | 4 ++-- src/server/scripts/Outland/zone_terokkar_forest.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 10 files changed, 20 insertions(+), 16 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index 70ed58d853d..a2f0f8f664b 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -83,8 +83,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/) i_victimGuid = victim->GetGUID(); // attack - me->SetInFront(victim); // client change orientation by self - me->CastSpell(victim, me->ToTotem()->GetSpell(), false); + me->CastSpell(victim, me->ToTotem()->GetSpell()); } else i_victimGuid.Clear(); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index c19c6854239..cc5608bfc3d 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -328,7 +328,7 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next ::Update call void DoNotReacquireTarget() { m_shouldReacquireTarget = false; m_suppressedTarget = ObjectGuid::Empty; m_suppressedOrientation = 0.0f; } void FocusTarget(Spell const* focusSpell, WorldObject const* target); - bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false); + bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false) override; void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true); bool IsMovementPreventedByCasting() const override; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 815ef9a4a62..df7273a5b2d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8839,7 +8839,8 @@ void Unit::TauntApply(Unit* taunter) if (target && target == taunter) return; - SetInFront(taunter); + if (!IsFocusing(nullptr, true)) + SetInFront(taunter); if (creature->IsAIEnabled) creature->AI()->AttackStart(taunter); @@ -8878,7 +8879,8 @@ void Unit::TauntFadeOut(Unit* taunter) if (target && target != taunter) { - SetInFront(target); + if (!IsFocusing(nullptr, true)) + SetInFront(target); if (creature->IsAIEnabled) creature->AI()->AttackStart(target); } @@ -8960,7 +8962,7 @@ Unit* Creature::SelectVictim() if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target)) { - if (!IsFocusing()) + if (!IsFocusing(nullptr, true)) SetInFront(target); return target; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 83f631311d2..7f126fa2c3e 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1659,6 +1659,7 @@ class TC_GAME_API Unit : public WorldObject virtual SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const; uint32 GetCastSpellXSpellVisualId(SpellInfo const* spellInfo) const; + virtual bool IsFocusing(Spell const* /*focusSpell*/ = nullptr, bool /*withDelay*/ = false) { return false; } virtual bool IsMovementPreventedByCasting() const; SpellHistory* GetSpellHistory() { return _spellHistory; } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 8dc2523afcc..73bc95f2caf 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -331,13 +331,15 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe { if (unit_target) { - pet->SetInFront(unit_target); + if (!pet->IsFocusing()) + pet->SetInFront(unit_target); if (Player* player = unit_target->ToPlayer()) pet->SendUpdateToPlayer(player); } else if (Unit* unit_target2 = spell->m_targets.GetUnitTarget()) { - pet->SetInFront(unit_target2); + if (!pet->IsFocusing()) + pet->SetInFront(unit_target2); if (Player* player = unit_target2->ToPlayer()) pet->SendUpdateToPlayer(player); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 5d760eecbbc..23f9d315457 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -196,8 +196,8 @@ public: ++IntroPhase; break; case 1: - me->SetInFront(Madrigosa); - Madrigosa->SetInFront(me); + me->SetFacingToObject(Madrigosa); + Madrigosa->SetFacingToObject(me); Madrigosa->AI()->Talk(YELL_MADR_INTRO, me); IntroPhaseTimer = 9000; ++IntroPhase; diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 029ea6ad9ce..d7bc3bd5240 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -532,8 +532,8 @@ public: return 1000; case 2: Talk(GEEZLE_SAY_1, Spark); - Spark->SetInFront(me); - me->SetInFront(Spark); + Spark->SetFacingToObject(me); + me->SetFacingToObject(Spark); return 5000; case 3: Spark->AI()->Talk(SPARK_SAY_2); diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 0e42a431d93..23716389e7e 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -70,8 +70,8 @@ public: void LockRageclaw(Creature* rageclaw) { // pointer check not needed - me->SetInFront(rageclaw); - rageclaw->SetInFront(me); + me->SetFacingToObject(rageclaw); + rageclaw->SetFacingToObject(me); DoCast(rageclaw, SPELL_LEFT_CHAIN, true); DoCast(rageclaw, SPELL_RIGHT_CHAIN, true); diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 2e604b4291f..bf595557c49 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -469,7 +469,7 @@ public: player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_A, me); else if (player->GetTeam() == HORDE) player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_H, me); - me->SetInFront(player); + me->SetFacingToObject(player); break; case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 671a03918ca..a5d11011ea1 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -420,7 +420,7 @@ public: { if (me->IsWithinLOS(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()) && me->IsWithinDistInMap(player, 30.0f)) { - me->SetInFront(player); + me->SetFacingToObject(player); Active = false; switch (emote) -- cgit v1.2.3 From 93c19c4194b7eb82984bd13349c8ce3953a9ad92 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 28 Apr 2017 02:24:04 -0300 Subject: Core/Misc: camelize GetFaction/SetFaction properly (cherry picked from commit 4c4dca6d694bd1064b403a31a5b1c776a326f3ce) --- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 6 +-- src/server/game/AI/SmartScripts/SmartAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +-- .../game/Battlefield/Zones/BattlefieldTB.cpp | 2 +- .../game/Battlefield/Zones/BattlefieldWG.cpp | 24 ++++++------ .../game/Battlegrounds/Zones/BattlegroundAB.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundAV.cpp | 4 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundIC.cpp | 12 +++--- .../game/Battlegrounds/Zones/BattlegroundSA.cpp | 8 ++-- src/server/game/Entities/Creature/Creature.cpp | 6 +-- .../game/Entities/Creature/TemporarySummon.cpp | 8 ++-- src/server/game/Entities/GameObject/GameObject.cpp | 4 +- src/server/game/Entities/Object/Object.cpp | 2 +- .../Object/Updates/ViewerDependentValues.h | 2 +- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 12 +++--- src/server/game/Entities/Unit/Unit.cpp | 24 ++++++------ src/server/game/Entities/Unit/Unit.h | 4 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 34 ++++++++--------- src/server/game/Handlers/NPCHandler.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 12 +++--- src/server/scripts/Commands/cs_modify.cpp | 4 +- src/server/scripts/Commands/cs_npc.cpp | 4 +- src/server/scripts/Commands/cs_pet.cpp | 2 +- .../EasternKingdoms/AlteracValley/boss_balinda.cpp | 2 +- .../BlackrockDepths/blackrock_depths.cpp | 2 +- .../BlackrockDepths/boss_coren_direbrew.cpp | 8 ++-- .../boss_emperor_dagran_thaurissan.cpp | 2 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 4 +- .../BlackrockDepths/instance_blackrock_depths.cpp | 4 +- .../BlackwingLair/boss_nefarian.cpp | 6 +-- .../BlackwingLair/boss_vaelastrasz.cpp | 4 +- .../MoltenCore/boss_majordomo_executus.cpp | 4 +- .../BlackrockMountain/MoltenCore/boss_ragnaros.cpp | 4 +- .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 6 +-- .../Karazhan/boss_prince_malchezaar.cpp | 4 +- .../Karazhan/boss_shade_of_aran.cpp | 6 +-- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 4 +- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 4 +- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 10 ++--- .../EasternKingdoms/ScarletEnclave/chapter2.cpp | 2 +- .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 44 +++++++++++----------- .../ShadowfangKeep/boss_apothecary_hummel.cpp | 6 +-- .../SunwellPlateau/boss_kalecgos.cpp | 4 +- .../SunwellPlateau/boss_kiljaeden.cpp | 6 +-- .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 14 +++---- .../EasternKingdoms/Uldaman/instance_uldaman.cpp | 16 ++++---- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- .../EasternKingdoms/zone_arathi_highlands.cpp | 2 +- .../scripts/EasternKingdoms/zone_ghostlands.cpp | 2 +- .../scripts/EasternKingdoms/zone_hinterlands.cpp | 2 +- .../EasternKingdoms/zone_stranglethorn_vale.cpp | 4 +- .../scripts/EasternKingdoms/zone_wetlands.cpp | 2 +- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 4 +- .../BattleForMountHyjal/hyjal_trash.cpp | 2 +- .../scripts/Kalimdor/Firelands/boss_alysrazor.cpp | 2 +- .../scripts/Kalimdor/Maraudon/boss_noxxion.cpp | 4 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 2 +- .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 4 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 6 +-- .../Kalimdor/WailingCaverns/wailing_caverns.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 12 +++--- src/server/scripts/Kalimdor/zone_ashenvale.cpp | 4 +- .../scripts/Kalimdor/zone_azuremyst_isle.cpp | 8 ++-- .../scripts/Kalimdor/zone_dustwallow_marsh.cpp | 2 +- src/server/scripts/Kalimdor/zone_felwood.cpp | 2 +- src/server/scripts/Kalimdor/zone_silithus.cpp | 6 +-- src/server/scripts/Kalimdor/zone_tanaris.cpp | 6 +-- src/server/scripts/Kalimdor/zone_the_barrens.cpp | 18 ++++----- src/server/scripts/Kalimdor/zone_winterspring.cpp | 2 +- .../TrialOfTheChampion/boss_argent_challenge.cpp | 4 +- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 2 +- .../TrialOfTheCrusader/boss_faction_champions.cpp | 4 +- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 4 +- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 2 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 2 +- .../Northrend/Nexus/Nexus/instance_nexus.cpp | 10 ++--- .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 4 +- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 4 +- .../scripts/Northrend/zone_borean_tundra.cpp | 14 +++---- src/server/scripts/Northrend/zone_dragonblight.cpp | 2 +- .../scripts/Northrend/zone_grizzly_hills.cpp | 4 +- .../scripts/Northrend/zone_howling_fjord.cpp | 2 +- src/server/scripts/Northrend/zone_icecrown.cpp | 6 +-- .../scripts/Northrend/zone_sholazar_basin.cpp | 2 +- src/server/scripts/Northrend/zone_storm_peaks.cpp | 2 +- src/server/scripts/Northrend/zone_wintergrasp.cpp | 4 +- src/server/scripts/Northrend/zone_zuldrak.cpp | 4 +- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 2 +- .../boss_shirrak_the_dead_watcher.cpp | 2 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 10 ++--- .../Outland/BlackTemple/instance_black_temple.cpp | 4 +- .../SerpentShrine/boss_fathomlord_karathress.cpp | 2 +- .../SerpentShrine/boss_lady_vashj.cpp | 6 +-- .../SerpentShrine/boss_morogrim_tidewalker.cpp | 2 +- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 2 +- .../ShatteredHalls/boss_nethekurse.cpp | 2 +- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 2 +- .../scripts/Outland/zone_hellfire_peninsula.cpp | 10 ++--- src/server/scripts/Outland/zone_nagrand.cpp | 4 +- src/server/scripts/Outland/zone_netherstorm.cpp | 4 +- .../scripts/Outland/zone_shadowmoon_valley.cpp | 8 ++-- src/server/scripts/Outland/zone_shattrath_city.cpp | 4 +- .../scripts/Outland/zone_terokkar_forest.cpp | 18 ++++----- src/server/scripts/Outland/zone_zangarmarsh.cpp | 8 ++-- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/scripts/World/go_scripts.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 6 +-- 120 files changed, 327 insertions(+), 327 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 20a1c895dae..46e4159bb4c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -176,7 +176,7 @@ void npc_escortAI::JustRespawned() //add a small delay before going to first waypoint, normal in near all cases m_uiWPWaitTimer = 2500; - if (me->getFaction() != me->GetCreatureTemplate()->faction) + if (me->GetFaction() != me->GetCreatureTemplate()->faction) me->RestoreFaction(); Reset(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 961700d43b1..6c38e34df97 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -166,8 +166,8 @@ void FollowerAI::JustRespawned() if (!IsCombatMovementAllowed()) SetCombatMovement(true); - if (me->getFaction() != me->GetCreatureTemplate()->faction) - me->setFaction(me->GetCreatureTemplate()->faction); + if (me->GetFaction() != me->GetCreatureTemplate()->faction) + me->SetFaction(me->GetCreatureTemplate()->faction); Reset(); } @@ -303,7 +303,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu m_uiLeaderGUID = player->GetGUID(); if (factionForFollower) - me->setFaction(factionForFollower); + me->SetFaction(factionForFollower); m_pQuestForFollow = quest; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index a215153b550..2621a91d8ee 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -580,7 +580,7 @@ void SmartAI::JustRespawned() mDespawnState = 0; mEscortState = SMART_ESCORT_NONE; me->SetVisible(true); - if (me->getFaction() != me->GetCreatureTemplate()->faction) + if (me->GetFaction() != me->GetCreatureTemplate()->faction) me->RestoreFaction(); mJustReset = true; JustReachedHome(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6224533846e..8b34e84cddb 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -365,7 +365,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (e.action.faction.factionID) { - (*itr)->ToCreature()->setFaction(e.action.faction.factionID); + (*itr)->ToCreature()->SetFaction(e.action.faction.factionID); TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, %s set faction to %u", (*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), e.action.faction.factionID); } @@ -373,9 +373,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry())) { - if ((*itr)->ToCreature()->getFaction() != ci->faction) + if ((*itr)->ToCreature()->GetFaction() != ci->faction) { - (*itr)->ToCreature()->setFaction(ci->faction); + (*itr)->ToCreature()->SetFaction(ci->faction); TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, %s set faction to %u", (*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), ci->faction); } diff --git a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp index f2130d973db..1d610373c94 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp @@ -609,7 +609,7 @@ void BattlefieldTB::OnCreatureCreate(Creature* creature) HideNpc(creature); break; case NPC_ABANDONED_SIEGE_ENGINE: - creature->setFaction(TBFactions[GetDefenderTeam()]); + creature->SetFaction(TBFactions[GetDefenderTeam()]); creature->CastSpell(creature, SPELL_THICK_LAYER_OF_RUST, true); break; case NPC_SIEGE_ENGINE_TURRET: diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 3589d7dd08c..6e1bba5f1a9 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -580,7 +580,7 @@ void BattlefieldWG::OnBattleStart() if (Creature* creature = GetCreature(*itr)) { ShowNpc(creature, true); - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[GetDefenderTeam()]); } } @@ -664,7 +664,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) if (Creature* creature = GetCreature(*itr)) { if (!endByTimer) - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[GetDefenderTeam()]); HideNpc(creature); } } @@ -891,9 +891,9 @@ void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/) case NPC_WINTERGRASP_DEMOLISHER: { uint8 team; - if (creature->getFaction() == WintergraspFaction[TEAM_ALLIANCE]) + if (creature->GetFaction() == WintergraspFaction[TEAM_ALLIANCE]) team = TEAM_ALLIANCE; - else if (creature->getFaction() == WintergraspFaction[TEAM_HORDE]) + else if (creature->GetFaction() == WintergraspFaction[TEAM_HORDE]) team = TEAM_HORDE; else return; @@ -1604,12 +1604,12 @@ void BfWGGameObjectBuilding::Init(GameObject* go) case GO_WINTERGRASP_FORTRESS_TOWER_2: case GO_WINTERGRASP_FORTRESS_TOWER_3: case GO_WINTERGRASP_FORTRESS_TOWER_4: - turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]); + turret->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]); break; case GO_WINTERGRASP_SHADOWSIGHT_TOWER: case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: case GO_WINTERGRASP_FLAMEWATCH_TOWER: - turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]); + turret->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]); break; } @@ -1629,12 +1629,12 @@ void BfWGGameObjectBuilding::Init(GameObject* go) case GO_WINTERGRASP_FORTRESS_TOWER_2: case GO_WINTERGRASP_FORTRESS_TOWER_3: case GO_WINTERGRASP_FORTRESS_TOWER_4: - turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]); + turret->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]); break; case GO_WINTERGRASP_SHADOWSIGHT_TOWER: case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: case GO_WINTERGRASP_FLAMEWATCH_TOWER: - turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]); + turret->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]); break; } _wg->HideNpc(turret); @@ -1689,14 +1689,14 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable) case GO_WINTERGRASP_FORTRESS_TOWER_3: case GO_WINTERGRASP_FORTRESS_TOWER_4: { - creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]); break; } case GO_WINTERGRASP_SHADOWSIGHT_TOWER: case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: case GO_WINTERGRASP_FLAMEWATCH_TOWER: { - creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]); + creature->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]); break; } } @@ -1719,14 +1719,14 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable) case GO_WINTERGRASP_FORTRESS_TOWER_3: case GO_WINTERGRASP_FORTRESS_TOWER_4: { - creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]); break; } case GO_WINTERGRASP_SHADOWSIGHT_TOWER: case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: case GO_WINTERGRASP_FLAMEWATCH_TOWER: { - creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]); + creature->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]); break; } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 6e89bc86b3f..ebe3f5462b6 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -384,7 +384,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team) //aura should only apply to players who have accupied the node, set correct faction for trigger if (trigger) { - trigger->setFaction(team == ALLIANCE ? 84 : 83); + trigger->SetFaction(team == ALLIANCE ? 84 : 83); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index fd31810e4b8..1dabe1a572d 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -342,7 +342,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) { if (Creature* trigger = AddCreature(WORLD_TRIGGER, triggerSpawnID, BG_AV_CreaturePos[triggerSpawnID])) { - trigger->setFaction(newFaction); + trigger->SetFaction(newFaction); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } @@ -756,7 +756,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node) DelCreature(node + 302); return; } - trigger->setFaction(owner == ALLIANCE ? 84 : 83); + trigger->SetFaction(owner == ALLIANCE ? 84 : 83); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index ec3e7488400..9cf74c56dd9 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -782,7 +782,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point) //aura should only apply to players who have accupied the node, set correct faction for trigger if (trigger) { - trigger->setFaction(Team == ALLIANCE ? 84 : 83); + trigger->SetFaction(Team == ALLIANCE ? 84 : 83); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index e93fc640d31..b8c28b586f8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -363,9 +363,9 @@ bool BattlegroundIC::SetupBattleground() // setting correct factions for Keep Cannons for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i <= BG_IC_NPC_KEEP_CANNON_12; ++i) - GetBGCreature(i)->setFaction(BG_IC_Factions[0]); + GetBGCreature(i)->SetFaction(BG_IC_Factions[0]); for (uint8 i = BG_IC_NPC_KEEP_CANNON_13; i <= BG_IC_NPC_KEEP_CANNON_24; ++i) - GetBGCreature(i)->setFaction(BG_IC_Factions[1]); + GetBGCreature(i)->SetFaction(BG_IC_Factions[1]); // correcting spawn time for keeps bombs for (uint8 i = BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1; i < BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4; ++i) @@ -694,7 +694,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture) continue; if (AddCreature(node->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, BG_IC_DocksVehiclesGlaives[i], node->faction, RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); } // spawning catapults @@ -706,7 +706,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture) continue; if (AddCreature(NPC_CATAPULT, type, BG_IC_DocksVehiclesCatapults[i], node->faction, RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); } break; case BG_IC_GO_WORKSHOP_BANNER: @@ -738,7 +738,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture) continue; if (AddCreature(NPC_DEMOLISHER, type, BG_IC_WorkshopVehicles[i], node->faction, RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); } // we check if the opossing siege engine is in use @@ -763,7 +763,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture) if (Creature* siegeEngine = GetBGCreature(siegeType)) { siegeEngine->AddUnitFlag(UnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_CANNOT_SWIM | UNIT_FLAG_IMMUNE_TO_PC)); - siegeEngine->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); + siegeEngine->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]); } } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 52cb90f5e0c..0abb08afd0f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -654,13 +654,13 @@ void BattlegroundSA::OverrideGunFaction() for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++) { if (Creature* gun = GetBGCreature(i)) - gun->setFaction(BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]); + gun->SetFaction(BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]); } for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++) { if (Creature* dem = GetBGCreature(i)) - dem->setFaction(BG_SA_Factions[Attackers]); + dem->SetFaction(BG_SA_Factions[Attackers]); } } @@ -831,7 +831,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) AddCreature(BG_SA_NpcEntries[j], j, BG_SA_NpcSpawnlocs[j], (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), 600); if (Creature* dem = GetBGCreature(j)) - dem->setFaction(BG_SA_Factions[Attackers]); + dem->SetFaction(BG_SA_Factions[Attackers]); } UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[i] == TEAM_ALLIANCE); @@ -856,7 +856,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) AddCreature(BG_SA_NpcEntries[j], j, BG_SA_NpcSpawnlocs[j], Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE, 600); if (Creature* dem = GetBGCreature(j)) - dem->setFaction(BG_SA_Factions[Attackers]); + dem->SetFaction(BG_SA_Factions[Attackers]); } UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[i] == TEAM_ALLIANCE); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index c844767b6ba..f9f68237d0d 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -501,7 +501,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/, if (!GetCreatureAddon()) SetSheath(SHEATH_STATE_MELEE); - setFaction(cInfo->faction); + SetFaction(cInfo->faction); uint64 npcFlags; uint32 unitFlags, unitFlags2, unitFlags3, dynamicFlags; @@ -555,7 +555,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/, { if (Player* owner = Creature::GetCharmerOrOwnerPlayerOrPlayerItself()) // this check comes in case we don't have a player { - setFaction(owner->getFaction()); // vehicles should have same as owner faction + SetFaction(owner->GetFaction()); // vehicles should have same as owner faction owner->VehicleSpellInitialize(); } } @@ -2342,7 +2342,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / // only from same creature faction if (checkfaction) { - if (getFaction() != u->getFaction()) + if (GetFaction() != u->GetFaction()) return false; } else diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 63578dfd872..18613f0fda2 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -187,7 +187,7 @@ void TempSummon::InitStats(uint32 duration) if (owner && IsTrigger() && m_spells[0]) { - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); SetLevel(owner->getLevel()); if (owner->GetTypeId() == TYPEID_PLAYER) m_ControlledByPlayer = true; @@ -212,9 +212,9 @@ void TempSummon::InitStats(uint32 duration) } if (m_Properties->Faction) - setFaction(m_Properties->Faction); + SetFaction(m_Properties->Faction); else if (IsVehicle() && owner) // properties should be vehicle - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); } void TempSummon::InitSummon() @@ -307,7 +307,7 @@ void Minion::InitStats(uint32 duration) SetReactState(REACT_PASSIVE); SetCreatorGUID(GetOwner()->GetGUID()); - setFaction(GetOwner()->getFaction()); + SetFaction(GetOwner()->GetFaction()); GetOwner()->SetMinion(this, true); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 4e34c8b4785..1bc8383a51c 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2112,7 +2112,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge if (Unit* owner = GetOwner()) { - trigger->setFaction(owner->getFaction()); + trigger->SetFaction(owner->GetFaction()); if (owner->HasUnitFlag(UNIT_FLAG_PVP_ATTACKABLE)) trigger->AddUnitFlag(UNIT_FLAG_PVP_ATTACKABLE); // copy pvp state flags from owner @@ -2123,7 +2123,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge } else { - trigger->setFaction(spellInfo->IsPositive() ? 35 : 14); + trigger->SetFaction(spellInfo->IsPositive() ? 35 : 14); // Set owner guid for target if no owner available - needed by trigger auras // - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell()) trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, target ? target->GetGUID() : ObjectGuid::Empty); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 94fd3e932c8..5e79eb1316c 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1889,7 +1889,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3 //summon->SetName(GetName()); if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) { - summon->setFaction(((Unit*)this)->getFaction()); + summon->SetFaction(((Unit*)this)->GetFaction()); summon->SetLevel(((Unit*)this)->getLevel()); } diff --git a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h index 52813dd4c82..1901e5e623d 100644 --- a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h +++ b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h @@ -147,7 +147,7 @@ public: FactionTemplateEntry const* ft2 = receiver->GetFactionTemplateEntry(); if (ft1 && ft2 && !ft1->IsFriendlyTo(ft2)) // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work) - factionTemplate = receiver->getFaction(); + factionTemplate = receiver->GetFaction(); } return factionTemplate; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 9c16502dd25..56f2d4447df 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -186,7 +186,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c PhasingHandler::InheritPhaseShift(this, owner); setPetType(petType); - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); SetCreatedBySpell(summonSpellId); if (IsCritter()) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1895aace00f..87f03539599 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2200,13 +2200,13 @@ void Player::SetGameMaster(bool on) if (on) { m_ExtraFlags |= PLAYER_EXTRA_GM_ON; - setFaction(35); + SetFaction(35); AddPlayerFlag(PLAYER_FLAGS_GM); AddUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS); if (Pet* pet = GetPet()) { - pet->setFaction(35); + pet->SetFaction(35); pet->getHostileRefManager().setOnlineOfflineState(false); } @@ -2230,7 +2230,7 @@ void Player::SetGameMaster(bool on) if (Pet* pet = GetPet()) { - pet->setFaction(getFaction()); + pet->SetFaction(GetFaction()); pet->getHostileRefManager().setOnlineOfflineState(true); } @@ -6298,7 +6298,7 @@ void Player::setFactionForRace(uint8 race) m_team = TeamForRace(race); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); - setFaction(rEntry ? rEntry->FactionID : 0); + SetFaction(rEntry ? rEntry->FactionID : 0); } ReputationRank Player::GetReputationRank(uint32 faction) const @@ -22618,7 +22618,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc float discount = GetReputationPriceDiscount(npc); totalcost = uint32(ceil(totalcost * discount)); firstcost = uint32(ceil(firstcost * discount)); - m_taxi.SetFlightMasterFactionTemplateId(npc->getFaction()); + m_taxi.SetFlightMasterFactionTemplateId(npc->GetFaction()); } else m_taxi.SetFlightMasterFactionTemplateId(0); @@ -28213,7 +28213,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy PhasingHandler::InheritPhaseShift(pet, this); pet->SetCreatorGUID(GetGUID()); - pet->setFaction(getFaction()); + pet->SetFaction(GetFaction()); pet->SetNpcFlags(UNIT_NPC_FLAG_NONE); pet->SetNpcFlags2(UNIT_NPC_FLAG_2_NONE); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index df7273a5b2d..84e6cb9ea16 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5429,15 +5429,15 @@ void Unit::UpdateDisplayPower() FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const { - FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction()); + FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction()); if (!entry) { if (Player const* player = ToPlayer()) - TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction()); + TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), GetFaction()); else if (Creature const* creature = ToCreature()) - TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction()); + TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, GetFaction()); else - TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction()); + TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), GetFaction()); ABORT(); } @@ -11225,7 +11225,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id) bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) { pet->SetCreatorGUID(GetGUID()); - pet->setFaction(getFaction()); + pet->SetFaction(GetFaction()); pet->SetCreatedBySpell(spell_id); if (GetTypeId() == TYPEID_PLAYER) @@ -11881,8 +11881,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au if (aurApp && aurApp->GetRemoveMode()) return false; - _oldFactionId = getFaction(); - setFaction(charmer->getFaction()); + _oldFactionId = GetFaction(); + SetFaction(charmer->GetFaction()); // Set charmed charmer->SetCharm(this, true); @@ -11998,7 +11998,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) if (_oldFactionId) { - setFaction(_oldFactionId); + SetFaction(_oldFactionId); _oldFactionId = 0; } else @@ -12090,13 +12090,13 @@ void Unit::RestoreFaction() { if (Unit* owner = GetOwner()) { - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); return; } } if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature - setFaction(cinfo->faction); + SetFaction(cinfo->faction); } } @@ -12191,7 +12191,7 @@ bool Unit::IsInPartyWith(Unit const* unit) const (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return true; - return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction(); + return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction(); } bool Unit::IsInRaidWith(Unit const* unit) const @@ -12210,7 +12210,7 @@ bool Unit::IsInRaidWith(Unit const* unit) const (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return true; - return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction(); + return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction(); } void Unit::GetPartyMembers(std::list &TagUnitMap) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7f126fa2c3e..1df51077ae4 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1119,8 +1119,8 @@ class TC_GAME_API Unit : public WorldObject void SetSheath(SheathState sheathed) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::SheatheState), sheathed); } // faction template id - uint32 getFaction() const { return m_unitData->FactionTemplate; } - void setFaction(uint32 faction) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::FactionTemplate), faction); } + uint32 GetFaction() const { return m_unitData->FactionTemplate; } + void SetFaction(uint32 faction) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::FactionTemplate), faction); } FactionTemplateEntry const* GetFactionTemplateEntry() const; ReputationRank GetReactionTo(Unit const* target) const; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index e4ccc62f5dc..95454d49f90 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -52,7 +52,7 @@ void WorldSession::HandleAuctionBrowseQuery(WorldPackets::AuctionHouse::AuctionB if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); TC_LOG_DEBUG("auctionHouse", "Auctionhouse search (%s), searchedname: %s, levelmin: %u, levelmax: %u, filters: %u", browseQuery.Auctioneer.ToString().c_str(), browseQuery.Name.c_str(), browseQuery.MinLevel, browseQuery.MaxLevel, AsUnderlyingType(browseQuery.Filters)); @@ -115,7 +115,7 @@ void WorldSession::HandleAuctionCancelCommoditiesPurchase(WorldPackets::AuctionH if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); auctionHouse->CancelCommodityQuote(_player->GetGUID()); } @@ -136,7 +136,7 @@ void WorldSession::HandleAuctionConfirmCommoditiesPurchase(WorldPackets::Auction if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); if (auctionHouse->BuyCommodity(trans, _player, confirmCommoditiesPurchase.ItemID, confirmCommoditiesPurchase.Quantity, throttle.DelayUntilNext)) @@ -190,7 +190,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPackets::AuctionHouse::Auct if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionListBidderItemsResult result; @@ -218,7 +218,7 @@ void WorldSession::HandleAuctionListBucketsByBucketKeys(WorldPackets::AuctionHou if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionListBucketsResult listBucketsResult; @@ -248,7 +248,7 @@ void WorldSession::HandleAuctionListItemsByBucketKey(WorldPackets::AuctionHouse: if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionListItemsResult listItemsResult; listItemsResult.DesiredDelay = uint32(throttle.DelayUntilNext.count()); @@ -279,7 +279,7 @@ void WorldSession::HandleAuctionListItemsByItemID(WorldPackets::AuctionHouse::Au if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionListItemsResult listItemsResult; listItemsResult.DesiredDelay = uint32(throttle.DelayUntilNext.count()); @@ -311,7 +311,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPackets::AuctionHouse::Aucti if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionListOwnerItemsResult result; @@ -345,7 +345,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPackets::AuctionHouse::AuctionPlac if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); AuctionPosting* auction = auctionHouse->GetAuction(placeBid.AuctionID); if (!auction || auction->IsCommodity()) @@ -467,7 +467,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPackets::AuctionHouse::AuctionRe if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); AuctionPosting* auction = auctionHouse->GetAuction(removeItem.AuctionID); Player* player = GetPlayer(); @@ -529,7 +529,7 @@ void WorldSession::HandleAuctionReplicateItems(WorldPackets::AuctionHouse::Aucti if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionReplicateResponse response; @@ -569,7 +569,7 @@ void WorldSession::HandleAuctionSellCommodity(WorldPackets::AuctionHouse::Auctio } uint32 houseId = 0; - AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction(), &houseId); + AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction(), &houseId); if (!auctionHouseEntry) { TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", sellCommodity.Auctioneer.ToString().c_str()); @@ -645,7 +645,7 @@ void WorldSession::HandleAuctionSellCommodity(WorldPackets::AuctionHouse::Auctio } Seconds auctionTime = Seconds(int64(std::chrono::duration_cast(Minutes(sellCommodity.RunTime)).count() * double(sWorld->getRate(RATE_AUCTION_TIME)))); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); uint64 deposit = AuctionHouseMgr::GetCommodityAuctionDeposit(items2.begin()->second.first->GetTemplate(), Minutes(sellCommodity.RunTime), totalCount); if (!_player->HasEnoughMoney(deposit)) @@ -793,7 +793,7 @@ void WorldSession::HandleAuctionSellItem(WorldPackets::AuctionHouse::AuctionSell } uint32 houseId = 0; - AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction(), &houseId); + AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction(), &houseId); if (!auctionHouseEntry) { TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", sellItem.Auctioneer.ToString().c_str()); @@ -837,7 +837,7 @@ void WorldSession::HandleAuctionSellItem(WorldPackets::AuctionHouse::AuctionSell } Seconds auctionTime = Seconds(int64(std::chrono::duration_cast(Minutes(sellItem.RunTime)).count() * double(sWorld->getRate(RATE_AUCTION_TIME)))); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); uint64 deposit = AuctionHouseMgr::GetItemAuctionDeposit(_player, item, Minutes(sellItem.RunTime)); if (!_player->HasEnoughMoney(deposit)) @@ -947,7 +947,7 @@ void WorldSession::HandleAuctionStartCommoditiesPurchase(WorldPackets::AuctionHo if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPackets::AuctionHouse::AuctionCommodityQuote auctionCommodityQuote; @@ -972,7 +972,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit) return; } - AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction(), nullptr); + AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction(), nullptr); if (!ahEntry) return; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 08981180970..1cda9ba2f1c 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -159,7 +159,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPackets::NPC::Hello& packet) } // set faction visible if needed - if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction())) + if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction())) _player->GetReputationMgr().SetVisible(factionTemplateEntry); GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f43aaab35e3..80918422f53 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4928,7 +4928,7 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, if (apply) { - target->setFaction(GetMiscValue()); + target->SetFaction(GetMiscValue()); if (target->GetTypeId() == TYPEID_PLAYER) target->RemoveUnitFlag(UNIT_FLAG_PVP_ATTACKABLE); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8f77c39afe2..a533517c6f6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2031,7 +2031,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (properties->Control == SUMMON_CATEGORY_ALLY) { summon->SetOwnerGUID(m_originalCaster->GetGUID()); - summon->setFaction(m_originalCaster->getFaction()); + summon->SetFaction(m_originalCaster->GetFaction()); summon->SetCreatedBySpell(m_spellInfo->Id); } @@ -2072,9 +2072,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) uint32 faction = properties->Faction; if (!faction) - faction = m_originalCaster->getFaction(); + faction = m_originalCaster->GetFaction(); - summon->setFaction(faction); + summon->SetFaction(faction); break; } @@ -3604,7 +3604,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) PhasingHandler::InheritPhaseShift(go, m_caster); - go->SetFaction(m_caster->getFaction()); + go->SetFaction(m_caster->GetFaction()); go->SetLevel(m_caster->getLevel()+1); int32 duration = m_spellInfo->CalcDuration(m_caster); go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); @@ -4688,7 +4688,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) { case GAMEOBJECT_TYPE_FISHINGNODE: { - go->SetFaction(m_caster->getFaction()); + go->SetFaction(m_caster->GetFaction()); ObjectGuid bobberGuid = go->GetGUID(); // client requires fishing bobber guid in channel object slot 0 to be usable m_caster->SetChannelObject(0, bobberGuid); @@ -5206,7 +5206,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* ((Guardian*)summon)->InitStatsForLevel(level); if (properties && properties->Control == SUMMON_CATEGORY_ALLY) - summon->setFaction(caster->getFaction()); + summon->SetFaction(caster->GetFaction()); if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst()) ((Minion*)summon)->SetFollowAngle(m_caster->GetAngle(summon)); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a9d9ddf2008..83ac3e43b4f 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -218,7 +218,7 @@ public: if (!pfactionid) { - uint32 factionid = target->getFaction(); + uint32 factionid = target->GetFaction(); uint32 flag = target->m_unitData->Flags; uint64 npcflag; memcpy(&npcflag, target->m_unitData->NpcFlags.begin(), sizeof(uint64)); @@ -261,7 +261,7 @@ public: handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().ToString().c_str(), factionid, flag, std::to_string(npcflag).c_str(), dyflag); - target->setFaction(factionid); + target->SetFaction(factionid); target->SetUnitFlags(UnitFlags(flag)); target->SetNpcFlags(NPCFlags(npcflag & 0xFFFFFFFF)); target->SetNpcFlags2(NPCFlags2(npcflag >> 32)); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 7a2e6cff30e..595af9223bc 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -606,7 +606,7 @@ public: return false; } - creature->setFaction(factionId); + creature->SetFaction(factionId); // Faction is set in creature_template - not inside creature @@ -725,7 +725,7 @@ public: CreatureTemplate const* cInfo = target->GetCreatureTemplate(); - uint32 faction = target->getFaction(); + uint32 faction = target->GetFaction(); uint64 npcflags; memcpy(&npcflags, target->m_unitData->NpcFlags.begin(), sizeof(npcflags)); uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index 5a373419634..1e0cd4ab835 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -102,7 +102,7 @@ public: creatureTarget->SetHealth(0); // just for nice GM-mode view pet->SetCreatorGUID(player->GetGUID()); - pet->setFaction(player->getFaction()); + pet->SetFaction(player->GetFaction()); if (!pet->InitStatsForLevel(creatureTarget->getLevel())) { diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 6d87e944368..853b03245d0 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -91,7 +91,7 @@ public: void JustSummoned(Creature* summoned) override { summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true)); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); WaterElementalGUID = summoned->GetGUID(); summons.Summon(summoned); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index e9bcdeeba0f..b0c7e149bd3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -600,7 +600,7 @@ public: //spell by trap has effect61, this indicate the bar go hostile if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX))) - tmp->setFaction(14); + tmp->SetFaction(14); //for later, this event(s) has alot more to it. //optionally, DONE can trigger bar to go hostile. diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp index 8eb276ed5fa..af91790fb12 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp @@ -143,7 +143,7 @@ public: { _Reset(); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(COREN_DIREBREW_FACTION_FRIEND); + me->SetFaction(COREN_DIREBREW_FACTION_FRIEND); events.SetPhase(PHASE_ALL); for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i) @@ -166,7 +166,7 @@ public: { events.SetPhase(PHASE_ONE); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); me->SetInCombatWithZone(); EntryCheckPredicate pred(NPC_ANTAGONIST); @@ -357,7 +357,7 @@ public: void Reset() override { - me->setFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); DoCastAOE(SPELL_MOLE_MACHINE_EMERGE, true); me->SetInCombatWithZone(); } @@ -399,7 +399,7 @@ public: break; case ACTION_ANTAGONIST_HOSTILE: me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); me->SetInCombatWithZone(); break; default: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index 4ae113289f6..9015420d079 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -75,7 +75,7 @@ class boss_emperor_dagran_thaurissan : public CreatureScript if (Creature* moira = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOIRA))) { moira->AI()->EnterEvadeMode(); - moira->setFaction(35); + moira->SetFaction(35); } } 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 39f9869cc22..afb97ec93d1 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 @@ -134,7 +134,7 @@ class boss_doomrel : public CreatureScript case GOSSIP_ACTION_INFO_DEF+2: CloseGossipMenuFor(player); //start event here - creature->setFaction(FACTION_HOSTILE); + creature->SetFaction(FACTION_HOSTILE); creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); creature->AI()->AttackStart(player); InstanceScript* instance = creature->GetInstanceScript(); @@ -170,7 +170,7 @@ class boss_doomrel : public CreatureScript { Initialize(); - me->setFaction(FACTION_FRIEND); + me->SetFaction(FACTION_FRIEND); // was set before event start, so set again me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 589a4757ec7..219414e29a7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -354,7 +354,7 @@ public: { if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) { - boss->setFaction(FACTION_HOSTILE); + boss->SetFaction(FACTION_HOSTILE); boss->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); if (Unit* target = boss->SelectNearestTarget(500)) boss->AI()->AttackStart(target); @@ -380,7 +380,7 @@ public: boss->GetMotionMaster()->MoveTargetedHome(); boss->SetLootRecipient(NULL); } - boss->setFaction(FACTION_FRIEND); + boss->SetFaction(FACTION_FRIEND); } } GhostKillCount = 0; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 10b4ed5c91e..5af9bf91aaa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -190,7 +190,7 @@ public: me->SetVisible(true); me->SetNpcFlags(UNIT_NPC_FLAG_GOSSIP); - me->setFaction(35); + me->SetFaction(35); me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR); me->RemoveAura(SPELL_NEFARIANS_BARRIER); } @@ -207,7 +207,7 @@ public: Talk(SAY_GAMESBEGIN_2); - me->setFaction(103); + me->SetFaction(103); me->SetNpcFlags(UNIT_NPC_FLAG_NONE); DoCast(me, SPELL_NEFARIANS_BARRIER); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -342,7 +342,7 @@ public: CreatureID = Entry[urand(0, 4)]; if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i])) { - dragon->setFaction(103); + dragon->SetFaction(103); dragon->AI()->AttackStart(me->GetVictim()); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index 41dbc2f2a8b..43c0d05805b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -75,7 +75,7 @@ public: { Initialize(); creature->AddNpcFlag(UNIT_NPC_FLAG_GOSSIP); - creature->setFaction(35); + creature->SetFaction(35); creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); } @@ -153,7 +153,7 @@ public: events.ScheduleEvent(EVENT_SPEECH_4, 16000); break; case EVENT_SPEECH_4: - me->setFaction(103); + me->SetFaction(103); if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) AttackStart(player); break; 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 147396ab2a2..6d03826d7b6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -110,7 +110,7 @@ class boss_majordomo : public CreatureScript if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f)) { instance->UpdateEncounterStateForKilledCreature(me->GetEntry(), me); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); EnterEvadeMode(); Talk(SAY_DEFEAT); _JustDied(); @@ -191,7 +191,7 @@ class boss_majordomo : public CreatureScript } else if (action == ACTION_START_RAGNAROS_ALT) { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->AddNpcFlag(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 361d84c137d..4e245db8aad 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -175,7 +175,7 @@ class boss_ragnaros : public CreatureScript { //Become unbanished again me->SetReactState(REACT_AGGRESSIVE); - me->setFaction(14); + me->SetFaction(14); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetEmoteState(EMOTE_ONESHOT_NONE); me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); @@ -253,7 +253,7 @@ class boss_ragnaros : public CreatureScript me->InterruptNonMeleeSpells(false); //Root self //DoCast(me, 23973); - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetEmoteState(EMOTE_STATE_SUBMERGED); me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index d3667627db7..a7998726e1e 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -130,7 +130,7 @@ public: { Start(true, false, player->GetGUID()); - me->setFaction(player->getFaction()); + me->SetFaction(player->GetFaction()); SetData(1, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -225,8 +225,8 @@ public: { //just in case if (GetPlayerForEscort()) - if (me->getFaction() != GetPlayerForEscort()->getFaction()) - me->setFaction(GetPlayerForEscort()->getFaction()); + if (me->GetFaction() != GetPlayerForEscort()->GetFaction()) + me->SetFaction(GetPlayerForEscort()->GetFaction()); switch (waypointId) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 911912168e6..1c4f1c112eb 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -374,7 +374,7 @@ public: if (infernal) { infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); - infernal->setFaction(me->getFaction()); + infernal->SetFaction(me->GetFaction()); if (point) ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->point = point; ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->malchezaar = me->GetGUID(); @@ -449,7 +449,7 @@ public: if (axe) { axe->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - axe->setFaction(me->getFaction()); + 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 990788b7c9d..8172ec257d0 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -428,7 +428,7 @@ public: if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) { - pSpawn->setFaction(me->getFaction()); + pSpawn->SetFaction(me->GetFaction()); pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); } break; @@ -446,7 +446,7 @@ public: if (Creature* unit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) { unit->Attack(me->GetVictim(), true); - unit->setFaction(me->getFaction()); + unit->SetFaction(me->GetFaction()); } } @@ -460,7 +460,7 @@ public: if (Creature* unit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) { unit->Attack(me->GetVictim(), true); - unit->setFaction(me->getFaction()); + unit->SetFaction(me->GetFaction()); } } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index fafc756dc07..bfc74a71127 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1382,7 +1382,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff) { Talk(SAY_JULIANNE_AGGRO); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(16); + me->SetFaction(16); AggroYellTimer = 0; } else AggroYellTimer -= diff; } @@ -1410,7 +1410,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff) ENSURE_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO; DoZoneInCombat(pRomulo); - pRomulo->setFaction(16); + pRomulo->SetFaction(16); } SummonedRomulo = true; } else SummonRomuloTimer -= diff; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 7d31ee88873..9fa6e43ae5d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -454,7 +454,7 @@ public: Initialize(); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); + me->SetFaction(14); DoCast(me, SPELL_FLAMESTRIKE2, true); } @@ -659,7 +659,7 @@ public: me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetDisableGravity(true); - me->setFaction(14); + me->SetFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 257bc278235..89d8c159194 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -128,7 +128,7 @@ public: { Initialize(); events.Reset(); - me->setFaction(7); + me->SetFaction(7); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->LoadEquipment(0, true); @@ -234,7 +234,7 @@ public: wait_timer -= diff; else { - me->setFaction(14); + me->SetFaction(14); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); phase = PHASE_ATTACKING; @@ -594,7 +594,7 @@ public: { if (m_uiDuelTimer <= uiDiff) { - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); if (Unit* unit = ObjectAccessor::GetUnit(*me, m_uiDuelerGUID)) AttackStart(unit); @@ -780,7 +780,7 @@ public: { charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE); caster->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); + caster->SetFaction(35); DoCast(caster, SPELL_CALL_DARK_RIDER, true); if (Creature* Dark_Rider = me->FindNearestCreature(NPC_DARK_RIDER_OF_ACHERUS, 15)) ENSURE_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); @@ -872,7 +872,7 @@ public: { deathcharger->AddNpcFlag(UNIT_NPC_FLAG_SPELLCLICK); deathcharger->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - deathcharger->setFaction(2096); + deathcharger->SetFaction(2096); } } }; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 30457fb0de8..2733669aa9d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -87,7 +87,7 @@ public: playerGUID = player->GetGUID(); speechTimer = 1000; speechCounter = 1; - me->setFaction(player->getFaction()); + me->SetFaction(player->GetFaction()); me->CombatStop(true); me->GetMotionMaster()->MoveIdle(); me->SetReactState(REACT_PASSIVE); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 3cc188d9bc0..97c0296df30 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -653,7 +653,7 @@ public: { Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); temp->SetWalk(false); - temp->setFaction(2084); + temp->SetFaction(2084); uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -671,7 +671,7 @@ public: { Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); temp->SetWalk(false); - temp->setFaction(2084); + temp->SetFaction(2084); uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -689,7 +689,7 @@ public: { Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); temp->SetWalk(false); - temp->setFaction(2084); + temp->SetFaction(2084); uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -707,7 +707,7 @@ public: { Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); temp->SetWalk(false); - temp->setFaction(2084); + temp->SetFaction(2084); uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -1002,7 +1002,7 @@ public: temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED); temp->SetWalk(false); temp->SetSpeedRate(MOVE_RUN, 2.0f); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); uiDefenderGUID[0] = temp->GetGUID(); @@ -1010,7 +1010,7 @@ public: temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED); temp->SetWalk(false); temp->SetSpeedRate(MOVE_RUN, 2.0f); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); uiEarthshatterGUID[0] = temp->GetGUID(); } @@ -1402,7 +1402,7 @@ public: if (!uiTirionGUID) 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, 600000)) { - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetVirtualItem(0, uint32(EQUIP_UNEQUIP)); temp->AI()->Talk(SAY_LIGHT_OF_DAWN25); uiTirionGUID = temp->GetGUID(); @@ -1440,7 +1440,7 @@ public: temp->DeleteThreatList(); temp->CombatStop(true); temp->AttackStop(); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9]); } @@ -1451,7 +1451,7 @@ public: temp->DeleteThreatList(); temp->CombatStop(true); temp->AttackStop(); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12]); } @@ -1462,7 +1462,7 @@ public: temp->DeleteThreatList(); temp->CombatStop(true); temp->AttackStop(); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15]); } @@ -1474,7 +1474,7 @@ public: temp->DeleteThreatList(); temp->CombatStop(true); temp->AttackStop(); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18]); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); @@ -1489,7 +1489,7 @@ public: temp->DeleteThreatList(); temp->CombatStop(true); temp->AttackStop(); - temp->setFaction(me->getFaction()); + temp->SetFaction(me->GetFaction()); temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20]); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); @@ -1539,7 +1539,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2084); + temp->SetFaction(2084); uiGhoulGUID[i] = temp->GetGUID(); } } @@ -1549,7 +1549,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2084); + temp->SetFaction(2084); uiAbominationGUID[i] = temp->GetGUID(); } } @@ -1559,7 +1559,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2084); + temp->SetFaction(2084); uiWarriorGUID[i] = temp->GetGUID(); } } @@ -1569,7 +1569,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2084); + temp->SetFaction(2084); uiBehemothGUID[i] = temp->GetGUID(); } } @@ -1581,7 +1581,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiDefenderGUID[i] = temp->GetGUID(); } @@ -1592,7 +1592,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiEarthshatterGUID[i] = temp->GetGUID(); } @@ -1601,7 +1601,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiKorfaxGUID = temp->GetGUID(); } @@ -1609,7 +1609,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiMaxwellGUID = temp->GetGUID(); } @@ -1617,7 +1617,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiEligorGUID = temp->GetGUID(); } @@ -1625,7 +1625,7 @@ public: if (!temp) { temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->setFaction(2089); + temp->SetFaction(2089); me->AddThreat(temp, 0.0f); uiRayneGUID = temp->GetGUID(); } diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index 18238ba3883..6edda7824be 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -118,7 +118,7 @@ class boss_apothecary_hummel : public CreatureScript _deadCount = 0; _isDead = false; events.SetPhase(PHASE_ALL); - me->setFaction(FACTION_APOTHECARY_FRIENDLY); + me->SetFaction(FACTION_APOTHECARY_FRIENDLY); me->SummonCreatureGroup(1); } @@ -137,7 +137,7 @@ class boss_apothecary_hummel : public CreatureScript events.ScheduleEvent(EVENT_HUMMEL_SAY_0, Milliseconds(1)); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_APOTHECARY_HOSTILE); + me->SetFaction(FACTION_APOTHECARY_HOSTILE); DummyEntryCheckPredicate pred; summons.DoAction(ACTION_START_EVENT, pred); } @@ -290,7 +290,7 @@ struct npc_apothecary_genericAI : public ScriptedAI if (action == ACTION_START_EVENT) { me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_APOTHECARY_HOSTILE); + me->SetFaction(FACTION_APOTHECARY_HOSTILE); me->GetMotionMaster()->MovePoint(1, _movePos); } else if (action == ACTION_START_FIGHT) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 986c3af28a5..d68a463a5ee 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -159,7 +159,7 @@ public: if (Creature* Sath = ObjectAccessor::GetCreature(*me, SathGUID)) Sath->AI()->EnterEvadeMode(); - me->setFaction(14); + me->SetFaction(14); if (!bJustReset) //first reset at create { me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)); @@ -386,7 +386,7 @@ public: switch (TalkSequence) { case 1: - me->setFaction(35); + me->SetFaction(35); TalkTimer = 1000; break; case 2: diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index f95ddb5ce62..1a4999d450f 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -610,7 +610,7 @@ public: else summoned->SetLevel(me->getLevel()); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summons.Summon(summoned); } @@ -936,7 +936,7 @@ public: void JustSummoned(Creature* summoned) override { - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summoned->SetLevel(me->getLevel()); } @@ -1036,7 +1036,7 @@ public: void JustSummoned(Creature* summoned) override { - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summoned->SetLevel(me->getLevel()); } diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 335e50a9223..38ab7cd851f 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -98,7 +98,7 @@ class boss_archaedas : public CreatureScript Initialize(); instance->SetData(0, 5); // respawn any dead minions - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->AddAura(SPELL_FREEZE_ANIM, me); @@ -114,14 +114,14 @@ class boss_archaedas : public CreatureScript minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true); minion->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); minion->SetControlled(false, UNIT_STATE_ROOT); - minion->setFaction(14); + minion->SetFaction(14); minion->RemoveAura(SPELL_MINION_FREEZE_ANIM); } } void EnterCombat(Unit* /*who*/) override { - me->setFaction(14); + me->SetFaction(14); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(false, UNIT_STATE_ROOT); } @@ -261,7 +261,7 @@ class npc_archaedas_minions : public CreatureScript { Initialize(); - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->RemoveAllAuras(); @@ -270,7 +270,7 @@ class npc_archaedas_minions : public CreatureScript void EnterCombat(Unit* /*who*/) override { - me->setFaction (14); + me->SetFaction(14); me->RemoveAllAuras(); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(false, UNIT_STATE_ROOT); @@ -350,7 +350,7 @@ class npc_stonekeepers : public CreatureScript void Reset() override { - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->RemoveAllAuras(); @@ -359,7 +359,7 @@ class npc_stonekeepers : public CreatureScript void EnterCombat(Unit* /*who*/) override { - me->setFaction(14); + me->SetFaction(14); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); 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 01613bf5a5f..ac3d2aa110f 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -149,7 +149,7 @@ class instance_uldaman : public InstanceMapScript void SetFrozenState(Creature* creature) { - creature->setFaction(35); + creature->SetFaction(35); creature->RemoveAllAuras(); creature->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); creature->SetControlled(true, UNIT_STATE_ROOT); @@ -184,7 +184,7 @@ class instance_uldaman : public InstanceMapScript if (!target || !target->IsAlive()) continue; target->SetControlled(false, UNIT_STATE_ROOT); - target->setFaction(14); + target->SetFaction(14); target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); target->RemoveAura(SPELL_MINION_FREEZE_ANIM); @@ -205,11 +205,11 @@ class instance_uldaman : public InstanceMapScript for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { Creature* target = instance->GetCreature(*i); - if (!target || !target->IsAlive() || target->getFaction() == 14) + if (!target || !target->IsAlive() || target->GetFaction() == 14) continue; target->SetControlled(false, UNIT_STATE_ROOT); target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - target->setFaction(14); + target->SetFaction(14); target->RemoveAura(SPELL_MINION_FREEZE_ANIM); archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true); @@ -225,7 +225,7 @@ class instance_uldaman : public InstanceMapScript for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { Creature* target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction() != 14) + if (!target || target->isDead() || target->GetFaction() != 14) continue; target->DespawnOrUnsummon(); } @@ -234,7 +234,7 @@ class instance_uldaman : public InstanceMapScript for (GuidVector::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i) { Creature* target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction() != 14) + if (!target || target->isDead() || target->GetFaction() != 14) continue; target->DespawnOrUnsummon(); } @@ -243,7 +243,7 @@ class instance_uldaman : public InstanceMapScript for (GuidVector::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i) { Creature* target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction() != 14) + if (!target || target->isDead() || target->GetFaction() != 14) continue; target->DespawnOrUnsummon(); } @@ -269,7 +269,7 @@ class instance_uldaman : public InstanceMapScript if (!ironaya) return; - ironaya->setFaction(415); + ironaya->SetFaction(415); ironaya->SetControlled(false, UNIT_STATE_ROOT); ironaya->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index bfa3983e8e4..3ad749d537d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -144,7 +144,7 @@ class boss_mandokir : public CreatureScript { if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, *itr)) if (chainedSpirit->GetEntry() == NPC_CHAINED_SPIRIT && chainedSpirit->AI()) - chainedSpirit->setFaction(FACTION_NONE); + chainedSpirit->SetFaction(FACTION_NONE); } } diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index 4d858c29c29..f07c55b2752 100644 --- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -113,7 +113,7 @@ class npc_professor_phizzlethorpe : public CreatureScript { Talk(SAY_PROGRESS_1, player); npc_escortAI::Start(false, false, player->GetGUID(), quest); - me->setFaction(FACTION_SUNKEN_TREASURE); + me->SetFaction(FACTION_SUNKEN_TREASURE); } } diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index 00acb433a61..1e4d75852a2 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -133,7 +133,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { - creature->setFaction(FACTION_QUEST_ESCAPE); + creature->SetFaction(FACTION_QUEST_ESCAPE); if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 7466162b472..821f99ffc9a 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -79,7 +79,7 @@ public: if (quest->GetQuestId() == QUEST_RESQUE_OOX_09) { me->SetStandState(UNIT_STAND_STATE_STAND); - me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H); + me->SetFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H); Talk(SAY_OOX_START, player); npc_escortAI::Start(false, false, player->GetGUID(), quest); } diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 1b328c3127b..16306014b1d 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -87,7 +87,7 @@ public: me->SetEmoteState(EMOTE_STATE_STUN); me->CombatStop(); // stop combat me->DeleteThreatList(); // unsure of this - me->setFaction(FACTION_HORDE_GENERIC); // horde generic + me->SetFaction(FACTION_HORDE_GENERIC); // horde generic bReset = true; Reset_Timer = 60000; @@ -105,7 +105,7 @@ public: { EnterEvadeMode(); bReset = false; - me->setFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp + me->SetFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp return; } diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 1b1f2e0b9d0..f561db22727 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -84,7 +84,7 @@ public: if (me->HasStealthAura()) me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); SetRun(); - me->setFaction(FACTION_ENEMY); + me->SetFaction(FACTION_ENEMY); break; } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 5ca36e99e0d..823ddd33aa9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -917,7 +917,7 @@ void hyjalAI::HideNearPos(float x, float y) for (std::list::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr) { (*itr)->SetVisible(false); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them + (*itr)->SetFaction(35);//make them friendly so mobs won't attack them } } } @@ -995,7 +995,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) if ((*itr) && (*itr)->IsAlive()) { (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them + (*itr)->SetFaction(35);//make them friendly so mobs won't attack them (*itr)->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index ede1d589535..00ff25951df 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -470,7 +470,7 @@ public: if (Creature* trigger = me->SummonCreature(NPC_WORLD_TRIGGER_TINY, me->GetPositionWithOffset({ 8.0f, 8.0f, frand(25.0f, 35.0f), 0.0f }), TEMPSUMMON_TIMED_DESPAWN, 1000)) { trigger->SetVisible(false); - trigger->setFaction(me->getFaction()); + trigger->SetFaction(me->GetFaction()); trigger->SetDisableGravity(true); trigger->CastSpell(me, SPELL_METEOR, true); } diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp index 98f22411a5e..1bb7bae6842 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp @@ -297,7 +297,7 @@ class npc_blazing_monstrosity : public CreatureScript // Our passenger is another vehicle (boardable by players) DoCast(passenger, SPELL_SHARE_HEALTH, true); - passenger->setFaction(35); + passenger->SetFaction(35); passenger->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); // Hack to relocate vehicle on vehicle so exiting players are not moved under map diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 1e9bca04fb8..cb715b6f1e2 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -82,7 +82,7 @@ public: if (Invisible && InvisibleTimer <= diff) { //Become visible again - me->setFaction(14); + me->SetFaction(14); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); //Noxxion model me->SetDisplayId(11172); @@ -122,7 +122,7 @@ public: //Interrupt any spell casting //me->m_canMove = true; me->InterruptNonMeleeSpells(false); - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); // Invisible Model me->SetDisplayId(11686); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index d3167d2272c..adfca4e9a7e 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -136,7 +136,7 @@ public: eventInProgress = true; Talk(SAY_QUEST_ACCEPTED); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_ESCORT); + me->SetFaction(FACTION_ESCORT); me->GetMotionMaster()->MovePath(PATH_ESCORT, false); } } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 226e1e0efd7..7fa68b2771a 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -58,7 +58,7 @@ public: { Start(true, false, player->GetGUID()); Talk(SAY_READY, player); - me->setFaction(113); + me->SetFaction(113); } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 4068f1491b6..3495a1a6d2b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -111,7 +111,7 @@ public: //Cast me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(35); + me->SetFaction(35); DoCast(me, SPELL_DIRTMOUND_PASSIVE); Submerged = true; @@ -134,7 +134,7 @@ public: if (Submerged && Back_Timer <= diff) { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); + me->SetFaction(14); DoCastVictim(SPELL_GROUND_RUPTURE); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index e9bd5488027..4dd49bb1c66 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -332,7 +332,7 @@ struct boss_twinemperorsAI : public ScriptedAI if (c->isDead()) { c->Respawn(); - c->setFaction(7); + c->SetFaction(7); c->RemoveAllAuras(); } if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE)) @@ -427,7 +427,7 @@ public: void CastSpellOnBug(Creature* target) override { - target->setFaction(14); + target->SetFaction(14); target->AI()->AttackStart(me->getThreatManager().getHostilTarget()); target->AddAura(SPELL_MUTATE_BUG, target); target->SetFullHealth(); @@ -518,7 +518,7 @@ public: void CastSpellOnBug(Creature* target) override { - target->setFaction(14); + target->SetFaction(14); target->AddAura(SPELL_EXPLODEBUG, target); target->SetFullHealth(); } diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index bdd909b5fff..d8fee227711 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -97,7 +97,7 @@ public: creature->AI()->Talk(SAY_MAKE_PREPARATIONS); - creature->setFaction(250); + creature->SetFaction(250); creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); ENSURE_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp index 3105164490a..f8b39df3d93 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp @@ -74,7 +74,7 @@ public: void Reset() override { - me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy + me->SetFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy Initialize(); } diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 0eb55441232..af4e5f4ec69 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -131,7 +131,7 @@ public: { Initialize(); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); } void UpdateAI(uint32 diff) override @@ -154,7 +154,7 @@ public: Text_Timer = 5000; break; case 3: - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); if (Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID)) AttackStart(target); @@ -199,7 +199,7 @@ public: { if (Creature* crew = ObjectAccessor::GetCreature(*me, instance->GetGuidData(entry))) if (crew->IsAlive()) - crew->setFaction(FACTION_HOSTILE); + crew->SetFaction(FACTION_HOSTILE); } }; @@ -238,7 +238,7 @@ private: crew->SetWalk(true); crew->SetHomePosition(x, y, z, 0); crew->GetMotionMaster()->MovePoint(1, x, y, z); - crew->setFaction(FACTION_FREED); + crew->SetFaction(FACTION_FREED); } } }; @@ -387,7 +387,7 @@ public: { if (me->IsAlive()) { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->MovePoint(0, 1858.57f, 1146.35f, 14.745f); me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f); // in case he gets interrupted Talk(SAY_WEEGLI_OK_I_GO); @@ -454,7 +454,7 @@ public: if (!pZumrah) return false; - pZumrah->setFaction(ZUMRAH_HOSTILE_FACTION); + pZumrah->SetFaction(ZUMRAH_HOSTILE_FACTION); return true; } diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index 6bf389dc180..af7ca599b3f 100644 --- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -83,7 +83,7 @@ public: { if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) { - me->setFaction(FACTION_QUEST); + me->SetFaction(FACTION_QUEST); npc_escortAI::Start(true, false, player->GetGUID()); } } @@ -226,7 +226,7 @@ public: if (quest->GetQuestId() == QUEST_VORSHA) { Talk(SAY_MUG_START1); - me->setFaction(FACTION_QUEST); + me->SetFaction(FACTION_QUEST); npc_escortAI::Start(true, false, player->GetGUID()); } } diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index d7bc3bd5240..2e15e2d2118 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -201,7 +201,7 @@ public: npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) { Initialize(); - NormFaction = creature->getFaction(); + NormFaction = creature->GetFaction(); NpcFlags = NPCFlags(creature->m_unitData->NpcFlags[0]); } @@ -220,7 +220,7 @@ public: { Initialize(); - me->setFaction(NormFaction); + me->SetFaction(NormFaction); me->SetNpcFlags(NpcFlags); } @@ -232,7 +232,7 @@ public: void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { CloseGossipMenuFor(player); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); me->Attack(player, true); } @@ -403,7 +403,7 @@ public: case EVENT_ACCEPT_QUEST: if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) Talk(SAY_START, player); - me->setFaction(FACTION_QUEST); + me->SetFaction(FACTION_QUEST); _events.ScheduleEvent(EVENT_START_ESCORT, Seconds(1)); break; case EVENT_START_ESCORT: diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index bf6b78ea005..5c2f4299068 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -105,7 +105,7 @@ public: bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) override { if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - creature->setFaction(FACTION_HOSTILE); + creature->SetFaction(FACTION_HOSTILE); return true; } diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp index adc4d92a01c..f3aff8909f7 100644 --- a/src/server/scripts/Kalimdor/zone_felwood.cpp +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp @@ -59,7 +59,7 @@ public: { me->CastSpell(me, SPELL_INFECTED_WOULD); me->SetEntry(NPC_CORRUPTED_LASHER); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); } else { diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 9e4de29c00d..2df4806adac 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -980,7 +980,7 @@ public: Merithra->SetNpcFlags(UNIT_NPC_FLAG_NONE); Merithra->SetStandState(UNIT_STAND_STATE_STAND); Merithra->SetDisplayId(MERITHRA_NIGHT_ELF_FORM); - Merithra->setFaction(35); + Merithra->SetFaction(35); } if (Caelestrasz) @@ -988,7 +988,7 @@ public: Caelestrasz->SetNpcFlags(UNIT_NPC_FLAG_NONE); Caelestrasz->SetStandState(UNIT_STAND_STATE_STAND); Caelestrasz->SetDisplayId(CAELESTRASZ_NIGHT_ELF_FORM); - Caelestrasz->setFaction(35); + Caelestrasz->SetFaction(35); } if (Arygos) @@ -996,7 +996,7 @@ public: Arygos->SetNpcFlags(UNIT_NPC_FLAG_NONE); Arygos->SetStandState(UNIT_STAND_STATE_STAND); Arygos->SetDisplayId(ARYGOS_GNOME_FORM); - Arygos->setFaction(35); + Arygos->SetFaction(35); } if (Anachronos) diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 393ee9fcff6..2d5ad0bc50b 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -90,7 +90,7 @@ public: void Reset() override { Initialize(); - me->setFaction(35); + me->SetFaction(35); } void SendItem(Unit* receiver) @@ -120,7 +120,7 @@ public: { if (SwitchFactionTimer <= diff) { - me->setFaction(91); + me->SetFaction(91); isFriendly = false; } else SwitchFactionTimer -= diff; } @@ -318,7 +318,7 @@ public: { if (quest->GetQuestId() == Q_OOX17) { - creature->setFaction(113); + creature->SetFaction(113); creature->SetFullHealth(); creature->SetStandState(UNIT_STAND_STATE_STAND); creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 7c36c9a1af5..2ac0c1dc8dd 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -101,7 +101,7 @@ public: { if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) { - creature->setFaction(FACTION_ESCORTEE); + creature->SetFaction(FACTION_ESCORTEE); creature->SetStandState(UNIT_STAND_STATE_STAND); creature->AI()->Talk(SAY_GIL_START, player); @@ -196,7 +196,7 @@ public: npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) { Initialize(); - factionNorm = creature->getFaction(); + factionNorm = creature->GetFaction(); } void Initialize() @@ -214,7 +214,7 @@ public: void Reset() override { Initialize(); - me->setFaction(factionNorm); + me->SetFaction(factionNorm); } void DoFriend() @@ -226,7 +226,7 @@ public: me->StopMoving(); me->GetMotionMaster()->MoveIdle(); - me->setFaction(FACTION_FRIENDLY_F); + me->SetFaction(FACTION_FRIENDLY_F); me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); } @@ -266,7 +266,7 @@ public: { if (FlareCount >= 2) { - if (me->getFaction() == FACTION_FRIENDLY_F) + if (me->GetFaction() == FACTION_FRIENDLY_F) return; DoFriend(); @@ -419,7 +419,7 @@ public: Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); if (!creature) continue; - creature->setFaction(35); + creature->SetFaction(35); creature->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); creature->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); @@ -460,7 +460,7 @@ public: creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); + creature->SetFaction(14); creature->AI()->AttackStart(warrior); ++Wave; WaveTimer = 20000; @@ -492,7 +492,7 @@ public: creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); + creature->SetFaction(14); creature->AI()->AttackStart(warrior); } } @@ -653,7 +653,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE) { - creature->setFaction(FACTION_RATCHET); + creature->SetFaction(FACTION_RATCHET); creature->AI()->Talk(SAY_START); if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index 97084ad9d28..c0d5b422cb9 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -299,7 +299,7 @@ public: if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR) { creature->AI()->Talk(SAY_QUEST_START); - creature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); + creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); if (npc_ranshallaAI* escortAI = dynamic_cast(creature->AI())) escortAI->Start(false, false, player->GetGUID(), quest); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index ff34eb5851a..81dcf1846a6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -195,7 +195,7 @@ public: { damage = 0; EnterEvadeMode(); - me->setFaction(35); + me->SetFaction(35); bDone = true; } } @@ -323,7 +323,7 @@ public: { damage = 0; EnterEvadeMode(); - me->setFaction(35); + me->SetFaction(35); bDone = true; } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 4d41e3b4c14..868bb4e07c8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -226,7 +226,7 @@ class boss_anubarak_trial : public CreatureScript for (int i = 0; i < 10; i++) if (Creature* scarab = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ())) { - scarab->setFaction(31); + scarab->SetFaction(31); scarab->GetMotionMaster()->MoveRandom(10); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index a40b30d6128..871214b8c21 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -922,7 +922,7 @@ class npc_toc_shaman : public CreatureScript events.ScheduleEvent(EVENT_SPIRIT_CLEANSE, urand(15*IN_MILLISECONDS, 35*IN_MILLISECONDS)); return; case EVENT_HEAL_BLOODLUST_HEROISM: - if (me->getFaction()) // alliance = 1 + if (me->GetFaction()) // alliance = 1 { if (!me->HasAura(AURA_EXHAUSTION)) DoCastAOE(SPELL_HEROISM); @@ -2030,7 +2030,7 @@ class npc_toc_enh_shaman : public CreatureScript events.ScheduleEvent(EVENT_STORMSTRIKE, urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS)); return; case EVENT_DPS_BLOODLUST_HEROISM: - if (me->getFaction()) //Am i alliance? + if (me->GetFaction()) //Am i alliance? { if (!me->HasAura(AURA_EXHAUSTION)) DoCastAOE(SPELL_HEROISM); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 80ab44fe32a..fbe2655cf84 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -463,7 +463,7 @@ class boss_deathbringer_saurfang : public CreatureScript { case EVENT_INTRO_ALLIANCE_2: me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(FACTION_SCOURGE); + me->SetFaction(FACTION_SCOURGE); Talk(SAY_INTRO_ALLIANCE_2); break; case EVENT_INTRO_ALLIANCE_3: @@ -476,7 +476,7 @@ class boss_deathbringer_saurfang : public CreatureScript break; case EVENT_INTRO_HORDE_2: me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(FACTION_SCOURGE); + me->SetFaction(FACTION_SCOURGE); Talk(SAY_INTRO_HORDE_2); break; case EVENT_INTRO_HORDE_4: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 217dc86e342..f4e8d4e10b1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -359,7 +359,7 @@ class boss_lady_deathwhisper : public CreatureScript { if (darnavan->IsAlive()) { - darnavan->setFaction(35); + darnavan->SetFaction(35); darnavan->CombatStop(true); darnavan->GetMotionMaster()->MoveIdle(); darnavan->SetReactState(REACT_PASSIVE); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 997ab3c0180..0aa77ef0eb2 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1214,7 +1214,7 @@ public: me->SetCanFly(false); } - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->RemoveAllAuras(); } } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index 8fa9aabb59e..857ce9c32b4 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -61,31 +61,31 @@ class instance_nexus : public InstanceMapScript // Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs. case NPC_ALLIANCE_BERSERKER: if (ServerAllowsTwoSideGroups()) - creature->setFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_HOSTILE_FOR_ALL); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_BERSERKER); break; case NPC_ALLIANCE_RANGER: if (ServerAllowsTwoSideGroups()) - creature->setFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_HOSTILE_FOR_ALL); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_RANGER); break; case NPC_ALLIANCE_CLERIC: if (ServerAllowsTwoSideGroups()) - creature->setFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_HOSTILE_FOR_ALL); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_CLERIC); break; case NPC_ALLIANCE_COMMANDER: if (ServerAllowsTwoSideGroups()) - creature->setFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_HOSTILE_FOR_ALL); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_COMMANDER); break; case NPC_COMMANDER_STOUTBEARD: if (ServerAllowsTwoSideGroups()) - creature->setFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_HOSTILE_FOR_ALL); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_COMMANDER_KOLURG); break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index e70769ffd11..6ebe372fe25 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -538,7 +538,7 @@ class boss_algalon_the_observer : public CreatureScript damage = 0; me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->setFaction(35); + me->SetFaction(35); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_SELF_STUN); events.Reset(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 8e734e6d3e7..c301d287a97 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -607,7 +607,7 @@ class boss_flame_leviathan_seat : public CreatureScript if (Unit* turretPassenger = me->GetVehicleKit()->GetPassenger(SEAT_TURRET)) if (Creature* turret = turretPassenger->ToCreature()) { - turret->setFaction(me->GetVehicleBase()->getFaction()); + turret->SetFaction(me->GetVehicleBase()->GetFaction()); turret->SetUnitFlags(UnitFlags(0)); // unselectable turret->AI()->AttackStart(who); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 5cfc0d75481..33e346e0c94 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -226,7 +226,7 @@ class npc_iron_roots : public CreatureScript SetCombatMovement(false); me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip - me->setFaction(14); + me->SetFaction(14); me->SetReactState(REACT_PASSIVE); } @@ -610,7 +610,7 @@ class boss_freya : public CreatureScript _JustDied(); me->RemoveAllAuras(); me->AttackStop(); - me->setFaction(35); + me->SetFaction(35); me->DeleteThreatList(); me->CombatStop(true); me->DespawnOrUnsummon(7500); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 4d8a49160bc..a320994dc07 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -408,7 +408,7 @@ class boss_hodir : public CreatureScript DoCastAOE(SPELL_KILL_CREDIT, true); /// need to be cast before changing boss faction /// spell will target enemies only - me->setFaction(35); + me->SetFaction(35); me->DespawnOrUnsummon(10000); _JustDied(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 37141085731..cfe2d3879d1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -180,7 +180,7 @@ class boss_ignis : public CreatureScript { if (summon->GetEntry() == NPC_IRON_CONSTRUCT) { - summon->setFaction(16); + summon->SetFaction(16); summon->SetReactState(REACT_AGGRESSIVE); summon->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IMMUNE_TO_PC)); summon->SetControlled(false, UNIT_STATE_ROOT); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 4d9ed335279..940c5b4f52f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -637,7 +637,7 @@ class boss_mimiron : public CreatureScript case EVENT_OUTTRO_1: me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL_1); DoCast(me, SPELL_SLEEP_VISUAL_2); - me->setFaction(35); + me->SetFaction(35); events.ScheduleEvent(EVENT_OUTTRO_2, 3000); break; case EVENT_OUTTRO_2: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 79214b5b0e1..e36e32fd882 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -774,7 +774,7 @@ class boss_sara : public CreatureScript { me->RemoveAllAuras(); me->SetReactState(REACT_PASSIVE); - me->setFaction(35); + me->SetFaction(35); _events.Reset(); _events.SetPhase(PHASE_ONE); } @@ -817,7 +817,7 @@ class boss_sara : public CreatureScript case EVENT_TRANSFORM_3: Talk(SAY_SARA_TRANSFORM_4); DoCast(me, SPELL_FULL_HEAL); - me->setFaction(16); + me->SetFaction(16); if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON)) voice->AI()->DoAction(ACTION_PHASE_TWO); if (Creature* mimiron = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MIMIRON_YS))) diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 61c5a52c24e..1dcc2de11c2 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -668,11 +668,11 @@ public: switch (player->GetTeam()) { case ALLIANCE: - creature->setFaction(FACTION_ESCORTEE_A); + creature->SetFaction(FACTION_ESCORTEE_A); break; default: case HORDE: - creature->setFaction(FACTION_ESCORTEE_H); + creature->SetFaction(FACTION_ESCORTEE_H); break; } @@ -710,7 +710,7 @@ public: owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f); owner->CastSpell(owner, SPELL_SUBDUED, true); GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); - owner->setFaction(35); + owner->SetFaction(35); owner->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); owner->DespawnOrUnsummon(3 * MINUTE*IN_MILLISECONDS); } @@ -891,7 +891,7 @@ public: if (talbot) { talbot->UpdateEntry(NPC_PRINCE_VALANAR); - talbot->setFaction(14); + talbot->SetFaction(14); talbot->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); talbot->SetReactState(REACT_PASSIVE); } @@ -1629,10 +1629,10 @@ public: switch (player->GetTeam()) { case ALLIANCE: - creature->setFaction(FACTION_ESCORTEE_A); + creature->SetFaction(FACTION_ESCORTEE_A); break; case HORDE: - creature->setFaction(FACTION_ESCORTEE_H); + creature->SetFaction(FACTION_ESCORTEE_H); break; } creature->SetStandState(UNIT_STAND_STATE_STAND); @@ -2217,7 +2217,7 @@ public: void AttackPlayer() { - me->setFaction(14); + me->SetFaction(14); if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID)) AttackStart(player); } diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index f2c59c76c1d..05cb11fc414 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -414,7 +414,7 @@ public: else if (roll == 0) // enemy version { tree->AI()->Talk(SAY_WALKER_ENEMY, player); - tree->setFaction(FACTION_WALKER_ENEMY); + tree->SetFaction(FACTION_WALKER_ENEMY); tree->Attack(player, true); } } diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 5519d70d21c..a9495310e89 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -103,7 +103,7 @@ public: Talk(SAY_WORGRAGGRO3); if (Creature* RWORG = me->SummonCreature(NPC_RAVENOUS_WORG, me->GetPositionX()+10, me->GetPositionY()+8, me->GetPositionZ()+2, 3.229f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000)) { - RWORG->setFaction(35); + RWORG->SetFaction(35); _RavenousworgGUID = RWORG->GetGUID(); } break; @@ -136,7 +136,7 @@ public: { RWORG->Kill(Mrfloppy); Mrfloppy->ExitVehicle(); - RWORG->setFaction(14); + RWORG->SetFaction(14); RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10, RWORG->GetPositionY()+80, RWORG->GetPositionZ()); Talk(SAY_VICTORY2); } diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index ed389a87d4a..9f49df63596 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -164,7 +164,7 @@ public: break; case EVENT_START_ESCORT: events.Reset(); - me->setFaction(FACTION_ESCORTEE_H); + me->SetFaction(FACTION_ESCORTEE_H); me->SetReactState(REACT_AGGRESSIVE); ENSURE_AI(npc_escortAI, (me->AI()))->Start(true, true, _player); break; diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 181d24d7761..8adbd37d884 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -47,7 +47,7 @@ public: { Initialize(); creature->GetMotionMaster()->MovePoint(0, 8599.258f, 963.951f, 547.553f); - creature->setFaction(35); //wrong faction in db? + creature->SetFaction(35); //wrong faction in db? } void Initialize() @@ -69,7 +69,7 @@ public: if (uiType != POINT_MOTION_TYPE) return; - me->setFaction(14); + me->SetFaction(14); } void DamageTaken(Unit* pDoneBy, uint32& uiDamage) override @@ -78,7 +78,7 @@ public: { uiDamage = 0; pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true); - me->setFaction(35); + me->SetFaction(35); me->DespawnOrUnsummon(5000); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); EnterEvadeMode(); diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index c6489dcb6c8..1c226c23528 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -326,7 +326,7 @@ public: if (npc_engineer_heliceAI* pEscortAI = CAST_AI(npc_engineer_helice::npc_engineer_heliceAI, creature->AI())) { creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); - creature->setFaction(113); + creature->SetFaction(113); pEscortAI->Start(false, false, player->GetGUID()); creature->AI()->Talk(SAY_WP_1); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 700b64c0417..6b3cc445c9d 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -93,7 +93,7 @@ public: if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID) { CloseGossipMenuFor(player); - me->setFaction(113); + me->SetFaction(113); Start(true, true, player->GetGUID()); } } diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 1ead42b9a39..7233bf3db61 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -345,8 +345,8 @@ class go_wg_vehicle_teleporter : public GameObjectScript bool IsFriendly(Unit* passenger) { - return ((go->GetFaction() == WintergraspFaction[TEAM_HORDE] && passenger->getFaction() == HORDE) || - (go->GetFaction() == WintergraspFaction[TEAM_ALLIANCE] && passenger->getFaction() == ALLIANCE)); + return ((go->GetFaction() == WintergraspFaction[TEAM_HORDE] && passenger->GetFaction() == HORDE) || + (go->GetFaction() == WintergraspFaction[TEAM_ALLIANCE] && passenger->GetFaction() == ALLIANCE)); } Creature* GetValidVehicle(Creature* cVeh) diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 23716389e7e..e9e94189bf7 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -138,7 +138,7 @@ public: void Reset() override { - me->setFaction(35); + me->SetFaction(35); DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P } @@ -151,7 +151,7 @@ public: me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN); me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN); me->RemoveAurasDueToSpell(SPELL_KNEEL); - me->setFaction(me->GetCreatureTemplate()->faction); + me->SetFaction(me->GetCreatureTemplate()->faction); DoCast(me, SPELL_UNSHACKLED, true); Talk(SAY_RAGECLAW); me->GetMotionMaster()->MoveRandom(10); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index 8b2e7d01220..e02d3f206d5 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -228,7 +228,7 @@ public: //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. summoned->CastSpell(summoned, SPELL_STOLEN_SOUL_VISUAL, false); summoned->SetDisplayId(soulmodel); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); if (Unit* target = ObjectAccessor::GetUnit(*me, soulholder)) { diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index d0ba63b17f9..c07ddb0cb23 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -96,7 +96,7 @@ public: if (summoned && summoned->GetEntry() == NPC_FOCUS_FIRE) { summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summoned->SetLevel(me->getLevel()); summoned->AddUnitState(UNIT_STATE_ROOT); diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 610d12a377b..dc5d479bf58 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -384,7 +384,7 @@ public: void Reset() override { Initialize(); - me->setFaction(ASHTONGUE_FACTION_FRIEND); + me->SetFaction(ASHTONGUE_FACTION_FRIEND); DoCastSelf(SPELL_STEALTH); if (_instance->GetBossState(DATA_SHADE_OF_AKAMA) != DONE) @@ -430,7 +430,7 @@ public: { _isInCombat = false; me->CombatStop(true); - me->setFaction(ASHTONGUE_FACTION_FRIEND); + me->SetFaction(ASHTONGUE_FACTION_FRIEND); me->SetWalk(true); _events.Reset(); me->GetMotionMaster()->MovePoint(AKAMA_INTRO_WAYPOINT, AkamaWP[1]); @@ -484,7 +484,7 @@ public: case EVENT_SHADE_CHANNEL: me->SetFacingTo(FACE_THE_PLATFORM); DoCastSelf(SPELL_AKAMA_SOUL_CHANNEL); - me->setFaction(AKAMA_FACTION_COMBAT); + me->SetFaction(AKAMA_FACTION_COMBAT); _events.ScheduleEvent(EVENT_FIXATE, Seconds(5)); break; case EVENT_FIXATE: @@ -532,7 +532,7 @@ public: } } - if (me->getFaction() == AKAMA_FACTION_COMBAT) + if (me->GetFaction() == AKAMA_FACTION_COMBAT) { if (!UpdateVictim()) return; @@ -1170,7 +1170,7 @@ public: Talk(SAY_BROKEN_SPECIAL); break; case ACTION_BROKEN_HAIL: - me->setFaction(ASHTONGUE_FACTION_FRIEND); + me->SetFaction(ASHTONGUE_FACTION_FRIEND); Talk(SAY_BROKEN_HAIL); break; case ACTION_BROKEN_EMOTE: diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 8684879ac42..66600ccb4d0 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -128,7 +128,7 @@ class instance_black_temple : public InstanceMapScript case NPC_STORM_FURY: AshtongueGUIDs.emplace_back(creature->GetGUID()); if (GetBossState(DATA_SHADE_OF_AKAMA) == DONE) - creature->setFaction(ASHTONGUE_FACTION_FRIEND); + creature->SetFaction(ASHTONGUE_FACTION_FRIEND); break; default: break; @@ -175,7 +175,7 @@ class instance_black_temple : public InstanceMapScript if (state == DONE) for (ObjectGuid ashtongueGuid : AshtongueGUIDs) if (Creature* ashtongue = instance->GetCreature(ashtongueGuid)) - ashtongue->setFaction(ASHTONGUE_FACTION_FRIEND); + ashtongue->SetFaction(ASHTONGUE_FACTION_FRIEND); // no break case DATA_TERON_GOREFIEND: case DATA_GURTOGG_BLOODBOIL: diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 0187d263a5e..a8485ecbdf3 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -668,7 +668,7 @@ public: { Cyclone->SetObjectScale(3.0f); Cyclone->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - Cyclone->setFaction(me->getFaction()); + Cyclone->SetFaction(me->GetFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) Cyclone->AI()->AttackStart(target); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 520ee2c9e9b..a454599bbf7 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -753,7 +753,7 @@ public: void Reset() override { me->SetDisableGravity(true); - me->setFaction(14); + me->SetFaction(14); Initialize(); } @@ -788,7 +788,7 @@ public: { if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000)) { - trig->setFaction(14); + trig->SetFaction(14); trig->CastSpell(trig, SPELL_TOXIC_SPORES, true); } } @@ -804,7 +804,7 @@ public: if (!Vashj || !Vashj->IsAlive() || ENSURE_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3) { // remove - me->setFaction(35); + me->SetFaction(35); me->DespawnOrUnsummon(); return; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index 265787589e4..eca80aec5e6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -321,7 +321,7 @@ public: me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); + me->SetFaction(14); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 009c5b261df..858705111b0 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -104,7 +104,7 @@ class boss_nazan : public CreatureScript if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE) { summoned->SetLevel(me->getLevel()); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true); summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true); } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index a128e0349fb..765a7d5a7de 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -207,7 +207,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript void JustSummoned(Creature* summoned) override { - summoned->setFaction(16); + summoned->SetFaction(16); summoned->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index d30cb2e08f0..6fba85f3580 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -410,7 +410,7 @@ class boss_alar : public CreatureScript Summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f); Summoned->SetDisplayId(11686); - Summoned->setFaction(me->getFaction()); + Summoned->SetFaction(me->GetFaction()); Summoned->SetLevel(me->getLevel()); Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index e08071fc475..ee44f0c0f46 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1278,7 +1278,7 @@ class npc_kael_flamestrike : public CreatureScript Initialize(); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); + me->SetFaction(14); } void MoveInLineOfSight(Unit* /*who*/) override { } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index fc45410e932..70b1da72d93 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -539,7 +539,7 @@ class npc_zerekethvoidzone : public CreatureScript void Reset() override { me->SetNpcFlags(UNIT_NPC_FLAG_NONE); - me->setFaction(16); + me->SetFaction(16); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_VOID_ZONE_DAMAGE); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 3a3902a5668..7e3afcbc225 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -76,7 +76,7 @@ public: Initialize(); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(SAY_SUMMON); } @@ -87,7 +87,7 @@ public: { if (faction_Timer <= diff) { - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); faction_Timer = 0; } else faction_Timer -= diff; } @@ -97,7 +97,7 @@ public: if (HealthBelowPct(30)) { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); me->RemoveAllAuras(); me->DeleteThreatList(); @@ -281,7 +281,7 @@ public: { if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) { - me->setFaction(FACTION_FALCON_WATCH_QUEST); + me->SetFaction(FACTION_FALCON_WATCH_QUEST); npc_escortAI::Start(true, false, player->GetGUID()); } } @@ -1004,7 +1004,7 @@ public: break; case EVENT_ATTACK: me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) me->CombatStart(player); _events.ScheduleEvent(EVENT_FIREBALL, 1); diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index ae5e1a60708..2f662558c93 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -79,7 +79,7 @@ public: if (npc_maghar_captiveAI* EscortAI = dynamic_cast(creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->setFaction(232); + creature->SetFaction(232); EscortAI->Start(true, false, player->GetGUID(), quest); creature->AI()->Talk(SAY_MAG_START); @@ -433,7 +433,7 @@ public: if (npc_kurenai_captiveAI* EscortAI = dynamic_cast(creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->setFaction(231); + creature->SetFaction(231); EscortAI->Start(true, false, player->GetGUID(), quest); creature->AI()->Talk(SAY_KUR_START); diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index f11a2f2df65..cc10c1d619c 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -498,7 +498,7 @@ public: { if (quest->GetQuestId() == Q_ALMABTRIEB) { - creature->setFaction(113); + creature->SetFaction(113); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); } @@ -664,7 +664,7 @@ public: { if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI())) { - creature->setFaction(113); + creature->SetFaction(113); pEscortAI->Start(false, false, player->GetGUID()); } } diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index a8bd85023a2..af98238d5b5 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -379,7 +379,7 @@ public: void Reset() override { if (!Tapped) - me->setFaction(FACTION_DEFAULT); + me->SetFaction(FACTION_DEFAULT); FlyTimer = 10000; me->SetDisableGravity(false); @@ -395,7 +395,7 @@ public: Tapped = true; PlayerGUID = caster->GetGUID(); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); Unit* Dragonmaw = me->FindNearestCreature(NPC_DRAGONMAW_SUBJUGATOR, 50); @@ -602,7 +602,7 @@ public: if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR) { creature->AI()->Talk(SAY_WIL_START, player); - creature->setFaction(FACTION_EARTHEN); + creature->SetFaction(FACTION_EARTHEN); if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest); @@ -1479,7 +1479,7 @@ public: totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS); if (totemOspirits) { - Summoned->setFaction(FACTION_ENRAGED_SOUL_FRIENDLY); + Summoned->SetFaction(FACTION_ENRAGED_SOUL_FRIENDLY); Summoned->GetMotionMaster()->MovePoint(0, totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ()); if (Unit* owner = totemOspirits->GetOwner()) diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 948a47fca33..c76e803c168 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -62,7 +62,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF+1) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_OGRE_HOSTILE); + creature->SetFaction(FACTION_OGRE_HOSTILE); creature->AI()->Talk(SAY_RALIQ_ATTACK, player); creature->AI()->AttackStart(player); } @@ -152,7 +152,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF+1) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_DEMON_HOSTILE); + creature->SetFaction(FACTION_DEMON_HOSTILE); creature->AI()->Talk(SAY_DEMONIC_AGGRO, player); creature->AI()->AttackStart(player); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index bf595557c49..d5521265fe4 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -86,7 +86,7 @@ public: { Initialize(); me->SetStandState(UNIT_STAND_STATE_STAND); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); } void EnterCombat(Unit* /*who*/) override { } @@ -94,7 +94,7 @@ public: void DoNice() { Talk(SAY_SUBMIT); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->SetStandState(UNIT_STAND_STATE_SIT); me->RemoveAllAuras(); me->DeleteThreatList(); @@ -338,7 +338,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF+1) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_HOSTILE_FLOON); + creature->SetFaction(FACTION_HOSTILE_FLOON); creature->AI()->Talk(SAY_FLOON_ATTACK, player); creature->AI()->AttackStart(player); } @@ -364,7 +364,7 @@ public: npc_floonAI(Creature* creature) : ScriptedAI(creature) { Initialize(); - m_uiNormFaction = creature->getFaction(); + m_uiNormFaction = creature->GetFaction(); } void Initialize() @@ -382,8 +382,8 @@ public: void Reset() override { Initialize(); - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->GetFaction() != m_uiNormFaction) + me->SetFaction(m_uiNormFaction); } void EnterCombat(Unit* /*who*/) override { } @@ -503,7 +503,7 @@ public: if (quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_H || quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_A) { ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - creature->setFaction(FACTION_ESCORTEE); + creature->SetFaction(FACTION_ESCORTEE); } return true; } @@ -643,9 +643,9 @@ public: pEscortAI->Start(false, false, player->GetGUID()); if (player->GetTeamId() == TEAM_ALLIANCE) - creature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); + creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); else - creature->setFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE); + creature->SetFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE); } return true; } diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index a31d8e4fe33..d73acd789f9 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -168,7 +168,7 @@ public: { npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = creature->getFaction(); + m_uiNormFaction = creature->GetFaction(); Initialize(); } @@ -183,8 +183,8 @@ public: void Reset() override { Initialize(); - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->GetFaction() != m_uiNormFaction) + me->SetFaction(m_uiNormFaction); } void EnterCombat(Unit* /*who*/) override { } @@ -224,7 +224,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_HOSTILE_CO); + creature->SetFaction(FACTION_HOSTILE_CO); creature->AI()->AttackStart(player); } return true; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index eb800765b7c..85fb71cccec 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3704,7 +3704,7 @@ class spell_gen_gm_freeze : public SpellScriptLoader if (Player* player = GetTarget()->ToPlayer()) { // stop combat + make player unattackable + duel stop + stop some spells - player->setFaction(35); + player->SetFaction(35); player->CombatStop(); if (player->IsNonMeleeSpellCast(true)) player->InterruptNonMeleeSpells(true); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index c0e1fdaae33..8e63c84fe2a 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -256,7 +256,7 @@ public: if (Spell) creature->CastSpell(player, Spell, false); else - TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction()); + TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->GetFaction()); } } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index a5d11011ea1..7c367705d36 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -285,7 +285,7 @@ public: void Reset() override { Initialize(); - me->setFaction(FACTION_CHICKEN); + me->SetFaction(FACTION_CHICKEN); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); } @@ -317,7 +317,7 @@ public: if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand32() % 30 == 1) { me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(player->GetTeam() == HORDE ? EMOTE_HELLO_H : EMOTE_HELLO_A); } break; @@ -325,7 +325,7 @@ public: if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE) { me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(EMOTE_CLUCK_TEXT); } break; -- cgit v1.2.3