Move a couple of warrior spell dummy effect handlers to spell scripts.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-02 13:18:45 -07:00
parent 891df4eccb
commit e798097ae3
5 changed files with 78 additions and 22 deletions
+2
View File
@@ -14683,6 +14683,8 @@ LOCK TABLES `spell_script_names` WRITE;
/*!40000 ALTER TABLE `spell_script_names` DISABLE KEYS */;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
-- warrior
( 12975,'spell_warr_last_stand'),
( 21977,'spell_warr_warriors_wrath'),
-- paladin
( 20425, 'spell_pal_judgement_of_command'),
(-20473, 'spell_pal_holy_shock'),
@@ -0,0 +1,5 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=21977 AND `ScriptName`='spell_warr_warriors_wrath';
DELETE FROM `spell_script_names` WHERE `spell_id`=12975 AND `ScriptName`='spell_warr_last_stand';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(12975,'spell_warr_last_stand'),
(21977,'spell_warr_warriors_wrath');
-15
View File
@@ -1571,21 +1571,6 @@ void Spell::EffectDummy(uint32 i)
}
switch(m_spellInfo->Id)
{
// Warrior's Wrath
case 21977:
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 21887, true);// spell mod
return;
}
// Last Stand
case 12975:
{
int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth()*0.3);
m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
return;
}
// Bloodthirst
case 23881:
{
+3 -2
View File
@@ -37,7 +37,7 @@ enum PaladinSpells
class spell_pal_blessing_of_faith_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
return false;
@@ -82,10 +82,11 @@ SpellScript * GetSpellScript_spell_pal_blessing_of_faith()
class spell_pal_holy_shock_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
return false;
// can't use other spell than holy shock due to spell_ranks dependency
if (spellmgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != spellmgr.GetFirstSpellInChain(spellEntry->Id))
return false;
+68 -5
View File
@@ -23,14 +23,77 @@
#include "ScriptPCH.h"
enum WarriorSpells
{
WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976,
WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED = 21887,
};
class spell_warr_last_stand_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(WARRIOR_SPELL_LAST_STAND_TRIGGERED))
return false;
return true;
}
void HandleDummy(SpellEffIndex effIndex)
{
int32 healthModSpellBasePoints0 = int32(GetCaster()->GetMaxHealth() * 0.3);
GetCaster()->CastCustomSpell(GetCaster(), WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
void Register()
{
// add dummy effect spell handler to Last Stand
EffectHandlers += EffectHandlerFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript * GetSpellScript_spell_warr_last_stand()
{
return new spell_warr_last_stand_SpellScript();
}
class spell_warr_warriors_wrath_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED))
return false;
return true;
}
void HandleDummy(SpellEffIndex effIndex)
{
if (Unit *unitTarget = GetHitUnit())
GetCaster()->CastSpell(unitTarget, WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED, true);
}
void Register()
{
// add dummy effect spell handler to Warrior's Wrath
EffectHandlers += EffectHandlerFn(spell_warr_warriors_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript * GetSpellScript_spell_warr_warriors_wrath()
{
return new spell_warr_warriors_wrath_SpellScript();
}
void AddSC_warrior_spell_scripts()
{
//Script *newscript;
Script *newscript;
/*
newscript = new Script;
newscript->Name = "spell_warr_";
newscript->GetSpellScript = &GetSpellScript_spell_warr_;
newscript->Name = "spell_warr_last_stand";
newscript->GetSpellScript = &GetSpellScript_spell_warr_last_stand;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_warr_warriors_wrath";
newscript->GetSpellScript = &GetSpellScript_spell_warr_warriors_wrath;
newscript->RegisterSelf();
*/
}