mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Scripts/Spell: extend SpellScript class: add target aura accessors and functions which prevent various effects of the spell from being executed. Check out SpellScript.h for details
--HG-- branch : trunk
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <string>
|
||||
#include "SpellScript.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuras.h"
|
||||
|
||||
bool _SpellScript::_Validate(SpellEntry const * entry, const char * scriptname)
|
||||
{
|
||||
@@ -164,6 +165,12 @@ bool SpellScript::_Load(Spell * spell)
|
||||
return Load();
|
||||
}
|
||||
|
||||
void SpellScript::_InitHit()
|
||||
{
|
||||
m_hitPreventEffectMask = 0;
|
||||
m_hitPreventDefaultEffectMask = 0;
|
||||
}
|
||||
|
||||
Unit * SpellScript::GetCaster()
|
||||
{
|
||||
return m_spell->GetCaster();
|
||||
@@ -237,6 +244,32 @@ void SpellScript::SetHitHeal(int32 heal)
|
||||
m_spell->m_healing = heal;
|
||||
}
|
||||
|
||||
Aura* SpellScript::GetHitAura()
|
||||
{
|
||||
if (!m_spell->m_spellAura)
|
||||
return NULL;
|
||||
if (m_spell->m_spellAura->IsRemoved())
|
||||
return NULL;
|
||||
return m_spell->m_spellAura;
|
||||
}
|
||||
|
||||
void SpellScript::PreventHitAura()
|
||||
{
|
||||
if (m_spell->m_spellAura)
|
||||
m_spell->m_spellAura->Remove();
|
||||
}
|
||||
|
||||
void SpellScript::PreventHitEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
m_hitPreventEffectMask |= 1 << effIndex;
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
m_hitPreventDefaultEffectMask |= 1 << effIndex;
|
||||
}
|
||||
|
||||
int32 SpellScript::GetEffectValue()
|
||||
{
|
||||
return m_spell->damage;
|
||||
|
||||
Reference in New Issue
Block a user