Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Unit/Unit.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Instances/InstanceScript.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/WorldSession.h src/server/scripts/Spells/spell_priest.cpp src/server/scripts/Spells/spell_rogue.cpp
This commit is contained in:
commit
66e8d8c69e
48 files changed
+10028
-1669
No files matched your search
@@ -26,17 +26,20 @@
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum RogueData
|
||||
enum RogueSpells
|
||||
{
|
||||
ROGUE_SPELL_SHIV_TRIGGERED = 5940,
|
||||
ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819,
|
||||
ROGUE_SPELL_PREY_ON_THE_WEAK = 58670,
|
||||
ROGUE_SPELL_CHEAT_DEATH_COOLDOWN = 31231,
|
||||
|
||||
ROGUE_ICON_IMPROVED_RECUPERATE = 4819
|
||||
SPELL_ROGUE_CHEAT_DEATH_COOLDOWN = 31231,
|
||||
SPELL_ROGUE_GLYPH_OF_PREPARATION = 56819,
|
||||
SPELL_ROGUE_PREY_ON_THE_WEAK = 58670,
|
||||
SPELL_ROGUE_SHIV_TRIGGERED = 5940
|
||||
};
|
||||
|
||||
// Cheat Death
|
||||
enum RogueSpellIcons
|
||||
{
|
||||
ICON_ROGUE_IMPROVED_RECUPERATE = 4819
|
||||
};
|
||||
|
||||
// 31228 - Cheat Death
|
||||
class spell_rog_cheat_death : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -48,9 +51,9 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
|
||||
uint32 absorbChance;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -70,11 +73,11 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
Player* target = GetTarget()->ToPlayer();
|
||||
if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance))
|
||||
if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance))
|
||||
return;
|
||||
|
||||
target->CastSpell(target, ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, true);
|
||||
target->AddSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60);
|
||||
target->CastSpell(target, SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, true);
|
||||
target->AddSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60);
|
||||
|
||||
uint32 health10 = target->CountPctFromMaxHealth(10);
|
||||
|
||||
@@ -99,203 +102,7 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 31130 - Nerves of Steel
|
||||
class spell_rog_nerves_of_steel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { }
|
||||
|
||||
class spell_rog_nerves_of_steel_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript);
|
||||
|
||||
uint32 absorbPct;
|
||||
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
// reduces all damage taken while stun or fear
|
||||
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
|
||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_rog_nerves_of_steel_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rog_preparation : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_preparation() : SpellScriptLoader("spell_rog_preparation") { }
|
||||
|
||||
class spell_rog_preparation_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_preparation_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
|
||||
//immediately finishes the cooldown on certain Rogue abilities
|
||||
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(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->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->RemoveSpellCooldown((itr++)->first, true);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Preparation
|
||||
OnEffectHitTarget += SpellEffectFn(spell_rog_preparation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rog_preparation_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 51685-51689 Prey on the Weak
|
||||
class spell_rog_prey_on_the_weak : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_prey_on_the_weak() : SpellScriptLoader("spell_rog_prey_on_the_weak") { }
|
||||
|
||||
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* victim = target->getVictim();
|
||||
if (victim && (target->GetHealthPct() > victim->GetHealthPct()))
|
||||
{
|
||||
if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK))
|
||||
{
|
||||
int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
|
||||
target->CastCustomSpell(target, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
target->RemoveAurasDueToSpell(ROGUE_SPELL_PREY_ON_THE_WEAK);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_prey_on_the_weak_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_rog_prey_on_the_weak_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rog_shiv : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_shiv() : SpellScriptLoader("spell_rog_shiv") { }
|
||||
|
||||
class spell_rog_shiv_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_shiv_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
caster->CastSpell(unitTarget, ROGUE_SPELL_SHIV_TRIGGERED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Shiv
|
||||
OnEffectHitTarget += SpellEffectFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rog_shiv_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 2818 - Deadly Poison
|
||||
class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -392,34 +199,163 @@ class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rog_shadowstep : public SpellScriptLoader
|
||||
// 31130 - Nerves of Steel
|
||||
class spell_rog_nerves_of_steel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { }
|
||||
spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { }
|
||||
|
||||
class spell_rog_shadowstep_SpellScript : public SpellScript
|
||||
class spell_rog_nerves_of_steel_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_shadowstep_SpellScript);
|
||||
PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
uint32 absorbPct;
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (GetCaster()->HasUnitState(UNIT_STATE_ROOT))
|
||||
return SPELL_FAILED_ROOTED;
|
||||
return SPELL_CAST_OK;
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
// reduces all damage taken while stun or fear
|
||||
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
|
||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_rog_nerves_of_steel_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 14185 - Preparation
|
||||
class spell_rog_preparation : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_preparation() : SpellScriptLoader("spell_rog_preparation") { }
|
||||
|
||||
class spell_rog_preparation_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_preparation_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_GLYPH_OF_PREPARATION))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
|
||||
// immediately finishes the cooldown on certain Rogue abilities
|
||||
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(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->RemoveSpellCooldown((itr++)->first, true);
|
||||
else if (caster->HasAura(SPELL_ROGUE_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->RemoveSpellCooldown((itr++)->first, true);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_rog_preparation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rog_shadowstep_SpellScript();
|
||||
return new spell_rog_preparation_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 51685 - Prey on the Weak
|
||||
class spell_rog_prey_on_the_weak : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_prey_on_the_weak() : SpellScriptLoader("spell_rog_prey_on_the_weak") { }
|
||||
|
||||
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_PREY_ON_THE_WEAK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* victim = target->getVictim();
|
||||
if (victim && (target->GetHealthPct() > victim->GetHealthPct()))
|
||||
{
|
||||
if (!target->HasAura(SPELL_ROGUE_PREY_ON_THE_WEAK))
|
||||
{
|
||||
int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
|
||||
target->CastCustomSpell(target, SPELL_ROGUE_PREY_ON_THE_WEAK, &bp, 0, 0, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
target->RemoveAurasDueToSpell(SPELL_ROGUE_PREY_ON_THE_WEAK);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_prey_on_the_weak_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_rog_prey_on_the_weak_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 73651 - Recuperate
|
||||
class spell_rog_recuperate : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -448,7 +384,7 @@ class spell_rog_recuperate : public SpellScriptLoader
|
||||
{
|
||||
int32 baseAmount = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster) * 1000;
|
||||
// Improved Recuperate
|
||||
if (AuraEffect const* auraEffect = caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, ROGUE_ICON_IMPROVED_RECUPERATE, EFFECT_0))
|
||||
if (AuraEffect const* auraEffect = caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, ICON_ROGUE_IMPROVED_RECUPERATE, EFFECT_0))
|
||||
baseAmount += auraEffect->GetAmount();
|
||||
|
||||
amount = CalculatePct(caster->GetMaxHealth(), float(baseAmount) / 1000.0f);
|
||||
@@ -468,14 +404,84 @@ class spell_rog_recuperate : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 36554 - Shadowstep
|
||||
class spell_rog_shadowstep : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { }
|
||||
|
||||
class spell_rog_shadowstep_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_shadowstep_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (GetCaster()->HasUnitState(UNIT_STATE_ROOT))
|
||||
return SPELL_FAILED_ROOTED;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rog_shadowstep_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 5938 - Shiv
|
||||
class spell_rog_shiv : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_shiv() : SpellScriptLoader("spell_rog_shiv") { }
|
||||
|
||||
class spell_rog_shiv_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rog_shiv_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_SHIV_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
caster->CastSpell(unitTarget, SPELL_ROGUE_SHIV_TRIGGERED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rog_shiv_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_rogue_spell_scripts()
|
||||
{
|
||||
new spell_rog_cheat_death();
|
||||
new spell_rog_deadly_poison();
|
||||
new spell_rog_nerves_of_steel();
|
||||
new spell_rog_preparation();
|
||||
new spell_rog_prey_on_the_weak();
|
||||
new spell_rog_recuperate();
|
||||
new spell_rog_shiv();
|
||||
new spell_rog_deadly_poison();
|
||||
new spell_rog_shadowstep();
|
||||
new spell_rog_shiv();
|
||||
}
|
||||
Reference in new issue
Block a user