*Mangos [7031] Implement some mage, paladin dummy trigers.

*Mangos [7029] Some work vs aura charges:
    Move to protected: need use SetAuraCharges, GetAuraCharges, DropAuraCharge
    Now m_procCharges == 0 if infinite charges, and > 0 for limit
    Remove not need UpdateAuraCharges()
By DiSlord.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-04 23:47:58 -06:00
parent b59020657b
commit fbc82ae631
8 changed files with 143 additions and 76 deletions

View File

@@ -4567,7 +4567,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 33493:
{
// Cast finish spell at last charge
if (triggeredByAura->m_procCharges > 1)
if (triggeredByAura->GetAuraCharges() > 1)
return false;
target = this;
@@ -4799,6 +4799,29 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 29077;
break;
}
// Hot Streak
if (dummySpell->SpellIconID == 2999)
{
if (triggeredByAura->GetEffIndex()!=0)
return true;
Aura *counter = GetAura(triggeredByAura->GetId(), 1);
if (!counter)
return true;
// Count spell criticals in a row in second aura
Modifier *mod = counter->GetModifier();
if (procEx & PROC_EX_CRITICAL_HIT)
{
mod->m_amount *=2;
if (mod->m_amount < 100) // not enough
return true;
// Crititcal counted -> roll chance
if (roll_chance_i(triggeredByAura->GetModifier()->m_amount))
CastSpell(this, 48108, true, castItem, triggeredByAura);
}
mod->m_amount = 25;
return true;
}
// Incanter's Regalia set (add trigger chance to Mana Shield)
if (dummySpell->SpellFamilyFlags & 0x0000000000008000LL)
{
@@ -4837,7 +4860,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 11129:
{
//last charge and crit
if (triggeredByAura->m_procCharges <= 1 && (procEx & PROC_EX_CRITICAL_HIT) )
if (triggeredByAura->GetAuraCharges() <= 1 && (procEx & PROC_EX_CRITICAL_HIT) )
{
RemoveAurasDueToSpell(28682); //-> remove Combustion auras
return true; // charge counting (will removed)
@@ -5156,11 +5179,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if(!procSpell)
return false;
// only rogue's finishing moves (maybe need additional checks)
if( procSpell->SpellFamilyName!=SPELLFAMILY_ROGUE ||
(procSpell->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE) == 0)
return false;
// energy cost save
basepoints0 = procSpell->manaCost * triggeredByAura->GetModifier()->m_amount/100;
if(basepoints0 <= 0)
@@ -5342,6 +5360,33 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
// Glyph of Divinity
case 54939:
{
// Lookup base amount mana restore
for (int i=0; i<3;i++)
if (procSpell->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
int32 mana = procSpell->EffectBasePoints[i];
CastCustomSpell(this, 54986, 0, &mana, 0, true, castItem, triggeredByAura);
break;
}
return true;
}
// Glyph of Flash of Light
case 54936:
{
triggered_spell_id = 54957;
basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100;
break;
}
// Glyph of Holy Light
case 54937:
{
triggered_spell_id = 54968;
basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100;
break;
}
}
break;
}
@@ -10039,6 +10084,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
procTriggered.push_back( ProcTriggeredData(spellProcEvent, itr->second) );
}
// Nothing found
if (procTriggered.empty())
return;
// Handle effects proceed this time
for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
{
@@ -10073,7 +10123,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
Modifier *auraModifier = triggeredByAura->GetModifier();
SpellEntry const *spellInfo = triggeredByAura->GetSpellProto();
uint32 effIndex = triggeredByAura->GetEffIndex();
bool useCharges = triggeredByAura->m_procCharges > 0;
bool useCharges = triggeredByAura->GetAuraCharges() > 0;
// For players set spell cooldown if need
uint32 cooldown = 0;
if (GetTypeId() == TYPEID_PLAYER && spellProcEvent && spellProcEvent->cooldown)
@@ -10137,11 +10187,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
continue;
break;
}
case SPELL_AURA_MOD_STUN:
// Remove by default, but if charge exist drop it
if (triggeredByAura->m_procCharges == 0)
removedSpells.push_back(triggeredByAura->GetId());
break;
case SPELL_AURA_MOD_CASTING_SPEED:
// Skip melee hits or instant cast spells
if (procSpell == NULL || GetSpellCastTime(procSpell) == 0)
@@ -10182,18 +10227,16 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
AuraMap::const_iterator upper = GetAuras().upper_bound(i->triggeredByAura_SpellPair);
for(AuraMap::const_iterator itr = lower; itr!= upper; ++itr)
{
if(itr->second == i->triggeredByAura)
// If last charge dropped add spell to remove list
if(itr->second == i->triggeredByAura && triggeredByAura->DropAuraCharge())
{
triggeredByAura->m_procCharges -=1;
triggeredByAura->UpdateAuraCharges();
if (triggeredByAura->m_procCharges <= 0)
removedSpells.push_back(triggeredByAura->GetId());
removedSpells.push_back(triggeredByAura->GetId());
break;
}
}
}
}
if (removedSpells.size())
if (!removedSpells.empty())
{
// Sort spells and remove dublicates
removedSpells.sort();
@@ -10905,10 +10948,10 @@ bool Unit::HandleMeandingAuraProc( Aura* triggeredByAura )
uint64 caster_guid = triggeredByAura->GetCasterGUID();
// jumps
int32 jumps = triggeredByAura->m_procCharges-1;
int32 jumps = triggeredByAura->GetAuraCharges()-1;
// current aura expire
triggeredByAura->m_procCharges = 1; // will removed at next charges decrease
triggeredByAura->SetAuraCharges(1); // will removed at next charges decrease
// next target selection
if(jumps > 0 && GetTypeId()==TYPEID_PLAYER && IS_PLAYER_GUID(caster_guid))