diff options
Diffstat (limited to 'src/server/scripts/Northrend')
3 files changed, 75 insertions, 33 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index 0812891367b..102714a3b71 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -242,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, AsUnderlyingType(player->GetPrimarySpecialization())); + summon->GetAI()->SetData(DATA_TWISTED_VISAGE_PLAYER_SPEC, player->GetPrimaryTalentTree()); summon->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(summon); // set phase @@ -417,11 +417,40 @@ struct npc_twisted_visage : public ScriptedAI void AttackStart(Unit* who) override { - ChrSpecializationEntry const* chrSpecialization = sChrSpecializationStore.LookupEntry(_playerSpec); - if (chrSpecialization && chrSpecialization->GetFlags().HasFlag(ChrSpecializationFlag::Ranged)) - ScriptedAI::AttackStartCaster(who, 25.0f); - else - ScriptedAI::AttackStart(who); + switch (_playerClass) + { + case CLASS_SHAMAN: + switch (_playerSpec) + { + case SPEC_SHAMAN_ELEMENTAL: + case SPEC_SHAMAN_RESTORATION: + ScriptedAI::AttackStartCaster(who, 25.0f); + break; + default: + break; + } + break; + case CLASS_DRUID: + switch (_playerSpec) + { + case SPEC_DRUID_BALANCE: + case SPEC_DRUID_RESTORATION: + ScriptedAI::AttackStartCaster(who, 25.0f); + break; + default: + break; + } + break; + case CLASS_PRIEST: + case CLASS_HUNTER: + case CLASS_MAGE: + case CLASS_WARLOCK: + ScriptedAI::AttackStartCaster(who, 25.0f); + break; + case CLASS_ROGUE: + ScriptedAI::AttackStart(who); + break; + } } void SetData(uint32 type, uint32 data) override @@ -439,9 +468,9 @@ struct npc_twisted_visage : public ScriptedAI switch (_playerClass) { case CLASS_WARRIOR: - switch (ChrSpecialization(data)) + switch (data) { - case ChrSpecialization::WarriorArms: + case SPEC_WARRIOR_ARMS: _scheduler.Schedule(3s, [this](TaskContext mortalStrike) { DoCastVictim(SPELL_TWISTED_VISAGE_MORTAL_STRIKE); @@ -453,7 +482,7 @@ struct npc_twisted_visage : public ScriptedAI }); break; default: - case ChrSpecialization::WarriorFury: + case SPEC_WARRIOR_FURY: _scheduler.Schedule(2s, [this](TaskContext intercept) { if (!me->IsWithinCombatRange(me->GetVictim(), 8.0f)) @@ -469,7 +498,7 @@ struct npc_twisted_visage : public ScriptedAI bloodthirst.Repeat(3s, 5s); }); break; - case ChrSpecialization::WarriorProtection: + case SPEC_WARRIOR_PROTECTION: _scheduler.Schedule(5s, [this](TaskContext thunderClap) { DoCastSelf(SPELL_TWISTED_VISAGE_THUNDER_CLAP); @@ -483,9 +512,9 @@ struct npc_twisted_visage : public ScriptedAI } break; case CLASS_PALADIN: - switch (ChrSpecialization(data)) + switch (data) { - case ChrSpecialization::PaladinProtection: + case SPEC_PALADIN_PROTECTION: _scheduler.Schedule(5s, [this](TaskContext consecration) { DoCastSelf(SPELL_TWISTED_VISAGE_CONSECRATION); @@ -497,7 +526,7 @@ struct npc_twisted_visage : public ScriptedAI }); break; default: - case ChrSpecialization::PaladinRetribution: + case SPEC_PALADIN_RETRIBUTION: _scheduler.Schedule(5s, [this](TaskContext consecration) { DoCastSelf(SPELL_TWISTED_VISAGE_CONSECRATION); @@ -542,9 +571,9 @@ struct npc_twisted_visage : public ScriptedAI }); break; case CLASS_PRIEST: - switch (ChrSpecialization(data)) + switch (data) { - case ChrSpecialization::PriestShadow: + case SPEC_PRIEST_SHADOW: _scheduler.Schedule(5s, [this](TaskContext shadowWordPain) { DoCastVictim(SPELL_TWISTED_VISAGE_SHADOW_WORD_PAIN); @@ -595,10 +624,10 @@ struct npc_twisted_visage : public ScriptedAI }); break; case CLASS_SHAMAN: - switch (ChrSpecialization(data)) + switch (data) { default: - case ChrSpecialization::ShamanElemental: + case SPEC_SHAMAN_ELEMENTAL: _scheduler.Schedule(5s, [this](TaskContext thunderstorm) { DoCastSelf(SPELL_TWISTED_VISAGE_THUNDERSTORM); @@ -609,14 +638,14 @@ struct npc_twisted_visage : public ScriptedAI lightningBolt.Repeat(3s, 5s); }); break; - case ChrSpecialization::ShamanEnhancement: + case SPEC_SHAMAN_ENHANCEMENT: _scheduler.Schedule(2s, [this](TaskContext earthShock) { DoCastVictim(SPELL_TWISTED_VISAGE_EARTH_SHOCK); earthShock.Repeat(3s, 5s); }); break; - case ChrSpecialization::ShamanRestoration: + case SPEC_SHAMAN_RESTORATION: _scheduler.Schedule(2s, [this](TaskContext earthShield) { if (Unit* target = DoSelectLowestHpFriendly(40.f)) @@ -662,9 +691,9 @@ struct npc_twisted_visage : public ScriptedAI }); break; case CLASS_DRUID: - switch (ChrSpecialization(data)) + switch (data) { - case ChrSpecialization::DruidBalance: + case SPEC_DRUID_BALANCE: _scheduler.Schedule(2s, [this](TaskContext moonfire) { DoCastVictim(SPELL_TWISTED_VISAGE_MOONFIRE); @@ -675,8 +704,7 @@ struct npc_twisted_visage : public ScriptedAI wrath.Repeat(3s, 5s); }); break; - case ChrSpecialization::DruidGuardian: - case ChrSpecialization::DruidFeral: + case SPEC_DRUID_FERAL: _scheduler.Schedule(1ms, [this](TaskContext /*catForm*/) { DoCastSelf(SPELL_TWISTED_VISAGE_CAT_FORM); @@ -691,7 +719,7 @@ struct npc_twisted_visage : public ScriptedAI }); break; default: - case ChrSpecialization::DruidRestoration: + case SPEC_DRUID_RESTORATION: _scheduler.Schedule(2s, [this](TaskContext lifebloom) { if (Unit* target = DoSelectLowestHpFriendly(40.f)) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 807109e1493..46bc594645c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -16,6 +16,7 @@ */ #include "icecrown_citadel.h" +#include "CommonHelpers.h" #include "Containers.h" #include "DB2Stores.h" #include "GridNotifiers.h" @@ -1089,18 +1090,30 @@ class spell_sindragosa_unchained_magic : public SpellScript if (!player) continue; - ChrSpecializationEntry const* specialization = player->GetPrimarySpecializationEntry(); - if (!specialization) - continue; - - if (specialization->GetRole() == ChrSpecializationRole::Healer) + if (Trinity::Helpers::Entity::IsPlayerHealer(player)) { healers.push_back(target); continue; } - if (specialization->GetFlags().HasFlag(ChrSpecializationFlag::Caster)) - casters.push_back(target); + switch (player->GetClass()) + { + case CLASS_PRIEST: + case CLASS_MAGE: + case CLASS_WARLOCK: + casters.push_back(target); + break; + case CLASS_SHAMAN: + if (Trinity::Helpers::Entity::GetPlayerSpecialization(player) != SPEC_SHAMAN_ENHANCEMENT) + casters.push_back(target); + break; + case CLASS_DRUID: + if (Trinity::Helpers::Entity::GetPlayerSpecialization(player) != SPEC_DRUID_FERAL) + casters.push_back(target); + break; + default: + break; + } } targets.clear(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index a36f99be4a2..a1864798ff1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -15,11 +15,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "naxxramas.h" #include "ScriptMgr.h" +#include "CommonHelpers.h" #include "GameObject.h" #include "InstanceScript.h" #include "MotionMaster.h" -#include "naxxramas.h" #include "ObjectAccessor.h" #include "Player.h" #include "PlayerAI.h" @@ -183,7 +184,7 @@ class KelThuzadCharmedPlayerAI : public SimpleCharmedPlayerAI if (pTarget->HasBreakableByDamageCrowdControlAura()) return false; // We _really_ dislike healers. So we hit them in the face. Repeatedly. Exclusively. - return PlayerAI::IsPlayerHealer(pTarget); + return Trinity::Helpers::Entity::IsPlayerHealer(pTarget); } }; |
