aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-08-26 15:32:08 +0200
committerShauren <none@none>2010-08-26 15:32:08 +0200
commit692779f2830cc9c14eb07cb70908694b3c5ad75a (patch)
treef23ecde82f586cfb99eeef857e2e04054c1a7f75 /src
parent73d3f210a9df46d3725575663538a69cf58f0fda (diff)
Core/Scripts: Added possibility to disable default aura effects for the whole duration of aura (PreventDefaultAction works per script call, PreventDefaultEffect is global)
Scripts/Icecrown Citadel: Corrected aura scripts for new PreventDefaultEffect, thx QAston for pointing it out SQL: Corrected name for 9599 vehicle accessory SQL: Fixed import errors in 9600_world_script_texts.sql by Supabad --HG-- branch : trunk rename : sql/updates/9599_vehicle_accessory.sql => sql/updates/9599_world_vehicle_accessory.sql
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellScript.h12
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 7a030614469..dea3ebbfc8d 100644
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -280,11 +280,17 @@ class AuraScript : public _SpellScript
public:
bool _Validate(SpellEntry const * entry, const char * scriptname);
bool _Load(Aura * aura);
- void _ResetDefault() { m_defaultPreventedEffectsMask = 0; }
- bool _IsDefaultActionPrevented(SpellEffIndex effIndex) { return m_defaultPreventedEffectsMask & (1 << effIndex); }
- void PreventDefaultAction(SpellEffIndex effIndex) { m_defaultPreventedEffectsMask |= 1 << effIndex; }
+ void _ResetDefault() { m_defaultPreventedActionsMask = 0; }
+ bool _IsDefaultActionPrevented(SpellEffIndex effIndex)
+ {
+ uint8 effIndexMask = 1 << effIndex;
+ return (m_defaultPreventedActionsMask & effIndexMask) || (m_defaultPreventedEffectsMask & effIndexMask);
+ }
+ void PreventDefaultAction(SpellEffIndex effIndex) { m_defaultPreventedActionsMask |= 1 << effIndex; }
+ void PreventDefaultEffect(SpellEffIndex effIndex) { m_defaultPreventedEffectsMask |= 1 << effIndex; }
private:
Aura * m_aura;
+ uint8 m_defaultPreventedActionsMask;
uint8 m_defaultPreventedEffectsMask;
public:
//
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 1bb5c3b2587..f8d297b9c71 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -954,7 +954,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
void Register()
{
- PreventDefaultAction(EFFECT_1);
+ PreventDefaultEffect(EFFECT_1);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathbringer_blood_link_AuraScript::HandlePeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
@@ -1040,13 +1040,13 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
+ PreventHitDefaultEffect(EFFECT_1); // make this the default handler
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true);
}
void Register()
{
- PreventHitDefaultEffect(EFFECT_1); // make this the default handler
OnEffect += SpellEffectFn(spell_deathbringer_rune_of_blood_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -1073,13 +1073,13 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
+ PreventHitDefaultEffect(EFFECT_1); // make this the default handler
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true);
}
void Register()
{
- PreventHitDefaultEffect(EFFECT_1); // make this the default handler
OnEffect += SpellEffectFn(spell_deathbringer_blood_nova_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index 130cfe4f026..7c55d3ec977 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -757,7 +757,6 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
{
void HandlePeriodicTick(AuraEffect const * aurEff, AuraApplication const * aurApp)
{
- PreventDefaultAction(EFFECT_0);
Unit* caster = GetCaster();
int32 missingHealth = caster->GetMaxHealth() - caster->GetHealth();
caster->ModifyHealth(missingHealth);
@@ -766,6 +765,7 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
void Register()
{
+ PreventDefaultEffect(EFFECT_0);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathwhisper_mana_barrier_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};