aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorWyrserth <43747507+Wyrserth@users.noreply.github.com>2019-06-15 14:13:19 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 12:06:54 +0100
commit6b7bc82641e0cb7cf8add1089d8dde0aad93edbe (patch)
treed1e0189fabbb93213d03f00d0401c382d0fabf46 /src/server/scripts
parent3ba08283ba650f5f470b58b1fd0bc50fa7e19c5b (diff)
Core/Spell: allow Northrend Inscription Research to unlock three recipes the first time it is cast. (#23401)
Also prevent double skill-up because of duplicate UpdateCraftSkill() calls. (cherry picked from commit 2315d43b2c1f478bd5f612e39f3a938bf6640ab6)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 610fc24dbd4..e926b079461 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -2564,6 +2564,11 @@ class spell_gen_pet_summoned : public SpellScript
}
};
+enum ProfessionResearch
+{
+ SPELL_NORTHREND_INSCRIPTION_RESEARCH = 61177
+};
+
class spell_gen_profession_research : public SpellScript
{
PrepareSpellScript(spell_gen_profession_research);
@@ -2575,7 +2580,9 @@ class spell_gen_profession_research : public SpellScript
SpellCastResult CheckRequirement()
{
- if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
+ Player* player = GetCaster()->ToPlayer();
+
+ if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER);
return SPELL_FAILED_CUSTOM_ERROR;
@@ -2589,11 +2596,15 @@ class spell_gen_profession_research : public SpellScript
Player* caster = GetCaster()->ToPlayer();
uint32 spellId = GetSpellInfo()->Id;
- // learn random explicit discovery recipe (if any)
+ // Learn random explicit discovery recipe (if any)
+ // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
+ if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
+ for (int i = 0; i < 2; ++i)
+ if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
+ caster->LearnSpell(discoveredSpellId, false);
+
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
caster->LearnSpell(discoveredSpellId, false);
-
- caster->UpdateCraftSkill(spellId);
}
void Register() override