aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-09-06 18:01:51 +0100
committerNay <dnpd.dd@gmail.com>2012-09-06 18:01:51 +0100
commit0522e50c8670a34698b15003ceb5e514db72e427 (patch)
treed6406bcbd2e836f5f08be8e67f1a01de4c938d48 /src/server/scripts/Spells
parent42a899a90eabae2ce6fc8ca103e7692c07153315 (diff)
parent9f09713b3e286ba94948c15d64b76b2aed16f8cd (diff)
Merge remote-tracking branch 'origin/master' into mmaps
Conflicts: src/server/game/Spells/Spell.cpp
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp13
-rw-r--r--src/server/scripts/Spells/spell_item.cpp11
2 files changed, 24 insertions, 0 deletions
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);
}
};