aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXTZGZoReX <none@none>2009-03-20 20:46:52 +0100
committerXTZGZoReX <none@none>2009-03-20 20:46:52 +0100
commiteddb72d1eaa21dfff850f7af56c3c59e0442d577 (patch)
tree0f26377096336dd6f056db9f0716961fde69490f /src
parent2bfa6254cc877043914ebd7a3a3c32e1ab66e187 (diff)
parentad06f05ddbbe1ddd9cde94abf7f47f0e7c17dc13 (diff)
* Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Spell.cpp4
-rw-r--r--src/game/SpellAuras.cpp8
-rw-r--r--src/game/SpellMgr.cpp2
-rw-r--r--src/game/Unit.cpp12
-rw-r--r--src/game/Unit.h2
6 files changed, 21 insertions, 9 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index ee168c274b5..1bacdfdd014 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -7289,7 +7289,7 @@ void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attTy
if(spellData.SpellPPMRate)
{
uint32 WeaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);
+ chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
}
else if(chance > 100.0f)
{
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 881a68e6c19..6784fc2f2a5 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2252,9 +2252,9 @@ void Spell::cast(bool skipCheck)
if(m_spellInfo->SpellFamilyName)
{
- if (m_spellInfo->excludeCasterAuraSpell)
+ if (m_spellInfo->excludeCasterAuraSpell && !IsPositiveSpell(m_spellInfo->excludeCasterAuraSpell))
m_preCastSpell = m_spellInfo->excludeCasterAuraSpell;
- else if (m_spellInfo->excludeTargetAuraSpell)
+ else if (m_spellInfo->excludeTargetAuraSpell && !IsPositiveSpell(m_spellInfo->excludeTargetAuraSpell))
m_preCastSpell = m_spellInfo->excludeTargetAuraSpell;
}
switch (m_spellInfo->SpellFamilyName)
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 97112095d62..79a87bed293 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2078,6 +2078,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
caster->CastSpell(m_target, GetModifier()->m_amount, true);
return;
}
+ // Focused Magic
+ if(m_spellProto->Id == 54646)
+ {
+ // only on remove by crit
+ if(caster && m_removeMode == AURA_REMOVE_BY_DEFAULT && GetAuraDuration()>0)
+ caster->CastSpell(caster,54648, true);
+ return;
+ }
break;
}
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 3183b1b4274..35e2cc197f4 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -534,7 +534,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
switch(spellproto->Mechanic)
{
- case MECHANIC_SHIELD:
+ case MECHANIC_IMMUNE_SHIELD:
return true;
default:
break;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e745aec5d6f..5c27d51c4aa 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5620,7 +5620,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true;
}
// Seed of Corruption (Mobs cast) - no die req
- if (dummySpell->SpellFamilyFlags == 0x00LL && dummySpell->SpellIconID == 1932)
+ if (dummySpell->SpellFamilyFlags.IsEqual(0,0,0) && dummySpell->SpellIconID == 1932)
{
Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need deal finish spell
@@ -9820,10 +9820,15 @@ float Unit::GetWeaponProcChance() const
return 0;
}
-float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const
+float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * spellProto) const
{
// proc per minute chance calculation
if (PPM <= 0) return 0.0f;
+ // Apply chance modifer aura
+ if (spellProto)
+ if(Player* modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,PPM);
+
uint32 result = uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
return result;
}
@@ -12694,13 +12699,12 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
if(!isVictim && spellProcEvent && spellProcEvent->ppmRate != 0)
{
uint32 WeaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate);
+ chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto);
}
// Apply chance modifer aura
if(Player* modOwner = GetSpellModOwner())
{
modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,chance);
}
return roll_chance_f(chance);
diff --git a/src/game/Unit.h b/src/game/Unit.h
index f153c725edf..a79202f915a 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1057,7 +1057,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
float GetWeaponProcChance() const;
- float GetPPMProcChance(uint32 WeaponSpeed, float PPM) const;
+ float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * spellProto) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;