diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 44 | ||||
| -rwxr-xr-x | src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp | 84 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 49 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 29 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 11 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_pet.cpp | 178 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 6 |
10 files changed, 159 insertions, 260 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 9baf6ba7a00..fdc9a6a21d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -200,7 +200,7 @@ class boss_sindragosa : public CreatureScript struct boss_sindragosaAI : public BossAI { - boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA) + boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA), _summoned(false) { } @@ -220,7 +220,7 @@ class boss_sindragosa : public CreatureScript _isInAirPhase = false; _isThirdPhase = false; - if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -266,10 +266,13 @@ class boss_sindragosa : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { + if (_summoned) + return; + + _summoned = true; if (TempSummon* summon = me->ToTempSummon()) summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); - instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255); if (me->isDead()) return; @@ -550,6 +553,7 @@ class boss_sindragosa : public CreatureScript uint8 _mysticBuffetStack; bool _isInAirPhase; bool _isThirdPhase; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -642,7 +646,7 @@ class npc_spinestalker : public CreatureScript struct npc_spinestalkerAI : public ScriptedAI { - npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -651,7 +655,7 @@ class npc_spinestalker : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -664,7 +668,7 @@ class npc_spinestalker : public CreatureScript _events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(8000, 12000)); me->SetReactState(REACT_DEFENSIVE); - if (_instance->GetData(DATA_SPINESTALKER) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -674,7 +678,7 @@ class npc_spinestalker : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -686,7 +690,10 @@ class npc_spinestalker : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_SPINESTALKER, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -753,6 +760,7 @@ class npc_spinestalker : public CreatureScript private: EventMap _events; InstanceScript* _instance; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -768,7 +776,7 @@ class npc_rimefang : public CreatureScript struct npc_rimefangAI : public ScriptedAI { - npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -777,7 +785,7 @@ class npc_rimefang : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -790,7 +798,7 @@ class npc_rimefang : public CreatureScript me->SetReactState(REACT_DEFENSIVE); _icyBlastCounter = 0; - if (_instance->GetData(DATA_RIMEFANG) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -800,7 +808,7 @@ class npc_rimefang : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -812,7 +820,10 @@ class npc_rimefang : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_RIMEFANG, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -906,6 +917,7 @@ class npc_rimefang : public CreatureScript EventMap _events; InstanceScript* _instance; uint8 _icyBlastCounter; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -933,7 +945,7 @@ class npc_sindragosa_trash : public CreatureScript if (!me->isDead()) { if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -956,7 +968,7 @@ class npc_sindragosa_trash : public CreatureScript // Increase add count if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void SetData(uint32 type, uint32 data) @@ -1503,7 +1515,7 @@ class at_sindragosa_lair : public AreaTriggerScript if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_RIMEFANG))) rimefang->AI()->DoAction(ACTION_START_FROSTWYRM); - if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) + if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && !instance->GetData64(DATA_SINDRAGOSA) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) { if (player->GetMap()->IsHeroic() && !instance->GetData(DATA_HEROIC_ATTEMPTS)) return true; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 288fde28c38..704c3c2b0c2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -89,13 +89,6 @@ WeeklyQuest const WeeklyQuestData[WeeklyNPCs] = {NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul }; -enum FrostwyrmFlags -{ - FLAG_SPINESTALKER_SUMMONED = 0x01, - FLAG_RIMEFANG_SUMMONED = 0x02, - FLAG_SINDRAGOSA_SUMMONED = 0x04, -}; - class instance_icecrown_citadel : public InstanceMapScript { public: @@ -152,7 +145,6 @@ class instance_icecrown_citadel : public InstanceMapScript ColdflameJetsState = NOT_STARTED; BloodQuickeningState = NOT_STARTED; BloodQuickeningMinutes = 0; - FrostwyrmFlags = 0; } void FillInitialWorldStates(WorldPacket& data) @@ -284,13 +276,9 @@ class instance_icecrown_citadel : public InstanceMapScript break; case NPC_SPINESTALKER: SpinestalkerGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; break; case NPC_RIMEFANG: RimefangGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; break; case NPC_THE_LICH_KING: TheLichKingGUID = creature->GetGUID(); @@ -307,6 +295,12 @@ class instance_icecrown_citadel : public InstanceMapScript } } + void OnCreatureRemove(Creature* creature) + { + if (creature->GetEntry() == NPC_SINDRAGOSA) + SindragosaGUID = 0; + } + // Weekly quest spawn prevention uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data) { @@ -357,49 +351,36 @@ class instance_icecrown_citadel : public InstanceMapScript crok->AI()->SetGUID(creature->GetGUID(), ACTION_VRYKUL_DEATH); break; case NPC_FROSTWING_WHELP: + if (FrostwyrmGUIDs.empty()) + return; + if (creature->AI()->GetData(1/*DATA_FROSTWYRM_OWNER*/) == DATA_SPINESTALKER) { - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return; - - SpinestalkerTrash.erase(creature->GetGUID()); + SpinestalkerTrash.erase(creature->GetDBTableGUIDLow()); if (SpinestalkerTrash.empty()) - { - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } else { - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return; - - RimefangTrash.erase(creature->GetGUID()); + RimefangTrash.erase(creature->GetDBTableGUIDLow()); if (RimefangTrash.empty()) - { - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; if (Creature* spinestalk = instance->GetCreature(RimefangGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } break; case NPC_RIMEFANG: case NPC_SPINESTALKER: { - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return; - if (instance->IsHeroic() && !HeroicAttempts) return; if (GetBossState(DATA_SINDRAGOSA) == DONE) return; - FrostwyrmGUIDs.erase(creature->GetGUID()); + FrostwyrmGUIDs.erase(creature->GetDBTableGUIDLow()); if (FrostwyrmGUIDs.empty()) { - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) boss->AI()->DoAction(ACTION_START_FROSTWYRM); @@ -597,16 +578,10 @@ class instance_icecrown_citadel : public InstanceMapScript switch (type) { case DATA_SINDRAGOSA_FROSTWYRMS: - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return 255; return FrostwyrmGUIDs.size(); case DATA_SPINESTALKER: - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return 255; return SpinestalkerTrash.size(); case DATA_RIMEFANG: - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return 255; return RimefangTrash.size(); case DATA_COLDFLAME_JETS: return ColdflameJetsState; @@ -806,9 +781,6 @@ class instance_icecrown_citadel : public InstanceMapScript sindra->DespawnOrUnsummon(); } } - // Reached when loading from DB - if (state == DONE) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; break; case DATA_THE_LICH_KING: { @@ -866,16 +838,13 @@ class instance_icecrown_citadel : public InstanceMapScript IsOrbWhispererEligible = data ? true : false; break; case DATA_SINDRAGOSA_FROSTWYRMS: - if (data == 255) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; + FrostwyrmGUIDs.insert(data); break; case DATA_SPINESTALKER: - if (data == 255) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; + SpinestalkerTrash.insert(data); break; case DATA_RIMEFANG: - if (data == 255) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; + RimefangTrash.insert(data); break; case DATA_COLDFLAME_JETS: ColdflameJetsState = data; @@ -918,22 +887,6 @@ class instance_icecrown_citadel : public InstanceMapScript } } - void SetData64(uint32 id, uint64 data) - { - switch (id) - { - case DATA_SINDRAGOSA_FROSTWYRMS: - FrostwyrmGUIDs.insert(data); - break; - case DATA_SPINESTALKER: - SpinestalkerTrash.insert(data); - break; - case DATA_RIMEFANG: - RimefangTrash.insert(data); - break; - } - } - bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) { switch (criteria_id) @@ -1301,13 +1254,12 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 PillarsUnchainedGUID; uint32 TeamInInstance; uint32 ColdflameJetsState; - std::set<uint64> FrostwyrmGUIDs; - std::set<uint64> SpinestalkerTrash; - std::set<uint64> RimefangTrash; + std::set<uint32> FrostwyrmGUIDs; + std::set<uint32> SpinestalkerTrash; + std::set<uint32> RimefangTrash; uint32 BloodQuickeningState; uint32 HeroicAttempts; uint16 BloodQuickeningMinutes; - uint16 FrostwyrmFlags; bool IsBonedEligible; bool IsOozeDanceEligible; bool IsNauseaEligible; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index bdaaa002b3f..f42fd87c643 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -193,7 +193,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader { PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript); - void CalculateDamage() + void CalculateDamage(SpellEffIndex /*effIndex*/) { if (!GetHitUnit()) return; @@ -205,7 +205,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader void Register() { - OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage); + OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9dedeaf5bd7..4c8a9db1571 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -332,26 +332,6 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; -class StarfallDummyTargetFilter -{ - public: - StarfallDummyTargetFilter(Unit* caster) : _caster(caster) { } - - bool operator()(Unit* target) const - { - if (target->HasStealthAura() || target->HasInvisibilityAura()) - return true; - - if (!target->IsWithinLOSInMap(_caster)) - return true; - - return false; - } - - private: - Unit* _caster; -}; - class spell_dru_starfall_dummy : public SpellScriptLoader { public: @@ -363,8 +343,6 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void FilterTargets(std::list<Unit*>& unitList) { - // Remove targets not in LoS or in stealth - unitList.remove_if(StarfallDummyTargetFilter(GetCaster())); Trinity::Containers::RandomResizeList(unitList, 2); } @@ -426,21 +404,20 @@ class spell_dru_lifebloom : public SpellScriptLoader // final heal int32 stack = GetStackAmount(); int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) + if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); - } - GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); - // restore mana - if (caster) - { + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + return; } + + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } void HandleDispel(DispelInfo* dispelInfo) @@ -451,21 +428,19 @@ class spell_dru_lifebloom : public SpellScriptLoader { // final heal int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) + if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - } - - target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); - // restore mana - if (caster) - { + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + return; } + + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); } } } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f254908fe55..e7cc7360aab 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -252,12 +252,7 @@ class spell_gen_parachute : public SpellScriptLoader if (target->IsFalling()) { target->RemoveAurasDueToSpell(SPELL_PARACHUTE); - - float x, y, z; - target->GetPosition(x, y, z); - float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z); - if (fabs(groundZ - z) > 0.1f) - target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } } @@ -2825,24 +2820,16 @@ class spell_gen_lifebloom : public SpellScriptLoader void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { // Final heal only on duration end - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) return; // final heal GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); } - void HandleDispel(DispelInfo* /*dispelInfo*/) - { - // final heal - if (Unit* target = GetUnitOwner()) - target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID()); - } - void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); - AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel); } private: @@ -2887,8 +2874,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader { if (GetCaster()) if (Unit* owner = GetCaster()->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong - owner->CastSpell(owner, _spellId, true); + owner->CastSpell(owner, _spellId, true); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -3010,14 +2996,11 @@ class spell_gen_mount : public SpellScriptLoader // Triggered spell id dependent on riding skill and zone bool canFly = false; - uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); - if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) + uint32 map = target->GetMapId(); + if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) canFly = true; - float x, y, z; - target->GetPosition(x, y, z); - uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); + AreaTableEntry const* area = sAreaStore.LookupEntry(target->GetAreaId()); if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) canFly = false; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index fe681032c1c..329e0d2e170 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -462,19 +462,10 @@ class spell_pal_lay_on_hands : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) - { if (caster == target) - { - if (target->HasAura(SPELL_FORBEARANCE)) - return SPELL_FAILED_TARGET_AURASTATE; - - if (target->HasAura(SPELL_AVENGING_WRATH_MARKER)) + if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) return SPELL_FAILED_TARGET_AURASTATE; - if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; - } - } return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 6ed0f18c785..78bdbb7f127 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1,4 +1,4 @@ -/* + /* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it @@ -102,7 +102,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -121,7 +121,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -140,7 +140,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -155,7 +155,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -170,7 +170,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -237,7 +237,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -249,7 +249,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -281,7 +281,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -291,7 +291,7 @@ public: } } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -310,16 +310,16 @@ public: // Glyph of felguard if (pet->GetEntry() == ENTRY_FELGUARD) { - if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(56246, EFFECT_0)) { float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); - amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + amount += CalculatePctN(amount+base_attPower, /* aurEff */ect->GetAmount()); } } } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -374,7 +374,7 @@ public: return true; } - void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateIntellectAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -389,7 +389,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -417,7 +417,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -427,7 +427,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -439,7 +439,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -486,7 +486,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -498,7 +498,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -510,7 +510,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -553,7 +553,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -593,7 +593,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -608,7 +608,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -623,7 +623,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -668,7 +668,7 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -690,7 +690,7 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -741,11 +741,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { switch (GetCaster()->GetEntry()) { @@ -792,13 +792,13 @@ public: return true; } - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) if (Unit* owner = pet->ToPet()->GetOwner()) - if (AuraEffect* aurEffect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) - amount += aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) + amount += /* aurEff */ect->GetAmount(); } void Register() @@ -830,10 +830,8 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -847,10 +845,8 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -886,50 +882,45 @@ public: { PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript); - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float mod = 0.45f; - float ownerBonus = 0.0f; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float mod = 0.45f; + float ownerBonus = 0.0f; - PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 - if (itr == pet->ToPet()->m_spells.end()) - itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 - if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); - } + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + } - ownerBonus = owner->GetStat(STAT_STAMINA)*mod; + ownerBonus = owner->GetStat(STAT_STAMINA)*mod; - amount += ownerBonus; - } + amount += ownerBonus; + } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -959,7 +950,7 @@ public: } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1024,7 +1015,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1043,7 +1034,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1062,7 +1053,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1111,7 +1102,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1130,7 +1121,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1149,7 +1140,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1198,7 +1189,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1215,7 +1206,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1232,7 +1223,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1279,11 +1270,11 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritSpell = 0.0f; @@ -1300,11 +1291,11 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritMelee = 0.0f; @@ -1350,11 +1341,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // Pet's base damage changes depending on happiness if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet()) @@ -1408,14 +1399,14 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { - if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) - amount = aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) + amount = /* aurEff */ect->GetAmount(); else amount = 0; } @@ -1450,18 +1441,19 @@ public: return true; } - void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { if (Unit* owner = pet->GetOwner()) - + { // Army of the dead ghoul if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) amount = -90; // Night of the dead else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + } } } @@ -1494,7 +1486,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1520,20 +1512,20 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1597,7 +1589,7 @@ public: return true; } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1640,7 +1632,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1657,7 +1649,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1703,7 +1695,7 @@ public: return true; } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1718,7 +1710,7 @@ public: } } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index dbc3a91012b..6910bf47805 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -352,17 +352,13 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { if (Unit* target = GetUnitOwner()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { int32 damage = aurEff->GetAmount() * 8; // backfire damage caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } - } } void Register() diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index da15c5c5046..fce3d0415a6 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,7 +35,7 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, - + SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, @@ -261,7 +261,7 @@ class EarthenPowerTargetSelector { public: EarthenPowerTargetSelector() { } - + bool operator() (Unit* target) { if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) @@ -679,9 +679,8 @@ class spell_sha_flame_shock : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { // Lava Flows - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) { if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) return; @@ -689,7 +688,6 @@ class spell_sha_flame_shock : public SpellScriptLoader uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); } - } } void Register() @@ -723,11 +721,9 @@ class spell_sha_sentry_totem : public SpellScriptLoader void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - { if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) if (totem->isTotem()) caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); - } } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 1b24a9ec09f..e20eb07d45a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -37,6 +37,7 @@ enum WarlockSpells WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, + WARLOCK_HAUNT = 48181, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, }; @@ -560,6 +561,9 @@ class spell_warl_haunt : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + if (Unit* caster = GetCaster()) { int32 amount = aurEff->GetAmount(); @@ -603,14 +607,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader void HandleDispel(DispelInfo* dispelInfo) { if (Unit* caster = GetCaster()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) { int32 damage = aurEff->GetAmount() * 9; // backfire damage and silence caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } } void Register() |
