[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;
Unit* target = pVictim;
int32 basepoints0 = 0;
int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};
switch(dummySpell->SpellFamilyName)
{
@ -5059,9 +5059,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 25988:
{
// return damage % to attacker but < 50% own total health
basepoints0 = triggerAmount*int32(damage)/100;
if(basepoints0 > (int32)GetMaxHealth()/2)
basepoints0 = (int32)GetMaxHealth()/2;
basepoints[0] = triggerAmount*int32(damage)/100;
if (basepoints[0] > (int32)GetMaxHealth()/2)
basepoints[0] = (int32)GetMaxHealth()/2;
triggered_spell_id = 25997;
break;
@ -5071,7 +5071,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 35429:
{
// prevent chain of triggered spell from same triggered spell
if(procSpell && procSpell->Id == 26654)
if (procSpell && procSpell->Id == 26654)
return false;
target = SelectRandomUnfriendlyTarget(pVictim);
@ -5213,8 +5213,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Vampiric Aura (boss spell)
case 38196:
{
basepoints0 = 3 * damage; // 300%
if (basepoints0 < 0)
basepoints[0] = 3 * damage; // 300%
if (basepoints[0] < 0)
return false;
triggered_spell_id = 31285;
@ -5397,7 +5397,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 48504:
{
triggered_spell_id = 48503;
basepoints0 = triggerAmount;
basepoints[0] = triggerAmount;
target = this;
break;
}
@ -5406,7 +5406,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 60501:
{
triggered_spell_id = 52724;
basepoints0 = damage / 2;
basepoints[0] = damage / 2;
target = this;
break;
}
@ -5455,7 +5455,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// mana reward
basepoints0 = (triggerAmount * GetMaxPower(POWER_MANA) / 100);
basepoints[0] = (triggerAmount * GetMaxPower(POWER_MANA) / 100);
target = this;
triggered_spell_id = 29442;
break;
@ -5468,8 +5468,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// mana cost save
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggerAmount/100;
if( basepoints0 <=0 )
basepoints[0] = cost * triggerAmount/100;
if (basepoints[0] <=0)
return false;
target = this;
@ -5525,8 +5525,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggerAmount/100;
if( basepoints0 <=0 )
basepoints[0] = cost * triggerAmount/100;
if (basepoints[0] <=0)
return false;
triggered_spell_id = 44450;
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)
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000008000))
{
if(GetTypeId() != TYPEID_PLAYER)
if (GetTypeId() != TYPEID_PLAYER)
return false;
target = this;
@ -5553,11 +5553,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
switch (dummySpell->Id)
{
case 11119: basepoints0 = int32(0.04f*damage); break;
case 11120: basepoints0 = int32(0.08f*damage); break;
case 12846: basepoints0 = int32(0.12f*damage); break;
case 12847: basepoints0 = int32(0.16f*damage); break;
case 12848: basepoints0 = int32(0.20f*damage); break;
case 11119: basepoints[0] = int32(0.04f*damage); break;
case 11120: basepoints[0] = int32(0.08f*damage); break;
case 12846: basepoints[0] = int32(0.12f*damage); break;
case 12847: basepoints[0] = int32(0.16f*damage); break;
case 12848: basepoints[0] = int32(0.20f*damage); break;
default:
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)",dummySpell->Id);
return false;
@ -5638,7 +5638,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3214)
{
triggered_spell_id = 59653;
basepoints0 = GetShieldBlockValue() * triggerAmount / 100;
basepoints[0] = GetShieldBlockValue() * triggerAmount / 100;
break;
}
@ -5709,7 +5709,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = GetPet();
if (!target)
return false;
basepoints0 = damage * triggerAmount / 100;
basepoints[0] = damage * triggerAmount / 100;
triggered_spell_id = 54181;
break;
}
@ -5730,7 +5730,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 30296:
{
// health
basepoints0 = int32(damage*triggerAmount/100);
basepoints[0] = int32(damage*triggerAmount/100);
target = this;
triggered_spell_id = 30294;
break;
@ -5745,11 +5745,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 37381:
{
target = GetPet();
if(!target)
if (!target)
return false;
// heal amount
basepoints0 = damage * triggerAmount/100;
basepoints[0] = damage * triggerAmount/100;
triggered_spell_id = 37382;
break;
}
@ -5762,7 +5762,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Siphon Life
case 63108:
{
basepoints0 = int32(damage * triggerAmount / 100);
basepoints[0] = int32(damage * triggerAmount / 100);
triggered_spell_id = 63106;
break;
}
@ -5801,7 +5801,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Divine Aegis
case 2820:
{
basepoints0 = damage * triggerAmount/100;
basepoints[0] = damage * triggerAmount/100;
triggered_spell_id = 47753;
break;
}
@ -5816,7 +5816,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
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;
break;
}
@ -5831,7 +5831,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
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;
break;
}
@ -5871,7 +5871,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 26169:
{
// heal amount
basepoints0 = int32(damage * 10/100);
basepoints[0] = int32(damage * 10/100);
target = this;
triggered_spell_id = 26170;
break;
@ -5883,7 +5883,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// heal amount
basepoints0 = damage * triggerAmount/100;
basepoints[0] = damage * triggerAmount/100;
target = this;
triggered_spell_id = 39373;
break;
@ -5900,7 +5900,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if(!target->IsFriendlyTo(this))
return false;
basepoints0 = int32(target->GetMaxHealth() * triggerAmount / 100);
basepoints[0] = int32(target->GetMaxHealth() * triggerAmount / 100);
triggered_spell_id = 56131;
break;
}
@ -5925,7 +5925,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// health
triggered_spell_id = 34299;
basepoints0 = GetMaxHealth() * heal_percent / 100;
basepoints[0] = GetMaxHealth() * heal_percent / 100;
target = this;
// mana to caster
@ -5943,7 +5943,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 28719:
{
// mana back
basepoints0 = int32(procSpell->manaCost * 30 / 100);
basepoints[0] = int32(procSpell->manaCost * 30 / 100);
target = this;
triggered_spell_id = 28742;
break;
@ -6008,7 +6008,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// less 50% health
if (pVictim->GetMaxHealth() < 2 * pVictim->GetHealth())
return false;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 54755;
break;
}
@ -6069,7 +6069,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
else if (dummySpell->SpellIconID == 2860)
{
triggered_spell_id = 48504;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
break;
}
break;
@ -6121,8 +6121,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// energy cost save
basepoints0 = procSpell->manaCost * triggerAmount/100;
if (basepoints0 <= 0)
basepoints[0] = procSpell->manaCost * triggerAmount/100;
if (basepoints[0] <= 0)
return false;
target = this;
@ -6137,7 +6137,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellFamilyFlags & UI64LIT(0x4000000000000))
{
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;
triggered_spell_id = 34075;
@ -6146,13 +6146,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Thrill of the Hunt
if (dummySpell->SpellIconID == 2236)
{
if(!procSpell)
if (!procSpell)
return false;
// mana cost save
int32 mana = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = mana * 40/100;
if(basepoints0 <= 0)
basepoints[0] = mana * 40/100;
if (basepoints[0] <= 0)
return false;
target = this;
@ -6160,7 +6160,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
// Hunting Party
if ( dummySpell->SpellIconID == 3406 )
if (dummySpell->SpellIconID == 3406)
{
triggered_spell_id = 57669;
target = this;
@ -6213,14 +6213,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
float ap = GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
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;
}
// Righteous Vengeance
if (dummySpell->SpellIconID == 3025)
{
// 4 damage tick
basepoints0 = triggerAmount*damage/400;
basepoints[0] = triggerAmount*damage/400;
triggered_spell_id = 61840;
break;
}
@ -6228,7 +6228,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3030)
{
// 4 healing tick
basepoints0 = triggerAmount*damage/400;
basepoints[0] = triggerAmount*damage/400;
triggered_spell_id = 54203;
break;
}
@ -6237,8 +6237,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Judgement of Light
case 20185:
{
basepoints0 = int32( pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100 );
pVictim->CastCustomSpell(pVictim, 20267, &basepoints0, NULL, NULL, true, NULL, triggeredByAura);
basepoints[0] = int32( pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100 );
pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
return true;
}
// Judgement of Wisdom
@ -6247,8 +6247,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (pVictim->getPowerType() == POWER_MANA)
{
// 2% of maximum base mana
basepoints0 = int32(pVictim->GetCreateMana() * 2 / 100);
pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, NULL, triggeredByAura);
basepoints[0] = int32(pVictim->GetCreateMana() * 2 / 100);
pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
}
return true;
}
@ -6314,11 +6314,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 33776:
{
// if healed by another unit (pVictim)
if(this == pVictim)
if (this == pVictim)
return false;
// heal amount
basepoints0 = triggerAmount*damage/100;
basepoints[0] = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
@ -6419,10 +6419,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
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
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;
}
// 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
case 54936:
{
triggered_spell_id = 54957;
basepoints0 = triggerAmount*damage/100;
break;
}
// Glyph of Holy Light
{
triggered_spell_id = 54957;
basepoints[0] = triggerAmount*damage/100;
break;
}
// Glyph of Holy Light
case 54937:
{
triggered_spell_id = 54968;
basepoints0 = triggerAmount*damage/100;
break;
}
{
triggered_spell_id = 54968;
basepoints[0] = triggerAmount*damage/100;
break;
}
// Glyph of Divinity
case 54939:
{
@ -6487,7 +6487,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (!triggeredEntry)
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;
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);
// Off-Hand case
if ( castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND )
if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND)
{
// 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;
}
// Main-Hand case
else
{
// 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;
}
@ -6607,7 +6607,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Attack Twice
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;
}
@ -6648,7 +6648,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Not proc from self heals
if (this==pVictim)
return false;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
target = this;
triggered_spell_id = 55533;
break;
@ -6658,23 +6658,23 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
// Cast on owner
target = GetOwner();
if(!target)
if (!target)
return false;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 58879;
break;
}
// Shaman T8 Elemental 4P Bonus
case 64928:
{
basepoints0 = int32( triggerAmount * damage / 100 );
basepoints[0] = int32( triggerAmount * damage / 100 );
triggered_spell_id = 64930; // Electrified
break;
}
// Shaman T9 Elemental 4P Bonus
case 67228:
{
basepoints0 = int32( triggerAmount * damage / 100 );
basepoints[0] = int32( triggerAmount * damage / 100 );
triggered_spell_id = 71824;
break;
}
@ -6696,7 +6696,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3065)
{
triggered_spell_id = 52759;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
target = this;
break;
}
@ -6704,13 +6704,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000))
{
target = this;
basepoints0 = triggerAmount;
basepoints[0] = triggerAmount;
// Glyph of Earth Shield
if (Aura* aur = GetDummyAura(63279))
{
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;
@ -6863,14 +6863,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim))
return false;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 53168;
break;
}
// Butchery
if (dummySpell->SpellIconID == 2664)
{
basepoints0 = triggerAmount;
basepoints[0] = triggerAmount;
triggered_spell_id = 50163;
target = this;
break;
@ -6895,7 +6895,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Vendetta
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000010000))
{
basepoints0 = triggerAmount * GetMaxHealth() / 100;
basepoints[0] = triggerAmount * GetMaxHealth() / 100;
triggered_spell_id = 50181;
target = this;
break;
@ -6903,7 +6903,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Necrosis
if (dummySpell->SpellIconID == 2709)
{
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 51460;
break;
}
@ -7004,7 +7004,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, pVictim)))
return false;
basepoints0 = triggerAmount * damage / 100;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 50526;
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))
return false;
if(basepoints0)
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
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
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);
return true;
@ -7061,7 +7065,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
// Set trigger spell id, target, custom basepoints
uint32 trigger_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()];
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)
basepoints[0] = triggerAmount;
@ -7840,19 +7844,19 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
// 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;
// default case
if(!target || target!=this && !target->isAlive())
if (!target || target!=this && !target->isAlive())
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,
basepoints[0] ? &basepoints[0] : NULL,
basepoints[1] ? &basepoints[1] : NULL,
basepoints[2] ? &basepoints[2] : NULL,
true,castItem,triggeredByAura);
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
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);