Core/Spells: Implement SPELL_EFFECT_UNTRAIN_TALENTS, thanks to Heisenberg, closes issue #5238

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-12-22 20:14:30 +02:00
parent 12c970f5dc
commit 42304c0b25
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -13911,7 +13911,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
break;
case GOSSIP_OPTION_UNLEARNTALENTS:
PlayerTalkClass->CloseGossip();
SendTalentWipeConfirm(guid);
pSource->ToCreature()->CastSpell(this, 46331, true); // Trainer: Untrain Talents
break;
case GOSSIP_OPTION_UNLEARNPETTALENTS:
PlayerTalkClass->CloseGossip();
+1
View File
@@ -319,6 +319,7 @@ class Spell
void EffectDualWield(SpellEffIndex effIndex);
void EffectPickPocket(SpellEffIndex effIndex);
void EffectAddFarsight(SpellEffIndex effIndex);
void EffectUntrainTalents(SpellEffIndex effIndex);
void EffectHealMechanical(SpellEffIndex effIndex);
void EffectJump(SpellEffIndex effIndex);
void EffectJumpDest(SpellEffIndex effIndex);
+10 -1
View File
@@ -137,7 +137,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectPull, // 70 SPELL_EFFECT_PULL one spell: Distract Move
&Spell::EffectPickPocket, // 71 SPELL_EFFECT_PICKPOCKET
&Spell::EffectAddFarsight, // 72 SPELL_EFFECT_ADD_FARSIGHT
&Spell::EffectUnused, // 73 SPELL_EFFECT_UNTRAIN_TALENTS
&Spell::EffectUntrainTalents, // 73 SPELL_EFFECT_UNTRAIN_TALENTS
&Spell::EffectApplyGlyph, // 74 SPELL_EFFECT_APPLY_GLYPH
&Spell::EffectHealMechanical, // 75 SPELL_EFFECT_HEAL_MECHANICAL one spell: Mechanical Patch Kit
&Spell::EffectSummonObjectWild, // 76 SPELL_EFFECT_SUMMON_OBJECT_WILD
@@ -3314,6 +3314,15 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
//m_caster->ToPlayer()->UpdateVisibilityOf(dynObj);
}
void Spell::EffectUntrainTalents(SpellEffIndex effIndex)
{
if (!unitTarget || m_caster->GetTypeId() == TYPEID_PLAYER)
return;
if (uint64 guid = m_caster->GetGUID()) // the trainer is the caster
unitTarget->ToPlayer()->SendTalentWipeConfirm(guid);
}
void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex)
{
if (!unitTarget)