diff options
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 7c724732bd9..d4f7e85dcd1 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -26,6 +26,7 @@ #include "MotionMaster.h" #include "MoveSplineInit.h" #include "ObjectAccessor.h" +#include "ObjectMgr.h" #include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" @@ -1108,7 +1109,8 @@ class spell_gift_of_the_harvester : public SpellScript enum Runeforging { - SPELL_RUNEFORGING_CREDIT = 54586 + SPELL_RUNEFORGING_CREDIT = 54586, + QUEST_RUNEFORGING = 12842 }; /* 53343 - Rune of Razorice @@ -1125,12 +1127,15 @@ class spell_chapter1_runeforging_credit : public SpellScript bool Validate(SpellInfo const* /*spellInfo*/) override { - return ValidateSpellInfo({ SPELL_RUNEFORGING_CREDIT }); + return ValidateSpellInfo({ SPELL_RUNEFORGING_CREDIT }) && + sObjectMgr->GetQuestTemplate(QUEST_RUNEFORGING); } void HandleDummy(SpellEffIndex /*effIndex*/) { - GetCaster()->CastSpell(GetCaster(), SPELL_RUNEFORGING_CREDIT); + if (Player* caster = GetCaster()->ToPlayer()) + if (caster->GetQuestStatus(QUEST_RUNEFORGING) == QUEST_STATUS_INCOMPLETE) + caster->CastSpell(caster, SPELL_RUNEFORGING_CREDIT); } void Register() override |