Scripts/Defines: cleanup some magic numbers in factions (#23631)

This commit is contained in:
ForesterDev
2019-07-25 14:54:49 +04:00
committed by Giacomo Pozzoni
parent b9756de7e5
commit 0c317498a5
13 changed files with 23 additions and 36 deletions

View File

@@ -24,13 +24,6 @@
#define BRDScriptName "instance_blackrock_depths"
#define DataHeader "BRD"
enum BRDFactionIds
{
FACTION_NEUTRAL = 734,
FACTION_HOSTILE = 754,
FACTION_FRIEND = 35
};
enum BRDDataTypes
{
TYPE_RING_OF_LAW = 1,

View File

@@ -948,7 +948,7 @@ public:
{
deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
deathcharger->SetFaction(2096);
deathcharger->SetFaction(FACTION_SCARLET_CRUSADE_2);
}
}
};

View File

@@ -354,7 +354,7 @@ public:
{
if (GameObject* pOrb = GetOrb(i))
{
if (pOrb->GetFaction() == 35)
if (pOrb->GetFaction() == FACTION_FRIENDLY)
{
pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
pOrb->setActive(true);
@@ -380,7 +380,7 @@ class go_orb_of_the_blue_flight : public GameObjectScript
bool GossipHello(Player* player) override
{
if (me->GetFaction() == 35)
if (me->GetFaction() == FACTION_FRIENDLY)
{
player->SummonCreature(NPC_POWER_OF_THE_BLUE_DRAGONFLIGHT, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);

View File

@@ -226,7 +226,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->GetFaction() != 14)
if (!target || target->isDead() || target->GetFaction() != FACTION_MONSTER)
continue;
target->DespawnOrUnsummon();
@@ -236,7 +236,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->GetFaction() != 14)
if (!target || target->isDead() || target->GetFaction() != FACTION_MONSTER)
continue;
target->DespawnOrUnsummon();
@@ -246,7 +246,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->GetFaction() != 14)
if (!target || target->isDead() || target->GetFaction() != FACTION_MONSTER)
continue;
target->DespawnOrUnsummon();

View File

@@ -439,8 +439,7 @@ public:
enum zumrahConsts
{
ZUMRAH_ID = 7271,
ZUMRAH_HOSTILE_FACTION = 37
ZUMRAH_ID = 7271
};
class at_zumrah : public AreaTriggerScript
@@ -455,7 +454,7 @@ public:
if (!pZumrah)
return false;
pZumrah->SetFaction(ZUMRAH_HOSTILE_FACTION);
pZumrah->SetFaction(FACTION_TROLL_FROSTMANE);
return true;
}

View File

@@ -53,8 +53,7 @@ enum Kerlonian
SPELL_SLEEP_VISUAL = 25148,
SPELL_AWAKEN = 17536,
QUEST_SLEEPER_AWAKENED = 5321,
NPC_LILADRIS = 11219, //attackers entries unknown
FACTION_KER_ESCORTEE = 113
NPC_LILADRIS = 11219 //attackers entries unknown
};
/// @todo make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road.
@@ -162,7 +161,7 @@ public:
{
me->SetStandState(UNIT_STAND_STATE_STAND);
Talk(SAY_KER_START, player);
StartFollow(player, FACTION_KER_ESCORTEE, quest);
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
}
}
};

View File

@@ -28,8 +28,6 @@
enum Kaya
{
FACTION_ESCORTEE_H = 775,
NPC_GRIMTOTEM_RUFFIAN = 11910,
NPC_GRIMTOTEM_BRUTE = 11912,
NPC_GRIMTOTEM_SORCERER = 11913,

View File

@@ -279,8 +279,7 @@ enum Tooga
QUEST_TOOGA = 1560,
NPC_TORTA = 6015,
POINT_ID_TO_WATER = 1,
FACTION_TOOG_ESCORTEE = 113
POINT_ID_TO_WATER = 1
};
Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f};
@@ -417,7 +416,7 @@ public:
void QuestAccept(Player* player, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_TOOGA)
StartFollow(player, FACTION_TOOG_ESCORTEE, quest);
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
}
};

View File

@@ -176,7 +176,6 @@ public:
enum TaskmasterFizzule
{
FACTION_FRIENDLY_F = 35,
SPELL_FLARE = 10113,
SPELL_FOLLY = 10137,
};
@@ -226,7 +225,7 @@ public:
EngagementOver();
me->GetMotionMaster()->MoveIdle();
me->SetFaction(FACTION_FRIENDLY_F);
me->SetFaction(FACTION_FRIENDLY);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
@@ -266,7 +265,7 @@ public:
{
if (FlareCount >= 2)
{
if (me->GetFaction() == FACTION_FRIENDLY_F)
if (me->GetFaction() == FACTION_FRIENDLY)
return;
DoFriend();
@@ -520,7 +519,6 @@ enum Wizzlecrank
SAY_END = 6,
QUEST_ESCAPE = 863,
FACTION_RATCHET = 637,
NPC_PILOT_WIZZ = 3451,
NPC_MERCENARY = 3282,
};

View File

@@ -171,8 +171,7 @@ enum Ringo
SPELL_REVIVE_RINGO = 15591,
QUEST_A_LITTLE_HELP = 4491,
NPC_SPRAGGLE = 9997,
FACTION_ESCORTEE = 113
NPC_SPRAGGLE = 9997
};
class npc_ringo : public CreatureScript
@@ -341,7 +340,7 @@ public:
if (quest->GetQuestId() == QUEST_A_LITTLE_HELP)
{
me->SetStandState(UNIT_STAND_STATE_STAND);
StartFollow(player, FACTION_ESCORTEE, quest);
StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, quest);
}
}
};

View File

@@ -757,7 +757,7 @@ public:
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f);
owner->CastSpell(owner, SPELL_SUBDUED, true);
GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true);
owner->SetFaction(35);
owner->SetFaction(FACTION_FRIENDLY);
owner->SetImmuneToAll(true);
owner->DespawnOrUnsummon(3 * MINUTE*IN_MILLISECONDS);
}
@@ -938,7 +938,7 @@ public:
if (talbot)
{
talbot->UpdateEntry(NPC_PRINCE_VALANAR);
talbot->SetFaction(14);
talbot->SetFaction(FACTION_MONSTER);
talbot->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
talbot->SetReactState(REACT_PASSIVE);
}
@@ -2244,7 +2244,7 @@ public:
void AttackPlayer()
{
me->SetFaction(14);
me->SetFaction(FACTION_MONSTER);
if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID))
AttackStart(player);
}

View File

@@ -133,7 +133,6 @@ enum BTGameObjectIds
enum BlackTempleMisc
{
AKAMA_FACTION_COMBAT = 1868,
AKAMA_INTRO = 1,
AKAMA_FIGHT = 2,
ACTION_ACTIVE_AKAMA_INTRO = 3,

View File

@@ -220,6 +220,7 @@ enum FactionTemplates
FACTION_PREY = 31,
FACTION_ESCORTEE_H_NEUTRAL_PASSIVE = 33,
FACTION_FRIENDLY = 35,
FACTION_TROLL_FROSTMANE = 37,
FACTION_OGRE = 45,
FACTION_ORC_DRAGONMAW = 62,
FACTION_HORDE_GENERIC = 83,
@@ -235,6 +236,7 @@ enum FactionTemplates
FACTION_ESCORTEE_N_FRIEND_PASSIVE = 290,
FACTION_TITAN = 415,
FACTION_ESCORTEE_N_FRIEND_ACTIVE = 495,
FACTION_RATCHET = 637,
FACTION_GOBLIN_DARK_IRON_BAR_PATRON = 736,
FACTION_DARK_IRON_DWARVES = 754,
FACTION_ESCORTEE_A_PASSIVE = 774,
@@ -251,7 +253,8 @@ enum FactionTemplates
FACTION_ESCORTEE_H_ACTIVE = 2046,
FACTION_UNDEAD_SCOURGE_2 = 2068,
FACTION_UNDEAD_SCOURGE_3 = 2084,
FACTION_SCARLET_CRUSADE = 2089
FACTION_SCARLET_CRUSADE = 2089,
FACTION_SCARLET_CRUSADE_2 = 2096
};
#define MIN_REPUTATION_RANK (REP_HATED)