aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp16
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp13
-rw-r--r--src/server/scripts/Spells/spell_item.cpp11
3 files changed, 26 insertions, 14 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index ad9298f0144..75cf7e82b25 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4141,6 +4141,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
return;
}
case 59317: // Teleporting
+ {
+
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4152,20 +4154,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->CastSpell(unitTarget, 59314, true);
return;
- // random spell learn instead placeholder
- case 60893: // Northrend Alchemy Research
- case 61177: // Northrend Inscription Research
- case 61288: // Minor Inscription Research
- case 61756: // Northrend Inscription Research (FAST QA VERSION)
- case 64323: // Book of Glyph Mastery
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // learn random explicit discovery recipe (if any)
- if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, m_caster->ToPlayer()))
- m_caster->ToPlayer()->learnSpell(discoveredSpell, false);
- return;
}
case 62482: // Grab Crate
{
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 5153010c0cc..27a6dac95f7 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -907,9 +907,22 @@ class spell_gen_profession_research : public SpellScriptLoader
return SPELL_CAST_OK;
}
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ uint32 spellId = GetSpellInfo()->Id;
+
+ // learn random explicit discovery recipe (if any)
+ if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
+ caster->learnSpell(discoveredSpellId, false);
+
+ caster->UpdateCraftSkill(spellId);
+ }
+
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement);
+ OnEffectHitTarget += SpellEffectFn(spell_gen_profession_research_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 3c89cb7005a..a88defad1ce 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -836,9 +836,20 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader
return SPELL_CAST_OK;
}
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ uint32 spellId = GetSpellInfo()->Id;
+
+ // learn random explicit discovery recipe (if any)
+ if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
+ caster->learnSpell(discoveredSpellId, false);
+ }
+
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_item_book_of_glyph_mastery_SpellScript::CheckRequirement);
+ OnEffectHitTarget += SpellEffectFn(spell_item_book_of_glyph_mastery_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};