From 27e4746ea2887904b667fa33324ae4e6d3595ab3 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 14 Aug 2017 13:44:25 +0200 Subject: Scripting: Clean up of magic numbers By Malcrom --- .../EasternKingdoms/zone_stranglethorn_vale.cpp | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 3000c30c8e7..5783d6782ba 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -36,6 +36,14 @@ EndContentData */ ## npc_yenniku ######*/ +enum Yenniku +{ + SPELL_YENNIKUS_RELEASE = 3607, + QUEST_SAVING_YENNIKU = 592, + FACTION_HORDE_GENERIC = 83, + FACTION_TROLL_BLOODSCALP = 28 +}; + class npc_yenniku : public CreatureScript { public: @@ -70,17 +78,17 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) override { - if (bReset || spell->Id != 3607) + if (bReset || spell->Id != SPELL_YENNIKUS_RELEASE) return; if (Player* player = caster->ToPlayer()) { - if (player->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE) //Yenniku's Release + if (player->GetQuestStatus(QUEST_SAVING_YENNIKU) == QUEST_STATUS_INCOMPLETE) // Yenniku's Release { me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - me->CombatStop(); //stop combat - me->DeleteThreatList(); //unsure of this - me->setFaction(83); //horde generic + me->CombatStop(); // stop combat + me->DeleteThreatList(); // unsure of this + me->setFaction(FACTION_HORDE_GENERIC); // horde generic bReset = true; Reset_Timer = 60000; @@ -98,7 +106,7 @@ public: { EnterEvadeMode(); bReset = false; - me->setFaction(28); //troll, bloodscalp + me->setFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp return; } @@ -126,10 +134,6 @@ public: }; }; -/*###### -## -######*/ - void AddSC_stranglethorn_vale() { new npc_yenniku(); -- cgit v1.2.3