aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp91
1 files changed, 81 insertions, 10 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 50a59e1ea12..4d947f41bde 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -556,13 +556,29 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if (AuraEffect const * aurEff = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID()))
{
// count consumed deadly poison doses at target
- //Aura *poison = 0;
+ bool needConsume = true;
uint32 spellId = aurEff->GetId();
uint32 doses = aurEff->GetParentAura()->GetStackAmount();
if (doses > combo)
doses = combo;
- for (uint32 i = 0; i < doses; ++i)
- unitTarget->RemoveAuraFromStack(spellId);
+ // Master Poisoner
+ Unit::AuraEffectList const& auraList = ((Player*)m_caster)->GetAurasByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
+ for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
+ {
+ if ((*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->SpellIconID == 1960)
+ {
+ uint32 chance = (*iter)->GetSpellProto()->CalculateSimpleValue(2);
+
+ if (chance && roll_chance_i(chance))
+ needConsume = false;
+
+ break;
+ }
+ }
+
+ if (needConsume)
+ for (uint32 i = 0; i < doses; ++i)
+ unitTarget->RemoveAuraFromStack(spellId);
damage *= doses;
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
}
@@ -1188,9 +1204,62 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 43068, true);
return;
}
+ case 49357: // Brewfest Mount Transformation
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+ if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED))
+ return;
+ m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ // Ram for Alliance, Kodo for Horde
+ if (((Player*)m_caster)->GetTeam() == ALLIANCE)
+ {
+ if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ // 100% Ram
+ m_caster->CastSpell(m_caster, 43900, true);
+ else
+ // 60% Ram
+ m_caster->CastSpell(m_caster, 43899, true);
+ }
+ else
+ {
+ if (((Player*)m_caster)->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ // 100% Kodo
+ m_caster->CastSpell(m_caster, 49379, true);
+ else
+ // 60% Kodo
+ m_caster->CastSpell(m_caster, 49378, true);
+ }
+ return;
+ case 52845: // Brewfest Mount Transformation (Faction Swap)
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+ if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED))
+ return;
+ m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ // Ram for Horde, Kodo for Alliance
+ if (((Player*)m_caster)->GetTeam() == HORDE)
+ {
+ if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ // 100% Ram
+ m_caster->CastSpell(m_caster, 43900, true);
+ else
+ // 60% Ram
+ m_caster->CastSpell(m_caster, 43899, true);
+ }
+ else
+ {
+ if (((Player*)m_caster)->GetSpeedRate(MOVE_RUN) >= 2.0f)
+ // 100% Kodo
+ m_caster->CastSpell(m_caster, 49379, true);
+ else
+ // 60% Kodo
+ m_caster->CastSpell(m_caster, 49378, true);
+ }
+ return;
case 55004: // Nitro Boosts
- if(!m_CastItem) return;
- if(roll_chance_i(95)) // Nitro Boosts - success
+ if (!m_CastItem)
+ return;
+ if (roll_chance_i(95)) // Nitro Boosts - success
m_caster->CastSpell(m_caster, 54861, true, m_CastItem);
else // Knocked Up - backfire 5%
m_caster->CastSpell(m_caster, 46014, true, m_CastItem);
@@ -1201,9 +1270,9 @@ void Spell::EffectDummy(uint32 i)
return;
// spell has a 1/3 chance to trigger one of the below
- if(roll_chance_i(66))
+ if (roll_chance_i(66))
return;
- if(((Player*)m_caster)->GetTeam() == ALLIANCE)
+ if (((Player*)m_caster)->GetTeam() == ALLIANCE)
{
// 1000001 - gnomish binary
m_caster->CastSpell(m_caster, 50242, true);
@@ -1881,19 +1950,21 @@ void Spell::EffectDummy(uint32 i)
{
int32 bp1 = 1;
// Cleansing Totem Effect
- m_caster->CastCustomSpell(unitTarget, 52025, NULL, &bp1, NULL, true, NULL, NULL, m_originalCasterGUID);
+ if (unitTarget)
+ m_caster->CastCustomSpell(unitTarget, 52025, NULL, &bp1, NULL, true, NULL, NULL, m_originalCasterGUID);
return;
}
// Healing Stream Totem
if(m_spellInfo->SpellFamilyFlags[0] & 0x2000)
{
- m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
+ if (unitTarget)
+ m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
return;
}
// Mana Spring Totem
if (m_spellInfo->SpellFamilyFlags[0] & 0x4000)
{
- if (unitTarget->getPowerType()!=POWER_MANA)
+ if (!unitTarget || unitTarget->getPowerType() != POWER_MANA)
return;
m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
return;