aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-07-14 19:09:59 +0300
committerShauren <shauren.trinity@gmail.com>2022-09-05 21:18:21 +0200
commit2102eced8f12d742a4c9c4c868393c44b7e4949f (patch)
treeea7d04095ed195f0f5220b32641eac4418aa180a
parentb160ba206148c0ce32c543e585caa60f693ba5e1 (diff)
Scripts/Quest: Adjustments to Runeforging (#28115)
(cherry picked from commit 444928f3c5fb51056321c9fe554743e25354de27)
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp11
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