diff options
| -rw-r--r-- | sql/FULL/world_spell_full.sql | 3 | ||||
| -rw-r--r-- | sql/updates/6142_world_spells.sql | 7 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp | 4 | ||||
| -rw-r--r-- | src/game/Pet.cpp | 4 | ||||
| -rw-r--r-- | src/game/Player.cpp | 4 | ||||
| -rw-r--r-- | src/game/SpellEffects.cpp | 91 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 50 |
7 files changed, 141 insertions, 22 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 82d4da9394b..dc95e228bdc 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -666,6 +666,9 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 15286, 0x20, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Embrace ( 15337, 0x00, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Spirit Tap (Rank 1) ( 15338, 0x00, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Spirit Tap (Rank 2) +( 15318, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0), -- Shadow Affinity (Rank 1) +( 15272, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0), -- Shadow Affinity (Rank 2) +( 15320, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0), -- Shadow Affinity (Rank 3) ( 15346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6, 0, 0), -- Seal of Reckoning ( 15362, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 2) ( 15363, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 3) diff --git a/sql/updates/6142_world_spells.sql b/sql/updates/6142_world_spells.sql new file mode 100644 index 00000000000..80b522953c2 --- /dev/null +++ b/sql/updates/6142_world_spells.sql @@ -0,0 +1,7 @@ + +DELETE FROM `spell_proc_event` WHERE `entry` IN +(15318,15272,15320); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +( 15318, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0), -- Shadow Affinity (Rank 1) +( 15272, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0), -- Shadow Affinity (Rank 2) +( 15320, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00002000, 0, 0, 0); -- Shadow Affinity (Rank 3) diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp index 0d240d2a49a..00733c68032 100644 --- a/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp @@ -255,8 +255,8 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI case EVENT_BLIZZARD: { //DoCastAOE(SPELL_SUMMON_BLIZZARD); - if(Creature *summon = DoSummon(MOB_BLIZZARD, me, 25000+rand()%5000, TEMPSUMMON_TIMED_DESPAWN)) - summon->GetMotionMaster()->MoveRandom(40); + if (Creature *pSummon = DoSummon(MOB_BLIZZARD, me, 0.0f, urand(25000,30000), TEMPSUMMON_TIMED_DESPAWN)) + pSummon->GetMotionMaster()->MoveRandom(40); events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); break; } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 6275bd8a75b..b5995120a9e 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1189,10 +1189,10 @@ void Pet::_LoadAuras(uint32 timediff) // negative effects should continue counting down after logout if (remaintime != -1 && !IsPositiveSpell(spellid)) { - if(remaintime <= int32(timediff)) + if (remaintime/IN_MILISECONDS <= int32(timediff)) continue; - remaintime -= timediff; + remaintime -= timediff*IN_MILISECONDS; } // prevent wrong values of remaincharges diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4199e23c2e4..5733abb630d 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -15431,10 +15431,10 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff) // negative effects should continue counting down after logout if (remaintime != -1 && !IsPositiveSpell(spellid)) { - if(remaintime <= int32(timediff)) + if (remaintime/IN_MILISECONDS <= int32(timediff)) continue; - remaintime -= timediff; + remaintime -= timediff*IN_MILISECONDS; } // prevent wrong values of remaincharges 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; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 21de3d3780b..bb1ceed76b6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2319,6 +2319,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // Reduce dodge chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) dodge_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100); + else + dodge_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25; // Modify dodge chance by attacker SPELL_AURA_MOD_COMBAT_RESULT_CHANCE dodge_chance+= GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE)*100; @@ -2345,7 +2347,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack { // Reduce parry chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) - parry_chance-= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100); + parry_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100); + else + parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25; if(pVictim->GetTypeId() == TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY) ) { @@ -2738,7 +2742,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) dodgeChance = int32 (float (dodgeChance) * GetTotalAuraMultiplier(SPELL_AURA_MOD_ENEMY_DODGE)); // Reduce dodge chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) - dodgeChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f); + dodgeChance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f); + else + dodgeChance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25; if (dodgeChance < 0) dodgeChance = 0; @@ -2753,7 +2759,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) int32 parryChance = int32(pVictim->GetUnitParryChance()*100.0f) - skillDiff * 4; // Reduce parry chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) - parryChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f); + parryChance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f); + else + parryChance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25; if (parryChance < 0) parryChance = 0; @@ -4859,7 +4867,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger { switch (dummySpell->Id) { - // BloodWorms Health Leech + // Bloodworms Health Leech case 50453: { if (Unit *owner = this->GetOwner()) @@ -4922,6 +4930,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 26654; break; } + // Glyph of Blocking + case 58375: + { + triggered_spell_id = 58374; + break; + } // Unstable Power case 24658: { @@ -5541,16 +5555,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 54181; break; } - switch(dummySpell->Id) + switch (dummySpell->Id) { // Siphon Life case 63108: { + // Glyph of Siphon Life + if (HasAura(56216)) + triggerAmount += triggerAmount * 25 / 100; triggered_spell_id = 63106; target = this; basepoints0 = int32(damage*triggerAmount/100); break; } + // Glyph of Life Tap + case 63320: + { + triggered_spell_id = 63321; + break; + } // Nightfall case 18094: case 18095: @@ -5687,6 +5710,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger pVictim->CastCustomSpell(pVictim,15290,&team,&self,NULL,true,castItem,triggeredByAura); return true; // no hidden cooldown } + // Shadow Affinity (Ranks 1-3) + case 15318: + case 15272: + case 15320: + { + basepoints0 = triggerAmount * target->GetCreateMana() / 100; + triggered_spell_id = 64103; + break; + } // Priest Tier 6 Trinket (Ashtongue Talisman of Acumen) case 40438: { @@ -9257,7 +9289,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (spellProto->SpellIconID == 186) { if (pVictim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) - DoneTotalMod *= 3.0f; + { + // Glyph of Ice Lance + if (owner->HasAura(56377) && pVictim->getLevel() > owner->getLevel()) + DoneTotalMod *= 4.0f; + else + DoneTotalMod *= 3.0f; + } } // Torment the weak |
