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

View File

@@ -148,11 +148,11 @@ public:
if( damage >= me->GetHealth() )
{
damage = me->GetHealth() - 1;
if( me->getFaction() != 35 )
if (me->GetFaction() != FACTION_FRIENDLY)
{
me->CastSpell((Unit*)nullptr, 68575, true); // achievements
me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, 68574, me); // paletress' spell credits encounter, but shouldn't credit achievements
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
events.Reset();
Talk(TEXT_EADRIC_DEATH);
me->getThreatMgr().clearReferences();
@@ -296,10 +296,10 @@ public:
{
damage = me->GetHealth() - 1;
if( me->getFaction() != 35 )
if (me->GetFaction() != FACTION_FRIENDLY)
{
me->CastSpell((Unit*)nullptr, 68574, true); // achievements
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
events.Reset();
Talk(TEXT_PALETRESS_DEATH);
me->getThreatMgr().clearReferences();

View File

@@ -184,7 +184,7 @@ public:
float dist = rand_norm() * 40.0f;
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
{
c->setFaction(31);
c->SetFaction(FACTION_PREY);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
c->GetMotionMaster()->MoveRandom(15.0f);
}
@@ -452,7 +452,7 @@ public:
me->CastSpell(me, SPELL_ACID_MANDIBLE, true);
determinationTimer = urand(10000, 50000);
despawnTimer = 0;
if( me->getFaction() == 16 ) // hostile - it's phase 2
if (me->GetFaction() == FACTION_MONSTER_2) // hostile - it's phase 2
if( Unit* target = me->SelectNearestTarget(250.0f) )
{
AttackStart(target);

View File

@@ -318,7 +318,7 @@ public:
{
trigger->SetDisplayId(11686);
trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->setFaction(14);
trigger->SetFaction(FACTION_MONSTER);
trigger->SetInCombatWithZone();
}
@@ -340,7 +340,7 @@ public:
{
trigger->SetDisplayId(11686);
trigger->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->setFaction(14);
trigger->SetFaction(FACTION_MONSTER);
trigger->SetInCombatWithZone();
}

View File

@@ -514,7 +514,7 @@ public:
if (darnavan->IsAlive())
{
darnavan->RemoveAllAuras();
darnavan->setFaction(35);
darnavan->SetFaction(FACTION_FRIENDLY);
darnavan->DeleteThreatList();
darnavan->CombatStop(true);
darnavan->GetMotionMaster()->MoveIdle();

View File

@@ -211,7 +211,7 @@ public:
sizeTimer = 0;
auraVisualTimer = 1;
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 2.0f);
me->setFaction(21);
me->SetFaction(FACTION_BOOTY_BAY);
}
void KilledUnit(Unit* who) override

View File

@@ -698,7 +698,7 @@ public:
case EVENT_DESTROY_PLATFORM_0:
if (Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER_LAOI, CenterPos, TEMPSUMMON_TIMED_DESPAWN, 3000))
{
c->setFaction(me->getFaction());
c->SetFaction(me->GetFaction());
c->CastSpell(c, SPELL_DESTROY_PLATFORM_VISUAL, true);
c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false);
}
@@ -726,7 +726,7 @@ public:
if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
{
c->setFaction(pPlayer->getFaction());
c->SetFaction(pPlayer->GetFaction());
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500));
AttackStart(c);

View File

@@ -87,7 +87,7 @@ public:
if (Creature* c = pPlayer->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
{
c->SetCanFly(true);
c->setFaction(pPlayer->getFaction());
c->SetFaction(pPlayer->GetFaction());
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500));
}

View File

@@ -58,27 +58,27 @@ public:
switch (creature->GetEntry())
{
case NPC_ALLIANCE_RANGER:
creature->setFaction(16);
creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_RANGER);
break;
case NPC_ALLIANCE_BERSERKER:
creature->setFaction(16);
creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_BERSERKER);
break;
case NPC_ALLIANCE_COMMANDER:
creature->setFaction(16);
creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_COMMANDER);
break;
case NPC_ALLIANCE_CLERIC:
creature->setFaction(16);
creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_HORDE_CLERIC);
break;
case NPC_COMMANDER_STOUTBEARD:
creature->setFaction(16);
creature->SetFaction(FACTION_MONSTER_2);
if (TeamIdInInstance == TEAM_ALLIANCE)
creature->UpdateEntry(NPC_COMMANDER_KOLURG);
break;

View File

@@ -203,7 +203,7 @@ public:
summons.Summon(summon);
if (summon->GetEntry() == NPC_MOLTEN_GOLEM)
{
summon->setFaction(me->getFaction());
summon->SetFaction(me->GetFaction());
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
summon->AI()->AttackStart(target);

View File

@@ -360,7 +360,7 @@ public:
if (Creature* dwarf = me->SummonCreature(NPC_DWARFES_FRIENDLY, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY(), RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
{
if (Player* plr = SelectTargetFromPlayerList(100.0f))
dwarf->setFaction(plr->getFaction());
dwarf->SetFaction(plr->GetFaction());
ActivatePipe(Pos);
dwarf->AI()->AttackStart(me);

View File

@@ -314,7 +314,7 @@ public:
SetDespawnAtEnd(false);
ResetEvent();
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->SetReactState(REACT_PASSIVE);
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
@@ -341,7 +341,7 @@ public:
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
me->setFaction(i->GetSource()->getFaction());
me->SetFaction(i->GetSource()->GetFaction());
break;
}
@@ -356,7 +356,7 @@ public:
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
break;
case ACTION_START_SJONNIR_FIGHT:
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->Yell("Don't worry! Ol' Brann's got yer back! Keep that metal monstrosity busy, and I'll see if I can't sweet talk this machine into helping ye!", LANG_UNIVERSAL);
me->PlayDirectSound(14274);
SetEscortPaused(false);

View File

@@ -379,7 +379,7 @@ public:
me->SetReactState(REACT_PASSIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetSheath(SHEATH_STATE_UNARMED);
me->setFaction(190);
me->SetFaction(190);
me->CastSpell(me, SPELL_DUAL_WIELD, true);
_phaseTwo = false;
@@ -437,7 +437,7 @@ public:
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->InterruptNonMeleeSpells(false);
if (m_pInstance)
@@ -602,7 +602,7 @@ public:
damage = 0;
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
events.Reset();
summons.DespawnAll();
@@ -666,7 +666,7 @@ public:
me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true);
// Hack: _IsValidTarget failed earlier due to flags, call AttackStart again
me->SetReactState(REACT_AGGRESSIVE);
me->setFaction(14);
me->SetFaction(FACTION_MONSTER);
if (Player* target = SelectTargetFromPlayerList(150.0f))
AttackStart(target);
me->SetInCombatWithZone();

View File

@@ -344,7 +344,7 @@ public:
damage = 0;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->SetHealth(me->GetMaxHealth());
me->CombatStop();
me->RemoveAllAuras();

View File

@@ -347,7 +347,7 @@ public:
}
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->GetMotionMaster()->Clear();
me->AttackStop();
me->CombatStop();
@@ -522,7 +522,7 @@ public:
if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2) )
{
h_p->setFaction(1665);
h_p->SetFaction(1665);
if( cnt < 8 )
Helpers[cnt++] = h_p->GetGUID();

View File

@@ -570,7 +570,7 @@ public:
{
_encounterFinished = true;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
me->SetHealth(me->GetMaxHealth());
me->CombatStop();
me->RemoveAllAuras();

View File

@@ -267,7 +267,7 @@ public:
void PassengerBoarded(Unit* p, int8 /*seat*/, bool /*apply*/) override
{
me->setFaction(p->getFaction());
me->SetFaction(p->GetFaction());
me->SetReactState(REACT_PASSIVE);
}
@@ -282,7 +282,7 @@ public:
me->CombatStop(true);
me->SetReactState(REACT_PASSIVE);
me->SetRegeneratingHealth(false);
me->setFaction(31);
me->SetFaction(FACTION_PREY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
me->CastSpell(me, 64770, true);
}
@@ -290,13 +290,13 @@ public:
void AttackStart(Unit* who) override
{
if (me->getFaction() == 16)
if (me->GetFaction() == FACTION_MONSTER_2)
ScriptedAI::AttackStart(who);
}
void EnterEvadeMode() override
{
if (me->getFaction() == 16)
if (me->GetFaction() == FACTION_MONSTER_2)
ScriptedAI::EnterEvadeMode();
}
@@ -304,7 +304,7 @@ public:
void UpdateAI(uint32 diff) override
{
if (me->getFaction() != 16)
if (me->GetFaction() != FACTION_MONSTER_2)
{
if (me->IsAlive() && (me->GetExactDist2dSq(2058.0f, 42.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2203.0f, 292.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2125.0f, 170.0f) > 160.0f * 160.0f))
Unit::Kill(me, me, false);

View File

@@ -45,7 +45,7 @@ public:
{
if (me->GetEntry() == NPC_KEEP_CANNON)
{
faction = me->getFaction();
faction = me->GetFaction();
me->Respawn();
me->UpdateEntry(NPC_BROKEN_KEEP_CANNON, nullptr, false);
me->RemoveVehicleKit();
@@ -59,7 +59,7 @@ public:
{
me->UpdateEntry(NPC_KEEP_CANNON, nullptr, false);
if (faction)
me->setFaction(faction);
me->SetFaction(faction);
me->CreateVehicleKit(510, NPC_KEEP_CANNON);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
events.ScheduleEvent(EVENT_RESTORE_FLAG, 4000);

View File

@@ -80,7 +80,7 @@ public:
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, M_PI, MOTION_SLOT_ACTIVE);
owner->CastSpell(owner, SPELL_SUBDUED, true);
GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true);
owner->setFaction(35);
owner->SetFaction(FACTION_FRIENDLY);
owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS);
}
@@ -375,12 +375,7 @@ public:
enum Lurgglbr
{
QUEST_ESCAPE_WINTERFIN_CAVERNS = 11570,
GO_CAGE = 187369,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775,
SAY_START_1 = 0,
SAY_START_2 = 1,
SAY_END_1 = 2,
@@ -497,7 +492,7 @@ public:
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
return true;
}
return false;
@@ -855,7 +850,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPING_THE_MIST)
{
creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_1, player);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
@@ -1173,8 +1168,7 @@ enum HiddenCultist
SAY_HIDDEN_CULTIST_4 = 3,
EVENT_CULTIST_SCRIPT_1 = 1,
EVENT_CULTIST_SCRIPT_2 = 2,
EVENT_CULTIST_SCRIPT_3 = 3,
FACTION_MONSTER = 14
EVENT_CULTIST_SCRIPT_3 = 3
};
class npc_hidden_cultist : public CreatureScript
@@ -1227,7 +1221,7 @@ public:
void AttackPlayer()
{
me->setFaction(FACTION_MONSTER);
me->SetFaction(FACTION_MONSTER);
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
{
AttackStart(player);
@@ -1465,9 +1459,6 @@ enum Thassarian
EVENT_THASSARIAN_SCRIPT_28 = 28,
EVENT_THASSARIAN_SCRIPT_29 = 29,
EVENT_THASSARIAN_CAST = 30,
FACTION_UNDEAD_SCOURGE = 974,
FACTION_VALIANCE_EXPEDITION_7 = 1974,
FACTION_UNDEAD_SCOURGE_9 = 1988,
NPC_IMAGE_LICH_KING = 26203,
NPC_COUNSELOR_TALBOT = 25301,
NPC_PRINCE_VALANAR = 28189,
@@ -1569,7 +1560,7 @@ public:
void Reset() override
{
me->setFaction(FACTION_VALIANCE_EXPEDITION_7);
me->SetFaction(FACTION_VALIANCE_EXPEDITION_7);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
@@ -1662,7 +1653,7 @@ public:
talbot->CastSpell(talbot, SPELL_TRANSFORM_VALANAR);
talbot->UpdateEntry(NPC_PRINCE_VALANAR);
talbot->SetFullHealth();
talbot->setFaction(FACTION_UNDEAD_SCOURGE);
talbot->SetFaction(FACTION_UNDEAD_SCOURGE);
talbot->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
talbot->SetReactState(REACT_PASSIVE);
talbot->SetStandState(UNIT_STAND_STATE_KNEEL);
@@ -1785,7 +1776,7 @@ public:
if (Creature* talbot = ObjectAccessor::GetCreature(*me, _talbotGUID))
{
talbot->AI()->Talk(SAY_TALBOT_4);
talbot->setFaction(FACTION_UNDEAD_SCOURGE_9);
talbot->SetFaction(FACTION_UNDEAD_SCOURGE_9);
talbot->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
talbot->SetReactState(REACT_AGGRESSIVE);
talbot->Attack(me, false);

View File

@@ -330,7 +330,7 @@ public:
{
futureGUID = cr->GetGUID();
summoner->CastSpell(cr, SPELL_CLONE_CASTER, true);
cr->setFaction(summoner->getFaction());
cr->SetFaction(summoner->GetFaction());
cr->SetReactState(REACT_AGGRESSIVE);
}
}
@@ -490,7 +490,7 @@ public:
void Reset() override
{
if (me->ToTempSummon() && me->ToTempSummon()->GetSummonerUnit())
me->setFaction(me->ToTempSummon()->GetSummonerUnit()->getFaction());
me->SetFaction(me->ToTempSummon()->GetSummonerUnit()->GetFaction());
}
void MoveInLineOfSight(Unit* who) override
@@ -1768,9 +1768,7 @@ enum StrengthenAncientsMisc
SPELL_CREATE_ITEM_BARK = 47550,
SPELL_CONFUSED = 47044,
NPC_LOTHALOR = 26321,
FACTION_WALKER_ENEMY = 14,
NPC_LOTHALOR = 26321
};
class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker
@@ -1803,7 +1801,7 @@ public:
else if (roll == 0) // enemy version
{
tree->AI()->Talk(SAY_WALKER_ENEMY, player);
tree->setFaction(FACTION_WALKER_ENEMY);
tree->SetFaction(FACTION_MONSTER);
tree->Attack(player, true);
}
}

View File

@@ -130,7 +130,7 @@ public:
case 4:
me->Whisper("NOOOOOOOoooooooooo!", LANG_UNIVERSAL, summoner->ToPlayer());
me->SetLevel(summoner->getLevel());
me->setFaction(14);
me->SetFaction(FACTION_MONSTER);
if (me->GetExactDist(summoner) < 50.0f)
{
me->UpdatePosition(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ(), 0.0f, true);
@@ -154,8 +154,6 @@ public:
enum Entries
{
NPC_APOTHECARY_HANES = 23784,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775,
NPC_HANES_FIRE_TRIGGER = 23968,
QUEST_TRAIL_OF_FIRE = 11241,
SPELL_COSMETIC_LOW_POLY_FIRE = 56274,
@@ -171,7 +169,7 @@ public:
{
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
{
creature->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
}
return true;

View File

@@ -1304,7 +1304,7 @@ public:
me->SetCanFly(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->SetSpeed(MOVE_FLIGHT, 0.1f);
me->setFaction(summoner->getFaction());
me->SetFaction(summoner->GetFaction());
}
void DamageTaken(Unit* who, uint32&, DamageEffectType, SpellSchoolMask) override

View File

@@ -136,13 +136,13 @@ public:
{
summons.Summon(cr);
cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true);
cr->setFaction(me->getFaction());
cr->SetFaction(me->GetFaction());
}
if ((cr = me->SummonCreature(NPC_ZEPIK, 5631.63f, 3794.36f, -92.24f, 3.45f)))
{
summons.Summon(cr);
cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true);
cr->setFaction(me->getFaction());
cr->SetFaction(me->GetFaction());
}
}
@@ -202,7 +202,7 @@ public:
{
minion->Say("Now you not catch us with back turned! Now we hurt you bad undead. BAD!", LANG_UNIVERSAL);
minion->RemoveAurasDueToSpell(SPELL_ARTRUIS_BINDING);
minion->setFaction(me->GetVictim()->getFaction());
minion->SetFaction(me->GetVictim()->GetFaction());
minion->AddThreat(me, 100000.0f);
minion->AI()->AttackStart(me);
minion->DespawnOrUnsummon(900000);
@@ -827,7 +827,7 @@ public:
if (npc_engineer_heliceAI* pEscortAI = CAST_AI(npc_engineer_helice::npc_engineer_heliceAI, creature->AI()))
{
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
creature->setFaction(113);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
pEscortAI->Start(false, false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1);

View File

@@ -53,7 +53,7 @@ public:
{
if (apply)
{
me->setFaction(who->getFaction());
me->SetFaction(who->GetFaction());
me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true);
Start(false, true, who->GetGUID());
}
@@ -483,7 +483,7 @@ public:
if (Player* charmer = GetValidPlayer())
{
me->setFaction(16);
me->SetFaction(FACTION_MONSTER_2);
charmer->SetClientControl(me, 0, true);
me->SetSpeed(MOVE_RUN, 2.0f, true);

View File

@@ -396,7 +396,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
if (player->IsWithinDistInMap(me, 80))
return;
me->setFaction(974);
me->SetFaction(FACTION_UNDEAD_SCOURGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
ScriptedAI::EnterEvadeMode();
}
@@ -407,7 +407,7 @@ public:
summons.DespawnAll();
playerGUID.Clear();
lichGUID.Clear();
me->setFaction(974);
me->SetFaction(FACTION_UNDEAD_SCOURGE);
me->SetVisible(false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -473,7 +473,7 @@ public:
me->RemoveAllAuras();
me->CombatStop();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
events.Reset();
events.ScheduleEvent(EVENT_BETRAYAL_4, 1000);
}
@@ -579,7 +579,7 @@ public:
break;
}
if (me->getFaction() == 35 || me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED))
if (me->GetFaction() == FACTION_FRIENDLY || me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED))
return;
if (!UpdateVictim())
@@ -726,7 +726,7 @@ public:
void Reset() override
{
me->setFaction(35);
me->SetFaction(FACTION_FRIENDLY);
DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
}
@@ -737,7 +737,7 @@ public:
me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_KNEEL);
me->setFaction(me->GetCreatureTemplate()->faction);
me->SetFaction(me->GetCreatureTemplate()->faction);
DoCast(me, SPELL_UNSHACKLED, true);
Talk(SAY_RAGECLAW);
me->GetMotionMaster()->MoveRandom(10);