aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2024-07-27 01:16:01 +0200
committerOvahlord <dreadkiller@gmx.de>2024-07-27 11:03:38 +0200
commit03b6898518e9321fdb1b805b7757bf4801fa8d08 (patch)
treeae2f2f5d32f4e2be01d6a7dfee1f344cdfeef83d /src/server/game/Spells/SpellEffects.cpp
parentacfba7fa1497d583a3c814db6e0161fe72bdfec9 (diff)
Core/Player: initial work on implementing talents for Cataclysm
- use a new structure to hold talent group data which will eventually replace the old master branch implementation - added support for unlocking dual talent specialization and switching specs - added basic support for learning and resetting talents
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index cbc2000d8f4..c91b83e5156 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -246,7 +246,7 @@ NonDefaultConstructible<SpellEffectHandlerFn> SpellEffectHandlers[TOTAL_SPELL_EF
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet, //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
&Spell::EffectForceCast, //160 SPELL_EFFECT_FORCE_CAST_2
- &Spell::EffectNULL, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert)
+ &Spell::EffectTalentSpecCount, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert)
&Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec
&Spell::EffectNULL, //163 SPELL_EFFECT_OBLITERATE_ITEM
&Spell::EffectRemoveAura, //164 SPELL_EFFECT_REMOVE_AURA
@@ -4983,23 +4983,28 @@ void Spell::EffectPlayMusic()
unitTarget->ToPlayer()->SendDirectMessage(WorldPackets::Misc::PlayMusic(soundid).Write());
}
+void Spell::EffectTalentSpecCount()
+{
+ if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
+ return;
+
+ if (!unitTarget || !unitTarget->IsPlayer() || damage <= 0)
+ return;
+
+ unitTarget->ToPlayer()->SetTalentGroupCount(damage);
+}
+
void Spell::EffectActivateSpec()
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ if (!unitTarget || !unitTarget->IsPlayer() || damage <= 0)
return;
Player* player = unitTarget->ToPlayer();
- uint32 specID = m_misc.SpecializationId;
- ChrSpecializationEntry const* spec = sChrSpecializationStore.AssertEntry(specID);
-
- // Safety checks done in Spell::CheckCast
- if (!spec->IsPetSpecialization())
- player->ActivateTalentGroup(spec);
- else
- player->GetPet()->SetSpecialization(specID);
+ if (player->HasTalentGroupUnlocked(damage - 1))
+ player->SetActiveTalentGroup(damage - 1);
}
void Spell::EffectPlaySound()
@@ -5321,7 +5326,7 @@ void Spell::EffectRemoveTalent()
if (!player)
return;
- player->RemoveTalent(talent);
+ //player->RemoveTalent(talent);
player->SendTalentsInfoData();
}