mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Misc: Turn ChrSpecialization into enum class
This commit is contained in:
@@ -195,7 +195,7 @@ public:
|
||||
if (playerClass != talentInfo->ClassID)
|
||||
continue;
|
||||
|
||||
if (talentInfo->SpecID && player->GetPrimarySpecialization() != talentInfo->SpecID)
|
||||
if (talentInfo->SpecID && player->GetPrimarySpecialization() != ChrSpecialization(talentInfo->SpecID))
|
||||
continue;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(talentInfo->SpellID, DIFFICULTY_NONE);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "ahnkahet.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
@@ -241,7 +242,7 @@ struct boss_volazj : public BossAI
|
||||
// clone
|
||||
player->CastSpell(summon, SPELL_CLONE_PLAYER, true);
|
||||
summon->GetAI()->SetData(DATA_TWISTED_VISAGE_PLAYER_CLASS, player->GetClass());
|
||||
summon->GetAI()->SetData(DATA_TWISTED_VISAGE_PLAYER_SPEC, player->GetPrimarySpecialization());
|
||||
summon->GetAI()->SetData(DATA_TWISTED_VISAGE_PLAYER_SPEC, AsUnderlyingType(player->GetPrimarySpecialization()));
|
||||
summon->SetReactState(REACT_AGGRESSIVE);
|
||||
DoZoneInCombat(summon);
|
||||
// set phase
|
||||
@@ -441,7 +442,7 @@ struct npc_twisted_visage : public ScriptedAI
|
||||
switch (_playerClass)
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
switch (data)
|
||||
switch (ChrSpecialization(data))
|
||||
{
|
||||
case ChrSpecialization::WarriorArms:
|
||||
_scheduler.Schedule(3s, [this](TaskContext mortalStrike)
|
||||
@@ -485,7 +486,7 @@ struct npc_twisted_visage : public ScriptedAI
|
||||
}
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
switch (data)
|
||||
switch (ChrSpecialization(data))
|
||||
{
|
||||
case ChrSpecialization::PaladinProtection:
|
||||
_scheduler.Schedule(5s, [this](TaskContext consecration)
|
||||
@@ -544,7 +545,7 @@ struct npc_twisted_visage : public ScriptedAI
|
||||
});
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
switch (data)
|
||||
switch (ChrSpecialization(data))
|
||||
{
|
||||
case ChrSpecialization::PriestShadow:
|
||||
_scheduler.Schedule(5s, [this](TaskContext shadowWordPain)
|
||||
@@ -597,7 +598,7 @@ struct npc_twisted_visage : public ScriptedAI
|
||||
});
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
switch (data)
|
||||
switch (ChrSpecialization(data))
|
||||
{
|
||||
default:
|
||||
case ChrSpecialization::ShamanElemental:
|
||||
@@ -664,7 +665,7 @@ struct npc_twisted_visage : public ScriptedAI
|
||||
});
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
switch (data)
|
||||
switch (ChrSpecialization(data))
|
||||
{
|
||||
case ChrSpecialization::DruidBalance:
|
||||
_scheduler.Schedule(2s, [this](TaskContext moonfire)
|
||||
|
||||
@@ -1098,7 +1098,10 @@ class spell_sindragosa_unchained_magic : public SpellScript
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
ChrSpecializationEntry const* specialization = sChrSpecializationStore.LookupEntry(player->GetPrimarySpecialization());
|
||||
ChrSpecializationEntry const* specialization = player->GetPrimarySpecializationEntry();
|
||||
if (!specialization)
|
||||
continue;
|
||||
|
||||
if (specialization->GetRole() == ChrSpecializationRole::Healer)
|
||||
{
|
||||
healers.push_back(target);
|
||||
|
||||
@@ -803,7 +803,7 @@ class spell_dru_innervate : public SpellScript
|
||||
if (!target)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
ChrSpecializationEntry const* spec = sChrSpecializationStore.LookupEntry(target->GetPrimarySpecialization());
|
||||
ChrSpecializationEntry const* spec = target->GetPrimarySpecializationEntry();
|
||||
if (!spec || spec->GetRole() != ChrSpecializationRole::Healer)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
|
||||
@@ -4344,7 +4344,7 @@ class spell_item_amalgams_seventh_spine : public AuraScript
|
||||
|
||||
auto updateAuraIfInCorrectSpec = [&](ChrSpecialization spec, AmalgamsSeventhSpine aura)
|
||||
{
|
||||
if (target->GetPrimarySpecialization() != uint32(spec))
|
||||
if (target->GetPrimarySpecialization() != spec)
|
||||
target->RemoveAurasDueToSpell(aura);
|
||||
else if (!target->HasAura(aura))
|
||||
target->CastSpell(target, aura, aurEff);
|
||||
|
||||
@@ -390,19 +390,19 @@ class spell_sha_deeply_rooted_elements : public AuraScript
|
||||
|
||||
void Register() override
|
||||
{
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == TALENT_SPEC_SHAMAN_ELEMENTAL)
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == ChrSpecialization::ShamanElemental)
|
||||
{
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_deeply_rooted_elements::CheckProc<SPELL_SHAMAN_LAVA_BURST>, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_sha_deeply_rooted_elements::HandleProc<SPELL_SHAMAN_ASCENDANCE_ELEMENTAL>, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == TALENT_SPEC_SHAMAN_ENHANCEMENT)
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == ChrSpecialization::ShamanEnhancement)
|
||||
{
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_deeply_rooted_elements::CheckProc<SPELL_SHAMAN_STORMSTRIKE>, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_sha_deeply_rooted_elements::HandleProc<SPELL_SHAMAN_ASCENDANCE_ENHANCEMENT>, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == TALENT_SPEC_SHAMAN_RESTORATION)
|
||||
if (!GetAura() || GetUnitOwner()->ToPlayer()->GetPrimarySpecialization() == ChrSpecialization::ShamanRestoration)
|
||||
{
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_deeply_rooted_elements::CheckProc<SPELL_SHAMAN_RIPTIDE>, EFFECT_3, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_sha_deeply_rooted_elements::HandleProc<SPELL_SHAMAN_ASCENDANCE_RESTORATION>, EFFECT_3, SPELL_AURA_DUMMY);
|
||||
|
||||
Reference in New Issue
Block a user