diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index bcff866be..427c6eeeb 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -184,7 +184,7 @@ void npc_escortAI::JustRespawned() //add a small delay before going to first waypoint, normal in near all cases m_uiWPWaitTimer = 1000; - 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 e6ad7de8b..d5bebe896 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -144,8 +144,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(); } @@ -282,7 +282,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 8bc2f8a9a..e9f8afec8 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -729,7 +729,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 4d285fefe..960453d97 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -422,7 +422,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); LOG_DEBUG("sql.sql", "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); } @@ -430,9 +430,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); LOG_DEBUG("sql.sql", "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/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f38933cba..1746d1549 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -814,7 +814,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl return nullptr; } - creature->setFaction(BattlefieldFactions[teamId]); + creature->SetFaction(BattlefieldFactions[teamId]); creature->SetHomePosition(x, y, z, o); // force using DB speeds -- do we really need this? diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 468a4156c..b4f680887 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -238,7 +238,7 @@ void BattlefieldWG::OnBattleStart() if (Creature* creature = GetCreature(*itr)) { ShowNpc(creature, true); - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[GetDefenderTeam()]); } } @@ -348,7 +348,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) if (Creature* creature = GetCreature(*itr)) { if (!endByTimer) - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); + creature->SetFaction(WintergraspFaction[GetDefenderTeam()]); HideNpc(creature); } } @@ -610,7 +610,7 @@ void BattlefieldWG::OnCreatureCreate(Creature* creature) return; if (Unit* owner = creature->ToTempSummon()->GetSummonerUnit()) - creature->setFaction(owner->getFaction()); + creature->SetFaction(owner->GetFaction()); break; } } @@ -630,9 +630,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; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 0c867852b..61a13aaca 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1413,7 +1413,7 @@ struct BfWGGameObjectBuilding { if (Creature* creature = m_WG->GetCreature(*itr)) { - creature->setFaction(faction); + creature->SetFaction(faction); if (disable) m_WG->HideNpc(creature); else @@ -1425,7 +1425,7 @@ struct BfWGGameObjectBuilding { if (Creature* creature = m_WG->GetCreature(*itr)) { - creature->setFaction(faction); + creature->SetFaction(faction); if (disable) m_WG->HideNpc(creature); else diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 408e20dc4..41920d0f5 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -271,7 +271,7 @@ void BattlegroundAB::NodeOccupied(uint8 node) if (trigger) { - trigger->setFaction(_capturePointInfo[node]._ownerTeamId == TEAM_ALLIANCE ? 84 : 83); + trigger->SetFaction(_capturePointInfo[node]._ownerTeamId == 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 d4950c147..e1827861b 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -355,7 +355,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) BG_AV_CreaturePos[triggerSpawnID][2], BG_AV_CreaturePos[triggerSpawnID][3])) { - trigger->setFaction(newFaction); + trigger->SetFaction(newFaction); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); } } @@ -786,7 +786,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node) DelCreature(node + 302); return; } - trigger->setFaction(ownerId == TEAM_ALLIANCE ? 84 : 83); + trigger->SetFaction(ownerId == TEAM_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 b083f058e..cdb40d311 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -505,7 +505,7 @@ void BattlegroundEY::EventTeamCapturedPoint(TeamId teamId, uint32 point) if (trigger) { - trigger->setFaction(teamId == TEAM_ALLIANCE ? 84 : 83); + trigger->SetFaction(teamId == TEAM_ALLIANCE ? FACTION_ALLIANCE_GENERIC : FACTION_HORDE_GENERIC); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, true); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index f876aba59..a3984cb08 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -467,9 +467,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_25; ++i) - GetBGCreature(i)->setFaction(BG_IC_Factions[1]); + GetBGCreature(i)->SetFaction(BG_IC_Factions[1]); // Flags if (GameObject* go = GetBGObject(BG_IC_GO_ALLIANCE_BANNER)) { @@ -821,7 +821,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) BG_IC_DocksVehiclesGlaives[i].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(), BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(), RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[nodePoint->faction]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[nodePoint->faction]); } // spawning catapults @@ -836,7 +836,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) BG_IC_DocksVehiclesCatapults[i].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(), BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(), RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE)]); } break; case BG_IC_GO_WORKSHOP_BANNER: @@ -857,7 +857,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) BG_IC_WorkshopVehicles[i].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(), BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(), RESPAWN_ONE_DAY)) - GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); + GetBGCreature(type)->SetFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE)]); } uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H); @@ -871,7 +871,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) if (Creature* siegeEngine = GetBgMap()->GetCreature(BgCreatures[siegeType])) { - siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); + siegeEngine->SetFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE)]); siegeEngine->SetCorpseDelay(5 * MINUTE); if (siegeEngine->IsAlive()) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index d690dc9d3..59e196a30 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -687,13 +687,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]); } } @@ -959,7 +959,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 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 ? 1 : 0)); @@ -987,7 +987,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 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 ? 1 : 0)); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index b0250008e..d44965baa 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -446,7 +446,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele if (!GetCreatureAddon()) SetSheath(SHEATH_STATE_MELEE); - setFaction(cInfo->faction); + SetFaction(cInfo->faction); uint32 npcflag, unit_flags, dynamicflags; ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data); @@ -517,7 +517,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele { 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(); } } @@ -2280,7 +2280,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 @@ -2362,7 +2362,7 @@ void Creature::UpdateMoveInLineOfSightState() } bool nonHostile = true; - if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(getFaction())) + if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetFaction())) if (factionTemplate->hostileMask || factionTemplate->enemyFaction[0] || factionTemplate->enemyFaction[1] || factionTemplate->enemyFaction[2] || factionTemplate->enemyFaction[3]) nonHostile = false; diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 70b04c4cd..0d3335a3b 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -199,7 +199,7 @@ void TempSummon::InitStats(uint32 duration) { if (IsTrigger() && m_spells[0]) { - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); SetLevel(owner->getLevel()); if (owner->GetTypeId() == TYPEID_PLAYER) m_ControlledByPlayer = true; @@ -227,9 +227,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() @@ -320,7 +320,7 @@ void Minion::InitStats(uint32 duration) Unit* owner = GetOwner(); SetCreatorGUID(owner->GetGUID()); - setFaction(owner->getFaction()); + SetFaction(owner->GetFaction()); owner->SetMinion(this, true); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 520242568..b0289e5b0 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2023,7 +2023,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) if (Unit* owner = GetOwner()) { trigger->SetLevel(owner->getLevel(), false); - trigger->setFaction(owner->getFaction()); + trigger->SetFaction(owner->GetFaction()); // needed for GO casts for proper target validation checks trigger->SetOwnerGUID(owner->GetGUID()); // xinef: fixes some duel bugs with traps] @@ -2042,7 +2042,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) else { // xinef: set faction of gameobject, if no faction - assume hostile - trigger->setFaction(GetTemplateAddon() && GetTemplateAddon()->faction ? GetTemplateAddon()->faction : 14); + trigger->SetFaction(GetTemplateAddon() && GetTemplateAddon()->faction ? GetTemplateAddon()->faction : 14); // Set owner guid for target if no owner availble - needed by trigger auras // - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell()) // xinef: set proper orientation, fixes cast against stealthed targets diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index bb94793ec..0137e7bb9 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2256,7 +2256,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3 //summon->SetName(GetName()); if (setLevel && (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/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index dda0fc7a5..e5176e2f5 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2231,7 +2231,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as if (info->m_createdBySpell) pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, info->m_createdBySpell); pet->SetCreatorGUID(player->GetGUID()); - pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); + pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->GetFaction()); pet->setPowerType(POWER_MANA); pet->SetUInt32Value(UNIT_NPC_FLAGS, 0); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1835293e9..6b99e1701 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -517,7 +517,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo m_realRace = createInfo->Race; // set real race flag m_race = createInfo->Race; // set real race flag - setFactionForRace(createInfo->Race); + SetFactionForRace(createInfo->Race); if (!IsValidGender(createInfo->Gender)) { @@ -2060,7 +2060,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) // xinef: not needed, CORRECTLY checked above including forced reputations etc // not unfriendly - //if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) + //if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->GetFaction())) // if (factionTemplate->faction) // if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) // if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) @@ -2150,14 +2150,14 @@ void Player::SetGameMaster(bool on) { m_ExtraFlags |= PLAYER_EXTRA_GM_ON; if (AccountMgr::IsGMAccount(GetSession()->GetSecurity())) - setFaction(35); + SetFaction(FACTION_FRIENDLY); SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS); if (Pet* pet = GetPet()) { if (AccountMgr::IsGMAccount(GetSession()->GetSecurity())) - pet->setFaction(35); + pet->SetFaction(FACTION_FRIENDLY); pet->getHostileRefMgr().setOnlineOfflineState(false); } @@ -2181,13 +2181,13 @@ void Player::SetGameMaster(bool on) SetPhaseMask(newPhase, false); m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON; - setFactionForRace(getRace(true)); + SetFactionForRace(getRace(true)); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS); if (Pet* pet = GetPet()) { - pet->setFaction(getFaction()); + pet->SetFaction(GetFaction()); pet->getHostileRefMgr().setOnlineOfflineState(true); } @@ -5649,7 +5649,7 @@ TeamId Player::TeamIdForRace(uint8 race) return TEAM_ALLIANCE; } -void Player::setFactionForRace(uint8 race) +void Player::SetFactionForRace(uint8 race) { m_team = TeamIdForRace(race); @@ -5659,7 +5659,7 @@ void Player::setFactionForRace(uint8 race) return; ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); - setFaction(rEntry ? rEntry->FactionID : 0); + SetFaction(rEntry ? rEntry->FactionID : 0); } ReputationRank Player::GetReputationRank(uint32 faction) const @@ -14442,7 +14442,7 @@ void Player::SetIsSpectator(bool on) AddAura(SPECTATOR_SPELL_SPEED, this); m_ExtraFlags |= PLAYER_EXTRA_SPECTATOR_ON; AddUnitState(UNIT_STATE_ISOLATED); - //setFaction(1100); + //SetFaction(1100); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); ResetContestedPvP(); @@ -14459,7 +14459,7 @@ void Player::SetIsSpectator(bool on) if (!IsGameMaster()) { - //setFactionForRace(getRace()); + //SetFactionForRace(getRace()); // restore FFA PvP Server state // Xinef: it will be removed if necessery in UpdateArea called in WorldPortOpcode diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d47c08465..675ee057f 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2048,7 +2048,7 @@ public: static TeamId TeamIdForRace(uint8 race); [[nodiscard]] TeamId GetTeamId(bool original = false) const { return original ? TeamIdForRace(getRace(true)) : m_team; }; - void setFactionForRace(uint8 race); + void SetFactionForRace(uint8 race); void setTeamId(TeamId teamid) { m_team = teamid; }; void InitDisplayIds(); diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 28722b45f..c352aaec6 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -5104,7 +5104,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons //Need to call it to initialize m_team (m_team can be calculated from race) //Other way is to saves m_team into characters table. - setFactionForRace(getRace(true)); + SetFactionForRace(getRace(true)); // pussywizard: create empty instance bind containers if necessary sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(playerGuid); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7d52ee5c4..d0a387240 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9413,7 +9413,7 @@ void Unit::setPowerType(Powers new_powertype) FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const { - FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction()); + FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction()); if (!entry) { static ObjectGuid guid; // prevent repeating spam same faction problem @@ -9421,11 +9421,11 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const if (GetGUID() != guid) { if (Player const* player = ToPlayer()) - LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction()); + LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), GetFaction()); else if (Creature const* creature = ToCreature()) - LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction()); + LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, GetFaction()); else - LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction()); + LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), GetFaction()); guid = GetGUID(); } @@ -9433,7 +9433,7 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const return entry; } -void Unit::setFaction(uint32 faction) +void Unit::SetFaction(uint32 faction) { SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction); if (GetTypeId() == TYPEID_UNIT) @@ -16519,7 +16519,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->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id); if (GetTypeId() == TYPEID_PLAYER) @@ -17497,8 +17497,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); @@ -17592,7 +17592,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au creature->RefreshSwimmingFlag(); if (GetTypeId() == TYPEID_PLAYER) - sScriptMgr->OnPlayerBeingCharmed(ToPlayer(), charmer, _oldFactionId, charmer->getFaction()); + sScriptMgr->OnPlayerBeingCharmed(ToPlayer(), charmer, _oldFactionId, charmer->GetFaction()); return true; } @@ -17622,7 +17622,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) if (_oldFactionId) { - setFaction(_oldFactionId); + SetFaction(_oldFactionId); _oldFactionId = 0; } else @@ -17741,20 +17741,20 @@ void Unit::RemoveCharmedBy(Unit* charmer) void Unit::RestoreFaction() { if (GetTypeId() == TYPEID_PLAYER) - ToPlayer()->setFactionForRace(getRace()); + ToPlayer()->SetFactionForRace(getRace()); else { if (HasUnitTypeMask(UNIT_MASK_MINION)) { 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); } } @@ -17831,7 +17831,7 @@ bool Unit::IsInPartyWith(Unit const* unit) const return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer()); // Xinef: we assume that npcs with the same faction are in party else if (u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && !u1->IsControlledByPlayer() && !u2->IsControlledByPlayer()) - return u1->getFaction() == u2->getFaction(); + return u1->GetFaction() == u2->GetFaction(); // Xinef: creature type_flag should work for party check only if player group is not a raid else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && (u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) && u2->ToPlayer()->GetGroup() && !u2->ToPlayer()->GetGroup()->isRaidGroup()) || (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && (u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) && u1->ToPlayer()->GetGroup() && !u1->ToPlayer()->GetGroup()->isRaidGroup())) @@ -17854,7 +17854,7 @@ bool Unit::IsInRaidWith(Unit const* unit) const return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer()); // Xinef: we assume that npcs with the same faction are in party else if (u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && !u1->IsControlledByPlayer() && !u2->IsControlledByPlayer()) - return u1->getFaction() == u2->getFaction(); + return u1->GetFaction() == u2->GetFaction(); else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) || (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return true; @@ -19903,7 +19903,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) fieldBuffer << (m_uint32Values[UNIT_FIELD_BYTES_2] & ((UNIT_BYTE2_FLAG_SANCTUARY /*| UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5*/) << 8)); // this flag is at uint8 offset 1 !! else // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work) - fieldBuffer << uint32(target->getFaction()); + fieldBuffer << uint32(target->GetFaction()); } else fieldBuffer << m_uint32Values[index]; @@ -19914,7 +19914,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) if (index == UNIT_FIELD_BYTES_2) fieldBuffer << (m_uint32Values[index] & 0xFFFFF2FF); // clear UNIT_BYTE2_FLAG_PVP, UNIT_BYTE2_FLAG_FFA_PVP, UNIT_BYTE2_FLAG_SANCTUARY else - fieldBuffer << (uint32)target->getFaction(); + fieldBuffer << (uint32)target->GetFaction(); } else if (!sScriptMgr->IsCustomBuildValuesUpdate(this, updateType, fieldBuffer, target, index)) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e5eb5d25d..a9aca7d38 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1596,8 +1596,8 @@ public: virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); } // faction template id - [[nodiscard]] uint32 getFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); } - void setFaction(uint32 faction); + [[nodiscard]] uint32 GetFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); } + void SetFaction(uint32 faction); [[nodiscard]] 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 616645967..207ba8521 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -62,7 +62,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit) if (!sScriptMgr->CanSendAuctionHello(this, guid, unit)) return; - AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction()); + AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction()); if (!ahEntry) return; @@ -166,7 +166,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) return; } - AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction()); + AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction()); if (!auctionHouseEntry) { LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", auctioneer.ToString().c_str()); @@ -253,7 +253,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) Item* item = items[i]; uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); if (!_player->HasEnoughMoney(deposit)) @@ -417,7 +417,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); AuctionEntry* auction = auctionHouse->GetAuction(auctionId); Player* player = GetPlayer(); @@ -539,7 +539,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); AuctionEntry* auction = auctionHouse->GetAuction(auctionId); Player* player = GetPlayer(); @@ -623,7 +623,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket& recvData) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4 + 4 + 4) + 30000); // pussywizard: ensure there is enough memory Player* player = GetPlayer(); @@ -690,7 +690,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(ObjectGuid creatureGuid) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4 + 4 + 4) + 60000); // pussywizard: ensure there is enough memory data << (uint32) 0; // amount place holder diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 2807097d5..f2ac63136 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -997,7 +997,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder) SendFullReputation({ 942, 935, 936, 1011, 970, 967, 989, 932, 934, 1038, 1077 }); - switch (pCurrChar->getFaction()) + switch (pCurrChar->GetFaction()) { case ALLIANCE: SendFullReputation({ 72, 47, 69, 930, 730, 978, 54, 946 }); diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 5a20c357a..2f3aa412a 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -314,7 +314,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData) return; // 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/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index ade5a27e8..0dc3b262b 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -181,7 +181,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result, pet->SetLoading(true); pet->Relocate(px, py, pz, owner->GetOrientation()); pet->setPetType(pet_type); - pet->setFaction(owner->getFaction()); + pet->SetFaction(owner->GetFaction()); pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id); if (pet->IsCritter()) diff --git a/src/server/game/Misc/AsyncAuctionListing.cpp b/src/server/game/Misc/AsyncAuctionListing.cpp index 364adac53..889961302 100644 --- a/src/server/game/Misc/AsyncAuctionListing.cpp +++ b/src/server/game/Misc/AsyncAuctionListing.cpp @@ -47,7 +47,7 @@ bool AuctionListItemsDelayEvent::Execute() if (!creature) return true; - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction()); WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4) + 50 * ((16 + MAX_INSPECTED_ENCHANTMENT_SLOT * 3) * 4)); uint32 count = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9f1c39941..48c8d3100 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5532,7 +5532,7 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, if (apply) { - target->setFaction(GetMiscValue()); + target->SetFaction(GetMiscValue()); if (target->GetTypeId() == TYPEID_PLAYER) target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b574ad18f..964d7a9e3 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2502,7 +2502,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (properties->Category == SUMMON_CATEGORY_ALLY) { summon->SetOwnerGUID(m_originalCaster->GetGUID()); - summon->setFaction(m_originalCaster->getFaction()); + summon->SetFaction(m_originalCaster->GetFaction()); } ExecuteLogEffectSummonObject(effIndex, summon); @@ -2552,9 +2552,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // xinef: i think this is wrong, found only 2 vehicles with faction override and one of them should inherit caster faction... //uint32 faction = properties->Faction; //if (!faction) - uint32 faction = m_originalCaster->getFaction(); + uint32 faction = m_originalCaster->GetFaction(); - summon->setFaction(faction); + summon->SetFaction(faction); break; } @@ -4387,7 +4387,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) return; } - pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction()); + pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->GetFaction()); pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() + 1); int32 duration = m_spellInfo->GetDuration(); pGameObj->SetRespawnTime(duration > 0 ? duration / IN_MILLISECONDS : 0); @@ -6231,7 +6231,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* } if (properties && properties->Category == SUMMON_CATEGORY_ALLY) - summon->setFaction(caster->getFaction()); + summon->SetFaction(caster->GetFaction()); ExecuteLogEffectSummonObject(i, summon); } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index cb23c0516..5b98f7648 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2932,7 +2932,7 @@ public: creatureTarget->SetHealth(0); // just for nice GM-mode view pet->SetGuidValue(UNIT_FIELD_CREATEDBY, player->GetGUID()); - pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); + pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->GetFaction()); if (!pet->InitStatsForLevel(creatureTarget->getLevel())) { diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index b03552828..e2103f511 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -333,7 +333,7 @@ public: if (!pfactionid) { - uint32 factionid = target->getFaction(); + uint32 factionid = target->GetFaction(); uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS); uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS); uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS); @@ -375,7 +375,7 @@ public: handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag); - target->setFaction(factionid); + target->SetFaction(factionid); target->SetUInt32Value(UNIT_FIELD_FLAGS, flag); target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag); target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 59b058fd4..3ab952360 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -458,7 +458,7 @@ public: return false; } - creature->setFaction(factionId); + creature->SetFaction(factionId); // Faction is set in creature_template - not inside creature @@ -491,7 +491,8 @@ public: if (!creature) return false; - creature->setFaction(tempfaction); + creature->SetFaction(tempfaction); + return true; } @@ -589,7 +590,7 @@ public: } CreatureTemplate const* cInfo = target->GetCreatureTemplate(); - uint32 faction = target->getFaction(); + uint32 faction = target->GetFaction(); uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS); uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; uint32 spellSchoolImmuneMask = cInfo->SpellSchoolImmuneMask; @@ -607,7 +608,7 @@ public: handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); - handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction()); + handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->GetFaction()); handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str()); handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId); handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index f1c1e8607..a7922c6ca 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -106,7 +106,7 @@ public: if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) player->SetShapeshiftForm(FORM_NONE); - player->setFactionForRace(player->getRace()); + player->SetFactionForRace(player->getRace()); player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24))); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 2c02062f0..4c49a8106 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -139,7 +139,7 @@ public: { CAST_AI(npc_water_elemental::npc_water_elementalAI, summoned->AI())->balindaGUID = me->GetGUID(); summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true)); - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); 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 58a002050..96eea66f9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -590,7 +590,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/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h index b210c08c4..8574f0e26 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h @@ -21,13 +21,6 @@ #include "CreatureAIImpl.h" #define BRDScriptName "instance_blackrock_depths" -enum FactionIds -{ - FACTION_NEUTRAL = 734, - FACTION_HOSTILE = 754, - FACTION_FRIEND = 35 -}; - enum BRDBosses { BOSS_AMBASSADOR_FLAMELASH = 0, 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 fd94d8fd2..e1231d3e4 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 @@ -76,7 +76,7 @@ public: 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 2d0777fcf..32af3b4df 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 @@ -178,7 +178,7 @@ public: Voidwalkers = false; // Reset his gossip menu me->SetFlag(UNIT_FIELD_FLAGS, UNIT_NPC_FLAG_GOSSIP); - me->setFaction(FACTION_FRIEND); + me->SetFaction(FACTION_FRIENDLY); // was set before event start, so set again me->SetFlag(UNIT_FIELD_FLAGS, 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 2748cd85a..fb1974a09 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -580,7 +580,7 @@ public: if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) { ++TombEventCounter; - boss->setFaction(FACTION_HOSTILE); + boss->SetFaction(FACTION_DARK_IRON_DWARVES); boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // find suitable target here. @@ -614,7 +614,7 @@ public: boss->GetMotionMaster()->MoveTargetedHome(); boss->SetLootRecipient(nullptr); } - boss->setFaction(FACTION_FRIEND); + boss->SetFaction(FACTION_FRIENDLY); boss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // think this is useless if (i == 6) // doomrel needs explicit reset { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 88ed38dd4..7c5e7952a 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->SetPhaseMask(1, true); me->SetUInt32Value(UNIT_NPC_FLAGS, 1); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR); me->RemoveAura(SPELL_NEFARIANS_BARRIER); } @@ -209,7 +209,7 @@ public: Talk(SAY_GAMESBEGIN_2); - me->setFaction(103); + me->SetFaction(FACTION_DRAGONFLIGHT_BLACK); me->SetUInt32Value(UNIT_NPC_FLAGS, 0); DoCast(me, SPELL_NEFARIANS_BARRIER); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -345,7 +345,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 20351a0ce..5619d1dec 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -89,7 +89,7 @@ public: HasYelled = false; me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -182,7 +182,7 @@ public: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; case EVENT_SPEECH_7: - me->setFaction(103); + me->SetFaction(FACTION_DRAGONFLIGHT_BLACK); if (PlayerGUID && ObjectAccessor::GetUnit(*me, PlayerGUID)) AttackStart(ObjectAccessor::GetUnit(*me, PlayerGUID)); 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 6c8ab795f..2b6eb4229 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -106,7 +106,7 @@ public: if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f)) { me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); EnterEvadeMode(); Talk(SAY_DEFEAT); _JustDied(); @@ -184,7 +184,7 @@ public: } else if (action == ACTION_START_RAGNAROS_ALT) { - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, 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 584071552..2e7055318 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -177,7 +177,7 @@ public: { //Become unbanished again me->SetReactState(REACT_AGGRESSIVE); - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); @@ -246,7 +246,7 @@ public: DoResetThreat(); me->SetReactState(REACT_PASSIVE); me->InterruptNonMeleeSpells(false); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 0aea193d7..f4f16dfb1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -314,7 +314,7 @@ public: if (infernal) { infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); - infernal->setFaction(me->getFaction()); + infernal->SetFaction(me->GetFaction()); infernals.push_back(infernal->GetGUID()); infernal->SetControlled(true, UNIT_STATE_ROOT); RELAY->AI()->DoCast(infernal, SPELL_INFERNAL_RELAY); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_servant_quarters.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_servant_quarters.cpp index daa947bd2..ccb3b36c3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_servant_quarters.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_servant_quarters.cpp @@ -62,7 +62,7 @@ public: events.Reset(); me->SetVisible(false); me->SetReactState(REACT_PASSIVE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); _events2.Reset(); _events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000); if (me->GetEntry() == NPC_HYAKISS_THE_LURKER) 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 90650e733..ee9c43c30 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -390,7 +390,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; @@ -419,7 +419,7 @@ public: DoStartNoMovement(target); ElementalOne->SetInCombatWithZone(); ElementalOne->CombatStart(target); - ElementalOne->setFaction(me->getFaction()); + ElementalOne->SetFaction(me->GetFaction()); ElementalOne->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalOne->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); } @@ -433,7 +433,7 @@ public: DoStartNoMovement(target); ElementalTwo->SetInCombatWithZone(); ElementalTwo->CombatStart(target); - ElementalTwo->setFaction(me->getFaction()); + ElementalTwo->SetFaction(me->GetFaction()); ElementalTwo->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalTwo->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); } @@ -447,7 +447,7 @@ public: DoStartNoMovement(target); ElementalThree->SetInCombatWithZone(); ElementalThree->CombatStart(target); - ElementalThree->setFaction(me->getFaction()); + ElementalThree->SetFaction(me->GetFaction()); ElementalThree->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalThree->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); } @@ -461,7 +461,7 @@ public: DoStartNoMovement(target); ElementalFour->SetInCombatWithZone(); ElementalFour->CombatStart(target); - ElementalFour->setFaction(me->getFaction()); + ElementalFour->SetFaction(me->GetFaction()); ElementalFour->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalFour->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); } @@ -476,7 +476,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 ed7f6c586..aa2900ebd 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1384,7 +1384,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff) { Talk(SAY_JULIANNE_AGGRO); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(16); + me->SetFaction(FACTION_MONSTER_2); AggroYellTimer = 0; } else @@ -1416,7 +1416,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff) CAST_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO; DoZoneInCombat(pRomulo); - pRomulo->setFaction(16); + pRomulo->SetFaction(FACTION_MONSTER_2); } SummonedRomulo = true; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 300119d81..474107318 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -173,7 +173,6 @@ enum deathsChallenge SAY_DUEL = 0, QUEST_DEATH_CHALLENGE = 12733, - FACTION_HOSTILE = 2068, DATA_IN_PROGRESS = 0, @@ -337,7 +336,7 @@ public: Talk(SAY_DUEL + 4, ObjectAccessor::GetPlayer(*me, _duelGUID)); break; case EVENT_SPEAK+5: - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_UNDEAD_SCOURGE_2); if (Player* player = ObjectAccessor::GetPlayer(*me, _duelGUID)) AttackStart(player); return; @@ -723,7 +722,7 @@ public: anchorGUID.Clear(); phase = PHASE_CHAINED; events.Reset(); - me->setFaction(7); + me->SetFaction(FACTION_CREATURE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); me->LoadEquipment(0, true); @@ -825,7 +824,7 @@ public: wait_timer -= diff; else { - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); phase = PHASE_ATTACKING; @@ -947,7 +946,7 @@ public: npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature) { me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. } @@ -970,7 +969,7 @@ public: me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); } } @@ -1080,7 +1079,7 @@ public: me->SetFacingToObject(car); // xinef: add some flags car->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - car->setFaction(35); + car->SetFaction(FACTION_FRIENDLY); } Talk(SAY_SCARLET_MINER_0); SetRun(true); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 0b0bfb437..d444a14b7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -86,7 +86,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 f3098a1e4..bd27b6cf5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1054,7 +1054,7 @@ public: float o = me->GetAngle(tirion); tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * sin(o), me->GetPositionZ(), false); tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - tirion->setFaction(35); + tirion->SetFaction(FACTION_FRIENDLY); } break; case EVENT_OUTRO_SCENE_48: diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 465c2b9b5..35e3b273f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -36,7 +36,6 @@ enum AshbringerEventMisc NPC_FAIRBANKS = 4542, NPC_COMMANDER_MOGRAINE = 3976, NPC_INQUISITOR_WHITEMANE = 3977, - FACTION_FRIENDLY_TO_ALL = 35, DOOR_HIGH_INQUISITOR_ID = 104600, }; @@ -86,8 +85,7 @@ public: player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); if (!ScarletList.empty()) - for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) - (*itr)->setFaction(FACTION_FRIENDLY_TO_ALL); + for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY); } } @@ -108,8 +106,7 @@ public: player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); if (!ScarletList.empty()) - for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) - (*itr)->setFaction(FACTION_FRIENDLY_TO_ALL); + for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY); } } @@ -221,7 +218,7 @@ public: if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) { Talk(SAY_WELCOME); - me->setFaction(FACTION_FRIENDLY_TO_ALL); + me->SetFaction(FACTION_FRIENDLY); me->SetSheath(SHEATH_STATE_UNARMED); me->SetFacingToObject(player); me->SetStandState(UNIT_STAND_STATE_KNEEL); @@ -318,7 +315,7 @@ public: return 10 * IN_MILLISECONDS; case 4: me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine"); - me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f)->setFaction(FACTION_FRIENDLY_TO_ALL); + me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f)->SetFaction(FACTION_FRIENDLY); return 30 * IN_MILLISECONDS; case 5: mograine->StopMovingOnCurrentPos(); @@ -381,7 +378,7 @@ public: if (Player* player = who->ToPlayer()) if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) { - me->setFaction(FACTION_FRIENDLY_TO_ALL); + me->SetFaction(FACTION_FRIENDLY); me->SetSheath(SHEATH_STATE_UNARMED); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->SetFacingToObject(player); @@ -783,7 +780,7 @@ public: if (Player* player = who->ToPlayer()) if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) { - me->setFaction(FACTION_FRIENDLY_TO_ALL); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetSheath(SHEATH_STATE_UNARMED); me->CastSpell(me, 57767, true); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 2792f41cb..bdb480a3a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -243,12 +243,12 @@ public: if (instance->GetData(DATA_MINI_BOSSES) != 6) { me->SetVisible(false); - me->setFaction(35); + me->SetFaction(35); } else { me->SetVisible(true); - me->setFaction(21); + me->SetFaction(21); } OpenAllGates(); summons.DespawnAll(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 6135fbb68..184dd4e1e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -371,7 +371,7 @@ public: break; case EVENT_MAD_20: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BRUTALLUS))) { brutallus->AI()->Talk(YELL_INTRO_TAUNT); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 082631784..904eb761d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -241,7 +241,7 @@ public: me->SetReactState(REACT_PASSIVE); me->CombatStop(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); events2.ScheduleEvent(EVENT_TALK_GOOD_2, 1000); break; case EVENT_TALK_GOOD_2: diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 853148126..bb2ce7a1b 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it @@ -186,7 +186,7 @@ public: y = 1380.0f + rand() % 60; if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000)) { - trigger->setFaction(35); + trigger->SetFaction(FACTION_FRIENDLY); trigger->SetMaxHealth(100000); trigger->SetHealth(100000); trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -281,7 +281,7 @@ public: Cloud->SetDisableGravity(true); Cloud->StopMoving(); Cloud->SetObjectScale(1.0f); - Cloud->setFaction(35); + Cloud->SetFaction(FACTION_FRIENDLY); Cloud->SetMaxHealth(9999999); Cloud->SetHealth(9999999); Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 10020487b..baa08fb68 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -174,7 +174,7 @@ public: if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->setFaction(14); + pLorKhan->SetFaction(FACTION_MONSTER); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->SetFullHealth(); instance->SetData(DATA_LORKHAN, DONE); @@ -187,7 +187,7 @@ public: if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->setFaction(14); + pZath->SetFaction(FACTION_MONSTER); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->SetFullHealth(); instance->SetBossState(DATA_ZATH, DONE); @@ -361,7 +361,7 @@ public: { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); + pThekal->SetFaction(FACTION_MONSTER); pThekal->SetFullHealth(); } } @@ -373,7 +373,7 @@ public: { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->setFaction(14); + pZath->SetFaction(FACTION_MONSTER); pZath->SetFullHealth(); } } @@ -389,7 +389,7 @@ public: me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->AttackStop(); instance->SetBossState(DATA_LORKHAN, SPECIAL); @@ -514,7 +514,7 @@ public: { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->setFaction(14); + pLorKhan->SetFaction(FACTION_MONSTER); pLorKhan->SetFullHealth(); } } @@ -526,7 +526,7 @@ public: { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); + pThekal->SetFaction(FACTION_MONSTER); pThekal->SetFullHealth(); } } @@ -542,7 +542,7 @@ public: me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->AttackStop(); instance->SetBossState(DATA_ZATH, SPECIAL); diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index d7687e32f..39ae94684 100644 --- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -51,8 +51,7 @@ enum ProfessorPhizzlethorpe // Quests QUEST_SUNKEN_TREASURE = 665, // Creatures - NPC_VENGEFUL_SURGE = 2776, - FACTION_SUNKEN_TREASURE = 113 + NPC_VENGEFUL_SURGE = 2776 }; class npc_professor_phizzlethorpe : public CreatureScript @@ -119,7 +118,7 @@ public: { 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_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index cf4715343..5fed80825 100644 --- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -38,8 +38,7 @@ enum TwilightCorrupter SPELL_LEVEL_UP = 24312, EVENT_SOUL_CORRUPTION = 1, - EVENT_CREATURE_OF_NIGHTMARE = 2, - FACTION_HOSTILE = 14 + EVENT_CREATURE_OF_NIGHTMARE = 2 }; /*###### @@ -83,7 +82,7 @@ public: { _introSpoken = true; Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, who); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER); } ScriptedAI::MoveInLineOfSight(who); } diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index f7f5a2e17..589f05f07 100644 --- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -72,7 +72,7 @@ public: { if (quest->GetQuestId() == QUEST_BALANCE_OF_LIGHT_AND_SHADOW) { - creature->AI()->SetData(player->getFaction(), 0); + creature->AI()->SetData(player->GetFaction(), 0); creature->AI()->SetGUID(player->GetGUID()); } @@ -160,7 +160,7 @@ public: summons.Summon(creature); if (creature->GetEntry() == NPC_INJURED_PEASANT || creature->GetEntry() == NPC_PLAGUED_PEASANT) { - creature->setFaction(_faction); + creature->SetFaction(_faction); if (!_spoken) { _spoken = true; diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index 5ac8b82c5..0a8660e6e 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -49,8 +49,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 @@ -130,7 +129,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { - creature->setFaction(FACTION_QUEST_ESCAPE); + creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); 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_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index 7676f81da..eb709e6c6 100644 --- a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -63,7 +63,7 @@ public: Talk(SAY_CORPORAL_1, player); npc_escortAI::Start(true, false, player->GetGUID(), quest); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); - me->setFaction(250); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } } diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 8e8fb70e4..6582b7b3f 100644 --- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -240,7 +240,7 @@ public: if (!target) target = me; - summoned->setFaction(123); + summoned->SetFaction(FACTION_STORMWIND); summoned->AddThreat(target, 32.0f); summoned->AI()->AttackStart(target); } diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index d05ade766..53a60cfde 100644 --- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -43,7 +43,6 @@ EndContentData */ enum Bartleby { - FACTION_ENEMY = 168, QUEST_BEAT = 1640 }; @@ -56,7 +55,7 @@ public: { if (quest->GetQuestId() == QUEST_BEAT) { - creature->setFaction(FACTION_ENEMY); + creature->SetFaction(FACTION_ENEMY); creature->AI()->AttackStart(player); } return true; @@ -71,15 +70,15 @@ public: { npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormalFaction = creature->getFaction(); + m_uiNormalFaction = creature->GetFaction(); } uint32 m_uiNormalFaction; void Reset() override { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); + if (me->GetFaction() != m_uiNormalFaction) + me->SetFaction(m_uiNormalFaction); } void AttackedBy(Unit* pAttacker) override @@ -259,8 +258,8 @@ public: if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) pTyrion->AI()->Talk(SAY_TYRION_2); if (Creature* pMarzon = ObjectAccessor::GetCreature(*me, MarzonGUID)) - pMarzon->setFaction(14); - me->setFaction(14); + pMarzon->SetFaction(FACTION_MONSTER); + me->SetFaction(FACTION_MONSTER); uiTimer = 0; uiPhase = 0; break; diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index c351f2bf9..4e829879a 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -73,7 +73,7 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); me->CombatStop(); //stop combat me->DeleteThreatList(); //unsure of this - me->setFaction(83); //horde generic + me->SetFaction(FACTION_HORDE_GENERIC); bReset = true; Reset_Timer = 60000; @@ -91,7 +91,7 @@ public: { EnterEvadeMode(); bReset = false; - me->setFaction(28); //troll, bloodscalp + me->SetFaction(FACTION_TROLL_BLOODSCALP); return; } diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp index 3cb744bb3..96e75c55f 100644 --- a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp @@ -40,8 +40,7 @@ enum Calvin { SAY_COMPLETE = 0, SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) - QUEST_590 = 590, - FACTION_HOSTILE = 168 + QUEST_590 = 590 }; class npc_calvin_montague : public CreatureScript @@ -53,7 +52,7 @@ public: { if (quest->GetQuestId() == QUEST_590) { - creature->setFaction(FACTION_HOSTILE); + creature->SetFaction(FACTION_ENEMY); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); } diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 162b92e39..4451c74d9 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -354,12 +354,6 @@ public: } }; -enum Factions -{ - FACTION_HOSTILE = 14, - FACTION_FRIENDLY_TO_ALL = 35 -}; - /*###### ## ALLIANCE #######*/ @@ -1616,7 +1610,7 @@ public: { jaina->GetMotionMaster()->MoveFollow(me, 5, PET_FOLLOW_ANGLE); jaina->SetReactState(REACT_AGGRESSIVE); - jaina->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + jaina->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); } bStepping = false; JumpToNextStep(0); @@ -2464,7 +2458,7 @@ public: summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true); summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SYLVANAS_BUFF, true); if (!EnableAttack) - summoned->setFaction(FACTION_FRIENDLY_TO_ALL); + summoned->SetFaction(FACTION_FRIENDLY); summoned->AddThreat(me, 100.0f); me->AddThreat(summoned, 100.0f); summoned->AI()->AttackStart(me); @@ -2568,7 +2562,7 @@ public: sylvanas->GetMotionMaster()->Clear(); sylvanas->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); sylvanas->SetReactState(REACT_AGGRESSIVE); - sylvanas->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + sylvanas->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); sylvanas->GetMotionMaster()->MoveFollow(me, 1, M_PI * 0.1f); } } @@ -3141,8 +3135,7 @@ public: me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_DOCTOR_H, 1000.0f); me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_CHEMIST_H, 1000.0f); if (!HostileEndList.empty()) - for (std::list::iterator itr = HostileEndList.begin(); itr != HostileEndList.end(); itr++) - (*itr)->setFaction(FACTION_HOSTILE); + for (std::list::iterator itr = HostileEndList.begin(); itr != HostileEndList.end(); itr++) (*itr)->SetFaction(FACTION_MONSTER); SpawnWave(4); JumpToNextStep(10 * IN_MILLISECONDS); break; diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 17cbdd3eb..fd3bc9913 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, @@ -76,7 +75,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/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 6eb0e6a7d..db3147936 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -1545,7 +1545,6 @@ enum BrewfestRevelerEnum { FACTION_ALLIANCE = 1934, FACTION_HORDE = 1935, - FACTION_FRIENDLY = 35, SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_MALE = 44003, SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_FEMALE = 44004, @@ -1585,7 +1584,7 @@ public: break; } - GetTarget()->setFaction(factionId); + GetTarget()->SetFaction(factionId); } void Register() override @@ -1714,7 +1713,6 @@ enum DirebrewMisc GOSSIP_OPTION_APOLOGIZE = 1, DATA_TARGET_GUID = 1, MAX_ANTAGONISTS = 3, - FACTION_GOBLIN_DARK_IRON_BAR_PATRON = 736, DATA_COREN = 33, GO_MACHINE_SUMMONER = 188508 }; @@ -1769,7 +1767,7 @@ public: _events.Reset(); _summons.DespawnAll(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); _events.SetPhase(PHASE_ALL); for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i) @@ -1808,7 +1806,7 @@ public: { _events.SetPhase(PHASE_ONE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoZoneInCombat(); EntryCheckPredicate pred(NPC_ANTAGONIST); @@ -2032,7 +2030,7 @@ public: void Reset() override { - me->setFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoZoneInCombat(); } @@ -2075,7 +2073,7 @@ public: break; case ACTION_ANTAGONIST_HOSTILE: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->setFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); + me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); DoZoneInCombat(); break; default: diff --git a/src/server/scripts/Events/love_in_air.cpp b/src/server/scripts/Events/love_in_air.cpp index 18d1d51dd..7483d2b7a 100644 --- a/src/server/scripts/Events/love_in_air.cpp +++ b/src/server/scripts/Events/love_in_air.cpp @@ -359,7 +359,7 @@ public: void Reset() override { speachTimer = 0; - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); summons.DespawnAll(); events.Reset(); me->SummonCreature(NPC_APOTHECARY_FRYE, -205.449f, 2219.56f, 79.7633f, 0.7f); @@ -383,7 +383,7 @@ public: void JustSummoned(Creature* cr) override { summons.Summon(cr); - cr->setFaction(35); + cr->SetFaction(FACTION_FRIENDLY); cr->SetControlled(true, UNIT_STATE_STUNNED); cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -407,7 +407,7 @@ public: { me->AI()->Talk(SAY_HUMMEL_2); speachTimer = 0; - me->setFaction(16); + me->SetFaction(FACTION_MONSTER_2); me->SetInCombatWithZone(); if (Unit* target = SelectTargetFromPlayerList(40.0f)) { @@ -513,7 +513,7 @@ public: { me->SetControlled(false, UNIT_STATE_STUNNED); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(16); + me->SetFaction(FACTION_MONSTER_2); me->SetInCombatWithZone(); if (Unit* target = SelectTargetFromPlayerList(40.0f)) AttackStart(target); diff --git a/src/server/scripts/Events/midsummer.cpp b/src/server/scripts/Events/midsummer.cpp index d6b2ef27c..31f180a77 100644 --- a/src/server/scripts/Events/midsummer.cpp +++ b/src/server/scripts/Events/midsummer.cpp @@ -240,7 +240,7 @@ public: if (Unit* caster = GetCaster()) { caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true); - caster->setFaction(88); + caster->SetFaction(FACTION_BLACKFATHOM); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 0fe56dc69..068d7c688 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -464,7 +464,7 @@ public: summoned->AI()->AttackStart(me); else { - summoned->setFaction(me->getFaction()); + summoned->SetFaction(me->GetFaction()); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -553,15 +553,15 @@ public: if (!me->IsInCombat()) { // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. - if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35))) + if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->GetFaction() != FACTION_FRIENDLY))) { me->SetVisible(false); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); } - if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35))) + if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->GetFaction() == FACTION_FRIENDLY))) { - me->setFaction(1720); + me->SetFaction(FACTION_DRAGONKIN); me->SetVisible(true); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 9e03197bc..e7d4c2c73 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -910,7 +910,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(FACTION_FRIENDLY); // make them friendly so mobs won't attack them } } } @@ -988,7 +988,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)->SetFlag(UNIT_FIELD_FLAGS, 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 941b22e7d..bbe5c799b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -471,7 +471,7 @@ public: if (trigger) { 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/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index ac68c944d..fc8a172ff 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -45,8 +45,6 @@ enum Belnistrasz EVENT_FIREBALL = 5, EVENT_FROST_NOVA = 6, - FACTION_ESCORT = 250, - PATH_ESCORT = 871710, POINT_REACH_IDOL = 17, @@ -122,7 +120,7 @@ public: eventInProgress = true; Talk(SAY_QUEST_ACCEPTED); me->RemoveFlag(UNIT_NPC_FLAGS, 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/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index d51ce3665..0b640a0ec 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -105,7 +105,7 @@ public: //Cast me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); DoCast(me, SPELL_DIRTMOUND_PASSIVE); Submerged = true; @@ -129,7 +129,7 @@ public: if (Submerged && Back_Timer <= diff) { me->RemoveFlag(UNIT_FIELD_FLAGS, 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 68877fb9f..a6553b321 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -319,7 +319,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)) @@ -414,7 +414,7 @@ public: void CastSpellOnBug(Creature* target) override { - target->setFaction(14); + target->SetFaction(FACTION_MONSTER); target->AI()->AttackStart(me->getThreatMgr().getHostilTarget()); target->AddAura(SPELL_MUTATE_BUG, target); target->SetFullHealth(); @@ -503,7 +503,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/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 6ee73ff37..b55ed9fd1 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -65,7 +65,7 @@ public: void InitializeAI() override { startedFight = false; - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); postGossipStep = 0; Text_Timer = 0; me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -125,7 +125,7 @@ public: Text_Timer = 5000; break; case 3: - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID); switchFactionIfAlive(NPC_RAVEN, target); @@ -186,7 +186,7 @@ public: { if (crew->IsAlive()) { - crew->setFaction(14); + crew->SetFaction(FACTION_MONSTER); if (target) { @@ -279,7 +279,7 @@ public: crew->SetWalk(true); crew->SetHomePosition(x, y, z, 4.78f); crew->GetMotionMaster()->MovePoint(1, { x, y, z, 4.78f }); - crew->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + crew->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); switch (entry) { @@ -470,7 +470,7 @@ public: { if (me->IsAlive()) { - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetWalk(false); me->GetMotionMaster()->MovePoint(0, { 1858.57f, 1146.35f, 14.745f, 3.85f }); me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f); diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index e7fb6d2b3..8158aeee3 100644 --- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -29,7 +29,6 @@ EndScriptData */ enum Muglash { - FACTION_QUEST = 113, SAY_MUG_START1 = 0, SAY_MUG_START2 = 1, SAY_MUG_BRAZIER = 2, @@ -117,7 +116,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_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index ec31a3139..d433e243b 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -356,7 +356,7 @@ public: { Talk(SAY_RIZZLE_FINAL); me->SetUInt32Value(UNIT_NPC_FLAGS, 1); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->MoveIdle(); me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); Reached = true; diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index cc8f81cf9..764d88645 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -228,8 +228,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 @@ -297,7 +296,7 @@ public: { Talk(SAY_START, player); } - me->setFaction(FACTION_QUEST); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); _events.ScheduleEvent(EVENT_START_ESCORT, 1000); break; case EVENT_START_ESCORT: diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index 0004e7f9d..d5d4a9fd8 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -176,8 +176,7 @@ enum Kerlonian SPELL_SLEEP_VISUAL = 25148, SPELL_AWAKEN = 17536, QUEST_SLEEPER_AWAKENED = 5321, - NPC_LILADRIS = 11219, //attackers entries unknown - FACTION_KER_ESCORTEE = 113 + NPC_LILADRIS = 11219 //attackers entries unknown }; /// @todo make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. @@ -280,7 +279,7 @@ public: { creature->SetStandState(UNIT_STAND_STATE_STAND); creature->AI()->Talk(SAY_KER_START, player); - pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); + pKerlonianAI->StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest); } } @@ -313,7 +312,6 @@ enum Remtravel SAY_REM_REMEMBER = 11, EMOTE_REM_END = 12, - FACTION_ESCORTEE = 10, QUEST_ABSENT_MINDED_PT2 = 731, NPC_GRAVEL_SCOUT = 2158, NPC_GRAVEL_BONE = 2159, @@ -412,7 +410,7 @@ public: if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID()); - creature->setFaction(FACTION_ESCORTEE); + creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE); } return true; diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index c07bedf18..d4278025a 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -73,7 +73,7 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override { if (quest->GetQuestId() == QUEST_BODYGUARD_FOR_HIRE) - creature->AI()->SetGUID(player->GetGUID(), player->getFaction()); + creature->AI()->SetGUID(player->GetGUID(), player->GetFaction()); return true; } @@ -155,7 +155,7 @@ public: { if (field == 1 && data == 1) if (Player* player = me->SelectNearestPlayer(50.0f)) - SetGUID(player->GetGUID(), player->getFaction()); + SetGUID(player->GetGUID(), player->GetFaction()); } bool CheckCaravan() @@ -256,7 +256,7 @@ public: for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i) if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i])) { - summon->setFaction(faction); + summon->SetFaction(faction); if (remove) summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); else @@ -266,7 +266,7 @@ public: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); else me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); - me->setFaction(faction); + me->SetFaction(faction); } void WaypointReached(uint32 waypointId) override diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp index 1a54c6a4d..b13e1891a 100644 --- a/src/server/scripts/Kalimdor/zone_feralas.cpp +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp @@ -204,7 +204,7 @@ public: me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + me->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); me->GetMotionMaster()->MoveFollow(player, 3.f, M_PI); _events.ScheduleEvent(EVENT_WANDERING_START, urand(40 * IN_MILLISECONDS, 70 * IN_MILLISECONDS)); diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index c394a20b2..0925a8132 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -44,9 +44,6 @@ enum EternalBoard { QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, - C_ANACHRONOS = 15381, C_FANDRAL_STAGHELM = 15382, C_ARYGOS = 15380, @@ -919,7 +916,7 @@ public: Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); - Merithra->setFaction(35); + Merithra->SetFaction(FACTION_FRIENDLY); } if (Caelestrasz) @@ -927,7 +924,7 @@ public: Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); - Caelestrasz->setFaction(35); + Caelestrasz->SetFaction(FACTION_FRIENDLY); } if (Arygos) @@ -935,7 +932,7 @@ public: Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); - Arygos->setFaction(35); + Arygos->SetFaction(FACTION_FRIENDLY); } if (Anachronos) diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 80a310e40..06c1be833 100644 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -152,7 +152,7 @@ public: pEscortAI->Start(true, false, player->GetGUID()); creature->AI()->Talk(SAY_START); - creature->setFaction(113); + creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } return true; diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 868c4dc02..46cea901e 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -75,7 +75,7 @@ public: { SendItemTimer = 0; SwitchFactionTimer = 10000; - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); isFriendly = true; AquaJetTimer = 5000; @@ -109,7 +109,7 @@ public: { if (SwitchFactionTimer <= diff) { - me->setFaction(91); + me->SetFaction(FACTION_ELEMENTAL); isFriendly = false; } else SwitchFactionTimer -= diff; diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 8be80dd34..f6d3b6b97 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -91,8 +91,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 @@ -104,7 +103,7 @@ public: { if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) { - creature->setFaction(FACTION_ESCORTEE); + creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed, possible not needed for this quest creature->SetStandState(UNIT_STAND_STATE_STAND); creature->AI()->Talk(SAY_GIL_START, player); @@ -197,7 +196,7 @@ public: { npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) { - factionNorm = creature->getFaction(); + factionNorm = creature->GetFaction(); } uint32 factionNorm; @@ -210,7 +209,7 @@ public: IsFriend = false; ResetTimer = 120000; FlareCount = 0; - me->setFaction(factionNorm); + me->SetFaction(factionNorm); } void DoFriend() @@ -222,7 +221,7 @@ public: me->StopMoving(); me->GetMotionMaster()->MoveIdle(); - me->setFaction(FACTION_FRIENDLY_F); + me->SetFaction(FACTION_FRIENDLY); me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); } @@ -263,7 +262,7 @@ public: { if (FlareCount >= 2) { - if (me->getFaction() == FACTION_FRIENDLY_F) + if (me->GetFaction() == FACTION_FRIENDLY_F) return; DoFriend(); @@ -408,7 +407,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(FACTION_FRIENDLY); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); @@ -450,7 +449,7 @@ public: creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); + creature->SetFaction(FACTION_MONSTER); creature->AI()->AttackStart(pWarrior); } ++Wave; @@ -481,7 +480,7 @@ public: creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); + creature->SetFaction(FACTION_MONSTER); creature->AI()->AttackStart(pWarrior); } WaveTimer = 2000; @@ -511,7 +510,6 @@ enum Wizzlecrank SAY_END = 6, QUEST_ESCAPE = 863, - FACTION_RATCHET = 637, NPC_PILOT_WIZZ = 3451, NPC_MERCENARY = 3282, }; @@ -644,7 +642,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_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp index bc3a5454d..620e2cf7b 100644 --- a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp @@ -50,7 +50,6 @@ enum Lakota QUEST_FREE_AT_LAST = 4904, NPC_GRIM_BANDIT = 10758, - FACTION_ESCORTEE_LAKO = 232, //guessed ID_AMBUSH_1 = 0, ID_AMBUSH_2 = 2, @@ -77,7 +76,7 @@ public: if (quest->GetQuestId() == QUEST_FREE_AT_LAST) { creature->AI()->Talk(SAY_LAKO_START, player); - creature->setFaction(FACTION_ESCORTEE_LAKO); + creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest); @@ -138,8 +137,7 @@ enum Packa SAY_COMPLETE = 2, QUEST_HOMEWARD = 4770, - NPC_WYVERN = 4107, - FACTION_ESCORTEE = 232 //guessed + NPC_WYVERN = 4107 }; Position const WyvernLoc[3] = @@ -159,7 +157,7 @@ public: if (quest->GetQuestId() == QUEST_HOMEWARD) { creature->AI()->Talk(SAY_START, player); - creature->setFaction(FACTION_ESCORTEE); + creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest); @@ -212,7 +210,6 @@ public: enum Plucky { - FACTION_FRIENDLY = 35, QUEST_SCOOP = 1950, SPELL_PLUCKY_HUMAN = 9192, SPELL_PLUCKY_CHICKEN = 9220 @@ -253,7 +250,7 @@ public: struct npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->GetFaction(); } uint32 NormFaction; uint32 ResetTimer; @@ -262,8 +259,8 @@ public: { ResetTimer = 120000; - if (me->getFaction() != NormFaction) - me->setFaction(NormFaction); + if (me->GetFaction() != NormFaction) + me->SetFaction(NormFaction); if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -277,7 +274,7 @@ public: { if (TextEmote == TEXT_EMOTE_BECKON) { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); DoCast(me, SPELL_PLUCKY_HUMAN, false); } @@ -289,7 +286,7 @@ public: return; else { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); DoCast(me, SPELL_PLUCKY_HUMAN, false); me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index d129bc83e..929a540cc 100644 --- a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -64,7 +64,7 @@ public: creature->AI()->Talk(SAY_READY, player); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); // Change faction so mobs attack - creature->setFaction(113); + creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); } return true; } @@ -164,8 +164,7 @@ enum Ringo SPELL_REVIVE_RINGO = 15591, QUEST_A_LITTLE_HELP = 4491, - NPC_SPRAGGLE = 9997, - FACTION_ESCORTEE = 113 + NPC_SPRAGGLE = 9997 }; class npc_ringo : public CreatureScript @@ -180,7 +179,7 @@ public: if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); - ringoAI->StartFollow(player, FACTION_ESCORTEE, quest); + ringoAI->StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest); } } diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index db1be90f7..ca64cc75b 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -297,7 +297,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 25542a5c8..43fc65073 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -148,11 +148,11 @@ public: if( damage >= me->GetHealth() ) { damage = me->GetHealth() - 1; - if( me->getFaction() != 35 ) + if (me->GetFaction() != FACTION_FRIENDLY) { me->CastSpell((Unit*)nullptr, 68575, true); // achievements me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, 68574, me); // paletress' spell credits encounter, but shouldn't credit achievements - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); events.Reset(); Talk(TEXT_EADRIC_DEATH); me->getThreatMgr().clearReferences(); @@ -296,10 +296,10 @@ public: { damage = me->GetHealth() - 1; - if( me->getFaction() != 35 ) + if (me->GetFaction() != FACTION_FRIENDLY) { me->CastSpell((Unit*)nullptr, 68574, true); // achievements - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); events.Reset(); Talk(TEXT_PALETRESS_DEATH); me->getThreatMgr().clearReferences(); 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 dcffdd19e..0fc43721a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -184,7 +184,7 @@ public: float dist = rand_norm() * 40.0f; if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) ) { - c->setFaction(31); + c->SetFaction(FACTION_PREY); c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); c->GetMotionMaster()->MoveRandom(15.0f); } @@ -452,7 +452,7 @@ public: me->CastSpell(me, SPELL_ACID_MANDIBLE, true); determinationTimer = urand(10000, 50000); despawnTimer = 0; - if( me->getFaction() == 16 ) // hostile - it's phase 2 + if (me->GetFaction() == FACTION_MONSTER_2) // hostile - it's phase 2 if( Unit* target = me->SelectNearestTarget(250.0f) ) { AttackStart(target); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index ce0799153..ff31e1804 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -318,7 +318,7 @@ public: { trigger->SetDisplayId(11686); trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - trigger->setFaction(14); + trigger->SetFaction(FACTION_MONSTER); trigger->SetInCombatWithZone(); } @@ -340,7 +340,7 @@ public: { trigger->SetDisplayId(11686); trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - trigger->setFaction(14); + trigger->SetFaction(FACTION_MONSTER); trigger->SetInCombatWithZone(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index be1c5b8cd..380b2caa7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -514,7 +514,7 @@ public: if (darnavan->IsAlive()) { darnavan->RemoveAllAuras(); - darnavan->setFaction(35); + darnavan->SetFaction(FACTION_FRIENDLY); darnavan->DeleteThreatList(); darnavan->CombatStop(true); darnavan->GetMotionMaster()->MoveIdle(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 92db2ccb7..f08033ee8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -211,7 +211,7 @@ public: sizeTimer = 0; auraVisualTimer = 1; me->SetFloatValue(UNIT_FIELD_COMBATREACH, 2.0f); - me->setFaction(21); + me->SetFaction(FACTION_BOOTY_BAY); } void KilledUnit(Unit* who) override diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index d8e9ed844..4890baa35 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -698,7 +698,7 @@ public: case EVENT_DESTROY_PLATFORM_0: if (Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER_LAOI, CenterPos, TEMPSUMMON_TIMED_DESPAWN, 3000)) { - c->setFaction(me->getFaction()); + c->SetFaction(me->GetFaction()); c->CastSpell(c, SPELL_DESTROY_PLATFORM_VISUAL, true); c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false); } @@ -726,7 +726,7 @@ public: if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0)) { - c->setFaction(pPlayer->getFaction()); + c->SetFaction(pPlayer->GetFaction()); //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true); c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500)); AttackStart(c); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index 2e65c94f3..74f6b7ff2 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -87,7 +87,7 @@ public: if (Creature* c = pPlayer->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0)) { c->SetCanFly(true); - c->setFaction(pPlayer->getFaction()); + c->SetFaction(pPlayer->GetFaction()); //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true); c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500)); } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index 0695ea805..fe9d73447 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -58,27 +58,27 @@ public: switch (creature->GetEntry()) { case NPC_ALLIANCE_RANGER: - creature->setFaction(16); + creature->SetFaction(FACTION_MONSTER_2); if (TeamIdInInstance == TEAM_ALLIANCE) creature->UpdateEntry(NPC_HORDE_RANGER); break; case NPC_ALLIANCE_BERSERKER: - creature->setFaction(16); + creature->SetFaction(FACTION_MONSTER_2); if (TeamIdInInstance == TEAM_ALLIANCE) creature->UpdateEntry(NPC_HORDE_BERSERKER); break; case NPC_ALLIANCE_COMMANDER: - creature->setFaction(16); + creature->SetFaction(FACTION_MONSTER_2); if (TeamIdInInstance == TEAM_ALLIANCE) creature->UpdateEntry(NPC_HORDE_COMMANDER); break; case NPC_ALLIANCE_CLERIC: - creature->setFaction(16); + creature->SetFaction(FACTION_MONSTER_2); if (TeamIdInInstance == TEAM_ALLIANCE) creature->UpdateEntry(NPC_HORDE_CLERIC); break; case NPC_COMMANDER_STOUTBEARD: - creature->setFaction(16); + creature->SetFaction(FACTION_MONSTER_2); if (TeamIdInInstance == TEAM_ALLIANCE) creature->UpdateEntry(NPC_COMMANDER_KOLURG); break; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index e9d54cd1b..f1fac2841 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -203,7 +203,7 @@ public: summons.Summon(summon); if (summon->GetEntry() == NPC_MOLTEN_GOLEM) { - summon->setFaction(me->getFaction()); + summon->SetFaction(me->GetFaction()); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) summon->AI()->AttackStart(target); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 4637f0d6a..f1f6d2007 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -360,7 +360,7 @@ public: if (Creature* dwarf = me->SummonCreature(NPC_DWARFES_FRIENDLY, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY(), RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) { if (Player* plr = SelectTargetFromPlayerList(100.0f)) - dwarf->setFaction(plr->getFaction()); + dwarf->SetFaction(plr->GetFaction()); ActivatePipe(Pos); dwarf->AI()->AttackStart(me); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index 5003a5843..9e8a92d81 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -314,7 +314,7 @@ public: SetDespawnAtEnd(false); ResetEvent(); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetReactState(REACT_PASSIVE); me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); @@ -341,7 +341,7 @@ public: if (!PlayerList.isEmpty()) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { - me->setFaction(i->GetSource()->getFaction()); + me->SetFaction(i->GetSource()->GetFaction()); break; } @@ -356,7 +356,7 @@ public: me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); break; case ACTION_START_SJONNIR_FIGHT: - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->Yell("Don't worry! Ol' Brann's got yer back! Keep that metal monstrosity busy, and I'll see if I can't sweet talk this machine into helping ye!", LANG_UNIVERSAL); me->PlayDirectSound(14274); SetEscortPaused(false); 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 33e7782ff..ec337429a 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 @@ -379,7 +379,7 @@ public: me->SetReactState(REACT_PASSIVE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetSheath(SHEATH_STATE_UNARMED); - me->setFaction(190); + me->SetFaction(190); me->CastSpell(me, SPELL_DUAL_WIELD, true); _phaseTwo = false; @@ -437,7 +437,7 @@ public: me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->InterruptNonMeleeSpells(false); if (m_pInstance) @@ -602,7 +602,7 @@ public: damage = 0; me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); events.Reset(); summons.DespawnAll(); @@ -666,7 +666,7 @@ public: me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true); // Hack: _IsValidTarget failed earlier due to flags, call AttackStart again me->SetReactState(REACT_AGGRESSIVE); - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); if (Player* target = SelectTargetFromPlayerList(150.0f)) AttackStart(target); me->SetInCombatWithZone(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index f0ff23808..58c1fe3a8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -344,7 +344,7 @@ public: damage = 0; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetHealth(me->GetMaxHealth()); me->CombatStop(); me->RemoveAllAuras(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index f4529272e..8a62c0296 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -347,7 +347,7 @@ public: } me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->Clear(); me->AttackStop(); me->CombatStop(); @@ -522,7 +522,7 @@ public: if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2) ) { - h_p->setFaction(1665); + h_p->SetFaction(1665); if( cnt < 8 ) Helpers[cnt++] = h_p->GetGUID(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index fd1db86e0..d386a78d4 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -570,7 +570,7 @@ public: { _encounterFinished = true; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); me->SetHealth(me->GetMaxHealth()); me->CombatStop(); me->RemoveAllAuras(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp index 3a0a23b10..864fcab10 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp @@ -267,7 +267,7 @@ public: void PassengerBoarded(Unit* p, int8 /*seat*/, bool /*apply*/) override { - me->setFaction(p->getFaction()); + me->SetFaction(p->GetFaction()); me->SetReactState(REACT_PASSIVE); } @@ -282,7 +282,7 @@ public: me->CombatStop(true); me->SetReactState(REACT_PASSIVE); me->SetRegeneratingHealth(false); - me->setFaction(31); + me->SetFaction(FACTION_PREY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); me->CastSpell(me, 64770, true); } @@ -290,13 +290,13 @@ public: void AttackStart(Unit* who) override { - if (me->getFaction() == 16) + if (me->GetFaction() == FACTION_MONSTER_2) ScriptedAI::AttackStart(who); } void EnterEvadeMode() override { - if (me->getFaction() == 16) + if (me->GetFaction() == FACTION_MONSTER_2) ScriptedAI::EnterEvadeMode(); } @@ -304,7 +304,7 @@ public: void UpdateAI(uint32 diff) override { - if (me->getFaction() != 16) + if (me->GetFaction() != FACTION_MONSTER_2) { if (me->IsAlive() && (me->GetExactDist2dSq(2058.0f, 42.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2203.0f, 292.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2125.0f, 170.0f) > 160.0f * 160.0f)) Unit::Kill(me, me, false); diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index ca17a8063..6121f8b5b 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -45,7 +45,7 @@ public: { if (me->GetEntry() == NPC_KEEP_CANNON) { - faction = me->getFaction(); + faction = me->GetFaction(); me->Respawn(); me->UpdateEntry(NPC_BROKEN_KEEP_CANNON, nullptr, false); me->RemoveVehicleKit(); @@ -59,7 +59,7 @@ public: { me->UpdateEntry(NPC_KEEP_CANNON, nullptr, false); if (faction) - me->setFaction(faction); + me->SetFaction(faction); me->CreateVehicleKit(510, NPC_KEEP_CANNON); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); events.ScheduleEvent(EVENT_RESTORE_FLAG, 4000); diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 32f32b871..2443dd9fb 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -80,7 +80,7 @@ public: owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, M_PI, MOTION_SLOT_ACTIVE); owner->CastSpell(owner, SPELL_SUBDUED, true); GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); - owner->setFaction(35); + owner->SetFaction(FACTION_FRIENDLY); owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); } @@ -375,12 +375,7 @@ public: enum Lurgglbr { QUEST_ESCAPE_WINTERFIN_CAVERNS = 11570, - GO_CAGE = 187369, - - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775, - SAY_START_1 = 0, SAY_START_2 = 1, SAY_END_1 = 2, @@ -497,7 +492,7 @@ public: if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); - creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H); + creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); return true; } return false; @@ -855,7 +850,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPING_THE_MIST) { - creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H); + creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetStandState(UNIT_STAND_STATE_STAND); creature->AI()->Talk(SAY_1, player); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); @@ -1173,8 +1168,7 @@ enum HiddenCultist SAY_HIDDEN_CULTIST_4 = 3, EVENT_CULTIST_SCRIPT_1 = 1, EVENT_CULTIST_SCRIPT_2 = 2, - EVENT_CULTIST_SCRIPT_3 = 3, - FACTION_MONSTER = 14 + EVENT_CULTIST_SCRIPT_3 = 3 }; class npc_hidden_cultist : public CreatureScript @@ -1227,7 +1221,7 @@ public: void AttackPlayer() { - me->setFaction(FACTION_MONSTER); + me->SetFaction(FACTION_MONSTER); if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) { AttackStart(player); @@ -1465,9 +1459,6 @@ enum Thassarian EVENT_THASSARIAN_SCRIPT_28 = 28, EVENT_THASSARIAN_SCRIPT_29 = 29, EVENT_THASSARIAN_CAST = 30, - FACTION_UNDEAD_SCOURGE = 974, - FACTION_VALIANCE_EXPEDITION_7 = 1974, - FACTION_UNDEAD_SCOURGE_9 = 1988, NPC_IMAGE_LICH_KING = 26203, NPC_COUNSELOR_TALBOT = 25301, NPC_PRINCE_VALANAR = 28189, @@ -1569,7 +1560,7 @@ public: void Reset() override { - me->setFaction(FACTION_VALIANCE_EXPEDITION_7); + me->SetFaction(FACTION_VALIANCE_EXPEDITION_7); me->SetStandState(UNIT_STAND_STATE_STAND); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); @@ -1662,7 +1653,7 @@ public: talbot->CastSpell(talbot, SPELL_TRANSFORM_VALANAR); talbot->UpdateEntry(NPC_PRINCE_VALANAR); talbot->SetFullHealth(); - talbot->setFaction(FACTION_UNDEAD_SCOURGE); + talbot->SetFaction(FACTION_UNDEAD_SCOURGE); talbot->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); talbot->SetReactState(REACT_PASSIVE); talbot->SetStandState(UNIT_STAND_STATE_KNEEL); @@ -1785,7 +1776,7 @@ public: if (Creature* talbot = ObjectAccessor::GetCreature(*me, _talbotGUID)) { talbot->AI()->Talk(SAY_TALBOT_4); - talbot->setFaction(FACTION_UNDEAD_SCOURGE_9); + talbot->SetFaction(FACTION_UNDEAD_SCOURGE_9); talbot->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); talbot->SetReactState(REACT_AGGRESSIVE); talbot->Attack(me, false); diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 80aa515b1..6e2c8c39d 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -330,7 +330,7 @@ public: { futureGUID = cr->GetGUID(); summoner->CastSpell(cr, SPELL_CLONE_CASTER, true); - cr->setFaction(summoner->getFaction()); + cr->SetFaction(summoner->GetFaction()); cr->SetReactState(REACT_AGGRESSIVE); } } @@ -490,7 +490,7 @@ public: void Reset() override { if (me->ToTempSummon() && me->ToTempSummon()->GetSummonerUnit()) - me->setFaction(me->ToTempSummon()->GetSummonerUnit()->getFaction()); + me->SetFaction(me->ToTempSummon()->GetSummonerUnit()->GetFaction()); } void MoveInLineOfSight(Unit* who) override @@ -1768,9 +1768,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 @@ -1803,7 +1801,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_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 4f9cd9b59..17cd6656a 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -130,7 +130,7 @@ public: case 4: me->Whisper("NOOOOOOOoooooooooo!", LANG_UNIVERSAL, summoner->ToPlayer()); me->SetLevel(summoner->getLevel()); - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); if (me->GetExactDist(summoner) < 50.0f) { me->UpdatePosition(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ(), 0.0f, true); @@ -154,8 +154,6 @@ public: enum Entries { NPC_APOTHECARY_HANES = 23784, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775, NPC_HANES_FIRE_TRIGGER = 23968, QUEST_TRAIL_OF_FIRE = 11241, SPELL_COSMETIC_LOW_POLY_FIRE = 56274, @@ -171,7 +169,7 @@ public: { if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) { - creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H); + creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); } return true; diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 05211fb49..d4ab7ebf9 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -1304,7 +1304,7 @@ public: me->SetCanFly(true); me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->SetSpeed(MOVE_FLIGHT, 0.1f); - me->setFaction(summoner->getFaction()); + me->SetFaction(summoner->GetFaction()); } void DamageTaken(Unit* who, uint32&, DamageEffectType, SpellSchoolMask) override diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index e078eb4da..6344208c1 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -136,13 +136,13 @@ public: { summons.Summon(cr); cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true); - cr->setFaction(me->getFaction()); + cr->SetFaction(me->GetFaction()); } if ((cr = me->SummonCreature(NPC_ZEPIK, 5631.63f, 3794.36f, -92.24f, 3.45f))) { summons.Summon(cr); cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true); - cr->setFaction(me->getFaction()); + cr->SetFaction(me->GetFaction()); } } @@ -202,7 +202,7 @@ public: { minion->Say("Now you not catch us with back turned! Now we hurt you bad undead. BAD!", LANG_UNIVERSAL); minion->RemoveAurasDueToSpell(SPELL_ARTRUIS_BINDING); - minion->setFaction(me->GetVictim()->getFaction()); + minion->SetFaction(me->GetVictim()->GetFaction()); minion->AddThreat(me, 100000.0f); minion->AI()->AttackStart(me); minion->DespawnOrUnsummon(900000); @@ -827,7 +827,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(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); 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 4bde226a7..fc5a45781 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -53,7 +53,7 @@ public: { if (apply) { - me->setFaction(who->getFaction()); + me->SetFaction(who->GetFaction()); me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true); Start(false, true, who->GetGUID()); } @@ -483,7 +483,7 @@ public: if (Player* charmer = GetValidPlayer()) { - me->setFaction(16); + me->SetFaction(FACTION_MONSTER_2); charmer->SetClientControl(me, 0, true); me->SetSpeed(MOVE_RUN, 2.0f, true); diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index fdb50feff..7431acb69 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -396,7 +396,7 @@ public: if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID)) if (player->IsWithinDistInMap(me, 80)) return; - me->setFaction(974); + me->SetFaction(FACTION_UNDEAD_SCOURGE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); ScriptedAI::EnterEvadeMode(); } @@ -407,7 +407,7 @@ public: summons.DespawnAll(); playerGUID.Clear(); lichGUID.Clear(); - me->setFaction(974); + me->SetFaction(FACTION_UNDEAD_SCOURGE); me->SetVisible(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -473,7 +473,7 @@ public: me->RemoveAllAuras(); me->CombatStop(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); events.Reset(); events.ScheduleEvent(EVENT_BETRAYAL_4, 1000); } @@ -579,7 +579,7 @@ public: break; } - if (me->getFaction() == 35 || me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED)) + if (me->GetFaction() == FACTION_FRIENDLY || me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED)) return; if (!UpdateVictim()) @@ -726,7 +726,7 @@ public: void Reset() override { - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P } @@ -737,7 +737,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/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index 70433d03c..cc5898335 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -94,9 +94,7 @@ enum MiscIds SPELL_SHADOW_INFERNO_DAMAGE = 39646, SPELL_CHAOTIC_CHARGE = 41033, SPELL_DEMENTIA1 = 41406, - SPELL_DEMENTIA2 = 41409, - - FACTION_ASHTONGUE = 1820 + SPELL_DEMENTIA2 = 41409 }; template diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index a6c016577..94c0e35fd 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -118,7 +118,7 @@ public: { ashtongueGUIDs.push_back(creature->GetGUID()); if (GetBossState(DATA_SHADE_OF_AKAMA) == DONE) - creature->setFaction(FACTION_ASHTONGUE); + creature->SetFaction(FACTION_ASHTONGUE_DEATHSWORN); } } @@ -202,7 +202,7 @@ public: { for (ObjectGuid const& guid : ashtongueGUIDs) if (Creature* ashtongue = instance->GetCreature(guid)) - ashtongue->setFaction(FACTION_ASHTONGUE); + ashtongue->SetFaction(FACTION_ASHTONGUE_DEATHSWORN); } else if (type == DATA_ILLIDARI_COUNCIL && state == DONE) { 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 09c2f5fc5..53527200a 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -326,7 +326,7 @@ public: void Reset() { me->SetDisableGravity(true); - me->setFaction(14); + me->SetFaction(FACTION_MONSTER); MovementTimer = 0; ToxicSporeTimer = 5000; BoltTimer = 5500; @@ -364,7 +364,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); } } @@ -382,7 +382,7 @@ public: // remove me->setDeathState(DEAD); me->RemoveCorpse(); - me->setFaction(35); + me->SetFaction(FACTION_FRIENDLY); } CheckTimer = 1000; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 9f1e1158b..f21dc0e79 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -72,7 +72,7 @@ public: void JustSummoned(Creature* summoned) override { - summoned->setFaction(16); + summoned->SetFaction(FACTION_MONSTER_2); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); summoned->CastSpell(summoned, SPELL_POISON, false, 0, 0, me->GetGUID()); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 1b04bebce..d9a144696 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -82,8 +82,6 @@ enum Aeranas { SAY_SUMMON = 0, SAY_FREE = 1, - FACTION_HOSTILE = 16, - FACTION_FRIENDLY = 35, SPELL_ENVELOPING_WINDS = 15535, SPELL_SHOCK = 12553 }; @@ -104,7 +102,7 @@ public: shock_Timer = 5000; me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(SAY_SUMMON); } @@ -115,7 +113,7 @@ public: { if (faction_Timer <= diff) { - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_MONSTER_2); faction_Timer = 0; } else faction_Timer -= diff; @@ -126,7 +124,7 @@ public: if (HealthBelowPct(30)) { - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->RemoveAllAuras(); me->DeleteThreatList(); @@ -249,8 +247,7 @@ enum WoundedBloodElf SAY_ELF_AGGRO = 5, QUEST_ROAD_TO_FALCON_WATCH = 9375, NPC_HAALESHI_WINDWALKER = 16966, - NPC_HAALESHI_TALONGUARD = 16967, - FACTION_FALCON_WATCH_QUEST = 775 + NPC_HAALESHI_TALONGUARD = 16967 }; class npc_wounded_blood_elf : public CreatureScript @@ -279,7 +276,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()); } } diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 40c73bc90..ec78eedf5 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -76,7 +76,7 @@ public: if (npc_maghar_captiveAI* EscortAI = dynamic_cast(creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->setFaction(232); + creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); EscortAI->Start(true, false, player->GetGUID(), quest); creature->AI()->Talk(SAY_MAG_START); diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 6084a0e9d..375f9c181 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -54,10 +54,7 @@ enum DeathblowToTheLegion DEATHBLOW_TO_THE_LEGION = 10409, // Quest ID TURNING_POINT = 10507, // Quest ID SOCRETHAR_QUEST_CREDIT = 35762, // Quest spell - SOCRETHAR_TP_STONE = 29796, - - EXODAR_FACTION = 1806, - EXODAR_ENEMY_FACTION = 90 + SOCRETHAR_TP_STONE = 29796 }; enum RoleplayActions @@ -606,7 +603,7 @@ public: void Reset() override { me->SetReactState(REACT_PASSIVE); - me->setFaction(EXODAR_ENEMY_FACTION); + me->SetFaction(FACTION_DEMON); adyen = nullptr; orelis = nullptr; karja = nullptr; @@ -750,7 +747,7 @@ public: case EVENT_FIGHT_ALDOR: if (GetCreature(KAYLAAN_THE_LOST)) { - kaylaan->setFaction(EXODAR_ENEMY_FACTION); + kaylaan->SetFaction(FACTION_DEMON); if (GetCreature(ADYEN_THE_LIGHTBRINGER)) kaylaan->AI()->AttackStart(adyen); } @@ -758,7 +755,7 @@ public: case EVENT_END_ALDOR_FIGHT: if (GetCreature(KAYLAAN_THE_LOST)) { - kaylaan->setFaction(EXODAR_FACTION); + kaylaan->SetFaction(FACTION_DEMON); kaylaan->GetMotionMaster()->MoveTargetedHome(); kaylaan->CombatStop(); kaylaan->ClearInCombat(); @@ -876,7 +873,7 @@ public: break; case EVENT_FINAL_FIGHT: // Prepare Socrethar for encounter - me->setFaction(EXODAR_ENEMY_FACTION); + me->SetFaction(FACTION_DEMON); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); me->SetReactState(REACT_AGGRESSIVE); @@ -1150,7 +1147,7 @@ public: { summons.Summon(*itr); (*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - (*itr)->setFaction(250); + (*itr)->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } cl.clear(); me->GetCreaturesWithEntryInRange(cl, 20.0f, NPC_PROTECTORATE_DEFENDER); @@ -1158,10 +1155,10 @@ public: { summons.Summon(*itr); (*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - (*itr)->setFaction(250); + (*itr)->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } - me->setFaction(250); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); Talk(SAY_SAEED_0); events.ScheduleEvent(EVENT_START_WALK, 3000); } @@ -1824,7 +1821,7 @@ public: { if (quest->GetQuestId() == Q_ALMABTRIEB) { - creature->setFaction(113); + creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->AI()->Talk(SAY_BESSY_0); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); @@ -1992,7 +1989,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(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); 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 394070264..79b3c7ed1 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -75,7 +75,7 @@ public: Creature* cr2 = go->SummonTrigger(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ() + 2.0f, 0.0f, 100); if (cr2) { - cr2->setFaction(14); + cr2->SetFaction(FACTION_MONSTER); cr2->SetUInt32Value(UNIT_FIELD_FLAGS, 0); GetCaster()->CastSpell(cr2, 38083, true); } @@ -428,10 +428,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, @@ -467,7 +463,7 @@ public: void Reset() override { if (!Tapped) - me->setFaction(FACTION_DEFAULT); + me->SetFaction(FACTION_ORC_DRAGONMAW); FlyTimer = 1000; me->SetDisableGravity(false); @@ -484,7 +480,7 @@ public: Tapped = true; PlayerGUID = caster->GetGUID(); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FLAYER_HUNTER); // Not sure if this is correct, it was taken off of Mordenai. Unit* Dragonmaw = me->FindNearestCreature(NPC_DRAGONMAW_SUBJUGATOR, 50); if (Dragonmaw) @@ -835,8 +831,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 @@ -849,7 +844,7 @@ public: if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR) { creature->AI()->Talk(SAY_WIL_START, player); - creature->setFaction(FACTION_EARTHEN); + creature->SetFaction(FACTION_EARTHEN_RING); //guessed if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest); @@ -1640,11 +1635,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 @@ -1712,7 +1703,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 d888b6c36..84736e72f 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -47,8 +47,7 @@ EndContentData */ enum Raliq { SPELL_UPPERCUT = 10966, - QUEST_CRACK_SKULLS = 10009, - FACTION_HOSTILE_RD = 45 + QUEST_CRACK_SKULLS = 10009 }; class npc_raliq_the_drunk : public CreatureScript @@ -62,7 +61,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF + 1) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_HOSTILE_RD); + creature->SetFaction(FACTION_OGRE); creature->AI()->AttackStart(player); } return true; @@ -86,7 +85,7 @@ public: { npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = creature->getFaction(); + m_uiNormFaction = creature->GetFaction(); } uint32 m_uiNormFaction; @@ -121,10 +120,6 @@ public: enum Salsalabim { - // Factions - FACTION_HOSTILE_SA = 90, - FACTION_FRIENDLY_SA = 35, - // Quests QUEST_10004 = 10004, @@ -141,7 +136,7 @@ public: { if (player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE) { - creature->setFaction(FACTION_HOSTILE_SA); + creature->SetFaction(FACTION_DEMON); creature->AI()->AttackStart(player); } else diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index a9ad52d49..838570b4c 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -335,7 +335,6 @@ enum UnkorTheRuthless SAY_SUBMIT = 0, FACTION_HOSTILE = 45, - FACTION_FRIENDLY = 35, QUEST_DONTKILLTHEFATONE = 9889, SPELL_PULVERIZE = 2676 @@ -365,7 +364,7 @@ public: UnkorUnfriendly_Timer = 0; Pulverize_Timer = 3000; me->SetStandState(UNIT_STAND_STATE_STAND); - me->setFaction(FACTION_HOSTILE); + me->SetFaction(FACTION_HOSTILE); } void EnterCombat(Unit* /*who*/) override { } @@ -373,7 +372,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(); @@ -527,7 +526,6 @@ enum Floon SPELL_FROSTBOLT = 9672, SPELL_FROST_NOVA = 11831, - FACTION_HOSTILE_FL = 1738, QUEST_CRACK_SKULLS = 10009 }; @@ -547,7 +545,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF + 1) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_HOSTILE_FL); + creature->SetFaction(FACTION_ARAKKOA); creature->AI()->Talk(SAY_FLOON_ATTACK, player); creature->AI()->AttackStart(player); } @@ -572,7 +570,7 @@ public: { npc_floonAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = creature->getFaction(); + m_uiNormFaction = creature->GetFaction(); } uint32 m_uiNormFaction; @@ -585,8 +583,8 @@ public: Silence_Timer = 2000; Frostbolt_Timer = 4000; FrostNova_Timer = 9000; - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->GetFaction() != m_uiNormFaction) + me->SetFaction(m_uiNormFaction); } void EnterCombat(Unit* /*who*/) override { } @@ -754,7 +752,7 @@ public: if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) { CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - creature->setFaction(250); + creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } return true; } diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index af0db2ca0..39e349172 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -250,8 +250,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 @@ -263,7 +262,7 @@ public: { npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = creature->getFaction(); + m_uiNormFaction = creature->GetFaction(); } uint32 m_uiNormFaction; @@ -272,8 +271,8 @@ public: void Reset() override { LightningBolt_Timer = 2000; - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->GetFaction() != m_uiNormFaction) + me->SetFaction(m_uiNormFaction); } void EnterCombat(Unit* /*who*/) override { } @@ -314,7 +313,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF) { CloseGossipMenuFor(player); - creature->setFaction(FACTION_HOSTILE_CO); + creature->SetFaction(FACTION_OGRE); creature->AI()->AttackStart(player); } return true; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index f14f6f15e..f7789985f 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1467,7 +1467,7 @@ public: continue; summon->SetOwnerGUID(GetCaster()->GetGUID()); - summon->setFaction(GetCaster()->getFaction()); + summon->SetFaction(GetCaster()->GetFaction()); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); summon->SetReactState(REACT_PASSIVE); summon->GetMotionMaster()->MoveFollow(GetCaster(), PET_FOLLOW_DIST, GetCaster()->GetAngle(summon), MOTION_SLOT_CONTROLLED); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index a459caa2b..5206b44fd 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1006,7 +1006,7 @@ public: bool CheckProc(ProcEventInfo& eventInfo) { Unit* target = eventInfo.GetActionTarget(); - return target && target->getFaction() == 1843; // Xinef: Illidari demons faction + return target && target->GetFaction() == 1843; // Xinef: Illidari demons faction } void Register() override diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 2f4ea335b..1e6af7ad5 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -650,9 +650,7 @@ enum ChickenCluck EMOTE_HELLO = 0, EMOTE_CLUCK_TEXT = 2, - QUEST_CLUCK = 3861, - FACTION_FRIENDLY = 35, - FACTION_CHICKEN = 31 + QUEST_CLUCK = 3861 }; class npc_chicken_cluck : public CreatureScript @@ -669,7 +667,7 @@ public: void Reset() override { ResetFlagTimer = 120000; - me->setFaction(FACTION_CHICKEN); + me->SetFaction(FACTION_PREY); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); } @@ -701,7 +699,7 @@ public: if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand() % 30 == 1) { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(EMOTE_HELLO); } break; @@ -709,7 +707,7 @@ public: if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE) { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->setFaction(FACTION_FRIENDLY); + me->SetFaction(FACTION_FRIENDLY); Talk(EMOTE_CLUCK_TEXT); } break; diff --git a/src/server/shared/SharedDefines.h b/src/server/shared/SharedDefines.h index 9a2e019d1..a412ad0fa 100644 --- a/src/server/shared/SharedDefines.h +++ b/src/server/shared/SharedDefines.h @@ -157,6 +157,60 @@ 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_BOOTY_BAY = 21, + FACTION_TROLL_BLOODSCALP = 28, + FACTION_PREY = 31, + FACTION_ESCORTEE_H_NEUTRAL_PASSIVE = 33, + FACTION_FRIENDLY = 35, + FACTION_TROLL_FROSTMANE = 37, + FACTION_OGRE = 45, + FACTION_ORC_DRAGONMAW = 62, + FACTION_HORDE_GENERIC = 83, + FACTION_ALLIANCE_GENERIC = 84, + FACTION_BLACKFATHOM = 88, + FACTION_DEMON = 90, + FACTION_ELEMENTAL = 91, + FACTION_DRAGONFLIGHT_BLACK = 103, + FACTION_ESCORTEE_N_NEUTRAL_PASSIVE = 113, + FACTION_STORMWIND = 123, + 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_RATCHET = 637, + 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_DRAGONKIN = 1720, + 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_VALIANCE_EXPEDITION_7 = 1974, + FACTION_ESCORTEE_N_ACTIVE = 1986, + FACTION_UNDEAD_SCOURGE_9 = 1988, + FACTION_ESCORTEE_H_ACTIVE = 2046, + FACTION_UNDEAD_SCOURGE_2 = 2068, + FACTION_UNDEAD_SCOURGE_3 = 2084, + FACTION_SCARLET_CRUSADE = 2089, + FACTION_SCARLET_CRUSADE_2 = 2096 +}; + #define MIN_REPUTATION_RANK (REP_HATED) #define MAX_REPUTATION_RANK 8