[9476] Add basepoints array to Unit::HandleDummyAuraProc

This commit is contained in:
VladimirMangos 2010-02-28 08:21:02 +03:00
parent ded1e3c263
commit f4f3ae4282
2 changed files with 100 additions and 96 deletions

View file

@ -5046,7 +5046,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
uint32 triggered_spell_id = 0; uint32 triggered_spell_id = 0;
Unit* target = pVictim; Unit* target = pVictim;
int32 basepoints0 = 0; int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};
switch(dummySpell->SpellFamilyName) switch(dummySpell->SpellFamilyName)
{ {
@ -5059,9 +5059,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 25988: case 25988:
{ {
// return damage % to attacker but < 50% own total health // return damage % to attacker but < 50% own total health
basepoints0 = triggerAmount*int32(damage)/100; basepoints[0] = triggerAmount*int32(damage)/100;
if(basepoints0 > (int32)GetMaxHealth()/2) if (basepoints[0] > (int32)GetMaxHealth()/2)
basepoints0 = (int32)GetMaxHealth()/2; basepoints[0] = (int32)GetMaxHealth()/2;
triggered_spell_id = 25997; triggered_spell_id = 25997;
break; break;
@ -5071,7 +5071,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 35429: case 35429:
{ {
// prevent chain of triggered spell from same triggered spell // prevent chain of triggered spell from same triggered spell
if(procSpell && procSpell->Id == 26654) if (procSpell && procSpell->Id == 26654)
return false; return false;
target = SelectRandomUnfriendlyTarget(pVictim); target = SelectRandomUnfriendlyTarget(pVictim);
@ -5213,8 +5213,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Vampiric Aura (boss spell) // Vampiric Aura (boss spell)
case 38196: case 38196:
{ {
basepoints0 = 3 * damage; // 300% basepoints[0] = 3 * damage; // 300%
if (basepoints0 < 0) if (basepoints[0] < 0)
return false; return false;
triggered_spell_id = 31285; triggered_spell_id = 31285;
@ -5397,7 +5397,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 48504: case 48504:
{ {
triggered_spell_id = 48503; triggered_spell_id = 48503;
basepoints0 = triggerAmount; basepoints[0] = triggerAmount;
target = this; target = this;
break; break;
} }
@ -5406,7 +5406,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 60501: case 60501:
{ {
triggered_spell_id = 52724; triggered_spell_id = 52724;
basepoints0 = damage / 2; basepoints[0] = damage / 2;
target = this; target = this;
break; break;
} }
@ -5455,7 +5455,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
// mana reward // mana reward
basepoints0 = (triggerAmount * GetMaxPower(POWER_MANA) / 100); basepoints[0] = (triggerAmount * GetMaxPower(POWER_MANA) / 100);
target = this; target = this;
triggered_spell_id = 29442; triggered_spell_id = 29442;
break; break;
@ -5468,8 +5468,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// mana cost save // mana cost save
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggerAmount/100; basepoints[0] = cost * triggerAmount/100;
if( basepoints0 <=0 ) if (basepoints[0] <=0)
return false; return false;
target = this; target = this;
@ -5525,8 +5525,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggerAmount/100; basepoints[0] = cost * triggerAmount/100;
if( basepoints0 <=0 ) if (basepoints[0] <=0)
return false; return false;
triggered_spell_id = 44450; triggered_spell_id = 44450;
target = this; target = this;
@ -5535,7 +5535,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Incanter's Regalia set (add trigger chance to Mana Shield) // Incanter's Regalia set (add trigger chance to Mana Shield)
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000008000)) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000008000))
{ {
if(GetTypeId() != TYPEID_PLAYER) if (GetTypeId() != TYPEID_PLAYER)
return false; return false;
target = this; target = this;
@ -5553,11 +5553,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{ {
switch (dummySpell->Id) switch (dummySpell->Id)
{ {
case 11119: basepoints0 = int32(0.04f*damage); break; case 11119: basepoints[0] = int32(0.04f*damage); break;
case 11120: basepoints0 = int32(0.08f*damage); break; case 11120: basepoints[0] = int32(0.08f*damage); break;
case 12846: basepoints0 = int32(0.12f*damage); break; case 12846: basepoints[0] = int32(0.12f*damage); break;
case 12847: basepoints0 = int32(0.16f*damage); break; case 12847: basepoints[0] = int32(0.16f*damage); break;
case 12848: basepoints0 = int32(0.20f*damage); break; case 12848: basepoints[0] = int32(0.20f*damage); break;
default: default:
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)",dummySpell->Id); sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)",dummySpell->Id);
return false; return false;
@ -5638,7 +5638,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3214) if (dummySpell->SpellIconID == 3214)
{ {
triggered_spell_id = 59653; triggered_spell_id = 59653;
basepoints0 = GetShieldBlockValue() * triggerAmount / 100; basepoints[0] = GetShieldBlockValue() * triggerAmount / 100;
break; break;
} }
@ -5709,7 +5709,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = GetPet(); target = GetPet();
if (!target) if (!target)
return false; return false;
basepoints0 = damage * triggerAmount / 100; basepoints[0] = damage * triggerAmount / 100;
triggered_spell_id = 54181; triggered_spell_id = 54181;
break; break;
} }
@ -5730,7 +5730,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 30296: case 30296:
{ {
// health // health
basepoints0 = int32(damage*triggerAmount/100); basepoints[0] = int32(damage*triggerAmount/100);
target = this; target = this;
triggered_spell_id = 30294; triggered_spell_id = 30294;
break; break;
@ -5745,11 +5745,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 37381: case 37381:
{ {
target = GetPet(); target = GetPet();
if(!target) if (!target)
return false; return false;
// heal amount // heal amount
basepoints0 = damage * triggerAmount/100; basepoints[0] = damage * triggerAmount/100;
triggered_spell_id = 37382; triggered_spell_id = 37382;
break; break;
} }
@ -5762,7 +5762,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Siphon Life // Siphon Life
case 63108: case 63108:
{ {
basepoints0 = int32(damage * triggerAmount / 100); basepoints[0] = int32(damage * triggerAmount / 100);
triggered_spell_id = 63106; triggered_spell_id = 63106;
break; break;
} }
@ -5801,7 +5801,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Divine Aegis // Divine Aegis
case 2820: case 2820:
{ {
basepoints0 = damage * triggerAmount/100; basepoints[0] = damage * triggerAmount/100;
triggered_spell_id = 47753; triggered_spell_id = 47753;
break; break;
} }
@ -5816,7 +5816,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
int32 healingfromticks = SpellHealingBonus(pVictim, procSpell, (healingAura->GetModifier()->m_amount* GetSpellAuraMaxTicks(procSpell)), DOT); int32 healingfromticks = SpellHealingBonus(pVictim, procSpell, (healingAura->GetModifier()->m_amount* GetSpellAuraMaxTicks(procSpell)), DOT);
basepoints0 = healingfromticks * triggerAmount / 100; basepoints[0] = healingfromticks * triggerAmount / 100;
triggered_spell_id = 63544; triggered_spell_id = 63544;
break; break;
} }
@ -5831,7 +5831,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
int32 damagefromticks = SpellDamageBonus(pVictim, procSpell, (leachAura->GetModifier()->m_amount* GetSpellAuraMaxTicks(procSpell)), DOT); int32 damagefromticks = SpellDamageBonus(pVictim, procSpell, (leachAura->GetModifier()->m_amount* GetSpellAuraMaxTicks(procSpell)), DOT);
basepoints0 = damagefromticks * triggerAmount / 100; basepoints[0] = damagefromticks * triggerAmount / 100;
triggered_spell_id = 63675; triggered_spell_id = 63675;
break; break;
} }
@ -5871,7 +5871,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 26169: case 26169:
{ {
// heal amount // heal amount
basepoints0 = int32(damage * 10/100); basepoints[0] = int32(damage * 10/100);
target = this; target = this;
triggered_spell_id = 26170; triggered_spell_id = 26170;
break; break;
@ -5883,7 +5883,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
// heal amount // heal amount
basepoints0 = damage * triggerAmount/100; basepoints[0] = damage * triggerAmount/100;
target = this; target = this;
triggered_spell_id = 39373; triggered_spell_id = 39373;
break; break;
@ -5900,7 +5900,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if(!target->IsFriendlyTo(this)) if(!target->IsFriendlyTo(this))
return false; return false;
basepoints0 = int32(target->GetMaxHealth() * triggerAmount / 100); basepoints[0] = int32(target->GetMaxHealth() * triggerAmount / 100);
triggered_spell_id = 56131; triggered_spell_id = 56131;
break; break;
} }
@ -5925,7 +5925,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// health // health
triggered_spell_id = 34299; triggered_spell_id = 34299;
basepoints0 = GetMaxHealth() * heal_percent / 100; basepoints[0] = GetMaxHealth() * heal_percent / 100;
target = this; target = this;
// mana to caster // mana to caster
@ -5943,7 +5943,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 28719: case 28719:
{ {
// mana back // mana back
basepoints0 = int32(procSpell->manaCost * 30 / 100); basepoints[0] = int32(procSpell->manaCost * 30 / 100);
target = this; target = this;
triggered_spell_id = 28742; triggered_spell_id = 28742;
break; break;
@ -6008,7 +6008,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// less 50% health // less 50% health
if (pVictim->GetMaxHealth() < 2 * pVictim->GetHealth()) if (pVictim->GetMaxHealth() < 2 * pVictim->GetHealth())
return false; return false;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 54755; triggered_spell_id = 54755;
break; break;
} }
@ -6069,7 +6069,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
else if (dummySpell->SpellIconID == 2860) else if (dummySpell->SpellIconID == 2860)
{ {
triggered_spell_id = 48504; triggered_spell_id = 48504;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
break; break;
} }
break; break;
@ -6121,8 +6121,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
// energy cost save // energy cost save
basepoints0 = procSpell->manaCost * triggerAmount/100; basepoints[0] = procSpell->manaCost * triggerAmount/100;
if (basepoints0 <= 0) if (basepoints[0] <= 0)
return false; return false;
target = this; target = this;
@ -6137,7 +6137,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellFamilyFlags & UI64LIT(0x4000000000000)) if (dummySpell->SpellFamilyFlags & UI64LIT(0x4000000000000))
{ {
uint32 maxmana = GetMaxPower(POWER_MANA); uint32 maxmana = GetMaxPower(POWER_MANA);
basepoints0 = int32(maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f); basepoints[0] = int32(maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f);
target = this; target = this;
triggered_spell_id = 34075; triggered_spell_id = 34075;
@ -6146,13 +6146,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Thrill of the Hunt // Thrill of the Hunt
if (dummySpell->SpellIconID == 2236) if (dummySpell->SpellIconID == 2236)
{ {
if(!procSpell) if (!procSpell)
return false; return false;
// mana cost save // mana cost save
int32 mana = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; int32 mana = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = mana * 40/100; basepoints[0] = mana * 40/100;
if(basepoints0 <= 0) if (basepoints[0] <= 0)
return false; return false;
target = this; target = this;
@ -6160,7 +6160,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Hunting Party // Hunting Party
if ( dummySpell->SpellIconID == 3406 ) if (dummySpell->SpellIconID == 3406)
{ {
triggered_spell_id = 57669; triggered_spell_id = 57669;
target = this; target = this;
@ -6213,14 +6213,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
float ap = GetTotalAttackPowerValue(BASE_ATTACK); float ap = GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) + int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, pVictim); SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, pVictim);
basepoints0 = GetAttackTime(BASE_ATTACK) * int32(ap*0.022f + 0.044f * holy) / 1000; basepoints[0] = GetAttackTime(BASE_ATTACK) * int32(ap*0.022f + 0.044f * holy) / 1000;
break; break;
} }
// Righteous Vengeance // Righteous Vengeance
if (dummySpell->SpellIconID == 3025) if (dummySpell->SpellIconID == 3025)
{ {
// 4 damage tick // 4 damage tick
basepoints0 = triggerAmount*damage/400; basepoints[0] = triggerAmount*damage/400;
triggered_spell_id = 61840; triggered_spell_id = 61840;
break; break;
} }
@ -6228,7 +6228,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3030) if (dummySpell->SpellIconID == 3030)
{ {
// 4 healing tick // 4 healing tick
basepoints0 = triggerAmount*damage/400; basepoints[0] = triggerAmount*damage/400;
triggered_spell_id = 54203; triggered_spell_id = 54203;
break; break;
} }
@ -6237,8 +6237,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Judgement of Light // Judgement of Light
case 20185: case 20185:
{ {
basepoints0 = int32( pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100 ); basepoints[0] = int32( pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100 );
pVictim->CastCustomSpell(pVictim, 20267, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
return true; return true;
} }
// Judgement of Wisdom // Judgement of Wisdom
@ -6247,8 +6247,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (pVictim->getPowerType() == POWER_MANA) if (pVictim->getPowerType() == POWER_MANA)
{ {
// 2% of maximum base mana // 2% of maximum base mana
basepoints0 = int32(pVictim->GetCreateMana() * 2 / 100); basepoints[0] = int32(pVictim->GetCreateMana() * 2 / 100);
pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
} }
return true; return true;
} }
@ -6314,11 +6314,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 33776: case 33776:
{ {
// if healed by another unit (pVictim) // if healed by another unit (pVictim)
if(this == pVictim) if (this == pVictim)
return false; return false;
// heal amount // heal amount
basepoints0 = triggerAmount*damage/100; basepoints[0] = triggerAmount*damage/100;
target = this; target = this;
triggered_spell_id = 31786; triggered_spell_id = 31786;
break; break;
@ -6419,10 +6419,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
triggered_spell_id = 53652; // Beacon of Light triggered_spell_id = 53652; // Beacon of Light
basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100; basepoints[0] = triggeredByAura->GetModifier()->m_amount*damage/100;
// cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check // cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check
beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID()); beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID());
return true; return true;
} }
// Seal of Corruption (damage calc on apply aura) // Seal of Corruption (damage calc on apply aura)
@ -6452,18 +6452,18 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
} }
// Glyph of Flash of Light // Glyph of Flash of Light
case 54936: case 54936:
{ {
triggered_spell_id = 54957; triggered_spell_id = 54957;
basepoints0 = triggerAmount*damage/100; basepoints[0] = triggerAmount*damage/100;
break; break;
} }
// Glyph of Holy Light // Glyph of Holy Light
case 54937: case 54937:
{ {
triggered_spell_id = 54968; triggered_spell_id = 54968;
basepoints0 = triggerAmount*damage/100; basepoints[0] = triggerAmount*damage/100;
break; break;
} }
// Glyph of Divinity // Glyph of Divinity
case 54939: case 54939:
{ {
@ -6487,7 +6487,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (!triggeredEntry) if (!triggeredEntry)
return false; return false;
basepoints0 = int32(damage / (GetSpellDuration(triggeredEntry) / triggeredEntry->EffectAmplitude[EFFECT_INDEX_0])); basepoints[0] = int32(damage / (GetSpellDuration(triggeredEntry) / triggeredEntry->EffectAmplitude[EFFECT_INDEX_0]));
target = this; target = this;
break; break;
} }
@ -6587,17 +6587,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry, EFFECT_INDEX_1, windfurySpellEntry->EffectBasePoints[EFFECT_INDEX_1], pVictim); int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry, EFFECT_INDEX_1, windfurySpellEntry->EffectBasePoints[EFFECT_INDEX_1], pVictim);
// Off-Hand case // Off-Hand case
if ( castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND ) if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND)
{ {
// Value gained from additional AP // Value gained from additional AP
basepoints0 = int32(extra_attack_power/14.0f * GetAttackTime(OFF_ATTACK)/1000/2); basepoints[0] = int32(extra_attack_power/14.0f * GetAttackTime(OFF_ATTACK)/1000/2);
triggered_spell_id = 33750; triggered_spell_id = 33750;
} }
// Main-Hand case // Main-Hand case
else else
{ {
// Value gained from additional AP // Value gained from additional AP
basepoints0 = int32(extra_attack_power/14.0f * GetAttackTime(BASE_ATTACK)/1000); basepoints[0] = int32(extra_attack_power/14.0f * GetAttackTime(BASE_ATTACK)/1000);
triggered_spell_id = 25504; triggered_spell_id = 25504;
} }
@ -6607,7 +6607,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Attack Twice // Attack Twice
for ( uint32 i = 0; i<2; ++i ) for ( uint32 i = 0; i<2; ++i )
CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); CastCustomSpell(pVictim,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura);
return true; return true;
} }
@ -6648,7 +6648,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Not proc from self heals // Not proc from self heals
if (this==pVictim) if (this==pVictim)
return false; return false;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
target = this; target = this;
triggered_spell_id = 55533; triggered_spell_id = 55533;
break; break;
@ -6658,23 +6658,23 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{ {
// Cast on owner // Cast on owner
target = GetOwner(); target = GetOwner();
if(!target) if (!target)
return false; return false;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 58879; triggered_spell_id = 58879;
break; break;
} }
// Shaman T8 Elemental 4P Bonus // Shaman T8 Elemental 4P Bonus
case 64928: case 64928:
{ {
basepoints0 = int32( triggerAmount * damage / 100 ); basepoints[0] = int32( triggerAmount * damage / 100 );
triggered_spell_id = 64930; // Electrified triggered_spell_id = 64930; // Electrified
break; break;
} }
// Shaman T9 Elemental 4P Bonus // Shaman T9 Elemental 4P Bonus
case 67228: case 67228:
{ {
basepoints0 = int32( triggerAmount * damage / 100 ); basepoints[0] = int32( triggerAmount * damage / 100 );
triggered_spell_id = 71824; triggered_spell_id = 71824;
break; break;
} }
@ -6696,7 +6696,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3065) if (dummySpell->SpellIconID == 3065)
{ {
triggered_spell_id = 52759; triggered_spell_id = 52759;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
target = this; target = this;
break; break;
} }
@ -6704,13 +6704,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000)) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000))
{ {
target = this; target = this;
basepoints0 = triggerAmount; basepoints[0] = triggerAmount;
// Glyph of Earth Shield // Glyph of Earth Shield
if (Aura* aur = GetDummyAura(63279)) if (Aura* aur = GetDummyAura(63279))
{ {
int32 aur_mod = aur->GetModifier()->m_amount; int32 aur_mod = aur->GetModifier()->m_amount;
basepoints0 = int32(basepoints0 * (aur_mod + 100.0f) / 100.0f); basepoints[0] = int32(basepoints[0] * (aur_mod + 100.0f) / 100.0f);
} }
triggered_spell_id = 379; triggered_spell_id = 379;
@ -6863,14 +6863,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{ {
if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim)) if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim))
return false; return false;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 53168; triggered_spell_id = 53168;
break; break;
} }
// Butchery // Butchery
if (dummySpell->SpellIconID == 2664) if (dummySpell->SpellIconID == 2664)
{ {
basepoints0 = triggerAmount; basepoints[0] = triggerAmount;
triggered_spell_id = 50163; triggered_spell_id = 50163;
target = this; target = this;
break; break;
@ -6895,7 +6895,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Vendetta // Vendetta
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000010000)) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000010000))
{ {
basepoints0 = triggerAmount * GetMaxHealth() / 100; basepoints[0] = triggerAmount * GetMaxHealth() / 100;
triggered_spell_id = 50181; triggered_spell_id = 50181;
target = this; target = this;
break; break;
@ -6903,7 +6903,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Necrosis // Necrosis
if (dummySpell->SpellIconID == 2709) if (dummySpell->SpellIconID == 2709)
{ {
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 51460; triggered_spell_id = 51460;
break; break;
} }
@ -7004,7 +7004,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{ {
if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, pVictim))) if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, pVictim)))
return false; return false;
basepoints0 = triggerAmount * damage / 100; basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 50526; triggered_spell_id = 50526;
break; break;
} }
@ -7039,12 +7039,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id)) if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
return false; return false;
if(basepoints0) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); CastCustomSpell(target, triggered_spell_id,
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
true, castItem, triggeredByAura);
else else
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura);
if( cooldown && GetTypeId()==TYPEID_PLAYER ) if (cooldown && GetTypeId()==TYPEID_PLAYER)
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
return true; return true;
@ -7061,7 +7065,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
// Set trigger spell id, target, custom basepoints // Set trigger spell id, target, custom basepoints
uint32 trigger_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()]; uint32 trigger_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()];
Unit* target = NULL; Unit* target = NULL;
int32 basepoints[3] = {0, 0, 0}; int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};
if(triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE) if(triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE)
basepoints[0] = triggerAmount; basepoints[0] = triggerAmount;
@ -7840,19 +7844,19 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false; return false;
// try detect target manually if not set // try detect target manually if not set
if ( target == NULL ) if (target == NULL)
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
// default case // default case
if(!target || target!=this && !target->isAlive()) if (!target || target!=this && !target->isAlive())
return false; return false;
if(basepoints[0] || basepoints[1] || basepoints[2]) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
CastCustomSpell(target,trigger_spell_id, CastCustomSpell(target,trigger_spell_id,
basepoints[0] ? &basepoints[0] : NULL, basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
basepoints[1] ? &basepoints[1] : NULL, basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
basepoints[2] ? &basepoints[2] : NULL, basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
true,castItem,triggeredByAura); true, castItem, triggeredByAura);
else else
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9475" #define REVISION_NR "9476"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__