Core/Spell: restore old proc system behaviour on auras self proc.

This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 02:21:58 +01:00
1 parent cb77d33cb9
commit c62077237d
14 files changed
+92 -80

No files matched your search

+34 -33
View File
@@ -148,7 +148,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
@@ -172,7 +172,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader
}
int32 amount = CalculatePct(spellInfo->Effects[i].CalcValue(caster), 40);
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
}
@@ -220,7 +220,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
@@ -237,7 +237,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1))
spellId = SPELL_MANIFEST_ANGER_OFF_HAND;
caster->CastSpell(target, spellId, true);
caster->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -326,7 +326,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
{
@@ -359,7 +359,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]);
caster->CastSpell(caster, spellId, true);
caster->CastSpell(caster, spellId, true, nullptr, aurEff);
if (roll_chance_i(10))
caster->Unit::Say(SAY_MADNESS);
@@ -395,10 +395,10 @@ class spell_item_dementia : public SpellScriptLoader
return true;
}
void HandlePeriodicDummy(AuraEffect const* /*aurEff*/)
void HandlePeriodicDummy(AuraEffect const* aurEff)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true);
GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true, nullptr, aurEff);
}
void Register() override
@@ -458,7 +458,7 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader
protEff->GetBase()->RefreshDuration();
}
else
GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff);
GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, nullptr, aurEff);
}
void Register() override
@@ -584,7 +584,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
{
@@ -616,12 +616,12 @@ class spell_item_deathbringers_will : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
auto const& randomSpells = triggeredSpells[caster->getClass()];
std::vector<uint32> const& randomSpells = triggeredSpells[caster->getClass()];
if (randomSpells.empty())
return;
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(randomSpells);
caster->CastSpell(caster, spellId, true);
caster->CastSpell(caster, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1051,7 +1051,7 @@ class spell_item_frozen_shadoweave : public SpellScriptLoader
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
Unit* caster = eventInfo.GetActor();
caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1096,9 +1096,9 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader
if (Unit* target = GetHitUnit())
{
if (urand(0, 99) < 15)
caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure
caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true); // failure
else
caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL);
caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true);
}
}
@@ -1137,10 +1137,10 @@ class spell_item_healing_touch_refund : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true);
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true, nullptr, aurEff);
}
void Register() override
@@ -1194,7 +1194,7 @@ class spell_item_heartpierce : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
@@ -1211,6 +1211,7 @@ class spell_item_heartpierce : public SpellScriptLoader
case POWER_RAGE:
spellId = Rage;
break;
// Death Knights can't use daggers, but oh well
case POWER_RUNIC_POWER:
spellId = RunicPower;
break;
@@ -1218,7 +1219,7 @@ class spell_item_heartpierce : public SpellScriptLoader
return;
}
caster->CastSpell((Unit*)nullptr, spellId, true);
caster->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1348,14 +1349,14 @@ class spell_item_mark_of_conquest : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
if (eventInfo.GetTypeMask() & (PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS))
{
// in that case, do not cast heal spell
PreventDefaultAction();
// but mana instead
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true);
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true, nullptr, aurEff);
}
}
@@ -1514,7 +1515,7 @@ class spell_item_net_o_matic : public SpellScriptLoader
else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
spellId = SPELL_NET_O_MATIC_TRIGGERED2;
GetCaster()->CastSpell(target, spellId, true, NULL);
GetCaster()->CastSpell(target, spellId, true, nullptr);
}
}
@@ -1570,7 +1571,7 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader
case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
}
caster->CastSpell(caster, spellId, true, NULL);
caster->CastSpell(caster, spellId, true, nullptr);
}
void Register() override
@@ -1702,7 +1703,7 @@ class spell_item_pet_healing : public SpellScriptLoader
int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
Unit* caster = eventInfo.GetActor();
caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true);
caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2174,7 +2175,7 @@ class spell_item_swift_hand_justice_dummy : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount());
caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2212,10 +2213,10 @@ class spell_item_totem_of_flowing_water : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true);
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true, nullptr, aurEff);
}
void Register() override
@@ -3664,17 +3665,17 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS)
caster->CastSpell(target, HealProc, true);
caster->CastSpell(target, HealProc, true, nullptr, aurEff);
if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG)
caster->CastSpell(target, DamageProc, true);
caster->CastSpell(target, DamageProc, true, nullptr, aurEff);
}
void Register() override
@@ -3810,7 +3811,7 @@ class spell_item_sunwell_neck : public SpellScriptLoader
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Player* player = eventInfo.GetActor()->ToPlayer();
@@ -3818,10 +3819,10 @@ class spell_item_sunwell_neck : public SpellScriptLoader
// Aggression checks are in the spell system... just cast and forget
if (player->GetReputationRank(FACTION_ALDOR) == REP_EXALTED)
player->CastSpell(target, Aldors, true);
player->CastSpell(target, Aldors, true, nullptr, aurEff);
if (player->GetReputationRank(FACTION_SCRYERS) == REP_EXALTED)
player->CastSpell(target, Scryers, true);
player->CastSpell(target, Scryers, true, nullptr, aurEff);
}
void Register() override