aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-07-14 19:09:59 +0300
committerGitHub <noreply@github.com>2022-07-14 19:09:59 +0300
commit444928f3c5fb51056321c9fe554743e25354de27 (patch)
tree0b4c383a90663471c910345ea9e145e46090b889 /src
parent9a9edb4dfe60f574b33c705c79fca29e278e2384 (diff)
Scripts/Quest: Adjustments to Runeforging (#28115)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 98f94d82c55..5b3c94ea729 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -1104,7 +1104,8 @@ class spell_gift_of_the_harvester : public SpellScript
enum Runeforging
{
- SPELL_RUNEFORGING_CREDIT = 54586
+ SPELL_RUNEFORGING_CREDIT = 54586,
+ QUEST_RUNEFORGING = 12842
};
/* 53323 - Rune of Swordshattering
@@ -1123,12 +1124,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