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
This commit is contained in:
Shauren
2010-08-26 15:32:08 +02:00
parent 73d3f210a9
commit 692779f283
5 changed files with 19 additions and 13 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
DELETE FROM script_texts WHERE entry BETWEEN -1000578 AND -1000575; DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000578 AND -1000575;
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
(19589,-1000575, 'All systems on-line. Prepare yourself, we leave shortly.',0,0,0,0, 'max_a_million SAY_START'), (19589,-1000575, 'All systems on-line. Prepare yourself, we leave shortly.',0,0,0,0, 'max_a_million SAY_START'),
(19589,-1000576, 'Be careful in there and come back in one piece!',0,0,0,0, 'bot-specialist_alley SAY_ALLEY_FAREWELL'), (19589,-1000576, 'Be careful in there and come back in one piece!',0,0,0,0, 'bot-specialist_alley SAY_ALLEY_FAREWELL'),
(19589,-1000577, 'Proceed.',0,0,0,0, 'max_a_million SAY_CONTINUE'), (19589,-1000577, 'Proceed.',0,0,0,0, 'max_a_million SAY_CONTINUE'),
+9 -3
View File
@@ -280,11 +280,17 @@ class AuraScript : public _SpellScript
public: public:
bool _Validate(SpellEntry const * entry, const char * scriptname); bool _Validate(SpellEntry const * entry, const char * scriptname);
bool _Load(Aura * aura); bool _Load(Aura * aura);
void _ResetDefault() { m_defaultPreventedEffectsMask = 0; } void _ResetDefault() { m_defaultPreventedActionsMask = 0; }
bool _IsDefaultActionPrevented(SpellEffIndex effIndex) { return m_defaultPreventedEffectsMask & (1 << effIndex); } bool _IsDefaultActionPrevented(SpellEffIndex effIndex)
void PreventDefaultAction(SpellEffIndex effIndex) { m_defaultPreventedEffectsMask |= 1 << 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: private:
Aura * m_aura; Aura * m_aura;
uint8 m_defaultPreventedActionsMask;
uint8 m_defaultPreventedEffectsMask; uint8 m_defaultPreventedEffectsMask;
public: public:
// //
@@ -954,7 +954,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
void Register() void Register()
{ {
PreventDefaultAction(EFFECT_1); PreventDefaultEffect(EFFECT_1);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathbringer_blood_link_AuraScript::HandlePeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); 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*/) void HandleScript(SpellEffIndex /*effIndex*/)
{ {
PreventHitDefaultEffect(EFFECT_1); // make this the default handler
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true); GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true);
} }
void Register() 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); 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*/) void HandleScript(SpellEffIndex /*effIndex*/)
{ {
PreventHitDefaultEffect(EFFECT_1); // make this the default handler
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true); GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true);
} }
void Register() void Register()
{ {
PreventHitDefaultEffect(EFFECT_1); // make this the default handler
OnEffect += SpellEffectFn(spell_deathbringer_blood_nova_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); OnEffect += SpellEffectFn(spell_deathbringer_blood_nova_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
} }
}; };
@@ -757,7 +757,6 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
{ {
void HandlePeriodicTick(AuraEffect const * aurEff, AuraApplication const * aurApp) void HandlePeriodicTick(AuraEffect const * aurEff, AuraApplication const * aurApp)
{ {
PreventDefaultAction(EFFECT_0);
Unit* caster = GetCaster(); Unit* caster = GetCaster();
int32 missingHealth = caster->GetMaxHealth() - caster->GetHealth(); int32 missingHealth = caster->GetMaxHealth() - caster->GetHealth();
caster->ModifyHealth(missingHealth); caster->ModifyHealth(missingHealth);
@@ -766,6 +765,7 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
void Register() void Register()
{ {
PreventDefaultEffect(EFFECT_0);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathwhisper_mana_barrier_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathwhisper_mana_barrier_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
} }
}; };