mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
refactor(Scripts/Spells): code cleanup (part 9) (#6946)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Item.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
|
||||
@@ -886,8 +886,8 @@ public:
|
||||
if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0))
|
||||
amount += cp * idol->GetAmount();
|
||||
// Idol of Worship. Can't be handled as SpellMod due its dependency from CPs
|
||||
else if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0))
|
||||
amount += cp * idol->GetAmount();
|
||||
else if (AuraEffect const* idol2 = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0))
|
||||
amount += cp * idol2->GetAmount();
|
||||
|
||||
amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp));
|
||||
}
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -32,6 +30,11 @@
|
||||
#include "Vehicle.h"
|
||||
#include <array>
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
// there is probably some underlying problem with imports which should properly addressed
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
// Ours
|
||||
class spell_gen_model_visible : public SpellScriptLoader
|
||||
{
|
||||
@@ -4713,15 +4716,19 @@ public:
|
||||
{
|
||||
Aura const* aura = GetHitAura();
|
||||
if (!(aura && aura->GetStackAmount() == 3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_BONKED);
|
||||
|
||||
if (Aura const* aura = target->GetAura(SPELL_ON_GUARD))
|
||||
if (Aura const* onGuardAura = target->GetAura(SPELL_ON_GUARD))
|
||||
{
|
||||
if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID()))
|
||||
if (Item* item = target->GetItemByGuid(onGuardAura->GetCastItemGUID()))
|
||||
{
|
||||
target->DestroyItemCount(item->GetEntry(), 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,16 @@
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Pet.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
// there is probably some underlying problem with imports which should properly addressed
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
enum HunterSpells
|
||||
{
|
||||
// Ours
|
||||
|
||||
@@ -227,10 +227,14 @@ public:
|
||||
// Xinef: removed divine guardian because it will affect triggered spell with increased amount
|
||||
// Arena - Dampening
|
||||
if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0))
|
||||
{
|
||||
AddPct(amount, dampening->GetAmount());
|
||||
}
|
||||
// Battleground - Dampening
|
||||
else if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0))
|
||||
AddPct(amount, dampening->GetAmount());
|
||||
else if (AuraEffect const* dampening2 = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0))
|
||||
{
|
||||
AddPct(amount, dampening2->GetAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1259,8 +1263,10 @@ public:
|
||||
holy += eventInfo.GetProcTarget()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY);
|
||||
|
||||
// Xinef: Libram of Divine Purpose
|
||||
if (AuraEffect* aurEff = GetTarget()->GetDummyAuraEffect(SPELLFAMILY_PALADIN, 2025, EFFECT_0))
|
||||
holy += aurEff->GetAmount();
|
||||
if (AuraEffect* aurEffPaladin = GetTarget()->GetDummyAuraEffect(SPELLFAMILY_PALADIN, 2025, EFFECT_0))
|
||||
{
|
||||
holy += aurEffPaladin->GetAmount();
|
||||
}
|
||||
|
||||
int32 bp = std::max<int32>(0, int32((ap * 0.022f + 0.044f * holy) * GetTarget()->GetAttackTime(BASE_ATTACK) / 1000));
|
||||
GetTarget()->CastCustomSpell(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
|
||||
@@ -713,11 +713,15 @@ public:
|
||||
AddPct(amount, healModifier);
|
||||
|
||||
// Arena - Dampening
|
||||
if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0))
|
||||
AddPct(amount, dampening->GetAmount());
|
||||
if (AuraEffect const* arenaDampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0))
|
||||
{
|
||||
AddPct(amount, arenaDampening->GetAmount());
|
||||
}
|
||||
// Battleground - Dampening
|
||||
else if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0))
|
||||
AddPct(amount, dampening->GetAmount());
|
||||
else if (AuraEffect const* bgDampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0))
|
||||
{
|
||||
AddPct(amount, bgDampening->GetAmount());
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
Reference in New Issue
Block a user