refactor(Core): update getFaction to GetFaction and setFaction to SetFaction (#8708)

This commit is contained in:
Malcrom
2021-11-01 13:04:32 -03:00
committed by GitHub
parent 3396a9da87
commit f106de8788
129 changed files with 418 additions and 444 deletions
@@ -184,7 +184,7 @@ void npc_escortAI::JustRespawned()
//add a small delay before going to first waypoint, normal in near all cases //add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 1000; m_uiWPWaitTimer = 1000;
if (me->getFaction() != me->GetCreatureTemplate()->faction) if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction(); me->RestoreFaction();
Reset(); Reset();
@@ -144,8 +144,8 @@ void FollowerAI::JustRespawned()
if (!IsCombatMovementAllowed()) if (!IsCombatMovementAllowed())
SetCombatMovement(true); SetCombatMovement(true);
if (me->getFaction() != me->GetCreatureTemplate()->faction) if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->setFaction(me->GetCreatureTemplate()->faction); me->SetFaction(me->GetCreatureTemplate()->faction);
Reset(); Reset();
} }
@@ -282,7 +282,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
m_uiLeaderGUID = player->GetGUID(); m_uiLeaderGUID = player->GetGUID();
if (factionForFollower) if (factionForFollower)
me->setFaction(factionForFollower); me->SetFaction(factionForFollower);
m_pQuestForFollow = quest; m_pQuestForFollow = quest;
+1 -1
View File
@@ -729,7 +729,7 @@ void SmartAI::JustRespawned()
mDespawnState = 0; mDespawnState = 0;
mEscortState = SMART_ESCORT_NONE; mEscortState = SMART_ESCORT_NONE;
me->SetVisible(true); me->SetVisible(true);
if (me->getFaction() != me->GetCreatureTemplate()->faction) if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction(); me->RestoreFaction();
mJustReset = true; mJustReset = true;
JustReachedHome(); JustReachedHome();
@@ -422,7 +422,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{ {
if (e.action.faction.factionID) 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", 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); (*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 (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", 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); (*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), ci->faction);
} }
+1 -1
View File
@@ -814,7 +814,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
return nullptr; return nullptr;
} }
creature->setFaction(BattlefieldFactions[teamId]); creature->SetFaction(BattlefieldFactions[teamId]);
creature->SetHomePosition(x, y, z, o); creature->SetHomePosition(x, y, z, o);
// force using DB speeds -- do we really need this? // force using DB speeds -- do we really need this?
@@ -238,7 +238,7 @@ void BattlefieldWG::OnBattleStart()
if (Creature* creature = GetCreature(*itr)) if (Creature* creature = GetCreature(*itr))
{ {
ShowNpc(creature, true); 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 (Creature* creature = GetCreature(*itr))
{ {
if (!endByTimer) if (!endByTimer)
creature->setFaction(WintergraspFaction[GetDefenderTeam()]); creature->SetFaction(WintergraspFaction[GetDefenderTeam()]);
HideNpc(creature); HideNpc(creature);
} }
} }
@@ -610,7 +610,7 @@ void BattlefieldWG::OnCreatureCreate(Creature* creature)
return; return;
if (Unit* owner = creature->ToTempSummon()->GetSummonerUnit()) if (Unit* owner = creature->ToTempSummon()->GetSummonerUnit())
creature->setFaction(owner->getFaction()); creature->SetFaction(owner->GetFaction());
break; break;
} }
} }
@@ -630,9 +630,9 @@ void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/)
case NPC_WINTERGRASP_DEMOLISHER: case NPC_WINTERGRASP_DEMOLISHER:
{ {
uint8 team; uint8 team;
if (creature->getFaction() == WintergraspFaction[TEAM_ALLIANCE]) if (creature->GetFaction() == WintergraspFaction[TEAM_ALLIANCE])
team = TEAM_ALLIANCE; team = TEAM_ALLIANCE;
else if (creature->getFaction() == WintergraspFaction[TEAM_HORDE]) else if (creature->GetFaction() == WintergraspFaction[TEAM_HORDE])
team = TEAM_HORDE; team = TEAM_HORDE;
else else
return; return;
@@ -1413,7 +1413,7 @@ struct BfWGGameObjectBuilding
{ {
if (Creature* creature = m_WG->GetCreature(*itr)) if (Creature* creature = m_WG->GetCreature(*itr))
{ {
creature->setFaction(faction); creature->SetFaction(faction);
if (disable) if (disable)
m_WG->HideNpc(creature); m_WG->HideNpc(creature);
else else
@@ -1425,7 +1425,7 @@ struct BfWGGameObjectBuilding
{ {
if (Creature* creature = m_WG->GetCreature(*itr)) if (Creature* creature = m_WG->GetCreature(*itr))
{ {
creature->setFaction(faction); creature->SetFaction(faction);
if (disable) if (disable)
m_WG->HideNpc(creature); m_WG->HideNpc(creature);
else else
@@ -271,7 +271,7 @@ void BattlegroundAB::NodeOccupied(uint8 node)
if (trigger) 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); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
} }
} }
@@ -355,7 +355,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
BG_AV_CreaturePos[triggerSpawnID][2], BG_AV_CreaturePos[triggerSpawnID][2],
BG_AV_CreaturePos[triggerSpawnID][3])) BG_AV_CreaturePos[triggerSpawnID][3]))
{ {
trigger->setFaction(newFaction); trigger->SetFaction(newFaction);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
} }
} }
@@ -786,7 +786,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
DelCreature(node + 302); DelCreature(node + 302);
return; 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); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
} }
} }
@@ -505,7 +505,7 @@ void BattlegroundEY::EventTeamCapturedPoint(TeamId teamId, uint32 point)
if (trigger) 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); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, true);
} }
} }
@@ -467,9 +467,9 @@ bool BattlegroundIC::SetupBattleground()
// setting correct factions for Keep Cannons // setting correct factions for Keep Cannons
for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i <= BG_IC_NPC_KEEP_CANNON_12; ++i) 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) 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 // Flags
if (GameObject* go = GetBGObject(BG_IC_GO_ALLIANCE_BANNER)) 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].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(),
BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(), BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(),
RESPAWN_ONE_DAY)) RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[nodePoint->faction]); GetBGCreature(type)->SetFaction(BG_IC_Factions[nodePoint->faction]);
} }
// spawning catapults // 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].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(),
BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(), BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(),
RESPAWN_ONE_DAY)) 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; break;
case BG_IC_GO_WORKSHOP_BANNER: 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].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(),
BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(), BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(),
RESPAWN_ONE_DAY)) 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); 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])) 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); siegeEngine->SetCorpseDelay(5 * MINUTE);
if (siegeEngine->IsAlive()) if (siegeEngine->IsAlive())
@@ -687,13 +687,13 @@ void BattlegroundSA::OverrideGunFaction()
for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++) for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++)
{ {
if (Creature* gun = GetBGCreature(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++) for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
{ {
if (Creature* dem = GetBGCreature(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); BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
if (Creature* dem = GetBGCreature(j)) 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)); 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); BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
if (Creature* dem = GetBGCreature(j)) 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)); UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
@@ -446,7 +446,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
if (!GetCreatureAddon()) if (!GetCreatureAddon())
SetSheath(SHEATH_STATE_MELEE); SetSheath(SHEATH_STATE_MELEE);
setFaction(cInfo->faction); SetFaction(cInfo->faction);
uint32 npcflag, unit_flags, dynamicflags; uint32 npcflag, unit_flags, dynamicflags;
ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data); 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 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(); owner->VehicleSpellInitialize();
} }
} }
@@ -2280,7 +2280,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
// only from same creature faction // only from same creature faction
if (checkfaction) if (checkfaction)
{ {
if (getFaction() != u->getFaction()) if (GetFaction() != u->GetFaction())
return false; return false;
} }
else else
@@ -2362,7 +2362,7 @@ void Creature::UpdateMoveInLineOfSightState()
} }
bool nonHostile = true; 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]) if (factionTemplate->hostileMask || factionTemplate->enemyFaction[0] || factionTemplate->enemyFaction[1] || factionTemplate->enemyFaction[2] || factionTemplate->enemyFaction[3])
nonHostile = false; nonHostile = false;
@@ -199,7 +199,7 @@ void TempSummon::InitStats(uint32 duration)
{ {
if (IsTrigger() && m_spells[0]) if (IsTrigger() && m_spells[0])
{ {
setFaction(owner->getFaction()); SetFaction(owner->GetFaction());
SetLevel(owner->getLevel()); SetLevel(owner->getLevel());
if (owner->GetTypeId() == TYPEID_PLAYER) if (owner->GetTypeId() == TYPEID_PLAYER)
m_ControlledByPlayer = true; m_ControlledByPlayer = true;
@@ -227,9 +227,9 @@ void TempSummon::InitStats(uint32 duration)
} }
if (m_Properties->Faction) if (m_Properties->Faction)
setFaction(m_Properties->Faction); SetFaction(m_Properties->Faction);
else if (IsVehicle() && owner) // properties should be vehicle else if (IsVehicle() && owner) // properties should be vehicle
setFaction(owner->getFaction()); SetFaction(owner->GetFaction());
} }
void TempSummon::InitSummon() void TempSummon::InitSummon()
@@ -320,7 +320,7 @@ void Minion::InitStats(uint32 duration)
Unit* owner = GetOwner(); Unit* owner = GetOwner();
SetCreatorGUID(owner->GetGUID()); SetCreatorGUID(owner->GetGUID());
setFaction(owner->getFaction()); SetFaction(owner->GetFaction());
owner->SetMinion(this, true); owner->SetMinion(this, true);
} }
@@ -2023,7 +2023,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
if (Unit* owner = GetOwner()) if (Unit* owner = GetOwner())
{ {
trigger->SetLevel(owner->getLevel(), false); trigger->SetLevel(owner->getLevel(), false);
trigger->setFaction(owner->getFaction()); trigger->SetFaction(owner->GetFaction());
// needed for GO casts for proper target validation checks // needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID()); trigger->SetOwnerGUID(owner->GetGUID());
// xinef: fixes some duel bugs with traps] // xinef: fixes some duel bugs with traps]
@@ -2042,7 +2042,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
else else
{ {
// xinef: set faction of gameobject, if no faction - assume hostile // 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 // 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()) // - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
// xinef: set proper orientation, fixes cast against stealthed targets // xinef: set proper orientation, fixes cast against stealthed targets
+1 -1
View File
@@ -2256,7 +2256,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
//summon->SetName(GetName()); //summon->SetName(GetName());
if (setLevel && (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT)) if (setLevel && (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT))
{ {
summon->setFaction(((Unit*)this)->getFaction()); summon->SetFaction(((Unit*)this)->GetFaction());
summon->SetLevel(((Unit*)this)->getLevel()); summon->SetLevel(((Unit*)this)->getLevel());
} }
+1 -1
View File
@@ -2231,7 +2231,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
if (info->m_createdBySpell) if (info->m_createdBySpell)
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, info->m_createdBySpell); pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, info->m_createdBySpell);
pet->SetCreatorGUID(player->GetGUID()); pet->SetCreatorGUID(player->GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->GetFaction());
pet->setPowerType(POWER_MANA); pet->setPowerType(POWER_MANA);
pet->SetUInt32Value(UNIT_NPC_FLAGS, 0); pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+10 -10
View File
@@ -517,7 +517,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
m_realRace = createInfo->Race; // set real race flag m_realRace = createInfo->Race; // set real race flag
m_race = createInfo->Race; // set real race flag m_race = createInfo->Race; // set real race flag
setFactionForRace(createInfo->Race); SetFactionForRace(createInfo->Race);
if (!IsValidGender(createInfo->Gender)) 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 // xinef: not needed, CORRECTLY checked above including forced reputations etc
// not unfriendly // not unfriendly
//if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) //if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->GetFaction()))
// if (factionTemplate->faction) // if (factionTemplate->faction)
// if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) // if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction))
// if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) // if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
@@ -2150,14 +2150,14 @@ void Player::SetGameMaster(bool on)
{ {
m_ExtraFlags |= PLAYER_EXTRA_GM_ON; m_ExtraFlags |= PLAYER_EXTRA_GM_ON;
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity())) if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
setFaction(35); SetFaction(FACTION_FRIENDLY);
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS); SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
if (Pet* pet = GetPet()) if (Pet* pet = GetPet())
{ {
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity())) if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
pet->setFaction(35); pet->SetFaction(FACTION_FRIENDLY);
pet->getHostileRefMgr().setOnlineOfflineState(false); pet->getHostileRefMgr().setOnlineOfflineState(false);
} }
@@ -2181,13 +2181,13 @@ void Player::SetGameMaster(bool on)
SetPhaseMask(newPhase, false); SetPhaseMask(newPhase, false);
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON; m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
setFactionForRace(getRace(true)); SetFactionForRace(getRace(true));
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS); RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
if (Pet* pet = GetPet()) if (Pet* pet = GetPet())
{ {
pet->setFaction(getFaction()); pet->SetFaction(GetFaction());
pet->getHostileRefMgr().setOnlineOfflineState(true); pet->getHostileRefMgr().setOnlineOfflineState(true);
} }
@@ -5649,7 +5649,7 @@ TeamId Player::TeamIdForRace(uint8 race)
return TEAM_ALLIANCE; return TEAM_ALLIANCE;
} }
void Player::setFactionForRace(uint8 race) void Player::SetFactionForRace(uint8 race)
{ {
m_team = TeamIdForRace(race); m_team = TeamIdForRace(race);
@@ -5659,7 +5659,7 @@ void Player::setFactionForRace(uint8 race)
return; return;
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
setFaction(rEntry ? rEntry->FactionID : 0); SetFaction(rEntry ? rEntry->FactionID : 0);
} }
ReputationRank Player::GetReputationRank(uint32 faction) const ReputationRank Player::GetReputationRank(uint32 faction) const
@@ -14442,7 +14442,7 @@ void Player::SetIsSpectator(bool on)
AddAura(SPECTATOR_SPELL_SPEED, this); AddAura(SPECTATOR_SPELL_SPEED, this);
m_ExtraFlags |= PLAYER_EXTRA_SPECTATOR_ON; m_ExtraFlags |= PLAYER_EXTRA_SPECTATOR_ON;
AddUnitState(UNIT_STATE_ISOLATED); AddUnitState(UNIT_STATE_ISOLATED);
//setFaction(1100); //SetFaction(1100);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
ResetContestedPvP(); ResetContestedPvP();
@@ -14459,7 +14459,7 @@ void Player::SetIsSpectator(bool on)
if (!IsGameMaster()) if (!IsGameMaster())
{ {
//setFactionForRace(getRace()); //SetFactionForRace(getRace());
// restore FFA PvP Server state // restore FFA PvP Server state
// Xinef: it will be removed if necessery in UpdateArea called in WorldPortOpcode // Xinef: it will be removed if necessery in UpdateArea called in WorldPortOpcode
+1 -1
View File
@@ -2048,7 +2048,7 @@ public:
static TeamId TeamIdForRace(uint8 race); static TeamId TeamIdForRace(uint8 race);
[[nodiscard]] TeamId GetTeamId(bool original = false) const { return original ? TeamIdForRace(getRace(true)) : m_team; }; [[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 setTeamId(TeamId teamid) { m_team = teamid; };
void InitDisplayIds(); void InitDisplayIds();
@@ -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) //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. //Other way is to saves m_team into characters table.
setFactionForRace(getRace(true)); SetFactionForRace(getRace(true));
// pussywizard: create empty instance bind containers if necessary // pussywizard: create empty instance bind containers if necessary
sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(playerGuid); sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(playerGuid);
+17 -17
View File
@@ -9413,7 +9413,7 @@ void Unit::setPowerType(Powers new_powertype)
FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
{ {
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction()); FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction());
if (!entry) if (!entry)
{ {
static ObjectGuid guid; // prevent repeating spam same faction problem static ObjectGuid guid; // prevent repeating spam same faction problem
@@ -9421,11 +9421,11 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
if (GetGUID() != guid) if (GetGUID() != guid)
{ {
if (Player const* player = ToPlayer()) 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()) 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 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(); guid = GetGUID();
} }
@@ -9433,7 +9433,7 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
return entry; return entry;
} }
void Unit::setFaction(uint32 faction) void Unit::SetFaction(uint32 faction)
{ {
SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction); SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction);
if (GetTypeId() == TYPEID_UNIT) 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) bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
{ {
pet->SetCreatorGUID(GetGUID()); pet->SetCreatorGUID(GetGUID());
pet->setFaction(getFaction()); pet->SetFaction(GetFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id); pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
@@ -17497,8 +17497,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (aurApp && aurApp->GetRemoveMode()) if (aurApp && aurApp->GetRemoveMode())
return false; return false;
_oldFactionId = getFaction(); _oldFactionId = GetFaction();
setFaction(charmer->getFaction()); SetFaction(charmer->GetFaction());
// Set charmed // Set charmed
charmer->SetCharm(this, true); charmer->SetCharm(this, true);
@@ -17592,7 +17592,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
creature->RefreshSwimmingFlag(); creature->RefreshSwimmingFlag();
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
sScriptMgr->OnPlayerBeingCharmed(ToPlayer(), charmer, _oldFactionId, charmer->getFaction()); sScriptMgr->OnPlayerBeingCharmed(ToPlayer(), charmer, _oldFactionId, charmer->GetFaction());
return true; return true;
} }
@@ -17622,7 +17622,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (_oldFactionId) if (_oldFactionId)
{ {
setFaction(_oldFactionId); SetFaction(_oldFactionId);
_oldFactionId = 0; _oldFactionId = 0;
} }
else else
@@ -17741,20 +17741,20 @@ void Unit::RemoveCharmedBy(Unit* charmer)
void Unit::RestoreFaction() void Unit::RestoreFaction()
{ {
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
ToPlayer()->setFactionForRace(getRace()); ToPlayer()->SetFactionForRace(getRace());
else else
{ {
if (HasUnitTypeMask(UNIT_MASK_MINION)) if (HasUnitTypeMask(UNIT_MASK_MINION))
{ {
if (Unit* owner = GetOwner()) if (Unit* owner = GetOwner())
{ {
setFaction(owner->getFaction()); SetFaction(owner->GetFaction());
return; return;
} }
} }
if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature 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()); return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer());
// Xinef: we assume that npcs with the same faction are in party // 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()) 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 // 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()) || 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())) (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()); return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer());
// Xinef: we assume that npcs with the same faction are in party // 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()) 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) || 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)) (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true; 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 !! 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 else
// pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work) // 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 else
fieldBuffer << m_uint32Values[index]; fieldBuffer << m_uint32Values[index];
@@ -19914,7 +19914,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
if (index == UNIT_FIELD_BYTES_2) 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 fieldBuffer << (m_uint32Values[index] & 0xFFFFF2FF); // clear UNIT_BYTE2_FLAG_PVP, UNIT_BYTE2_FLAG_FFA_PVP, UNIT_BYTE2_FLAG_SANCTUARY
else else
fieldBuffer << (uint32)target->getFaction(); fieldBuffer << (uint32)target->GetFaction();
} }
else else
if (!sScriptMgr->IsCustomBuildValuesUpdate(this, updateType, fieldBuffer, target, index)) if (!sScriptMgr->IsCustomBuildValuesUpdate(this, updateType, fieldBuffer, target, index))
+2 -2
View File
@@ -1596,8 +1596,8 @@ public:
virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); } virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); }
// faction template id // faction template id
[[nodiscard]] uint32 getFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); } [[nodiscard]] uint32 GetFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); }
void setFaction(uint32 faction); void SetFaction(uint32 faction);
[[nodiscard]] FactionTemplateEntry const* GetFactionTemplateEntry() const; [[nodiscard]] FactionTemplateEntry const* GetFactionTemplateEntry() const;
ReputationRank GetReactionTo(Unit const* target) const; ReputationRank GetReactionTo(Unit const* target) const;
@@ -62,7 +62,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
if (!sScriptMgr->CanSendAuctionHello(this, guid, unit)) if (!sScriptMgr->CanSendAuctionHello(this, guid, unit))
return; return;
AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction()); AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction());
if (!ahEntry) if (!ahEntry)
return; return;
@@ -166,7 +166,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
return; return;
} }
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction()); AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction());
if (!auctionHouseEntry) if (!auctionHouseEntry)
{ {
LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", auctioneer.ToString().c_str()); 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]; Item* item = items[i];
uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); 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); uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount);
if (!_player->HasEnoughMoney(deposit)) if (!_player->HasEnoughMoney(deposit))
@@ -417,7 +417,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
AuctionEntry* auction = auctionHouse->GetAuction(auctionId); AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* player = GetPlayer(); Player* player = GetPlayer();
@@ -539,7 +539,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
AuctionEntry* auction = auctionHouse->GetAuction(auctionId); AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* player = GetPlayer(); Player* player = GetPlayer();
@@ -623,7 +623,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket& recvData)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); 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 WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4 + 4 + 4) + 30000); // pussywizard: ensure there is enough memory
Player* player = GetPlayer(); Player* player = GetPlayer();
@@ -690,7 +690,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(ObjectGuid creatureGuid)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); 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 WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4 + 4 + 4) + 60000); // pussywizard: ensure there is enough memory
data << (uint32) 0; // amount place holder data << (uint32) 0; // amount place holder
@@ -997,7 +997,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
SendFullReputation({ 942, 935, 936, 1011, 970, 967, 989, 932, 934, 1038, 1077 }); SendFullReputation({ 942, 935, 936, 1011, 970, 967, 989, 932, 934, 1038, 1077 });
switch (pCurrChar->getFaction()) switch (pCurrChar->GetFaction())
{ {
case ALLIANCE: case ALLIANCE:
SendFullReputation({ 72, 47, 69, 930, 730, 978, 54, 946 }); SendFullReputation({ 72, 47, 69, 930, 730, 978, 54, 946 });
+1 -1
View File
@@ -314,7 +314,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
return; return;
// set faction visible if needed // 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); _player->GetReputationMgr().SetVisible(factionTemplateEntry);
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
+1 -1
View File
@@ -181,7 +181,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
pet->SetLoading(true); pet->SetLoading(true);
pet->Relocate(px, py, pz, owner->GetOrientation()); pet->Relocate(px, py, pz, owner->GetOrientation());
pet->setPetType(pet_type); pet->setPetType(pet_type);
pet->setFaction(owner->getFaction()); pet->SetFaction(owner->GetFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id); pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
if (pet->IsCritter()) if (pet->IsCritter())
+1 -1
View File
@@ -47,7 +47,7 @@ bool AuctionListItemsDelayEvent::Execute()
if (!creature) if (!creature)
return true; 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)); WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4) + 50 * ((16 + MAX_INSPECTED_ENCHANTMENT_SLOT * 3) * 4));
uint32 count = 0; uint32 count = 0;
@@ -5532,7 +5532,7 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode,
if (apply) if (apply)
{ {
target->setFaction(GetMiscValue()); target->SetFaction(GetMiscValue());
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
} }
+5 -5
View File
@@ -2502,7 +2502,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (properties->Category == SUMMON_CATEGORY_ALLY) if (properties->Category == SUMMON_CATEGORY_ALLY)
{ {
summon->SetOwnerGUID(m_originalCaster->GetGUID()); summon->SetOwnerGUID(m_originalCaster->GetGUID());
summon->setFaction(m_originalCaster->getFaction()); summon->SetFaction(m_originalCaster->GetFaction());
} }
ExecuteLogEffectSummonObject(effIndex, summon); 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... // 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; //uint32 faction = properties->Faction;
//if (!faction) //if (!faction)
uint32 faction = m_originalCaster->getFaction(); uint32 faction = m_originalCaster->GetFaction();
summon->setFaction(faction); summon->SetFaction(faction);
break; break;
} }
@@ -4387,7 +4387,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
return; return;
} }
pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction()); pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->GetFaction());
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() + 1); pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() + 1);
int32 duration = m_spellInfo->GetDuration(); int32 duration = m_spellInfo->GetDuration();
pGameObj->SetRespawnTime(duration > 0 ? duration / IN_MILLISECONDS : 0); 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) if (properties && properties->Category == SUMMON_CATEGORY_ALLY)
summon->setFaction(caster->getFaction()); summon->SetFaction(caster->GetFaction());
ExecuteLogEffectSummonObject(i, summon); ExecuteLogEffectSummonObject(i, summon);
} }
+1 -1
View File
@@ -2932,7 +2932,7 @@ public:
creatureTarget->SetHealth(0); // just for nice GM-mode view creatureTarget->SetHealth(0); // just for nice GM-mode view
pet->SetGuidValue(UNIT_FIELD_CREATEDBY, player->GetGUID()); 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())) if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
{ {
+2 -2
View File
@@ -333,7 +333,7 @@ public:
if (!pfactionid) if (!pfactionid)
{ {
uint32 factionid = target->getFaction(); uint32 factionid = target->GetFaction();
uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS); uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS); uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_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); 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_FIELD_FLAGS, flag);
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag); target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag); target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);
+5 -4
View File
@@ -458,7 +458,7 @@ public:
return false; return false;
} }
creature->setFaction(factionId); creature->SetFaction(factionId);
// Faction is set in creature_template - not inside creature // Faction is set in creature_template - not inside creature
@@ -491,7 +491,8 @@ public:
if (!creature) if (!creature)
return false; return false;
creature->setFaction(tempfaction); creature->SetFaction(tempfaction);
return true; return true;
} }
@@ -589,7 +590,7 @@ public:
} }
CreatureTemplate const* cInfo = target->GetCreatureTemplate(); CreatureTemplate const* cInfo = target->GetCreatureTemplate();
uint32 faction = target->getFaction(); uint32 faction = target->GetFaction();
uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS); uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask;
uint32 spellSchoolImmuneMask = cInfo->SpellSchoolImmuneMask; uint32 spellSchoolImmuneMask = cInfo->SpellSchoolImmuneMask;
@@ -607,7 +608,7 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); 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_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId); handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId);
handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId());
+1 -1
View File
@@ -106,7 +106,7 @@ public:
if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
player->SetShapeshiftForm(FORM_NONE); 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))); player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24)));
@@ -139,7 +139,7 @@ public:
{ {
CAST_AI(npc_water_elemental::npc_water_elementalAI, summoned->AI())->balindaGUID = me->GetGUID(); CAST_AI(npc_water_elemental::npc_water_elementalAI, summoned->AI())->balindaGUID = me->GetGUID();
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true)); summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
summoned->setFaction(me->getFaction()); summoned->SetFaction(me->GetFaction());
summons.Summon(summoned); summons.Summon(summoned);
} }
@@ -590,7 +590,7 @@ public:
//spell by trap has effect61, this indicate the bar go hostile //spell by trap has effect61, this indicate the bar go hostile
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX))) 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. //for later, this event(s) has alot more to it.
//optionally, DONE can trigger bar to go hostile. //optionally, DONE can trigger bar to go hostile.
@@ -21,13 +21,6 @@
#include "CreatureAIImpl.h" #include "CreatureAIImpl.h"
#define BRDScriptName "instance_blackrock_depths" #define BRDScriptName "instance_blackrock_depths"
enum FactionIds
{
FACTION_NEUTRAL = 734,
FACTION_HOSTILE = 754,
FACTION_FRIEND = 35
};
enum BRDBosses enum BRDBosses
{ {
BOSS_AMBASSADOR_FLAMELASH = 0, BOSS_AMBASSADOR_FLAMELASH = 0,
@@ -76,7 +76,7 @@ public:
if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOIRA))) if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOIRA)))
{ {
Moira->AI()->EnterEvadeMode(); Moira->AI()->EnterEvadeMode();
Moira->setFaction(35); Moira->SetFaction(FACTION_FRIENDLY);
} }
} }
@@ -178,7 +178,7 @@ public:
Voidwalkers = false; Voidwalkers = false;
// Reset his gossip menu // Reset his gossip menu
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_NPC_FLAG_GOSSIP); 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 // was set before event start, so set again
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
@@ -580,7 +580,7 @@ public:
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
{ {
++TombEventCounter; ++TombEventCounter;
boss->setFaction(FACTION_HOSTILE); boss->SetFaction(FACTION_DARK_IRON_DWARVES);
boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
// find suitable target here. // find suitable target here.
@@ -614,7 +614,7 @@ public:
boss->GetMotionMaster()->MoveTargetedHome(); boss->GetMotionMaster()->MoveTargetedHome();
boss->SetLootRecipient(nullptr); 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 boss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // think this is useless
if (i == 6) // doomrel needs explicit reset if (i == 6) // doomrel needs explicit reset
{ {
@@ -190,7 +190,7 @@ public:
me->SetVisible(true); me->SetVisible(true);
me->SetPhaseMask(1, true); me->SetPhaseMask(1, true);
me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR); me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR);
me->RemoveAura(SPELL_NEFARIANS_BARRIER); me->RemoveAura(SPELL_NEFARIANS_BARRIER);
} }
@@ -209,7 +209,7 @@ public:
Talk(SAY_GAMESBEGIN_2); Talk(SAY_GAMESBEGIN_2);
me->setFaction(103); me->SetFaction(FACTION_DRAGONFLIGHT_BLACK);
me->SetUInt32Value(UNIT_NPC_FLAGS, 0); me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
DoCast(me, SPELL_NEFARIANS_BARRIER); DoCast(me, SPELL_NEFARIANS_BARRIER);
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
@@ -345,7 +345,7 @@ public:
CreatureID = Entry[urand(0, 4)]; CreatureID = Entry[urand(0, 4)];
if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i])) if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i]))
{ {
dragon->setFaction(103); dragon->SetFaction(FACTION_DRAGONFLIGHT_BLACK);
dragon->AI()->AttackStart(me->GetVictim()); dragon->AI()->AttackStart(me->GetVictim());
} }
@@ -89,7 +89,7 @@ public:
HasYelled = false; HasYelled = false;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); 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); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} }
@@ -182,7 +182,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break; break;
case EVENT_SPEECH_7: case EVENT_SPEECH_7:
me->setFaction(103); me->SetFaction(FACTION_DRAGONFLIGHT_BLACK);
if (PlayerGUID && ObjectAccessor::GetUnit(*me, PlayerGUID)) if (PlayerGUID && ObjectAccessor::GetUnit(*me, PlayerGUID))
AttackStart(ObjectAccessor::GetUnit(*me, PlayerGUID)); AttackStart(ObjectAccessor::GetUnit(*me, PlayerGUID));
break; break;
@@ -106,7 +106,7 @@ public:
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f)) 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->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
EnterEvadeMode(); EnterEvadeMode();
Talk(SAY_DEFEAT); Talk(SAY_DEFEAT);
_JustDied(); _JustDied();
@@ -184,7 +184,7 @@ public:
} }
else if (action == ACTION_START_RAGNAROS_ALT) else if (action == ACTION_START_RAGNAROS_ALT)
{ {
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
} }
} }
@@ -177,7 +177,7 @@ public:
{ {
//Become unbanished again //Become unbanished again
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
me->setFaction(14); me->SetFaction(FACTION_MONSTER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
@@ -246,7 +246,7 @@ public:
DoResetThreat(); DoResetThreat();
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->InterruptNonMeleeSpells(false); me->InterruptNonMeleeSpells(false);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
@@ -314,7 +314,7 @@ public:
if (infernal) if (infernal)
{ {
infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
infernal->setFaction(me->getFaction()); infernal->SetFaction(me->GetFaction());
infernals.push_back(infernal->GetGUID()); infernals.push_back(infernal->GetGUID());
infernal->SetControlled(true, UNIT_STATE_ROOT); infernal->SetControlled(true, UNIT_STATE_ROOT);
RELAY->AI()->DoCast(infernal, SPELL_INFERNAL_RELAY); RELAY->AI()->DoCast(infernal, SPELL_INFERNAL_RELAY);
@@ -62,7 +62,7 @@ public:
events.Reset(); events.Reset();
me->SetVisible(false); me->SetVisible(false);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
_events2.Reset(); _events2.Reset();
_events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000); _events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000);
if (me->GetEntry() == NPC_HYAKISS_THE_LURKER) if (me->GetEntry() == NPC_HYAKISS_THE_LURKER)
@@ -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)) 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); pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
} }
break; break;
@@ -419,7 +419,7 @@ public:
DoStartNoMovement(target); DoStartNoMovement(target);
ElementalOne->SetInCombatWithZone(); ElementalOne->SetInCombatWithZone();
ElementalOne->CombatStart(target); ElementalOne->CombatStart(target);
ElementalOne->setFaction(me->getFaction()); ElementalOne->SetFaction(me->GetFaction());
ElementalOne->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalOne->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
ElementalOne->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); ElementalOne->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
} }
@@ -433,7 +433,7 @@ public:
DoStartNoMovement(target); DoStartNoMovement(target);
ElementalTwo->SetInCombatWithZone(); ElementalTwo->SetInCombatWithZone();
ElementalTwo->CombatStart(target); ElementalTwo->CombatStart(target);
ElementalTwo->setFaction(me->getFaction()); ElementalTwo->SetFaction(me->GetFaction());
ElementalTwo->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalTwo->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
ElementalTwo->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); ElementalTwo->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
} }
@@ -447,7 +447,7 @@ public:
DoStartNoMovement(target); DoStartNoMovement(target);
ElementalThree->SetInCombatWithZone(); ElementalThree->SetInCombatWithZone();
ElementalThree->CombatStart(target); ElementalThree->CombatStart(target);
ElementalThree->setFaction(me->getFaction()); ElementalThree->SetFaction(me->GetFaction());
ElementalThree->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalThree->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
ElementalThree->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); ElementalThree->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
} }
@@ -461,7 +461,7 @@ public:
DoStartNoMovement(target); DoStartNoMovement(target);
ElementalFour->SetInCombatWithZone(); ElementalFour->SetInCombatWithZone();
ElementalFour->CombatStart(target); ElementalFour->CombatStart(target);
ElementalFour->setFaction(me->getFaction()); ElementalFour->SetFaction(me->GetFaction());
ElementalFour->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); ElementalFour->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
ElementalFour->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0); 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)) 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->Attack(me->GetVictim(), true);
unit->setFaction(me->getFaction()); unit->SetFaction(me->GetFaction());
} }
} }
@@ -1384,7 +1384,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
{ {
Talk(SAY_JULIANNE_AGGRO); Talk(SAY_JULIANNE_AGGRO);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16); me->SetFaction(FACTION_MONSTER_2);
AggroYellTimer = 0; AggroYellTimer = 0;
} }
else else
@@ -1416,7 +1416,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
CAST_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO; CAST_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO;
DoZoneInCombat(pRomulo); DoZoneInCombat(pRomulo);
pRomulo->setFaction(16); pRomulo->SetFaction(FACTION_MONSTER_2);
} }
SummonedRomulo = true; SummonedRomulo = true;
} }
@@ -173,7 +173,6 @@ enum deathsChallenge
SAY_DUEL = 0, SAY_DUEL = 0,
QUEST_DEATH_CHALLENGE = 12733, QUEST_DEATH_CHALLENGE = 12733,
FACTION_HOSTILE = 2068,
DATA_IN_PROGRESS = 0, DATA_IN_PROGRESS = 0,
@@ -337,7 +336,7 @@ public:
Talk(SAY_DUEL + 4, ObjectAccessor::GetPlayer(*me, _duelGUID)); Talk(SAY_DUEL + 4, ObjectAccessor::GetPlayer(*me, _duelGUID));
break; break;
case EVENT_SPEAK+5: case EVENT_SPEAK+5:
me->setFaction(FACTION_HOSTILE); me->SetFaction(FACTION_UNDEAD_SCOURGE_2);
if (Player* player = ObjectAccessor::GetPlayer(*me, _duelGUID)) if (Player* player = ObjectAccessor::GetPlayer(*me, _duelGUID))
AttackStart(player); AttackStart(player);
return; return;
@@ -723,7 +722,7 @@ public:
anchorGUID.Clear(); anchorGUID.Clear();
phase = PHASE_CHAINED; phase = PHASE_CHAINED;
events.Reset(); events.Reset();
me->setFaction(7); me->SetFaction(FACTION_CREATURE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8);
me->LoadEquipment(0, true); me->LoadEquipment(0, true);
@@ -825,7 +824,7 @@ public:
wait_timer -= diff; wait_timer -= diff;
else else
{ {
me->setFaction(14); me->SetFaction(FACTION_MONSTER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
phase = PHASE_ATTACKING; phase = PHASE_ATTACKING;
@@ -947,7 +946,7 @@ public:
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature) npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature)
{ {
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); 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. me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse.
} }
@@ -970,7 +969,7 @@ public:
me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); 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->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); me->SetFacingToObject(car);
// xinef: add some flags // xinef: add some flags
car->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); 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); Talk(SAY_SCARLET_MINER_0);
SetRun(true); SetRun(true);
@@ -86,7 +86,7 @@ public:
playerGUID = player->GetGUID(); playerGUID = player->GetGUID();
speechTimer = 1000; speechTimer = 1000;
speechCounter = 1; speechCounter = 1;
me->setFaction(player->getFaction()); me->SetFaction(player->GetFaction());
me->CombatStop(true); me->CombatStop(true);
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
@@ -1054,7 +1054,7 @@ public:
float o = me->GetAngle(tirion); 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->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->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
tirion->setFaction(35); tirion->SetFaction(FACTION_FRIENDLY);
} }
break; break;
case EVENT_OUTRO_SCENE_48: case EVENT_OUTRO_SCENE_48:
@@ -36,7 +36,6 @@ enum AshbringerEventMisc
NPC_FAIRBANKS = 4542, NPC_FAIRBANKS = 4542,
NPC_COMMANDER_MOGRAINE = 3976, NPC_COMMANDER_MOGRAINE = 3976,
NPC_INQUISITOR_WHITEMANE = 3977, NPC_INQUISITOR_WHITEMANE = 3977,
FACTION_FRIENDLY_TO_ALL = 35,
DOOR_HIGH_INQUISITOR_ID = 104600, DOOR_HIGH_INQUISITOR_ID = 104600,
}; };
@@ -86,8 +85,7 @@ public:
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f);
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f);
if (!ScarletList.empty()) if (!ScarletList.empty())
for (std::list<Creature*>::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) for (std::list<Creature*>::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY);
(*itr)->setFaction(FACTION_FRIENDLY_TO_ALL);
} }
} }
@@ -108,8 +106,7 @@ public:
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f);
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f);
if (!ScarletList.empty()) if (!ScarletList.empty())
for (std::list<Creature*>::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) for (std::list<Creature*>::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY);
(*itr)->setFaction(FACTION_FRIENDLY_TO_ALL);
} }
} }
@@ -221,7 +218,7 @@ public:
if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer)
{ {
Talk(SAY_WELCOME); Talk(SAY_WELCOME);
me->setFaction(FACTION_FRIENDLY_TO_ALL); me->SetFaction(FACTION_FRIENDLY);
me->SetSheath(SHEATH_STATE_UNARMED); me->SetSheath(SHEATH_STATE_UNARMED);
me->SetFacingToObject(player); me->SetFacingToObject(player);
me->SetStandState(UNIT_STAND_STATE_KNEEL); me->SetStandState(UNIT_STAND_STATE_KNEEL);
@@ -318,7 +315,7 @@ public:
return 10 * IN_MILLISECONDS; return 10 * IN_MILLISECONDS;
case 4: case 4:
me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine"); 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; return 30 * IN_MILLISECONDS;
case 5: case 5:
mograine->StopMovingOnCurrentPos(); mograine->StopMovingOnCurrentPos();
@@ -381,7 +378,7 @@ public:
if (Player* player = who->ToPlayer()) if (Player* player = who->ToPlayer())
if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer)
{ {
me->setFaction(FACTION_FRIENDLY_TO_ALL); me->SetFaction(FACTION_FRIENDLY);
me->SetSheath(SHEATH_STATE_UNARMED); me->SetSheath(SHEATH_STATE_UNARMED);
me->SetStandState(UNIT_STAND_STATE_KNEEL); me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->SetFacingToObject(player); me->SetFacingToObject(player);
@@ -783,7 +780,7 @@ public:
if (Player* player = who->ToPlayer()) if (Player* player = who->ToPlayer())
if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) 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->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetSheath(SHEATH_STATE_UNARMED); me->SetSheath(SHEATH_STATE_UNARMED);
me->CastSpell(me, 57767, true); me->CastSpell(me, 57767, true);
@@ -243,12 +243,12 @@ public:
if (instance->GetData(DATA_MINI_BOSSES) != 6) if (instance->GetData(DATA_MINI_BOSSES) != 6)
{ {
me->SetVisible(false); me->SetVisible(false);
me->setFaction(35); me->SetFaction(35);
} }
else else
{ {
me->SetVisible(true); me->SetVisible(true);
me->setFaction(21); me->SetFaction(21);
} }
OpenAllGates(); OpenAllGates();
summons.DespawnAll(); summons.DespawnAll();
@@ -371,7 +371,7 @@ public:
break; break;
case EVENT_MAD_20: case EVENT_MAD_20:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 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))) if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BRUTALLUS)))
{ {
brutallus->AI()->Talk(YELL_INTRO_TAUNT); brutallus->AI()->Talk(YELL_INTRO_TAUNT);
@@ -241,7 +241,7 @@ public:
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->CombatStop(); me->CombatStop();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
events2.ScheduleEvent(EVENT_TALK_GOOD_2, 1000); events2.ScheduleEvent(EVENT_TALK_GOOD_2, 1000);
break; break;
case EVENT_TALK_GOOD_2: case EVENT_TALK_GOOD_2:
@@ -1,4 +1,4 @@
/* /*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * 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 * This program is free software; you can redistribute it and/or modify it
@@ -186,7 +186,7 @@ public:
y = 1380.0f + rand() % 60; y = 1380.0f + rand() % 60;
if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000)) if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000))
{ {
trigger->setFaction(35); trigger->SetFaction(FACTION_FRIENDLY);
trigger->SetMaxHealth(100000); trigger->SetMaxHealth(100000);
trigger->SetHealth(100000); trigger->SetHealth(100000);
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -281,7 +281,7 @@ public:
Cloud->SetDisableGravity(true); Cloud->SetDisableGravity(true);
Cloud->StopMoving(); Cloud->StopMoving();
Cloud->SetObjectScale(1.0f); Cloud->SetObjectScale(1.0f);
Cloud->setFaction(35); Cloud->SetFaction(FACTION_FRIENDLY);
Cloud->SetMaxHealth(9999999); Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999); Cloud->SetHealth(9999999);
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -174,7 +174,7 @@ public:
if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN))) if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN)))
{ {
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->setFaction(14); pLorKhan->SetFaction(FACTION_MONSTER);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetFullHealth(); pLorKhan->SetFullHealth();
instance->SetData(DATA_LORKHAN, DONE); instance->SetData(DATA_LORKHAN, DONE);
@@ -187,7 +187,7 @@ public:
if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH))) if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH)))
{ {
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->setFaction(14); pZath->SetFaction(FACTION_MONSTER);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetFullHealth(); pZath->SetFullHealth();
instance->SetBossState(DATA_ZATH, DONE); instance->SetBossState(DATA_ZATH, DONE);
@@ -361,7 +361,7 @@ public:
{ {
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14); pThekal->SetFaction(FACTION_MONSTER);
pThekal->SetFullHealth(); pThekal->SetFullHealth();
} }
} }
@@ -373,7 +373,7 @@ public:
{ {
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->setFaction(14); pZath->SetFaction(FACTION_MONSTER);
pZath->SetFullHealth(); pZath->SetFullHealth();
} }
} }
@@ -389,7 +389,7 @@ public:
me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_SLEEP); me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->AttackStop(); me->AttackStop();
instance->SetBossState(DATA_LORKHAN, SPECIAL); instance->SetBossState(DATA_LORKHAN, SPECIAL);
@@ -514,7 +514,7 @@ public:
{ {
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->setFaction(14); pLorKhan->SetFaction(FACTION_MONSTER);
pLorKhan->SetFullHealth(); pLorKhan->SetFullHealth();
} }
} }
@@ -526,7 +526,7 @@ public:
{ {
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14); pThekal->SetFaction(FACTION_MONSTER);
pThekal->SetFullHealth(); pThekal->SetFullHealth();
} }
} }
@@ -542,7 +542,7 @@ public:
me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_SLEEP); me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->AttackStop(); me->AttackStop();
instance->SetBossState(DATA_ZATH, SPECIAL); instance->SetBossState(DATA_ZATH, SPECIAL);
@@ -51,8 +51,7 @@ enum ProfessorPhizzlethorpe
// Quests // Quests
QUEST_SUNKEN_TREASURE = 665, QUEST_SUNKEN_TREASURE = 665,
// Creatures // Creatures
NPC_VENGEFUL_SURGE = 2776, NPC_VENGEFUL_SURGE = 2776
FACTION_SUNKEN_TREASURE = 113
}; };
class npc_professor_phizzlethorpe : public CreatureScript class npc_professor_phizzlethorpe : public CreatureScript
@@ -119,7 +118,7 @@ public:
{ {
Talk(SAY_PROGRESS_1, player); Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest); npc_escortAI::Start(false, false, player->GetGUID(), quest);
me->setFaction(FACTION_SUNKEN_TREASURE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
} }
} }
@@ -38,8 +38,7 @@ enum TwilightCorrupter
SPELL_LEVEL_UP = 24312, SPELL_LEVEL_UP = 24312,
EVENT_SOUL_CORRUPTION = 1, EVENT_SOUL_CORRUPTION = 1,
EVENT_CREATURE_OF_NIGHTMARE = 2, EVENT_CREATURE_OF_NIGHTMARE = 2
FACTION_HOSTILE = 14
}; };
/*###### /*######
@@ -83,7 +82,7 @@ public:
{ {
_introSpoken = true; _introSpoken = true;
Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, who); Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, who);
me->setFaction(FACTION_HOSTILE); me->SetFaction(FACTION_MONSTER);
} }
ScriptedAI::MoveInLineOfSight(who); ScriptedAI::MoveInLineOfSight(who);
} }
@@ -72,7 +72,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_BALANCE_OF_LIGHT_AND_SHADOW) 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()); creature->AI()->SetGUID(player->GetGUID());
} }
@@ -160,7 +160,7 @@ public:
summons.Summon(creature); summons.Summon(creature);
if (creature->GetEntry() == NPC_INJURED_PEASANT || creature->GetEntry() == NPC_PLAGUED_PEASANT) if (creature->GetEntry() == NPC_INJURED_PEASANT || creature->GetEntry() == NPC_PLAGUED_PEASANT)
{ {
creature->setFaction(_faction); creature->SetFaction(_faction);
if (!_spoken) if (!_spoken)
{ {
_spoken = true; _spoken = true;
@@ -49,8 +49,7 @@ enum RangerLilatha
GO_CAGE = 181152, GO_CAGE = 181152,
NPC_CAPTAIN_HELIOS = 16220, NPC_CAPTAIN_HELIOS = 16220,
NPC_MUMMIFIED_HEADHUNTER = 16342, NPC_MUMMIFIED_HEADHUNTER = 16342,
NPC_SHADOWPINE_ORACLE = 16343, NPC_SHADOWPINE_ORACLE = 16343
FACTION_QUEST_ESCAPE = 113
}; };
class npc_ranger_lilatha : public CreatureScript class npc_ranger_lilatha : public CreatureScript
@@ -130,7 +129,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) 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())) if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, false, player->GetGUID());
@@ -63,7 +63,7 @@ public:
Talk(SAY_CORPORAL_1, player); Talk(SAY_CORPORAL_1, player);
npc_escortAI::Start(true, false, player->GetGUID(), quest); npc_escortAI::Start(true, false, player->GetGUID(), quest);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
me->setFaction(250); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
} }
} }
@@ -240,7 +240,7 @@ public:
if (!target) if (!target)
target = me; target = me;
summoned->setFaction(123); summoned->SetFaction(FACTION_STORMWIND);
summoned->AddThreat(target, 32.0f); summoned->AddThreat(target, 32.0f);
summoned->AI()->AttackStart(target); summoned->AI()->AttackStart(target);
} }
@@ -43,7 +43,6 @@ EndContentData */
enum Bartleby enum Bartleby
{ {
FACTION_ENEMY = 168,
QUEST_BEAT = 1640 QUEST_BEAT = 1640
}; };
@@ -56,7 +55,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_BEAT) if (quest->GetQuestId() == QUEST_BEAT)
{ {
creature->setFaction(FACTION_ENEMY); creature->SetFaction(FACTION_ENEMY);
creature->AI()->AttackStart(player); creature->AI()->AttackStart(player);
} }
return true; return true;
@@ -71,15 +70,15 @@ public:
{ {
npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) npc_bartlebyAI(Creature* creature) : ScriptedAI(creature)
{ {
m_uiNormalFaction = creature->getFaction(); m_uiNormalFaction = creature->GetFaction();
} }
uint32 m_uiNormalFaction; uint32 m_uiNormalFaction;
void Reset() override void Reset() override
{ {
if (me->getFaction() != m_uiNormalFaction) if (me->GetFaction() != m_uiNormalFaction)
me->setFaction(m_uiNormalFaction); me->SetFaction(m_uiNormalFaction);
} }
void AttackedBy(Unit* pAttacker) override void AttackedBy(Unit* pAttacker) override
@@ -259,8 +258,8 @@ public:
if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true))
pTyrion->AI()->Talk(SAY_TYRION_2); pTyrion->AI()->Talk(SAY_TYRION_2);
if (Creature* pMarzon = ObjectAccessor::GetCreature(*me, MarzonGUID)) if (Creature* pMarzon = ObjectAccessor::GetCreature(*me, MarzonGUID))
pMarzon->setFaction(14); pMarzon->SetFaction(FACTION_MONSTER);
me->setFaction(14); me->SetFaction(FACTION_MONSTER);
uiTimer = 0; uiTimer = 0;
uiPhase = 0; uiPhase = 0;
break; break;
@@ -73,7 +73,7 @@ public:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
me->CombatStop(); //stop combat me->CombatStop(); //stop combat
me->DeleteThreatList(); //unsure of this me->DeleteThreatList(); //unsure of this
me->setFaction(83); //horde generic me->SetFaction(FACTION_HORDE_GENERIC);
bReset = true; bReset = true;
Reset_Timer = 60000; Reset_Timer = 60000;
@@ -91,7 +91,7 @@ public:
{ {
EnterEvadeMode(); EnterEvadeMode();
bReset = false; bReset = false;
me->setFaction(28); //troll, bloodscalp me->SetFaction(FACTION_TROLL_BLOODSCALP);
return; return;
} }
@@ -40,8 +40,7 @@ enum Calvin
{ {
SAY_COMPLETE = 0, SAY_COMPLETE = 0,
SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct)
QUEST_590 = 590, QUEST_590 = 590
FACTION_HOSTILE = 168
}; };
class npc_calvin_montague : public CreatureScript class npc_calvin_montague : public CreatureScript
@@ -53,7 +52,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_590) if (quest->GetQuestId() == QUEST_590)
{ {
creature->setFaction(FACTION_HOSTILE); creature->SetFaction(FACTION_ENEMY);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player);
} }
@@ -354,12 +354,6 @@ public:
} }
}; };
enum Factions
{
FACTION_HOSTILE = 14,
FACTION_FRIENDLY_TO_ALL = 35
};
/*###### /*######
## ALLIANCE ## ALLIANCE
#######*/ #######*/
@@ -1616,7 +1610,7 @@ public:
{ {
jaina->GetMotionMaster()->MoveFollow(me, 5, PET_FOLLOW_ANGLE); jaina->GetMotionMaster()->MoveFollow(me, 5, PET_FOLLOW_ANGLE);
jaina->SetReactState(REACT_AGGRESSIVE); jaina->SetReactState(REACT_AGGRESSIVE);
jaina->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); jaina->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE);
} }
bStepping = false; bStepping = false;
JumpToNextStep(0); JumpToNextStep(0);
@@ -2464,7 +2458,7 @@ public:
summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true); summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true);
summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SYLVANAS_BUFF, true); summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SYLVANAS_BUFF, true);
if (!EnableAttack) if (!EnableAttack)
summoned->setFaction(FACTION_FRIENDLY_TO_ALL); summoned->SetFaction(FACTION_FRIENDLY);
summoned->AddThreat(me, 100.0f); summoned->AddThreat(me, 100.0f);
me->AddThreat(summoned, 100.0f); me->AddThreat(summoned, 100.0f);
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
@@ -2568,7 +2562,7 @@ public:
sylvanas->GetMotionMaster()->Clear(); sylvanas->GetMotionMaster()->Clear();
sylvanas->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC); sylvanas->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
sylvanas->SetReactState(REACT_AGGRESSIVE); 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); 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_DOCTOR_H, 1000.0f);
me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_CHEMIST_H, 1000.0f); me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_CHEMIST_H, 1000.0f);
if (!HostileEndList.empty()) if (!HostileEndList.empty())
for (std::list<Creature*>::iterator itr = HostileEndList.begin(); itr != HostileEndList.end(); itr++) for (std::list<Creature*>::iterator itr = HostileEndList.begin(); itr != HostileEndList.end(); itr++) (*itr)->SetFaction(FACTION_MONSTER);
(*itr)->setFaction(FACTION_HOSTILE);
SpawnWave(4); SpawnWave(4);
JumpToNextStep(10 * IN_MILLISECONDS); JumpToNextStep(10 * IN_MILLISECONDS);
break; break;
@@ -39,7 +39,6 @@ EndContentData */
enum TapokeSlim enum TapokeSlim
{ {
QUEST_MISSING_DIPLO_PT11 = 1249, QUEST_MISSING_DIPLO_PT11 = 1249,
FACTION_ENEMY = 168,
SPELL_STEALTH = 1785, SPELL_STEALTH = 1785,
SPELL_CALL_FRIENDS = 16457, //summons 1x friend SPELL_CALL_FRIENDS = 16457, //summons 1x friend
NPC_SLIMS_FRIEND = 4971, NPC_SLIMS_FRIEND = 4971,
@@ -76,7 +75,7 @@ public:
if (me->HasStealthAura()) if (me->HasStealthAura())
me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
SetRun(); SetRun();
me->setFaction(FACTION_ENEMY); me->SetFaction(FACTION_ENEMY);
break; break;
} }
} }
+5 -7
View File
@@ -1545,7 +1545,6 @@ enum BrewfestRevelerEnum
{ {
FACTION_ALLIANCE = 1934, FACTION_ALLIANCE = 1934,
FACTION_HORDE = 1935, FACTION_HORDE = 1935,
FACTION_FRIENDLY = 35,
SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_MALE = 44003, SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_MALE = 44003,
SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_FEMALE = 44004, SPELL_BREWFEST_REVELER_TRANSFORM_GOBLIN_FEMALE = 44004,
@@ -1585,7 +1584,7 @@ public:
break; break;
} }
GetTarget()->setFaction(factionId); GetTarget()->SetFaction(factionId);
} }
void Register() override void Register() override
@@ -1714,7 +1713,6 @@ enum DirebrewMisc
GOSSIP_OPTION_APOLOGIZE = 1, GOSSIP_OPTION_APOLOGIZE = 1,
DATA_TARGET_GUID = 1, DATA_TARGET_GUID = 1,
MAX_ANTAGONISTS = 3, MAX_ANTAGONISTS = 3,
FACTION_GOBLIN_DARK_IRON_BAR_PATRON = 736,
DATA_COREN = 33, DATA_COREN = 33,
GO_MACHINE_SUMMONER = 188508 GO_MACHINE_SUMMONER = 188508
}; };
@@ -1769,7 +1767,7 @@ public:
_events.Reset(); _events.Reset();
_summons.DespawnAll(); _summons.DespawnAll();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->setFaction(FACTION_FRIENDLY); me->SetFaction(FACTION_FRIENDLY);
_events.SetPhase(PHASE_ALL); _events.SetPhase(PHASE_ALL);
for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i) for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i)
@@ -1808,7 +1806,7 @@ public:
{ {
_events.SetPhase(PHASE_ONE); _events.SetPhase(PHASE_ONE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); 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(); DoZoneInCombat();
EntryCheckPredicate pred(NPC_ANTAGONIST); EntryCheckPredicate pred(NPC_ANTAGONIST);
@@ -2032,7 +2030,7 @@ public:
void Reset() override void Reset() override
{ {
me->setFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON); me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON);
DoZoneInCombat(); DoZoneInCombat();
} }
@@ -2075,7 +2073,7 @@ public:
break; break;
case ACTION_ANTAGONIST_HOSTILE: case ACTION_ANTAGONIST_HOSTILE:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); 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(); DoZoneInCombat();
break; break;
default: default:
+4 -4
View File
@@ -359,7 +359,7 @@ public:
void Reset() override void Reset() override
{ {
speachTimer = 0; speachTimer = 0;
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
summons.DespawnAll(); summons.DespawnAll();
events.Reset(); events.Reset();
me->SummonCreature(NPC_APOTHECARY_FRYE, -205.449f, 2219.56f, 79.7633f, 0.7f); me->SummonCreature(NPC_APOTHECARY_FRYE, -205.449f, 2219.56f, 79.7633f, 0.7f);
@@ -383,7 +383,7 @@ public:
void JustSummoned(Creature* cr) override void JustSummoned(Creature* cr) override
{ {
summons.Summon(cr); summons.Summon(cr);
cr->setFaction(35); cr->SetFaction(FACTION_FRIENDLY);
cr->SetControlled(true, UNIT_STATE_STUNNED); cr->SetControlled(true, UNIT_STATE_STUNNED);
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
} }
@@ -407,7 +407,7 @@ public:
{ {
me->AI()->Talk(SAY_HUMMEL_2); me->AI()->Talk(SAY_HUMMEL_2);
speachTimer = 0; speachTimer = 0;
me->setFaction(16); me->SetFaction(FACTION_MONSTER_2);
me->SetInCombatWithZone(); me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f)) if (Unit* target = SelectTargetFromPlayerList(40.0f))
{ {
@@ -513,7 +513,7 @@ public:
{ {
me->SetControlled(false, UNIT_STATE_STUNNED); me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16); me->SetFaction(FACTION_MONSTER_2);
me->SetInCombatWithZone(); me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f)) if (Unit* target = SelectTargetFromPlayerList(40.0f))
AttackStart(target); AttackStart(target);
+1 -1
View File
@@ -240,7 +240,7 @@ public:
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
{ {
caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true); caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true);
caster->setFaction(88); caster->SetFaction(FACTION_BLACKFATHOM);
} }
} }
@@ -464,7 +464,7 @@ public:
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
else 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_NON_ATTACKABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} }
@@ -553,15 +553,15 @@ public:
if (!me->IsInCombat()) if (!me->IsInCombat())
{ {
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. // 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->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); me->SetVisible(true);
} }
@@ -910,7 +910,7 @@ void hyjalAI::HideNearPos(float x, float y)
for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr) for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
{ {
(*itr)->SetVisible(false); (*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()) if ((*itr) && (*itr)->IsAlive())
{ {
(*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); (*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); (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
} }
} }
@@ -471,7 +471,7 @@ public:
if (trigger) if (trigger)
{ {
trigger->SetVisible(false); trigger->SetVisible(false);
trigger->setFaction(me->getFaction()); trigger->SetFaction(me->GetFaction());
trigger->SetDisableGravity(true); trigger->SetDisableGravity(true);
trigger->CastSpell(me, SPELL_METEOR, true); trigger->CastSpell(me, SPELL_METEOR, true);
} }
@@ -45,8 +45,6 @@ enum Belnistrasz
EVENT_FIREBALL = 5, EVENT_FIREBALL = 5,
EVENT_FROST_NOVA = 6, EVENT_FROST_NOVA = 6,
FACTION_ESCORT = 250,
PATH_ESCORT = 871710, PATH_ESCORT = 871710,
POINT_REACH_IDOL = 17, POINT_REACH_IDOL = 17,
@@ -122,7 +120,7 @@ public:
eventInProgress = true; eventInProgress = true;
Talk(SAY_QUEST_ACCEPTED); Talk(SAY_QUEST_ACCEPTED);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); 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); me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
} }
} }
@@ -105,7 +105,7 @@ public:
//Cast //Cast
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
DoCast(me, SPELL_DIRTMOUND_PASSIVE); DoCast(me, SPELL_DIRTMOUND_PASSIVE);
Submerged = true; Submerged = true;
@@ -129,7 +129,7 @@ public:
if (Submerged && Back_Timer <= diff) if (Submerged && Back_Timer <= diff)
{ {
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(14); me->SetFaction(FACTION_MONSTER);
DoCastVictim(SPELL_GROUND_RUPTURE); DoCastVictim(SPELL_GROUND_RUPTURE);
@@ -319,7 +319,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (c->isDead()) if (c->isDead())
{ {
c->Respawn(); c->Respawn();
c->setFaction(7); c->SetFaction(FACTION_CREATURE);
c->RemoveAllAuras(); c->RemoveAllAuras();
} }
if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE)) if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
@@ -414,7 +414,7 @@ public:
void CastSpellOnBug(Creature* target) override void CastSpellOnBug(Creature* target) override
{ {
target->setFaction(14); target->SetFaction(FACTION_MONSTER);
target->AI()->AttackStart(me->getThreatMgr().getHostilTarget()); target->AI()->AttackStart(me->getThreatMgr().getHostilTarget());
target->AddAura(SPELL_MUTATE_BUG, target); target->AddAura(SPELL_MUTATE_BUG, target);
target->SetFullHealth(); target->SetFullHealth();
@@ -503,7 +503,7 @@ public:
void CastSpellOnBug(Creature* target) override void CastSpellOnBug(Creature* target) override
{ {
target->setFaction(14); target->SetFaction(FACTION_MONSTER);
target->AddAura(SPELL_EXPLODEBUG, target); target->AddAura(SPELL_EXPLODEBUG, target);
target->SetFullHealth(); target->SetFullHealth();
} }
@@ -65,7 +65,7 @@ public:
void InitializeAI() override void InitializeAI() override
{ {
startedFight = false; startedFight = false;
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
postGossipStep = 0; postGossipStep = 0;
Text_Timer = 0; Text_Timer = 0;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -125,7 +125,7 @@ public:
Text_Timer = 5000; Text_Timer = 5000;
break; break;
case 3: case 3:
me->setFaction(14); me->SetFaction(FACTION_MONSTER);
Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID); Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID);
switchFactionIfAlive(NPC_RAVEN, target); switchFactionIfAlive(NPC_RAVEN, target);
@@ -186,7 +186,7 @@ public:
{ {
if (crew->IsAlive()) if (crew->IsAlive())
{ {
crew->setFaction(14); crew->SetFaction(FACTION_MONSTER);
if (target) if (target)
{ {
@@ -279,7 +279,7 @@ public:
crew->SetWalk(true); crew->SetWalk(true);
crew->SetHomePosition(x, y, z, 4.78f); crew->SetHomePosition(x, y, z, 4.78f);
crew->GetMotionMaster()->MovePoint(1, { 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) switch (entry)
{ {
@@ -470,7 +470,7 @@ public:
{ {
if (me->IsAlive()) if (me->IsAlive())
{ {
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->SetWalk(false); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(0, { 1858.57f, 1146.35f, 14.745f, 3.85f }); me->GetMotionMaster()->MovePoint(0, { 1858.57f, 1146.35f, 14.745f, 3.85f });
me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f); me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f);
@@ -29,7 +29,6 @@ EndScriptData */
enum Muglash enum Muglash
{ {
FACTION_QUEST = 113,
SAY_MUG_START1 = 0, SAY_MUG_START1 = 0,
SAY_MUG_START2 = 1, SAY_MUG_START2 = 1,
SAY_MUG_BRAZIER = 2, SAY_MUG_BRAZIER = 2,
@@ -117,7 +116,7 @@ public:
if (quest->GetQuestId() == QUEST_VORSHA) if (quest->GetQuestId() == QUEST_VORSHA)
{ {
Talk(SAY_MUG_START1); Talk(SAY_MUG_START1);
me->setFaction(FACTION_QUEST); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, false, player->GetGUID()); npc_escortAI::Start(true, false, player->GetGUID());
} }
} }
+1 -1
View File
@@ -356,7 +356,7 @@ public:
{ {
Talk(SAY_RIZZLE_FINAL); Talk(SAY_RIZZLE_FINAL);
me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
Reached = true; Reached = true;
@@ -228,8 +228,7 @@ enum Magwin
EVENT_STAND = 3, EVENT_STAND = 3,
EVENT_TALK_END = 4, EVENT_TALK_END = 4,
EVENT_COWLEN_TALK = 5, EVENT_COWLEN_TALK = 5,
QUEST_A_CRY_FOR_HELP = 9528, QUEST_A_CRY_FOR_HELP = 9528
FACTION_QUEST = 113
}; };
class npc_magwin : public CreatureScript class npc_magwin : public CreatureScript
@@ -297,7 +296,7 @@ public:
{ {
Talk(SAY_START, player); Talk(SAY_START, player);
} }
me->setFaction(FACTION_QUEST); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
_events.ScheduleEvent(EVENT_START_ESCORT, 1000); _events.ScheduleEvent(EVENT_START_ESCORT, 1000);
break; break;
case EVENT_START_ESCORT: case EVENT_START_ESCORT:
@@ -176,8 +176,7 @@ enum Kerlonian
SPELL_SLEEP_VISUAL = 25148, SPELL_SLEEP_VISUAL = 25148,
SPELL_AWAKEN = 17536, SPELL_AWAKEN = 17536,
QUEST_SLEEPER_AWAKENED = 5321, QUEST_SLEEPER_AWAKENED = 5321,
NPC_LILADRIS = 11219, //attackers entries unknown NPC_LILADRIS = 11219 //attackers entries unknown
FACTION_KER_ESCORTEE = 113
}; };
/// @todo make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. /// @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->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_KER_START, player); 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, SAY_REM_REMEMBER = 11,
EMOTE_REM_END = 12, EMOTE_REM_END = 12,
FACTION_ESCORTEE = 10,
QUEST_ABSENT_MINDED_PT2 = 731, QUEST_ABSENT_MINDED_PT2 = 731,
NPC_GRAVEL_SCOUT = 2158, NPC_GRAVEL_SCOUT = 2158,
NPC_GRAVEL_BONE = 2159, NPC_GRAVEL_BONE = 2159,
@@ -412,7 +410,7 @@ public:
if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID()); pEscortAI->Start(false, false, player->GetGUID());
creature->setFaction(FACTION_ESCORTEE); creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
} }
return true; return true;
@@ -73,7 +73,7 @@ public:
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
{ {
if (quest->GetQuestId() == QUEST_BODYGUARD_FOR_HIRE) if (quest->GetQuestId() == QUEST_BODYGUARD_FOR_HIRE)
creature->AI()->SetGUID(player->GetGUID(), player->getFaction()); creature->AI()->SetGUID(player->GetGUID(), player->GetFaction());
return true; return true;
} }
@@ -155,7 +155,7 @@ public:
{ {
if (field == 1 && data == 1) if (field == 1 && data == 1)
if (Player* player = me->SelectNearestPlayer(50.0f)) if (Player* player = me->SelectNearestPlayer(50.0f))
SetGUID(player->GetGUID(), player->getFaction()); SetGUID(player->GetGUID(), player->GetFaction());
} }
bool CheckCaravan() bool CheckCaravan()
@@ -256,7 +256,7 @@ public:
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i) for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i])) if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
{ {
summon->setFaction(faction); summon->SetFaction(faction);
if (remove) if (remove)
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
else else
@@ -266,7 +266,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
else else
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
me->setFaction(faction); me->SetFaction(faction);
} }
void WaypointReached(uint32 waypointId) override void WaypointReached(uint32 waypointId) override
+1 -1
View File
@@ -204,7 +204,7 @@ public:
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); 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->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); me->GetMotionMaster()->MoveFollow(player, 3.f, M_PI);
_events.ScheduleEvent(EVENT_WANDERING_START, urand(40 * IN_MILLISECONDS, 70 * IN_MILLISECONDS)); _events.ScheduleEvent(EVENT_WANDERING_START, urand(40 * IN_MILLISECONDS, 70 * IN_MILLISECONDS));
@@ -44,9 +44,6 @@ enum EternalBoard
{ {
QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519,
FACTION_HOSTILE = 14,
FACTION_FRIENDLY = 35,
C_ANACHRONOS = 15381, C_ANACHRONOS = 15381,
C_FANDRAL_STAGHELM = 15382, C_FANDRAL_STAGHELM = 15382,
C_ARYGOS = 15380, C_ARYGOS = 15380,
@@ -919,7 +916,7 @@ public:
Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420);
Merithra->setFaction(35); Merithra->SetFaction(FACTION_FRIENDLY);
} }
if (Caelestrasz) if (Caelestrasz)
@@ -927,7 +924,7 @@ public:
Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419);
Caelestrasz->setFaction(35); Caelestrasz->SetFaction(FACTION_FRIENDLY);
} }
if (Arygos) if (Arygos)
@@ -935,7 +932,7 @@ public:
Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418);
Arygos->setFaction(35); Arygos->SetFaction(FACTION_FRIENDLY);
} }
if (Anachronos) if (Anachronos)
@@ -152,7 +152,7 @@ public:
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, false, player->GetGUID());
creature->AI()->Talk(SAY_START); 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); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
} }
return true; return true;
+2 -2
View File
@@ -75,7 +75,7 @@ public:
{ {
SendItemTimer = 0; SendItemTimer = 0;
SwitchFactionTimer = 10000; SwitchFactionTimer = 10000;
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
isFriendly = true; isFriendly = true;
AquaJetTimer = 5000; AquaJetTimer = 5000;
@@ -109,7 +109,7 @@ public:
{ {
if (SwitchFactionTimer <= diff) if (SwitchFactionTimer <= diff)
{ {
me->setFaction(91); me->SetFaction(FACTION_ELEMENTAL);
isFriendly = false; isFriendly = false;
} }
else SwitchFactionTimer -= diff; else SwitchFactionTimer -= diff;
@@ -91,8 +91,7 @@ enum Gilthares
SAY_GIL_FREED = 7, SAY_GIL_FREED = 7,
QUEST_FREE_FROM_HOLD = 898, QUEST_FREE_FROM_HOLD = 898,
AREA_MERCHANT_COAST = 391, AREA_MERCHANT_COAST = 391
FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest
}; };
class npc_gilthares : public CreatureScript class npc_gilthares : public CreatureScript
@@ -104,7 +103,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) 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->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_GIL_START, player); creature->AI()->Talk(SAY_GIL_START, player);
@@ -197,7 +196,7 @@ public:
{ {
npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature)
{ {
factionNorm = creature->getFaction(); factionNorm = creature->GetFaction();
} }
uint32 factionNorm; uint32 factionNorm;
@@ -210,7 +209,7 @@ public:
IsFriend = false; IsFriend = false;
ResetTimer = 120000; ResetTimer = 120000;
FlareCount = 0; FlareCount = 0;
me->setFaction(factionNorm); me->SetFaction(factionNorm);
} }
void DoFriend() void DoFriend()
@@ -222,7 +221,7 @@ public:
me->StopMoving(); me->StopMoving();
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->setFaction(FACTION_FRIENDLY_F); me->SetFaction(FACTION_FRIENDLY);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
} }
@@ -263,7 +262,7 @@ public:
{ {
if (FlareCount >= 2) if (FlareCount >= 2)
{ {
if (me->getFaction() == FACTION_FRIENDLY_F) if (me->GetFaction() == FACTION_FRIENDLY_F)
return; return;
DoFriend(); DoFriend();
@@ -408,7 +407,7 @@ public:
Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if (!creature) if (!creature)
continue; continue;
creature->setFaction(35); creature->SetFaction(FACTION_FRIENDLY);
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); 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_NOT_SELECTABLE);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
creature->setFaction(14); creature->SetFaction(FACTION_MONSTER);
creature->AI()->AttackStart(pWarrior); creature->AI()->AttackStart(pWarrior);
} }
++Wave; ++Wave;
@@ -481,7 +480,7 @@ public:
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
creature->setFaction(14); creature->SetFaction(FACTION_MONSTER);
creature->AI()->AttackStart(pWarrior); creature->AI()->AttackStart(pWarrior);
} }
WaveTimer = 2000; WaveTimer = 2000;
@@ -511,7 +510,6 @@ enum Wizzlecrank
SAY_END = 6, SAY_END = 6,
QUEST_ESCAPE = 863, QUEST_ESCAPE = 863,
FACTION_RATCHET = 637,
NPC_PILOT_WIZZ = 3451, NPC_PILOT_WIZZ = 3451,
NPC_MERCENARY = 3282, NPC_MERCENARY = 3282,
}; };
@@ -644,7 +642,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_ESCAPE) if (quest->GetQuestId() == QUEST_ESCAPE)
{ {
creature->setFaction(FACTION_RATCHET); creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START); creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, false, player->GetGUID());
@@ -50,7 +50,6 @@ enum Lakota
QUEST_FREE_AT_LAST = 4904, QUEST_FREE_AT_LAST = 4904,
NPC_GRIM_BANDIT = 10758, NPC_GRIM_BANDIT = 10758,
FACTION_ESCORTEE_LAKO = 232, //guessed
ID_AMBUSH_1 = 0, ID_AMBUSH_1 = 0,
ID_AMBUSH_2 = 2, ID_AMBUSH_2 = 2,
@@ -77,7 +76,7 @@ public:
if (quest->GetQuestId() == QUEST_FREE_AT_LAST) if (quest->GetQuestId() == QUEST_FREE_AT_LAST)
{ {
creature->AI()->Talk(SAY_LAKO_START, player); 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())) if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, false, player->GetGUID(), quest);
@@ -138,8 +137,7 @@ enum Packa
SAY_COMPLETE = 2, SAY_COMPLETE = 2,
QUEST_HOMEWARD = 4770, QUEST_HOMEWARD = 4770,
NPC_WYVERN = 4107, NPC_WYVERN = 4107
FACTION_ESCORTEE = 232 //guessed
}; };
Position const WyvernLoc[3] = Position const WyvernLoc[3] =
@@ -159,7 +157,7 @@ public:
if (quest->GetQuestId() == QUEST_HOMEWARD) if (quest->GetQuestId() == QUEST_HOMEWARD)
{ {
creature->AI()->Talk(SAY_START, player); 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())) if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, false, player->GetGUID(), quest);
@@ -212,7 +210,6 @@ public:
enum Plucky enum Plucky
{ {
FACTION_FRIENDLY = 35,
QUEST_SCOOP = 1950, QUEST_SCOOP = 1950,
SPELL_PLUCKY_HUMAN = 9192, SPELL_PLUCKY_HUMAN = 9192,
SPELL_PLUCKY_CHICKEN = 9220 SPELL_PLUCKY_CHICKEN = 9220
@@ -253,7 +250,7 @@ public:
struct npc_pluckyAI : public ScriptedAI 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 NormFaction;
uint32 ResetTimer; uint32 ResetTimer;
@@ -262,8 +259,8 @@ public:
{ {
ResetTimer = 120000; ResetTimer = 120000;
if (me->getFaction() != NormFaction) if (me->GetFaction() != NormFaction)
me->setFaction(NormFaction); me->SetFaction(NormFaction);
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
me->RemoveFlag(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) if (TextEmote == TEXT_EMOTE_BECKON)
{ {
me->setFaction(FACTION_FRIENDLY); me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(me, SPELL_PLUCKY_HUMAN, false); DoCast(me, SPELL_PLUCKY_HUMAN, false);
} }
@@ -289,7 +286,7 @@ public:
return; return;
else else
{ {
me->setFaction(FACTION_FRIENDLY); me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(me, SPELL_PLUCKY_HUMAN, false); DoCast(me, SPELL_PLUCKY_HUMAN, false);
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
@@ -64,7 +64,7 @@ public:
creature->AI()->Talk(SAY_READY, player); creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
// Change faction so mobs attack // Change faction so mobs attack
creature->setFaction(113); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
} }
return true; return true;
} }
@@ -164,8 +164,7 @@ enum Ringo
SPELL_REVIVE_RINGO = 15591, SPELL_REVIVE_RINGO = 15591,
QUEST_A_LITTLE_HELP = 4491, QUEST_A_LITTLE_HELP = 4491,
NPC_SPRAGGLE = 9997, NPC_SPRAGGLE = 9997
FACTION_ESCORTEE = 113
}; };
class npc_ringo : public CreatureScript class npc_ringo : public CreatureScript
@@ -180,7 +179,7 @@ public:
if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI()))
{ {
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
ringoAI->StartFollow(player, FACTION_ESCORTEE, quest); ringoAI->StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
} }
} }
@@ -297,7 +297,7 @@ public:
if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR) if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR)
{ {
creature->AI()->Talk(SAY_QUEST_START); 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<npc_ranshallaAI*>(creature->AI())) if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
escortAI->Start(false, false, player->GetGUID(), quest); escortAI->Start(false, false, player->GetGUID(), quest);
@@ -148,11 +148,11 @@ public:
if( damage >= me->GetHealth() ) if( damage >= me->GetHealth() )
{ {
damage = me->GetHealth() - 1; damage = me->GetHealth() - 1;
if( me->getFaction() != 35 ) if (me->GetFaction() != FACTION_FRIENDLY)
{ {
me->CastSpell((Unit*)nullptr, 68575, true); // achievements 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->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(); events.Reset();
Talk(TEXT_EADRIC_DEATH); Talk(TEXT_EADRIC_DEATH);
me->getThreatMgr().clearReferences(); me->getThreatMgr().clearReferences();
@@ -296,10 +296,10 @@ public:
{ {
damage = me->GetHealth() - 1; damage = me->GetHealth() - 1;
if( me->getFaction() != 35 ) if (me->GetFaction() != FACTION_FRIENDLY)
{ {
me->CastSpell((Unit*)nullptr, 68574, true); // achievements me->CastSpell((Unit*)nullptr, 68574, true); // achievements
me->setFaction(35); me->SetFaction(FACTION_FRIENDLY);
events.Reset(); events.Reset();
Talk(TEXT_PALETRESS_DEATH); Talk(TEXT_PALETRESS_DEATH);
me->getThreatMgr().clearReferences(); me->getThreatMgr().clearReferences();
@@ -184,7 +184,7 @@ public:
float dist = rand_norm() * 40.0f; 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) ) 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->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
c->GetMotionMaster()->MoveRandom(15.0f); c->GetMotionMaster()->MoveRandom(15.0f);
} }
@@ -452,7 +452,7 @@ public:
me->CastSpell(me, SPELL_ACID_MANDIBLE, true); me->CastSpell(me, SPELL_ACID_MANDIBLE, true);
determinationTimer = urand(10000, 50000); determinationTimer = urand(10000, 50000);
despawnTimer = 0; 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) ) if( Unit* target = me->SelectNearestTarget(250.0f) )
{ {
AttackStart(target); AttackStart(target);
@@ -318,7 +318,7 @@ public:
{ {
trigger->SetDisplayId(11686); trigger->SetDisplayId(11686);
trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->setFaction(14); trigger->SetFaction(FACTION_MONSTER);
trigger->SetInCombatWithZone(); trigger->SetInCombatWithZone();
} }
@@ -340,7 +340,7 @@ public:
{ {
trigger->SetDisplayId(11686); trigger->SetDisplayId(11686);
trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->setFaction(14); trigger->SetFaction(FACTION_MONSTER);
trigger->SetInCombatWithZone(); trigger->SetInCombatWithZone();
} }
@@ -514,7 +514,7 @@ public:
if (darnavan->IsAlive()) if (darnavan->IsAlive())
{ {
darnavan->RemoveAllAuras(); darnavan->RemoveAllAuras();
darnavan->setFaction(35); darnavan->SetFaction(FACTION_FRIENDLY);
darnavan->DeleteThreatList(); darnavan->DeleteThreatList();
darnavan->CombatStop(true); darnavan->CombatStop(true);
darnavan->GetMotionMaster()->MoveIdle(); darnavan->GetMotionMaster()->MoveIdle();
@@ -211,7 +211,7 @@ public:
sizeTimer = 0; sizeTimer = 0;
auraVisualTimer = 1; auraVisualTimer = 1;
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 2.0f); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 2.0f);
me->setFaction(21); me->SetFaction(FACTION_BOOTY_BAY);
} }
void KilledUnit(Unit* who) override void KilledUnit(Unit* who) override
@@ -698,7 +698,7 @@ public:
case EVENT_DESTROY_PLATFORM_0: case EVENT_DESTROY_PLATFORM_0:
if (Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER_LAOI, CenterPos, TEMPSUMMON_TIMED_DESPAWN, 3000)) 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_VISUAL, true);
c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false); 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)) 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); //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500)); c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500));
AttackStart(c); AttackStart(c);
@@ -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)) 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->SetCanFly(true);
c->setFaction(pPlayer->getFaction()); c->SetFaction(pPlayer->GetFaction());
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true); //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500)); c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500));
} }
@@ -58,27 +58,27 @@ public:
switch (creature->GetEntry()) switch (creature->GetEntry())
{ {
case NPC_ALLIANCE_RANGER: case NPC_ALLIANCE_RANGER:
creature->setFaction(16); creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE) if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_RANGER); creature->UpdateEntry(NPC_HORDE_RANGER);
break; break;
case NPC_ALLIANCE_BERSERKER: case NPC_ALLIANCE_BERSERKER:
creature->setFaction(16); creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE) if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_BERSERKER); creature->UpdateEntry(NPC_HORDE_BERSERKER);
break; break;
case NPC_ALLIANCE_COMMANDER: case NPC_ALLIANCE_COMMANDER:
creature->setFaction(16); creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE) if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_COMMANDER); creature->UpdateEntry(NPC_HORDE_COMMANDER);
break; break;
case NPC_ALLIANCE_CLERIC: case NPC_ALLIANCE_CLERIC:
creature->setFaction(16); creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE) if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_CLERIC); creature->UpdateEntry(NPC_HORDE_CLERIC);
break; break;
case NPC_COMMANDER_STOUTBEARD: case NPC_COMMANDER_STOUTBEARD:
creature->setFaction(16); creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE) if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_COMMANDER_KOLURG); creature->UpdateEntry(NPC_COMMANDER_KOLURG);
break; break;
@@ -203,7 +203,7 @@ public:
summons.Summon(summon); summons.Summon(summon);
if (summon->GetEntry() == NPC_MOLTEN_GOLEM) if (summon->GetEntry() == NPC_MOLTEN_GOLEM)
{ {
summon->setFaction(me->getFaction()); summon->SetFaction(me->GetFaction());
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
summon->AI()->AttackStart(target); summon->AI()->AttackStart(target);
@@ -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 (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)) if (Player* plr = SelectTargetFromPlayerList(100.0f))
dwarf->setFaction(plr->getFaction()); dwarf->SetFaction(plr->GetFaction());
ActivatePipe(Pos); ActivatePipe(Pos);
dwarf->AI()->AttackStart(me); dwarf->AI()->AttackStart(me);

Some files were not shown because too many files have changed in this diff Show More