mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Scripts/Spells: Fixed Rogue's Recuperate, Mage's Conjure Refreshment and Paladin's Sacred Shield.
Also fixed SQL file naming.
This commit is contained in:
16
sql/updates/world/2012_12_01_00_world_spell_script_names.sql
Normal file
16
sql/updates/world/2012_12_01_00_world_spell_script_names.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- Conjure Refreshment
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=42955;
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(42955, 'spell_mage_conjure_refreshment');
|
||||
|
||||
-- Sacred Shield
|
||||
DELETE FROM spell_proc_event WHERE entry=85285;
|
||||
INSERT INTO spell_proc_event (entry, Cooldown) VALUES(85285, 60);
|
||||
DELETE FROM spell_script_names WHERE spell_id=85285;
|
||||
INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
|
||||
(85285, 'spell_pal_sacred_shield');
|
||||
|
||||
-- Recuperate
|
||||
DELETE FROM spell_script_names WHERE spell_id=73651;
|
||||
INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
|
||||
(73651, "spell_rog_recuperate");
|
||||
@@ -39,6 +39,7 @@ enum MageSpells
|
||||
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908,
|
||||
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907,
|
||||
SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126,
|
||||
SPELL_MAGE_CONJURE_REFRESHMENT = 42955,
|
||||
};
|
||||
|
||||
class spell_mage_blast_wave : public SpellScriptLoader
|
||||
@@ -423,6 +424,75 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct ConjureRefreshmentData
|
||||
{
|
||||
uint32 minLevel;
|
||||
uint32 maxLevel;
|
||||
uint32 spellId;
|
||||
};
|
||||
|
||||
uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = 7;
|
||||
const ConjureRefreshmentData _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] =
|
||||
{
|
||||
{ 33, 43, 92739 },
|
||||
{ 44, 53, 92799 },
|
||||
{ 54, 63, 92802 },
|
||||
{ 64, 73, 92805 },
|
||||
{ 74, 79, 74625 },
|
||||
{ 80, 84, 92822 },
|
||||
{ 85, 85, 92727 }
|
||||
};
|
||||
|
||||
class spell_mage_conjure_refreshment : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_conjure_refreshment() : SpellScriptLoader("spell_mage_conjure_refreshment") { }
|
||||
|
||||
class spell_mage_conjure_refreshment_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mage_conjure_refreshment_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
|
||||
if (!sSpellMgr->GetSpellInfo(_conjureData[i].spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint8 level = GetHitUnit()->getLevel();
|
||||
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
|
||||
{
|
||||
ConjureRefreshmentData const& spellData = _conjureData[i];
|
||||
if (level < spellData.minLevel || level > spellData.maxLevel)
|
||||
continue;
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), spellData.spellId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mage_conjure_refreshment_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_mage_spell_scripts()
|
||||
{
|
||||
new spell_mage_blast_wave();
|
||||
|
||||
@@ -668,19 +668,53 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_sacred_shield : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_sacred_shield() : SpellScriptLoader("spell_pal_sacred_shield") { }
|
||||
|
||||
class spell_pal_sacred_shield_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_sacred_shield_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (!caster->HealthBelowPct(30))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_sacred_shield_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_sacred_shield_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_paladin_spell_scripts()
|
||||
{
|
||||
//new spell_pal_ardent_defender();
|
||||
new spell_pal_blessing_of_faith();
|
||||
new spell_pal_blessing_of_sanctuary();
|
||||
new spell_pal_divine_sacrifice();
|
||||
new spell_pal_exorcism_and_holy_wrath_damage();
|
||||
new spell_pal_guarded_by_the_light();
|
||||
new spell_pal_hand_of_sacrifice();
|
||||
new spell_pal_holy_shock();
|
||||
new spell_pal_judgement_of_command();
|
||||
new spell_pal_divine_storm();
|
||||
new spell_pal_divine_storm_dummy();
|
||||
new spell_pal_lay_on_hands();
|
||||
new spell_pal_righteous_defense();
|
||||
new spell_pal_exorcism_and_holy_wrath_damage();
|
||||
new spell_pal_hand_of_sacrifice();
|
||||
new spell_pal_divine_sacrifice();
|
||||
new spell_pal_sacred_shield();
|
||||
}
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum RogueSpells
|
||||
enum RogueData
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
// Cheat Death
|
||||
@@ -418,12 +420,61 @@ class spell_rog_shadowstep : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rog_recuperate : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_recuperate() : SpellScriptLoader("spell_rog_recuperate") { }
|
||||
|
||||
class spell_rog_recuperate_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_recuperate_AuraScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
effect->RecalculateAmount(caster);
|
||||
}
|
||||
|
||||
void CalculateBonus(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
canBeRecalculated = false;
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
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))
|
||||
baseAmount += auraEffect->GetAmount();
|
||||
|
||||
amount = CalculatePct(caster->GetMaxHealth(), float(baseAmount) / 1000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_recuperate_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_recuperate_AuraScript::CalculateBonus, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_rog_recuperate_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_rogue_spell_scripts()
|
||||
{
|
||||
new spell_rog_cheat_death();
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user