diff options
author | ForesterDev <forester.manv@gmail.com> | 2017-05-23 14:30:27 +0400 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2020-06-14 23:49:03 +0200 |
commit | c34b83a467975f5d2ed6f8a98b8d6cb0c7710a34 (patch) | |
tree | 44a6e4676cea8beb3baf17ae1b5871c4f5d6dfaf | |
parent | 607c5ad5541bac7ce8a2787ef9c87b4ebea74a5e (diff) |
Core/Defines: define faction templates and replace magic numbers from scripts
(cherry picked from commit abea8bf4cb3034f56d833982f951a0742dc36fc7)
87 files changed, 225 insertions, 281 deletions
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 6e1bba5f1a9..62e37f5d76b 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -57,7 +57,7 @@ BfWGCoordGY const WGGraveYard[BATTLEFIELD_WG_GRAVEYARD_MAX] = }; uint32 const ClockWorldState[] = { 3781, 4354 }; -uint32 const WintergraspFaction[] = { 1732, 1735, 35 }; +uint32 const WintergraspFaction[] = { FACTION_ALLIANCE_GENERIC_WG, FACTION_HORDE_GENERIC_WG, FACTION_FRIENDLY }; Position const WintergraspStalkerPos = { 4948.985f, 2937.789f, 550.5172f, 1.815142f }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index edd6d3e67ed..31345c14048 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 ? FACTION_ALLIANCE_GENERIC : FACTION_HORDE_GENERIC); 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 3fc2cd2ad8d..ff37ce06346 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -757,7 +757,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node) DelCreature(node + 302); return; } - trigger->SetFaction(owner == ALLIANCE ? 84 : 83); + trigger->SetFaction(owner == ALLIANCE ? FACTION_ALLIANCE_GENERIC : FACTION_HORDE_GENERIC); 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 c83e1ff48b1..8c4143e0ce3 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -810,7 +810,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 ? FACTION_ALLIANCE_GENERIC : FACTION_HORDE_GENERIC); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 4059e6e72d6..6df8c23d765 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2121,7 +2121,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge } else { - trigger->SetFaction(spellInfo->IsPositive() ? 35 : 14); + trigger->SetFaction(spellInfo->IsPositive() ? FACTION_FRIENDLY : FACTION_MONSTER); // 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/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a7fb7ce765d..0802908a9cf 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2201,13 +2201,13 @@ void Player::SetGameMaster(bool on) if (on) { m_ExtraFlags |= PLAYER_EXTRA_GM_ON; - SetFaction(35); + SetFaction(FACTION_FRIENDLY); AddPlayerFlag(PLAYER_FLAGS_GM); AddUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS); if (Pet* pet = GetPet()) { - pet->SetFaction(35); + pet->SetFaction(FACTION_FRIENDLY); pet->getHostileRefManager().setOnlineOfflineState(false); } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 2e7d7e81ddb..03b0f954ccd 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -189,6 +189,51 @@ enum ReputationRank REP_EXALTED = 7 }; +enum FactionTemplates +{ + FACTION_NONE = 0, + FACTION_CREATURE = 7, + FACTION_ESCORTEE_A_NEUTRAL_PASSIVE = 10, + FACTION_MONSTER = 14, + FACTION_MONSTER_2 = 16, + FACTION_TROLL_BLOODSCALP = 28, + FACTION_PREY = 31, + FACTION_ESCORTEE_H_NEUTRAL_PASSIVE = 33, + FACTION_FRIENDLY = 35, + FACTION_OGRE = 45, + FACTION_ORC_DRAGONMAW = 62, + FACTION_HORDE_GENERIC = 83, + FACTION_ALLIANCE_GENERIC = 84, + FACTION_DEMON = 90, + FACTION_ELEMENTAL = 91, + FACTION_DRAGONFLIGHT_BLACK = 103, + FACTION_ESCORTEE_N_NEUTRAL_PASSIVE = 113, + FACTION_ENEMY = 168, + FACTION_ESCORTEE_A_NEUTRAL_ACTIVE = 231, + FACTION_ESCORTEE_H_NEUTRAL_ACTIVE = 232, + FACTION_ESCORTEE_N_NEUTRAL_ACTIVE = 250, + FACTION_ESCORTEE_N_FRIEND_PASSIVE = 290, + FACTION_TITAN = 415, + FACTION_ESCORTEE_N_FRIEND_ACTIVE = 495, + FACTION_GOBLIN_DARK_IRON_BAR_PATRON = 736, + FACTION_DARK_IRON_DWARVES = 754, + FACTION_ESCORTEE_A_PASSIVE = 774, + FACTION_ESCORTEE_H_PASSIVE = 775, + FACTION_UNDEAD_SCOURGE = 974, + FACTION_EARTHEN_RING = 1726, + FACTION_ALLIANCE_GENERIC_WG = 1732, + FACTION_HORDE_GENERIC_WG = 1735, + FACTION_ARAKKOA = 1738, + FACTION_ASHTONGUE_DEATHSWORN = 1820, + FACTION_FLAYER_HUNTER = 1840, + FACTION_MONSTER_SPAR_BUDDY = 1868, + FACTION_ESCORTEE_N_ACTIVE = 1986, + FACTION_ESCORTEE_H_ACTIVE = 2046, + FACTION_UNDEAD_SCOURGE_2 = 2068, + FACTION_UNDEAD_SCOURGE_3 = 2084, + FACTION_SCARLET_CRUSADE = 2089 +}; + #define MIN_REPUTATION_RANK (REP_HATED) #define MAX_REPUTATION_RANK 8 diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index 9f5a0ef78ce..f058bf886ee 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -28,30 +28,6 @@ struct SplineChainLink; #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available -/// @todo find better namings and definitions. -//N=Neutral, A=Alliance, H=Horde. -//NEUTRAL or FRIEND = Hostility to player surroundings (not a good definition) -//ACTIVE or PASSIVE = Hostility to environment surroundings. -enum eEscortFaction -{ - FACTION_ESCORT_A_NEUTRAL_PASSIVE = 10, - FACTION_ESCORT_H_NEUTRAL_PASSIVE = 33, - FACTION_ESCORT_N_NEUTRAL_PASSIVE = 113, - - FACTION_ESCORT_A_NEUTRAL_ACTIVE = 231, - FACTION_ESCORT_H_NEUTRAL_ACTIVE = 232, - FACTION_ESCORT_N_NEUTRAL_ACTIVE = 250, - - FACTION_ESCORT_N_FRIEND_PASSIVE = 290, - FACTION_ESCORT_N_FRIEND_ACTIVE = 495, - - FACTION_ESCORT_A_PASSIVE = 774, - FACTION_ESCORT_H_PASSIVE = 775, - - FACTION_ESCORT_N_ACTIVE = 1986, - FACTION_ESCORT_H_ACTIVE = 2046 -}; - struct ScriptPointMove { uint32 uiCreatureEntry; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index 3851a74d263..14c6ec900db 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -588,7 +588,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(FACTION_MONSTER); //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 923b771b04b..39cf1b6345a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp @@ -99,8 +99,6 @@ enum DirebrewEvents enum DirebrewMisc { - COREN_DIREBREW_FACTION_HOSTILE = 736, - COREN_DIREBREW_FACTION_FRIEND = 35, GOSSIP_ID = 11388, GO_MOLE_MACHINE_TRAP = 188509, GOSSIP_OPTION_FIGHT = 0, @@ -145,7 +143,7 @@ public: { _Reset(); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->SetFaction(COREN_DIREBREW_FACTION_FRIEND); + me->SetFaction(FACTION_FRIENDLY); events.SetPhase(PHASE_ALL); for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i) @@ -168,7 +166,7 @@ public: { events.SetPhase(PHASE_ONE); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); me->SetInCombatWithZone(); EntryCheckPredicate pred(NPC_ANTAGONIST); @@ -359,7 +357,7 @@ public: void Reset() override { - me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoCastAOE(SPELL_MOLE_MACHINE_EMERGE, true); me->SetInCombatWithZone(); } @@ -401,7 +399,7 @@ public: break; case ACTION_ANTAGONIST_HOSTILE: me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); 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 9015420d079..5017f5e48bd 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(FACTION_FRIENDLY); } } 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 d5af35b77b0..7d709fdaf42 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 @@ -149,7 +149,7 @@ class boss_doomrel : public CreatureScript { Initialize(); - me->SetFaction(FACTION_FRIEND); + me->SetFaction(FACTION_FRIENDLY); // was set before event start, so set again me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); @@ -239,7 +239,7 @@ class boss_doomrel : public CreatureScript case GOSSIP_ACTION_INFO_DEF + 2: CloseGossipMenuFor(player); //start event here - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_DARK_IRON_DWARVES); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); me->AI()->AttackStart(player); 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 219414e29a7..85a38917f2b 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_DARK_IRON_DWARVES); 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_FRIENDLY); } } 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 e5c2d97a9d4..f9f81e46efe 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(FACTION_FRIENDLY); 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(FACTION_DRAGONFLIGHT_BLACK); 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(FACTION_DRAGONFLIGHT_BLACK); 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 184b64a9cde..e5b49dd8910 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(FACTION_FRIENDLY); 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(FACTION_DRAGONFLIGHT_BLACK); 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 cd1aeef7b97..72eb8f43cb9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -55,7 +55,6 @@ enum Spells enum Extras { OPTION_ID_YOU_CHALLENGED_US = 0, - FACTION_FRIENDLY = 35, MENU_OPTION_YOU_CHALLENGED_US = 4108 }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index 4e245db8aad..3e73c1e162e 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(FACTION_MONSTER); 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(FACTION_FRIENDLY); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetEmoteState(EMOTE_STATE_SUBMERGED); me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 28bdb8e9056..c3a65c24fab 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(FACTION_MONSTER_2); 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(FACTION_MONSTER_2); } 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 45fe5e7c0cc..1a379d8676e 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(FACTION_MONSTER); DoCast(me, SPELL_FLAMESTRIKE2, true); } @@ -659,7 +659,7 @@ public: me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetDisableGravity(true); - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); 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 d7e50807867..9134885bd46 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -129,7 +129,7 @@ public: { Initialize(); events.Reset(); - me->SetFaction(7); + me->SetFaction(FACTION_CREATURE); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->LoadEquipment(0, true); @@ -235,7 +235,7 @@ public: wait_timer -= diff; else { - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); phase = PHASE_ATTACKING; @@ -484,8 +484,7 @@ enum Says_VBM enum Misc_VBN { - QUEST_DEATH_CHALLENGE = 12733, - FACTION_HOSTILE = 2068 + QUEST_DEATH_CHALLENGE = 12733 }; class npc_death_knight_initiate : public CreatureScript @@ -563,7 +562,7 @@ public: { if (m_uiDuelTimer <= uiDiff) { - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_UNDEAD_SCOURGE_2); if (Unit* unit = ObjectAccessor::GetUnit(*me, m_uiDuelerGUID)) AttackStart(unit); @@ -789,7 +788,7 @@ public: { charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE); caster->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK); - caster->SetFaction(35); + caster->SetFaction(FACTION_FRIENDLY); 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); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 255e709ae90..461d326dd3e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -621,7 +621,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(FACTION_UNDEAD_SCOURGE_3); uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -639,7 +639,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(FACTION_UNDEAD_SCOURGE_3); uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -657,7 +657,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(FACTION_UNDEAD_SCOURGE_3); uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -675,7 +675,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(FACTION_UNDEAD_SCOURGE_3); uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } @@ -1507,7 +1507,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(FACTION_UNDEAD_SCOURGE_3); uiGhoulGUID[i] = temp->GetGUID(); } } @@ -1517,7 +1517,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(FACTION_UNDEAD_SCOURGE_3); uiAbominationGUID[i] = temp->GetGUID(); } } @@ -1527,7 +1527,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(FACTION_UNDEAD_SCOURGE_3); uiWarriorGUID[i] = temp->GetGUID(); } } @@ -1537,7 +1537,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(FACTION_UNDEAD_SCOURGE_3); uiBehemothGUID[i] = temp->GetGUID(); } } @@ -1549,7 +1549,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(FACTION_SCARLET_CRUSADE); me->AddThreat(temp, 0.0f); uiDefenderGUID[i] = temp->GetGUID(); } @@ -1560,7 +1560,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(FACTION_SCARLET_CRUSADE); me->AddThreat(temp, 0.0f); uiEarthshatterGUID[i] = temp->GetGUID(); } @@ -1569,7 +1569,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(FACTION_SCARLET_CRUSADE); me->AddThreat(temp, 0.0f); uiKorfaxGUID = temp->GetGUID(); } @@ -1577,7 +1577,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(FACTION_SCARLET_CRUSADE); me->AddThreat(temp, 0.0f); uiMaxwellGUID = temp->GetGUID(); } @@ -1585,7 +1585,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(FACTION_SCARLET_CRUSADE); me->AddThreat(temp, 0.0f); uiEligorGUID = temp->GetGUID(); } @@ -1593,7 +1593,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(FACTION_SCARLET_CRUSADE); 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 9d03d816fda..1cfbabb638d 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -78,8 +78,6 @@ enum ApothecaryMisc { ACTION_START_EVENT = 1, ACTION_START_FIGHT = 2, - FACTION_APOTHECARY_HOSTILE = 14, - FACTION_APOTHECARY_FRIENDLY = 35, GOSSIP_OPTION_START = 0, GOSSIP_MENU_HUMMEL = 10847, QUEST_YOUVE_BEEN_SERVED = 14488, @@ -120,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_FRIENDLY); me->SummonCreatureGroup(1); } @@ -139,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_MONSTER); DummyEntryCheckPredicate pred; summons.DoAction(ACTION_START_EVENT, pred); } @@ -296,7 +294,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_MONSTER); 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 ca4ef08a0d1..0a0f528ffdd 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -161,7 +161,7 @@ public: if (Creature* Sath = ObjectAccessor::GetCreature(*me, SathGUID)) Sath->AI()->EnterEvadeMode(); - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); if (!bJustReset) //first reset at create { me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)); @@ -388,7 +388,7 @@ public: switch (TalkSequence) { case 1: - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); 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 0eff7cda638..146ebefceaf 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -294,7 +294,7 @@ public: me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); for (uint8 i = 0; i < 4; ++i) if (GameObject* pOrb = GetOrb(i)) - pOrb->SetFaction(0); + pOrb->SetFaction(FACTION_NONE); } void EmpowerOrb(bool all) @@ -311,7 +311,7 @@ public: if (GameObject* pOrb = GetOrb(i)) { pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); - pOrb->SetFaction(35); + pOrb->SetFaction(FACTION_FRIENDLY); pOrb->setActive(true); pOrb->Refresh(); } @@ -323,7 +323,7 @@ public: if (GameObject* pOrb = GetOrb(urand(0, 3))) { pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); - pOrb->SetFaction(35); + pOrb->SetFaction(FACTION_FRIENDLY); pOrb->setActive(true); pOrb->Refresh(); @@ -381,7 +381,7 @@ class go_orb_of_the_blue_flight : public GameObjectScript { player->SummonCreature(NPC_POWER_OF_THE_BLUE_DRAGONFLIGHT, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000); player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false); - me->SetFaction(0); + me->SetFaction(FACTION_NONE); if (Creature* pKalec = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_KALECGOS_KJ))) ENSURE_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames(); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 1b301d553dc..6d2e392e18d 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -100,7 +100,7 @@ class boss_archaedas : public CreatureScript Initialize(); instance->SetData(0, 5); // respawn any dead minions - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->AddAura(SPELL_FREEZE_ANIM, me); @@ -116,14 +116,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(FACTION_MONSTER); minion->RemoveAura(SPELL_MINION_FREEZE_ANIM); } } void EnterCombat(Unit* /*who*/) override { - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(false, UNIT_STATE_ROOT); } @@ -272,7 +272,7 @@ class npc_archaedas_minions : public CreatureScript void EnterCombat(Unit* /*who*/) override { - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); me->RemoveAllAuras(); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(false, UNIT_STATE_ROOT); @@ -352,7 +352,7 @@ class npc_stonekeepers : public CreatureScript void Reset() override { - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->RemoveAllAuras(); @@ -361,7 +361,7 @@ class npc_stonekeepers : public CreatureScript void EnterCombat(Unit* /*who*/) override { - me->SetFaction(14); + me->SetFaction(FACTION_FRIENDLY); 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 ac3d2aa110f..0b6128af171 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(FACTION_FRIENDLY); 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(FACTION_MONSTER); 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() == FACTION_MONSTER) continue; target->SetControlled(false, UNIT_STATE_ROOT); target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - target->SetFaction(14); + target->SetFaction(FACTION_MONSTER); target->RemoveAura(SPELL_MINION_FREEZE_ANIM); archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true); @@ -269,7 +269,7 @@ class instance_uldaman : public InstanceMapScript if (!ironaya) return; - ironaya->SetFaction(415); + ironaya->SetFaction(FACTION_TITAN); 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 3ad749d537d..f9cd1192777 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -93,7 +93,6 @@ enum Misc DATA_OHGANOT_SO_FAST = 5762, - FACTION_NONE = 1665 }; enum SummonGroups diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index f9f0985b416..0225040f053 100644 --- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -56,8 +56,7 @@ enum ProfessorPhizzlethorpe QUEST_SUNKEN_TREASURE = 665, QUEST_GOGGLE_BOGGLE = 26050, // Creatures - NPC_VENGEFUL_SURGE = 2776, - FACTION_SUNKEN_TREASURE = 113 + NPC_VENGEFUL_SURGE = 2776 }; class npc_professor_phizzlethorpe : public CreatureScript @@ -113,7 +112,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_ESCORTEE_N_NEUTRAL_PASSIVE); } } diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index fd4617bb183..b00f3a0ee9d 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -52,8 +52,7 @@ enum RangerLilatha GO_CAGE = 181152, NPC_CAPTAIN_HELIOS = 16220, NPC_MUMMIFIED_HEADHUNTER = 16342, - NPC_SHADOWPINE_ORACLE = 16343, - FACTION_QUEST_ESCAPE = 113 + NPC_SHADOWPINE_ORACLE = 16343 }; class npc_ranger_lilatha : public CreatureScript @@ -132,7 +131,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { - me->SetFaction(FACTION_QUEST_ESCAPE); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); Start(true, false, player->GetGUID()); } } diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 3fd9345ef0e..96f5b757c88 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -45,9 +45,7 @@ enum eOOX SAY_OOX_END = 4, QUEST_RESQUE_OOX_09 = 836, NPC_MARAUDING_OWL = 7808, - NPC_VILE_AMBUSHER = 7809, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 + NPC_VILE_AMBUSHER = 7809 }; class npc_oox09hl : public CreatureScript @@ -79,7 +77,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_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); 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 16306014b1d..5015ff30cc2 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -39,8 +39,6 @@ enum Yenniku { SPELL_YENNIKUS_RELEASE = 3607, QUEST_SAVING_YENNIKU = 592, - FACTION_HORDE_GENERIC = 83, - FACTION_TROLL_BLOODSCALP = 28 }; class npc_yenniku : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 856080be6fa..f192a4bcf8f 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -39,7 +39,6 @@ EndContentData */ enum TapokeSlim { QUEST_MISSING_DIPLO_PT11 = 1249, - FACTION_ENEMY = 168, SPELL_STEALTH = 1785, SPELL_CALL_FRIENDS = 16457, //summons 1x friend NPC_SLIMS_FRIEND = 4971, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 823ddd33aa9..39a1cbd7dde 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<Creature*>::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(FACTION_FRIENDLY);//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(FACTION_FRIENDLY);//make them friendly so mobs won't attack them (*itr)->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); } } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index cb715b6f1e2..298a3535107 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(FACTION_MONSTER); 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(FACTION_FRIENDLY); 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 2c1059a9bd9..6d1f4c70be9 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -58,8 +58,6 @@ enum Belnistrasz EVENT_FIREBALL = 5, EVENT_FROST_NOVA = 6, - FACTION_ESCORT = 250, - PATH_ESCORT = 871710, POINT_REACH_IDOL = 17, @@ -137,7 +135,7 @@ public: eventInProgress = true; Talk(SAY_QUEST_ACCEPTED); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - me->SetFaction(FACTION_ESCORT); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); me->GetMotionMaster()->MovePath(PATH_ESCORT, false); } } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp index 19c999033d7..470908d9a5d 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp @@ -57,7 +57,7 @@ public: switch (go->GetEntry()) { case 21099: DoorWardGUID = go->GetGUID(); break; - case 20920: go->SetFaction(0); break; // big fat fugly hack + case 20920: go->SetFaction(FACTION_NONE); break; // big fat fugly hack } } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 3f1ed9792ff..68d11185f33 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(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 3495a1a6d2b..067f326e011 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(FACTION_FRIENDLY); 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(FACTION_MONSTER); 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 39a0034747f..b27a339ed7b 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(FACTION_CREATURE); c->RemoveAllAuras(); } if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE)) @@ -427,7 +427,7 @@ public: void CastSpellOnBug(Creature* target) override { - target->SetFaction(14); + target->SetFaction(FACTION_MONSTER); 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(FACTION_MONSTER); 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 e3019c885bd..2c99ade96d3 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -329,7 +329,7 @@ public: Talk(SAY_MAKE_PREPARATIONS); - me->SetFaction(250); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); 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 f8b39df3d93..03443d77c6f 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp @@ -48,11 +48,6 @@ enum Events EVENT_HEALING_WAVE = 4 }; -enum Faction -{ - ZUMRAH_FRIENDLY_FACTION = 35 -}; - class boss_zum_rah : public CreatureScript { public: @@ -74,7 +69,7 @@ public: void Reset() override { - me->SetFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy + me->SetFaction(FACTION_FRIENDLY); // 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 6b74f7d0221..3589c70fbec 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -43,13 +43,6 @@ EndContentData */ ## npc_sergeant_bly ######*/ -enum blyAndCrewFactions -{ - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, //while in cages (so the trolls won't attack them while they're caged) - FACTION_FREED = 250 //after release (so they'll be hostile towards trolls) -}; - enum blySays { SAY_1 = 0, @@ -120,7 +113,7 @@ public: Text_Timer = 5000; break; case 3: - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER); if (Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID)) AttackStart(target); @@ -165,7 +158,7 @@ public: { if (Creature* crew = ObjectAccessor::GetCreature(*me, instance->GetGuidData(entry))) if (crew->IsAlive()) - crew->SetFaction(FACTION_HOSTILE); + crew->SetFaction(FACTION_MONSTER); } bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override @@ -239,7 +232,7 @@ public: crew->SetWalk(true); crew->SetHomePosition(x, y, z, 0); crew->GetMotionMaster()->MovePoint(1, x, y, z); - crew->SetFaction(FACTION_FREED); + crew->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } } }; diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index 854e5322667..5fcf56a797e 100644 --- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -44,7 +44,6 @@ enum RuulSnowhoof NPC_THISTLEFUR_TOTEMIC = 3922, NPC_THISTLEFUR_PATHFINDER = 3926, QUEST_FREEDOM_TO_RUUL = 6482, - FACTION_QUEST = 113, GO_CAGE = 178147 }; @@ -84,7 +83,7 @@ public: { if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) { - me->SetFaction(FACTION_QUEST); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); npc_escortAI::Start(true, false, player->GetGUID()); } } @@ -227,7 +226,7 @@ public: if (quest->GetQuestId() == QUEST_VORSHA) { Talk(SAY_MUG_START1); - me->SetFaction(FACTION_QUEST); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); 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 b834317359b..4bef27b450a 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -188,7 +188,6 @@ enum Overgrind AREA_COVE = 3579, AREA_ISLE = 3639, QUEST_GNOMERCY = 9537, - FACTION_HOSTILE = 14, SPELL_DYNAMITE = 7978 }; @@ -233,7 +232,7 @@ public: bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { CloseGossipMenuFor(player); - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER); me->Attack(player, true); return false; } @@ -339,8 +338,7 @@ enum Magwin EVENT_STAND = 3, EVENT_TALK_END = 4, EVENT_COWLEN_TALK = 5, - QUEST_A_CRY_FOR_HELP = 9528, - FACTION_QUEST = 113 + QUEST_A_CRY_FOR_HELP = 9528 }; class npc_magwin : public CreatureScript @@ -405,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_ESCORTEE_N_NEUTRAL_PASSIVE); _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 99cc3ce925c..88429574c30 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -99,7 +99,6 @@ enum Hendel EMOTE_SURRENDER = 4, QUEST_MISSING_DIPLO_PT16 = 1324, - FACTION_HOSTILE = 168, //guessed, may be different NPC_SENTRY = 5184, //helps hendel NPC_JAINA = 4968, //appears once hendel gives up @@ -149,7 +148,7 @@ public: void QuestAccept(Player* /*player*/, Quest const* quest) override { if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_ENEMY); } }; diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index bf1dc96d5e4..661eef0ad1f 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -54,9 +54,6 @@ enum EternalBoard { QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, - EVENT_AREA_RADIUS = 65, // 65yds EVENT_COOLDOWN = 500000, // in ms. appears after event completed or failed (should be = Adds despawn time) @@ -985,7 +982,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(FACTION_FRIENDLY); } if (Caelestrasz) @@ -993,7 +990,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(FACTION_FRIENDLY); } if (Arygos) @@ -1001,7 +998,7 @@ public: Arygos->SetNpcFlags(UNIT_NPC_FLAG_NONE); Arygos->SetStandState(UNIT_STAND_STATE_STAND); Arygos->SetDisplayId(ARYGOS_GNOME_FORM); - Arygos->SetFaction(35); + Arygos->SetFaction(FACTION_FRIENDLY); } if (Anachronos) diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 78d64e4d21a..6a070468b38 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(FACTION_FRIENDLY); } void SendItem(Unit* receiver) @@ -120,7 +120,7 @@ public: { if (SwitchFactionTimer <= diff) { - me->SetFaction(91); + me->SetFaction(FACTION_ELEMENTAL); isFriendly = false; } else SwitchFactionTimer -= diff; } @@ -362,7 +362,7 @@ public: { if (quest->GetQuestId() == Q_OOX17) { - me->SetFaction(113); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFullHealth(); me->SetStandState(UNIT_STAND_STATE_STAND); me->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 fd602f78a6d..734f14e65f4 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -87,8 +87,7 @@ enum Gilthares SAY_GIL_FREED = 7, QUEST_FREE_FROM_HOLD = 898, - AREA_MERCHANT_COAST = 391, - FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest + AREA_MERCHANT_COAST = 391 }; class npc_gilthares : public CreatureScript @@ -150,7 +149,7 @@ public: { if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) { - me->SetFaction(FACTION_ESCORTEE); + me->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); me->SetStandState(UNIT_STAND_STATE_STAND); Talk(SAY_GIL_START, player); diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index d29175c8985..81b79d276cb 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -587,7 +587,7 @@ public: if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR) { Talk(SAY_QUEST_START); - me->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); + me->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE); 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 81dcf1846a6..895b9e15cc4 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(FACTION_FRIENDLY); bDone = true; } } @@ -323,7 +323,7 @@ public: { damage = 0; EnterEvadeMode(); - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); 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 868bb4e07c8..34af2872fdd 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(FACTION_PREY); scarab->GetMotionMaster()->MoveRandom(10); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index d4976c75255..cdf2feee3e8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -204,7 +204,6 @@ enum Actions enum Misc { DATA_MADE_A_MESS = 45374613, // 4537, 4613 are achievement IDs - FACTION_SCOURGE = 974, GOSSIP_MENU_MURADIN_BRONZEBEARD = 10934, GOSSIP_MENU_HIGH_OVERLORD_SAURFANG = 10952 @@ -463,7 +462,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_UNDEAD_SCOURGE); Talk(SAY_INTRO_ALLIANCE_2); break; case EVENT_INTRO_ALLIANCE_3: @@ -476,7 +475,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_UNDEAD_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 6541f51269b..638c600905f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -365,7 +365,7 @@ class boss_lady_deathwhisper : public CreatureScript { if (darnavan->IsAlive()) { - darnavan->SetFaction(35); + darnavan->SetFaction(FACTION_FRIENDLY); 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 0aa77ef0eb2..cb85a35c884 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -175,12 +175,6 @@ enum Seats SEAT_0 = 0 }; -enum Factions -{ - // Needed for melee hover disks /when Nexus Lords die/ - FACTION_FRIENDLY = 35 -}; - enum Actions { // Malygos diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index 857ce9c32b4..5b3228e6413 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -23,11 +23,6 @@ #include "nexus.h" #include "Player.h" -enum Factions -{ - FACTION_HOSTILE_FOR_ALL = 16 -}; - class instance_nexus : public InstanceMapScript { public: @@ -61,31 +56,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_MONSTER_2); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_BERSERKER); break; case NPC_ALLIANCE_RANGER: if (ServerAllowsTwoSideGroups()) - creature->SetFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_MONSTER_2); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_RANGER); break; case NPC_ALLIANCE_CLERIC: if (ServerAllowsTwoSideGroups()) - creature->SetFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_MONSTER_2); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_CLERIC); break; case NPC_ALLIANCE_COMMANDER: if (ServerAllowsTwoSideGroups()) - creature->SetFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_MONSTER_2); if (_teamInInstance == ALLIANCE) creature->UpdateEntry(NPC_HORDE_COMMANDER); break; case NPC_COMMANDER_STOUTBEARD: if (ServerAllowsTwoSideGroups()) - creature->SetFaction(FACTION_HOSTILE_FOR_ALL); + creature->SetFaction(FACTION_MONSTER_2); 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 3f622a72c83..201655985d1 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(FACTION_FRIENDLY); me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_SELF_STUN); events.Reset(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 33e346e0c94..f22095817cf 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(FACTION_MONSTER); me->SetReactState(REACT_PASSIVE); } @@ -610,7 +610,7 @@ class boss_freya : public CreatureScript _JustDied(); me->RemoveAllAuras(); me->AttackStop(); - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); 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 a320994dc07..6635ece7ee9 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(FACTION_FRIENDLY); 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 cfe2d3879d1..76acc9e7c45 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(FACTION_MONSTER_2); 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 690a1ecdbfc..b23e296f0df 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -638,7 +638,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(FACTION_FRIENDLY); events.ScheduleEvent(EVENT_OUTTRO_2, 3000); break; case EVENT_OUTTRO_2: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index f5a8e693922..7861eb165fa 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -315,7 +315,6 @@ enum Data { DATA_CHARGED_PILLAR = 1, - FACTION_FRIENDLY = 35 }; enum DisplayIds 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 2eb507db98c..be43dc8c6cb 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(FACTION_FRIENDLY); _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(FACTION_MONSTER_2); 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 b14038431ad..b487d7fc6e1 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -119,7 +119,7 @@ public: DoCast(me, SPELL_EXPLODE_CART, true); DoCast(me, SPELL_SUMMON_CART, true); if (GameObject* cart = me->FindNearestGameObject(GO_EXPLOSIVES_CART, 3.0f)) - cart->SetFaction(14); + cart->SetFaction(FACTION_MONSTER); phaseTimer = 3000; phase = 2; break; @@ -557,9 +557,6 @@ enum Lurgglbr GO_CAGE = 187369, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775, - SAY_START_1 = 0, SAY_START_2 = 1, SAY_END_1 = 2, @@ -681,11 +678,11 @@ public: switch (player->GetTeam()) { case ALLIANCE: - me->SetFaction(FACTION_ESCORTEE_A); + me->SetFaction(FACTION_ESCORTEE_A_PASSIVE); break; default: case HORDE: - me->SetFaction(FACTION_ESCORTEE_H); + me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); break; } } @@ -1690,10 +1687,10 @@ public: switch (player->GetTeam()) { case ALLIANCE: - me->SetFaction(FACTION_ESCORTEE_A); + me->SetFaction(FACTION_ESCORTEE_A_PASSIVE); break; case HORDE: - me->SetFaction(FACTION_ESCORTEE_H); + me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); break; } me->SetStandState(UNIT_STAND_STATE_STAND); diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 5c7df86b6a4..9c3f455bc41 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -379,9 +379,7 @@ enum StrengthenAncientsMisc SPELL_CREATE_ITEM_BARK = 47550, SPELL_CONFUSED = 47044, - NPC_LOTHALOR = 26321, - - FACTION_WALKER_ENEMY = 14, + NPC_LOTHALOR = 26321 }; class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker @@ -414,7 +412,7 @@ public: else if (roll == 0) // enemy version { tree->AI()->Talk(SAY_WALKER_ENEMY, player); - tree->SetFaction(FACTION_WALKER_ENEMY); + tree->SetFaction(FACTION_MONSTER); 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 d5c06855cff..bfb90373474 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(FACTION_FRIENDLY); _RavenousworgGUID = RWORG->GetGUID(); } break; @@ -136,7 +136,7 @@ public: { RWORG->Kill(Mrfloppy); Mrfloppy->ExitVehicle(); - RWORG->SetFaction(14); + RWORG->SetFaction(FACTION_MONSTER); 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 cab2d03b29c..1989b424679 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -43,7 +43,6 @@ EndContentData */ enum Entries { NPC_APOTHECARY_HANES = 23784, - FACTION_ESCORTEE_H = 775, QUEST_TRAIL_OF_FIRE = 11241, SPELL_HEALING_POTION = 17534, @@ -155,7 +154,7 @@ public: break; case EVENT_START_ESCORT: events.Reset(); - me->SetFaction(FACTION_ESCORTEE_H); + me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); 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 8adbd37d884..bf4caf3128f 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(FACTION_FRIENDLY); //wrong faction in db? } void Initialize() @@ -69,7 +69,7 @@ public: if (uiType != POINT_MOTION_TYPE) return; - me->SetFaction(14); + me->SetFaction(FACTION_MONSTER); } 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(FACTION_FRIENDLY); 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 01285e18a61..5ace31b5cdd 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -340,7 +340,7 @@ public: if (quest->GetQuestId() == QUEST_DISASTER) { me->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); - me->SetFaction(113); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); Start(false, false, player->GetGUID()); 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 8fbf23d4a44..5a0e6c5aa99 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(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); Start(true, true, player->GetGUID()); } return false; diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 48dc7a1d7e4..4e1079eccc7 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -139,7 +139,7 @@ public: void Reset() override { - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P } diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index 2213c65373d..42a6c0457d8 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -133,7 +133,6 @@ enum BTGameObjectIds enum BlackTempleMisc { - ASHTONGUE_FACTION_FRIEND = 1820, AKAMA_FACTION_COMBAT = 1868, AKAMA_INTRO = 1, AKAMA_FIGHT = 2, 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 279749dfd9f..3d5b3c3f4a4 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(FACTION_ASHTONGUE_DEATHSWORN); 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(FACTION_ASHTONGUE_DEATHSWORN); 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(FACTION_MONSTER_SPAR_BUDDY); _events.ScheduleEvent(EVENT_FIXATE, Seconds(5)); break; case EVENT_FIXATE: @@ -532,7 +532,7 @@ public: } } - if (me->GetFaction() == AKAMA_FACTION_COMBAT) + if (me->GetFaction() == FACTION_MONSTER_SPAR_BUDDY) { if (!UpdateVictim()) return; @@ -1171,7 +1171,7 @@ public: Talk(SAY_BROKEN_SPECIAL); break; case ACTION_BROKEN_HAIL: - me->SetFaction(ASHTONGUE_FACTION_FRIEND); + me->SetFaction(FACTION_ASHTONGUE_DEATHSWORN); 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 21197f01c81..bc2c071f7c3 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(FACTION_ASHTONGUE_DEATHSWORN); break; default: break; @@ -175,8 +175,8 @@ class instance_black_temple : public InstanceMapScript if (state == DONE) for (ObjectGuid ashtongueGuid : AshtongueGUIDs) if (Creature* ashtongue = instance->GetCreature(ashtongueGuid)) - ashtongue->SetFaction(ASHTONGUE_FACTION_FRIEND); - /* fallthrough */ + ashtongue->SetFaction(FACTION_ASHTONGUE_DEATHSWORN); + // no break case DATA_TERON_GOREFIEND: case DATA_GURTOGG_BLOODBOIL: case DATA_RELIQUARY_OF_SOULS: 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 a454599bbf7..ba563eb252f 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(FACTION_MONSTER); 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(FACTION_MONSTER); 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(FACTION_FRIENDLY); 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 eca80aec5e6..8d2d134d80c 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(FACTION_MONSTER); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 765a7d5a7de..7a04ba358ac 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(FACTION_MONSTER_2); summoned->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index ee44f0c0f46..ab5480e8b5f 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(FACTION_MONSTER); } 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 70b1da72d93..3b4f22bc23c 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(FACTION_MONSTER_2); 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 72001b3a07e..ab8b16468ae 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -46,8 +46,6 @@ enum Aeranas { SAY_SUMMON = 0, SAY_FREE = 1, - FACTION_HOSTILE = 16, - FACTION_FRIENDLY = 35, SPELL_ENVELOPING_WINDS = 15535, SPELL_SHOCK = 12553 }; @@ -87,7 +85,7 @@ public: { if (faction_Timer <= diff) { - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER_2); faction_Timer = 0; } else faction_Timer -= diff; } @@ -252,7 +250,7 @@ enum WoundedBloodElf QUEST_ROAD_TO_FALCON_WATCH = 9375, NPC_HAALESHI_WINDWALKER = 16966, NPC_HAALESHI_TALONGUARD = 16967, - FACTION_FALCON_WATCH_QUEST = 775 + }; class npc_wounded_blood_elf : public CreatureScript @@ -281,7 +279,7 @@ public: { if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) { - me->SetFaction(FACTION_FALCON_WATCH_QUEST); + me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); npc_escortAI::Start(true, false, player->GetGUID()); } } @@ -997,7 +995,7 @@ public: break; case EVENT_ATTACK: me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER_2); 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 c51dfa286ad..55e129504e6 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -200,7 +200,7 @@ public: if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_H) { me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetFaction(232); + me->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); Start(true, false, player->GetGUID(), quest); Talk(SAY_MAG_START); @@ -575,7 +575,7 @@ public: if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_A) { me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetFaction(231); + me->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_ACTIVE); Start(true, false, player->GetGUID(), quest); Talk(SAY_KUR_START); diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index c4560a9d633..9ef66707d03 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -548,7 +548,7 @@ public: { if (quest->GetQuestId() == Q_ALMABTRIEB) { - me->SetFaction(113); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); Start(true, false, player->GetGUID()); } @@ -656,7 +656,7 @@ public: { if (quest->GetQuestId() == QUEST_MARK_V_IS_ALIVE) { - me->SetFaction(113); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); 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 19b79b6ee4c..a44dedb56ca 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -341,10 +341,6 @@ public: enum EnshlavedNetherwingDrake { - // Factions - FACTION_DEFAULT = 62, - FACTION_FRIENDLY = 1840, // Not sure if this is correct, it was taken off of Mordenai. - // Spells SPELL_HIT_FORCE_OF_NELTHARAKU = 38762, SPELL_FORCE_OF_NELTHARAKU = 38775, @@ -380,7 +376,7 @@ public: void Reset() override { if (!Tapped) - me->SetFaction(FACTION_DEFAULT); + me->SetFaction(FACTION_ORC_DRAGONMAW); FlyTimer = 10000; me->SetDisableGravity(false); @@ -396,7 +392,7 @@ public: Tapped = true; PlayerGUID = caster->GetGUID(); - me->SetFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FLAYER_HUNTER); DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); Unit* Dragonmaw = me->FindNearestCreature(NPC_DRAGONMAW_SUBJUGATOR, 50); @@ -589,8 +585,7 @@ enum Earthmender SPELL_HEALING_WAVE = 12491, QUEST_ESCAPE_COILSCAR = 10451, - NPC_COILSKAR_ASSASSIN = 21044, - FACTION_EARTHEN = 1726 //guessed + NPC_COILSKAR_ASSASSIN = 21044 }; class npc_earthmender_wilda : public CreatureScript @@ -733,7 +728,7 @@ public: if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR) { Talk(SAY_WIL_START, player); - me->SetFaction(FACTION_EARTHEN); + me->SetFaction(FACTION_EARTHEN_RING); Start(false, false, player->GetGUID(), quest); } @@ -1415,11 +1410,7 @@ enum Enraged_Dpirits NPC_CREDIT_EARTH = 21092, // Captured Spell / Buff - SPELL_SOUL_CAPTURED = 36115, - - // Factions - FACTION_ENRAGED_SOUL_FRIENDLY = 35, - FACTION_ENRAGED_SOUL_HOSTILE = 14 + SPELL_SOUL_CAPTURED = 36115 }; class npc_enraged_spirit : public CreatureScript @@ -1487,7 +1478,7 @@ public: totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS); if (totemOspirits) { - Summoned->SetFaction(FACTION_ENRAGED_SOUL_FRIENDLY); + Summoned->SetFaction(FACTION_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 5334f567a89..60037276c25 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -44,7 +44,6 @@ enum RaliqTheDrunk { SAY_RALIQ_ATTACK = 0, OPTION_ID_COLLECT_A_DEBT = 0, - FACTION_OGRE_HOSTILE = 45, MENU_ID_COLLECT_A_DEBT = 7729, NPC_TEXT_WUT_YOU_WANT = 9440, CRACKIN_SOME_SKULLS = 10009, @@ -97,7 +96,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF + 1) { CloseGossipMenuFor(player); - me->SetFaction(FACTION_OGRE_HOSTILE); + me->SetFaction(FACTION_OGRE); Talk(SAY_RALIQ_ATTACK, player); AttackStart(player); } @@ -134,8 +133,6 @@ enum Salsalabim { SAY_DEMONIC_AGGRO = 0, OPTION_ID_ALTRUIS_SENT_ME = 0, - FACTION_FRIENDLY = 35, - FACTION_DEMON_HOSTILE = 90, MENU_ID_ALTRUIS_SENT_ME = 7725, NPC_TEXT_SAL_GROWLS_AT_YOU = 9435, PATIENCE_AND_UNDERSTANDING = 10004, @@ -198,7 +195,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF + 1) { CloseGossipMenuFor(player); - me->SetFaction(FACTION_DEMON_HOSTILE); + me->SetFaction(FACTION_DEMON); Talk(SAY_DEMONIC_AGGRO, player); AttackStart(player); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 50ee9cf0039..7d519c434a4 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -48,8 +48,6 @@ enum UnkorTheRuthless { SAY_SUBMIT = 0, REQUIRED_KILL_COUNT = 10, - FACTION_FRIENDLY = 35, - FACTION_HOSTILE = 45, SPELL_PULVERIZE = 2676, QUEST_DONTKILLTHEFATONE = 9889, NPC_BOULDERFIST_INVADER = 18260 @@ -87,7 +85,7 @@ public: { Initialize(); me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_OGRE); } void EnterCombat(Unit* /*who*/) override { } @@ -310,7 +308,6 @@ enum Floon SAY_FLOON_ATTACK = 0, OPTION_ID_PAY_UP_OR_DIE = 0, OPTION_ID_COLLECT_A_DEBT = 0, - FACTION_HOSTILE_FLOON = 1738, MENU_ID_PAY_UP_OR_DIE = 7731, MENU_ID_COLLECT_A_DEBT = 7732, GOSSIP_FLOON_STRANGE_SOUNDS = 9442, @@ -395,7 +392,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF + 1) { CloseGossipMenuFor(player); - me->SetFaction(FACTION_HOSTILE_FLOON); + me->SetFaction(FACTION_ARAKKOA); Talk(SAY_FLOON_ATTACK, player); AttackStart(player); } @@ -428,7 +425,6 @@ enum IslaStarmaneData SAY_PROGRESS_3 = 2, SAY_PROGRESS_4 = 3, GO_DISTANCE = 10, - FACTION_ESCORTEE = 113, ESCAPE_FROM_FIREWING_POINT_A = 10051, ESCAPE_FROM_FIREWING_POINT_H = 10052, SPELL_TRAVEL_FORM_CAT = 32447, @@ -504,7 +500,7 @@ public: if (quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_H || quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_A) { Start(true, false, player->GetGUID()); - me->SetFaction(FACTION_ESCORTEE); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); } } }; @@ -694,9 +690,9 @@ public: Start(false, false, player->GetGUID()); if (player->GetTeamId() == TEAM_ALLIANCE) - me->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); + me->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE); else - me->SetFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE); + me->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_PASSIVE); } } }; diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index ced7d46107f..3ff618f4b2d 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -162,8 +162,7 @@ public: enum Cooshhooosh { SPELL_LIGHTNING_BOLT = 9532, - QUEST_CRACK_SKULLS = 10009, - FACTION_HOSTILE_CO = 45 + QUEST_CRACK_SKULLS = 10009 }; class npc_cooshcoosh : public CreatureScript @@ -226,7 +225,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF) { CloseGossipMenuFor(player); - me->SetFaction(FACTION_HOSTILE_CO); + me->SetFaction(FACTION_OGRE); AttackStart(player); } return true; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2824a5e637b..de38535a865 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(FACTION_FRIENDLY); player->CombatStop(); if (player->IsNonMeleeSpellCast(true)) player->InterruptNonMeleeSpells(true); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 095933d4c03..60db94dbf63 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -259,8 +259,6 @@ enum ChickenCluck EMOTE_CLUCK_TEXT = 2, QUEST_CLUCK = 3861, - FACTION_FRIENDLY = 35, - FACTION_CHICKEN = 31 }; class npc_chicken_cluck : public CreatureScript @@ -285,7 +283,7 @@ public: void Reset() override { Initialize(); - me->SetFaction(FACTION_CHICKEN); + me->SetFaction(FACTION_PREY); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); } |