mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Cleanup the mage spell scripts, and move SPELLFAMILY_PRIEST and SPELLFAMILY_ROGUE dummy effect handlers to spell scripts.
--HG-- branch : trunk
This commit is contained in:
@@ -1650,7 +1650,17 @@ update creature_template set scriptname="boss_flame_leviathan_safety_container"
|
||||
DELETE FROM spell_script_names WHERE spell_id=19958 AND ScriptName='spell_mage_cold_snap';
|
||||
DELETE FROM spell_script_names WHERE spell_id=32826 AND ScriptName='spell_mage_polymorph_visual';
|
||||
DELETE FROM spell_script_names WHERE spell_id=31687 AND ScriptName='spell_mage_summon_water_elemental';
|
||||
DELETE FROM spell_script_names WHERE spell_id=-47540 AND ScriptName='spell_pri_penance';
|
||||
DELETE FROM spell_script_names WHERE spell_id=31231 AND ScriptName='spell_rog_cheat_death';
|
||||
DELETE FROM spell_script_names WHERE spell_id=51662 AND ScriptName='spell_rog_hunger_for_blood';
|
||||
DELETE FROM spell_script_names WHERE spell_id=14185 AND ScriptName='spell_rog_preparation';
|
||||
DELETE FROM spell_script_names WHERE spell_id=5938 AND ScriptName='spell_rog_shiv';
|
||||
INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
|
||||
(11958,'spell_mage_cold_snap'),
|
||||
(32826,'spell_mage_polymorph_visual'),
|
||||
(31687,'spell_mage_summon_water_elemental');
|
||||
(31687,'spell_mage_summon_water_elemental'),
|
||||
(-47540, 'spell_pri_penance'),
|
||||
(31231,'spell_rog_cheat_death'),
|
||||
(51662,'spell_rog_hunger_for_blood'),
|
||||
(14185,'spell_rog_preparation'),
|
||||
(5938,'spell_rog_shiv');
|
||||
|
||||
11
sql/updates/9058_world_spell_script_names.sql
Normal file
11
sql/updates/9058_world_spell_script_names.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
DELETE FROM spell_script_names WHERE spell_id=-47540 AND ScriptName='spell_pri_penance';
|
||||
DELETE FROM spell_script_names WHERE spell_id=31231 AND ScriptName='spell_rog_cheat_death';
|
||||
DELETE FROM spell_script_names WHERE spell_id=51662 AND ScriptName='spell_rog_hunger_for_blood';
|
||||
DELETE FROM spell_script_names WHERE spell_id=14185 AND ScriptName='spell_rog_preparation';
|
||||
DELETE FROM spell_script_names WHERE spell_id=5938 AND ScriptName='spell_rog_shiv';
|
||||
INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
|
||||
(-47540,'spell_pri_penance'),
|
||||
(31231,'spell_rog_cheat_death'),
|
||||
(51662,'spell_rog_hunger_for_blood'),
|
||||
(14185,'spell_rog_preparation'),
|
||||
(5938,'spell_rog_shiv');
|
||||
@@ -1397,7 +1397,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
return;
|
||||
|
||||
if (BattleGround* bg = m_caster->ToPlayer()->GetBattleGround())
|
||||
bg->EventPlayerDroppedFlag(m_caster->ToPlayer());
|
||||
bg->EventPlayerDroppedFlag(m_caster->ToPlayer());
|
||||
|
||||
m_caster->CastSpell(m_caster, 30452, true, NULL);
|
||||
return;
|
||||
@@ -1409,7 +1409,6 @@ void Spell::EffectDummy(uint32 i)
|
||||
|
||||
unitTarget->ToCreature()->ForcedDespawn();
|
||||
return;
|
||||
|
||||
}
|
||||
case 52308: // Take Sputum Sample
|
||||
{
|
||||
@@ -1637,32 +1636,6 @@ void Spell::EffectDummy(uint32 i)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_PRIEST:
|
||||
// Penance
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_PRIEST_PENANCE)
|
||||
{
|
||||
if (!unitTarget || !unitTarget->isAlive())
|
||||
return;
|
||||
|
||||
int hurt = 0;
|
||||
int heal = 0;
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 47540: hurt = 47758; heal = 47757; break;
|
||||
case 53005: hurt = 53001; heal = 52986; break;
|
||||
case 53006: hurt = 53002; heal = 52987; break;
|
||||
case 53007: hurt = 53003; heal = 52988; break;
|
||||
default:
|
||||
sLog.outError("Spell::EffectDummy: Spell %u Penance need set correct heal/damage spell", m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
if (m_caster->IsFriendlyTo(unitTarget))
|
||||
m_caster->CastSpell(unitTarget, heal, false, 0);
|
||||
else
|
||||
m_caster->CastSpell(unitTarget, hurt, false, 0);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
// Starfall
|
||||
if (m_spellInfo->SpellFamilyFlags[2] & SPELLFAMILYFLAG2_DRUID_STARFALL)
|
||||
@@ -1683,68 +1656,6 @@ void Spell::EffectDummy(uint32 i)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Hunger for Blood
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_HUNGERFORBLOOD)
|
||||
{
|
||||
m_caster->CastSpell(m_caster, 63848, true);
|
||||
break;
|
||||
}
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 5938: // Shiv
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(unitTarget, 5940, true);
|
||||
return;
|
||||
}
|
||||
case 14185: // Preparation
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
//immediately finishes the cooldown on certain Rogue abilities
|
||||
const SpellCooldowns& cm = m_caster->ToPlayer()->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
|
||||
{
|
||||
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT // Vanish, Evasion, Sprint
|
||||
)
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
else if (m_caster->HasAura(56819)) // Glyph of Preparation
|
||||
{
|
||||
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
|
||||
(
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
|
||||
spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY
|
||||
)
|
||||
)
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 31231: // Cheat Death
|
||||
{
|
||||
m_caster->CastSpell(m_caster, 45182, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER:
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
|
||||
@@ -39,23 +39,15 @@ enum MageSpells
|
||||
|
||||
class spell_mage_cold_snap_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
return true;
|
||||
};
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *m_caster = GetCaster();
|
||||
Unit *caster = GetCaster();
|
||||
|
||||
if (!m_caster)
|
||||
return;
|
||||
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// immediately finishes the cooldown on Frost spells
|
||||
const SpellCooldowns& cm = m_caster->ToPlayer()->GetSpellCooldownMap();
|
||||
const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
@@ -64,7 +56,7 @@ class spell_mage_cold_snap_SpellScript : public SpellScript
|
||||
(GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST) &&
|
||||
spellInfo->Id != SPELL_MAGE_COLD_SNAP && GetSpellRecoveryTime(spellInfo) > 0)
|
||||
{
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
@@ -85,35 +77,19 @@ SpellScript * GetSpellScript_spell_mage_cold_snap()
|
||||
|
||||
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
|
||||
{
|
||||
static const uint32 spell_list[6];
|
||||
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
const uint32 spell_list[6] = {
|
||||
SPELL_MAGE_SQUIRREL_FORM,
|
||||
SPELL_MAGE_GIRAFFE_FORM,
|
||||
SPELL_MAGE_SERPENT_FORM,
|
||||
SPELL_MAGE_DRAGONHAWK_FORM,
|
||||
SPELL_MAGE_WORGEN_FORM,
|
||||
SPELL_MAGE_SHEEP_FORM
|
||||
};
|
||||
|
||||
// check if spell ids exist in dbc
|
||||
for (int i = 0; i < 6; i++)
|
||||
if (!sSpellStore.LookupEntry(spell_list[i]))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
const uint32 spell_list[6] = {
|
||||
SPELL_MAGE_SQUIRREL_FORM,
|
||||
SPELL_MAGE_GIRAFFE_FORM,
|
||||
SPELL_MAGE_SERPENT_FORM,
|
||||
SPELL_MAGE_DRAGONHAWK_FORM,
|
||||
SPELL_MAGE_WORGEN_FORM,
|
||||
SPELL_MAGE_SHEEP_FORM
|
||||
};
|
||||
|
||||
if (Unit *unitTarget = GetHitUnit())
|
||||
if (unitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true);
|
||||
@@ -126,6 +102,15 @@ class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
const uint32 spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] = {
|
||||
SPELL_MAGE_SQUIRREL_FORM,
|
||||
SPELL_MAGE_GIRAFFE_FORM,
|
||||
SPELL_MAGE_SERPENT_FORM,
|
||||
SPELL_MAGE_DRAGONHAWK_FORM,
|
||||
SPELL_MAGE_WORGEN_FORM,
|
||||
SPELL_MAGE_SHEEP_FORM
|
||||
};
|
||||
|
||||
SpellScript * GetSpellScript_spell_mage_polymorph_visual()
|
||||
{
|
||||
return new spell_mage_polymorph_cast_visual_SpellScript();
|
||||
@@ -142,7 +127,7 @@ class spell_mage_summon_water_elemental_SpellScript : public SpellScript
|
||||
if (!sSpellStore.LookupEntry(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
|
||||
@@ -23,14 +23,115 @@
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
|
||||
enum PriestSpells
|
||||
{
|
||||
PRIEST_SPELL_PENANCE_R1 = 47540,
|
||||
PRIEST_SPELL_PENANCE_R1_DAMAGE = 47758,
|
||||
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
|
||||
PRIEST_SPELL_PENANCE_R2 = 53005,
|
||||
PRIEST_SPELL_PENANCE_R2_DAMAGE = 53001,
|
||||
PRIEST_SPELL_PENANCE_R2_HEAL = 52986,
|
||||
PRIEST_SPELL_PENANCE_R3 = 53006,
|
||||
PRIEST_SPELL_PENANCE_R3_DAMAGE = 53002,
|
||||
PRIEST_SPELL_PENANCE_R3_HEAL = 52987,
|
||||
PRIEST_SPELL_PENANCE_R4 = 53007,
|
||||
PRIEST_SPELL_PENANCE_R4_DAMAGE = 53003,
|
||||
PRIEST_SPELL_PENANCE_R4_HEAL = 52988,
|
||||
};
|
||||
|
||||
class spell_pri_penance_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1_DAMAGE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1_HEAL))
|
||||
return false;
|
||||
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R2))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R2_DAMAGE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R2_HEAL))
|
||||
return false;
|
||||
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R3))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R3_DAMAGE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R3_HEAL))
|
||||
return false;
|
||||
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R4))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R4_DAMAGE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R4_HEAL))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *unitTarget = GetHitUnit();
|
||||
if (!unitTarget || !unitTarget->isAlive())
|
||||
return;
|
||||
|
||||
Unit *caster = GetCaster();
|
||||
SpellEntry const *spellInfo = GetSpellInfo();
|
||||
|
||||
int hurt = 0;
|
||||
int heal = 0;
|
||||
switch(spellInfo->Id)
|
||||
{
|
||||
case PRIEST_SPELL_PENANCE_R1:
|
||||
hurt = PRIEST_SPELL_PENANCE_R1_DAMAGE;
|
||||
heal = PRIEST_SPELL_PENANCE_R1_HEAL;
|
||||
break;
|
||||
case PRIEST_SPELL_PENANCE_R2:
|
||||
hurt = PRIEST_SPELL_PENANCE_R2_DAMAGE;
|
||||
heal = PRIEST_SPELL_PENANCE_R2_HEAL;
|
||||
break;
|
||||
case PRIEST_SPELL_PENANCE_R3:
|
||||
hurt = PRIEST_SPELL_PENANCE_R3_DAMAGE;
|
||||
heal = PRIEST_SPELL_PENANCE_R3_HEAL;
|
||||
break;
|
||||
case PRIEST_SPELL_PENANCE_R4:
|
||||
hurt = PRIEST_SPELL_PENANCE_R4_DAMAGE;
|
||||
heal = PRIEST_SPELL_PENANCE_R4_HEAL;
|
||||
break;
|
||||
default:
|
||||
sLog.outError("spell_pri_penance_SpellScript::HandleDummy: Spell %u Penance need set correct heal/damage spell", spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (caster->IsFriendlyTo(unitTarget))
|
||||
caster->CastSpell(unitTarget, heal, false, 0);
|
||||
else
|
||||
caster->CastSpell(unitTarget, hurt, false, 0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Penance
|
||||
EffectHandlers += EffectHandlerFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript_spell_pri_penance()
|
||||
{
|
||||
return new spell_pri_penance_SpellScript();
|
||||
}
|
||||
|
||||
void AddSC_priest_spell_scripts()
|
||||
{
|
||||
//Script *newscript;
|
||||
Script *newscript;
|
||||
|
||||
/*
|
||||
newscript = new Script;
|
||||
newscript->Name = "spell_pri_";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_pri_;
|
||||
newscript->Name = "spell_pri_penance";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_pri_penance;
|
||||
newscript->RegisterSelf();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,14 +23,176 @@
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
|
||||
enum RogueSpells
|
||||
{
|
||||
ROGUE_SPELL_HUNGER_FOR_BLOOD_BUFF = 63848,
|
||||
ROGUE_SPELL_SHIV_TRIGGERED = 5940,
|
||||
ROGUE_SPELL_CHEATING_DEATH = 45182,
|
||||
ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819,
|
||||
};
|
||||
|
||||
class spell_rog_cheat_death_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(ROGUE_SPELL_CHEATING_DEATH))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
caster->CastSpell(caster, ROGUE_SPELL_CHEATING_DEATH, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Cheat Death
|
||||
EffectHandlers += EffectHandlerFn(spell_rog_cheat_death_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript_spell_rog_cheat_death()
|
||||
{
|
||||
return new spell_rog_cheat_death_SpellScript();
|
||||
}
|
||||
|
||||
class spell_rog_hunger_for_blood_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(ROGUE_SPELL_HUNGER_FOR_BLOOD_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
caster->CastSpell(caster, ROGUE_SPELL_HUNGER_FOR_BLOOD_BUFF, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Hunger for Blood
|
||||
EffectHandlers += EffectHandlerFn(spell_rog_hunger_for_blood_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript_spell_rog_hunger_for_blood()
|
||||
{
|
||||
return new spell_rog_hunger_for_blood_SpellScript();
|
||||
}
|
||||
|
||||
class spell_rog_preparation_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(ROGUE_SPELL_GLYPH_OF_PREPARATION))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
//immediately finishes the cooldown on certain Rogue abilities
|
||||
const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
|
||||
{
|
||||
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint
|
||||
caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
else if (caster->HasAura(ROGUE_SPELL_GLYPH_OF_PREPARATION))
|
||||
{
|
||||
if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
|
||||
(spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
|
||||
spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY))
|
||||
caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Preparation
|
||||
EffectHandlers += EffectHandlerFn(spell_rog_preparation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript_spell_rog_preparation()
|
||||
{
|
||||
return new spell_rog_preparation_SpellScript();
|
||||
}
|
||||
|
||||
class spell_rog_shiv_SpellScript : public SpellScript
|
||||
{
|
||||
bool Validate(SpellEntry const * spellEntry)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(ROGUE_SPELL_SHIV_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (Unit *unitTarget = GetHitUnit())
|
||||
caster->CastSpell(unitTarget, ROGUE_SPELL_SHIV_TRIGGERED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Hunger for Blood
|
||||
EffectHandlers += EffectHandlerFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript_spell_rog_shiv()
|
||||
{
|
||||
return new spell_rog_shiv_SpellScript();
|
||||
}
|
||||
|
||||
void AddSC_rogue_spell_scripts()
|
||||
{
|
||||
//Script *newscript;
|
||||
Script *newscript;
|
||||
|
||||
/*
|
||||
newscript = new Script;
|
||||
newscript->Name = "spell_rog_";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_rog_;
|
||||
newscript->Name = "spell_rog_cheat_death";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_rog_cheat_death;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "spell_rog_hunger_for_blood";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_rog_hunger_for_blood;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "spell_rog_preparation";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_rog_preparation;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "spell_rog_shiv";
|
||||
newscript->GetSpellScript = &GetSpellScript_spell_rog_shiv;
|
||||
newscript->RegisterSelf();
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user