From e140e2ffbced17e0e3bdd9c2fdfde4f8ec1eab2c Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 14 Aug 2017 13:42:26 +0200 Subject: [PATCH] Scripting: Clean up of magic numbers By Malcrom --- .../zone_stranglethorn_vale.cpp | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 4fd9fa4d865..e4bd5fe9261 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(FACTION_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(FACTION_TROLL_BLOODSCALP); + me->setFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp return; } @@ -126,10 +134,6 @@ public: }; }; -/*###### -## -######*/ - void AddSC_stranglethorn_vale() { new npc_yenniku();