diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-05-18 23:52:58 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-05-18 23:53:25 +0200 |
| commit | c5d3dd90bea3889ef5fcd33c9ef0d59d7c544f8a (patch) | |
| tree | aa7fde6f924fc39da54908bd6eeeb0be422e5fc3 /src/server/scripts/Spells | |
| parent | 74456703146194de72424ec98c4ea76402077be6 (diff) | |
Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 21 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 16 |
4 files changed, 31 insertions, 18 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 62408425efa..d53a014343e 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -31,14 +31,15 @@ #include "Group.h" #include "InstanceScript.h" #include "LFGMgr.h" +#include "Log.h" +#include "NPCPackets.h" #include "Pet.h" #include "ReputationMgr.h" #include "SkillDiscovery.h" -#include "SpellScript.h" #include "SpellAuraEffects.h" #include "SpellHistory.h" +#include "SpellScript.h" #include "Vehicle.h" -#include "NPCPackets.h" class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader { diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index ca3615a141e..c04559b15c5 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -29,6 +29,7 @@ #include "SpellHistory.h" #include "SkillDiscovery.h" #include "Battleground.h" +#include "Log.h" // Generic script for handling item dummy effects which trigger another spell. class spell_item_trigger_spell : public SpellScriptLoader @@ -120,13 +121,13 @@ enum AlchemistStone SPELL_ALCHEMIST_STONE_EXTRA_MANA = 21400 }; -// Item - 13503: Alchemist's Stone -// Item - 35748: Guardian's Alchemist Stone -// Item - 35749: Sorcerer's Alchemist Stone -// Item - 35750: Redeemer's Alchemist Stone -// Item - 35751: Assassin's Alchemist Stone -// Item - 44322: Mercurial Alchemist Stone -// Item - 44323: Indestructible Alchemist's Stone +// Item - 13503: Alchemist's Stone +// Item - 35748: Guardian's Alchemist Stone +// Item - 35749: Sorcerer's Alchemist Stone +// Item - 35750: Redeemer's Alchemist Stone +// Item - 35751: Assassin's Alchemist Stone +// Item - 44322: Mercurial Alchemist Stone +// Item - 44323: Indestructible Alchemist's Stone // Item - 44324: Mighty Alchemist's Stone // 17619 - Alchemist Stone @@ -294,7 +295,7 @@ enum AuraOfMadness SAY_MADNESS = 21954 }; -// Item - 31859: Darkmoon Card: Madness +// Item - 31859: Darkmoon Card: Madness // 39446 - Aura of Madness class spell_item_aura_of_madness : public SpellScriptLoader { @@ -1294,8 +1295,8 @@ enum MarkOfConquest SPELL_MARK_OF_CONQUEST_ENERGIZE = 39599 }; -// Item - 27920: Mark of Conquest -// Item - 27921: Mark of Conquest +// Item - 27920: Mark of Conquest +// Item - 27921: Mark of Conquest // 33510 - Health Restore class spell_item_mark_of_conquest : public SpellScriptLoader { diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index fbb86df1b04..af4283b0e94 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -21,12 +21,13 @@ * Scriptnames of files in this file should be prefixed with "spell_rog_". */ -#include "Player.h" #include "ScriptMgr.h" -#include "SpellScript.h" +#include "Containers.h" +#include "Log.h" +#include "Player.h" #include "SpellAuraEffects.h" #include "SpellHistory.h" -#include "Containers.h" +#include "SpellScript.h" enum RogueSpells { diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 6ed2e92592d..7e40ec29f67 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -317,7 +317,7 @@ public: void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); - GetAura()->SetCastExtraParam("procTargetGUID", eventInfo.GetProcTarget()->GetGUID()); + _procTargetGuid = eventInfo.GetProcTarget()->GetGUID(); eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC, true); } @@ -325,6 +325,14 @@ public: { OnEffectProc += AuraEffectProcFn(spell_sha_earthen_rage_passive_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); } + + ObjectGuid _procTargetGuid; + + public: + ObjectGuid const& GetProcTargetGuid() const + { + return _procTargetGuid; + } }; AuraScript* GetAuraScript() const override @@ -354,10 +362,12 @@ public: void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { + using earthen_rage_script_t = spell_sha_earthen_rage_passive::spell_sha_earthen_rage_passive_AuraScript; + PreventDefaultAction(); if (Aura const* aura = GetCaster()->GetAura(SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE)) - if (ObjectGuid const* procTargetGUID = aura->GetCastExtraParam<ObjectGuid>("procTargetGUID")) - if (Unit* procTarget = ObjectAccessor::GetUnit(*GetCaster(), *procTargetGUID)) + if (earthen_rage_script_t const* earthen_rage_script = dynamic_cast<earthen_rage_script_t const*>(aura->GetScriptByName("spell_sha_earthen_rage_passive"))) + if (Unit* procTarget = ObjectAccessor::GetUnit(*GetCaster(), earthen_rage_script->GetProcTargetGuid())) GetTarget()->CastSpell(procTarget, SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE, true); } |
