diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-05-01 00:05:08 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-05-01 00:05:08 +0200 |
commit | 0fbcddcb4f8fda8498faa76c7e7d92d9c7c1c3f8 (patch) | |
tree | a98e9411d09386d7c55de5ba19d4bc711ddf6145 /src | |
parent | 35ab476f1691870a67c8ede78e9c37618f6bd383 (diff) |
Core/Spells: Removed proc handlers of deleted spells
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Totem/Totem.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 356 |
2 files changed, 13 insertions, 346 deletions
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 5b59f464e52..e3a5f9065e0 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -90,9 +90,6 @@ void Totem::InitSummon() // Some totems can have both instant effect and passive spell if (GetSpell(1)) CastSpell(this, GetSpell(1), true); - - if (m_Properties->ID == SUMMON_TYPE_TOTEM_FIRE && GetOwner()->HasAura(SPELL_TOTEMIC_WRATH_TALENT)) - CastSpell(this, SPELL_TOTEMIC_WRATH, true); } void Totem::UnSummon(uint32 msTime) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e25d8ebe8e1..f579917a7ed 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5199,18 +5199,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } return false; } - // Kill command - case 58914: - { - // Remove aura stack from pet - RemoveAuraFromStack(58914); - Unit* owner = GetOwner(); - if (!owner) - return true; - // reduce the owner's aura stack - owner->RemoveAuraFromStack(34027); - return true; - } // Vampiric Touch (generic, used by some boss) case 52723: case 60501: @@ -5220,28 +5208,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Shadowfiend Death (Gain mana if pet dies with Glyph of Shadowfiend) - case 57989: - { - Unit* owner = GetOwner(); - if (!owner || owner->GetTypeId() != TYPEID_PLAYER) - return false; - // Glyph of Shadowfiend (need cast as self cast for owner, no hidden cooldown) - owner->CastSpell(owner, 58227, true, castItem, triggeredByAura); - return true; - } - // Divine purpose - case 31871: - case 31872: - { - // Roll chane - if (!victim || !victim->IsAlive() || !roll_chance_i(triggerAmount)) - return false; - - // Remove any stun effect on target - victim->RemoveAurasWithMechanic(1<<MECHANIC_STUN, AURA_REMOVE_BY_ENEMY_SPELL); - return true; - } // Purified Shard of the Scale - Onyxia 10 Caster Trinket case 69755: { @@ -5376,38 +5342,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } case SPELLFAMILY_MAGE: { - // Hot Streak & Improved Hot Streak - if (dummySpell->SpellIconID == 2999) - { - if (effIndex != 0) - return false; - AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(EFFECT_1); - if (!counter) - return true; - - // Count spell criticals in a row in second aura - if (procEx & PROC_EX_CRITICAL_HIT) - { - counter->SetAmount(counter->GetAmount() * 2); - if (counter->GetAmount() < 100 && dummySpell->Id != 44445) // not enough or Hot Streak spell - return true; - // Crititcal counted -> roll chance - if (roll_chance_i(triggerAmount)) - CastSpell(this, 48108, true, castItem, triggeredByAura); - } - counter->SetAmount(25); - return true; - } - // Incanter's Regalia set (add trigger chance to Mana Shield) - if (dummySpell->SpellFamilyFlags[0] & 0x8000) - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - target = this; - triggered_spell_id = 37436; - break; - } + break; } case SPELLFAMILY_WARLOCK: { @@ -5543,48 +5478,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->Id) { - // Glyph of Bloodletting - case 54815: - { - if (!target) - return false; - - // try to find spell Rip on the target - if (AuraEffect const* AurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x00800000, 0x0, 0x0), GetGUID())) - { - // Rip's max duration, note: spells which modifies Rip's duration also counted - uint32 CountMin = AurEff->GetBase()->GetMaxDuration(); - - // just Rip's max duration without other spells - uint32 CountMax = AurEff->GetSpellInfo()->GetMaxDuration(); - - // add possible auras' and Glyph of Shred's max duration - CountMax += 3 * triggerAmount * IN_MILLISECONDS; // Glyph of Bloodletting -> +6 seconds - CountMax += HasAura(60141) ? 4 * IN_MILLISECONDS : 0; // Rip Duration/Lacerate Damage -> +4 seconds - - // if min < max -> that means caster didn't cast 3 shred yet - // so set Rip's duration and max duration - if (CountMin < CountMax) - { - AurEff->GetBase()->SetDuration(AurEff->GetBase()->GetDuration() + triggerAmount * IN_MILLISECONDS); - AurEff->GetBase()->SetMaxDuration(CountMin + triggerAmount * IN_MILLISECONDS); - return true; - } - } - // if not found Rip - return false; - } // Leader of the Pack case 24932: { if (triggerAmount <= 0) return false; - basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); target = this; - triggered_spell_id = 34299; - // Regenerate 4% mana - int32 mana = CalculatePct(GetCreateMana(), triggerAmount); - CastCustomSpell(this, 68285, &mana, NULL, NULL, true, castItem, triggeredByAura); + triggered_spell_id = 68285; break; } // Healing Touch (Dreamwalker Raiment set) @@ -5692,32 +5592,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } case SPELLFAMILY_PALADIN: { - // Judgements of the Wise - if (dummySpell->SpellIconID == 3017) - { - target = this; - triggered_spell_id = 31930; - break; - } switch (dummySpell->Id) { - // Sacred Shield - case 53601: - { - if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS) - return false; - - if (damage > 0) - triggered_spell_id = 58597; - - // Item - Paladin T8 Holy 4P Bonus - if (Unit* caster = triggeredByAura->GetCaster()) - if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0)) - cooldown = aurEff->GetAmount(); - - target = this; - break; - } // Holy Power (Redemption Armor set) case 28789: { @@ -5918,76 +5794,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - // Lesser Healing Wave (Totem of Flowing Water Relic) - case 28849: - { - target = this; - triggered_spell_id = 28850; - break; - } - // Windfury Weapon (Passive) 1-8 Ranks - case 33757: - { - Player* player = ToPlayer(); - if (!player || !castItem || !castItem->IsEquipped() || !victim || !victim->IsAlive()) - return false; - - // custom cooldown processing case - if (cooldown && GetSpellHistory()->HasCooldown(dummySpell->Id)) - return false; - - if (triggeredByAura->GetBase() && castItem->GetGUID() != triggeredByAura->GetBase()->GetCastItemGUID()) - return false; - - WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot(), castItem->GetTemplate()->GetInventoryType())); - if ((attType != BASE_ATTACK && attType != OFF_ATTACK) - || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) - || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)) - return false; - - // Now compute real proc chance... - uint32 chance = 20; - player->ApplySpellMod(dummySpell->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); - - Item* addWeapon = player->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true); - uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0; - SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id_add); - if (pEnchant && pEnchant->EffectSpellID[0] == dummySpell->Id) - chance += 14; - - if (!roll_chance_i(chance)) - return false; - - // Now amount of extra power stored in 1 effect of Enchant spell - uint32 spellId = 8232; - SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!windfurySpellInfo) - { - TC_LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId); - return false; - } - - int32 extra_attack_power = CalculateSpellDamage(victim, windfurySpellInfo, 1); - - // Value gained from additional AP - basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(attType) / 1000); - - if (procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) - triggered_spell_id = 25504; - - if (procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) - triggered_spell_id = 33750; - - // apply cooldown before cast to prevent processing itself - if (cooldown) - player->GetSpellHistory()->AddCooldown(dummySpell->Id, 0, std::chrono::seconds(cooldown)); - - // Attack Twice - for (uint32 i = 0; i < 2; ++i) - CastCustomSpell(victim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - - return true; - } // Shaman Tier 6 Trinket case 40463: { @@ -6032,6 +5838,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); break; } + // Frozen Power + case 63374: + { + triggered_spell_id = 63685; + break; + } // Shaman T8 Elemental 4P Bonus case 64928: { @@ -6097,34 +5909,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - // Frozen Power - if (dummySpell->SpellIconID == 3780) - { - if (!target) - return false; - if (GetDistance(target) < 15.0f) - return false; - float chance = (float)triggerAmount; - if (!roll_chance_f(chance)) - return false; - - triggered_spell_id = 63685; - break; - } - // Static Shock - if (dummySpell->SpellIconID == 3059) - { - // Lightning Shield - if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, flag128(0x400, 0, 0))) - { - uint32 spell = 26364; - - GetSpellHistory()->ResetCooldown(spell); - CastSpell(target, spell, true, castItem, triggeredByAura); - return true; - } - return false; - } break; } case SPELLFAMILY_DEATHKNIGHT: @@ -6163,9 +5947,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Must Dual Wield if (!procSpell || !haveOffhandWeapon()) return false; - // Chance as basepoints for dummy aura - if (!roll_chance_i(triggerAmount)) - return false; switch (procSpell->Id) { @@ -6173,8 +5954,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere case 49143: triggered_spell_id = 66196; break; // Frost Strike case 45462: triggered_spell_id = 66216; break; // Plague Strike case 49998: triggered_spell_id = 66188; break; // Death Strike - case 56815: triggered_spell_id = 66217; break; // Rune Strike - case 45902: triggered_spell_id = 66215; break; // Blood Strike default: return false; } @@ -6253,9 +6032,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura break; // Gaseous Bloat case 70672: - case 72455: - case 72832: - case 72833: { *handled = true; uint32 stack = triggeredByAura->GetStackAmount(); @@ -6269,9 +6045,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura } // Ball of Flames Proc case 71756: - case 72782: - case 72783: - case 72784: RemoveAuraFromStack(dummySpell->Id); *handled = true; break; @@ -6298,13 +6071,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura break; case SPELLFAMILY_PALADIN: { - // Judgements of the Just - if (dummySpell->SpellIconID == 3015) - { - *handled = true; - CastSpell(victim, 68055, true); - return true; - } break; } case SPELLFAMILY_MAGE: @@ -6401,16 +6167,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura } break; } - // Recklessness - case 1719: - { - //! Possible hack alert - //! Don't drop charges on proc, they will be dropped on SpellMod removal - //! Before this change, it was dropping two charges per attack, one in ProcDamageAndSpellFor, and one in RemoveSpellMods. - //! The reason of this behaviour is Recklessness having three auras, 2 of them can not proc (isTriggeredAura array) but the other one can, making the whole spell proc. - *handled = true; - break; - } default: break; } @@ -6549,17 +6305,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } case SPELLFAMILY_HUNTER: { - /*if (auraSpellInfo->SpellIconID == 3247) // Piercing Shots - { - trigger_spell_id = 63468; // 6.x missing from dbc but it is in the tooltip - SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id); - if (!TriggerPS) - return false; - - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].ApplyAuraPeriod); - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - break; - }*/ // Item - Hunter T9 4P Bonus if (auraSpellInfo->Id == 67151) { @@ -6689,24 +6434,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Custom triggered spells switch (auraSpellInfo->Id) { - // Deep Wounds - case 12834: - case 12849: - case 12867: - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - float averageDmg = 0; - // now compute approximate weapon damage by formula from wowwiki.com - if (procFlags & PROC_FLAG_DONE_OFFHAND_ATTACK) - averageDmg = (GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)) / 2.f; - else - averageDmg = (GetFloatValue(UNIT_FIELD_MINDAMAGE) + GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2.f; - - basepoints0 = int32(averageDmg); - break; - } // Persistent Shield (Scarab Brooch trinket) // This spell originally trigger 13567 - Dummy Trigger (vs dummy efect) case 26467: @@ -6730,7 +6457,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - // Cheat Death case 28845: { @@ -6800,14 +6526,12 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 7099: // Curse of Mending case 39703: // Curse of Mending case 29494: // Temptation - case 20233: // Improved Lay on Hands (cast on target) { target = victim; break; } // Finish movies that add combo case 14189: // Seal Fate (Netherblade set) - case 14157: // Ruthlessness { if (!victim || victim == this) return false; @@ -6833,29 +6557,9 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - case 46916: // Slam! (Bloodsurge proc) - case 52437: // Sudden Death - { - // Item - Warrior T10 Melee 4P Bonus - if (AuraEffect const* aurEff = GetAuraEffect(70847, 0)) - { - if (!roll_chance_i(aurEff->GetAmount())) - break; - CastSpell(this, 70849, true, castItem, triggeredByAura); // Extra Charge! - CastSpell(this, 71072, true, castItem, triggeredByAura); // Slam GCD Reduced - CastSpell(this, 71069, true, castItem, triggeredByAura); // Execute GCD Reduced - } - break; - } // Maelstrom Weapon case 53817: { - // has rank dependant proc chance, ignore too often cases - // PPM = 2.5 * (rank of talent), - uint32 rank = auraSpellInfo->GetRank(); - // 5 rank -> 100% 4 rank -> 80% and etc from full rate - if (!roll_chance_i(20*rank)) - return false; // Item - Shaman T10 Enhancement 4P Bonus if (AuraEffect const* aurEff = GetAuraEffect(70832, 0)) if (Aura const* maelstrom = GetAura(53817)) @@ -6871,14 +6575,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - // Savage Defense - case 62606: - { - basepoints0 = CalculatePct(triggerAmount, GetTotalAttackPowerValue(BASE_ATTACK)); - break; - } // Body and Soul - case 64128: case 65081: { // Proc only from PW:S cast @@ -6886,17 +6583,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - // Culling the Herd - case 70893: - { - // check if we're doing a critical hit - if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT)) - return false; - // check if we're procced by Claw, Bite or Smack (need to use the spell icon ID to detect it) - if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473)) - return false; - break; - } } if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(trigger_spell_id)) @@ -6935,22 +6621,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au switch (scriptId) { - case 4533: // Dreamwalker Raiment 2 pieces bonus - { - // Chance 50% - if (!roll_chance_i(50)) - return false; - - switch (victim->getPowerType()) - { - case POWER_MANA: triggered_spell_id = 28722; break; - case POWER_RAGE: triggered_spell_id = 28723; break; - case POWER_ENERGY: triggered_spell_id = 28724; break; - default: - return false; - } - break; - } case 4537: // Dreamwalker Raiment 6 pieces bonus triggered_spell_id = 28750; // Blessing of the Claw break; @@ -13410,18 +13080,19 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura) { // aura can be deleted at casts SpellInfo const* spellProto = triggeredByAura->GetSpellInfo(); + uint32 triggered_spell_id = 0; int32 heal = triggeredByAura->GetAmount(); ObjectGuid caster_guid = triggeredByAura->GetCasterGUID(); // Currently only Prayer of Mending - if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) + if (!triggered_spell_id) { TC_LOG_DEBUG("spells", "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); return false; } // jumps - int32 jumps = triggeredByAura->GetBase()->GetCharges()-1; + int32 jumps = triggeredByAura->GetBase()->GetCharges() - 1; // current aura expire triggeredByAura->GetBase()->SetCharges(1); // will removed at next charges decrease @@ -13443,11 +13114,10 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura) } } - // heal - CastCustomSpell(this, 33110, &heal, NULL, NULL, true, NULL, NULL, caster_guid); + CastSpell(this, triggered_spell_id, true, NULL, triggeredByAura, caster_guid); return true; - } + bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) { // aura can be deleted at casts |