Skip to content

Commit

Permalink
Merge pull request #10336 from joschiwald/spellscripts5
Browse files Browse the repository at this point in the history
Scripts/Spells: backport some SpellScripts from 4.3.4 branch
  • Loading branch information
joschiwald committed Jul 24, 2013
2 parents e11714e + 99c67c1 commit a522be8
Show file tree
Hide file tree
Showing 9 changed files with 415 additions and 93 deletions.
11 changes: 11 additions & 0 deletions sql/updates/world/2013_07_24_00_world_spell_script_names.sql
@@ -0,0 +1,11 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (63310,50421,23780,33896,37594,37705,23551,23552,23572);
INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
(63310,'spell_warl_glyph_of_shadowflame'),
(50421,'spell_dk_scent_of_blood'),
(23780,'spell_item_aegis_of_preservation'),
(33896,'spell_item_desperate_defense'),
(37594,'spell_pri_item_greater_heal_refund'),
(37705,'spell_pal_item_healing_discount'),
(23551,'spell_sha_item_lightning_shield'),
(23552,'spell_sha_item_lightning_shield_trigger'),
(23572,'spell_sha_item_mana_surge');
55 changes: 1 addition & 54 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -5733,12 +5733,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
switch (dummySpell->Id)
{
// Glyph of Shadowflame
case 63310:
{
triggered_spell_id = 63311;
break;
}
// Nightfall
case 18094:
case 18095:
Expand Down Expand Up @@ -7712,12 +7706,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case SPELLFAMILY_GENERIC:
switch (auraSpellInfo->Id)
{
case 23780: // Aegis of Preservation (Aegis of Preservation trinket)
trigger_spell_id = 23781;
break;
case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher)
trigger_spell_id = 33898;
break;
case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
// Pct value stored in dummy
basepoints0 = victim->GetCreateHealth() * auraSpellInfo->Effects[1].CalcValue() / 100;
Expand Down Expand Up @@ -7800,14 +7788,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
}
}
break;
case SPELLFAMILY_WARRIOR:
if (auraSpellInfo->Id == 50421) // Scent of Blood
{
CastSpell(this, 50422, true);
RemoveAuraFromStack(auraSpellInfo->Id);
return false;
}
break;
case SPELLFAMILY_WARLOCK:
{
// Drain Soul
Expand Down Expand Up @@ -7853,11 +7833,8 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
}
case SPELLFAMILY_PRIEST:
{
// Greater Heal Refund
if (auraSpellInfo->Id == 37594)
trigger_spell_id = 37595;
// Blessed Recovery
else if (auraSpellInfo->SpellIconID == 1875)
if (auraSpellInfo->SpellIconID == 1875)
{
switch (auraSpellInfo->Id)
{
Expand Down Expand Up @@ -7949,13 +7926,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{
switch (auraSpellInfo->Id)
{
// Healing Discount
case 37705:
{
trigger_spell_id = 37706;
target = this;
break;
}
// Soul Preserver
case 60510:
{
Expand Down Expand Up @@ -8062,29 +8032,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{
switch (auraSpellInfo->Id)
{
// Lightning Shield (The Ten Storms set)
case 23551:
{
trigger_spell_id = 23552;
target = victim;
break;
}
// Damage from Lightning Shield (The Ten Storms set)
case 23552:
{
trigger_spell_id = 27635;
break;
}
// Mana Surge (The Earthfury set)
case 23572:
{
if (!procSpell)
return false;
basepoints0 = int32(CalculatePct(procSpell->ManaCost, 35));
trigger_spell_id = 23571;
target = this;
break;
}
case 30881: // Nature's Guardian Rank 1
case 30883: // Nature's Guardian Rank 2
case 30884: // Nature's Guardian Rank 3
Expand Down
52 changes: 45 additions & 7 deletions src/server/scripts/Spells/spell_dk.cpp
Expand Up @@ -32,28 +32,29 @@ enum DeathKnightSpells
SPELL_DK_BLACK_ICE_R1 = 49140,
SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658,
SPELL_DK_BLOOD_GORGED_HEAL = 50454,
SPELL_DK_BLOOD_PRESENCE = 48266,
SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999,
SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270,
SPELL_DK_DEATH_COIL_DAMAGE = 47632,
SPELL_DK_DEATH_COIL_HEAL = 47633,
SPELL_DK_DEATH_STRIKE_HEAL = 45470,
SPELL_DK_GHOUL_EXPLODE = 47496,
SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625,
SPELL_DK_RUNIC_POWER_ENERGIZE = 49088,
SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890,
SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
SPELL_DK_BLOOD_PRESENCE = 48266,
SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611,
SPELL_DK_UNHOLY_PRESENCE = 48265,
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622,
SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962,
SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736,
SPELL_DK_RUNIC_POWER_ENERGIZE = 49088,
SPELL_DK_SCENT_OF_BLOOD = 50422,
SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890,
SPELL_DK_UNHOLY_PRESENCE = 48265,
SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284
};

enum DeathKnightSpellIcons
{
DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751,
DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751
};

// 50462 - Anti-Magic Shell (on raid member)
Expand Down Expand Up @@ -807,6 +808,42 @@ class spell_dk_rune_tap_party : public SpellScriptLoader
}
};

// 50421 - Scent of Blood
class spell_dk_scent_of_blood : public SpellScriptLoader
{
public:
spell_dk_scent_of_blood() : SpellScriptLoader("spell_dk_scent_of_blood") { }

class spell_dk_scent_of_blood_AuraScript : public AuraScript
{
PrepareAuraScript(spell_dk_scent_of_blood_AuraScript);

bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD))
return false;
return true;
}

void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff);
GetTarget()->RemoveAuraFromStack(GetSpellInfo()->Id);
}

void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_dk_scent_of_blood_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};

AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_dk_scent_of_blood_AuraScript();
}
};

// 55090 - Scourge Strike (55265, 55270, 55271)
class spell_dk_scourge_strike : public SpellScriptLoader
{
Expand Down Expand Up @@ -1027,6 +1064,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_improved_blood_presence();
new spell_dk_improved_unholy_presence();
new spell_dk_rune_tap_party();
new spell_dk_scent_of_blood();
new spell_dk_scourge_strike();
new spell_dk_spell_deflection();
new spell_dk_vampiric_blood();
Expand Down
90 changes: 89 additions & 1 deletion src/server/scripts/Spells/spell_item.cpp
Expand Up @@ -73,6 +73,46 @@ class spell_item_trigger_spell : public SpellScriptLoader
}
};

enum AegisOfPreservation
{
SPELL_AEGIS_HEAL = 23781
};

// 23780 - Aegis of Preservation
class spell_item_aegis_of_preservation : public SpellScriptLoader
{
public:
spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { }

class spell_item_aegis_of_preservation_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript);

bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL))
return false;
return true;
}

void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff);
}

void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};

AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_item_aegis_of_preservation_AuraScript();
}
};

// 26400 - Arcane Shroud
class spell_item_arcane_shroud : public SpellScriptLoader
{
Expand Down Expand Up @@ -217,6 +257,46 @@ class spell_item_defibrillate : public SpellScriptLoader
uint32 _failSpell;
};

enum DesperateDefense
{
SPELL_DESPERATE_RAGE = 33898
};

// 33896 - Desperate Defense
class spell_item_desperate_defense : public SpellScriptLoader
{
public:
spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { }

class spell_item_desperate_defense_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_desperate_defense_AuraScript);

bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE))
return false;
return true;
}

void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff);
}

void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};

AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_item_desperate_defense_AuraScript();
}
};

// http://www.wowhead.com/item=6522 Deviate Fish
// 8063 Deviate Fish
enum DeviateFishSpells
Expand Down Expand Up @@ -523,15 +603,21 @@ class spell_item_necrotic_touch : public SpellScriptLoader
return true;
}

bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive();
}

void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount());
GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff);
}

void Register() OVERRIDE
{
DoCheckProc += AuraCheckProcFn(spell_item_necrotic_touch_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_item_necrotic_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
Expand Down Expand Up @@ -2477,11 +2563,13 @@ void AddSC_item_spell_scripts()
// 23075 Mithril Mechanical Dragonling
new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING);

new spell_item_aegis_of_preservation();
new spell_item_arcane_shroud();
new spell_item_blessing_of_ancient_kings();
new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);
new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL);
new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
new spell_item_desperate_defense();
new spell_item_deviate_fish();
new spell_item_flask_of_the_north();
new spell_item_gnomish_death_ray();
Expand Down
38 changes: 38 additions & 0 deletions src/server/scripts/Spells/spell_paladin.cpp
Expand Up @@ -55,6 +55,8 @@ enum PaladinSpells
SPELL_PALADIN_HAND_OF_SACRIFICE = 6940,
SPELL_PALADIN_DIVINE_SACRIFICE = 64205,

SPELL_PALADIN_ITEM_HEALING_TRANCE = 37706,

SPELL_PALADIN_GLYPH_OF_SALVATION = 63225,

SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790,
Expand Down Expand Up @@ -587,6 +589,41 @@ class spell_pal_hand_of_salvation : public SpellScriptLoader
}
};

// 37705 - Healing Discount
class spell_pal_item_healing_discount : public SpellScriptLoader
{
public:
spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { }

class spell_pal_item_healing_discount_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_item_healing_discount_AuraScript);

bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
return false;
return true;
}

void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
}

void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};

AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_item_healing_discount_AuraScript();
}
};

// -20473 - Holy Shock
class spell_pal_holy_shock : public SpellScriptLoader
{
Expand Down Expand Up @@ -911,6 +948,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_guarded_by_the_light();
new spell_pal_hand_of_sacrifice();
new spell_pal_hand_of_salvation();
new spell_pal_item_healing_discount();
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
new spell_pal_lay_on_hands();
Expand Down

1 comment on commit a522be8

@2010phenix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad to see that you accept invitation to TC team and community ;)
congrat to you man.

Please sign in to comment.