From a9d5fab2718862cfeb31be81e1a099e5d997e9e6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 May 2016 21:14:53 +0200 Subject: [PATCH 001/110] Core/Spells: Calculate hitMask and store it in DamageInfo/HealInfo structures --- src/server/game/Entities/Unit/Unit.cpp | 99 ++++++++++++++++++++++---- src/server/game/Entities/Unit/Unit.h | 23 +++--- 2 files changed, 97 insertions(+), 25 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 42eb1456da..204ff0ac74 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -104,21 +104,63 @@ static bool isAlwaysTriggeredAura[TOTAL_AURAS]; // Prepare lists static bool procPrepared = InitTriggerAuraData(); -DamageInfo::DamageInfo(Unit* _attacker, Unit* _victim, uint32 _damage, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType) -: m_attacker(_attacker), m_victim(_victim), m_damage(_damage), m_spellInfo(_spellInfo), m_schoolMask(_schoolMask), -m_damageType(_damageType), m_attackType(BASE_ATTACK) +DamageInfo::DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType) + : m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType), + m_absorb(0), m_resist(0), m_block(0), m_hitMask(0) { - m_absorb = 0; - m_resist = 0; - m_block = 0; } -DamageInfo::DamageInfo(CalcDamageInfo& dmgInfo) -: m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_spellInfo(NULL), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)), -m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType) + +DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo) + : m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)), + m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType), m_absorb(dmgInfo.absorb), m_resist(dmgInfo.resist), m_block(dmgInfo.blocked_amount), m_hitMask(0) { - m_absorb = 0; - m_resist = 0; - m_block = 0; + switch (dmgInfo.TargetState) + { + case VICTIMSTATE_IS_IMMUNE: + m_hitMask |= PROC_HIT_IMMUNE; + break; + case VICTIMSTATE_BLOCKS: + m_hitMask |= PROC_HIT_FULL_BLOCK; + break; + } + + if (m_absorb) + m_hitMask |= PROC_HIT_ABSORB; + + if (dmgInfo.HitInfo & HITINFO_FULL_RESIST) + m_hitMask |= PROC_HIT_FULL_RESIST; + + if (m_block) + m_hitMask |= PROC_HIT_BLOCK; + + switch (dmgInfo.hitOutCome) + { + case MELEE_HIT_MISS: + m_hitMask |= PROC_HIT_MISS; + break; + case MELEE_HIT_DODGE: + m_hitMask |= PROC_HIT_DODGE; + break; + case MELEE_HIT_PARRY: + m_hitMask |= PROC_HIT_PARRY; + break; + case MELEE_HIT_EVADE: + m_hitMask |= PROC_HIT_EVADE; + break; + default: + break; + } +} + +DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType) + : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), + m_spellInfo(sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType), + m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(0) +{ + if (spellNonMeleeDamage.blocked) + m_hitMask |= PROC_HIT_BLOCK; + if (spellNonMeleeDamage.absorb) + m_hitMask |= PROC_HIT_ABSORB; } void DamageInfo::ModifyDamage(int32 amount) @@ -132,6 +174,7 @@ void DamageInfo::AbsorbDamage(uint32 amount) amount = std::min(amount, GetDamage()); m_absorb += amount; m_damage -= amount; + m_hitMask |= PROC_HIT_ABSORB; } void DamageInfo::ResistDamage(uint32 amount) @@ -139,6 +182,8 @@ void DamageInfo::ResistDamage(uint32 amount) amount = std::min(amount, GetDamage()); m_resist += amount; m_damage -= amount; + if (!m_damage) + m_hitMask |= PROC_HIT_FULL_RESIST; } void DamageInfo::BlockDamage(uint32 amount) @@ -146,6 +191,32 @@ void DamageInfo::BlockDamage(uint32 amount) amount = std::min(amount, GetDamage()); m_block += amount; m_damage -= amount; + m_hitMask |= PROC_HIT_BLOCK; + if (!m_damage) + m_hitMask |= PROC_HIT_FULL_BLOCK; +} + +uint32 DamageInfo::GetHitMask() const +{ + return m_hitMask; +} + +HealInfo::HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask) + : _healer(healer), _target(target), _heal(heal), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0) +{ +} + +void HealInfo::AbsorbHeal(uint32 amount) +{ + amount = std::min(amount, GetHeal()); + _absorb += amount; + _heal -= amount; + _hitMask |= PROC_HIT_ABSORB; +} + +uint32 HealInfo::GetHitMask() const +{ + return _hitMask; } ProcEventInfo::ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, @@ -1611,7 +1682,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (!victim || !victim->IsAlive() || !damage) return; - DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype); + DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype, BASE_ATTACK); uint32 spellResistance = CalcSpellResistance(victim, schoolMask, spellInfo); dmgInfo.ResistDamage(CalculatePct(damage, spellResistance)); @@ -12810,7 +12881,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u Unit* actor = isVictim ? target : this; Unit* actionTarget = !isVictim ? target : this; - DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE); + DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE, attType); HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL); ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4d9a483e9e..78cad4a615 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -894,9 +894,11 @@ private: uint32 m_absorb; uint32 m_resist; uint32 m_block; + uint32 m_hitMask; public: - explicit DamageInfo(Unit* _attacker, Unit* _victim, uint32 _damage, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType); - explicit DamageInfo(CalcDamageInfo& dmgInfo); + DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType); + explicit DamageInfo(CalcDamageInfo const& dmgInfo); + DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType); void ModifyDamage(int32 amount); void AbsorbDamage(uint32 amount); @@ -913,9 +915,11 @@ public: uint32 GetAbsorb() const { return m_absorb; } uint32 GetResist() const { return m_resist; } uint32 GetBlock() const { return m_block; } + + uint32 GetHitMask() const; }; -class HealInfo +class TC_GAME_API HealInfo { private: Unit* const _healer; @@ -924,17 +928,12 @@ private: uint32 _absorb; SpellInfo const* const _spellInfo; SpellSchoolMask const _schoolMask; + uint32 _hitMask; public: - explicit HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask) - : _healer(healer), _target(target), _heal(heal), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask) { } + explicit HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask); - void AbsorbHeal(uint32 amount) - { - amount = std::min(amount, GetHeal()); - _absorb += amount; - _heal -= amount; - } + void AbsorbHeal(uint32 amount); Unit* GetHealer() const { return _healer; } Unit* GetTarget() const { return _target; } @@ -942,6 +941,8 @@ public: uint32 GetAbsorb() const { return _absorb; } SpellInfo const* GetSpellInfo() const { return _spellInfo; }; SpellSchoolMask GetSchoolMask() const { return _schoolMask; }; + + uint32 GetHitMask() const; }; class TC_GAME_API ProcEventInfo From 1f96c1f2684d0aa9639f95d57a421693dbe51cf3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 May 2016 21:09:03 +0200 Subject: [PATCH 002/110] Merge 1e1fcd6847619629f4b6642faaccb81c4cf3755e --- src/server/game/Entities/Unit/Unit.cpp | 244 +++++++++++++------- src/server/game/Entities/Unit/Unit.h | 9 +- src/server/game/Spells/Auras/SpellAuras.cpp | 24 +- src/server/game/Spells/Auras/SpellAuras.h | 10 +- 4 files changed, 186 insertions(+), 101 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 204ff0ac74..e912f6b4cf 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5363,7 +5363,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe } //victim may be NULL -bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); uint32 effIndex = triggeredByAura->GetEffIndex(); @@ -5373,8 +5373,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; uint32 triggered_spell_id = 0; - uint32 cooldown_spell_id = 0; // for random trigger, will be one of the triggered spell to avoid repeatable triggers - // otherwise, it's the triggered_spell_id by default Unit* target = victim; int32 basepoints0 = 0; ObjectGuid originalCaster; @@ -5450,24 +5448,20 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere case CLASS_PALADIN: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 case CLASS_DRUID: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 triggered_spell_id = RAND(39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409); - cooldown_spell_id = 39511; break; case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011 case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011 case CLASS_DEATH_KNIGHT: triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011); - cooldown_spell_id = 39511; break; case CLASS_PRIEST: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 case CLASS_SHAMAN: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 case CLASS_MAGE: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 case CLASS_WARLOCK: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 triggered_spell_id = RAND(40999, 41002, 41005, 41009, 41011, 41406, 41409); - cooldown_spell_id = 40999; break; case CLASS_HUNTER: // 40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409 triggered_spell_id = RAND(40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409); - cooldown_spell_id = 40997; break; default: return false; @@ -5685,11 +5679,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere uint8 rand_spell = urand(0, (RandomSpells.size() - 1)); CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); - for (std::vector::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) - { - if (!GetSpellHistory()->HasCooldown(*itr)) - GetSpellHistory()->AddCooldown(*itr, 0, std::chrono::seconds(cooldown)); - } break; } case 71562: // Deathbringer's Will Heroic @@ -5731,11 +5720,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere uint8 rand_spell = urand(0, (RandomSpells.size() - 1)); CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); - for (std::vector::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) - { - if (!GetSpellHistory()->HasCooldown(*itr)) - GetSpellHistory()->AddCooldown(*itr, 0, std::chrono::seconds(cooldown)); - } break; } case 65032: // Boom aura (321 Boombot) @@ -6113,7 +6097,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Item - Paladin T8 Holy 4P Bonus if (Unit* caster = triggeredByAura->GetCaster()) if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0)) - cooldown = aurEff->GetAmount(); + cooldown = Milliseconds(aurEff->GetAmount()); target = this; break; @@ -6332,10 +6316,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere 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; @@ -6379,8 +6359,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 33750; // apply cooldown before cast to prevent processing itself - if (cooldown) - player->GetSpellHistory()->AddCooldown(dummySpell->Id, 0, std::chrono::seconds(cooldown)); + triggeredByAura->GetBase()->AddProcCooldown(std::chrono::steady_clock::now() + cooldown); + cooldown = Milliseconds::zero(); // Attack Twice for (uint32 i = 0; i < 2; ++i) @@ -6554,6 +6534,86 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere CastCustomSpell(victim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); return true; } + // Improved Water Shield + if (dummySpell->SpellIconID == 2287) + { + // Default chance for Healing Wave and Riptide + float chance = (float)triggeredByAura->GetAmount(); + + if (!procSpell) + return false; //This is the same than putting chance *= 0.0f; + else if (procSpell->SpellFamilyFlags[0] & 0x80) + // Lesser Healing Wave - 0.6 of default + chance *= 0.6f; + else if (procSpell->SpellFamilyFlags[0] & 0x100) + // Chain heal - 0.3 of default + chance *= 0.3f; + + if (!roll_chance_f(chance)) + return false; + + // Water Shield + if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0, 0x00000020, 0)) + { + uint32 spell = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + CastSpell(this, spell, true, castItem, triggeredByAura); + return true; + } + return false; + } + // Lightning Overload + if (dummySpell->SpellIconID == 2018) // only this spell has SpellFamily Shaman SpellIconID == 2018 and dummy aura + { + if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim) + return false; + + uint32 spellId = 0; + // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost + switch (procSpell->Id) + { + // Lightning Bolt + case 403: spellId = 45284; break; // Rank 1 + case 529: spellId = 45286; break; // Rank 2 + case 548: spellId = 45287; break; // Rank 3 + case 915: spellId = 45288; break; // Rank 4 + case 943: spellId = 45289; break; // Rank 5 + case 6041: spellId = 45290; break; // Rank 6 + case 10391: spellId = 45291; break; // Rank 7 + case 10392: spellId = 45292; break; // Rank 8 + case 15207: spellId = 45293; break; // Rank 9 + case 15208: spellId = 45294; break; // Rank 10 + case 25448: spellId = 45295; break; // Rank 11 + case 25449: spellId = 45296; break; // Rank 12 + case 49237: spellId = 49239; break; // Rank 13 + case 49238: spellId = 49240; break; // Rank 14 + // Chain Lightning + case 421: spellId = 45297; break; // Rank 1 + case 930: spellId = 45298; break; // Rank 2 + case 2860: spellId = 45299; break; // Rank 3 + case 10605: spellId = 45300; break; // Rank 4 + case 25439: spellId = 45301; break; // Rank 5 + case 25442: spellId = 45302; break; // Rank 6 + case 49270: spellId = 49268; break; // Rank 7 + case 49271: spellId = 49269; break; // Rank 8 + default: + TC_LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); + return false; + } + + // Chain Lightning + if (procSpell->SpellFamilyFlags[0] & 0x2) + { + // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit. + // A maxed LO would have a 33% / 3 = 11% chance to proc of each target. + // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets] + float chance = 100.0f / procSpell->Effects[effIndex].ChainTarget; + if (!roll_chance_f(chance)) + return false; + } + + CastSpell(victim, spellId, true, castItem, triggeredByAura); + return true; + } // Static Shock if (dummySpell->SpellIconID == 3059) { @@ -6708,20 +6768,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; } - if (cooldown_spell_id == 0) - cooldown_spell_id = triggered_spell_id; - - if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(cooldown_spell_id)) - return false; - if (basepoints0) CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura, originalCaster); else CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster); - if (cooldown && GetTypeId() == TYPEID_PLAYER) - GetSpellHistory()->AddCooldown(cooldown_spell_id, 0, std::chrono::seconds(cooldown)); - return true; } @@ -6731,7 +6782,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Used in case when access to whole aura is needed // All procs should be handled like this... -bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown, bool * handled) +bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, bool* handled) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); @@ -6905,12 +6956,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura case 49222: { *handled = true; - if (cooldown && GetTypeId() == TYPEID_PLAYER) - { - if (GetSpellHistory()->HasCooldown(100000)) - return false; - GetSpellHistory()->AddCooldown(100000, 0, std::chrono::seconds(cooldown)); - } return true; } } @@ -6946,7 +6991,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura return false; } -bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown) +bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx) { // Get triggered aura spell info SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); @@ -7244,7 +7289,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg float averageDmg = 0; // now compute approximate weapon damage by formula from wowwiki.com - if (procFlags & PROC_FLAG_DONE_OFFHAND_ATTACK) + if (procFlag & 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; @@ -7343,6 +7388,18 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg switch (trigger_spell_id) { // Auras which should proc on area aura source (caster in this case): + // Turn the Tables + case 52914: + case 52915: + case 52910: + { + target = triggeredByAura->GetBase()->GetCaster(); + if (!target) + return false; + + target->CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); + return true; + } // Cast positive spell on enemy target case 7099: // Curse of Mending case 39703: // Curse of Mending @@ -7405,6 +7462,35 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(this, 70831, true, castItem, triggeredByAura); break; } + // Astral Shift + case 52179: + { + if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) + return false; + + // Need stun, fear or silence mechanic + if (!(procSpell->GetAllEffectsMechanicMask() & ((1<GetAllEffectsMechanicMask() & ((1<SchoolMask & SPELL_SCHOOL_MASK_FROST) || !roll_chance_i(triggerAmount)) + return false; + break; + } // Glyph of Death's Embrace case 58679: { @@ -7441,29 +7527,23 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } } - if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(trigger_spell_id)) - return false; - // extra attack should hit same target if (triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) target = victim; // try detect target manually if not set if (target == NULL) - target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim; + target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim; if (basepoints0) CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); - if (cooldown && GetTypeId() == TYPEID_PLAYER) - GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown)); - return true; } -bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 cooldown) +bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell) { int32 scriptId = triggeredByAura->GetMiscValue(); @@ -7513,14 +7593,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au return false; } - if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(triggered_spell_id)) - return false; - CastSpell(victim, triggered_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - GetSpellHistory()->AddCooldown(triggered_spell_id, 0, std::chrono::seconds(cooldown)); - return true; } @@ -12885,6 +12958,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL); ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo); + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); ProcTriggeredList procTriggered; // Fill procTriggered list for (AuraApplicationMap::const_iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr) @@ -12892,6 +12966,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u // Do not allow auras to proc from effect triggered by itself if (procAura && procAura->Id == itr->first) continue; + + if (itr->second->GetBase()->IsProcOnCooldown(now)) + continue; + ProcTriggeredData triggerData(itr->second->GetBase()); // Defensive procs are active on absorbs (so absorption effects are not a hindrance) bool active = damage || (procExtra & PROC_EX_BLOCK && isVictim); @@ -12976,10 +13054,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo); - //Milliseconds cooldown = Milliseconds::zero(); // temp revert. dig for the 3.3.5a commit changing this. - uint32 cooldown = 0; - if (prepare && i->spellProcEvent && i->spellProcEvent->cooldown) - cooldown = i->spellProcEvent->cooldown; + // For players set spell cooldown if need + Milliseconds cooldown = Milliseconds::zero(); + if (prepare && GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown) + cooldown = Seconds(i->spellProcEvent->cooldown); // Note: must SetCantProc(false) before return if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) @@ -12988,9 +13066,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo); // "handled" is needed as long as proc can be handled in multiple places - if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) + if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, &handled)) { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), Id); takeCharges = true; } @@ -12998,7 +13076,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { - if (!(i->effMask & (1<effMask & (1 << effIndex))) continue; AuraEffect* triggeredByAura = i->aura->GetEffect(effIndex); @@ -13015,9 +13093,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { case SPELL_AURA_PROC_TRIGGER_SPELL: { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", + spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); // Don`t drop charge or add cooldown for not started trigger - if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) + if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra)) takeCharges = true; break; } @@ -13034,7 +13113,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", + spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; @@ -13052,20 +13132,22 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_MOD_POWER_REGEN_PERCENT: case SPELL_AURA_MOD_MELEE_HASTE: case SPELL_AURA_MOD_MELEE_HASTE_3: - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId()); + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", + spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId()); takeCharges = true; break; case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown)) + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", + spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); + if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell)) takeCharges = true; break; } case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); HandleAuraRaidProcFromChargeWithValue(triggeredByAura); takeCharges = true; @@ -13074,7 +13156,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_RAID_PROC_FROM_CHARGE: { TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); HandleAuraRaidProcFromCharge(triggeredByAura); takeCharges = true; @@ -13082,9 +13164,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", + spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) + if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra)) takeCharges = true; break; } @@ -13169,6 +13252,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } // for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) } // if (!handled) + if (prepare && takeCharges && cooldown != Milliseconds::zero()) + i->aura->AddProcCooldown(now + cooldown); + // Remove charge (aura can be removed by triggers) if (prepare && useCharges && takeCharges) { @@ -13197,6 +13283,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u void Unit::GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo) { + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); + // use provided list of auras which can proc if (procAuras) { @@ -13204,9 +13292,9 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list& aurasTrigge { ASSERT((*itr)->GetTarget() == this); if (!(*itr)->GetRemoveMode()) - if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo)) + if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo, now)) { - (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo); + (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo, now); aurasTriggeringProc.push_back(*itr); } } @@ -13216,9 +13304,9 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list& aurasTrigge { for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr) { - if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo)) + if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) { - itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo); + itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now); aurasTriggeringProc.push_back(itr->second); } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 78cad4a615..4496e5224c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2287,11 +2287,10 @@ class TC_GAME_API Unit : public WorldObject private: bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent); bool RollProcResult(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const* spellProcEvent); - bool HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); - bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); + bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown); + bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, bool* handled); + bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx); + bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell); bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura); bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8499e0199e..2d808550fd 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -346,7 +346,8 @@ m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID( m_castItemGuid(castItem ? castItem->GetGUID() : ObjectGuid::Empty), m_applyTime(time(NULL)), m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0), m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1), -m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr) +m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr), +m_procCooldown(std::chrono::steady_clock::time_point::min()) { if (m_spellInfo->ManaPerSecond) m_timeCla = 1 * IN_MILLISECONDS; @@ -1695,22 +1696,17 @@ bool Aura::CanStackWith(Aura const* existingAura) const return true; } -bool Aura::IsProcOnCooldown() const +bool Aura::IsProcOnCooldown(std::chrono::steady_clock::time_point now) const { - /*if (m_procCooldown) - { - if (m_procCooldown > time(NULL)) - return true; - }*/ - return false; + return m_procCooldown > now; } -void Aura::AddProcCooldown(Milliseconds /*msec*/) +void Aura::AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd) { - //m_procCooldown = std::chrono::steady_clock::now() + msec; + m_procCooldown = cooldownEnd; } -void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo) +void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) { bool prepare = CallScriptPrepareProcHandlers(aurApp, eventInfo); if (!prepare) @@ -1728,10 +1724,10 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf ASSERT(procEntry); // cooldowns should be added to the whole aura (see 51698 area aura) - AddProcCooldown(procEntry->Cooldown); + AddProcCooldown(now + procEntry->Cooldown); } -bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const +bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const { SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()); // only auras with spell proc entry can trigger proc @@ -1743,7 +1739,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI return false; // check proc cooldown - if (IsProcOnCooldown()) + if (IsProcOnCooldown(now)) return false; /// @todo diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index cf87921070..803954e817 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -203,12 +203,12 @@ class TC_GAME_API Aura // this subsystem is not yet in use - the core of it is functional, but still some research has to be done // and some dependant problems fixed before it can replace old proc system (for example cooldown handling) // currently proc system functionality is implemented in Unit::ProcDamageAndSpell - bool IsProcOnCooldown() const; - void AddProcCooldown(Milliseconds msec); + bool IsProcOnCooldown(std::chrono::steady_clock::time_point now) const; + void AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd); bool IsUsingCharges() const { return m_isUsingCharges; } void SetUsingCharges(bool val) { m_isUsingCharges = val; } - void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo); - bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const; + void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now); + bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo); @@ -269,6 +269,8 @@ class TC_GAME_API Aura ChargeDropEvent* m_dropEvent; + std::chrono::steady_clock::time_point m_procCooldown; + private: Unit::AuraApplicationList m_removedApplications; }; From 51f26dfe5113bb5acd5413a13416bd1ca372034e Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 25 Sep 2016 20:47:28 -0300 Subject: [PATCH 003/110] Core/Spells: Implementation of QAston proc system --- sql/base/auth_database.sql | 4 + sql/updates/auth/3.3.5/2016_09_22_00_auth.sql | 1 + src/server/game/Combat/ThreatManager.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 169 +- src/server/game/Entities/Player/Player.h | 124 +- src/server/game/Entities/Unit/Unit.cpp | 3224 ++--------------- src/server/game/Entities/Unit/Unit.h | 295 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 155 +- .../game/Spells/Auras/SpellAuraEffects.h | 6 +- src/server/game/Spells/Auras/SpellAuras.cpp | 126 +- src/server/game/Spells/Auras/SpellAuras.h | 9 +- src/server/game/Spells/Spell.cpp | 258 +- src/server/game/Spells/Spell.h | 6 +- src/server/game/Spells/SpellEffects.cpp | 39 +- src/server/game/Spells/SpellHistory.cpp | 4 +- src/server/game/Spells/SpellInfo.cpp | 12 +- src/server/game/Spells/SpellMgr.cpp | 632 ++-- src/server/game/Spells/SpellMgr.h | 62 +- src/server/game/Spells/SpellScript.cpp | 16 + src/server/game/Spells/SpellScript.h | 17 + src/server/game/World/World.cpp | 3 - src/server/scripts/Commands/cs_reload.cpp | 10 - .../IcecrownCitadel/icecrown_citadel.cpp | 2 +- src/server/scripts/Spells/spell_warlock.cpp | 2 +- 25 files changed, 1200 insertions(+), 3980 deletions(-) create mode 100644 sql/updates/auth/3.3.5/2016_09_22_00_auth.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 4c9dd90027..9baa75c683 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -649,8 +649,12 @@ CREATE TABLE `updates` ( LOCK TABLES `updates` WRITE; /*!40000 ALTER TABLE `updates` DISABLE KEYS */; +<<<<<<< HEAD INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-14 23:27:07',0),('2016_01_13_00_auth_434.sql','3E88183E1A85D11BFD74CF9A32A725C44AE02EEC','ARCHIVED','2016-01-13 01:19:16',0),('2016_03_12_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-03-12 01:19:16',0),('2016_05_15_00_auth_from_335_was_2016_05_11_00_auth.sql','C593DA4423F344FB10AAA86C20D1E87B','ARCHIVED','',0),('2016_08_28_00_auth.sql','30A76055F50A79629DB82B7BF17CE9B7','ARCHIVED','',0),('2016_09_03_02_auth_from_335_was_2016_06_06_00_auth.sql','8E1989D33A2A6CCC60B3AFAEFCBFD735','ARCHIVED','',0),('2016_09_28_00_auth.sql','1719674D3EE9E8B965BAC4042140D6BD','ARCHIVED','',0),('2016_11_06_00_auth.sql','C3B848943465F7D360EF3E01F46219E6','ARCHIVED','2016-11-06 17:11:18',0),('2017_01_07_00_auth_from_335_was_2017_01_06_00_auth.sql','D471D225E30B746E4A1736D173E83A84','ARCHIVED','2017-01-07 00:00:00',0),('2017_01_12_00_auth.sql','7EB5AAEC12EDD728EB66C89FF5E4C466','ARCHIVED','2017-01-12 00:00:00',0),('2017_02_11_00_auth.sql','16147413149F2EA1AD413FEA9C503093','ARCHIVED','2017-02-11 00:00:00',0),('2017_03_16_00_auth.sql','C1BC73E532180AE4CE5D28AF6A0730DC','RELEASED','2017-02-16 00:00:00',0),('2017_03_20_00_auth_from_335_was_2017_03_17_00_auth.sql','22FBDB54B8BC809C95E4D2AFAF1B249C','ARCHIVED','2017-03-20 16:48:01',0),('2017_04_02_00_auth.sql','2420814101287A57800A877BE699AE5F','ARCHIVED','2017-04-02 07:48:01',0),('2017_04_16_00_auth.sql','0E7939DE2187B93E351DE6174D467F0C','ARCHIVED','2017-04-16 07:48:01',0); +======= +INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',92),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-13 00:00:00',0),('2016_04_11_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-04-11 03:18:17',0),('2016_05_11_00_auth.sql','95B66235B8D67BF1CA216EB09F313C1F8F393B47','RELEASED','2016-04-16 13:17:11',0),('2016_06_06_00_auth.sql','57603BB68C340A8C919FB424452C282C47A193F7','RELEASED','2016-06-06 18:20',0),('2016_09_22_00_auth.sql','70047954E3556BFA430ADD5680EF8797F74A4B9E','RELEASED','2016-09-22 00:00:00',0); +>>>>>>> e641d0c7d7... Core/Spells: Implementation of QAston proc system /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql b/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql new file mode 100644 index 0000000000..324bd800ad --- /dev/null +++ b/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql @@ -0,0 +1 @@ +DELETE FROM `rbac_permissions` WHERE `id` = 698; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index c23ca5ce21..6e10e8345c 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -44,7 +44,7 @@ float ThreatCalcHelper::calcThreat(Unit* hatedUnit, Unit* /*hatingUnit*/, float return threat; if (Player* modOwner = hatedUnit->GetSpellModOwner()) - modOwner->ApplySpellMod(threatSpell->Id, SPELLMOD_THREAT, threat); + modOwner->ApplySpellMod(threatSpell->Id, threat); } return hatedUnit->ApplyTotalThreatModifier(threat, schoolMask); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bae2ed585c..016a9ca2e8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8186,8 +8186,10 @@ void Player::UpdateEquipSpellsAtFormChange() } } } -void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx) + +void Player::CastItemCombatSpell(DamageInfo const& damageInfo) { + Unit* target = damageInfo.GetVictim(); if (!target || !target->IsAlive() || target == this) return; @@ -8195,7 +8197,9 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 { // If usable, try to cast item spell if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (!item->IsBroken() && CanUseAttackType(attType)) + { + if (!item->IsBroken() && CanUseAttackType(damageInfo.GetAttackType())) + { if (ItemTemplate const* proto = item->GetTemplate()) { // Additional check for weapons @@ -8203,30 +8207,42 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 { // offhand item cannot proc from main hand hit etc EquipmentSlots slot; - switch (attType) + switch (damageInfo.GetAttackType()) { - case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break; - case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break; - case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break; - default: slot = EQUIPMENT_SLOT_END; break; + case BASE_ATTACK: + slot = EQUIPMENT_SLOT_MAINHAND; + break; + case OFF_ATTACK: + slot = EQUIPMENT_SLOT_OFFHAND; + break; + case RANGED_ATTACK: + slot = EQUIPMENT_SLOT_RANGED; + break; + default: + slot = EQUIPMENT_SLOT_END; + break; } if (slot != i) continue; // Check if item is useable (forms or disarm) - if (attType == BASE_ATTACK) + if (damageInfo.GetAttackType() == BASE_ATTACK) if (!IsUseEquipedWeapon(true) && !IsInFeralForm()) continue; } - CastItemCombatSpell(target, attType, procVictim, procEx, item, proto); + + CastItemCombatSpell(damageInfo, item, proto); } + } + } } } -void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto) +void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemTemplate const* proto) { // Can do effect if any damage done to target - if (procVictim & PROC_FLAG_TAKEN_DAMAGE) - //if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE) + // for done procs allow normal + critical + absorbs by default + bool canTrigger = (damageInfo.GetHitMask() & (PROC_HIT_NORMAL | PROC_HIT_CRITICAL | PROC_HIT_ABSORB)) != 0; + if (canTrigger) { for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { @@ -8256,14 +8272,14 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 if (proto->SpellPPMRate) { - uint32 WeaponSpeed = GetAttackTime(attType); + uint32 WeaponSpeed = GetAttackTime(damageInfo.GetAttackType()); chance = GetPPMProcChance(WeaponSpeed, proto->SpellPPMRate, spellInfo); } else if (chance > 100.0f) chance = GetWeaponProcChance(); if (roll_chance_f(chance)) - CastSpell(target, spellInfo->Id, true, item); + CastSpell(damageInfo.GetVictim(), spellInfo->Id, true, item); } } @@ -8284,18 +8300,17 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 continue; SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); - if (entry && entry->procEx) { // Check hit/crit/dodge/parry requirement - if ((entry->procEx & procEx) == 0) + if ((entry->procEx & damageInfo.GetHitMask()) == 0) continue; } else { // Can do effect if any damage done to target - if (!(procVictim & PROC_FLAG_TAKEN_DAMAGE)) - //if (!(damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE)) + // for done procs allow normal + critical + absorbs by default + if (!canTrigger) continue; } @@ -8308,7 +8323,6 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 } float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance(); - if (entry) { if (entry->PPMChance) @@ -8318,7 +8332,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 } // Apply spell mods - ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); + ApplySpellMod(pEnchant->spellid[s], chance); // Shiv has 100% chance to apply the poison if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT) @@ -8329,7 +8343,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 if (spellInfo->IsPositive()) CastSpell(this, spellInfo, true, item); else - CastSpell(target, spellInfo, true, item); + CastSpell(damageInfo.GetVictim(), spellInfo, true, item); } } } @@ -21226,8 +21240,8 @@ bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod if (!mod || !spellInfo) return false; - // Mod out of charges - if (spell && mod->charges == -1 && spell->m_appliedMods.find(mod->ownerAura) == spell->m_appliedMods.end()) + // First time this aura applies a mod to us and is out of charges + if (spell && mod->ownerAura->IsUsingCharges() && !mod->ownerAura->GetCharges() && !spell->m_appliedMods.count(mod->ownerAura)) return false; // +duration to infinite duration spells making them limited @@ -21250,7 +21264,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) size_t writePos = data.wpos(); data << uint32(modTypeCount); data << uint8(mod->op); - for (int eff = 0; eff < 96; ++eff) + for (int32 eff = 0; eff < 96; ++eff) { if (eff != 0 && (eff % 32) == 0) _mask[i++] = 0; @@ -21259,9 +21273,11 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) if (mod->mask & _mask) { int32 val = 0; - for (SpellModList::iterator itr = m_spellMods[mod->op].begin(); itr != m_spellMods[mod->op].end(); ++itr) - if ((*itr)->type == mod->type && (*itr)->mask & _mask) - val += (*itr)->value; + for (SpellModifier* spellMod : m_spellMods[mod->op]) + { + if (spellMod->type == mod->type && (spellMod->mask & _mask)) + val += spellMod->value; + } val += apply ? mod->value : -(mod->value); data << uint8(eff); @@ -21272,36 +21288,30 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) data.put(writePos, modTypeCount); SendDirectMessage(&data); if (apply) - m_spellMods[mod->op].push_back(mod); + m_spellMods[mod->op].insert(mod); else - { - m_spellMods[mod->op].remove(mod); - // mods bound to aura will be removed in AuraEffect::~AuraEffect - if (!mod->ownerAura) - delete mod; - } + m_spellMods[mod->op].erase(mod); } // Restore spellmods in case of failed cast -void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura) +void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId /*= 0*/, Aura* aura /*= nullptr*/) { if (!spell || spell->m_appliedMods.empty()) return; std::list aurasQueue; - - for (uint8 i=0; iownerAura || !mod->ownerAura->IsUsingCharges()) + // Spellmods without charged aura cannot be charged + if (!mod->ownerAura->IsUsingCharges()) continue; // Restore only specific owner aura mods - if (ownerAuraId && (ownerAuraId != mod->ownerAura->GetSpellInfo()->Id)) + if (ownerAuraId && mod->spellId != ownerAuraId) continue; if (aura && mod->ownerAura != aura) @@ -21322,84 +21332,33 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura) // only see the first of its modifier restored) aurasQueue.push_back(mod->ownerAura); - // add mod charges back to mod - if (mod->charges == -1) - mod->charges = 1; - else - mod->charges++; - - // Do not set more spellmods than available - if (mod->ownerAura->GetCharges() < mod->charges) - mod->charges = mod->ownerAura->GetCharges(); - - // Skip this check for now - aura charges may change due to various reason - /// @todo track these changes correctly - //ASSERT (mod->ownerAura->GetCharges() <= mod->charges); + // add charges back to aura + mod->ownerAura->ModCharges(1); } } - for (std::list::iterator itr = aurasQueue.begin(); itr != aurasQueue.end(); ++itr) - { - Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(*itr); - if (iterMod != spell->m_appliedMods.end()) - spell->m_appliedMods.erase(iterMod); - } + for (Aura* aura : aurasQueue) + spell->m_appliedMods.erase(aura); } -void Player::RestoreAllSpellMods(uint32 ownerAuraId, Aura* aura) +void Player::RestoreAllSpellMods(uint32 ownerAuraId /*= 0*/, Aura* aura /*= nullptr*/) { for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (m_currentSpells[i]) - RestoreSpellMods(m_currentSpells[i], ownerAuraId, aura); + if (Spell* spell = m_currentSpells[i]) + RestoreSpellMods(spell, ownerAuraId, aura); } -void Player::RemoveSpellMods(Spell* spell) +void Player::ApplyModToSpell(SpellModifier* mod, Spell* spell) { if (!spell) return; - if (spell->m_appliedMods.empty()) + // don't do anything with no charges + if (mod->ownerAura->IsUsingCharges() && !mod->ownerAura->GetCharges()) return; - for (uint8 i=0; iownerAura || !mod->ownerAura->IsUsingCharges()) - continue; - - // check if mod affected this spell - Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura); - if (iterMod == spell->m_appliedMods.end()) - continue; - - // remove from list - spell->m_appliedMods.erase(iterMod); - - if (mod->ownerAura->DropCharge(AURA_REMOVE_BY_EXPIRE)) - itr = m_spellMods[i].begin(); - } - } -} - -void Player::DropModCharge(SpellModifier* mod, Spell* spell) -{ - // don't handle spells with proc_event entry defined - // this is a temporary workaround, because all spellmods should be handled like that - if (sSpellMgr->GetSpellProcEvent(mod->spellId)) - return; - - if (spell && mod->ownerAura && mod->charges > 0) - { - if (--mod->charges == 0) - mod->charges = -1; - - spell->m_appliedMods.insert(mod->ownerAura); - } + // register inside spell, proc system uses this to drop charges + spell->m_appliedMods.insert(mod->ownerAura); } void Player::SetSpellModTakingSpell(Spell* spell, bool apply) @@ -21410,7 +21369,7 @@ void Player::SetSpellModTakingSpell(Spell* spell, bool apply) if (apply && spell->getState() == SPELL_STATE_FINISHED) return; - m_spellModTakingSpell = apply ? spell : NULL; + m_spellModTakingSpell = apply ? spell : nullptr; } // send Proficiency diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 3fba7878d0..2384bed559 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -68,10 +68,10 @@ typedef std::deque PlayerMails; #define PLAYER_EXPLORED_ZONES_SIZE 156 // Note: SPELLMOD_* values is aura types in fact -enum SpellModType +enum SpellModType : uint8 { - SPELLMOD_FLAT = 107, // SPELL_AURA_ADD_FLAT_MODIFIER - SPELLMOD_PCT = 108 // SPELL_AURA_ADD_PCT_MODIFIER + SPELLMOD_FLAT = SPELL_AURA_ADD_FLAT_MODIFIER, + SPELLMOD_PCT = SPELL_AURA_ADD_PCT_MODIFIER }; // 2^n values, Player::m_isunderwater is a bitmask. These are Trinity internal values, they are never send to any client @@ -156,10 +156,11 @@ enum TalentTree // talent tabs // Spell modifier (used for modify other spells) struct SpellModifier { - SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) { } - SpellModOp op : 8; - SpellModType type : 8; - int16 charges : 16; + SpellModifier(Aura* _ownerAura) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), value(0), mask(), spellId(0), ownerAura(_ownerAura) { } + + SpellModOp op; + SpellModType type; + int32 value; flag96 mask; uint32 spellId; @@ -183,7 +184,7 @@ struct PlayerCurrency typedef std::unordered_map PlayerTalentMap; typedef std::unordered_map PlayerSpellMap; -typedef std::list SpellModList; +typedef std::unordered_set SpellModContainer; typedef std::unordered_map PlayerCurrenciesMap; /// Maximum number of CompactUnitFrames profiles @@ -1842,13 +1843,12 @@ class TC_GAME_API Player : public Unit, public GridObject PlayerSpellMap & GetSpellMap() { return m_spells; } void AddSpellMod(SpellModifier* mod, bool apply); - bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr); - template - void ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell = nullptr); - void RemoveSpellMods(Spell* spell); + static bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr); + template + void ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell = nullptr) const; void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr); void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr); - void DropModCharge(SpellModifier* mod, Spell* spell); + static void ApplyModToSpell(SpellModifier* mod, Spell* spell); void SetSpellModTakingSpell(Spell* spell, bool apply); void RemoveArenaSpellCooldowns(bool removeActivePetCooldowns = false); @@ -2198,9 +2198,9 @@ class TC_GAME_API Player : public Unit, public GridObject void ApplyItemEquipSpell(Item* item, bool apply, bool form_change = false); void ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, bool form_change = false); void UpdateEquipSpellsAtFormChange(); - void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx); + void CastItemCombatSpell(DamageInfo const& damageInfo); + void CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemTemplate const* proto); void CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex); - void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto); void SendEquipmentSetList(); void SetEquipmentSet(uint32 index, EquipmentSet eqset); @@ -2722,7 +2722,7 @@ class TC_GAME_API Player : public Unit, public GridObject uint32 m_baseHealthRegen; int32 m_spellPenetrationItemMod; - SpellModList m_spellMods[MAX_SPELLMOD]; + SpellModContainer m_spellMods[MAX_SPELLMOD]; EnchantDurationList m_enchantDuration; ItemDurationList m_itemDuration; @@ -2893,8 +2893,8 @@ TC_GAME_API void AddItemsSetItem(Player* player, Item* item); TC_GAME_API void RemoveItemsSetItem(Player* player, ItemTemplate const* proto); // "the bodies of template functions must be made available in a header file" -template -void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell /*= nullptr*/) +template +void Player::ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell /*= nullptr*/) const { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) @@ -2906,33 +2906,89 @@ void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* s if (m_spellModTakingSpell) spell = m_spellModTakingSpell; - for (SpellModList::iterator itr = m_spellMods[op].begin(); itr != m_spellMods[op].end(); ++itr) + switch (op) { - SpellModifier* mod = *itr; + // special case, if a mod makes spell instant, only consume that mod + case SPELLMOD_CASTING_TIME: + { + SpellModifier* modInstantSpell = nullptr; + for (SpellModifier* mod : m_spellMods[SPELLMOD_CASTING_TIME]) + { + if (!IsAffectedBySpellmod(spellInfo, mod, spell)) + continue; - // Charges can be set only for mods with auras - if (!mod->ownerAura) - ASSERT(mod->charges == 0); + if (mod->type == SPELLMOD_PCT && basevalue < T(10000) && mod->value <= -100) + { + modInstantSpell = mod; + break; + } + } + if (modInstantSpell) + { + Player::ApplyModToSpell(modInstantSpell, spell); + basevalue = T(0); + return; + } + break; + } + // special case if two mods apply 100% critical chance, only consume one + case SPELLMOD_CRITICAL_CHANCE: + { + SpellModifier* modCritical = nullptr; + for (SpellModifier* mod : m_spellMods[SPELLMOD_CRITICAL_CHANCE]) + { + if (!IsAffectedBySpellmod(spellInfo, mod, spell)) + continue; + + if (mod->type == SPELLMOD_FLAT && mod->value >= 100) + { + modCritical = mod; + break; + } + } + + if (modCritical) + { + Player::ApplyModToSpell(modCritical, spell); + basevalue = T(100); + return; + } + break; + } + default: + break; + } + + for (SpellModifier* mod : m_spellMods[op]) + { if (!IsAffectedBySpellmod(spellInfo, mod, spell)) continue; - if (mod->type == SPELLMOD_FLAT) - totalflat += mod->value; - else if (mod->type == SPELLMOD_PCT) + switch (mod->type) { - // skip percent mods for null basevalue (most important for spell mods with charges) - if (basevalue == T(0)) - continue; + case SPELLMOD_FLAT: + totalflat += mod->value; + break; + case SPELLMOD_PCT: + { + // skip percent mods for null basevalue (most important for spell mods with charges) + if (basevalue == T(0)) + continue; - // special case (skip > 10sec spell casts for instant cast setting) - if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100) - continue; + // special case (skip > 10sec spell casts for instant cast setting) + if (op == SPELLMOD_CASTING_TIME) + { + if (mod->value <= -100 && basevalue >= T(10000)) + continue; + } - totalmul += CalculatePct(1.0f, mod->value); + totalmul += CalculatePct(1.0f, mod->value); + break; + } } - DropModCharge(mod, spell); + Player::ApplyModToSpell(mod, spell); } basevalue = T(float(basevalue + totalflat) * totalmul); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e912f6b4cf..0155871786 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -93,17 +93,6 @@ float playerBaseMoveSpeed[MAX_MOVE_TYPE] = 3.14f // MOVE_PITCH_RATE }; -// Used for prepare can/can`t triggr aura -static bool InitTriggerAuraData(); -// Define can trigger auras -static bool isTriggerAura[TOTAL_AURAS]; -// Define can't trigger auras (need for disable second trigger) -static bool isNonTriggerAura[TOTAL_AURAS]; -// Triggered always, even from triggered spells -static bool isAlwaysTriggeredAura[TOTAL_AURAS]; -// Prepare lists -static bool procPrepared = InitTriggerAuraData(); - DamageInfo::DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType) : m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType), m_absorb(0), m_resist(0), m_block(0), m_hitMask(0) @@ -147,15 +136,23 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo) case MELEE_HIT_EVADE: m_hitMask |= PROC_HIT_EVADE; break; + case MELEE_HIT_CRUSHING: + case MELEE_HIT_GLANCING: + case MELEE_HIT_NORMAL: + m_hitMask |= PROC_HIT_NORMAL; + break; + case MELEE_HIT_CRIT: + m_hitMask |= PROC_HIT_CRITICAL; + break; default: break; } } -DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType) +DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, uint32 hitMask) : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), m_spellInfo(sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType), - m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(0) + m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask) { if (spellNonMeleeDamage.blocked) m_hitMask |= PROC_HIT_BLOCK; @@ -202,7 +199,7 @@ uint32 DamageInfo::GetHitMask() const } HealInfo::HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask) - : _healer(healer), _target(target), _heal(heal), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0) + : _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0) { } @@ -211,6 +208,8 @@ void HealInfo::AbsorbHeal(uint32 amount) amount = std::min(amount, GetHeal()); _absorb += amount; _heal -= amount; + amount = std::min(amount, GetEffectiveHeal()); + _effectiveHeal -= amount; _hitMask |= PROC_HIT_ABSORB; } @@ -1096,7 +1095,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama uint32 crit_bonus = damage; // Apply crit_damage bonus for melee spells if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus); + modOwner->ApplySpellMod(spellInfo->Id, crit_bonus); damage += crit_bonus; // Apply SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE or SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE @@ -1205,7 +1204,6 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->HitInfo = 0; damageInfo->procAttacker = PROC_FLAG_NONE; damageInfo->procVictim = PROC_FLAG_NONE; - damageInfo->procEx = PROC_EX_NONE; damageInfo->hitOutCome = MELEE_HIT_EVADE; if (!victim) @@ -1236,7 +1234,6 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->HitInfo |= HITINFO_NORMALSWING; damageInfo->TargetState = VICTIMSTATE_IS_IMMUNE; - damageInfo->procEx |= PROC_EX_IMMUNE; damageInfo->damage = 0; damageInfo->cleanDamage = 0; return; @@ -1266,27 +1263,23 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam case MELEE_HIT_EVADE: damageInfo->HitInfo |= HITINFO_MISS | HITINFO_SWINGNOHITSOUND; damageInfo->TargetState = VICTIMSTATE_EVADES; - damageInfo->procEx |= PROC_EX_EVADE; damageInfo->damage = 0; damageInfo->cleanDamage = 0; return; case MELEE_HIT_MISS: damageInfo->HitInfo |= HITINFO_MISS; damageInfo->TargetState = VICTIMSTATE_INTACT; - damageInfo->procEx |= PROC_EX_MISS; damageInfo->damage = 0; damageInfo->cleanDamage = 0; break; case MELEE_HIT_NORMAL: damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_NORMAL_HIT; break; case MELEE_HIT_CRIT: { damageInfo->HitInfo |= HITINFO_CRITICALHIT; damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_CRITICAL_HIT; // Crit bonus calc damageInfo->damage += damageInfo->damage; float mod = 0.0f; @@ -1305,20 +1298,17 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam } case MELEE_HIT_PARRY: damageInfo->TargetState = VICTIMSTATE_PARRY; - damageInfo->procEx |= PROC_EX_PARRY; damageInfo->cleanDamage += damageInfo->damage; damageInfo->damage = 0; break; case MELEE_HIT_DODGE: damageInfo->TargetState = VICTIMSTATE_DODGE; - damageInfo->procEx |= PROC_EX_DODGE; damageInfo->cleanDamage += damageInfo->damage; damageInfo->damage = 0; break; case MELEE_HIT_BLOCK: damageInfo->TargetState = VICTIMSTATE_HIT; damageInfo->HitInfo |= HITINFO_BLOCK; - damageInfo->procEx |= PROC_EX_BLOCK | PROC_EX_NORMAL_HIT; // 30% damage blocked, double blocked amount if block is critical damageInfo->blocked_amount = CalculatePct(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent() * 2 : damageInfo->target->GetBlockPercent()); damageInfo->damage -= damageInfo->blocked_amount; @@ -1328,7 +1318,6 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam { damageInfo->HitInfo |= HITINFO_GLANCING; damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_NORMAL_HIT; int32 leveldif = int32(victim->getLevel()) - int32(getLevel()); if (leveldif > 3) leveldif = 3; @@ -1340,7 +1329,6 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam case MELEE_HIT_CRUSHING: damageInfo->HitInfo |= HITINFO_CRUSHING; damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_NORMAL_HIT; // 150% normal damage damageInfo->damage += (damageInfo->damage / 2); break; @@ -1366,10 +1354,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam CalcAbsorbResist(damageInfo->target, SpellSchoolMask(damageInfo->damageSchoolMask), DIRECT_DAMAGE, damageInfo->damage, &damageInfo->absorb, &damageInfo->resist); if (damageInfo->absorb) - { damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); - damageInfo->procEx |= PROC_EX_ABSORB; - } if (damageInfo->resist) damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); @@ -1459,7 +1444,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) } if (GetTypeId() == TYPEID_PLAYER) - ToPlayer()->CastItemCombatSpell(victim, damageInfo->attackType, damageInfo->procVictim, damageInfo->procEx); + { + DamageInfo dmgInfo(*damageInfo); + ToPlayer()->CastItemCombatSpell(dmgInfo); + } // Do effect if any damage done to target if (damageInfo->damage) @@ -1561,7 +1549,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo if (spellInfo) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_IGNORE_ARMOR, armor); + modOwner->ApplySpellMod(spellInfo->Id, armor); AuraEffectList const& resIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); for (AuraEffectList::const_iterator j = resIgnoreAuras.begin(); j != resIgnoreAuras.end(); ++j) @@ -1870,8 +1858,10 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe CleanDamage cleanDamage = CleanDamage(splitDamage, 0, BASE_ATTACK, MELEE_HIT_NORMAL); DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false); + // break 'Fear' and similar auras - caster->ProcDamageAndSpellFor(true, this, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_NORMAL_HIT, BASE_ATTACK, (*itr)->GetSpellInfo(), splitDamage); + DamageInfo damageInfo(caster, this, splitDamage, (*itr)->GetSpellInfo(), schoolMask, DIRECT_DAMAGE, BASE_ATTACK); + ProcSkillsAndAuras(caster, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, PROC_HIT_NONE, nullptr, &damageInfo, nullptr); } } @@ -1879,21 +1869,22 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe *absorb = dmgInfo.GetAbsorb(); } -void Unit::CalcHealAbsorb(Unit* victim, SpellInfo const* healSpell, uint32 &healAmount, uint32 &absorb) +void Unit::CalcHealAbsorb(HealInfo& healInfo) { - if (!healAmount) + if (!healInfo.GetHeal()) return; - int32 RemainingHeal = healAmount; + int32 const healing = static_cast(healInfo.GetHeal()); + int32 absorbAmount = 0; // Need remove expired auras after bool existExpired = false; // absorb without mana cost - AuraEffectList const& vHealAbsorb = victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_HEAL_ABSORB); - for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && RemainingHeal > 0; ++i) + AuraEffectList const& vHealAbsorb = healInfo.GetTarget()->GetAuraEffectsByType(SPELL_AURA_SCHOOL_HEAL_ABSORB); + for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && absorbAmount <= healing; ++i) { - if (!((*i)->GetMiscValue() & healSpell->SchoolMask)) + if (!((*i)->GetMiscValue() & healInfo.GetSpellInfo()->SchoolMask)) continue; // Max Amount can be absorbed by this aura @@ -1908,10 +1899,10 @@ void Unit::CalcHealAbsorb(Unit* victim, SpellInfo const* healSpell, uint32 &heal // currentAbsorb - damage can be absorbed by shield // If need absorb less damage - if (RemainingHeal < currentAbsorb) - currentAbsorb = RemainingHeal; + if (healing < currentAbsorb + absorbAmount) + currentAbsorb = healing - absorbAmount; - RemainingHeal -= currentAbsorb; + absorbAmount += currentAbsorb; // Reduce shield amount (*i)->SetAmount((*i)->GetAmount() - currentAbsorb); @@ -1929,19 +1920,19 @@ void Unit::CalcHealAbsorb(Unit* victim, SpellInfo const* healSpell, uint32 &heal ++i; if (auraEff->GetAmount() <= 0) { - uint32 removedAuras = victim->m_removedAurasCount; + uint32 removedAuras = healInfo.GetTarget()->m_removedAurasCount; auraEff->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL); - if (removedAuras+1 < victim->m_removedAurasCount) + if (removedAuras + 1 < healInfo.GetTarget()->m_removedAurasCount) i = vHealAbsorb.begin(); } } } - absorb = RemainingHeal > 0 ? (healAmount - RemainingHeal) : healAmount; - healAmount = RemainingHeal; + if (absorbAmount > 0) + healInfo.AbsorbHeal(absorbAmount); } -void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool extra) +void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extra) { if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return; @@ -1975,8 +1966,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext DealDamageMods(victim, damageInfo.damage, &damageInfo.absorb); SendAttackStateUpdate(&damageInfo); - //TriggerAurasProcOnEvent(damageInfo); - ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType); + TriggerAurasProcOnEvent(damageInfo); DealMeleeDamage(&damageInfo, true); @@ -2027,7 +2017,6 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA damageInfo.procAttacker = PROC_FLAG_NONE; damageInfo.procVictim = PROC_FLAG_NONE; - damageInfo.procEx = PROC_EX_NONE; damageInfo.hitOutCome = MELEE_HIT_NORMAL; SendAttackStateUpdate(&damageInfo); @@ -2546,7 +2535,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo // Spellmod from SPELLMOD_RESIST_MISS_CHANCE if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_MISS_CHANCE, modHitChance); + modOwner->ApplySpellMod(spellInfo->Id, modHitChance); // Spells with SPELL_ATTR3_IGNORE_HIT_RESULT will ignore target's avoidance effects if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) @@ -2626,12 +2615,9 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo for (Unit::AuraEffectList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i) if ((*i)->GetMiscValue() & spellInfo->GetSchoolMask()) reflectchance += (*i)->GetAmount(); + if (reflectchance > 0 && roll_chance_i(reflectchance)) - { - // Start triggers for remove charges if need (trigger only for victim, and mark as active spell) - ProcDamageAndSpell(victim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_REFLECT, 1, BASE_ATTACK, spellInfo); return SPELL_MISS_REFLECT; - } } switch (spellInfo->DmgClass) @@ -5062,15 +5048,16 @@ void Unit::SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damag SendSpellNonMeleeDamageLog(&log); } -void Unit::ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellInfo const* procSpell, SpellInfo const* procAura) +void Unit::ProcSkillsAndAuras(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo) { - // Not much to do if no flags are set. - if (procAttacker) - ProcDamageAndSpellFor(false, victim, procAttacker, procExtra, attType, procSpell, amount, procAura); - // Now go on with a victim's events'n'auras - // Not much to do if no flags are set or there is no victim - if (victim && victim->IsAlive() && procVictim) - victim->ProcDamageAndSpellFor(true, this, procVictim, procExtra, attType, procSpell, amount, procAura); + WeaponAttackType attType = damageInfo ? damageInfo->GetAttackType() : BASE_ATTACK; + if (typeMaskActor && CanProc()) + ProcSkillsAndReactives(false, actionTarget, typeMaskActor, hitMask, attType); + + if (typeMaskActionTarget && actionTarget && actionTarget->CanProc()) + actionTarget->ProcSkillsAndReactives(true, this, typeMaskActionTarget, hitMask, attType); + + TriggerAurasProcOnEvent(actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); } void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo) @@ -5235,7 +5222,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType SendAttackStateUpdate(&dmgInfo); } -bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 /*procEx*/, uint32 cooldown) +/*bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) { // Get triggered aura spell info SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); @@ -5257,18 +5244,6 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - /* Try handle unknown trigger spells or with invalid power amount or misc value - if (sSpellMgr->GetSpellInfo(trigger_spell_id) == NULL || powerAmountRequired == NULL || powerRequired >= MAX_POWER) - { - switch (auraSpellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - break; - } - } - }*/ - // All ok. Check current trigger spell SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id); if (triggerEntry == NULL) @@ -5360,2242 +5335,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe ToPlayer()->GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown)); return true; -} - -//victim may be NULL -bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown) -{ - SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); - uint32 effIndex = triggeredByAura->GetEffIndex(); - int32 triggerAmount = triggeredByAura->GetAmount(); - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - Unit* target = victim; - int32 basepoints0 = 0; - ObjectGuid originalCaster; - - switch (dummySpell->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - switch (dummySpell->Id) - { - // Unstable Power - case 24658: - { - if (!procSpell || procSpell->Id == 24659) - return false; - // Need remove one 24659 aura - RemoveAuraFromStack(24659); - return true; - } - // Restless Strength - case 24661: - { - // Need remove one 24662 aura - RemoveAuraFromStack(24662); - return true; - } - // Mark of Malice - case 33493: - { - // Cast finish spell at last charge - if (triggeredByAura->GetBase()->GetCharges() > 1) - return false; - - target = this; - triggered_spell_id = 33494; - break; - } - // Twisted Reflection (boss spell) - case 21063: - triggered_spell_id = 21064; - break; - // Vampiric Aura (boss spell) - case 38196: - { - basepoints0 = 3 * damage; // 300% - if (basepoints0 < 0) - return false; - - triggered_spell_id = 31285; - target = this; - break; - } - // Aura of Madness (Darkmoon Card: Madness trinket) - //===================================================== - // 39511 Sociopath: +35 strength (Paladin, Rogue, Druid, Warrior) - // 40997 Delusional: +70 attack power (Rogue, Hunter, Paladin, Warrior, Druid) - // 40998 Kleptomania: +35 agility (Warrior, Rogue, Paladin, Hunter, Druid) - // 40999 Megalomania: +41 damage/healing (Druid, Shaman, Priest, Warlock, Mage, Paladin) - // 41002 Paranoia: +35 spell/melee/ranged crit strike rating (All classes) - // 41005 Manic: +35 haste (spell, melee and ranged) (All classes) - // 41009 Narcissism: +35 intellect (Druid, Shaman, Priest, Warlock, Mage, Paladin, Hunter) - // 41011 Martyr Complex: +35 stamina (All classes) - // 41406 Dementia: Every 5 seconds either gives you +5% damage/healing. (Druid, Shaman, Priest, Warlock, Mage, Paladin) - // 41409 Dementia: Every 5 seconds either gives you -5% damage/healing. (Druid, Shaman, Priest, Warlock, Mage, Paladin) - case 39446: - { - if (GetTypeId() != TYPEID_PLAYER || !IsAlive()) - return false; - - // Select class defined buff - switch (getClass()) - { - case CLASS_PALADIN: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 - case CLASS_DRUID: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 - triggered_spell_id = RAND(39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409); - break; - case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011 - case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011 - case CLASS_DEATH_KNIGHT: - triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011); - break; - case CLASS_PRIEST: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 - case CLASS_SHAMAN: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 - case CLASS_MAGE: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 - case CLASS_WARLOCK: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 - triggered_spell_id = RAND(40999, 41002, 41005, 41009, 41011, 41406, 41409); - break; - case CLASS_HUNTER: // 40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409 - triggered_spell_id = RAND(40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409); - break; - default: - return false; - } - - target = this; - if (roll_chance_i(10)) - ToPlayer()->Say("This is Madness!", LANG_UNIVERSAL); /// @todo It should be moved to database, shouldn't it? - break; - } - // Sunwell Exalted Caster Neck (??? neck) - // cast ??? Light's Wrath if Exalted by Aldor - // cast ??? Arcane Bolt if Exalted by Scryers - case 46569: - return false; // old unused version - // Sunwell Exalted Caster Neck (Shattered Sun Pendant of Acumen neck) - // cast 45479 Light's Wrath if Exalted by Aldor - // cast 45429 Arcane Bolt if Exalted by Scryers - case 45481: - { - Player* player = ToPlayer(); - if (!player) - return false; - - // Get Aldor reputation rank - if (player->GetReputationRank(932) == REP_EXALTED) - { - target = this; - triggered_spell_id = 45479; - break; - } - // Get Scryers reputation rank - if (player->GetReputationRank(934) == REP_EXALTED) - { - // triggered at positive/self casts also, current attack target used then - if (target && IsFriendlyTo(target)) - { - target = GetVictim(); - if (!target) - { - target = player->GetSelectedUnit(); - if (!target) - return false; - } - if (IsFriendlyTo(target)) - return false; - } - - triggered_spell_id = 45429; - break; - } - return false; - } - // Sunwell Exalted Melee Neck (Shattered Sun Pendant of Might neck) - // cast 45480 Light's Strength if Exalted by Aldor - // cast 45428 Arcane Strike if Exalted by Scryers - case 45482: - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - // Get Aldor reputation rank - if (ToPlayer()->GetReputationRank(932) == REP_EXALTED) - { - target = this; - triggered_spell_id = 45480; - break; - } - // Get Scryers reputation rank - if (ToPlayer()->GetReputationRank(934) == REP_EXALTED) - { - triggered_spell_id = 45428; - break; - } - return false; - } - // Sunwell Exalted Tank Neck (Shattered Sun Pendant of Resolve neck) - // cast 45431 Arcane Insight if Exalted by Aldor - // cast 45432 Light's Ward if Exalted by Scryers - case 45483: - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - // Get Aldor reputation rank - if (ToPlayer()->GetReputationRank(932) == REP_EXALTED) - { - target = this; - triggered_spell_id = 45432; - break; - } - // Get Scryers reputation rank - if (ToPlayer()->GetReputationRank(934) == REP_EXALTED) - { - target = this; - triggered_spell_id = 45431; - break; - } - return false; - } - // Sunwell Exalted Healer Neck (Shattered Sun Pendant of Restoration neck) - // cast 45478 Light's Salvation if Exalted by Aldor - // cast 45430 Arcane Surge if Exalted by Scryers - case 45484: - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - // Get Aldor reputation rank - if (ToPlayer()->GetReputationRank(932) == REP_EXALTED) - { - target = this; - triggered_spell_id = 45478; - break; - } - // Get Scryers reputation rank - if (ToPlayer()->GetReputationRank(934) == REP_EXALTED) - { - triggered_spell_id = 45430; - break; - } - 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: - { - triggered_spell_id = 52724; - basepoints0 = damage / 2; - 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< RandomSpells; - switch (getClass()) - { - case CLASS_WARRIOR: - case CLASS_PALADIN: - case CLASS_DEATH_KNIGHT: - RandomSpells.push_back(71484); - RandomSpells.push_back(71491); - RandomSpells.push_back(71492); - break; - case CLASS_SHAMAN: - case CLASS_ROGUE: - RandomSpells.push_back(71486); - RandomSpells.push_back(71485); - RandomSpells.push_back(71492); - break; - case CLASS_DRUID: - RandomSpells.push_back(71484); - RandomSpells.push_back(71485); - RandomSpells.push_back(71492); - break; - case CLASS_HUNTER: - RandomSpells.push_back(71486); - RandomSpells.push_back(71491); - RandomSpells.push_back(71485); - break; - default: - return false; - } - if (RandomSpells.empty()) // shouldn't happen - return false; - - uint8 rand_spell = urand(0, (RandomSpells.size() - 1)); - CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); - break; - } - case 71562: // Deathbringer's Will Heroic - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - std::vector RandomSpells; - switch (getClass()) - { - case CLASS_WARRIOR: - case CLASS_PALADIN: - case CLASS_DEATH_KNIGHT: - RandomSpells.push_back(71561); - RandomSpells.push_back(71559); - RandomSpells.push_back(71560); - break; - case CLASS_SHAMAN: - case CLASS_ROGUE: - RandomSpells.push_back(71558); - RandomSpells.push_back(71556); - RandomSpells.push_back(71560); - break; - case CLASS_DRUID: - RandomSpells.push_back(71561); - RandomSpells.push_back(71556); - RandomSpells.push_back(71560); - break; - case CLASS_HUNTER: - RandomSpells.push_back(71558); - RandomSpells.push_back(71559); - RandomSpells.push_back(71556); - break; - default: - return false; - } - if (RandomSpells.empty()) // shouldn't happen - return false; - - uint8 rand_spell = urand(0, (RandomSpells.size() - 1)); - CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); - break; - } - case 65032: // Boom aura (321 Boombot) - { - if (victim->GetEntry() != 33343) // Scrapbot - return false; - - InstanceScript* instance = GetInstanceScript(); - if (!instance) - return false; - - instance->DoCastSpellOnPlayers(65037); // Achievement criteria marker - break; - } - case 47020: // Enter vehicle XT-002 (Scrapbot) - { - if (GetTypeId() != TYPEID_UNIT) - return false; - - Unit* vehicleBase = GetVehicleBase(); - if (!vehicleBase) - return false; - - // Todo: Check if this amount is blizzlike - vehicleBase->ModifyHealth(int32(vehicleBase->CountPctFromMaxHealth(1))); - break; - } - } - break; - } - 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; - } - } - case SPELLFAMILY_WARLOCK: - { - // Seed of Corruption - if (dummySpell->SpellFamilyFlags[1] & 0x00000010) - { - if (procSpell && procSpell->SpellFamilyFlags[1] & 0x8000) - return false; - // if damage is more than need or target die from damage deal finish spell - if (triggeredByAura->GetAmount() <= int32(damage) || GetHealth() <= damage) - { - // remember caster before aura delete - Unit* caster = triggeredByAura->GetCaster(); - - // Remove aura (before cast for prevent infinite loop handlers) - RemoveAurasDueToSpell(triggeredByAura->GetId()); - - uint32 spell = sSpellMgr->GetSpellWithRank(27285, dummySpell->GetRank()); - - // Cast finish spell (triggeredByAura already not exist!) - if (caster) - caster->CastSpell(this, spell, true, castItem); - return true; // no hidden cooldown - } - - // Damage counting - triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage); - return true; - } - // Seed of Corruption (Mobs cast) - no die req - if (dummySpell->SpellFamilyFlags.IsEqual(0, 0, 0) && dummySpell->SpellIconID == 1932) - { - // if damage is more than need deal finish spell - if (triggeredByAura->GetAmount() <= int32(damage)) - { - // remember caster before aura delete - Unit* caster = triggeredByAura->GetCaster(); - - // Remove aura (before cast for prevent infinite loop handlers) - RemoveAurasDueToSpell(triggeredByAura->GetId()); - - // Cast finish spell (triggeredByAura already not exist!) - if (caster) - caster->CastSpell(this, 32865, true, castItem); - return true; // no hidden cooldown - } - // Damage counting - triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage); - return true; - } - switch (dummySpell->Id) - { - // Shadowflame (Voidheart Raiment set bonus) - case 37377: - { - triggered_spell_id = 37379; - break; - } - // Pet Healing (Corruptor Raiment or Rift Stalker Armor) - case 37381: - { - target = GetGuardianPet(); - if (!target) - return false; - - // heal amount - basepoints0 = CalculatePct(int32(damage), triggerAmount); - triggered_spell_id = 37382; - break; - } - // Shadowflame Hellfire (Voidheart Raiment set bonus) - case 39437: - { - triggered_spell_id = 37378; - break; - } - } - break; - } - case SPELLFAMILY_PRIEST: - { - switch (dummySpell->Id) - { - // Priest Tier 6 Trinket (Ashtongue Talisman of Acumen) - case 40438: - { - // Shadow Word: Pain - if (!procSpell) - return false; - else if (procSpell->SpellFamilyFlags[0] & 0x8000) - triggered_spell_id = 40441; - // Renew - else if (procSpell->SpellFamilyFlags[0] & 0x40) - triggered_spell_id = 40440; - else - return false; - - target = this; - break; - } - // Oracle Healing Bonus ("Garments of the Oracle" set) - case 26169: - { - // heal amount - basepoints0 = int32(CalculatePct(damage, 10)); - target = this; - triggered_spell_id = 26170; - break; - } - // Frozen Shadoweave (Shadow's Embrace set) warning! its not only priest set - case 39372: - { - if (!procSpell || (procSpell->GetSchoolMask() & (SPELL_SCHOOL_MASK_FROST | SPELL_SCHOOL_MASK_SHADOW)) == 0) - return false; - - // heal amount - basepoints0 = CalculatePct(int32(damage), triggerAmount); - target = this; - triggered_spell_id = 39373; - break; - } - // Greater Heal (Vestments of Faith (Priest Tier 3) - 4 pieces bonus) - case 28809: - { - triggered_spell_id = 28810; - break; - } - // Priest T10 Healer 2P Bonus - case 70770: - // Flash Heal - if (procSpell && procSpell->SpellFamilyFlags[0] & 0x800) - { - triggered_spell_id = 70772; - SpellInfo const* blessHealing = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!blessHealing) - return false; - basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude)); - } - break; - } - break; - } - case SPELLFAMILY_DRUID: - { - 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, 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; - if (triggeredByAura->GetCasterGUID() != GetGUID()) - break; - int32 basepoints1 = CalculatePct(GetMaxPower(Powers(POWER_MANA)), triggerAmount * 2); - // Improved Leader of the Pack - // Check cooldown of heal spell cooldown - if (!GetSpellHistory()->HasCooldown(34299)) - CastCustomSpell(this, 68285, &basepoints1, 0, 0, true, 0, triggeredByAura); - break; - } - // Healing Touch (Dreamwalker Raiment set) - case 28719: - { - if (procSpell) - { - // mana back - basepoints0 = int32(CalculatePct(procSpell->ManaCost, 30)); - target = this; - triggered_spell_id = 28742; - } - break; - } - // Healing Touch Refund (Idol of Longevity trinket) - case 28847: - { - target = this; - triggered_spell_id = 28848; - break; - } - // Mana Restore (Malorne Raiment set / Malorne Regalia set) - case 37288: - case 37295: - { - target = this; - triggered_spell_id = 37238; - break; - } - // Druid Tier 6 Trinket - case 40442: - { - float chance; - - if (!procSpell) - return false; - // Starfire - else if (procSpell->SpellFamilyFlags[0] & 0x4) - { - triggered_spell_id = 40445; - chance = 25.0f; - } - // Rejuvenation - else if (procSpell->SpellFamilyFlags[0] & 0x10) - { - triggered_spell_id = 40446; - chance = 25.0f; - } - // Mangle (Bear) and Mangle (Cat) - else if (procSpell->SpellFamilyFlags[1] & 0x00000440) - { - triggered_spell_id = 40452; - chance = 40.0f; - } - else - return false; - - if (!roll_chance_f(chance)) - return false; - - target = this; - break; - } - // Item - Druid T10 Balance 4P Bonus - case 70723: - { - // Wrath & Starfire - if (procSpell && (procSpell->SpellFamilyFlags[0] & 0x5) && (procEx & PROC_EX_CRITICAL_HIT)) - { - triggered_spell_id = 71023; - SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!triggeredSpell) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); - // Add remaining ticks to damage done - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - } - break; - } - // Item - Druid T10 Restoration 4P Bonus (Rejuvenation) - case 70664: - { - // Proc only from normal Rejuvenation - if (!procSpell || procSpell->SpellVisual[0] != 32) - return false; - - Player* caster = ToPlayer(); - if (!caster) - return false; - if (!caster->GetGroup() && victim == this) - return false; - - CastCustomSpell(70691, SPELLVALUE_BASE_POINT0, damage, victim, true); - return true; - } - } - break; - } - 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 = Milliseconds(aurEff->GetAmount()); - - target = this; - break; - } - // Holy Power (Redemption Armor set) - case 28789: - { - if (!victim) - return false; - - // Set class defined buff - switch (victim->getClass()) - { - case CLASS_PALADIN: - case CLASS_PRIEST: - case CLASS_SHAMAN: - case CLASS_DRUID: - triggered_spell_id = 28795; // Increases the friendly target's mana regeneration by $s1 per 5 sec. for $d. - break; - case CLASS_MAGE: - case CLASS_WARLOCK: - triggered_spell_id = 28793; // Increases the friendly target's spell damage and healing by up to $s1 for $d. - break; - case CLASS_HUNTER: - case CLASS_ROGUE: - triggered_spell_id = 28791; // Increases the friendly target's attack power by $s1 for $d. - break; - case CLASS_WARRIOR: - triggered_spell_id = 28790; // Increases the friendly target's armor - break; - default: - return false; - } - break; - } - case 31801: - { - if (effIndex != 0) // effect 2 used by seal unleashing code - return false; - - // At melee attack or Hammer of the Righteous spell damage considered as melee attack - bool stacker = !procSpell || procSpell->Id == 53595; - // spells with SPELL_DAMAGE_CLASS_MELEE excluding Judgements - bool damager = procSpell && (procSpell->EquippedItemClass != -1 || (procSpell->SpellIconID == 243 && procSpell->SpellVisual[0] == 39)); - - if (!stacker && !damager) - return false; - - triggered_spell_id = 31803; - - // On target with 5 stacks of Censure direct damage is done - if (Aura* aur = victim->GetAura(triggered_spell_id, GetGUID())) - { - if (aur->GetStackAmount() == 5) - { - if (stacker) - aur->RefreshDuration(); - CastSpell(victim, 42463, true); - return true; - } - } - - if (!stacker) - return false; - break; - } - // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) - case 40470: - { - if (!procSpell) - return false; - - float chance; - - // Flash of light/Holy light - if (procSpell->SpellFamilyFlags[0] & 0xC0000000) - { - triggered_spell_id = 40471; - chance = 15.0f; - } - // Judgement (any) - else if (procSpell->GetSpellSpecific() == SPELL_SPECIFIC_JUDGEMENT) - { - triggered_spell_id = 40472; - chance = 50.0f; - } - else - return false; - - if (!roll_chance_f(chance)) - return false; - - break; - } - // Item - Paladin T8 Holy 2P Bonus - case 64890: - { - triggered_spell_id = 64891; - basepoints0 = triggerAmount * damage / 300; - break; - } - case 71406: // Tiny Abomination in a Jar - case 71545: // Tiny Abomination in a Jar (Heroic) - { - if (!victim || !victim->IsAlive()) - return false; - - CastSpell(this, 71432, true, NULL, triggeredByAura); - - Aura const* dummy = GetAura(71432); - if (!dummy || dummy->GetStackAmount() < (dummySpell->Id == 71406 ? 8 : 7)) - return false; - - RemoveAurasDueToSpell(71432); - triggered_spell_id = 71433; // default main hand attack - // roll if offhand - if (Player const* player = ToPlayer()) - if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1)) - triggered_spell_id = 71434; - target = victim; - break; - } - // Item - Icecrown 25 Normal Dagger Proc - case 71880: - { - switch (getPowerType()) - { - case POWER_MANA: - triggered_spell_id = 71881; - break; - case POWER_RAGE: - triggered_spell_id = 71883; - break; - case POWER_ENERGY: - triggered_spell_id = 71882; - break; - case POWER_RUNIC_POWER: - triggered_spell_id = 71884; - break; - default: - return false; - } - break; - } - // Item - Icecrown 25 Heroic Dagger Proc - case 71892: - { - switch (getPowerType()) - { - case POWER_MANA: - triggered_spell_id = 71888; - break; - case POWER_RAGE: - triggered_spell_id = 71886; - break; - case POWER_ENERGY: - triggered_spell_id = 71887; - break; - case POWER_RUNIC_POWER: - triggered_spell_id = 71885; - break; - default: - return false; - } - break; - } - } - break; - } - case SPELLFAMILY_SHAMAN: - { - switch (dummySpell->Id) - { - // Totemic Power (The Earthshatterer set) - case 28823: - { - if (!victim) - return false; - - // Set class defined buff - switch (victim->getClass()) - { - case CLASS_PALADIN: - case CLASS_PRIEST: - case CLASS_SHAMAN: - case CLASS_DRUID: - triggered_spell_id = 28824; // Increases the friendly target's mana regeneration by $s1 per 5 sec. for $d. - break; - case CLASS_MAGE: - case CLASS_WARLOCK: - triggered_spell_id = 28825; // Increases the friendly target's spell damage and healing by up to $s1 for $d. - break; - case CLASS_HUNTER: - case CLASS_ROGUE: - triggered_spell_id = 28826; // Increases the friendly target's attack power by $s1 for $d. - break; - case CLASS_WARRIOR: - triggered_spell_id = 28827; // Increases the friendly target's armor - break; - default: - return false; - } - 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; - - if (triggeredByAura->GetBase() && castItem->GetGUID() != triggeredByAura->GetBase()->GetCastItemGUID()) - return false; - - WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); - 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->spellid[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 - triggeredByAura->GetBase()->AddProcCooldown(std::chrono::steady_clock::now() + cooldown); - cooldown = Milliseconds::zero(); - - // 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: - { - if (!procSpell) - return false; - - float chance; - if (procSpell->SpellFamilyFlags[0] & 0x1) - { - triggered_spell_id = 40465; // Lightning Bolt - chance = 15.0f; - } - else if (procSpell->SpellFamilyFlags[0] & 0x80) - { - triggered_spell_id = 40465; // Lesser Healing Wave - chance = 10.0f; - } - else if (procSpell->SpellFamilyFlags[1] & 0x00000010) - { - triggered_spell_id = 40466; // Stormstrike - chance = 50.0f; - } - else - return false; - - if (!roll_chance_f(chance)) - return false; - - target = this; - break; - } - // Spirit Hunt - case 58877: - { - // Cast on owner - target = GetOwner(); - if (!target) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount); - triggered_spell_id = 58879; - // Cast on spirit wolf - CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); - break; - } - // Shaman T8 Elemental 4P Bonus - case 64928: - { - basepoints0 = CalculatePct(int32(damage), triggerAmount); - triggered_spell_id = 64930; // Electrified - break; - } - // Shaman T9 Elemental 4P Bonus - case 67228: - { - // Lava Burst - if (procSpell && procSpell->SpellFamilyFlags[1] & 0x1000) - { - triggered_spell_id = 71824; - SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!triggeredSpell) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); - } - break; - } - // Item - Shaman T10 Restoration 4P Bonus - case 70808: - { - // Chain Heal - if (procSpell && (procSpell->SpellFamilyFlags[0] & 0x100) && (procEx & PROC_EX_CRITICAL_HIT)) - { - triggered_spell_id = 70809; - SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!triggeredSpell) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); - // Add remaining ticks to healing done - basepoints0 += GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL); - } - break; - } - // Item - Shaman T10 Elemental 4P Bonus - case 70817: - { - if (!target) - return false; - // try to find spell Flame Shock on the target - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0x0, 0x0, GetGUID())) - { - Aura* flameShock = aurEff->GetBase(); - int32 maxDuration = flameShock->GetMaxDuration(); - int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetAmplitude(); - - flameShock->SetDuration(newDuration); - // is it blizzlike to change max duration for FS? - if (newDuration > maxDuration) - flameShock->SetMaxDuration(newDuration); - - return true; - } - // if not found Flame Shock - return false; - } - 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; - } - // Flametongue Weapon (Passive) - if (dummySpell->SpellFamilyFlags[0] & 0x200000) - { - if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->IsAlive() || !castItem || !castItem->IsEquipped()) - return false; - - WeaponAttackType attType = WeaponAttackType(Player::GetAttackBySlot(castItem->GetSlot())); - 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; - - float fire_onhit = float(CalculatePct(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f)); - - float add_spellpower = (float)(SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) - + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE)); - - // 1.3speed = 5%, 2.6speed = 10%, 4.0 speed = 15%, so, 1.0speed = 3.84% - ApplyPct(add_spellpower, 3.84f); - - // Enchant on Off-Hand and ready? - if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) - { - float BaseWeaponSpeed = GetAttackTime(OFF_ATTACK) / 1000.0f; - - // Value1: add the tooltip damage by swingspeed + Value2: add spelldmg by swingspeed - basepoints0 = int32((fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed)); - triggered_spell_id = 10444; - } - - // Enchant on Main-Hand and ready? - else if (castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) - { - float BaseWeaponSpeed = GetAttackTime(BASE_ATTACK) / 1000.0f; - - // Value1: add the tooltip damage by swingspeed + Value2: add spelldmg by swingspeed - basepoints0 = int32((fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed)); - triggered_spell_id = 10444; - } - - // If not ready, we should return, shouldn't we?! - else - return false; - - CastCustomSpell(victim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - return true; - } - // Improved Water Shield - if (dummySpell->SpellIconID == 2287) - { - // Default chance for Healing Wave and Riptide - float chance = (float)triggeredByAura->GetAmount(); - - if (!procSpell) - return false; //This is the same than putting chance *= 0.0f; - else if (procSpell->SpellFamilyFlags[0] & 0x80) - // Lesser Healing Wave - 0.6 of default - chance *= 0.6f; - else if (procSpell->SpellFamilyFlags[0] & 0x100) - // Chain heal - 0.3 of default - chance *= 0.3f; - - if (!roll_chance_f(chance)) - return false; - - // Water Shield - if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0, 0x00000020, 0)) - { - uint32 spell = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; - CastSpell(this, spell, true, castItem, triggeredByAura); - return true; - } - return false; - } - // Lightning Overload - if (dummySpell->SpellIconID == 2018) // only this spell has SpellFamily Shaman SpellIconID == 2018 and dummy aura - { - if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim) - return false; - - uint32 spellId = 0; - // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost - switch (procSpell->Id) - { - // Lightning Bolt - case 403: spellId = 45284; break; // Rank 1 - case 529: spellId = 45286; break; // Rank 2 - case 548: spellId = 45287; break; // Rank 3 - case 915: spellId = 45288; break; // Rank 4 - case 943: spellId = 45289; break; // Rank 5 - case 6041: spellId = 45290; break; // Rank 6 - case 10391: spellId = 45291; break; // Rank 7 - case 10392: spellId = 45292; break; // Rank 8 - case 15207: spellId = 45293; break; // Rank 9 - case 15208: spellId = 45294; break; // Rank 10 - case 25448: spellId = 45295; break; // Rank 11 - case 25449: spellId = 45296; break; // Rank 12 - case 49237: spellId = 49239; break; // Rank 13 - case 49238: spellId = 49240; break; // Rank 14 - // Chain Lightning - case 421: spellId = 45297; break; // Rank 1 - case 930: spellId = 45298; break; // Rank 2 - case 2860: spellId = 45299; break; // Rank 3 - case 10605: spellId = 45300; break; // Rank 4 - case 25439: spellId = 45301; break; // Rank 5 - case 25442: spellId = 45302; break; // Rank 6 - case 49270: spellId = 49268; break; // Rank 7 - case 49271: spellId = 49269; break; // Rank 8 - default: - TC_LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); - return false; - } - - // Chain Lightning - if (procSpell->SpellFamilyFlags[0] & 0x2) - { - // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit. - // A maxed LO would have a 33% / 3 = 11% chance to proc of each target. - // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets] - float chance = 100.0f / procSpell->Effects[effIndex].ChainTarget; - if (!roll_chance_f(chance)) - return false; - } - - CastSpell(victim, spellId, true, castItem, triggeredByAura); - return true; - } - // Static Shock - if (dummySpell->SpellIconID == 3059) - { - // Lightning Shield - if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) - { - uint32 spell = 26364; - - // custom cooldown processing case - if (GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(spell)) - GetSpellHistory()->ResetCooldown(spell); - - CastSpell(target, spell, true, castItem, triggeredByAura); - return true; - } - return false; - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Blood-Caked Blade - if (dummySpell->SpellIconID == 138) - { - if (!target || !target->IsAlive()) - return false; - - triggered_spell_id = dummySpell->Effects[effIndex].TriggerSpell; - break; - } - // Dancing Rune Weapon - if (dummySpell->Id == 49028) - { - // 1 dummy aura for dismiss rune blade - if (effIndex != 1) - return false; - - Unit* pPet = NULL; - for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) // Find Rune Weapon - if ((*itr)->GetEntry() == 27893) - { - pPet = *itr; - break; - } - - if (pPet && pPet->GetVictim() && damage && procSpell) - { - uint32 procDmg = damage / 2; - pPet->SendSpellNonMeleeDamageLog(pPet->GetVictim(), procSpell->Id, procDmg, procSpell->GetSchoolMask(), 0, 0, false, 0, false); - pPet->DealDamage(pPet->GetVictim(), procDmg, NULL, SPELL_DIRECT_DAMAGE, procSpell->GetSchoolMask(), procSpell, true); - break; - } - else - return false; - } - // Unholy Blight - if (dummySpell->Id == 49194) - { - triggered_spell_id = 50536; - SpellInfo const* unholyBlight = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!unholyBlight) - return false; - - basepoints0 = CalculatePct(int32(damage), triggerAmount); - - //Glyph of Unholy Blight - if (AuraEffect* glyph=GetAuraEffect(63332, 0)) - AddPct(basepoints0, glyph->GetAmount()); - - basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude); - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - break; - } - // Threat of Thassarian - if (dummySpell->SpellIconID == 2023) - { - // Must Dual Wield - if (!procSpell || !haveOffhandWeapon()) - return false; - // Chance as basepoints for dummy aura - if (!roll_chance_i(triggerAmount)) - return false; - - switch (procSpell->Id) - { - case 49020: triggered_spell_id = 66198; break; // Obliterate - 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; - } - break; - } - // Runic Power Back on Snare/Root - if (dummySpell->Id == 61257) - { - // only for spells and hit/crit (trigger start always) and not start from self cast spells - if (!procSpell || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) - return false; - // Need snare or root mechanic - if (procSpell && !(procSpell->GetAllEffectsMechanicMask() & ((1<SpellIconID) - { - // Guard Dog - case 201: - { - if (!victim || !procSpell) - return false; - - triggered_spell_id = 54445; - target = this; - float addThreat = float(CalculatePct(procSpell->Effects[0].CalcValue(this), triggerAmount)); - victim->AddThreat(this, addThreat); - break; - } - // Silverback - case 1582: - triggered_spell_id = dummySpell->Id == 62765 ? 62801 : 62800; - target = this; - break; - } - break; - } - default: - break; - } - - // if not handled by custom case, get triggered spell from dummySpell proto - if (!triggered_spell_id) - triggered_spell_id = dummySpell->Effects[triggeredByAura->GetEffIndex()].TriggerSpell; - - // processed charge only counting case - if (!triggered_spell_id) - return true; - - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!triggerEntry) - { - TC_LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id); - return false; - } - - if (basepoints0) - CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura, originalCaster); - else - CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster); - - return true; -} - - /* - */ - - -// Used in case when access to whole aura is needed -// All procs should be handled like this... -bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, bool* handled) -{ - SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); - - switch (dummySpell->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - switch (dummySpell->Id) - { - // Nevermelting Ice Crystal - case 71564: - RemoveAuraFromStack(71564); - *handled = true; - break; - // Gaseous Bloat - case 70672: - case 72455: - case 72832: - case 72833: - { - *handled = true; - uint32 stack = triggeredByAura->GetStackAmount(); - int32 const mod = (GetMap()->GetSpawnMode() & 1) ? 1500 : 1250; - int32 dmg = 0; - for (uint8 i = 1; i <= stack; ++i) - dmg += mod * i; - if (Unit* caster = triggeredByAura->GetCaster()) - caster->CastCustomSpell(70701, SPELLVALUE_BASE_POINT0, dmg); - break; - } - // Ball of Flames Proc - case 71756: - case 72782: - case 72783: - case 72784: - RemoveAuraFromStack(dummySpell->Id); - *handled = true; - break; - // Discerning Eye of the Beast - case 59915: - { - CastSpell(this, 59914, true); // 59914 already has correct basepoints in DBC, no need for custom bp - *handled = true; - break; - } - // Swift Hand of Justice - case 59906: - { - int32 bp0 = CalculatePct(GetMaxHealth(), dummySpell->Effects[EFFECT_0]. CalcValue()); - CastCustomSpell(this, 59913, &bp0, NULL, NULL, true); - *handled = true; - break; - } - } - - break; - case SPELLFAMILY_PALADIN: - { - // Judgements of the Just - if (dummySpell->SpellIconID == 3015) - { - *handled = true; - CastSpell(victim, 68055, true); - return true; - } - // Glyph of Divinity - else if (dummySpell->Id == 54939) - { - if (!procSpell) - return false; - *handled = true; - // Check if we are the target and prevent mana gain - if (victim && triggeredByAura->GetCasterGUID() == victim->GetGUID()) - return false; - // Lookup base amount mana restore - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++) - { - if (procSpell->Effects[i].Effect == SPELL_EFFECT_ENERGIZE) - { - // value multiplied by 2 because you should get twice amount - int32 mana = procSpell->Effects[i].CalcValue() * 2; - CastCustomSpell(this, 54986, 0, &mana, NULL, true); - } - } - return true; - } - break; - } - case SPELLFAMILY_MAGE: - { - switch (dummySpell->Id) - { - // Empowered Fire - case 31656: - case 31657: - case 31658: - { - *handled = true; - - SpellInfo const* spInfo = sSpellMgr->GetSpellInfo(67545); - if (!spInfo) - return false; - - int32 bp0 = int32(CalculatePct(GetCreateMana(), spInfo->Effects[0].CalcValue())); - CastCustomSpell(this, 67545, &bp0, NULL, NULL, true, NULL, triggeredByAura->GetEffect(EFFECT_0), GetGUID()); - return true; - } - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Blood of the North - // Reaping - // Death Rune Mastery - /// @todo move those to spell scripts - if (dummySpell->SpellIconID == 3041 || (dummySpell->SpellIconID == 22 && dummySpell->Id != 62459) || dummySpell->SpellIconID == 2622) - { - *handled = true; - // Convert recently used Blood Rune to Death Rune - if (Player* player = ToPlayer()) - { - if (player->getClass() != CLASS_DEATH_KNIGHT) - return false; - - RuneType rune = ToPlayer()->GetLastUsedRune(); - // can't proc from death rune use - if (rune == RUNE_DEATH) - return false; - AuraEffect* aurEff = triggeredByAura->GetEffect(EFFECT_0); - if (!aurEff) - return false; - - // Reset amplitude - set death rune remove timer to 30s - aurEff->ResetPeriodic(true); - uint32 runesLeft; - - if (dummySpell->SpellIconID == 2622) - runesLeft = 2; - else - runesLeft = 1; - - for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i) - { - if (dummySpell->SpellIconID == 2622) - { - if (player->GetCurrentRune(i) == RUNE_DEATH || - player->GetBaseRune(i) == RUNE_BLOOD) - continue; - } - else - { - if (player->GetCurrentRune(i) == RUNE_DEATH || - player->GetBaseRune(i) != RUNE_BLOOD) - continue; - } - if (player->GetRuneCooldown(i) != (player->GetRuneBaseCooldown(i) - player->GetLastRuneGraceTimer(i))) - continue; - - --runesLeft; - // Mark aura as used - player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff); - } - return true; - } - return false; - } - - switch (dummySpell->Id) - { - // Bone Shield cooldown - case 49222: - { - *handled = true; - return true; - } - } - break; - } - case SPELLFAMILY_WARRIOR: - { - switch (dummySpell->Id) - { - // Item - Warrior T10 Protection 4P Bonus - case 70844: - { - int32 basepoints0 = CalculatePct(GetMaxHealth(), dummySpell->Effects[EFFECT_1]. CalcValue()); - CastCustomSpell(this, 70845, &basepoints0, NULL, NULL, true); - 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; - } - break; - } - } - return false; -} - -bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx) -{ - // Get triggered aura spell info - SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); - - // Basepoints of trigger aura - int32 triggerAmount = triggeredByAura->GetAmount(); - - // Set trigger spell id, target, custom basepoints - uint32 trigger_spell_id = auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].TriggerSpell; - - Unit* target = NULL; - int32 basepoints0 = 0; - - if (triggeredByAura->GetAuraType() == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE) - basepoints0 = triggerAmount; - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - // Try handle unknown trigger spells - // triggered spells exists only in serverside spell_dbc - /// @todo: reverify and move these spells to spellscripts - { - switch (auraSpellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - switch (auraSpellInfo->Id) - { - case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) - // Pct value stored in dummy - basepoints0 = victim->GetCreateHealth() * auraSpellInfo->Effects[1].CalcValue() / 100; - target = victim; - break; - case 57345: // Darkmoon Card: Greatness - { - float stat = 0.0f; - // strength - if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); } - // agility - if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); } - // intellect - if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);} - // spirit - if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235; } - break; - } - case 64568: // Blood Reserve - { - if (HealthBelowPctDamaged(35, damage)) - { - CastCustomSpell(this, 64569, &triggerAmount, NULL, NULL, true); - RemoveAura(64568); - } - return false; - } - case 67702: // Death's Choice, Item - Coliseum 25 Normal Melee Trinket - { - float stat = 0.0f; - // strength - if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67708;stat = GetStat(STAT_STRENGTH); } - // agility - if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67703; } - break; - } - case 67771: // Death's Choice (heroic), Item - Coliseum 25 Heroic Melee Trinket - { - float stat = 0.0f; - // strength - if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67773;stat = GetStat(STAT_STRENGTH); } - // agility - if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67772; } - break; - } - // Mana Drain Trigger - case 27522: - case 40336: - { - // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. - if (IsAlive()) - CastSpell(this, 29471, true, castItem, triggeredByAura); - if (victim && victim->IsAlive()) - CastSpell(victim, 27526, true, castItem, triggeredByAura); - return true; - } - // Evasive Maneuvers - case 50240: - { - // Remove a Evasive Charge - Aura* charge = GetAura(50241); - if (charge && charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL)) - RemoveAurasDueToSpell(50240); - break; - } - // Battle Experience - // already handled in gunship battle script - case 71201: - return false; - } - break; - case SPELLFAMILY_DRUID: - { - switch (auraSpellInfo->Id) - { - // Druid Forms Trinket - case 37336: - { - switch (GetShapeshiftForm()) - { - case FORM_NONE: trigger_spell_id = 37344; break; - case FORM_CAT: trigger_spell_id = 37341; break; - case FORM_BEAR: trigger_spell_id = 37340; break; - case FORM_TREE: trigger_spell_id = 37342; break; - case FORM_MOONKIN: trigger_spell_id = 37343; break; - default: - return false; - } - break; - } - // Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred) - case 67353: - { - switch (GetShapeshiftForm()) - { - case FORM_CAT: trigger_spell_id = 67355; break; - case FORM_BEAR: trigger_spell_id = 67354; break; - default: - return false; - } - break; - } - default: - break; - } - break; - } - case SPELLFAMILY_HUNTER: - { - if (auraSpellInfo->SpellIconID == 3247) // Piercing Shots - { - switch (auraSpellInfo->Id) - { - case 53234: // Rank 1 - case 53237: // Rank 2 - case 53238: // Rank 3 - trigger_spell_id = 63468; - break; - default: - TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id); - return false; - } - SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id); - if (!TriggerPS) - return false; - - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude); - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - break; - } - // Item - Hunter T9 4P Bonus - if (auraSpellInfo->Id == 67151) - { - trigger_spell_id = 68130; - target = this; - break; - } - break; - } - case SPELLFAMILY_PALADIN: - { - switch (auraSpellInfo->Id) - { - // Soul Preserver - case 60510: - { - switch (getClass()) - { - case CLASS_DRUID: - trigger_spell_id = 60512; - break; - case CLASS_PALADIN: - trigger_spell_id = 60513; - break; - case CLASS_PRIEST: - trigger_spell_id = 60514; - break; - case CLASS_SHAMAN: - trigger_spell_id = 60515; - break; - } - - target = this; - break; - } - case 37657: // Lightning Capacitor - case 54841: // Thunder Capacitor - case 67712: // Item - Coliseum 25 Normal Caster Trinket - case 67758: // Item - Coliseum 25 Heroic Caster Trinket - { - if (!victim || !victim->IsAlive() || GetTypeId() != TYPEID_PLAYER) - return false; - - uint32 stack_spell_id = 0; - switch (auraSpellInfo->Id) - { - case 37657: - stack_spell_id = 37658; - trigger_spell_id = 37661; - break; - case 54841: - stack_spell_id = 54842; - trigger_spell_id = 54843; - break; - case 67712: - stack_spell_id = 67713; - trigger_spell_id = 67714; - break; - case 67758: - stack_spell_id = 67759; - trigger_spell_id = 67760; - break; - } - - CastSpell(this, stack_spell_id, true, NULL, triggeredByAura); - - Aura* dummy = GetAura(stack_spell_id); - if (!dummy || dummy->GetStackAmount() < triggerAmount) - return false; - - RemoveAurasDueToSpell(stack_spell_id); - target = victim; - break; - } - default: - break; - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Item - Death Knight T10 Melee 4P Bonus - if (auraSpellInfo->Id == 70656) - { - if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT) - return false; - - for (uint8 i = 0; i < MAX_RUNES; ++i) - if (ToPlayer()->GetRuneCooldown(i) == 0) - return false; - } - break; - } - case SPELLFAMILY_ROGUE: - { - switch (auraSpellInfo->Id) - { - // Rogue T10 2P bonus, should only proc on caster - case 70805: - { - if (victim != this) - return false; - break; - } - } - break; - } - default: - break; - } - } - - // All ok. Check current trigger spell - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id); - if (triggerEntry == NULL) - { - // Don't cast unknown spell - TC_LOG_ERROR("entities.unit.handleproctriggerspell", "Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id); - return false; - } - - // not allow proc extra attack spell at extra attack - if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) - return false; - - // Custom requirements (not listed in procEx) Warning! damage dealing after this - // 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 (procFlag & 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: - { - basepoints0 = int32(CalculatePct(damage, 15)); - target = victim; - trigger_spell_id = 26470; - break; - } - // Unyielding Knights (item exploit 29108\29109) - case 38164: - { - if (!victim || victim->GetEntry() != 19457) // Proc only if your target is Grillok - return false; - break; - } - // Deflection - case 52420: - { - if (!HealthBelowPctDamaged(35, damage)) - return false; - break; - } - - // Cheat Death - case 28845: - { - // When your health drops below 20% - if (HealthBelowPctDamaged(20, damage) || HealthBelowPct(20)) - return false; - break; - } - // Greater Heal Refund (Avatar Raiment set) - case 37594: - { - if (!victim || !victim->IsAlive()) - return false; - - // Doesn't proc if target already has full health - if (victim->IsFullHealth()) - return false; - // If your Greater Heal brings the target to full health, you gain $37595s1 mana. - if (victim->GetHealth() + damage < victim->GetMaxHealth()) - return false; - break; - } - // Bonus Healing (Crystal Spire of Karabor mace) - case 40971: - { - // If your target is below $s1% health - if (!victim || !victim->IsAlive() || victim->HealthAbovePct(triggerAmount)) - return false; - break; - } - // Decimation - case 63156: - case 63158: - // Can proc only if target has hp below 25% - if (!victim || !victim->HealthBelowPct(auraSpellInfo->Effects[EFFECT_1].CalcValue())) - return false; - break; - // Deathbringer Saurfang - Blood Beast's Blood Link - case 72176: - basepoints0 = 3; - break; - ASSERT(procSpell); - // Professor Putricide - Ooze Spell Tank Protection - case 71770: - if (victim) - victim->CastSpell(victim, trigger_spell_id, true); // EffectImplicitTarget is self - return true; - case 45057: // Evasive Maneuvers (Commendation of Kael`thas trinket) - case 71634: // Item - Icecrown 25 Normal Tank Trinket 1 - case 71640: // Item - Icecrown 25 Heroic Tank Trinket 1 - case 75475: // Item - Chamber of Aspects 25 Normal Tank Trinket - case 75481: // Item - Chamber of Aspects 25 Heroic Tank Trinket - { - // Procs only if damage takes health below $s1% - if (!HealthBelowPctDamaged(triggerAmount, damage)) - return false; - break; - } - default: - break; - } - - // Custom basepoints/target for exist spell - // dummy basepoints or other customs - switch (trigger_spell_id) - { - // Auras which should proc on area aura source (caster in this case): - // Turn the Tables - case 52914: - case 52915: - case 52910: - { - target = triggeredByAura->GetBase()->GetCaster(); - if (!target) - return false; - - target->CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); - return true; - } - // Cast positive spell on enemy target - 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 moves that add combo - case 14189: // Seal Fate (Netherblade set) - case 14157: // Ruthlessness - { - if (!victim || victim == this) - return false; - // Need add combopoint AFTER finish movie (or they dropped in finish phase) - break; - } - // Item - Druid T10 Balance 2P Bonus - case 16870: - { - if (HasAura(70718)) - CastSpell(this, 70721, true); - break; - } - // Enlightenment (trigger only from mana cost spells) - case 35095: - { - if (!procSpell || procSpell->PowerType != POWER_MANA || (procSpell->ManaCost == 0 && procSpell->ManaCostPercentage == 0 && procSpell->ManaCostPerlevel == 0)) - 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)) - if ((maelstrom->GetStackAmount() == maelstrom->GetSpellInfo()->StackAmount) && roll_chance_i(aurEff->GetAmount())) - CastSpell(this, 70831, true, castItem, triggeredByAura); - break; - } - // Astral Shift - case 52179: - { - if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) - return false; - - // Need stun, fear or silence mechanic - if (!(procSpell->GetAllEffectsMechanicMask() & ((1<GetAllEffectsMechanicMask() & ((1<SchoolMask & SPELL_SCHOOL_MASK_FROST) || !roll_chance_i(triggerAmount)) - return false; - break; - } - // Glyph of Death's Embrace - case 58679: - { - // Proc only from healing part of Death Coil. Check is essential as all Death Coil spells have 0x2000 mask in SpellFamilyFlags - if (!procSpell || !(procSpell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && procSpell->SpellFamilyFlags[0] == 0x80002000)) - 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 - if (!(procSpell->SpellFamilyFlags[0] & 0x00000001)) - 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; - } - } - - // extra attack should hit same target - if (triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) - target = victim; - - // try detect target manually if not set - if (target == NULL) - target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim; - - if (basepoints0) - CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); - - return true; -} - -bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell) -{ - int32 scriptId = triggeredByAura->GetMiscValue(); - - if (!victim || !victim->IsAlive()) - return false; - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - - 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; - default: - break; - } - - // not processed - if (!triggered_spell_id) - return false; - - // standard non-dummy case - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - - if (!triggerEntry) - { - TC_LOG_ERROR("entities.unit", "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId); - return false; - } - - CastSpell(victim, triggered_spell_id, true, castItem, triggeredByAura); - return true; -} +}*/ void Unit::setPowerType(Powers new_powertype) { @@ -8111,9 +5851,9 @@ uint32 Unit::BuildAuraStateUpdateForTarget(Unit* target) const { uint32 auraStates = GetUInt32Value(UNIT_FIELD_AURASTATE) &~(PER_CASTER_AURA_STATE_MASK); for (AuraStateAurasMap::const_iterator itr = m_auraStateAuras.begin(); itr != m_auraStateAuras.end(); ++itr) - if ((1<<(itr->first-1)) & PER_CASTER_AURA_STATE_MASK) + if ((1 << (itr->first - 1)) & PER_CASTER_AURA_STATE_MASK) if (itr->second->GetBase()->GetCasterGUID() == target->GetGUID()) - auraStates |= (1<<(itr->first-1)); + auraStates |= (1 << (itr->first - 1)); return auraStates; } @@ -8125,13 +5865,14 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co if (spellProto) { AuraEffectList const& stateAuras = Caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); - for (AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j) - if ((*j)->IsAffectingSpell(spellProto)) + for (AuraEffect const* aurEff : stateAuras) + if (aurEff->IsAffectingSpell(spellProto)) return true; } + // Check per caster aura state // If aura with aurastate by caster not found return false - if ((1<<(flag-1)) & PER_CASTER_AURA_STATE_MASK) + if ((1 << (flag - 1)) & PER_CASTER_AURA_STATE_MASK) { AuraStateAurasMapBounds range = m_auraStateAuras.equal_range(flag); for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr) @@ -8141,7 +5882,7 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co } } - return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); + return HasFlag(UNIT_FIELD_AURASTATE, 1 << (flag - 1)); } void Unit::SetOwnerGUID(ObjectGuid owner) @@ -8509,9 +6250,11 @@ void Unit::SetCharm(Unit* charm, bool apply) } } -int32 Unit::DealHeal(Unit* victim, uint32 addhealth) +void Unit::DealHeal(HealInfo& healInfo) { int32 gain = 0; + Unit* victim = healInfo.GetTarget(); + uint32 addhealth = healInfo.GetHeal(); if (victim->IsAIEnabled) victim->GetAI()->HealReceived(this, addhealth); @@ -8548,7 +6291,8 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth); } - return gain; + if (gain) + healInfo.SetEffectiveHeal(gain > 0 ? static_cast(gain) : 0UL); } bool Unit::IsMagnet() const @@ -8761,30 +6505,29 @@ void Unit::UnsummonAllTotems() } } -void Unit::SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical) +void Unit::SendHealSpellLog(HealInfo& healInfo, bool critical /*= false*/) { // we guess size WorldPacket data(SMSG_SPELLHEALLOG, 8 + 8 + 4 + 4 + 4 + 4 + 1 + 1); - data << victim->GetPackGUID(); + data << healInfo.GetTarget()->GetPackGUID(); data << GetPackGUID(); - data << uint32(SpellID); - data << uint32(Damage); - data << uint32(OverHeal); - data << uint32(Absorb); // Absorb amount + data << uint32(healInfo.GetSpellInfo()->Id); + data << uint32(healInfo.GetHeal()); + data << uint32(healInfo.GetHeal() - healInfo.GetEffectiveHeal()); + data << uint32(healInfo.GetAbsorb()); // Absorb amount data << uint8(critical ? 1 : 0); data << uint8(0); // unused SendMessageToSet(&data, true); } -int32 Unit::HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical) +int32 Unit::HealBySpell(HealInfo& healInfo, bool critical /*= false*/) { - uint32 absorb = 0; // calculate heal absorb and reduce healing - CalcHealAbsorb(victim, spellInfo, addHealth, absorb); + CalcHealAbsorb(healInfo); - int32 gain = DealHeal(victim, addHealth); - SendHealSpellLog(victim, spellInfo->Id, addHealth, uint32(addHealth - gain), absorb, critical); - return gain; + DealHeal(healInfo); + SendHealSpellLog(healInfo, critical); + return healInfo.GetEffectiveHeal(); } void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellId, int32 damage, Powers powerType) @@ -8954,7 +6697,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + modOwner->ApplySpellMod(spellProto->Id, coeff); coeff /= 100.0f; } DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); @@ -8964,7 +6707,12 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype)); // apply spellmod to Done damage (flat and pct) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage); + { + if (damagetype == DOT) + modOwner->ApplySpellMod(spellProto->Id, tmpDamage); + else + modOwner->ApplySpellMod(spellProto->Id, tmpDamage); + } return uint32(std::max(tmpDamage, 0.0f)); } @@ -9222,7 +6970,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + modOwner->ApplySpellMod(spellProto->Id, coeff); coeff /= 100.0f; } TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); @@ -9369,12 +7117,12 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto break; case 7917: // Glyph of Shadowburn if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) - crit_chance+=(*i)->GetAmount(); + crit_chance += (*i)->GetAmount(); break; case 7997: // Renewed Hope case 7998: if (victim->HasAura(6788)) - crit_chance+=(*i)->GetAmount(); + crit_chance += (*i)->GetAmount(); break; default: break; @@ -9479,7 +7227,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto // percent done // only players use intelligence for critical chance computations if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRITICAL_CHANCE, crit_chance); + modOwner->ApplySpellMod(spellProto->Id, crit_chance); // for this types the bonus was already added in GetUnitCriticalChance, do not add twice if (spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE && spellProto->DmgClass != SPELL_DAMAGE_CLASS_RANGED) @@ -9531,7 +7279,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage { // adds additional damage to critBonus (from talents) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus); + modOwner->ApplySpellMod(spellProto->Id, crit_bonus); } crit_bonus += damage; @@ -9650,7 +7398,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + modOwner->ApplySpellMod(spellProto->Id, coeff); coeff /= 100.0f; } @@ -9675,7 +7423,12 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto)); // apply spellmod to Done amount if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); + { + if (damagetype == DOT) + modOwner->ApplySpellMod(spellProto->Id, heal); + else + modOwner->ApplySpellMod(spellProto->Id, heal); + } return uint32(std::max(heal, 0.0f)); } @@ -9810,7 +7563,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + modOwner->ApplySpellMod(spellProto->Id, coeff); coeff /= 100.0f; } @@ -10138,7 +7891,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // apply spellmod to Done damage if (spellProto) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); + modOwner->ApplySpellMod(spellProto->Id, tmpDamage); // bonus result can be negative return uint32(std::max(tmpDamage, 0.0f)); @@ -10303,7 +8056,7 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spe // Apply chance modifer aura if (spellProto) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_PROC_PER_MINUTE, PPM); + modOwner->ApplySpellMod(spellProto->Id, PPM); return std::floor((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) } @@ -11522,17 +9275,17 @@ float Unit::ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index { if (Player* modOwner = GetSpellModOwner()) { - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_ALL_EFFECTS, value); + modOwner->ApplySpellMod(spellProto->Id, value); switch (effect_index) { - case 0: - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT1, value); + case EFFECT_0: + modOwner->ApplySpellMod(spellProto->Id, value); break; - case 1: - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT2, value); + case EFFECT_1: + modOwner->ApplySpellMod(spellProto->Id, value); break; - case 2: - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT3, value); + case EFFECT_2: + modOwner->ApplySpellMod(spellProto->Id, value); break; } } @@ -11661,7 +9414,7 @@ void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* // called from caster if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell); + modOwner->ApplySpellMod(spellInfo->Id, castTime, spell); if (!(spellInfo->HasAttribute(SPELL_ATTR0_ABILITY) || spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL) || spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS)) && ((GetTypeId() == TYPEID_PLAYER && spellInfo->SpellFamilyName) || GetTypeId() == TYPEID_UNIT)) @@ -11682,7 +9435,7 @@ void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Sp // called from caster if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, duration, spell); + modOwner->ApplySpellMod(spellInfo->Id, duration, spell); if (!(spellInfo->HasAttribute(SPELL_ATTR0_ABILITY) || spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL) || spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS)) && ((GetTypeId() == TYPEID_PLAYER && spellInfo->SpellFamilyName) || GetTypeId() == TYPEID_UNIT)) @@ -12773,142 +10526,83 @@ bool Unit::isFrozen() const return HasAuraState(AURA_STATE_FROZEN); } -struct ProcTriggeredData +uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition) { - ProcTriggeredData(Aura* _aura) - : aura(_aura) - { - effMask = 0; - spellProcEvent = NULL; - } - SpellProcEventEntry const* spellProcEvent; - Aura* aura; - uint32 effMask; -}; - -typedef std::list< ProcTriggeredData > ProcTriggeredList; - -// List of auras that CAN be trigger but may not exist in spell_proc_event -// in most case need for drop charges -// in some types of aura need do additional check -// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic -bool InitTriggerAuraData() -{ - for (uint16 i = 0; i < TOTAL_AURAS; ++i) - { - isTriggerAura[i] = false; - isNonTriggerAura[i] = false; - isAlwaysTriggeredAura[i] = false; - } - isTriggerAura[SPELL_AURA_PROC_ON_POWER_AMOUNT] = true; - isTriggerAura[SPELL_AURA_DUMMY] = true; - isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; - isTriggerAura[SPELL_AURA_MOD_THREAT] = true; - isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; - isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; - isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; - isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_ROOT] = true; - isTriggerAura[SPELL_AURA_TRANSFORM] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; - isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; - isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; - isTriggerAura[SPELL_AURA_SCHOOL_ABSORB] = true; // Savage Defense untested - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; - isTriggerAura[SPELL_AURA_MECHANIC_IMMUNITY] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; - isTriggerAura[SPELL_AURA_SPELL_MAGNET] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_REGEN_PERCENT] = true; - isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; - isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isTriggerAura[SPELL_AURA_MOD_MECHANIC_RESISTANCE] = true; - isTriggerAura[SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS] = true; - isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; - isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE_3] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_FROM_CASTER] = true; - isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; - - isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN] = true; - isNonTriggerAura[SPELL_AURA_REDUCE_PUSHBACK] = true; - - isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; - isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; - isAlwaysTriggeredAura[SPELL_AURA_SPELL_MAGNET] = true; - isAlwaysTriggeredAura[SPELL_AURA_SCHOOL_ABSORB] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; - - return true; -} - -uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition) -{ - uint32 procEx = PROC_EX_NONE; + uint32 hitMask = PROC_HIT_NONE; // Check victim state if (missCondition != SPELL_MISS_NONE) + { switch (missCondition) { - case SPELL_MISS_MISS: procEx|=PROC_EX_MISS; break; - case SPELL_MISS_RESIST: procEx|=PROC_EX_RESIST; break; - case SPELL_MISS_DODGE: procEx|=PROC_EX_DODGE; break; - case SPELL_MISS_PARRY: procEx|=PROC_EX_PARRY; break; - case SPELL_MISS_BLOCK: procEx|=PROC_EX_BLOCK; break; - case SPELL_MISS_EVADE: procEx|=PROC_EX_EVADE; break; - case SPELL_MISS_IMMUNE: procEx|=PROC_EX_IMMUNE; break; - case SPELL_MISS_IMMUNE2: procEx|=PROC_EX_IMMUNE; break; - case SPELL_MISS_DEFLECT: procEx|=PROC_EX_DEFLECT;break; - case SPELL_MISS_ABSORB: procEx|=PROC_EX_ABSORB; break; - case SPELL_MISS_REFLECT: procEx|=PROC_EX_REFLECT;break; + case SPELL_MISS_MISS: + hitMask |= PROC_HIT_MISS; + break; + case SPELL_MISS_DODGE: + hitMask |= PROC_HIT_DODGE; + break; + case SPELL_MISS_PARRY: + hitMask |= PROC_HIT_PARRY; + break; + case SPELL_MISS_BLOCK: + hitMask |= PROC_HIT_BLOCK; + break; + case SPELL_MISS_EVADE: + hitMask |= PROC_HIT_EVADE; + break; + case SPELL_MISS_IMMUNE: + hitMask |= PROC_HIT_IMMUNE; + break; + case SPELL_MISS_IMMUNE2: + hitMask |= PROC_HIT_IMMUNE; + break; + case SPELL_MISS_DEFLECT: + hitMask |= PROC_HIT_DEFLECT; + break; + case SPELL_MISS_ABSORB: + hitMask |= PROC_HIT_ABSORB; + break; + case SPELL_MISS_REFLECT: + hitMask |= PROC_HIT_REFLECT; + break; default: break; } + } else { // On block if (damageInfo->blocked) - procEx|=PROC_EX_BLOCK; + hitMask |= PROC_HIT_BLOCK; // On absorb if (damageInfo->absorb) - procEx|=PROC_EX_ABSORB; + hitMask |= PROC_HIT_ABSORB; // On crit if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT) - procEx|=PROC_EX_CRITICAL_HIT; + hitMask |= PROC_HIT_CRITICAL; else - procEx|=PROC_EX_NORMAL_HIT; + hitMask |= PROC_HIT_NORMAL; } - return procEx; + + return hitMask; } -void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura) +void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMask, uint32 hitMask, WeaponAttackType attType) { // Player is loaded now - do not allow passive spell casts to proc if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetSession()->PlayerLoading()) return; + // For melee/ranged based attack need update skills and set some Aura states if victim present - if (procFlag & MELEE_BASED_TRIGGER_MASK && target) + if (typeMask & MELEE_BASED_TRIGGER_MASK && procTarget) { // If exist crit/parry/dodge/block need update aura state (for victim and attacker) - if (procExtra & (PROC_EX_CRITICAL_HIT|PROC_EX_PARRY|PROC_EX_DODGE|PROC_EX_BLOCK)) + if (hitMask & (PROC_HIT_CRITICAL | PROC_HIT_PARRY | PROC_HIT_DODGE | PROC_HIT_BLOCK)) { // for victim if (isVictim) { // if victim and dodge attack - if (procExtra & PROC_EX_DODGE) + if (hitMask & PROC_HIT_DODGE) { // Update AURA_STATE on dodge if (getClass() != CLASS_ROGUE) // skip Rogue Riposte @@ -12918,7 +10612,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } } // if victim and parry attack - if (procExtra & PROC_EX_PARRY) + if (hitMask & PROC_HIT_PARRY) { // For Hunters only Counterattack (skip Mongoose bite) if (getClass() == CLASS_HUNTER) @@ -12933,7 +10627,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } } // if and victim block attack - if (procExtra & PROC_EX_BLOCK) + if (hitMask & PROC_HIT_BLOCK) { ModifyAuraState(AURA_STATE_DEFENSE, true); StartReactiveTimer(REACTIVE_DEFENSE); @@ -12942,372 +10636,42 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u else // For attacker { // Overpower on victim dodge - if (procExtra & PROC_EX_DODGE && GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR) + if ((hitMask & PROC_HIT_DODGE) && GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR) { - ToPlayer()->AddComboPoints(target, 1); + ToPlayer()->AddComboPoints(procTarget, 1); StartReactiveTimer(REACTIVE_OVERPOWER); } } } } - - Unit* actor = isVictim ? target : this; - Unit* actionTarget = !isVictim ? target : this; - - DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE, attType); - HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL); - ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo); - - std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); - ProcTriggeredList procTriggered; - // Fill procTriggered list - for (AuraApplicationMap::const_iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr) - { - // Do not allow auras to proc from effect triggered by itself - if (procAura && procAura->Id == itr->first) - continue; - - if (itr->second->GetBase()->IsProcOnCooldown(now)) - continue; - - ProcTriggeredData triggerData(itr->second->GetBase()); - // Defensive procs are active on absorbs (so absorption effects are not a hindrance) - bool active = damage || (procExtra & PROC_EX_BLOCK && isVictim); - if (isVictim) - procExtra &= ~PROC_EX_INTERNAL_REQ_FAMILY; - - SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo(); - - // only auras that has triggered spell should proc from fully absorbed damage - if (procExtra & PROC_EX_ABSORB && isVictim) - if (damage || spellProto->Effects[EFFECT_0].TriggerSpell || spellProto->Effects[EFFECT_1].TriggerSpell || spellProto->Effects[EFFECT_2].TriggerSpell) - active = true; - - if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent)) - continue; - - // do checks using conditions table - if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPELL_PROC, spellProto->Id, eventInfo.GetActor(), eventInfo.GetActionTarget())) - continue; - - // AuraScript Hook - if (!triggerData.aura->CallScriptCheckProcHandlers(itr->second, eventInfo)) - continue; - - bool procSuccess = RollProcResult(target, triggerData.aura, attType, isVictim, triggerData.spellProcEvent); - if (!procSuccess) - continue; - - bool triggeredCanProcAura = true; - // Additional checks for triggered spells (ignore trap casts) - if (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION)) - { - if (!spellProto->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED)) - triggeredCanProcAura = false; - } - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (itr->second->HasEffect(i)) - { - AuraEffect* aurEff = itr->second->GetBase()->GetEffect(i); - // Skip this auras - if (isNonTriggerAura[aurEff->GetAuraType()]) - continue; - // If not trigger by default and spellProcEvent == NULL - skip - if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent == NULL) - continue; - // Some spells must always trigger - if (triggeredCanProcAura || isAlwaysTriggeredAura[aurEff->GetAuraType()]) - triggerData.effMask |= 1<aura->IsRemoved()) - continue; - - bool useCharges = i->aura->IsUsingCharges(); - // no more charges to use, prevent proc - if (useCharges && !i->aura->GetCharges()) - continue; - - bool takeCharges = false; - SpellInfo const* spellInfo = i->aura->GetSpellInfo(); - uint32 Id = i->aura->GetId(); - - AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID()); - - bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo); - - // For players set spell cooldown if need - Milliseconds cooldown = Milliseconds::zero(); - if (prepare && GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown) - cooldown = Seconds(i->spellProcEvent->cooldown); - - // Note: must SetCantProc(false) before return - if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) - SetCantProc(true); - - bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo); - - // "handled" is needed as long as proc can be handled in multiple places - if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, &handled)) - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), Id); - takeCharges = true; - } - - if (!handled) - { - for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) - { - if (!(i->effMask & (1 << effIndex))) - continue; - - AuraEffect* triggeredByAura = i->aura->GetEffect(effIndex); - ASSERT(triggeredByAura); - - bool prevented = i->aura->CallScriptEffectProcHandlers(triggeredByAura, aurApp, eventInfo); - if (prevented) - { - takeCharges = true; - continue; - } - - switch (triggeredByAura->GetAuraType()) - { - case SPELL_AURA_PROC_TRIGGER_SPELL: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", - spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - // Don`t drop charge or add cooldown for not started trigger - if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra)) - takeCharges = true; - break; - } - case SPELL_AURA_PROC_TRIGGER_DAMAGE: - { - // target has to be valid - if (!eventInfo.GetProcTarget()) - break; - - triggeredByAura->HandleProcTriggerDamageAuraProc(aurApp, eventInfo); // this function is part of the new proc system - takeCharges = true; - break; - } - case SPELL_AURA_MANA_SHIELD: - case SPELL_AURA_DUMMY: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", - spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; - break; - } - case SPELL_AURA_PROC_ON_POWER_AMOUNT: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (HandleAuraProcOnPowerAmount(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; - break; - } - case SPELL_AURA_OBS_MOD_POWER: - case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - case SPELL_AURA_MOD_POWER_REGEN_PERCENT: - case SPELL_AURA_MOD_MELEE_HASTE: - case SPELL_AURA_MOD_MELEE_HASTE_3: - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", - spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId()); - takeCharges = true; - break; - case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", - spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell)) - takeCharges = true; - break; - } - case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - - HandleAuraRaidProcFromChargeWithValue(triggeredByAura); - takeCharges = true; - break; - } - case SPELL_AURA_RAID_PROC_FROM_CHARGE: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - - HandleAuraRaidProcFromCharge(triggeredByAura); - takeCharges = true; - break; - } - case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: - { - TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", - spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - - if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra)) - takeCharges = true; - break; - } - case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK: - // Skip melee hits or instant cast spells - if (procSpell && procSpell->CalcCastTime(getLevel()) > 0) - takeCharges = true; - break; - case SPELL_AURA_REFLECT_SPELLS_SCHOOL: - // Skip Melee hits and spells ws wrong school - if (procSpell && (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check - takeCharges = true; - break; - case SPELL_AURA_SPELL_MAGNET: - // Skip Melee hits and targets with magnet aura - if (procSpell && (triggeredByAura->GetBase()->GetUnitOwner()->ToUnit() == ToUnit())) // Magnet - takeCharges = true; - break; - case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: - case SPELL_AURA_MOD_POWER_COST_SCHOOL: - // Skip melee hits and spells ws wrong school or zero cost - if (procSpell && - (procSpell->ManaCost != 0 || procSpell->ManaCostPercentage != 0) && // Cost check - (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check - takeCharges = true; - break; - case SPELL_AURA_MECHANIC_IMMUNITY: - // Compare mechanic - if (procSpell && procSpell->Mechanic == uint32(triggeredByAura->GetMiscValue())) - takeCharges = true; - break; - case SPELL_AURA_MOD_MECHANIC_RESISTANCE: - // Compare mechanic - if (procSpell && procSpell->Mechanic == uint32(triggeredByAura->GetMiscValue())) - takeCharges = true; - break; - case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: - // Compare casters - if (triggeredByAura->GetCasterGUID() == target->GetGUID()) - takeCharges = true; - break; - // CC Auras which use their amount amount to drop - // Are there any more auras which need this? - case SPELL_AURA_MOD_CONFUSE: - case SPELL_AURA_MOD_FEAR: - case SPELL_AURA_MOD_STUN: - case SPELL_AURA_MOD_ROOT: - case SPELL_AURA_TRANSFORM: - { - // chargeable mods are breaking on hit - if (useCharges) - takeCharges = true; - else - { - // Spell own direct damage at apply wont break the CC - if (procSpell && (procSpell->Id == triggeredByAura->GetId())) - { - Aura* aura = triggeredByAura->GetBase(); - // called from spellcast, should not have ticked yet - if (aura->GetDuration() == aura->GetMaxDuration()) - break; - } - int32 damageLeft = triggeredByAura->GetAmount(); - // No damage left - if (damageLeft < int32(damage)) - i->aura->Remove(); - else - triggeredByAura->SetAmount(damageLeft - damage); - } - break; - } - //case SPELL_AURA_ADD_FLAT_MODIFIER: - //case SPELL_AURA_ADD_PCT_MODIFIER: - // HandleSpellModAuraProc - //break; - default: - // nothing do, just charges counter - takeCharges = true; - break; - } // switch (triggeredByAura->GetAuraType()) - i->aura->CallScriptAfterEffectProcHandlers(triggeredByAura, aurApp, eventInfo); - } // for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) - } // if (!handled) - - if (prepare && takeCharges && cooldown != Milliseconds::zero()) - i->aura->AddProcCooldown(now + cooldown); - - // Remove charge (aura can be removed by triggers) - if (prepare && useCharges && takeCharges) - { - // Set charge drop delay (only for missiles) - if ((procExtra & PROC_EX_REFLECT) && target && procSpell && procSpell->Speed > 0.0f) - { - // Set up missile speed based delay (from Spell.cpp: Spell::AddUnitTarget()::L2237) - uint32 delay = uint32(std::floor(std::max(target->GetDistance(this), 5.0f) / procSpell->Speed * 1000.0f)); - // Schedule charge drop - i->aura->DropChargeDelayed(delay); - } - else - i->aura->DropCharge(); - } - - i->aura->CallScriptAfterProcHandlers(aurApp, eventInfo); - - if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) - SetCantProc(false); - } - - // Cleanup proc requirements - if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) - SetCantProc(false); } -void Unit::GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo) +void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo& eventInfo) { std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); // use provided list of auras which can proc if (procAuras) { - for (std::list::iterator itr = procAuras->begin(); itr!= procAuras->end(); ++itr) + for (AuraApplication* aurApp : *procAuras) { - ASSERT((*itr)->GetTarget() == this); - if (!(*itr)->GetRemoveMode()) - if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo, now)) - { - (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo, now); - aurasTriggeringProc.push_back(*itr); - } + ASSERT(aurApp->GetTarget() == this); + if (uint8 procEffectMask = aurApp->GetBase()->IsProcTriggeredOnEvent(aurApp, eventInfo, now)) + { + aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now); + aurasTriggeringProc.emplace_back(std::make_pair(procEffectMask, aurApp)); + } } } // or generate one on our own else { - for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr) + for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr != GetAppliedAuras().end(); ++itr) { - if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) + if (uint8 procEffectMask = itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) { itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now); - aurasTriggeringProc.push_back(itr->second); + aurasTriggeringProc.emplace_back(std::make_pair(procEffectMask, itr->second)); } } } @@ -13316,34 +10680,49 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list& aurasTrigge void Unit::TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo) { DamageInfo dmgInfo = DamageInfo(damageInfo); - TriggerAurasProcOnEvent(NULL, NULL, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, 0, 0, damageInfo.procEx, NULL, &dmgInfo, NULL); + TriggerAurasProcOnEvent(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, PROC_SPELL_TYPE_NONE, PROC_SPELL_PHASE_NONE, dmgInfo.GetHitMask(), nullptr, &dmgInfo, nullptr); } -void Unit::TriggerAurasProcOnEvent(std::list* myProcAuras, std::list* targetProcAuras, Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo) +void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo) { // prepare data for self trigger - ProcEventInfo myProcEventInfo = ProcEventInfo(this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); - std::list myAurasTriggeringProc; - GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, myProcAuras, myProcEventInfo); + ProcEventInfo myProcEventInfo(this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); + if (typeMaskActor && CanProc()) + { + AuraApplicationProcContainer myAurasTriggeringProc; + GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, nullptr, myProcEventInfo); + TriggerAurasProcOnEvent(myProcEventInfo, myAurasTriggeringProc); + } // prepare data for target trigger - ProcEventInfo targetProcEventInfo = ProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); - std::list targetAurasTriggeringProc; - if (typeMaskActionTarget) - GetProcAurasTriggeredOnEvent(targetAurasTriggeringProc, targetProcAuras, targetProcEventInfo); - - TriggerAurasProcOnEvent(myProcEventInfo, myAurasTriggeringProc); - - if (typeMaskActionTarget) - TriggerAurasProcOnEvent(targetProcEventInfo, targetAurasTriggeringProc); + ProcEventInfo targetProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); + if (typeMaskActionTarget && actionTarget && actionTarget->CanProc()) + { + AuraApplicationProcContainer targetAurasTriggeringProc; + actionTarget->GetProcAurasTriggeredOnEvent(targetAurasTriggeringProc, nullptr, targetProcEventInfo); + actionTarget->TriggerAurasProcOnEvent(targetProcEventInfo, targetAurasTriggeringProc); + } } -void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list& aurasTriggeringProc) +void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& aurasTriggeringProc) { - for (std::list::iterator itr = aurasTriggeringProc.begin(); itr != aurasTriggeringProc.end(); ++itr) + for (auto const& aurAppProc : aurasTriggeringProc) { - if (!(*itr)->GetRemoveMode()) - (*itr)->GetBase()->TriggerProcOnEvent(*itr, eventInfo); + AuraApplication* aurApp; + uint8 procEffectMask; + std::tie(procEffectMask, aurApp) = aurAppProc; + + if (aurApp->GetRemoveMode()) + continue; + + SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo(); + if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) + SetCantProc(true); + + aurApp->GetBase()->TriggerProcOnEvent(procEffectMask, aurApp, eventInfo); + + if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) + SetCantProc(false); } } @@ -13947,202 +11326,6 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) return true; } -bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent) -{ - SpellInfo const* spellInfo = aura->GetSpellInfo(); - - // let the aura be handled by new proc system if it has new entry - if (sSpellMgr->GetSpellProcEntry(spellInfo->Id)) - return false; - - // Get proc Event Entry - spellProcEvent = sSpellMgr->GetSpellProcEvent(spellInfo->Id); - - // Get EventProcFlag - uint32 EventProcFlag; - if (spellProcEvent && spellProcEvent->procFlags) // if exist get custom spellProcEvent->procFlags - EventProcFlag = spellProcEvent->procFlags; - else - EventProcFlag = spellInfo->ProcFlags; // else get from spell proto - // Continue if no trigger exist - if (!EventProcFlag) - return false; - - // Check spellProcEvent data requirements - if (!sSpellMgr->IsSpellProcEventCanTriggeredBy(spellInfo, spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) - return false; - // In most cases req get honor or XP from kill - if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER) - { - bool allow = false; - - if (victim) - allow = ToPlayer()->isHonorOrXPTarget(victim); - - // Shadow Word: Death - can trigger from every kill - if (aura->GetId() == 32409) - allow = true; - if (!allow) - return false; - } - // Aura added by spell can`t trigger from self (prevent drop charges/do triggers) - // But except periodic and kill triggers (can triggered from self) - if (procSpell && procSpell->Id == spellInfo->Id - && !(spellInfo->ProcFlags&(PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_KILL))) - return false; - - // Check if current equipment allows aura to proc - if (!isVictim && GetTypeId() == TYPEID_PLAYER) - { - Player* player = ToPlayer(); - if (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON) - { - Item* item = NULL; - if (attType == BASE_ATTACK) - item = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); - else if (attType == OFF_ATTACK) - item = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - else - item = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED); - - if (player->IsInFeralForm()) - return false; - - if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<GetTemplate()->SubClass) & spellInfo->EquippedItemSubClassMask)) - return false; - } - else if (spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR) - { - // Check if player is wearing shield - Item* item = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<GetTemplate()->SubClass) & spellInfo->EquippedItemSubClassMask)) - return false; - } - } - - return true; -} - -bool Unit::RollProcResult(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const* spellProcEvent) -{ - SpellInfo const* spellInfo = aura->GetSpellInfo(); - // Get chance from spell - float chance = float(spellInfo->ProcChance); - // If in spellProcEvent exist custom chance, chance = spellProcEvent->customChance; - if (spellProcEvent && spellProcEvent->customChance) - chance = spellProcEvent->customChance; - // If PPM exist calculate chance from PPM - if (spellProcEvent && spellProcEvent->ppmRate != 0) - { - if (!isVictim) - { - uint32 weaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellInfo); - } - else if (victim) - { - uint32 weaponSpeed = victim->GetAttackTime(attType); - chance = victim->GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellInfo); - } - } - // Apply chance modifer aura - if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); - return roll_chance_f(chance); -} - -bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura) -{ - // aura can be deleted at casts - SpellInfo const* spellProto = triggeredByAura->GetSpellInfo(); - int32 heal = triggeredByAura->GetAmount(); - ObjectGuid caster_guid = triggeredByAura->GetCasterGUID(); - - // Currently only Prayer of Mending - if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) - { - TC_LOG_DEBUG("spells", "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); - return false; - } - - // jumps - int32 jumps = triggeredByAura->GetBase()->GetCharges()-1; - - // current aura expire - triggeredByAura->GetBase()->SetCharges(1); // will removed at next charges decrease - - // next target selection - if (jumps > 0) - { - if (Unit* caster = triggeredByAura->GetCaster()) - { - float radius = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcRadius(caster); - - if (Unit* target = GetNextRandomRaidMemberOrPet(radius)) - { - CastCustomSpell(target, spellProto->Id, &heal, NULL, NULL, true, NULL, triggeredByAura, caster_guid); - if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID())) - aura->SetCharges(jumps); - } - } - } - - // heal - CastCustomSpell(this, 33110, &heal, NULL, NULL, true, NULL, NULL, caster_guid); - return true; - -} -bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) -{ - // aura can be deleted at casts - SpellInfo const* spellProto = triggeredByAura->GetSpellInfo(); - - uint32 damageSpellId; - switch (spellProto->Id) - { - case 57949: // shiver - damageSpellId = 57952; - //animationSpellId = 57951; dummy effects for jump spell have unknown use (see also 41637) - break; - case 59978: // shiver - damageSpellId = 59979; - break; - case 43593: // Cold Stare - damageSpellId = 43594; - break; - default: - TC_LOG_ERROR("entities.unit", "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id); - return false; - } - - ObjectGuid caster_guid = triggeredByAura->GetCasterGUID(); - - // jumps - int32 jumps = triggeredByAura->GetBase()->GetCharges()-1; - - // current aura expire - triggeredByAura->GetBase()->SetCharges(1); // will removed at next charges decrease - - // next target selection - if (jumps > 0) - { - if (Unit* caster = triggeredByAura->GetCaster()) - { - float radius = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcRadius(caster); - if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) - { - CastSpell(target, spellProto, true, NULL, triggeredByAura, caster_guid); - if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID())) - aura->SetCharges(jumps); - } - } - } - - CastSpell(this, damageSpellId, true, NULL, triggeredByAura, caster_guid); - - return true; -} - void Unit::SendDurabilityLoss(Player* receiver, uint32 percent) { WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 4); @@ -14256,14 +11439,17 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim if (IsPet() || IsTotem()) + { + // proc only once for victim if (Unit* owner = GetOwner()) - owner->ProcDamageAndSpell(victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0); + owner->ProcSkillsAndAuras(victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr); + } if (!victim->IsCritter()) - ProcDamageAndSpell(victim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0); + ProcSkillsAndAuras(victim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr); // Proc auras on death - must be before aura/combat remove - victim->ProcDamageAndSpell(NULL, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, BASE_ATTACK, 0); + victim->ProcSkillsAndAuras(victim, PROC_FLAG_NONE, PROC_FLAG_DEATH, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr); // update get killing blow achievements, must be done before setDeathState to be able to require auras on target // and before Spirit of Redemption as it also removes auras @@ -15223,7 +12409,7 @@ float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, u if (spellId) { if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_MISS_CHANCE, hitChance); + modOwner->ApplySpellMod(spellId, hitChance); } missChance += hitChance - 100.0f; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4496e5224c..7d741c43ba 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -82,42 +82,42 @@ enum SpellAuraInterruptFlags AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE) }; -enum SpellModOp +enum SpellModOp : uint8 { - SPELLMOD_DAMAGE = 0, - SPELLMOD_DURATION = 1, - SPELLMOD_THREAT = 2, - SPELLMOD_EFFECT1 = 3, - SPELLMOD_CHARGES = 4, - SPELLMOD_RANGE = 5, - SPELLMOD_RADIUS = 6, - SPELLMOD_CRITICAL_CHANCE = 7, - SPELLMOD_ALL_EFFECTS = 8, - SPELLMOD_NOT_LOSE_CASTING_TIME = 9, - SPELLMOD_CASTING_TIME = 10, - SPELLMOD_COOLDOWN = 11, - SPELLMOD_EFFECT2 = 12, - SPELLMOD_IGNORE_ARMOR = 13, - SPELLMOD_COST = 14, - SPELLMOD_CRIT_DAMAGE_BONUS = 15, - SPELLMOD_RESIST_MISS_CHANCE = 16, - SPELLMOD_JUMP_TARGETS = 17, - SPELLMOD_CHANCE_OF_SUCCESS = 18, - SPELLMOD_ACTIVATION_TIME = 19, - SPELLMOD_DAMAGE_MULTIPLIER = 20, - SPELLMOD_GLOBAL_COOLDOWN = 21, - SPELLMOD_DOT = 22, - SPELLMOD_EFFECT3 = 23, - SPELLMOD_BONUS_MULTIPLIER = 24, + SPELLMOD_DAMAGE = 0, + SPELLMOD_DURATION = 1, + SPELLMOD_THREAT = 2, + SPELLMOD_EFFECT1 = 3, + SPELLMOD_CHARGES = 4, + SPELLMOD_RANGE = 5, + SPELLMOD_RADIUS = 6, + SPELLMOD_CRITICAL_CHANCE = 7, + SPELLMOD_ALL_EFFECTS = 8, + SPELLMOD_NOT_LOSE_CASTING_TIME = 9, + SPELLMOD_CASTING_TIME = 10, + SPELLMOD_COOLDOWN = 11, + SPELLMOD_EFFECT2 = 12, + SPELLMOD_IGNORE_ARMOR = 13, + SPELLMOD_COST = 14, + SPELLMOD_CRIT_DAMAGE_BONUS = 15, + SPELLMOD_RESIST_MISS_CHANCE = 16, + SPELLMOD_JUMP_TARGETS = 17, + SPELLMOD_CHANCE_OF_SUCCESS = 18, + SPELLMOD_ACTIVATION_TIME = 19, + SPELLMOD_DAMAGE_MULTIPLIER = 20, + SPELLMOD_GLOBAL_COOLDOWN = 21, + SPELLMOD_DOT = 22, + SPELLMOD_EFFECT3 = 23, + SPELLMOD_BONUS_MULTIPLIER = 24, // spellmod 25 - SPELLMOD_PROC_PER_MINUTE = 26, - SPELLMOD_VALUE_MULTIPLIER = 27, - SPELLMOD_RESIST_DISPEL_CHANCE = 28, - SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell - SPELLMOD_SPELL_COST_REFUND_ON_FAIL = 30 -}; + SPELLMOD_PROC_PER_MINUTE = 26, + SPELLMOD_VALUE_MULTIPLIER = 27, + SPELLMOD_RESIST_DISPEL_CHANCE = 28, + SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell + SPELLMOD_SPELL_COST_REFUND_ON_FAIL = 30, -#define MAX_SPELLMOD 32 + MAX_SPELLMOD +}; enum SpellValueMod { @@ -452,7 +452,7 @@ enum TriggerCastFlags TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements - TRIGGERED_DISALLOW_PROC_EVENTS = 0x00020000, //! Disallows proc events from triggered spell (default) + // reuse 0x00020000 TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks) @@ -836,13 +836,13 @@ struct DiminishingReturn : DRGroup(group), stack(0), hitTime(t), hitCount(count) { } - DiminishingGroup DRGroup:16; - uint16 stack:16; + DiminishingGroup DRGroup; + uint16 stack; uint32 hitTime; uint32 hitCount; }; -enum MeleeHitOutcome +enum MeleeHitOutcome : uint8 { MELEE_HIT_EVADE, MELEE_HIT_MISS, MELEE_HIT_DODGE, MELEE_HIT_BLOCK, MELEE_HIT_PARRY, MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING, MELEE_HIT_NORMAL @@ -850,21 +850,18 @@ enum MeleeHitOutcome class DispelInfo { -public: - explicit DispelInfo(Unit* dispeller, uint32 dispellerSpellId, uint8 chargesRemoved) : - _dispellerUnit(dispeller), _dispellerSpell(dispellerSpellId), _chargesRemoved(chargesRemoved) { } + public: + explicit DispelInfo(Unit* dispeller, uint32 dispellerSpellId, uint8 chargesRemoved) : + _dispellerUnit(dispeller), _dispellerSpell(dispellerSpellId), _chargesRemoved(chargesRemoved) { } - Unit* GetDispeller() const { return _dispellerUnit; } - uint32 GetDispellerSpellId() const { return _dispellerSpell; } - uint8 GetRemovedCharges() const { return _chargesRemoved; } - void SetRemovedCharges(uint8 amount) - { - _chargesRemoved = amount; - } -private: - Unit* _dispellerUnit; - uint32 _dispellerSpell; - uint8 _chargesRemoved; + Unit* GetDispeller() const { return _dispellerUnit; } + uint32 GetDispellerSpellId() const { return _dispellerSpell; } + uint8 GetRemovedCharges() const { return _chargesRemoved; } + void SetRemovedCharges(uint8 amount) { _chargesRemoved = amount; } + private: + Unit* _dispellerUnit; + uint32 _dispellerSpell; + uint8 _chargesRemoved; }; struct CleanDamage @@ -880,104 +877,110 @@ struct CleanDamage }; struct CalcDamageInfo; +struct SpellNonMeleeDamage; class TC_GAME_API DamageInfo { -private: - Unit* const m_attacker; - Unit* const m_victim; - uint32 m_damage; - SpellInfo const* const m_spellInfo; - SpellSchoolMask const m_schoolMask; - DamageEffectType const m_damageType; - WeaponAttackType m_attackType; - uint32 m_absorb; - uint32 m_resist; - uint32 m_block; - uint32 m_hitMask; -public: - DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType); - explicit DamageInfo(CalcDamageInfo const& dmgInfo); - DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType); + private: + Unit* const m_attacker; + Unit* const m_victim; + uint32 m_damage; + SpellInfo const* const m_spellInfo; + SpellSchoolMask const m_schoolMask; + DamageEffectType const m_damageType; + WeaponAttackType m_attackType; + uint32 m_absorb; + uint32 m_resist; + uint32 m_block; + uint32 m_hitMask; + public: + DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType); + explicit DamageInfo(CalcDamageInfo const& dmgInfo); + DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, uint32 hitMask); - void ModifyDamage(int32 amount); - void AbsorbDamage(uint32 amount); - void ResistDamage(uint32 amount); - void BlockDamage(uint32 amount); + void ModifyDamage(int32 amount); + void AbsorbDamage(uint32 amount); + void ResistDamage(uint32 amount); + void BlockDamage(uint32 amount); - Unit* GetAttacker() const { return m_attacker; } - Unit* GetVictim() const { return m_victim; } - SpellInfo const* GetSpellInfo() const { return m_spellInfo; } - SpellSchoolMask GetSchoolMask() const { return m_schoolMask; } - DamageEffectType GetDamageType() const { return m_damageType; } - WeaponAttackType GetAttackType() const { return m_attackType; } - uint32 GetDamage() const { return m_damage; } - uint32 GetAbsorb() const { return m_absorb; } - uint32 GetResist() const { return m_resist; } - uint32 GetBlock() const { return m_block; } + Unit* GetAttacker() const { return m_attacker; } + Unit* GetVictim() const { return m_victim; } + SpellInfo const* GetSpellInfo() const { return m_spellInfo; } + SpellSchoolMask GetSchoolMask() const { return m_schoolMask; } + DamageEffectType GetDamageType() const { return m_damageType; } + WeaponAttackType GetAttackType() const { return m_attackType; } + uint32 GetDamage() const { return m_damage; } + uint32 GetAbsorb() const { return m_absorb; } + uint32 GetResist() const { return m_resist; } + uint32 GetBlock() const { return m_block; } - uint32 GetHitMask() const; + uint32 GetHitMask() const; }; class TC_GAME_API HealInfo { -private: - Unit* const _healer; - Unit* const _target; - uint32 _heal; - uint32 _absorb; - SpellInfo const* const _spellInfo; - SpellSchoolMask const _schoolMask; - uint32 _hitMask; + private: + Unit* const _healer; + Unit* const _target; + uint32 _heal; + uint32 _effectiveHeal; + uint32 _absorb; + SpellInfo const* const _spellInfo; + SpellSchoolMask const _schoolMask; + uint32 _hitMask; -public: - explicit HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask); + public: + HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask); - void AbsorbHeal(uint32 amount); + void AbsorbHeal(uint32 amount); + void SetEffectiveHeal(uint32 amount) { _effectiveHeal = amount; } - Unit* GetHealer() const { return _healer; } - Unit* GetTarget() const { return _target; } - uint32 GetHeal() const { return _heal; } - uint32 GetAbsorb() const { return _absorb; } - SpellInfo const* GetSpellInfo() const { return _spellInfo; }; - SpellSchoolMask GetSchoolMask() const { return _schoolMask; }; + Unit* GetHealer() const { return _healer; } + Unit* GetTarget() const { return _target; } + uint32 GetHeal() const { return _heal; } + uint32 GetEffectiveHeal() const { return _effectiveHeal; } + uint32 GetAbsorb() const { return _absorb; } + SpellInfo const* GetSpellInfo() const { return _spellInfo; }; + SpellSchoolMask GetSchoolMask() const { return _schoolMask; }; - uint32 GetHitMask() const; + uint32 GetHitMask() const; }; class TC_GAME_API ProcEventInfo { -public: - ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, uint32 typeMask, - uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, - Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo); + public: + ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, uint32 typeMask, + uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, + Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo); - Unit* GetActor() { return _actor; } - Unit* GetActionTarget() const { return _actionTarget; } - Unit* GetProcTarget() const { return _procTarget; } + Unit* GetActor() { return _actor; } + Unit* GetActionTarget() const { return _actionTarget; } + Unit* GetProcTarget() const { return _procTarget; } - uint32 GetTypeMask() const { return _typeMask; } - uint32 GetSpellTypeMask() const { return _spellTypeMask; } - uint32 GetSpellPhaseMask() const { return _spellPhaseMask; } - uint32 GetHitMask() const { return _hitMask; } + uint32 GetTypeMask() const { return _typeMask; } + uint32 GetSpellTypeMask() const { return _spellTypeMask; } + uint32 GetSpellPhaseMask() const { return _spellPhaseMask; } + uint32 GetHitMask() const { return _hitMask; } - SpellInfo const* GetSpellInfo() const; - SpellSchoolMask GetSchoolMask() const; + SpellInfo const* GetSpellInfo() const; + SpellSchoolMask GetSchoolMask() const; - DamageInfo* GetDamageInfo() const { return _damageInfo; } - HealInfo* GetHealInfo() const { return _healInfo; } + DamageInfo* GetDamageInfo() const { return _damageInfo; } + HealInfo* GetHealInfo() const { return _healInfo; } -private: - Unit* const _actor; - Unit* const _actionTarget; - Unit* const _procTarget; - uint32 _typeMask; - uint32 _spellTypeMask; - uint32 _spellPhaseMask; - uint32 _hitMask; - Spell* _spell; - DamageInfo* _damageInfo; - HealInfo* _healInfo; + Spell const* GetProcSpell() const { return _spell; } + + private: + Unit* const _actor; + Unit* const _actionTarget; + Unit* const _procTarget; + uint32 _typeMask; + uint32 _spellTypeMask; + uint32 _spellPhaseMask; + uint32 _hitMask; + Spell* _spell; + DamageInfo* _damageInfo; + HealInfo* _healInfo; }; // Struct for use in Unit::CalculateMeleeDamage @@ -997,7 +1000,6 @@ struct CalcDamageInfo WeaponAttackType attackType; // uint32 procAttacker; uint32 procVictim; - uint32 procEx; uint32 cleanDamage; // Used only for rage calculation MeleeHitOutcome hitOutCome; /// @todo remove this field (need use TargetState) }; @@ -1040,7 +1042,7 @@ struct SpellPeriodicAuraLogInfo bool critical; }; -uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition); +uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition); struct RedirectThreatInfo { @@ -1265,8 +1267,6 @@ enum PlayerTotemType #define ATTACK_DISPLAY_DELAY 200 #define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player -struct SpellProcEventEntry; // used only privately - class TC_GAME_API Unit : public WorldObject { public: @@ -1289,6 +1289,8 @@ class TC_GAME_API Unit : public WorldObject typedef std::list AuraApplicationList; typedef std::list Diminishing; + typedef std::deque> AuraApplicationProcContainer; + typedef std::map VisibleAuraMap; virtual ~Unit(); @@ -1468,18 +1470,18 @@ class TC_GAME_API Unit : public WorldObject uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); void Kill(Unit* victim, bool durabilityLoss = true); void KillSelf(bool durabilityLoss = true) { Kill(this, durabilityLoss); } - int32 DealHeal(Unit* victim, uint32 addhealth); + void DealHeal(HealInfo& healInfo); - void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); - void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL); + void ProcSkillsAndAuras(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, + uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, + DamageInfo* damageInfo, HealInfo* healInfo); - void GetProcAurasTriggeredOnEvent(AuraApplicationList& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo eventInfo); + void GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo& eventInfo); void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo); - void TriggerAurasProcOnEvent(AuraApplicationList* myProcAuras, AuraApplicationList* targetProcAuras, - Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, + void TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo); - void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationList& procAuras); + void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& procAuras); void HandleEmoteCommand(uint32 anim_id); void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); @@ -1576,8 +1578,8 @@ class TC_GAME_API Unit : public WorldObject virtual void UpdateUnderwaterState(Map* m, float x, float y, float z); bool isInAccessiblePlaceFor(Creature const* c) const; - void SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); - int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); + void SendHealSpellLog(HealInfo& healInfo, bool critical = false); + int32 HealBySpell(HealInfo& healInfo, bool critical = false); void SendEnergizeSpellLog(Unit* victim, uint32 spellID, int32 damage, Powers powertype); void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype); uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); @@ -2055,7 +2057,7 @@ class TC_GAME_API Unit : public WorldObject uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK); uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const; void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL); - void CalcHealAbsorb(Unit* victim, SpellInfo const* spellInfo, uint32& healAmount, uint32& absorb); + void CalcHealAbsorb(HealInfo& healInfo); void UpdateSpeed(UnitMoveType mtype); float GetSpeed(UnitMoveType mtype) const; @@ -2118,7 +2120,7 @@ class TC_GAME_API Unit : public WorldObject void UpdateAuraForGroup(uint8 slot); // proc trigger system - bool CanProc() const {return !m_procDeep;} + bool CanProc() const { return !m_procDeep; } void SetCantProc(bool apply); uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const; @@ -2284,15 +2286,8 @@ class TC_GAME_API Unit : public WorldObject bool IsAlwaysDetectableFor(WorldObject const* seer) const override; void DisableSpline(); + private: - bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent); - bool RollProcResult(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const* spellProcEvent); - bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown); - bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, bool* handled); - bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx); - bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell); - bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura); - bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura); void UpdateSplineMovement(uint32 t_diff); void UpdateSplinePosition(); @@ -2301,6 +2296,8 @@ class TC_GAME_API Unit : public WorldObject float GetCombatRatingReduction(CombatRating cr) const; uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const; + void ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMask, uint32 hitMask, WeaponAttackType attType); + protected: void SetFeared(bool apply); void SetConfused(bool apply); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 7364b20bd1..58a0919676 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3599,7 +3599,7 @@ enum DiminishingReturnsType }; // Diminishing Return Groups -enum DiminishingGroup +enum DiminishingGroup : uint16 { DIMINISHING_NONE = 0, DIMINISHING_BANISH = 1, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1e39cd4f9e..44f1bbd93d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -100,8 +100,8 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraModSchoolImmunity, // 39 SPELL_AURA_SCHOOL_IMMUNITY &AuraEffect::HandleAuraModDmgImmunity, // 40 SPELL_AURA_DAMAGE_IMMUNITY &AuraEffect::HandleAuraModDispelImmunity, // 41 SPELL_AURA_DISPEL_IMMUNITY - &AuraEffect::HandleNoImmediateEffect, // 42 SPELL_AURA_PROC_TRIGGER_SPELL implemented in Unit::ProcDamageAndSpellFor and Unit::HandleProcTriggerSpell - &AuraEffect::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in Unit::ProcDamageAndSpellFor + &AuraEffect::HandleNoImmediateEffect, // 42 SPELL_AURA_PROC_TRIGGER_SPELL implemented in AuraEffect::HandleProc + &AuraEffect::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in AuraEffect::HandleProc &AuraEffect::HandleAuraTrackCreatures, // 44 SPELL_AURA_TRACK_CREATURES &AuraEffect::HandleAuraTrackResources, // 45 SPELL_AURA_TRACK_RESOURCES &AuraEffect::HandleNULL, // 46 SPELL_AURA_46 (used in test spells 54054 and 54058, and spell 48050) (3.0.8a) @@ -320,7 +320,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleUnused, //259 unused (4.3.4) old SPELL_AURA_MOD_HOT_PCT &AuraEffect::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code &AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE - &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in spell::cancast + &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in Spell::CheckCast &AuraEffect::HandleAuraAllowOnlyAbility, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask &AuraEffect::HandleUnused, //264 unused (3.2.0) &AuraEffect::HandleUnused, //265 unused (4.3.4) @@ -636,7 +636,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru { // Apply periodic time mod if (modOwner) - modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_amplitude); + modOwner->ApplySpellMod(GetId(), m_amplitude); if (caster) { @@ -685,7 +685,6 @@ void AuraEffect::CalculateSpellMod() m_spellmod->type = SpellModType(uint32(GetAuraType())); // SpellModType value == spell aura types m_spellmod->spellId = GetId(); m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask; - m_spellmod->charges = GetBase()->GetCharges(); } m_spellmod->value = GetAmount(); break; @@ -1067,6 +1066,50 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const } } +bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) const +{ + bool result = GetBase()->CallScriptCheckEffectProcHandlers(this, aurApp, eventInfo); + if (!result) + return false; + + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + switch (GetAuraType()) + { + case SPELL_AURA_MECHANIC_IMMUNITY: + case SPELL_AURA_MOD_MECHANIC_RESISTANCE: + // compare mechanic + if (!spellInfo || static_cast(spellInfo->Mechanic) != GetMiscValue()) + result = false; + break; + case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK: + // skip melee hits and instant cast spells + if (!spellInfo || !spellInfo->CalcCastTime()) + result = false; + break; + case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: + // Compare casters + if (GetCasterGUID() != eventInfo.GetActor()->GetGUID()) + result = false; + break; + case SPELL_AURA_MOD_POWER_COST_SCHOOL: + case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: + // Skip melee hits and spells with wrong school or zero cost + if (!spellInfo || (!spellInfo->ManaCost && !spellInfo->ManaCostPercentage) || // Cost Check + !(spellInfo->GetSchoolMask() & GetMiscValue())) // School Check + result = false; + break; + case SPELL_AURA_REFLECT_SPELLS_SCHOOL: + // Skip melee hits and spells with wrong school + if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())) + result = false; + break; + default: + break; + } + + return result; +} + void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { bool prevented = GetBase()->CallScriptEffectProcHandlers(this, aurApp, eventInfo); @@ -1075,6 +1118,16 @@ void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) switch (GetAuraType()) { + // CC Auras which use their amount to drop + // Are there any more auras which need this? + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + case SPELL_AURA_MOD_ROOT: + case SPELL_AURA_TRANSFORM: + HandleBreakableCCAuraProc(aurApp, eventInfo); + break; + case SPELL_AURA_DUMMY: case SPELL_AURA_PROC_TRIGGER_SPELL: HandleProcTriggerSpellAuraProc(aurApp, eventInfo); break; @@ -4356,10 +4409,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (caster) target->GetMotionMaster()->MoveFall(); break; - case 71563: - if (Aura* newAura = target->AddAura(71564, target)) - newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); - break; } } // AT REMOVE @@ -5147,8 +5196,10 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) if (caster) { int32 heal = caster->CountPctFromMaxHealth(10); - caster->HealBySpell(target, auraSpellInfo, heal); + HealInfo healInfo(caster, target, heal, auraSpellInfo, auraSpellInfo->GetSchoolMask()); + caster->HealBySpell(healInfo); + /// @todo: should proc other auras? if (int32 mana = caster->GetMaxPower(POWER_MANA)) { mana /= 10; @@ -5454,7 +5505,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const damage = std::max(int32(damage * GetDonePct()), 0); if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage); + modOwner->ApplySpellMod(GetSpellInfo()->Id, damage); damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); @@ -5503,12 +5554,14 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const damage = uint32(ceil(CalculatePct(target->GetMaxHealth(), damage))); if (!m_spellInfo->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE)) + { if (m_spellInfo->Effects[m_effIndex].IsTargetingArea() || isAreaAura) { damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask)); if (caster->GetTypeId() != TYPEID_PLAYER) damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask)); } + } bool crit = false; @@ -5534,7 +5587,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 procEx = (crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT) | PROC_EX_INTERNAL_DOT; + uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; @@ -5546,7 +5599,8 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); + DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); } @@ -5623,12 +5677,17 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 procEx = (crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT) | PROC_EX_INTERNAL_DOT; + uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; + if (caster->IsAlive()) - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); + { + DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); + } + int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); if (caster->IsAlive()) { @@ -5637,8 +5696,11 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount())); - int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); - caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); + caster->HealBySpell(healInfo); + + caster->getHostileRefManager().threatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo()); + caster->ProcSkillsAndAuras(caster, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_PERIODIC, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_NONE, hitMask, nullptr, nullptr, &healInfo); } } @@ -5667,7 +5729,9 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) damage = int32(damage * gainMultiplier); - caster->HealBySpell(target, GetSpellInfo(), damage); + HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); + caster->HealBySpell(healInfo); + caster->ProcSkillsAndAuras(target, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_PERIODIC, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_NONE, PROC_HIT_NORMAL, nullptr, nullptr, &healInfo); } void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const @@ -5740,7 +5804,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const damage = std::max(int32(damage * GetDonePct()), 0); if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, damage); + modOwner->ApplySpellMod(GetSpellInfo()->Id, damage); damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); } @@ -5756,15 +5820,16 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s heal of %s for %u health inflicted by %u", GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId()); - uint32 absorb = 0; uint32 heal = damage; - caster->CalcHealAbsorb(target, GetSpellInfo(), heal, absorb); - int32 gain = caster->DealHeal(target, heal); - SpellPeriodicAuraLogInfo pInfo(this, heal, heal - gain, absorb, 0, 0.0f, crit); + HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); + caster->CalcHealAbsorb(healInfo); + caster->DealHeal(healInfo); + + SpellPeriodicAuraLogInfo pInfo(this, heal, heal - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); - target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo()); + target->getHostileRefManager().threatAssist(caster, float(healInfo.GetEffectiveHeal()) * 0.5f, GetSpellInfo()); bool haveCastItem = !GetBase()->GetCastItemGUID().IsEmpty(); @@ -5774,8 +5839,8 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const { uint32 funnelDamage = GetSpellInfo()->ManaPerSecond; // damage is not affected by spell power - if ((int32)funnelDamage > gain && gain > 0) - funnelDamage = gain; + if (funnelDamage > healInfo.GetEffectiveHeal() && healInfo.GetEffectiveHeal()) + funnelDamage = healInfo.GetEffectiveHeal(); uint32 funnelAbsorb = 0; caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb); @@ -5791,10 +5856,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 procEx = (crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT) | PROC_EX_INTERNAL_HOT; + uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; // ignore item heals if (!haveCastItem) - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_NONE, hitMask, nullptr, nullptr, &healInfo); } void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const @@ -5965,15 +6030,41 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE) | PROC_EX_INTERNAL_DOT; + uint32 hitMask = createProcHitMask(&damageInfo, SPELL_MISS_NONE); + uint32 spellTypeMask = PROC_SPELL_TYPE_NO_DMG_HEAL; if (damageInfo.damage) + { procVictim |= PROC_FLAG_TAKEN_DAMAGE; + spellTypeMask |= PROC_SPELL_TYPE_DAMAGE; + } - caster->ProcDamageAndSpell(damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, BASE_ATTACK, spellProto); + DamageInfo dotDamageInfo(damageInfo, DOT, BASE_ATTACK, hitMask); + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, spellTypeMask, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &dotDamageInfo, nullptr); caster->DealSpellDamage(&damageInfo, true); } +void AuraEffect::HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) +{ + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo) + return; + + // aura own damage at apply won't break CC + if (eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo == GetSpellInfo()) + return; + } + + int32 damageLeft = GetAmount(); + if (damageLeft < int32(damageInfo->GetDamage())) + aurApp->GetTarget()->RemoveAura(aurApp); + else + SetAmount(damageLeft - damageInfo->GetDamage()); +} + void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { Unit* triggerCaster = aurApp->GetTarget(); @@ -5986,7 +6077,7 @@ void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEve triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); } else - TC_LOG_DEBUG("spells","AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); + TC_LOG_ERROR("spells","AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); } void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) @@ -6002,7 +6093,7 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, NULL, NULL, true, NULL, this); } else - TC_LOG_DEBUG("spells","AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); + TC_LOG_ERROR("spells","AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); } void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index a93b16e1f8..4d4e121307 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -46,8 +46,6 @@ class TC_GAME_API AuraEffect template void GetApplicationList(Container& applicationContainer) const; - SpellModifier* GetSpellModifier() const { return m_spellmod; } - SpellInfo const* GetSpellInfo() const { return m_spellInfo; } uint32 GetId() const { return m_spellInfo->Id; } uint32 GetEffIndex() const { return m_effIndex; } @@ -95,8 +93,9 @@ class TC_GAME_API AuraEffect bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; } void SendTickImmune(Unit* target, Unit* caster) const; - void PeriodicTick(AuraApplication * aurApp, Unit* caster) const; + void PeriodicTick(AuraApplication* aurApp, Unit* caster) const; + bool CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) const; void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void CleanupTriggeredSpells(Unit* target); @@ -314,6 +313,7 @@ class TC_GAME_API AuraEffect void HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const; // aura effect proc handlers + void HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 2d808550fd..97ab83a410 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -738,7 +738,7 @@ int32 Aura::CalcMaxDuration(Unit* caster) const // IsPermanent() checks max duration (which we are supposed to calculate here) if (maxDuration != -1 && modOwner) - modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration); + modOwner->ApplySpellMod(GetId(), maxDuration); return maxDuration; } @@ -748,7 +748,7 @@ void Aura::SetDuration(int32 duration, bool withMods) if (withMods) if (Unit* caster = GetCaster()) if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, duration); + modOwner->ApplySpellMod(GetId(), duration); m_duration = duration; SetNeedClientUpdateForTargets(); @@ -819,7 +819,7 @@ uint8 Aura::CalcMaxCharges(Unit* caster) const if (caster) if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges); + modOwner->ApplySpellMod(GetId(), maxProcCharges); return uint8(maxProcCharges); } @@ -927,12 +927,6 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode) // reset charges SetCharges(CalcMaxCharges()); - // FIXME: not a best way to synchronize charges, but works - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (AuraEffect* aurEff = GetEffect(i)) - if (aurEff->GetAuraType() == SPELL_AURA_ADD_FLAT_MODIFIER || aurEff->GetAuraType() == SPELL_AURA_ADD_PCT_MODIFIER) - if (SpellModifier* mod = aurEff->GetSpellModifier()) - mod->charges = GetCharges(); } SetNeedClientUpdateForTargets(); @@ -1071,7 +1065,7 @@ int32 Aura::CalcDispelChance(Unit const* auraTarget, bool offensive) const // Apply dispel mod from aura caster if (Unit* caster = GetCaster()) if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetId(), SPELLMOD_RESIST_DISPEL_CHANCE, resistChance); + modOwner->ApplySpellMod(GetId(), resistChance); // Dispel resistance from target SPELL_AURA_MOD_DISPEL_RESIST // Only affects offensive dispels @@ -1128,7 +1122,7 @@ void Aura::HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply) m_effects[i]->HandleEffect(aurApp, mode, apply); } -void Aura::GetApplicationList(std::list & applicationList) const +void Aura::GetApplicationList(Unit::AuraApplicationList& applicationList) const { for (Aura::ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) { @@ -1720,49 +1714,76 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf } SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()); - ASSERT(procEntry); // cooldowns should be added to the whole aura (see 51698 area aura) AddProcCooldown(now + procEntry->Cooldown); } -bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const +uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const { SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()); // only auras with spell proc entry can trigger proc if (!procEntry) - return false; + return 0; // check if we have charges to proc with - if (IsUsingCharges() && !GetCharges()) - return false; + if (IsUsingCharges()) + { + if (!GetCharges()) + return 0; + + if (procEntry->AttributesMask & PROC_ATTR_REQ_SPELLMOD) + if (Spell const* spell = eventInfo.GetProcSpell()) + if (!spell->m_appliedMods.count(const_cast(this))) + return 0; + } // check proc cooldown if (IsProcOnCooldown(now)) - return false; - - /// @todo - // something about triggered spells triggering, and add extra attack effect + return 0; // do checks against db data if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) - return false; + return 0; + + // check if aura can proc when spell is triggered + if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) + if (Spell const* spell = eventInfo.GetProcSpell()) + if (spell->IsTriggered()) + if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED)) + return 0; // do checks using conditions table if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPELL_PROC, GetId(), eventInfo.GetActor(), eventInfo.GetActionTarget())) - return false; + return 0; // AuraScript Hook bool check = const_cast(this)->CallScriptCheckProcHandlers(aurApp, eventInfo); if (!check) - return false; + return 0; + + // At least one effect has to pass checks to proc aura + uint8 procEffectMask = 0; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (aurApp->HasEffect(i)) + if (GetEffect(i)->CheckEffectProc(aurApp, eventInfo)) + procEffectMask |= (1 << i); + + if (!procEffectMask) + return 0; /// @todo // do allow additional requirements for procs // this is needed because this is the last moment in which you can prevent aura charge drop on proc // and possibly a way to prevent default checks (if there're going to be any) + // Aura added by spell can't trigger from self (prevent drop charges/do triggers) + // But except periodic and kill triggers (can triggered from self) + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo->Id == GetId() && !(eventInfo.GetTypeMask() & (PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_KILL))) + return 0; + // Check if current equipment meets aura requirements // do that only for passive spells /// @todo this needs to be unified for all kinds of auras @@ -1772,12 +1793,12 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_WEAPON) { if (target->ToPlayer()->IsInFeralForm()) - return false; + return 0; - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - WeaponAttackType attType = eventInfo.GetDamageInfo()->GetAttackType(); - Item* item = NULL; + WeaponAttackType attType = damageInfo->GetAttackType(); + Item* item = nullptr; if (attType == BASE_ATTACK) item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); else if (attType == OFF_ATTACK) @@ -1785,20 +1806,23 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI else item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED); - if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask)) - return false; + if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1 << item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask)) + return 0; } } else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR) { // Check if player is wearing shield Item* item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask)) - return false; + if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1 << item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask)) + return 0; } } - return roll_chance_f(CalcProcChance(*procEntry, eventInfo)); + if (roll_chance_f(CalcProcChance(*procEntry, eventInfo))) + return procEffectMask; + + return 0; } float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const @@ -1816,21 +1840,28 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event } // apply chance modifer aura, applies also to ppm chance (see improved judgement of light spell) if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetId(), SPELLMOD_CHANCE_OF_SUCCESS, chance); + modOwner->ApplySpellMod(GetId(), chance); } return chance; } -void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) +void Aura::TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo) { - CallScriptProcHandlers(aurApp, eventInfo); + bool prevented = CallScriptProcHandlers(aurApp, eventInfo); + if (!prevented) + { + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (!(procEffectMask & (1 << i))) + continue; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (aurApp->HasEffect(i)) // OnEffectProc / AfterEffectProc hooks handled in AuraEffect::HandleProc() - GetEffect(i)->HandleProc(aurApp, eventInfo); + if (aurApp->HasEffect(i)) + GetEffect(i)->HandleProc(aurApp, eventInfo); + } - CallScriptAfterProcHandlers(aurApp, eventInfo); + CallScriptAfterProcHandlers(aurApp, eventInfo); + } // Remove aura if we've used last charge to proc if (IsUsingCharges() && !GetCharges()) @@ -2188,6 +2219,23 @@ void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventI } } +bool Aura::CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo) +{ + bool result = true; + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + { + (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC, aurApp); + std::list::iterator hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin(); + for (; hookItr != hookItrEnd; ++hookItr) + if (hookItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) + result &= hookItr->Call(*scritr, aurEff, eventInfo); + + (*scritr)->_FinishScriptCall(); + } + + return result; +} + bool Aura::CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool preventDefault = false; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 803954e817..4ebe087d84 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -199,18 +199,14 @@ class TC_GAME_API Aura bool CheckAreaTarget(Unit* target); bool CanStackWith(Aura const* existingAura) const; - // Proc system - // this subsystem is not yet in use - the core of it is functional, but still some research has to be done - // and some dependant problems fixed before it can replace old proc system (for example cooldown handling) - // currently proc system functionality is implemented in Unit::ProcDamageAndSpell bool IsProcOnCooldown(std::chrono::steady_clock::time_point now) const; void AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd); bool IsUsingCharges() const { return m_isUsingCharges; } void SetUsingCharges(bool val) { m_isUsingCharges = val; } void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now); - bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; + uint8 IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; - void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo); + void TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo); // AuraScript void LoadScripts(); @@ -233,6 +229,7 @@ class TC_GAME_API Aura void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount); // Spell Proc Hooks bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); + bool CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3cee8500d6..322fcce3ba 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -597,7 +597,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO m_healing = 0; m_procAttacker = 0; m_procVictim = 0; - m_procEx = 0; + m_hitMask = 0; focusObject = NULL; m_cast_count = 0; m_glyphIndex = 0; @@ -1495,7 +1495,7 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg { uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTarget; if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this); + modOwner->ApplySpellMod(m_spellInfo->Id, maxTargets, this); if (maxTargets > 1) { @@ -1964,12 +1964,11 @@ GameObject* Spell::SearchSpellFocus() return focus; } -void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/) +void Spell::prepareDataForTriggerSystem() { //========================================================================================== // Now fill data for trigger system, need know: - // can spell trigger another or not (m_canTrigger) - // Create base triggers flags for Attacker and Victim (m_procAttacker, m_procVictim and m_procEx) + // Create base triggers flags for Attacker and Victim (m_procAttacker, m_procVictim and m_hitMask) //========================================================================================== m_procVictim = m_procAttacker = 0; @@ -1999,7 +1998,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/) break; default: if (m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && - m_spellInfo->EquippedItemSubClassMask & (1<EquippedItemSubClassMask & (1 << ITEM_SUBCLASS_WEAPON_WAND) && m_spellInfo->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG)) // Wands auto attack { m_procAttacker = PROC_FLAG_DONE_RANGED_AUTO_ATTACK; @@ -2008,7 +2007,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/) // For other spells trigger procflags are set in Spell::DoAllEffectOnTarget // Because spell positivity is dependant on target } - m_procEx = PROC_EX_NONE; + m_hitMask = PROC_HIT_NONE; // Hunter trap spells - activation proc for Lock and Load, Entrapment and Misdirection if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && @@ -2019,29 +2018,12 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/) m_procAttacker |= PROC_FLAG_DONE_TRAP_ACTIVATION; } - /* Effects which are result of aura proc from triggered spell cannot proc - to prevent chain proc of these spells */ - // Hellfire Effect - trigger as DOT if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[0] & 0x00000040) { m_procAttacker = PROC_FLAG_DONE_PERIODIC; m_procVictim = PROC_FLAG_TAKEN_PERIODIC; } - - // Ranged autorepeat attack is set as triggered spell - ignore it - if (!(m_procAttacker & PROC_FLAG_DONE_RANGED_AUTO_ATTACK)) - { - if (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS && - (m_spellInfo->HasAttribute(SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC) || - m_spellInfo->HasAttribute(SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2))) - m_procEx |= PROC_EX_INTERNAL_CANT_PROC; - else if (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS) - m_procEx |= PROC_EX_INTERNAL_TRIGGERED; - } - // Totem casts require spellfamilymask defined in spell_proc_event to proc - if (m_originalCaster && m_caster != m_originalCaster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->IsTotem() && m_caster->IsControlledByPlayer()) - m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY; } void Spell::CleanupTargetList() @@ -2052,6 +2034,32 @@ void Spell::CleanupTargetList() m_delayMoment = 0; } +class ProcReflectDelayed : public BasicEvent +{ + public: + ProcReflectDelayed(Unit* owner, ObjectGuid casterGuid) : _victim(owner), _casterGuid(casterGuid) { } + + bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override + { + Unit* caster = ObjectAccessor::GetUnit(*_victim, _casterGuid); + if (!caster) + return true; + + uint32 const typeMaskActor = PROC_FLAG_NONE; + uint32 const typeMaskActionTarget = PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG; + uint32 const spellTypeMask = PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL; + uint32 const spellPhaseMask = PROC_SPELL_PHASE_NONE; + uint32 const hitMask = PROC_HIT_REFLECT; + + caster->ProcSkillsAndAuras(_victim, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, nullptr, nullptr, nullptr); + return true; + } + + private: + Unit* _victim; + ObjectGuid _casterGuid; +}; + void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/, bool implicit /*= true*/, Position const* losPosition /*= nullptr*/) { for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) @@ -2135,20 +2143,20 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= targetInfo.timeDelay = uint64(m_spellInfo->Speed * 1000.0f); // Calculate minimum incoming time - if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay) + if (!m_delayMoment || m_delayMoment > targetInfo.timeDelay) m_delayMoment = targetInfo.timeDelay; } else - targetInfo.timeDelay = 0LL; + targetInfo.timeDelay = 0ULL; // If target reflect spell back to caster if (targetInfo.missCondition == SPELL_MISS_REFLECT) { // Calculate reflected spell result on caster - targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect); + targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, false); // can't reflect twice - if (targetInfo.reflectResult == SPELL_MISS_REFLECT) // Impossible reflect again, so simply deflect spell - targetInfo.reflectResult = SPELL_MISS_PARRY; + // Proc spell reflect aura when missile hits the original target + target->m_Events.AddEvent(new ProcReflectDelayed(target, m_originalCasterGUID), target->m_Events.CalculateTime(targetInfo.timeDelay)); // Increase time interval for reflected spells by 1.5 targetInfo.timeDelay += targetInfo.timeDelay >> 1; @@ -2170,14 +2178,14 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask) { switch (m_spellInfo->Effects[effIndex].Effect) { - case SPELL_EFFECT_GAMEOBJECT_DAMAGE: - case SPELL_EFFECT_GAMEOBJECT_REPAIR: - case SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE: - if (go->GetGoType() != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) - effectMask &= ~(1 << effIndex); - break; - default: - break; + case SPELL_EFFECT_GAMEOBJECT_DAMAGE: + case SPELL_EFFECT_GAMEOBJECT_REPAIR: + case SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE: + if (go->GetGoType() != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) + effectMask &= ~(1 << effIndex); + break; + default: + break; } } } @@ -2217,7 +2225,7 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask) else target.timeDelay = uint64(m_spellInfo->Speed * 1000.0f); - if (m_delayMoment == 0 || m_delayMoment > target.timeDelay) + if (!m_delayMoment || m_delayMoment > target.timeDelay) m_delayMoment = target.timeDelay; } else @@ -2326,13 +2334,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Fill base trigger info uint32 procAttacker = m_procAttacker; uint32 procVictim = m_procVictim; - uint32 procEx = m_procEx; + uint32 hitMask = m_hitMask; - m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied + m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied - //Spells with this flag cannot trigger if effect is cast on self - bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2); - Unit* spellHitTarget = NULL; + // Spells with this flag cannot trigger if effect is cast on self + bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2); + Unit* spellHitTarget = nullptr; if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target spellHitTarget = unit; @@ -2360,23 +2368,15 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) if (missInfo2 != SPELL_MISS_MISS) m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo2); m_damage = 0; - spellHitTarget = NULL; + spellHitTarget = nullptr; } } // Do not take combo points on dodge and miss - if (missInfo != SPELL_MISS_NONE && m_needComboPoints && - m_targets.GetUnitTargetGUID() == target->targetGUID) - { + if (missInfo != SPELL_MISS_NONE && m_needComboPoints && m_targets.GetUnitTargetGUID() == target->targetGUID) m_needComboPoints = false; - // Restore spell mods for a miss/dodge/parry Cold Blood - /// @todo check how broad this rule should be - if (m_caster->GetTypeId() == TYPEID_PLAYER && (missInfo == SPELL_MISS_MISS || - missInfo == SPELL_MISS_DODGE || missInfo == SPELL_MISS_PARRY)) - m_caster->ToPlayer()->RestoreSpellMods(this, 14177); - } - // Trigger info was not filled in spell::preparedatafortriggersystem - we do it now + // Trigger info was not filled in Spell::prepareDataForTriggerSystem - we do it now if (canEffectTrigger && !procAttacker && !procVictim) { bool positive = true; @@ -2435,19 +2435,20 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) uint32 addhealth = m_healing; if (crit) { - procEx |= PROC_EX_CRITICAL_HIT; - addhealth = caster->SpellCriticalHealingBonus(m_spellInfo, addhealth, NULL); + hitMask |= PROC_HIT_CRITICAL; + addhealth = caster->SpellCriticalHealingBonus(m_spellInfo, addhealth, nullptr); } else - procEx |= PROC_EX_NORMAL_HIT; + hitMask |= PROC_HIT_NORMAL; - int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit); - unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo); - m_healing = gain; + HealInfo healInfo(caster, unitTarget, addhealth, m_spellInfo, m_spellInfo->GetSchoolMask()); + caster->HealBySpell(healInfo, crit); + unitTarget->getHostileRefManager().threatAssist(caster, float(healInfo.GetEffectiveHeal()) * 0.5f, m_spellInfo); + m_healing = healInfo.GetEffectiveHeal(); - // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); + // Do triggers for unit + if (canEffectTrigger) + caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, nullptr, &healInfo); } // Do damage and triggers else if (m_damage > 0) @@ -2462,16 +2463,18 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Send log damage message to client caster->SendSpellNonMeleeDamageLog(&damageInfo); - procEx |= createProcExtendMask(&damageInfo, missInfo); + hitMask |= createProcHitMask(&damageInfo, missInfo); procVictim |= PROC_FLAG_TAKEN_DAMAGE; - // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) + // Do triggers for unit + if (canEffectTrigger) { - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell); - if (caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) == 0 && - (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) - caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx); + DamageInfo spellDamageInfo(damageInfo, SPELL_DIRECT_DAMAGE, m_attackType, hitMask); + caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, hitMask, this, &spellDamageInfo, nullptr); + + if (caster->GetTypeId() == TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && + (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) + caster->ToPlayer()->CastItemCombatSpell(spellDamageInfo); } m_damage = damageInfo.damage; @@ -2483,10 +2486,17 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) { // Fill base damage struct (unitTarget - is real spell target) SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask); - procEx |= createProcExtendMask(&damageInfo, missInfo); - // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell); + hitMask |= createProcHitMask(&damageInfo, missInfo); + // Do triggers for unit + if (canEffectTrigger) + { + DamageInfo spellNoDamageInfo(damageInfo, NODAMAGE, m_attackType, hitMask); + caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_NO_DMG_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, &spellNoDamageInfo, nullptr); + + if (caster->GetTypeId() == TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && + (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) + caster->ToPlayer()->CastItemCombatSpell(spellNoDamageInfo); + } // Failed Pickpocket, reveal rogue if (missInfo == SPELL_MISS_RESIST && m_spellInfo->HasAttribute(SPELL_ATTR0_CU_PICKPOCKET) && unitTarget->GetTypeId() == TYPEID_UNIT) @@ -2857,7 +2867,7 @@ bool Spell::UpdateChanneledTargetList() { range = m_spellInfo->GetMaxRange(m_spellInfo->IsPositive()); if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); + modOwner->ApplySpellMod(m_spellInfo->Id, range, this); // add little tolerance level range += std::min(MAX_SPELL_RANGE_TOLERANCE, range*0.1f); // 10% but no more than MAX_SPELL_RANGE_TOLERANCE @@ -3006,7 +3016,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered } // Prepare data for triggers - prepareDataForTriggerSystem(triggeredByAura); + prepareDataForTriggerSystem(); if (Player* player = m_caster->ToPlayer()) { @@ -3125,10 +3135,6 @@ void Spell::cancel() SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); - // spell is canceled-take mods and clear list - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->RemoveSpellMods(this); - m_appliedMods.clear(); break; @@ -3361,6 +3367,28 @@ void Spell::cast(bool skipCheck) } SetExecutedCurrently(false); + + //if (Creature* creatureCaster = m_caster->ToCreature()) //TODO investigate + // creatureCaster->ReleaseFocus(this); + + if (!m_originalCaster) + return; + + // Handle procs on cast + uint32 procAttacker = m_procAttacker; + if (!procAttacker) + { + if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC) + procAttacker = m_spellInfo->IsPositive() ? PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS : PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; + else + procAttacker = m_spellInfo->IsPositive() ? PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS : PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG; + } + + uint32 hitMask = m_hitMask; + if (!(hitMask & PROC_HIT_CRITICAL)) + hitMask |= PROC_HIT_NORMAL; + + m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr); } void Spell::handle_immediate() @@ -3374,7 +3402,7 @@ void Spell::handle_immediate() // First mod_duration then haste - see Missile Barrage // Apply duration mod if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, duration); // Apply haste mods m_caster->ModSpellDurationTime(m_spellInfo, duration, this); @@ -3517,22 +3545,8 @@ void Spell::_handle_immediate_phase() } // process items - for (std::list::iterator ihit= m_UniqueItemInfo.begin(); ihit != m_UniqueItemInfo.end(); ++ihit) + for (std::list::iterator ihit = m_UniqueItemInfo.begin(); ihit != m_UniqueItemInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); - - if (!m_originalCaster) - return; - // Handle procs on cast - /// @todo finish new proc system:P - if (m_UniqueTargetInfo.empty() && m_targets.HasDst()) - { - uint32 procAttacker = m_procAttacker; - if (!procAttacker) - procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; - - // Proc the spells that have DEST target - m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); - } } void Spell::_handle_finish_phase() @@ -3559,7 +3573,24 @@ void Spell::_handle_finish_phase() m_caster->m_extraAttacks = 0; } - /// @todo trigger proc phase finish here + // Handle procs on finish + if (!m_originalCaster) + return; + + uint32 procAttacker = m_procAttacker; + if (!procAttacker) + { + if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC) + procAttacker = m_spellInfo->IsPositive() ? PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS : PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; + else + procAttacker = m_spellInfo->IsPositive() ? PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS : PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG; + } + + uint32 hitMask = m_hitMask; + if (!(hitMask & PROC_HIT_CRITICAL)) + hitMask |= PROC_HIT_NORMAL; + + m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_FINISH, hitMask, this, nullptr, nullptr); } void Spell::SendSpellCooldown() @@ -3729,18 +3760,6 @@ void Spell::finish(bool ok) m_caster->ToPlayer()->UpdatePotionCooldown(this); } - if (Player* modOwner = m_caster->GetSpellModOwner()) - { - // triggered spell pointer can be not set in some cases - // this is needed for proper apply of triggered spell mods - modOwner->SetSpellModTakingSpell(this, true); - - // Take mods after trigger spell (needed for 14177 to affect 48664) - // mods are taken only on succesfull cast and independantly from targets of the spell - modOwner->RemoveSpellMods(this); - modOwner->SetSpellModTakingSpell(this, false); - } - // Stop Attack for some spells if (m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET)) m_caster->AttackStop(); @@ -4544,7 +4563,7 @@ void Spell::TakePower() hit = false; //lower spell cost on fail (by talent aura) if (Player* modOwner = m_caster->ToPlayer()->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost); + modOwner->ApplySpellMod(m_spellInfo->Id, m_powerCost); } break; } @@ -4633,7 +4652,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) const { runeCost[i] = src->RuneCost[i]; if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCost[i], const_cast(this)); + modOwner->ApplySpellMod(m_spellInfo->Id, runeCost[i], const_cast(this)); } runeCost[RUNE_DEATH] = MAX_RUNES; // calculated later @@ -4673,7 +4692,7 @@ void Spell::TakeRunePower(bool didHit) { runeCost[i] = runeCostData->RuneCost[i]; if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCost[i], this); + modOwner->ApplySpellMod(m_spellInfo->Id, runeCost[i], this); } // Let's say we use a skill that requires a Frost rune. This is the order: @@ -4875,7 +4894,7 @@ void Spell::HandleHolyPower(Player* caster) // The spell did hit the target, apply aura cost mods if there are any. if (hit) { - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, m_powerCost); + modOwner->ApplySpellMod(m_spellInfo->Id, m_powerCost, this); m_caster->ModifyPower(POWER_HOLY_POWER, -m_powerCost); } } @@ -6100,7 +6119,7 @@ std::pair Spell::GetMinMaxRange(bool strict) const maxRange *= ranged->GetTemplate()->RangedModRange * 0.01f; if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, maxRange, const_cast(this)); + modOwner->ApplySpellMod(m_spellInfo->Id, maxRange, const_cast(this)); maxRange += rangeMod; @@ -6670,7 +6689,7 @@ void Spell::Delayed() // only called in DealDamage() //check pushback reduce int32 delaytime = 500; // spellcasting delay is normally 500ms int32 delayReduce = 100; // must be initialized to 100 for percent modifiers - m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this); + m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, delayReduce, this); delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100; if (delayReduce >= 100) return; @@ -6708,7 +6727,7 @@ void Spell::DelayedChannel() int32 delaytime = CalculatePct(duration, 25); // channeling delay is normally 25% of its time per hit int32 delayReduce = 100; // must be initialized to 100 for percent modifiers - m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this); + m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, delayReduce, this); delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100; if (delayReduce >= 100) return; @@ -7631,8 +7650,8 @@ void Spell::TriggerGlobalCooldown() if (m_spellInfo->StartRecoveryTime >= MIN_GCD && m_spellInfo->StartRecoveryTime <= MAX_GCD) { // gcd modifier auras are applied only to own spells and only players have such mods - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this); + if (Player* modOwner = m_caster->GetSpellModOwner()) + modOwner->ApplySpellMod(m_spellInfo->Id, gcd, this); bool isMeleeOrRangedSpell = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED || @@ -7642,6 +7661,9 @@ void Spell::TriggerGlobalCooldown() // Apply haste rating if (gcd > MIN_GCD && ((m_spellInfo->StartRecoveryCategory == 133 && !isMeleeOrRangedSpell))) gcd = std::min(std::max(int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_HASTE)), MIN_GCD), MAX_GCD); + + //gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); //TODO investigate + //RoundToInterval(gcd, MIN_GCD, MAX_GCD); } m_caster->GetSpellHistory()->AddGlobalCooldown(m_spellInfo, gcd); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 67b4b55b61..57195cfedd 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -362,7 +362,7 @@ class TC_GAME_API Spell void EffectUpdatePlayerPhase(SpellEffIndex effIndex); void EffectUpdateZoneAurasAndPhases(SpellEffIndex effIndex); - typedef std::set UsedSpellMods; + typedef std::unordered_set UsedSpellMods; Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = ObjectGuid::Empty, bool skipCheck = false); ~Spell(); @@ -596,8 +596,8 @@ class TC_GAME_API Spell // ****************************************** uint32 m_procAttacker; // Attacker trigger flags uint32 m_procVictim; // Victim trigger flags - uint32 m_procEx; - void prepareDataForTriggerSystem(AuraEffect const* triggeredByAura); + uint32 m_hitMask; + void prepareDataForTriggerSystem(); // ***************************************** // Spell target subsystem diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ba061d1c51..a03743acba 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1336,7 +1336,8 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL); healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL); - m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain)); + HealInfo healInfo(m_caster, m_caster, healthGain, m_spellInfo, m_spellSchoolMask); + m_caster->HealBySpell(healInfo); } } @@ -2029,7 +2030,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = m_originalCaster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, duration); TempSummon* summon = NULL; @@ -5225,18 +5226,8 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) m_runesState = m_caster->ToPlayer()->GetRunesState(); uint32 count = damage; - if (count == 0) count = 1; - for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j) - { - if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue)) - { - if (m_spellInfo->Id == 45529) - if (player->GetBaseRune(j) != RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) - continue; - player->SetRuneCooldown(j, 0); - --count; - } - } + if (count == 0) + count = 1; // Blood Tap if (m_spellInfo->Id == 45529 && count > 0) @@ -5244,11 +5235,12 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) for (uint32 l = 0; l + 1 < MAX_RUNES && count > 0; ++l) { // Check if both runes are on cd as that is the only time when this needs to come into effect - if ((player->GetRuneCooldown(l) && player->GetBaseRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetBaseRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB))) + if ((player->GetRuneCooldown(l) && player->GetBaseRune(l) == RUNE_BLOOD) && (player->GetRuneCooldown(l + 1) && player->GetBaseRune(l + 1) == RUNE_BLOOD)) { // Should always update the rune with the lowest cd - if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1)) - l++; + if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1)) + ++l; + player->SetRuneCooldown(l, 0); --count; // is needed to push through to the client that the rune is active @@ -5259,6 +5251,15 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) } } + for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j) + { + if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue)) + { + player->SetRuneCooldown(j, 0); + --count; + } + } + // Empower rune weapon if (m_spellInfo->Id == 47568) { @@ -5268,7 +5269,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) for (uint32 i = 0; i < MAX_RUNES; ++i) { - if (player->GetRuneCooldown(i) && (player->GetCurrentRune(i) == RUNE_FROST || player->GetCurrentRune(i) == RUNE_DEATH)) + if (player->GetRuneCooldown(i) && (player->GetBaseRune(i) == RUNE_FROST)) player->SetRuneCooldown(i, 0); } } @@ -5402,7 +5403,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = m_originalCaster->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, duration); //TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; Map* map = caster->GetMap(); diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index d0093b00e3..0609912715 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -304,10 +304,10 @@ void SpellHistory::StartCooldown(SpellInfo const* spellInfo, uint32 itemId, Spel if (Player* modOwner = _owner->GetSpellModOwner()) { if (cooldown > 0) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, cooldown, spell); + modOwner->ApplySpellMod(spellInfo->Id, cooldown, spell); if (categoryCooldown > 0 && !spellInfo->HasAttribute(SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS)) - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, categoryCooldown, spell); + modOwner->ApplySpellMod(spellInfo->Id, categoryCooldown, spell); } if (_owner->HasAuraTypeWithAffectMask(SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE, spellInfo)) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 422a1d1738..a8f2b56936 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -594,7 +594,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const { float multiplier = ValueMultiplier; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) - modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell); + modOwner->ApplySpellMod(_spellInfo->Id, multiplier, spell); return multiplier; } @@ -602,7 +602,7 @@ float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const { float multiplierPercent = DamageMultiplier * 100.0f; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) - modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplierPercent, spell); + modOwner->ApplySpellMod(_spellInfo->Id, multiplierPercent, spell); return multiplierPercent / 100.0f; } @@ -631,7 +631,7 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const radius += entry->RadiusPerLevel * caster->getLevel(); radius = std::min(radius, entry->RadiusMax); if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell); + modOwner->ApplySpellMod(_spellInfo->Id, radius, spell); } return radius; @@ -2766,7 +2766,7 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const range = RangeEntry->maxRangeHostile; if (caster) if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell); + modOwner->ApplySpellMod(Id, range, spell); return range; } @@ -2932,7 +2932,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c // Apply cost mod by spell if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(Id, SPELLMOD_COST, powerCost); + modOwner->ApplySpellMod(Id, powerCost); if (!caster->IsControlledByPlayer()) { @@ -3118,7 +3118,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const } break; case SPELLFAMILY_MAGE: - // Ignite + // Impact if (SpellIconID == 45) return true; // Arcane Missiles diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4d6086f967..7b7f41466c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -18,6 +18,7 @@ #include "SpellMgr.h" #include "SpellInfo.h" +#include "Spell.h" #include "ObjectMgr.h" #include "SpellAuraDefines.h" #include "SharedDefines.h" @@ -784,171 +785,6 @@ SpellGroupStackRule SpellMgr::GetSpellGroupStackRule(SpellGroup group) const return SPELL_GROUP_STACK_RULE_DEFAULT; } -SpellProcEventEntry const* SpellMgr::GetSpellProcEvent(uint32 spellId) const -{ - SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId); - if (itr != mSpellProcEventMap.end()) - return &itr->second; - return NULL; -} - -bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellInfo const* procSpell, uint32 procFlags, uint32 procExtra, bool active) const -{ - // No extra req need - uint32 procEvent_procEx = PROC_EX_NONE; - - // check prockFlags for condition - if ((procFlags & EventProcFlag) == 0) - return false; - - bool hasFamilyMask = false; - - /** - - * @brief Check auras procced by periodics - - *Only damaging Dots can proc auras with PROC_FLAG_TAKEN_DAMAGE - - *Only Dots can proc if ONLY has PROC_FLAG_DONE_PERIODIC or PROC_FLAG_TAKEN_PERIODIC. - - *Hots can proc if ONLY has PROC_FLAG_DONE_PERIODIC and spellfamily != 0 - - *Only Dots can proc auras with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG - - *Only Hots can proc auras with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS or PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS - - *Only Dots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG - - *Only Hots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS - - * @param procSpell the spell proccing the aura - * @param procFlags proc_flags of spellProc - * @param procExtra proc_EX of procSpell - * @param EventProcFlag proc_flags of aura to be procced - * @param spellProto SpellInfo of aura to be procced - - */ - - /// Quick Check - If PROC_FLAG_TAKEN_DAMAGE is set for aura and procSpell dealt damage, proc no matter what kind of spell that deals the damage. - if (procFlags & PROC_FLAG_TAKEN_DAMAGE && EventProcFlag & PROC_FLAG_TAKEN_DAMAGE) - return true; - - if (procFlags & PROC_FLAG_DONE_PERIODIC && EventProcFlag & PROC_FLAG_DONE_PERIODIC) - { - if (procExtra & PROC_EX_INTERNAL_HOT) - { - if (EventProcFlag == PROC_FLAG_DONE_PERIODIC) - { - /// no aura with only PROC_FLAG_DONE_PERIODIC and spellFamilyName == 0 can proc from a HOT. - if (!spellProto->SpellFamilyName) - return false; - } - /// Aura must have positive procflags for a HOT to proc - else if (!(EventProcFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS))) - return false; - } - /// Aura must have negative or neutral(PROC_FLAG_DONE_PERIODIC only) procflags for a DOT to proc - else if (EventProcFlag != PROC_FLAG_DONE_PERIODIC) - if (!(EventProcFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG))) - return false; - } - - if (procFlags & PROC_FLAG_TAKEN_PERIODIC && EventProcFlag & PROC_FLAG_TAKEN_PERIODIC) - { - if (procExtra & PROC_EX_INTERNAL_HOT) - { - /// No aura that only has PROC_FLAG_TAKEN_PERIODIC can proc from a HOT. - if (EventProcFlag == PROC_FLAG_TAKEN_PERIODIC) - return false; - /// Aura must have positive procflags for a HOT to proc - if (!(EventProcFlag & (PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS))) - return false; - } - /// Aura must have negative or neutral(PROC_FLAG_TAKEN_PERIODIC only) procflags for a DOT to proc - else if (EventProcFlag != PROC_FLAG_TAKEN_PERIODIC) - if (!(EventProcFlag & (PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG))) - return false; - } - // Trap casts are active by default - if (procFlags & PROC_FLAG_DONE_TRAP_ACTIVATION) - active = true; - - // Always trigger for this - if (procFlags & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_DEATH)) - return true; - - if (spellProcEvent) // Exist event data - { - // Store extra req - procEvent_procEx = spellProcEvent->procEx; - - // For melee triggers - if (procSpell == NULL) - { - // Check (if set) for school (melee attack has Normal school) - if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0) - return false; - } - else // For spells need check school/spell family/family mask - { - // Check (if set) for school - if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & procSpell->SchoolMask) == 0) - return false; - - // Check (if set) for spellFamilyName - if (spellProcEvent->spellFamilyName && (spellProcEvent->spellFamilyName != procSpell->SpellFamilyName)) - return false; - - // spellFamilyName is Ok need check for spellFamilyMask if present - if (spellProcEvent->spellFamilyMask) - { - if (!(spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags)) - return false; - hasFamilyMask = true; - // Some spells are not considered as active even with spellfamilyflags set - if (!(procEvent_procEx & PROC_EX_ONLY_ACTIVE_SPELL)) - active = true; - } - } - } - - if (procExtra & (PROC_EX_INTERNAL_REQ_FAMILY)) - { - if (!hasFamilyMask) - return false; - } - - // Check for extra req (if none) and hit/crit - if (procEvent_procEx == PROC_EX_NONE) - { - // No extra req, so can trigger only for hit/crit - spell has to be active - if ((procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && active) - return true; - } - else // Passive spells hits here only if resist/reflect/immune/evade - { - if (procExtra & AURA_SPELL_PROC_EX_MASK) - { - // if spell marked as procing only from not active spells - if (active && procEvent_procEx & PROC_EX_NOT_ACTIVE_SPELL) - return false; - // if spell marked as procing only from active spells - if (!active && procEvent_procEx & PROC_EX_ONLY_ACTIVE_SPELL) - return false; - // Exist req for PROC_EX_EX_TRIGGER_ALWAYS - if (procEvent_procEx & PROC_EX_EX_TRIGGER_ALWAYS) - return true; - // PROC_EX_NOT_ACTIVE_SPELL and PROC_EX_ONLY_ACTIVE_SPELL flags handle: if passed checks before - if ((procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && ((procEvent_procEx & (AURA_SPELL_PROC_EX_MASK)) == 0)) - return true; - } - // Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other) - if (procEvent_procEx & procExtra) - return true; - } - return false; -} - SpellProcEntry const* SpellMgr::GetSpellProcEntry(uint32 spellId) const { SpellProcMap::const_iterator itr = mSpellProcMap.find(spellId); @@ -969,10 +805,31 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE if (eventInfo.GetActionTarget() && !actor->isHonorOrXPTarget(eventInfo.GetActionTarget())) return false; + // check mana requirement + if (procEntry.AttributesMask & PROC_ATTR_REQ_MANA_COST) + if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo()) + if (!eventSpellInfo->ManaCost && !eventSpellInfo->ManaCostPercentage) + return false; + // always trigger for these types if (eventInfo.GetTypeMask() & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_DEATH)) return true; + // do triggered cast checks + if (!(procEntry.AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) + { + if (Spell const* spell = eventInfo.GetProcSpell()) + { + if (spell->IsTriggered()) + { + SpellInfo const* spellInfo = spell->GetSpellInfo(); + if (!spellInfo->HasAttribute(SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2) && + !spellInfo->HasAttribute(SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC)) + return false; + } + } + } + // check school mask (if set) for other trigger types if (procEntry.SchoolMask && !(eventInfo.GetSchoolMask() & procEntry.SchoolMask)) return false; @@ -1903,91 +1760,69 @@ void SpellMgr::LoadSpellGroupStackRules() TC_LOG_INFO("server.loading", ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -void SpellMgr::LoadSpellProcEvents() +// Used for prepare can/can't triggr aura +static bool InitTriggerAuraData(); +// Define can trigger auras +static bool isTriggerAura[TOTAL_AURAS]; +// Triggered always, even from triggered spells +static bool isAlwaysTriggeredAura[TOTAL_AURAS]; +// Prepare lists +static bool procPrepared = InitTriggerAuraData(); + +// List of auras that CAN be trigger but may not exist in spell_proc_event +// in most case need for drop charges +// in some types of aura need do additional check +// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic +bool InitTriggerAuraData() { - uint32 oldMSTime = getMSTime(); - - mSpellProcEventMap.clear(); // need for reload case - - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); - if (!result) + for (uint16 i = 0; i < TOTAL_AURAS; ++i) { - TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); - return; + isTriggerAura[i] = false; + isAlwaysTriggeredAura[i] = false; } + isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting. Remove? + isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets" + isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus + isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; + isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; + isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_ROOT] = true; + isTriggerAura[SPELL_AURA_TRANSFORM] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; + isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; + isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; + isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; + isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; + isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; + isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; - uint32 count = 0; + isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; + isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; + isAlwaysTriggeredAura[SPELL_AURA_SPELL_MAGNET] = true; + isAlwaysTriggeredAura[SPELL_AURA_SCHOOL_ABSORB] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; - do - { - Field* fields = result->Fetch(); - - int32 spellId = fields[0].GetInt32(); - - bool allRanks = false; - if (spellId < 0) - { - allRanks = true; - spellId = -spellId; - } - - SpellInfo const* spellInfo = GetSpellInfo(spellId); - if (!spellInfo) - { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` does not exist.", spellId); - continue; - } - - if (allRanks) - { - if (!spellInfo->IsRanked()) - TC_LOG_ERROR("sql.sql", "The spell %u is listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId); - - if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) - { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` is not first rank of spell.", spellId); - continue; - } - } - - SpellProcEventEntry spellProcEvent; - - spellProcEvent.schoolMask = fields[1].GetInt8(); - spellProcEvent.spellFamilyName = fields[2].GetUInt16(); - spellProcEvent.spellFamilyMask[0] = fields[3].GetUInt32(); - spellProcEvent.spellFamilyMask[1] = fields[4].GetUInt32(); - spellProcEvent.spellFamilyMask[2] = fields[5].GetUInt32(); - spellProcEvent.procFlags = fields[6].GetUInt32(); - spellProcEvent.procEx = fields[7].GetUInt32(); - spellProcEvent.ppmRate = fields[8].GetFloat(); - spellProcEvent.customChance = fields[9].GetFloat(); - spellProcEvent.cooldown = fields[10].GetUInt32(); - - while (spellInfo) - { - if (mSpellProcEventMap.find(spellInfo->Id) != mSpellProcEventMap.end()) - { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->Id); - break; - } - - if (!spellInfo->ProcFlags && !spellProcEvent.procFlags) - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` is probably not a triggered spell.", spellInfo->Id); - - mSpellProcEventMap[spellInfo->Id] = spellProcEvent; - - if (allRanks) - spellInfo = spellInfo->GetNextRankSpell(); - else - break; - } - - ++count; - } - while (result->NextRow()); - - TC_LOG_INFO("server.loading", ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + return true; } void SpellMgr::LoadSpellProcs() @@ -2001,126 +1836,200 @@ void SpellMgr::LoadSpellProcs() // 6 7 8 9 10 11 12 13 14 "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc"); - if (!result) - { - TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); - return; - } - uint32 count = 0; - do + if (result) { - Field* fields = result->Fetch(); - - int32 spellId = fields[0].GetInt32(); - - bool allRanks = false; - if (spellId < 0) + do { - allRanks = true; - spellId = -spellId; - } + Field* fields = result->Fetch(); - SpellInfo const* spellInfo = GetSpellInfo(spellId); - if (!spellInfo) - { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` does not exist", spellId); - continue; - } + int32 spellId = fields[0].GetInt32(); - if (allRanks) - { - if (!spellInfo->IsRanked()) - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId); - - if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) + bool allRanks = false; + if (spellId < 0) { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` is not the first rank of the spell.", spellId); + allRanks = true; + spellId = -spellId; + } + + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) + { + TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` does not exist", spellId); continue; } - } - - SpellProcEntry baseProcEntry; - - baseProcEntry.SchoolMask = fields[1].GetInt8(); - baseProcEntry.SpellFamilyName = fields[2].GetUInt16(); - baseProcEntry.SpellFamilyMask[0] = fields[3].GetUInt32(); - baseProcEntry.SpellFamilyMask[1] = fields[4].GetUInt32(); - baseProcEntry.SpellFamilyMask[2] = fields[5].GetUInt32(); - baseProcEntry.ProcFlags = fields[6].GetUInt32(); - baseProcEntry.SpellTypeMask = fields[7].GetUInt32(); - baseProcEntry.SpellPhaseMask = fields[8].GetUInt32(); - baseProcEntry.HitMask = fields[9].GetUInt32(); - baseProcEntry.AttributesMask = fields[10].GetUInt32(); - baseProcEntry.ProcsPerMinute = fields[11].GetFloat(); - baseProcEntry.Chance = fields[12].GetFloat(); - baseProcEntry.Cooldown = Milliseconds(fields[13].GetUInt32()); - baseProcEntry.Charges = fields[14].GetUInt8(); - - while (spellInfo) - { - if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) - { - TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` already has its first rank in the table.", spellInfo->Id); - break; - } - - SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); - - // take defaults from dbcs - if (!procEntry.ProcFlags) - procEntry.ProcFlags = spellInfo->ProcFlags; - if (!procEntry.Charges) - procEntry.Charges = spellInfo->ProcCharges; - if (!procEntry.Chance && !procEntry.ProcsPerMinute) - procEntry.Chance = float(spellInfo->ProcChance); - - // validate data - if (procEntry.SchoolMask & ~SPELL_SCHOOL_MASK_ALL) - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SchoolMask` set: %u", spellInfo->Id, procEntry.SchoolMask); - if (procEntry.SpellFamilyName && (procEntry.SpellFamilyName < 3 || procEntry.SpellFamilyName > 17 || procEntry.SpellFamilyName == 14 || procEntry.SpellFamilyName == 16)) - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellFamilyName` set: %u", spellInfo->Id, procEntry.SpellFamilyName); - if (procEntry.Chance < 0) - { - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `Chance` field", spellInfo->Id); - procEntry.Chance = 0; - } - if (procEntry.ProcsPerMinute < 0) - { - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `ProcsPerMinute` field", spellInfo->Id); - procEntry.ProcsPerMinute = 0; - } - if (procEntry.Chance == 0 && procEntry.ProcsPerMinute == 0) - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u doesn't have any `Chance` and `ProcsPerMinute` values defined, proc will not be triggered", spellInfo->Id); - if (!procEntry.ProcFlags) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `ProcFlags` value defined, proc will not be triggered.", spellInfo->Id); - if (procEntry.SpellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL) - TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellTypeMask` set: %u", spellInfo->Id, procEntry.SpellTypeMask); - if (procEntry.SpellTypeMask && !(procEntry.ProcFlags & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `SpellTypeMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id); - if (!procEntry.SpellPhaseMask && procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `SpellPhaseMask` value defined, but it is required for the defined `ProcFlags` value. Proc will not be triggered.", spellInfo->Id); - if (procEntry.SpellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `SpellPhaseMask` set: %u", spellInfo->Id, procEntry.SpellPhaseMask); - if (procEntry.SpellPhaseMask && !(procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK)) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has a `SpellPhaseMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id); - if (procEntry.HitMask & ~PROC_HIT_MASK_ALL) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask); - if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id); - - mSpellProcMap[spellInfo->Id] = procEntry; if (allRanks) - spellInfo = spellInfo->GetNextRankSpell(); - else - break; - } - ++count; + { + if (!spellInfo->IsRanked()) + TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) + { + TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` is not the first rank of the spell.", spellId); + continue; + } + } + + SpellProcEntry baseProcEntry; + + baseProcEntry.SchoolMask = fields[1].GetInt8(); + baseProcEntry.SpellFamilyName = fields[2].GetUInt16(); + baseProcEntry.SpellFamilyMask[0] = fields[3].GetUInt32(); + baseProcEntry.SpellFamilyMask[1] = fields[4].GetUInt32(); + baseProcEntry.SpellFamilyMask[2] = fields[5].GetUInt32(); + baseProcEntry.ProcFlags = fields[6].GetUInt32(); + baseProcEntry.SpellTypeMask = fields[7].GetUInt32(); + baseProcEntry.SpellPhaseMask = fields[8].GetUInt32(); + baseProcEntry.HitMask = fields[9].GetUInt32(); + baseProcEntry.AttributesMask = fields[10].GetUInt32(); + baseProcEntry.ProcsPerMinute = fields[11].GetFloat(); + baseProcEntry.Chance = fields[12].GetFloat(); + baseProcEntry.Cooldown = Milliseconds(fields[13].GetUInt32()); + baseProcEntry.Charges = fields[14].GetUInt8(); + + while (spellInfo) + { + if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) + { + TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` already has its first rank in the table.", spellInfo->Id); + break; + } + + SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); + + // take defaults from dbcs + if (!procEntry.ProcFlags) + procEntry.ProcFlags = spellInfo->ProcFlags; + if (!procEntry.Charges) + procEntry.Charges = spellInfo->ProcCharges; + if (!procEntry.Chance && !procEntry.ProcsPerMinute) + procEntry.Chance = float(spellInfo->ProcChance); + + // validate data + if (procEntry.SchoolMask & ~SPELL_SCHOOL_MASK_ALL) + TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SchoolMask` set: %u", spellInfo->Id, procEntry.SchoolMask); + if (procEntry.SpellFamilyName && (procEntry.SpellFamilyName < SPELLFAMILY_MAGE || procEntry.SpellFamilyName > SPELLFAMILY_PET || procEntry.SpellFamilyName == 14 || procEntry.SpellFamilyName == 16)) + TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellFamilyName` set: %u", spellInfo->Id, procEntry.SpellFamilyName); + if (procEntry.Chance < 0) + { + TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `Chance` field", spellInfo->Id); + procEntry.Chance = 0; + } + if (procEntry.ProcsPerMinute < 0) + { + TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `ProcsPerMinute` field", spellInfo->Id); + procEntry.ProcsPerMinute = 0; + } + if (!procEntry.ProcFlags) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `ProcFlags` value defined, proc will not be triggered.", spellInfo->Id); + if (procEntry.SpellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL) + TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellTypeMask` set: %u", spellInfo->Id, procEntry.SpellTypeMask); + if (procEntry.SpellTypeMask && !(procEntry.ProcFlags & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `SpellTypeMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id); + if (!procEntry.SpellPhaseMask && procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `SpellPhaseMask` value defined, but it is required for the defined `ProcFlags` value. Proc will not be triggered.", spellInfo->Id); + if (procEntry.SpellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `SpellPhaseMask` set: %u", spellInfo->Id, procEntry.SpellPhaseMask); + if (procEntry.SpellPhaseMask && !(procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK)) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has a `SpellPhaseMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id); + if (procEntry.HitMask & ~PROC_HIT_MASK_ALL) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask); + if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id); + + mSpellProcMap[spellInfo->Id] = procEntry; + + if (allRanks) + spellInfo = spellInfo->GetNextRankSpell(); + else + break; + } + ++count; + } while (result->NextRow()); } - while (result->NextRow()); + else + TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); TC_LOG_INFO("server.loading", ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + + // This generates default procs to retain compatibility with previous proc system + TC_LOG_INFO("server.loading", "Generating spell proc data from SpellMap..."); + count = 0; + oldMSTime = getMSTime(); + + for (SpellInfo const* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) + continue; + + bool found = false, addTriggerFlag = false; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (!spellInfo->Effects[i].IsEffect()) + continue; + + uint32 auraName = spellInfo->Effects[i].ApplyAuraName; + if (!auraName) + continue; + + if (!isTriggerAura[auraName]) + continue; + + found = true; + + if (!addTriggerFlag && isAlwaysTriggeredAura[auraName]) + addTriggerFlag = true; + break; + } + + if (!found) + continue; + + if (!spellInfo->ProcFlags) + continue; + + SpellProcEntry procEntry; + procEntry.SchoolMask = 0; + procEntry.SpellFamilyName = spellInfo->SpellFamilyName; + procEntry.ProcFlags = spellInfo->ProcFlags; + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (spellInfo->Effects[i].IsEffect() && isTriggerAura[spellInfo->Effects[i].ApplyAuraName]) + procEntry.SpellFamilyMask |= spellInfo->Effects[i].SpellClassMask; + + procEntry.SpellTypeMask = PROC_SPELL_TYPE_MASK_ALL; + procEntry.SpellPhaseMask = PROC_SPELL_PHASE_HIT; + procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent + + // Reflect auras should only proc off reflects + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS) || spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS_SCHOOL)) + { + procEntry.HitMask = PROC_HIT_REFLECT; + break; + } + } + + procEntry.AttributesMask = 0; + if (spellInfo->ProcFlags & PROC_FLAG_KILL) + procEntry.AttributesMask |= PROC_ATTR_REQ_EXP_OR_HONOR; + if (addTriggerFlag) + procEntry.AttributesMask |= PROC_ATTR_TRIGGERED_CAN_PROC; + + procEntry.ProcsPerMinute = 0; + procEntry.Chance = spellInfo->ProcChance; + procEntry.Cooldown = Milliseconds::zero(); + procEntry.Charges = spellInfo->ProcCharges; + + mSpellProcMap[spellInfo->Id] = procEntry; + ++count; + } + + TC_LOG_INFO("server.loading", ">> Generated spell proc data for %u spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellBonusess() @@ -3108,7 +3017,7 @@ void SpellMgr::LoadSpellInfoCorrections() case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); - spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS_2); + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); break; case 43265: // Death and Decay // We need access to the targets of the dynaura to correctly apply the damage spell @@ -3201,23 +3110,9 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->MaxAffectedTargets = 1; spellInfo->Effects[EFFECT_0].TriggerSpell = 33760; break; - case 17941: // Shadow Trance - case 22008: // Netherwind Focus - case 34477: // Misdirection - case 34936: // Backlash - case 48108: // Hot Streak - case 51124: // Killing Machine - case 54741: // Firestarter - case 57761: // Fireball! - case 64823: // Item - Druid T8 Balance 4P Bonus - case 88819: // Daybreak - case 18820: // Insight - spellInfo->ProcCharges = 1; - break; case 44544: // Fingers of Frost spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); break; - case 74396: // Fingers of Frost visual buff case 53257: // Cobra Strikes spellInfo->ProcCharges = 2; spellInfo->StackAmount = 0; @@ -3227,9 +3122,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 56612: spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x02000000, 0, 0); break; - case 28200: // Ascendance (Talisman of Ascendance trinket) - spellInfo->ProcCharges = 6; - break; case 47201: // Everlasting Affliction (1) case 47202: // Everlasting Affliction (2) case 47203: // Everlasting Affliction (3) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 58900e220a..f00300628c 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -192,43 +192,6 @@ enum ProcFlags PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | \ PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS) -enum ProcFlagsExLegacy -{ - PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag) - PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells) - PROC_EX_CRITICAL_HIT = 0x0000002, - PROC_EX_MISS = 0x0000004, - PROC_EX_RESIST = 0x0000008, - PROC_EX_DODGE = 0x0000010, - PROC_EX_PARRY = 0x0000020, - PROC_EX_BLOCK = 0x0000040, - PROC_EX_EVADE = 0x0000080, - PROC_EX_IMMUNE = 0x0000100, - PROC_EX_DEFLECT = 0x0000200, - PROC_EX_ABSORB = 0x0000400, - PROC_EX_REFLECT = 0x0000800, - PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used) - PROC_EX_FULL_BLOCK = 0x0002000, // block al attack damage - PROC_EX_RESERVED2 = 0x0004000, - PROC_EX_NOT_ACTIVE_SPELL = 0x0008000, // Spell mustn't do damage/heal to proc - PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always no matter of hit result - PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not implemented yet) - PROC_EX_ONLY_ACTIVE_SPELL = 0x0040000, // Spell has to do damage/heal to proc - - // Flags for internal use - do not use these in db! - PROC_EX_INTERNAL_CANT_PROC = 0x0800000, - PROC_EX_INTERNAL_DOT = 0x1000000, - PROC_EX_INTERNAL_HOT = 0x2000000, - PROC_EX_INTERNAL_TRIGGERED = 0x4000000, - PROC_EX_INTERNAL_REQ_FAMILY = 0x8000000 -}; - -#define AURA_SPELL_PROC_EX_MASK \ - (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT | PROC_EX_MISS | \ - PROC_EX_RESIST | PROC_EX_DODGE | PROC_EX_PARRY | PROC_EX_BLOCK | \ - PROC_EX_EVADE | PROC_EX_IMMUNE | PROC_EX_DEFLECT | \ - PROC_EX_ABSORB | PROC_EX_REFLECT | PROC_EX_INTERRUPT) - enum ProcFlagsSpellType { PROC_SPELL_TYPE_NONE = 0x0000000, @@ -269,23 +232,12 @@ enum ProcFlagsHit enum ProcAttributes { - PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000010 + PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000001, // requires proc target to give exp or honor for aura proc + PROC_ATTR_TRIGGERED_CAN_PROC = 0x0000002, // aura can proc even with triggered spells + PROC_ATTR_REQ_MANA_COST = 0x0000004, // requires triggering spell to have a mana cost for aura proc + PROC_ATTR_REQ_SPELLMOD = 0x0000008 // requires triggering spell to be affected by proccing aura to drop charges }; -struct SpellProcEventEntry -{ - uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2 - uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value - flag96 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do) - uint32 procFlags; // bitmask for matching proc event - uint32 procEx; // proc Extend info (see ProcFlagsEx) - float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc - float customChance; // Owerride chance (in most cases for debug only) - uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_ -}; - -typedef std::unordered_map SpellProcEventMap; - struct SpellProcEntry { uint32 SchoolMask; // if nonzero - bitmask for matching proc condition based on spell's school @@ -658,10 +610,6 @@ class TC_GAME_API SpellMgr SpellGroupStackRule CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2) const; SpellGroupStackRule GetSpellGroupStackRule(SpellGroup groupid) const; - // Spell proc event table - SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const; - bool IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellInfo const* procSpell, uint32 procFlags, uint32 procExtra, bool active) const; - // Spell proc table SpellProcEntry const* GetSpellProcEntry(uint32 spellId) const; bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; @@ -720,7 +668,6 @@ class TC_GAME_API SpellMgr void LoadSpellTargetPositions(); void LoadSpellGroups(); void LoadSpellGroupStackRules(); - void LoadSpellProcEvents(); void LoadSpellProcs(); void LoadSpellBonusess(); void LoadSpellThreats(); @@ -750,7 +697,6 @@ class TC_GAME_API SpellMgr SpellSpellGroupMap mSpellSpellGroup; SpellGroupSpellMap mSpellGroupSpell; SpellGroupStackMap mSpellGroupStack; - SpellProcEventMap mSpellProcEventMap; SpellProcMap mSpellProcMap; SpellBonusMap mSpellBonusMap; SpellThreatMap mSpellThreatMap; diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index be545edf87..64656c088b 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -735,6 +735,10 @@ bool AuraScript::_Validate(SpellInfo const* entry) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + for (std::list::iterator itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr) + if (!itr->GetAffectedEffectsMask(entry)) + TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoCheckEffectProc` of AuraScript won't be executed", entry->Id, itr->ToString().c_str(), m_scriptName->c_str()); + for (std::list::iterator itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); @@ -902,6 +906,17 @@ bool AuraScript::CheckProcHandler::Call(AuraScript* auraScript, ProcEventInfo& e return (auraScript->*_HandlerScript)(eventInfo); } +AuraScript::CheckEffectProcHandler::CheckEffectProcHandler(AuraCheckEffectProcFnType handlerScript, uint8 effIndex, uint16 effName) + : AuraScript::EffectBase(effIndex, effName) +{ + _HandlerScript = handlerScript; +} + +bool AuraScript::CheckEffectProcHandler::Call(AuraScript* auraScript, AuraEffect const* aurEff, ProcEventInfo& eventInfo) +{ + return (auraScript->*_HandlerScript)(aurEff, eventInfo); +} + AuraScript::AuraProcHandler::AuraProcHandler(AuraProcFnType handlerScript) { _HandlerScript = handlerScript; @@ -1163,6 +1178,7 @@ Unit* AuraScript::GetTarget() const case AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD: case AURA_SCRIPT_HOOK_EFFECT_SPLIT: case AURA_SCRIPT_HOOK_CHECK_PROC: + case AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC: case AURA_SCRIPT_HOOK_PREPARE_PROC: case AURA_SCRIPT_HOOK_PROC: case AURA_SCRIPT_HOOK_AFTER_PROC: diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 7b9bbffc94..47b04bfcd3 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -470,6 +470,7 @@ enum AuraScriptHookType AURA_SCRIPT_HOOK_AFTER_DISPEL, // Spell Proc Hooks AURA_SCRIPT_HOOK_CHECK_PROC, + AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC, AURA_SCRIPT_HOOK_PREPARE_PROC, AURA_SCRIPT_HOOK_PROC, AURA_SCRIPT_HOOK_EFFECT_PROC, @@ -501,6 +502,7 @@ class TC_GAME_API AuraScript : public _SpellScript typedef void(CLASSNAME::*AuraEffectAbsorbFnType)(AuraEffect*, DamageInfo &, uint32 &); \ typedef void(CLASSNAME::*AuraEffectSplitFnType)(AuraEffect*, DamageInfo &, uint32 &); \ typedef bool(CLASSNAME::*AuraCheckProcFnType)(ProcEventInfo&); \ + typedef bool(CLASSNAME::*AuraCheckEffectProcFnType)(AuraEffect const*, ProcEventInfo&); \ typedef void(CLASSNAME::*AuraProcFnType)(ProcEventInfo&); \ typedef void(CLASSNAME::*AuraEffectProcFnType)(AuraEffect const*, ProcEventInfo&); \ @@ -610,6 +612,14 @@ class TC_GAME_API AuraScript : public _SpellScript private: AuraCheckProcFnType _HandlerScript; }; + class TC_GAME_API CheckEffectProcHandler : public EffectBase + { + public: + CheckEffectProcHandler(AuraCheckEffectProcFnType handlerScript, uint8 effIndex, uint16 effName); + bool Call(AuraScript* auraScript, AuraEffect const* aurEff, ProcEventInfo& eventInfo); + private: + AuraCheckEffectProcFnType _HandlerScript; + }; class TC_GAME_API AuraProcHandler { public: @@ -640,6 +650,7 @@ class TC_GAME_API AuraScript : public _SpellScript class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) { } }; \ class EffectSplitFunction : public AuraScript::EffectSplitHandler { public: EffectSplitFunction(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectSplitHandler((AuraScript::AuraEffectSplitFnType)_pEffectHandlerScript, _effIndex) { } }; \ class CheckProcHandlerFunction : public AuraScript::CheckProcHandler { public: CheckProcHandlerFunction(AuraCheckProcFnType handlerScript) : AuraScript::CheckProcHandler((AuraScript::AuraCheckProcFnType)handlerScript) { } }; \ + class CheckEffectProcHandlerFunction : public AuraScript::CheckEffectProcHandler { public: CheckEffectProcHandlerFunction(AuraCheckEffectProcFnType handlerScript, uint8 effIndex, uint16 effName) : AuraScript::CheckEffectProcHandler((AuraScript::AuraCheckEffectProcFnType)handlerScript, effIndex, effName) { } }; \ class AuraProcHandlerFunction : public AuraScript::AuraProcHandler { public: AuraProcHandlerFunction(AuraProcFnType handlerScript) : AuraScript::AuraProcHandler((AuraScript::AuraProcFnType)handlerScript) { } }; \ class EffectProcHandlerFunction : public AuraScript::EffectProcHandler { public: EffectProcHandlerFunction(AuraEffectProcFnType effectHandlerScript, uint8 effIndex, uint16 effName) : AuraScript::EffectProcHandler((AuraScript::AuraEffectProcFnType)effectHandlerScript, effIndex, effName) { } } @@ -778,6 +789,12 @@ class TC_GAME_API AuraScript : public _SpellScript HookList DoCheckProc; #define AuraCheckProcFn(F) CheckProcHandlerFunction(&F) + // executed when aura effect checks if it can proc the aura + // example: DoCheckEffectProc += AuraCheckEffectProcFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier); + // where function is bool function (AuraEffect const* aurEff, ProcEventInfo& eventInfo); + HookList DoCheckEffectProc; + #define AuraCheckEffectProcFn(F, I, N) CheckEffectProcHandlerFunction(&F, I, N) + // executed before aura procs (possibility to prevent charge drop/cooldown) // example: DoPrepareProc += AuraProcFn(class::function); // where function is: void function (ProcEventInfo& eventInfo); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 8c596bb345..cf5a07bf95 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1574,9 +1574,6 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Spell Learn Spells..."); sSpellMgr->LoadSpellLearnSpells(); - TC_LOG_INFO("server.loading", "Loading Spell Proc Event conditions..."); - sSpellMgr->LoadSpellProcEvents(); - TC_LOG_INFO("server.loading", "Loading Spell Proc conditions and data..."); sSpellMgr->LoadSpellProcs(); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index f8445052f5..983471f750 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -142,7 +142,6 @@ public: { "spell_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSpellCommand, "" }, { "spell_linked_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL, true, &HandleReloadSpellLinkedSpellCommand, "" }, { "spell_pet_auras", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "" }, -// { "spell_proc_event", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC_EVENT, true, &HandleReloadSpellProcEventCommand, "" }, { "spell_proc", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "" }, { "spell_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "" }, { "spell_target_position", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "" }, @@ -274,7 +273,6 @@ public: HandleReloadSpellGroupsCommand(handler, "a"); HandleReloadSpellLearnSpellCommand(handler, "a"); HandleReloadSpellLinkedSpellCommand(handler, "a"); - HandleReloadSpellProcEventCommand(handler, "a"); HandleReloadSpellProcsCommand(handler, "a"); HandleReloadSpellBonusesCommand(handler, "a"); HandleReloadSpellTargetPositionCommand(handler, "a"); @@ -809,14 +807,6 @@ public: return true; } - static bool HandleReloadSpellProcEventCommand(ChatHandler* handler, const char* /*args*/) - { - TC_LOG_INFO("misc", "Re-Loading Spell Proc Event conditions..."); - sSpellMgr->LoadSpellProcEvents(); - handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded."); - return true; - } - static bool HandleReloadSpellProcsCommand(ChatHandler* handler, const char* /*args*/) { TC_LOG_INFO("misc", "Re-Loading Spell Proc conditions and data..."); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index c64773bdce..1407b0a0c4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1192,7 +1192,7 @@ class npc_crok_scourgebane : public CreatureScript } else { - me->DealHeal(me, me->CountPctFromMaxHealth(5)); + me->ModifyHealth(me->CountPctFromMaxHealth(5)); _events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); } break; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 2e2f0735da..53675688b4 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -781,7 +781,7 @@ class spell_warl_health_funnel : public SpellScriptLoader uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount()); if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetId(), SPELLMOD_COST, damage); + modOwner->ApplySpellMod(GetId(), damage); SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); damageInfo.damage = damage; From a40b85f8b267b6e26049691f516961267a341853 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 25 Sep 2016 20:48:31 -0300 Subject: [PATCH 004/110] Core/Scripts: convert some instance/item spells to scripts --- .../world/3.3.5/2016_xx_xx_xx_world.sql | 1115 +++++++++++++++ .../BattleForMountHyjal/boss_anetheron.cpp | 54 +- .../boss_blood_prince_council.cpp | 20 + .../boss_deathbringer_saurfang.cpp | 44 +- .../boss_professor_putricide.cpp | 54 + .../IcecrownCitadel/icecrown_citadel.cpp | 1 + .../Nexus/EyeOfEternity/boss_malygos.cpp | 6 +- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 46 + .../Ulduar/Ulduar/boss_yogg_saron.cpp | 1 + .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 6 +- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 98 +- .../ShadowLabyrinth/shadow_labyrinth.cpp | 66 + .../scripts/Outland/boss_doomlord_kazzak.cpp | 60 +- .../scripts/Outland/outland_script_loader.cpp | 2 + src/server/scripts/Pet/pet_hunter.cpp | 160 +++ src/server/scripts/Pet/pet_priest.cpp | 10 +- src/server/scripts/Spells/spell_generic.cpp | 135 +- src/server/scripts/Spells/spell_item.cpp | 1240 ++++++++++++++++- 18 files changed, 2992 insertions(+), 126 deletions(-) create mode 100644 sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql create mode 100644 src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp diff --git a/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql b/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql new file mode 100644 index 0000000000..6f5ff70297 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql @@ -0,0 +1,1115 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (15290, 59725); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 59725, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Improved Spell Reflection (effect 0) will hit the potential target of the spell if target is not the same as condition target.'), +(13, 1, 15290, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Vampiric Embrace (effect 0) will hit the potential target of the spell if target is not the same as condition target.'); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=24 AND `SourceGroup`=0 AND `SourceEntry` IN (38164,70805); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(24, 0, 38164, 0, 0, 31, 1, 3, 19457, 0, 0, 0, 0, '', 'Spell Unyielding Knights can proc on actionTarget if target is unit Grillok "Darkeye".'), +(24, 0, 70805, 0, 0, 33, 1, 0, 0, 0, 1, 0, 0, '', 'Spell Item - Rogue T10 2P Bonus can proc on actionTarget if target is not the same as condition target.'); + +-- Earth shield heal is DAMAGE_CLASS_NONE, it won't scale +-- Entry is unneeded +DELETE FROM `spell_bonus_data` WHERE `entry`=379; + +-- Remove renamed scripts +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_dummy_trigger','spell_pri_item_greater_heal_refund'); + +-- Stop console spam from dummy EFFECT_2 proc +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_pal_seals'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(20375, 'spell_pal_seals'), -- Seal of Command +(21084, 'spell_pal_seals'), -- Seal of Righteousness +(31801, 'spell_pal_seals'), -- Seal of Vengeance +(31892, 'spell_pal_seals'), -- Seal of Blood +(33127, 'spell_pal_seals'), -- Seal of Command +(38008, 'spell_pal_seals'), -- Seal of Blood +(41459, 'spell_pal_seals'), -- Seal of Blood +(53720, 'spell_pal_seals'), -- Seal of the Martyr +(53736, 'spell_pal_seals'); -- Seal of Corruption + +-- Grouped several hacks and handled with AuraScript now +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mage_fingers_of_frost'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(74396, 'spell_mage_fingers_of_frost'); -- Fingers of Frost + +-- Threat of Thassarian triggered spells, for easier script access +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN (59133,66198,66196,66216,66188,66215); +INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES +(66198, 66198, 1), +(66198, 66972, 2), +(66198, 66973, 3), +(66198, 66974, 4), + +(66196, 66196, 1), +(66196, 66958, 2), +(66196, 66959, 3), +(66196, 66960, 4), +(66196, 66961, 5), +(66196, 66962, 6), + +(66216, 66216, 1), +(66216, 66988, 2), +(66216, 66989, 3), +(66216, 66990, 4), +(66216, 66991, 5), +(66216, 66992, 6), + +(66188, 66188, 1), +(66188, 66950, 2), +(66188, 66951, 3), +(66188, 66952, 4), +(66188, 66953, 5), + +(66215, 66215, 1), +(66215, 66975, 2), +(66215, 66976, 3), +(66215, 66977, 4), +(66215, 66978, 5), +(66215, 66979, 6); + +DELETE FROM `command` WHERE `name`='reload spell_proc_event'; +-- Charges drop (previously hardcoded in SpellMgr::LoadSpellInfoCorrections) +DELETE FROM `spell_proc` WHERE `SpellId` IN (17941, 18820, 22008, 28200, 31834, 32216, 34477, 34936, 44401, 48108, 51124, 54741, 57761, 64823); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(17941, 0, 5, 0x00000001, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 0, 1), -- Shadow Trance +(18820, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x1, 0, 0x0, 0, 0, 0, 1), -- Insight +(22008, 0, 3, 0x61400035, 0x00000000, 0x00000000, 69632, 0x5, 0x1, 0, 0x0, 0, 0, 0, 1), -- Netherwind Focus +(28200, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x1, 0, 0x0, 0, 0, 0, 6), -- Ascendance +(31834, 0, 10, 0x80000000, 0x00000000, 0x00000000, 16384, 0x2, 0x1, 0, 0x0, 0, 0, 0, 1), -- Light's Grace +(32216, 0, 4, 0x00000000, 0x00000100, 0x00000000, 16, 0x1, 0x4, 0, 0x0, 0, 0, 0, 1), -- Victorious (drop charge on Victory rush cast) +(34477, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 1), -- Misdirection +(34936, 0, 5, 0x00000001, 0x00000040, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Backlash +(44401, 0, 3, 0x00000800, 0x00000000, 0x00000000, 4096, 0x5, 0x1, 0, 0x8, 0, 0, 0, 1), -- Missile Barrage +(48108, 0, 3, 0x00400000, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Hot Streak +(51124, 0, 15, 0x00000002, 0x00000006, 0x00000000, 65552, 0x1, 0x2, 0, 0x8, 0, 0, 0, 1), -- Killing Machine +(54741, 0, 3, 0x00000004, 0x00000000, 0x00000000, 65536, 0x5, 0x1, 0, 0x0, 0, 0, 0, 1), -- Firestarter +(57761, 0, 3, 0x00000001, 0x00001000, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Fireball! +(64823, 0, 7, 0x00000004, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 0, 1); -- Elune's Wrath + +-- Port procs from spell_proc_event table +DELETE FROM `spell_proc` WHERE `SpellId` IN (-974, -1463, -10400, -11119, -11185, -12834, -13983, -14156, -15337, -16180, -18094, -18213, -20234, -20335, -27243, -29441, -29723, -29834, -30293, -30675, -31244, -31571, -31656, -31785, -31871, -31876, -34497, -34914, -44404, -44445, -44546, -46913, -46951, -47569, -48539, -48979, -49015, -49018, -49182, -49188, -49208, -49217, -49467, -51459, -51474, -51525, -51556, -51625, -51627, -51664, -53178, -53228, -53290, -53380, -53501, -53569, -53695, -54639, -54747, -59088, -61680, -62764, -63156, -63373, -64127, -65661, 1719, 11129, 12536, 15286, 16246, 16864, 16870, 17619, 20185, 20186, 22007, 24658, 24932, 26169, 26467, 28716, 28719, 28744, 28789, 28809, 28823, 28845, 28847, 28849, 29601, 32863, 36123, 38252, 39367, 44141, 70388, 30823, 31801, 32409, 33757, 37288, 37295, 37381, 37377, 39437, 37168, 37594, 38164, 39372, 40438, 40442, 40463, 40470, 40971, 42770, 45057, 46916, 47383, 71162, 71165, 49005, 49028, 49194, 49222, 49796, 51209, 51528, 51529, 51530, 51531, 51532, 51698, 51700, 51701, 52420, 52437, 53601, 53646, 53736, 54274, 54276, 54277, 54748, 54754, 54815, 54821, 54832, 54845, 54909, 54937, 54939, 55198, 55440, 55677, 56218, 56372, 56374, 56375, 56800, 57870, 58375, 58642, 58677, 58877, 59906, 59915, 37447, 61062, 61257, 62259, 62600, 62606, 63279, 63280, 63320, 64890, 64928, 65032, 67228, 69755, 69739, 69762, 70723, 70664, 70770, 70805, 70808, 70817, 70844, 70672, 72455, 72832, 72833, 71756, 72782, 72783, 72784, 71406, 71545, 71880, 71892, 71519, 71562, 71564, 71634, 71640, 71761, 71770, 72176, 75475, 75481); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(-974, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x2, 0, 0, 3000, 0), -- Earth Shield +(-1463, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 1024, 0x0, 0, 0, 0, 0), -- Mana Shield +(-10400, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Flametongue Weapon (Passive) +(-11119, 4, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ignite +(-11185, 0, 3, 0x00000080, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Improved Blizzard +(-12834, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Deep Wounds Aura +(-13983, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 24, 0x0, 0, 0, 1000, 0), -- Setup +(-14156, 0, 8, 0x003E0000, 0x00000009, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Ruthlessness +(-15337, 0, 6, 0x00802000, 0x00000002, 0x00000000, 0, 0x1, 0x2, 2, 0x2, 0, 0, 0, 0), -- Improved Spirit Tap +(-16180, 0, 11, 0x000001C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Improved Water Shield +(-18094, 0, 5, 0x0000000A, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Nightfall +(-18213, 32, 5, 0x00004000, 0x00000000, 0x00000000, 2, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Improved Drain Soul +(-20234, 0, 10, 0x00008000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Lay on Hands +(-20335, 0, 10, 0x00800000, 0x00000000, 0x00000000, 16, 0x5, 0x2, 0, 0x0, 0, 100, 0, 0), -- Heart of the Crusader +(-27243, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of corruption (Warlock) +(-29441, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x0, 8, 0x0, 0, 0, 1000, 0), -- Magic Absorption +(-29723, 0, 4, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Death +(-29834, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Second Wind (Warrior talent) +(-30293, 0, 5, 0x00000181, 0x008200C0, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Soul Leech +(-30675, 0, 11, 0x00000003, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lightning Overload +(-31244, 0, 8, 0x003A0000, 0x00000009, 0x00000000, 0, 0x5, 0x2, 11196, 0x0, 0, 0, 0, 0), -- Quick Recovery +(-31571, 0, 3, 0x00000000, 0x00000022, 0x00000008, 16384, 0x7, 0x4, 0, 0x0, 0, 0, 0, 0), -- Arcane Potency +(-31656, 4, 3, 0x08000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Empowered Fire +(-31785, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spiritual Attunement +(-31871, 0, 10, 0x00000010, 0x00000000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Divine Purpose +(-31876, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Judgements of the Wise +(-34497, 0, 9, 0x00060800, 0x00800001, 0x00000201, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Thrill of the Hunt +(-34914, 0, 6, 0x00002000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Vampiric Touch +(-44404, 0, 3, 0x20000021, 0x00009000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Missile Barrage +(-44445, 0, 3, 0x00000013, 0x00011000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hot Streak +(-44546, 0, 3, 0x000002E0, 0x00001000, 0x00000000, 69632, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brain Freeze +(-46913, 0, 4, 0x00000040, 0x00000404, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Bloodsurge +(-46951, 0, 4, 0x00000400, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sword and Board +(-47569, 0, 6, 0x00004000, 0x00000000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Shadowform +(-48539, 0, 7, 0x00000010, 0x04000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Revitalize +(-48979, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Butchery +(-49015, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Vendetta +(-49018, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Doom +(-49182, 0, 15, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blade Barrier +(-49188, 0, 15, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rime +(-49208, 0, 15, 0x00400000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Reaping +(-49217, 0, 15, 0x00000000, 0x00000000, 0x00000002, 0, 0x0, 0x0, 0, 0x0, 0, 0, 1000, 0), -- Wandering Plague +(-49467, 0, 15, 0x00000010, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Death Rune Mastery +(-51459, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Necrosis +(-51474, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Astral Shift +(-51525, 0, 11, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0 ,0x0, 0, 0, 0, 0), -- Static Shock +(-51556, 0, 11, 0x000000C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ancestral Awakening +(-51625, 0, 8, 0x1000A000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Brew +(-51627, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Turn the Tables +(-51664, 0, 8, 0x00020000, 0x00000008, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Cut to the Chase +(-53178, 0, 9, 0x00000000, 0x10000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 100, 0, 0), -- Guard Dog +(-53228, 0, 9, 0x00000020, 0x01000000, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rapid Recuperation +(-53290, 0, 9, 0x00000800, 0x00000001, 0x00000200, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Hunting Party +(-53380, 0, 10, 0x00800000, 0x00028000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Righteous Vengeance +(-53501, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Sheath of Light +(-53569, 0, 10, 0x40200000, 0x00010000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Infusion of Light +(-53695, 0, 10, 0x00800000, 0x00000000, 0x00000008, 16, 0x5, 0x2, 0, 0x2, 0, 0, 0, 0), -- Judgements of the Just +(-54639, 0, 15, 0x00400000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blood of the North +(-54747, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Burning Determination +(-59088, 0, 4, 0x00000000, 0x00000002, 0x00000000, 1024, 0x4, 0x4, 0, 0x0, 0, 0, 0, 0), -- Improved Spell Reflection +(-61680, 0, 9, 0x00000000, 0x10000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Culling the Herd +(-62764, 0, 9, 0x00000000, 0x10000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 100, 0, 0), -- Silverback +(-63156, 0, 5, 0x00000001, 0x000000C0, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Decimation +(-63373, 0, 11, 0x80000000, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Frozen Power +(-64127, 0, 6, 0x00000001, 0x00000001, 0x00000000, 0, 0x6, 0x2, 0, 0x0, 0, 0, 0, 0), -- Body and Soul +(-65661, 0, 15, 0x00400011, 0x20020004, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 100, 0, 0), -- Threat of Thassarian + +(1719, 0, 4, 0x2E600444, 0x00404745, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Recklessness +(11129, 4, 3, 0x08C00017, 0x00031048, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Combustion +(12536, 0, 3, 0x20C21AF7, 0x00029040, 0x00000000, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Mage) +(15286, 32, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vampiric Embrace +(16246, 0, 11, 0x981001C3, 0x00001400, 0x00000010, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Shaman) +(16864, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 6, 0, 0), -- Omen of Clarity +(16870, 0, 7, 0x00E3BBFF, 0x079007D3, 0x00040400, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Druid) +(17619, 0, 13, 0x00000000, 0x00000000, 0x00000000, 32768, 0x7, 0x0, 0, 0x0, 0, 0, 0, 0), -- Alchemist's Stone +(20185, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 15, 0, 0, 0), -- Judgement of Light +(20186, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 15, 0, 0, 0), -- Judgement of Wisdom +(22007, 0, 3, 0x00200021, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Netherwind Focus +(24658, 0, 0, 0x00000000, 0x00000000, 0x00000000, 87376, 0x7, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unstable Power +(24932, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Leader of the Pack +(26169, 0, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Oracle Healing Bonus +(26467, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Persistent Shield +(28716, 0, 7, 0x00000010, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Rejuvenation - Dreamwalker Raiment 2pc +(28719, 0, 7, 0x00000020, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Healing Touch - Dreamwalker Raiment 8 pc +(28744, 0, 7, 0x00000040, 0x00000000, 0x00000000, 278528, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Regrowth - Dreamwalker Raiment 6pc +(28789, 0, 10, 0xC0000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Holy Power +(28809, 0, 6, 0x00001000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Greater Heal - Vestments of Faith 4pc +(28823, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totemic Power +(28845, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Cheat Death +(28847, 0, 7, 0x00000020, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Healing Touch Refund +(28849, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lesser Heealing Wave +(29601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x4, 0, 0, 0, 0), -- Enlightenment + +(32863, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) +(36123, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) +(38252, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) +(39367, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) +(44141, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) +(70388, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) + +(30823, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 10, 0, 0, 0), -- Shamanistic Rage +(31801, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Seal of Vengeance +(32409, 0, 0, 0x00000000, 0x00002000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadow Word: Death - do not require honor target +(33757, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 3000, 0), -- Windfury Weapon (Passive) +(37288, 0, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Restore - Malorne Raiment 2pc +(37295, 0, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Restore - Malorne Regalia 2pc +(37381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Pet Healing + +(37377, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadowflame +(39437, 4, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadowflame Hellfire and RoF + +(37168, 0, 8, 0x003E0000, 0x00000009, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Finisher Combo +(37594, 0, 6, 0x00001000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Greater Heal Refund +(38164, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unyielding Knights +(39372, 48, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Frozen Shadoweave +(40438, 0, 6, 0x00008040, 0x00000000, 0x00000000, 0, 0x3, 0x0, 0, 0x0, 0, 0, 0, 0), -- Priest Tier 6 Trinket +(40442, 0, 7, 0x00000014, 0x00000440, 0x00000000, 0, 0x7, 0x1, 0, 0x0, 0, 0, 0, 0), -- Druid Tier 6 Trinket +(40463, 0, 11, 0x00000081, 0x00000010, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shaman Tier 6 Trinket +(40470, 0, 10, 0xC0800000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Paladin Tier 6 Trinket +(40971, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Bonus Healing (Crystal Spire of Karabor) +(42770, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Second Wind (NPC aura) +(45057, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Evasive Maneuvers +(46916, 0, 4, 0x00200000, 0x00000000, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Slam! (Bloodsurge proc) + +(47383, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core +(71162, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core +(71165, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core + +(49005, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mark of Blood +(49028, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 0), -- Dancing Rune Weapon +(49194, 0, 15, 0x00000000, 0x00000000, 0x00000001, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unholy Blight +(49222, 0, 0, 0x00000000, 0x00000000, 0x00000000, 139944, 0x0, 0x0, 0, 0x0, 0, 0, 2000, 0), -- Bone Shield +(49796, 0, 15, 0x00000002, 0x00020006, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Deathchill +(51209, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Hungering Cold + +(51528, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 4, 0, 0, 0), -- Maelstrom Weapon (Rank 1) +(51529, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 8, 0, 0, 0), -- Maelstrom Weapon (Rank 2) +(51530, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 12, 0, 0, 0), -- Maelstrom Weapon (Rank 3) +(51531, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 16, 0, 0, 0), -- Maelstrom Weapon (Rank 4) +(51532, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 20, 0, 0, 0), -- Maelstrom Weapon (Rank 5) + +(51698, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 33, 0, 0), -- Honor Among Thieves (Rank 1) +(51700, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 66, 0, 0), -- Honor Among Thieves (Rank 2) +(51701, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 100, 0, 0), -- Honor Among Thieves (Rank 3) + +(52420, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Deflection +(52437, 1, 4, 0x20000000, 0x00000000, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Death proc +(53601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 1048576, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Sacred Shield +(53646, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Demonic Pact +(53736, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Seal of Corruption + +(54274, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft +(54276, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft +(54277, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft + +(54748, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 259, 0x0, 0, 0, 0, 0), -- Burning Determination proc +(54754, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rejuvenation +(54815, 0, 7, 0x00008000, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shred +(54821, 0, 7, 0x00001000, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rake +(54832, 0, 7, 0x00000000, 0x00001000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Innervate +(54845, 0, 7, 0x00000004, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Starfire +(54909, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Demonic Pact +(54937, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Holy Light +(54939, 0, 10, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Divinity +(55198, 0, 11, 0x000001C0, 0x00000000, 0x00000000, 16384, 0x2, 0x2, 2, 0x0, 0, 0, 0, 3), -- Tidal Force +(55440, 0, 11, 0x00000040, 0x00000000, 0x00000000, 0, 0x2, 0x1, 0, 0x0, 0, 0, 0, 0), -- Glyph of Healing Wave +(55677, 0, 6, 0x00000000, 0x00000001, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Dispel Magic +(56218, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Corruption +(56372, 0, 3, 0x00000000, 0x00000080, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Ice Block +(56374, 0, 3, 0x00000000, 0x00004000, 0x00000008, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Icy Veins +(56375, 0, 3, 0x01000000, 0x00000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Polymorph +(56800, 0, 8, 0x00000004, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Backstab +(57870, 0, 9, 0x00800000, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Mend Pet +(58375, 0, 4, 0x00000000, 0x00000200, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Blocking +(58642, 0, 15, 0x00000000, 0x08000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Scourge Strike +(58677, 0, 15, 0x00002000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x2, 0, 0, 0, 0), -- Glyph of Death's Embrace +(58877, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spirit Hunt +(59906, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Swift Hand of Justice +(59915, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Discerning Eye of the Beast + +(37447, 0, 3, 0x00000000, 0x00000100, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Mana Gems +(61062, 0, 3, 0x00000000, 0x00000100, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Mana Gems + +(61257, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Runic Power Back on Snare/Root +(62259, 0, 15, 0x02000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Glyph of Death Grip +(62600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Savage Defense (Passive) +(62606, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 1027, 0x0, 0, 0, 0, 0), -- Savage Defense +(63279, 0, 11, 0x00000000, 0x00000400, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Earth Shield +(63280, 0, 11, 0x20000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Totem of Wrath +(63320, 0, 5, 0x80040000, 0x00000000, 0x00008000, 1024, 0x7, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Life Tap +(64890, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Holy 2P Bonus +(64928, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Shaman T8 Elemental 4P Bonus +(65032, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- 321-Boombot Aura - do not require experience target +(67228, 0, 11, 0x00000000, 0x00001000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T9 Elemental 4P Bonus (Lava Burst) +(69755, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Purified Shard of the Scale +(69739, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Shiny Shard of the Scale +(69762, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Unchained Magic +(70723, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Balance 4P Bonus +(70664, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Druid T10 Restoration 4P Bonus (Rejuvenation) +(70770, 0, 6, 0x00000800, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T10 Healer 2P Bonus +(70805, 0, 8, 0x00000000, 0x00020000, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T10 2P Bonus +(70808, 0, 11, 0x00000100, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration 4P Bonus +(70817, 0, 11, 0x00000000, 0x00001000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental 4P Bonus +(70844, 0, 4, 0x00000100, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Warrior T10 Protection 4P Bonus + +(70672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat +(72455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat +(72832, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat +(72833, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat + +(71756, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc +(72782, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc +(72783, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc +(72784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc + +(71406, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 50, 0, 0), -- Anger Capacitor +(71545, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 50, 0, 0), -- Anger Capacitor + +(71880, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 1, 0, 0, 0), -- Item - Icecrown 25 Normal Dagger Proc +(71892, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 1, 0, 0, 0), -- Item - Icecrown 25 Heroic Dagger Proc + +(71519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 105000, 0), -- Deathbringer's Will +(71562, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 105000, 0), -- Deathbringer's Will (Heroic) +(71564, 126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 0, 0, 5), -- Deadly Precision +(71634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Item - Icecrown 25 Normal Tank Trinket 1 +(71640, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Item - Icecrown 25 Heroic Tank Trinket 1 +(71761, 3, 0, 0x00000000, 0x00100000, 0x00000000, 0, 0x5, 0x2, 256, 0x0, 0, 0, 0, 0), -- Deep Freeze Immunity State +(71770, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Ooze Spell Tank Protection +(72176, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blood Beast's Blood Link +(75475, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Tank Trinket +(75481, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0); -- Item - Chamber of Aspects 25 Heroic Tank Trinket + +-- Add spellscripts to spells previously on giant switches in Unit.cpp +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_rog_t10_2p_bonus'; +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_flametongue_weapon','spell_mage_imp_blizzard','spell_warr_deep_wounds_aura','spell_rog_setup','spell_pri_improved_spirit_tap','spell_sha_imp_water_shield','spell_warl_improved_drain_soul','spell_pal_improved_lay_of_hands','spell_pal_heart_of_the_crusader','spell_warl_seed_of_corruption_dummy','spell_mage_magic_absorption','spell_warr_extra_proc','spell_warr_second_wind','spell_warl_soul_leech','spell_sha_lightning_overload','spell_rog_quick_recovery','spell_mage_arcane_potency','spell_mage_empowered_fire','spell_pal_spiritual_attunement','spell_pal_divine_purpose','spell_pal_judgements_of_the_wise','spell_hun_thrill_of_the_hunt','spell_mage_missile_barrage','spell_mage_hot_streak','spell_warr_sword_and_board','spell_pri_imp_shadowform','spell_dk_butchery','spell_item_unstable_power','spell_item_restless_strength','spell_dru_leader_of_the_pack','spell_pri_aq_3p_bonus','spell_item_persistent_shield','spell_dru_revitalize','spell_dk_death_rune','spell_dk_scent_of_blood_trigger','spell_dk_vendetta','spell_dk_sudden_doom','spell_dk_blade_barrier','spell_dk_rime','spell_dk_wandering_plague','spell_sha_astral_shift_aura','spell_dk_necrosis','spell_sha_static_shock','spell_sha_maelstrom_weapon','spell_sha_ancestral_awakening','spell_rog_deadly_brew','spell_rog_turn_the_tables','spell_rog_cut_to_the_chase','spell_pet_guard_dog','spell_hun_rapid_recuperation_trigger','spell_hun_hunting_party','spell_pal_righteous_vengeance','spell_pal_sheath_of_light','spell_pal_infusion_of_light','spell_pal_judgements_of_the_just','spell_mage_burning_determination','spell_warr_improved_spell_reflection','spell_pet_culling_the_herd','spell_pet_silverback','spell_warl_decimation','spell_sha_frozen_power','spell_pri_body_and_soul','spell_dk_threat_of_thassarian','spell_warl_seduction','spell_mage_combustion','spell_pri_vampiric_embrace','spell_dru_omen_of_clarity','spell_item_alchemists_stone','spell_pal_judgement_of_light_heal','spell_pal_judgement_of_wisdom_mana','spell_twisted_reflection','spell_dru_t3_2p_bonus','spell_dru_t3_8p_bonus','spell_dru_t3_6p_bonus','spell_pal_t3_6p_bonus','spell_pri_t3_4p_bonus','spell_sha_t3_6p_bonus','spell_warr_t3_prot_8p_bonus','spell_item_healing_touch_refund','spell_item_totem_of_flowing_water','spell_item_pendant_of_the_violet_eye','spell_sha_shamanistic_rage','spell_pal_seal_of_vengeance','spell_warl_seed_of_corruption_generic','spell_mark_of_malice','spell_item_mark_of_conquest','spell_sha_windfury_weapon','spell_dru_t4_2p_bonus','spell_pri_t5_heal_2p_bonus','spell_anetheron_vampiric_aura','spell_item_frozen_shadoweave','spell_item_aura_of_madness','spell_pri_item_t6_trinket','spell_dru_item_t6_trinket','spell_sha_item_t6_trinket','spell_pal_item_t6_trinket','spell_item_crystal_spire_of_karabor','spell_item_dementia','spell_item_pet_healing','spell_warl_t4_2p_bonus_shadow','spell_warl_t4_2p_bonus_fire','spell_mage_gen_extra_effects','spell_uk_second_wind','spell_item_commendation_of_kaelthas','spell_item_sunwell_exalted_caster_neck','spell_item_sunwell_exalted_melee_neck','spell_item_sunwell_exalted_tank_neck','spell_item_sunwell_exalted_healer_neck','spell_warl_glyph_of_corruption_nightfall','spell_dk_mark_of_blood','spell_dk_dancing_rune_weapon','spell_dk_unholy_blight','spell_dk_hungering_cold','spell_item_soul_harvesters_charm','spell_rog_turn_the_tables_proc','spell_pal_sacred_shield_dummy','spell_warl_demonic_pact','spell_pal_seal_of_corruption','spell_dru_glyph_of_rejuvenation','spell_dru_glyph_of_shred','spell_dru_glyph_of_rake','spell_dru_glyph_of_innervate','spell_dru_glyph_of_starfire_dummy','spell_pal_glyph_of_holy_light_dummy','spell_pal_glyph_of_divinity','spell_sha_tidal_force_dummy','spell_sha_glyph_of_healing_wave','spell_pri_glyph_of_dispel_magic','spell_mage_glyph_of_ice_block','spell_mage_glyph_of_icy_veins','spell_mage_glyph_of_polymorph','spell_rog_glyph_of_backstab','spell_hun_glyph_of_mend_pet','spell_pri_shadowfiend_death','spell_warr_glyph_of_blocking','spell_dk_glyph_of_scourge_strike','spell_sha_spirit_hunt','spell_hun_kill_command_pet','spell_item_swift_hand_justice_dummy','spell_item_discerning_eye_beast_dummy','spell_mage_imp_mana_gems','spell_gen_vampiric_touch','spell_dk_pvp_4p_bonus','spell_dk_glyph_of_death_grip','spell_dru_savage_defense','spell_sha_glyph_of_earth_shield','spell_sha_glyph_of_totem_of_wrath','spell_warl_glyph_of_life_tap','spell_pal_t8_2p_bonus','spell_sha_t8_elemental_4p_bonus','spell_xt002_321_boombot_aura','spell_sha_t9_elemental_4p_bonus','spell_item_purified_shard_of_the_scale','spell_item_shiny_shard_of_the_scale','spell_dru_t10_balance_4p_bonus','spell_dru_t10_restoration_4p_bonus_dummy','spell_pri_t10_heal_2p_bonus','spell_sha_t10_restoration_4p_bonus','spell_sha_t10_elemental_4p_bonus','spell_warr_item_t10_prot_4p_bonus','spell_item_tiny_abomination_in_a_jar','spell_item_tiny_abomination_in_a_jar_hero','spell_item_deadly_precision_dummy','spell_item_deadly_precision','spell_item_heartpierce','spell_item_heartpierce_hero','spell_item_deathbringers_will_normal','spell_item_deathbringers_will_heroic','spell_item_corpse_tongue_coin','spell_item_corpse_tongue_coin_heroic','spell_putricide_ooze_tank_protection','spell_deathbringer_blood_beast_blood_link','spell_item_petrified_twilight_scale','spell_item_petrified_twilight_scale_heroic'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-10400, 'spell_sha_flametongue_weapon'), +(-11185, 'spell_mage_imp_blizzard'), +(-12834, 'spell_warr_deep_wounds_aura'), +(-13983, 'spell_rog_setup'), +(-15337, 'spell_pri_improved_spirit_tap'), +(-16180, 'spell_sha_imp_water_shield'), +(-18213, 'spell_warl_improved_drain_soul'), +(-20234, 'spell_pal_improved_lay_of_hands'), +(-20335, 'spell_pal_heart_of_the_crusader'), +(-27243, 'spell_warl_seed_of_corruption_dummy'), +(-29441, 'spell_mage_magic_absorption'), + +(-29723, 'spell_warr_extra_proc'), +(-46913, 'spell_warr_extra_proc'), + +(-29834, 'spell_warr_second_wind'), +(-30293, 'spell_warl_soul_leech'), +(-30675, 'spell_sha_lightning_overload'), +(-31244, 'spell_rog_quick_recovery'), +(-31571, 'spell_mage_arcane_potency'), +(-31656, 'spell_mage_empowered_fire'), +(-31785, 'spell_pal_spiritual_attunement'), +(-31871, 'spell_pal_divine_purpose'), +(-31876, 'spell_pal_judgements_of_the_wise'), +(-34497, 'spell_hun_thrill_of_the_hunt'), +(-44404, 'spell_mage_missile_barrage'), +(-44445, 'spell_mage_hot_streak'), +(-46951, 'spell_warr_sword_and_board'), +(-47569, 'spell_pri_imp_shadowform'), +(-48979, 'spell_dk_butchery'), +(-48539, 'spell_dru_revitalize'), + +(-49208, 'spell_dk_death_rune'), +(-49467, 'spell_dk_death_rune'), +(-54639, 'spell_dk_death_rune'), + +(-49004, 'spell_dk_scent_of_blood_trigger'), +(-49015, 'spell_dk_vendetta'), +(-49018, 'spell_dk_sudden_doom'), +(-49182, 'spell_dk_blade_barrier'), +(-49188, 'spell_dk_rime'), +(-49217, 'spell_dk_wandering_plague'), +(-51474, 'spell_sha_astral_shift_aura'), +(-51459, 'spell_dk_necrosis'), +(-51525, 'spell_sha_static_shock'), +(-51556, 'spell_sha_ancestral_awakening'), +(-51625, 'spell_rog_deadly_brew'), +(-51627, 'spell_rog_turn_the_tables'), +(-51664, 'spell_rog_cut_to_the_chase'), +(-53178, 'spell_pet_guard_dog'), +(-53228, 'spell_hun_rapid_recuperation_trigger'), +(-53290, 'spell_hun_hunting_party'), +(-53380, 'spell_pal_righteous_vengeance'), +(-53501, 'spell_pal_sheath_of_light'), +(-53569, 'spell_pal_infusion_of_light'), +(-53695, 'spell_pal_judgements_of_the_just'), +(-54747, 'spell_mage_burning_determination'), +(-59088, 'spell_warr_improved_spell_reflection'), +(-61680, 'spell_pet_culling_the_herd'), +(-62764, 'spell_pet_silverback'), +(-63156, 'spell_warl_decimation'), +(-63373, 'spell_sha_frozen_power'), +(-64127, 'spell_pri_body_and_soul'), +(-65661, 'spell_dk_threat_of_thassarian'), +(6358, 'spell_warl_seduction'), +(11129, 'spell_mage_combustion'), +(15286, 'spell_pri_vampiric_embrace'), +(16864, 'spell_dru_omen_of_clarity'), +(17619, 'spell_item_alchemists_stone'), +(20185, 'spell_pal_judgement_of_light_heal'), +(20186, 'spell_pal_judgement_of_wisdom_mana'), +(21063, 'spell_twisted_reflection'), +(24658, 'spell_item_unstable_power'), +(24661, 'spell_item_restless_strength'), +(24932, 'spell_dru_leader_of_the_pack'), +(26169, 'spell_pri_aq_3p_bonus'), +(26467, 'spell_item_persistent_shield'), +(28716, 'spell_dru_t3_2p_bonus'), +(28719, 'spell_dru_t3_8p_bonus'), +(28744, 'spell_dru_t3_6p_bonus'), +(28789, 'spell_pal_t3_6p_bonus'), +(28809, 'spell_pri_t3_4p_bonus'), +(28823, 'spell_sha_t3_6p_bonus'), +(28845, 'spell_warr_t3_prot_8p_bonus'), +(28847, 'spell_item_healing_touch_refund'), +(28849, 'spell_item_totem_of_flowing_water'), +(29601, 'spell_item_pendant_of_the_violet_eye'), +(30823, 'spell_sha_shamanistic_rage'), +(31801, 'spell_pal_seal_of_vengeance'), + +(32863, 'spell_warl_seed_of_corruption_generic'), +(36123, 'spell_warl_seed_of_corruption_generic'), +(38252, 'spell_warl_seed_of_corruption_generic'), +(39367, 'spell_warl_seed_of_corruption_generic'), +(44141, 'spell_warl_seed_of_corruption_generic'), +(70388, 'spell_warl_seed_of_corruption_generic'), + +(33493, 'spell_mark_of_malice'), +(33510, 'spell_item_mark_of_conquest'), +(33757, 'spell_sha_windfury_weapon'), +(37288, 'spell_dru_t4_2p_bonus'), +(37295, 'spell_dru_t4_2p_bonus'), +(37594, 'spell_pri_t5_heal_2p_bonus'), +(38196, 'spell_anetheron_vampiric_aura'), +(39372, 'spell_item_frozen_shadoweave'), +(39446, 'spell_item_aura_of_madness'), +(40438, 'spell_pri_item_t6_trinket'), +(40442, 'spell_dru_item_t6_trinket'), +(40463, 'spell_sha_item_t6_trinket'), +(40470, 'spell_pal_item_t6_trinket'), +(40971, 'spell_item_crystal_spire_of_karabor'), +(41404, 'spell_item_dementia'), + +(37381, 'spell_item_pet_healing'), + +(37377, 'spell_warl_t4_2p_bonus_shadow'), +(39437, 'spell_warl_t4_2p_bonus_fire'), + +(44401, 'spell_mage_gen_extra_effects'), +(48108, 'spell_mage_gen_extra_effects'), +(57761, 'spell_mage_gen_extra_effects'), + +(42770, 'spell_uk_second_wind'), +(45057, 'spell_item_commendation_of_kaelthas'), +(45481, 'spell_item_sunwell_exalted_caster_neck'), +(45482, 'spell_item_sunwell_exalted_melee_neck'), +(45483, 'spell_item_sunwell_exalted_tank_neck'), +(45484, 'spell_item_sunwell_exalted_healer_neck'), + +(-18094, 'spell_warl_glyph_of_corruption_nightfall'), +(56218, 'spell_warl_glyph_of_corruption_nightfall'), + +(49005, 'spell_dk_mark_of_blood'), +(49028, 'spell_dk_dancing_rune_weapon'), +(49194, 'spell_dk_unholy_blight'), +(51209, 'spell_dk_hungering_cold'), +(52420, 'spell_item_soul_harvesters_charm'), + +(52910, 'spell_rog_turn_the_tables_proc'), +(52914, 'spell_rog_turn_the_tables_proc'), +(52915, 'spell_rog_turn_the_tables_proc'), + +(53601, 'spell_pal_sacred_shield_dummy'), + +(53646, 'spell_warl_demonic_pact'), +(54909, 'spell_warl_demonic_pact'), + +(53736, 'spell_pal_seal_of_corruption'), +(53817, 'spell_sha_maelstrom_weapon'), +(54748, 'spell_mage_burning_determination'), +(54754, 'spell_dru_glyph_of_rejuvenation'), +(54815, 'spell_dru_glyph_of_shred'), +(54821, 'spell_dru_glyph_of_rake'), +(54832, 'spell_dru_glyph_of_innervate'), +(54845, 'spell_dru_glyph_of_starfire_dummy'), +(54937, 'spell_pal_glyph_of_holy_light_dummy'), +(54939, 'spell_pal_glyph_of_divinity'), +(55198, 'spell_sha_tidal_force_dummy'), +(55440, 'spell_sha_glyph_of_healing_wave'), +(55677, 'spell_pri_glyph_of_dispel_magic'), +(56372, 'spell_mage_glyph_of_ice_block'), +(56374, 'spell_mage_glyph_of_icy_veins'), +(56375, 'spell_mage_glyph_of_polymorph'), +(56800, 'spell_rog_glyph_of_backstab'), +(57870, 'spell_hun_glyph_of_mend_pet'), +(57989, 'spell_pri_shadowfiend_death'), +(58375, 'spell_warr_glyph_of_blocking'), +(58642, 'spell_dk_glyph_of_scourge_strike'), +(58877, 'spell_sha_spirit_hunt'), +(58914, 'spell_hun_kill_command_pet'), +(59906, 'spell_item_swift_hand_justice_dummy'), +(59915, 'spell_item_discerning_eye_beast_dummy'), + +(37447, 'spell_mage_imp_mana_gems'), +(61062, 'spell_mage_imp_mana_gems'), + +(52723, 'spell_gen_vampiric_touch'), +(60501, 'spell_gen_vampiric_touch'), +(61257, 'spell_dk_pvp_4p_bonus'), +(62259, 'spell_dk_glyph_of_death_grip'), +(62600, 'spell_dru_savage_defense'), +(63279, 'spell_sha_glyph_of_earth_shield'), +(63280, 'spell_sha_glyph_of_totem_of_wrath'), +(63320, 'spell_warl_glyph_of_life_tap'), +(64890, 'spell_pal_t8_2p_bonus'), +(64928, 'spell_sha_t8_elemental_4p_bonus'), +(65032, 'spell_xt002_321_boombot_aura'), +(67228, 'spell_sha_t9_elemental_4p_bonus'), +(69755, 'spell_item_purified_shard_of_the_scale'), +(69739, 'spell_item_shiny_shard_of_the_scale'), +(70723, 'spell_dru_t10_balance_4p_bonus'), +(70664, 'spell_dru_t10_restoration_4p_bonus_dummy'), +(70770, 'spell_pri_t10_heal_2p_bonus'), +(70808, 'spell_sha_t10_restoration_4p_bonus'), +(70817, 'spell_sha_t10_elemental_4p_bonus'), +(70844, 'spell_warr_item_t10_prot_4p_bonus'), + +(71406, 'spell_item_tiny_abomination_in_a_jar'), +(71545, 'spell_item_tiny_abomination_in_a_jar_hero'), + +(71563, 'spell_item_deadly_precision_dummy'), +(71564, 'spell_item_deadly_precision'), + +(71880, 'spell_item_heartpierce'), +(71892, 'spell_item_heartpierce_hero'), + +(71519, 'spell_item_deathbringers_will_normal'), +(71562, 'spell_item_deathbringers_will_heroic'), + +(71634, 'spell_item_corpse_tongue_coin'), +(71640, 'spell_item_corpse_tongue_coin_heroic'), + +(71770, 'spell_putricide_ooze_tank_protection'), +(72176, 'spell_deathbringer_blood_beast_blood_link'), + +(75475, 'spell_item_petrified_twilight_scale'), +(75481, 'spell_item_petrified_twilight_scale_heroic'); + +-- Non scripted auras from `spell_proc_event` +DELETE FROM `spell_proc` WHERE `SpellId` IN (-66799, -63730, -61846, -58872, -57878, -57470, -56636, -56342, -55666, -53709, -53671, -53551, -53527, -53486, -53256, -53234, -53221, -53215, -52795, -52127, -51940, -51692, -51672, -51634, -51562, -51523, -51521, -50880, -49223, -49219, -49149, -49027, -49004, -48988, -48516, -48506, -48496, -48483, -47580, -47516, -47509, -47263, -47258, -47245, -47201, -47195, -46945, -46867, -46854, -45234, -44557, -44449, -44442, -41635, -35541, -35100, -34950, -34935, -34753, -34500, -33881, -33191, -33150, -33142, -33076, -32385, -31833, -31569, -31124, -30881, -30701, -30299, -30160, -29593, -29074, -27811, -20925, -20500, -20210, -20177, -20049, -19572, -19184, -18119, -18096, -17793, -17106, -16958, -16952, -16880, -16487, -16257, -16256, -16176, -14892, -14531, -14186, -13754, -13165, -12966, -12319, -12311, -12298, -12289, -12281, -11255, -11213, -11180, -11095, -9799, -9452, -5952, -324, 6346, 7383, 7434, 8178, 9782, 9784, 12169, 12322, 12999, 13000, 13001, 13002, 13163, 15088, 15128, 15277, 15346, 15600, 16164, 16550, 16620, 16624, 17364, 17495, 20128, 20131, 20132, 20164, 20165, 20166, 20375, 20705, 20784, 20911, 21185, 21882, 21890, 22618, 22648, 23547, 23548, 23551, 23552, 23572, 23578, 23581, 23686, 23688, 23689, 23721, 23920, 24353, 24389, 24905, 25050, 25669, 25899, 26107, 26119, 26128, 26135, 26480, 26605, 27419, 27498, 27521, 27656, 27774, 27787, 28305, 28752, 28802, 28812, 28816, 29150, 29385, 29455, 29501, 29624, 29625, 29626, 29632, 29633, 29634, 29635, 29636, 29637, 29977, 30003, 30937, 31394, 31794, 31904, 32587, 32642, 32734, 32748, 32776, 32777, 32837, 32844, 32885, 33089, 33127, 33297, 33299, 33510, 33648, 33719, 33746, 33759, 33953, 34074, 34080, 34138, 34139, 34258, 34262, 34320, 34355, 34584, 34586, 34598, 34749, 34774, 34783, 34827, 35077, 35080, 35083, 35086, 35121, 36032, 36096, 36111, 36541, 37165, 37170, 37173, 37189, 37193, 37195, 37197, 37213, 37214, 37227, 37237, 37247, 37379, 37384, 37443, 37514, 37516, 37519, 37523, 37528, 37536, 37568, 37600, 37601, 37603, 37655, 37657, 38026, 38031, 38290, 38299, 38326, 38327, 38334, 38347, 38350, 38394, 38857, 39027, 39442, 39443, 39530, 39958, 40407, 40444, 40458, 40475, 40478, 40482, 40485, 40899, 41034, 41260, 41262, 41381, 41393, 41434, 41469, 41989, 42083, 42135, 42136, 42368, 42370, 43443, 43726, 43728, 43737, 43739, 43741, 43745, 43748, 43750, 43819, 44543, 44545, 45054, 45354, 45355, 45469, 45481, 45482, 45483, 45484, 46025, 46092, 46098, 46569, 46662, 46832, 46910, 46911, 47981, 48833, 48835, 48837, 49592, 49622, 50240, 50421, 50781, 51123, 51127, 51128, 51129, 51130, 51346, 51349, 51352, 51359, 51414, 51915, 52020, 52423, 52898, 53386, 53397, 54278, 54646, 54695, 54707, 54738, 54808, 54838, 54841, 54925, 55380, 55381, 55640, 55680, 55681, 55689, 55747, 55768, 55776, 56249, 56355, 56364, 56451, 56816, 56817, 56821, 56841, 57345, 57352, 57907, 57989, 58357, 58364, 58372, 58386, 58442, 58444, 58616, 58620, 58626, 58901, 59176, 59327, 59345, 59630, 59725, 60061, 60063, 60066, 60132, 60170, 60172, 60176, 60221, 60301, 60306, 60317, 60436, 60442, 60473, 60482, 60487, 60490, 60493, 60503, 60519, 60524, 60529, 60537, 60564, 60571, 60572, 60573, 60574, 60575, 60710, 60717, 60719, 60722, 60724, 60726, 60770, 60818, 60826, 61188, 61324, 61356, 61618, 61848, 62114, 62115, 62147, 62459, 63086, 63108, 63251, 63310, 63335, 63611, 64343, 64411, 64415, 64440, 64571, 64714, 64738, 64742, 64752, 64786, 64792, 64824, 64860, 64867, 64882, 64908, 64912, 64914, 64938, 64952, 64955, 64964, 64976, 64999, 65002, 65005, 65007, 65013, 65020, 65025, 66808, 67115, 67151, 67209, 67353, 67356, 67361, 67363, 67365, 67379, 67381, 67384, 67386, 67389, 67392, 67653, 67667, 67670, 67672, 67698, 67702, 67712, 67752, 67758, 67771, 68051, 68160, 70188, 70652, 70727, 70730, 70748, 70756, 70761, 70803, 70807, 70811, 70830, 70841, 70854, 71174, 71176, 71178, 71186, 71191, 71194, 71198, 71214, 71217, 71226, 71228, 71402, 71404, 71540, 71585, 71602, 71606, 71611, 71637, 71642, 71645, 71903, 72413, 72417, 72419, 74396, 75455, 75457, 75465, 75474); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(-66799, 0, 15, 0x00400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Desolation +(-63730, 0, 6, 0x00000800, 0x00000004, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Serendipity +(-61846, 0, 0, 0x00000000, 0x00000000, 0x00000000, 64, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Dragonhawk +(-58872, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 8259, 0x0, 0, 0, 0, 0), -- Damage Shield +(-57878, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Natural Reaction +(-57470, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Renewed Hope +(-56636, 0, 4, 0x00000020, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 6000, 0), -- Taste for Blood +(-56342, 0, 9, 0x00000018, 0x08000000, 0x00024000, 0, 0x0, 0x0, 0, 0x2, 0, 0, 0, 0), -- Lock and Load +(-55666, 0, 15, 0x00000001, 0x08000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Desecration +(-53709, 2, 10, 0x00004000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shield of the Templar +(-53671, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Judgements of the Pure +(-53551, 0, 10, 0x00001000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sacred Cleansing +(-53527, 1, 10, 0x00000000, 0x00000000, 0x00000004, 1024, 0x0, 0x2, 1, 0x0, 0, 100, 0, 0), -- Divine Guardian +(-53486, 0, 10, 0x00800000, 0x00028000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- The Art of War +(-53256, 0, 9, 0x00000800, 0x00800001, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Cobra Strikes +(-53234, 0, 9, 0x00020000, 0x00000001, 0x00000001, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Piercing Shots +(-53221, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Steady Shot +(-53215, 0, 9, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Wild Quiver +(-52795, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Borrowed Time +(-52127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Water Shield +(-51940, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 20, 0, 0), -- Earthliving Weapon (Passive) +(-51692, 0, 8, 0x00000204, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Waylay +(-51672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 1000, 0), -- Unfair Advantage +(-51634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Focused Attacks +(-51562, 0, 11, 0x00000100, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Tidal Waves +(-51523, 0, 11, 0x00000000, 0x00000001, 0x00000000, 65536, 0x0, 0x2, 0, 0x0, 0, 50, 0, 0), -- Earthen Power +(-51521, 0, 11, 0x00000000, 0x01000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Stormstrike +(-50880, 0, 15, 0x00000000, 0x04000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Icy Talons +(-49223, 0, 15, 0x00000011, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Dirge +(-49219, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Blood-Caked Blade +(-49149, 0, 15, 0x00000006, 0x00020002, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Chill of the Grave +(-49027, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 20000, 0), -- Bloodworms +(-49004, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 51, 0x0, 0, 0, 0, 0), -- Scent of Blood +(-48988, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Bloody Vengeance +(-48516, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Eclipse +(-48506, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Earth and Moon +(-48496, 0, 7, 0x00000060, 0x02000002, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Living Seed +(-48483, 0, 7, 0x00008800, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Infected Wounds +(-47580, 0, 6, 0x00000000, 0x00000000, 0x00000040, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Pain and Suffering +(-47516, 0, 6, 0x00001800, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Grace +(-47509, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Divine Aegis +(-47263, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 20000, 0), -- Torture +(-47258, 0, 5, 0x00000000, 0x00800000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Backdraft +(-47245, 0, 5, 0x00000002, 0x00000000, 0x00000000, 262144, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Molten Core +(-47201, 0, 5, 0x00004009, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Everlasting Affliction +(-47195, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Eradication +(-46945, 0, 4, 0x00000000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Safeguard +(-46867, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Wrecking Crew +(-46854, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Trauma +(-45234, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Focused Will +(-44557, 0, 3, 0x00000020, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Enduring Winter +(-44449, 0, 3, 0x20E21277, 0x00019048, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Burnout +(-44442, 0, 3, 0x00800000, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 1000, 0), -- Firestarter +(-41635, 0, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Prayer of Mending +(-35541, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8388608, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Combat Potency +(-35100, 0, 9, 0x00001000, 0x00000000, 0x00000001, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Concussive Barrage +(-34950, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Go for the Throat +(-34935, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 8000, 0), -- Backlash +(-34753, 0, 6, 0x00001800, 0x00000004, 0x00001000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Holy Concentration +(-34500, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Expose Weakness +(-33881, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Natural Perfection +(-33191, 0, 6, 0x00008000, 0x00000400, 0x00000040, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Misery +(-33150, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Surge of Light +(-33142, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blessed Resilience +(-33076, 0, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Prayer of Mending +(-32385, 0, 5, 0x00000001, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadow Embrace +(-31833, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Light's Grace +(-31569, 0, 3, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Blink +(-31124, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blade Twisting +(-30881, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Nature's Guardian +(-30701, 28, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x0, 0x0, 0, 0x0, 0, 100, 0, 0), -- Elemental Absorption +(-30299,126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Nether Protection +(-30160, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Elemental Devastation +(-29593, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 112, 0x0, 0, 0, 0, 0), -- Improved Defensive Stance +(-29074, 20, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Master of Elements +(-27811, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blessed Recovery +(-20925, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield +(-20500, 0, 4, 0x10000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Berserker Rage +(-20210, 0, 10, 0xC0000000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Illumination +(-20177, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Reckoning +(-20049, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Vengeance +(-19572, 0, 9, 0x00800000, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Improved Mend Pet +(-19184, 0, 9, 0x00000010, 0x00002000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Entrapment +(-18119, 0, 5, 0x00000000, 0x00800000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aftermath +(-18096, 0, 5, 0x00000100, 0x00800000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Pyroclasm +(-17793, 0, 5, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Shadow Bolt +(-17106, 0, 7, 0x00080000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Intensity +(-16958, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Primal Fury +(-16952, 0, 7, 0x00039000, 0x00000400, 0x00040000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Blood Frenzy +(-16880, 72, 7, 0x00000067, 0x03800002, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Nature's Grace +(-16487, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blood Craze +(-16257, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Flurry +(-16256, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Flurry +(-16176, 0, 11, 0x000001C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ancestral Healing +(-14892, 0, 6, 0x10001E00, 0x00010004, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Inspiration +(-14531, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Martyrdom +(-14186, 0, 8, 0x40800508, 0x00000006, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Seal Fate +(-13754, 0, 8, 0x00000010, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Kick +(-13165, 0, 0, 0x00000000, 0x00000000, 0x00000000, 64, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Hawk +(-12966, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Flurry +(-12319, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Flurry +(-12311, 0, 4, 0x00000800, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Gag Order +(-12298, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Shield Specialization +(-12289, 0, 4, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Hamstring +(-12281, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 6000, 0), -- Sword Specialization +(-11255, 0, 3, 0x00004000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Counterspell +(-11213, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Arcane Concentration +(-11180, 16, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Winter's Chill +(-11095, 0, 3, 0x00000010, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Scorch +(-9799, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Eye for an Eye +(-9452, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 3, 0, 0, 0), -- Vindication +(-5952, 0, 8, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Throwing Specialization +(-324, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Lightning Shield +(6346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Fear Ward +(7383, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Water Bubble +(7434, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Fate Rune of Unsurpassed Vigor +(8178, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Grounding Totem Effect +(9782, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Mithril Shield Spike +(9784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Iron Shield Spike +(12169, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block +(12322, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Unbridled Wrath +(12999, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 6, 0, 0, 0), -- Unbridled Wrath +(13000, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 9, 0, 0, 0), -- Unbridled Wrath +(13001, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 12, 0, 0, 0), -- Unbridled Wrath +(13002, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 15, 0, 0, 0), -- Unbridled Wrath +(13163, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Aspect of the Monkey +(15088, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Flurry +(15128, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Flames +(15277, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Seal of Reckoning +(15346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Seal of Reckoning +(15600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Hand of Justice +(16164, 28, 0, 0x00000000, 0x00000000, 0x00000000, 65536, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Elemental Focus +(16550, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Bonespike +(16620, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Proc Self Invulnerability +(16624, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Thorium Shield Spike +(17364, 8, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Stormstrike +(17495, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Crest of Retribution +(20128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt +(20131, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt +(20132, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt +(20164, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 5, 0, 0, 0), -- Seal of Justice +(20165, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 20, 0, 0, 0), -- Seal of Light +(20166, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 12, 0, 0, 0), -- Seal of Wisdom +(20375, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 1000, 0), -- Seal of Command +(20705, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Power Shield 500 +(20784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Tamed Pet Passive 07 (DND) +(20911, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Blessing of Sanctuary +(21185, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Spinal Reaper +(21882, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Judgement Smite +(21890, 0, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Warrior's Wrath +(22618, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Force Reactive Disk +(22648, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Call of Eskhandar +(23547, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Parry +(23548, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Parry +(23551, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lightning Shield +(23552, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Lightning Shield +(23572, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Surge +(23578, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Expose Weakness +(23581, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Bloodfang +(23686, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Lightning Strike +(23688, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aura of the Blue Dragon +(23689, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 4, 0, 0, 0), -- Heroism +(23721, 0, 9, 0x00000800, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Arcane Infused +(23920, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(24353, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Primal Instinct +(24389, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Chaos Fire +(24905, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 15, 0, 0, 0), -- Moonkin Form (Passive) +(25050, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Flames +(25669, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Decapitate +(25899, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Greater Blessing of Sanctuary +(26107, 0, 7, 0x00800000, 0x10000080, 0x00000000, 0, 0x0, 0x2, 116, 0x0, 0, 0, 0, 0), -- Symbols of Unending Life Finisher Bonus +(26119, 0, 10, 0x90100003, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Stormcaller Spelldamage Bonus +(26128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 8, 0x0, 0, 0, 0, 0), -- Enigma Resist Bonus +(26135, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Battlegear of Eternal Justice +(26480, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Badge of the Swarmguard +(26605, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x2, 0, 0, 0, 0), -- Bloodcrown +(27419, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Warrior's Resolve +(27498, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Crusader's Wrath +(27521, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Mana Restore +(27656, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flame Lash +(27774, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- The Furious Storm +(27787, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Rogue Armor Energize +(28305, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mana Leech +(28752, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Adrenaline Rush +(28802, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Epiphany +(28812, 0, 8, 0x02000006, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Head Rush +(28816, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Invigorate +(29150, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Electric Discharge +(29385, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command +(29455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Felsteel Shield Spike +(29501, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Frost Arrow +(29624, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Searing Arrow +(29625, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flaming Cannonball +(29626, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Shadow Bolt +(29632, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Shadow Shot +(29633, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Fire Blast +(29634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Quill Shot +(29635, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flaming Shell +(29636, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Venom Shot +(29637, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Keeper's Sting +(29977, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Combustion +(30003, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Sheen of Zanza +(30937, 32, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Shadow +(31394, 32, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Shadow +(31794, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Focused Mind +(31904, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield +(32587, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block +(32642, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Spore Cloud +(32734, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Earth Shield +(32748, 0, 8, 0x00000000, 0x00000001, 0x00000000, 320, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Throw Interrupt +(32776, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt +(32777, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield +(32837, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Focus Trigger +(32844, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Lesser Heroism +(32885, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Infuriate +(33089, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Vigilance of the Colossus +(33127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command +(33297, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Haste Trinket +(33299, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Coilfang Slave Pens Lvl 70 Boss3a Caster Trinket +(33510, 0, 0, 0x00000000, 0x00000000, 0x00000000, 340, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Health Restore +(33648, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Reflection of Torment +(33719, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Perfect Spell Reflection +(33746, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Essence Infused Mushroom +(33759, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Power Infused Mushroom +(33953, 0, 0, 0x00000000, 0x00000000, 0x00000000, 17408, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Essence of Life +(34074, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Viper +(34080, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Riposte Stance +(34138, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totem of the Third Wind +(34139, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Libram of Justice +(34258, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Justice +(34262, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Mercy +(34320, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Call of the Nexus +(34355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Poison Shield +(34584, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 30000, 0), -- Love Struck +(34586, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.5, 0, 0, 0), -- Romulo's Poison +(34598, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Karazhan Caster Robe +(34749, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 8, 0x2, 0, 0, 0, 0), -- Recurring Power +(34774, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.5, 0, 20000, 0), -- Magtheridon Melee Trinket +(34783, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(34827, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Water Shield +(35077, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Defender +(35080, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 55000, 0), -- Band of the Eternal Champion +(35083, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Sage +(35086, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Restorer +(35121, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Nether Power +(36032, 0, 3, 0x00001000, 0x00008000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Arcane Blast +(36096, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(36111, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- World Breaker +(36541, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x2, 0, 0, 0, 0), -- Curse of Burning Shadows +(37165, 0, 8, 0x00200400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Haste +(37170, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Free Finisher Chance +(37173, 0, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 25000, 0), -- Armor Penetration +(37189, 0, 10, 0xC0000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 60000, 0), -- Recuced Holy Light Cast Time +(37193, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Infused Shield +(37195, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Judgement Group Heal +(37197, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Damage +(37213, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Mana Cost Reduction +(37214, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Energized +(37227, 0, 11, 0x000001C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 60000, 0), -- Improved Healing Wave +(37237, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Lightning Bolt Discount +(37247, 8, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Regain Mana +(37379, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Flameshadow +(37384, 0, 5, 0x00000001, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Corruption and Immolate +(37443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Bonus Damage +(37514, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Blade Turning +(37516, 0, 4, 0x00000400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Revenge Bonus +(37519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 48, 0x0, 0, 0, 0, 0), -- Rage Bonus +(37523, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Reinforced Shield +(37528, 0, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Overpower Bonus +(37536, 0, 4, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Battle Shout +(37568, 0, 6, 0x00000800, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Greater Heal Discount +(37600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Offensive Discount +(37601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Relentlessness +(37603, 0, 6, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadow Word Pain Damage +(37655, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Bonus Mana Regen +(37657, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 2500, 0), -- Lightning Capacitor +(38026, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Viscous Shield +(38031, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block +(38290, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.6, 0, 0, 0), -- Santos' Blessing +(38299, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 12000, 0), -- HoTs on Heals +(38326, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Threat Reduction Melee +(38327, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Threat Reduction Spell +(38334, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Proc Mana Regen +(38347, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Crit Proc Spell Damage +(38350, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Proc Heal +(38394, 0, 5, 0x00000006, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Dot Heals +(38857, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spell Ground +(39027, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Poison Shield +(39442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 1, 0x0, 0, 0, 0, 0), -- Aura of Wrath +(39443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Aura of Wrath +(39530, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Focus +(39958, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,0.7, 0, 40000, 0), -- Skyfire Swiftness +(40407, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Illidan Tank Shield +(40444, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Black Temple Tank Trinket +(40458, 0, 4, 0x02000000, 0x00000601, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Warrior Tier 6 Trinket +(40475, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Black Temple Melee Trinket +(40478, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Warlock Tier 6 Trinket +(40482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Mage Tier 6 Trinket +(40485, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hunter Tier 6 Trinket +(40899, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 1, 0, 0, 0), -- Felfire Proc +(41034, 126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 1024, 0x0, 0, 0, 0, 0), -- Spell Absorption +(41260, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Aviana's Purpose +(41262, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Aviana's Will +(41381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 256, 0x0, 0, 0, 0, 0), -- Shell of Life +(41393, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 32, 0x0, 0, 0, 0, 0), -- Riposte +(41434, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 45000, 0), -- The Twin Blades of Azzinoth +(41469, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command +(41989, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,0.5, 0, 0, 0), -- Fists of Fury +(42083, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Fury of the Crashing Waves +(42135, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 90000, 0), -- Lesser Rune of Warding +(42136, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 90000, 0), -- Greater Rune of Warding +(42368, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Merciless Libram of Justice +(42370, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Merciless Totem of the Third WInd +(43443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(43726, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vengeful Libram of Justice +(43728, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vengeful Totem of Third WInd +(43737, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Primal Instinct +(43739, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lunar Grace +(43741, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Light's Grace +(43745, 0, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Crusader's Command +(43748, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Elemental Strength +(43750, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Energized +(43819, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Lucidity +(44543, 0, 3, 0x00100220, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 7, 0, 0), -- Fingers of Frost +(44545, 0, 3, 0x00100220, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 15, 0, 0), -- Fingers of Frost +(45054, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 15000, 0), -- Augment Pain +(45354, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Sunwell Dungeon Melee Trinket +(45355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - T7 Melee Trinket Base +(45469, 0, 15, 0x00000010, 0x00000000, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Death Strike +(45481, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Caster Neck +(45482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Melee Neck +(45483, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Tank Neck +(45484, 0, 0, 0x00000000, 0x00000000, 0x00000000, 16384, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Healer Neck +(46025, 32, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blackout +(46092, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brutal Libram of Justice +(46098, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brutal Totem of Third WInd +(46569, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Caster Neck +(46662, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 20000, 0), -- Deathfrost +(46832, 0, 7, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Moonkin Starfire Bonus +(46910, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,5.5, 0, 0, 0), -- Furious Attacks +(46911, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,7.5, 0, 0, 0), -- Furious Attacks +(47981, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(48833, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Primal Instinct +(48835, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Justice +(48837, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Elemental Tenacity +(49592, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8528552, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Temporal Rift +(49622, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Bonus Mana Regen +(50240, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Evasive Maneuvers +(50421, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Scent of Blood +(50781, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 6000, 0), -- Fate Rune of Primal Energy +(51123, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 1, 0, 0, 0), -- Killing Machine +(51127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 2, 0, 0, 0), -- Killing Machine +(51128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 4, 0, 0, 0), -- Killing Machine +(51129, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 6, 0, 0, 0), -- Killing Machine +(51130, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 8, 0, 0, 0), -- Killing Machine +(51346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown! +(51349, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown +(51352, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown! +(51359, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown +(51414, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Venomous Breath Aura +(51915, 0, 0, 0x00000000, 0x00000000, 0x00000000,16777216, 0x0, 0x0, 0, 0x0, 0, 100, 600000, 0), -- Undying Resolve +(52020, 0, 7, 0x00008000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Snap and Snarl +(52423, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Retaliation +(52898, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Spell Damping +(53386, 0, 15, 0x82127F27, 0x000001BF, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Cinderglacier +(53397, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Invigoration +(54278, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Empowered Imp +(54646, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Focus Magic +(54695, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Death Knight's Anguish Base +(54707, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Sonic Awareness (DND) +(54738, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Star of Light +(54808, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 60000, 0), -- Sonic Shield +(54838, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Purified Spirit +(54841, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 2500, 0), -- Thunder Capacitor +(54925, 2, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Seal of Command +(55380, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,0.7, 0, 40000, 0), -- Skyflare Swiftness +(55381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Mana Restore +(55640, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Lightweave Embroidery +(55680, 0, 6, 0x00000200, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Prayer of Healing +(55681, 0, 6, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shadow Word: Pain +(55689, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Shadow +(55747, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Argent Fury +(55768, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkglow Embroidery +(55776, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Swordguard Embroidery +(56249, 0, 5, 0x00000000, 0x00000000, 0x00000400, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Felhunter +(56355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Titanium Shield Spike +(56364, 0, 3, 0x00000000, 0x01000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Remove Curse +(56451, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Earth Shield +(56816, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 48, 0x0, 0, 0, 0, 0), -- Rune Strike +(56817, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rune strike proc (SERVERSIDE) +(56821, 0, 8, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Sinister Strike +(56841, 0, 9, 0x00000800, 0x00000000, 0x00000000, 256, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Arcane Shot +(57345, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkmoon Card: Greatness +(57352, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkmoon Card: Death +(57907, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Increased Spirit +(57989, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadowfiend Death +(58357, 0, 4, 0x00000040, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Heroic Strike +(58364, 0, 4, 0x00000400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Revenge +(58372, 0, 4, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Hamstring +(58386, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 32, 0x0, 0, 0, 0, 0), -- Glyph of Overpower +(58442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Airy Pale Ale +(58444, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 5000, 0), -- Worg Tooth Oatmeal Stout +(58616, 0, 15, 0x01000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Heart Strike +(58620, 0, 15, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Chains of Ice +(58626, 0, 15, 0x02000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Death Grip +(58901, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Tears of Anguish +(59176, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Spell Damping +(59327, 0, 15, 0x08000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rune Tap +(59345, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Chagrin +(59630, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 35000, 0), -- Black Magic +(59725, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection +(60061, 0, 0, 0x00000000, 0x00000000, 0x00000000, 294912, 0x2, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Flow of Time +(60063, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Now is the Time! +(60066, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Rage of the Unraveller +(60132, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Oblit/Scourge Strike Runic Power Up +(60170, 0, 5, 0x00000006, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Corruption Triggers Crit +(60172, 0, 5, 0x00040000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Life Tap Bonus Spirit +(60176, 0, 4, 0x00000020, 0x00000010, 0x00000000, 262144, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Bleed Cost Reduction +(60221, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Essence of Gossamer +(60301, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Meteorite Whetstone +(60306, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Vestige of Haldor +(60317, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Signet of Edward the Odd +(60436, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Grim Toll +(60442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Bandit's Insignia +(60473, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Forge Ember +(60482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Pendulum of Telluric Currents +(60487, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 15000, 0), -- Extract of Necromatic Power +(60490, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Embrace of the Spider +(60493, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Dying Curse +(60503, 1, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Taste for Blood +(60519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spark of Life +(60524, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Majestic Dragon Figurine +(60529, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Forethought Talisman +(60537, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Soul of the Dead +(60564, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Savage Gladiator's Totem of Survival +(60571, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hateful Gladiator's Totem of Survival +(60572, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Gladiator's Totem of Survival +(60573, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 4 Gladiator's Totem of Survival +(60574, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 5 Gladiator's Totem of Survival +(60575, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 6 Gladiator's Totem of Survival +(60710, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Savage Gladiator's Idol of Steadfastness +(60717, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hateful Gladiator's Idol of Steadfastness +(60719, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Gladiator's Idol of Steadfastness +(60722, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 4 Gladiator's Idol of Steadfastness +(60724, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 5 Gladiator's Idol of Steadfastness +(60726, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 6 Gladiator's Idol of Steadfastness +(60770, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totem of the Elemental Plane +(60818, 0, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Libram of Reciprocation +(60826, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sigil of Haunted Dreams +(61188, 0, 5, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Chaotic Mind +(61324, 0, 10, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Justice +(61356, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 90000, 0), -- Invigorating Earthsiege Diamond Passive +(61618, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Tentacles +(61848, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Aspect of the Dragonhawk +(62114, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Flow of Knowledge +(62115, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Strength of the Titans +(62147, 0, 15, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Icy Touch Defense Increase +(62459, 0, 15, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Chains of Ice Frost Rune Refresh +(63086, 0, 9, 0x00000000, 0x00000000, 0x00010000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Raptor Strike +(63108, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Siphon Life +(63251, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Glory of the Jouster +(63310, 0, 5, 0x00000000, 0x00010000, 0x00000000, 65536, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shadowflame +(63335, 0, 15, 0x00000000, 0x00000002, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Howling Blast +(63611, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x1, 0, 0, 0, 0), -- Improved Blood Presence +(64343, 0, 3, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Impact +(64411, 0, 0, 0x00000000, 0x00000000, 0x00000000, 279552, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blessing of Ancient Kings +(64415, 0, 0, 0x00000000, 0x00000000, 0x00000000, 279552, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Val'anyr Hammer of Ancient Kings - Equip Effect +(64440, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 20000, 0), -- Blade Warding +(64571, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Blood Draining +(64714, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Flame of the Heavens +(64738, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Show of Faith +(64742, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Pandora's Plea +(64752, 0, 7, 0x00001000, 0x00000100, 0x00200000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Feral 2P Bonus +(64786, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Comet's Trail +(64792, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Blood of the Old God +(64824, 0, 7, 0x00200000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Balance 4P Bonus +(64860, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T8 4P Bonus +(64867, 0, 3, 0x20000021, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Mage T8 2P Bonus +(64882, 0, 10, 0x00000000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Protection 4P Bonus +(64908, 0, 6, 0x00002000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T8 Shadow 4P Bonus +(64912, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T8 Healer 4P Bonus +(64914, 0, 8, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T8 2P Bonus +(64938, 0, 4, 0x00200040, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Warrior T8 Melee 2P Bonus +(64952, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Feral Relic +(64955, 0, 10, 0x00000000, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Protection Relic +(64964, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T8 Tank Relic +(64976, 0, 4, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Juggernaut +(64999, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x4, 0, 0, 0, 0), -- Meteoric Inspiration +(65002, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Bonus Mana Regen +(65005, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Alacrity of the Elements +(65007, 0, 0, 0x00000000, 0x00000000, 0x00000000, 81920, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Eye of the Broodmother +(65013, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Pyrite Infusion +(65020, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Mjolnir Runestone +(65025, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Dark Matter +(66808, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Meteor Fists +(67115, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Death Knight T9 Melee 2P Bonus +(67151, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Hunter T9 4P Bonus (Steady Shot) +(67209, 1, 8, 0x00100000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T9 2P Bonus (Rupture) +(67353, 0, 7, 0x00008000, 0x00100500, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred) +(67356, 8, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Restoration Relic (Rejuvenation) +(67361, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Balance Relic (Moonfire) +(67363, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Item - Paladin T9 Holy Relic (Judgement) +(67365, 0, 10, 0x00000000, 0x00000800, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 6000, 0), -- Item - Paladin T9 Retribution Relic (Seal of Vengeance) +(67379, 0, 10, 0x00000000, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T9 Protection Relic (Hammer of The Righteous) +(67381, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Item - Death Knight T9 Tank Relic (Rune Strike) +(67384, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 80, 10000, 0), -- Item - Death Knight T9 Melee Relic (Rune Strike) +(67386, 0, 11, 0x00000001, 0x00000000, 0x00000000, 65536, 0x0, 0x1, 0, 0x0, 0, 0, 6000, 0), -- Item - Shaman T9 Elemental Relic (Lightning Bolt) +(67389, 0, 11, 0x00000100, 0x00000000, 0x00000000, 16384, 0x0, 0x1, 0, 0x0, 0, 0, 8000, 0), -- Item - Shaman T9 Restoration Relic (Chain Heal) +(67392, 0, 11, 0x00000000, 0x00000000, 0x00000004, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T9 Enhancement Relic (Lava Lash) +(67653, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4194344, 0x1, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Tank Trinket +(67667, 0, 0, 0x00000000, 0x00000000, 0x00000000, 16384, 0x2, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Healer Trinket +(67670, 0, 0, 0x00000000, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 CasterTrinket +(67672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8388948, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Melee Trinket +(67698, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Item - Coliseum 25 Normal Healer Trinket +(67702, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Coliseum 25 Normal Melee Trinket +(67712, 0, 0, 0x00000000, 0x00000000, 0x00000000, 69632, 0x0, 0x2, 2, 0x0, 0, 0, 2000, 0), -- Item - Coliseum 25 Normal Caster Trinket +(67752, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Item - Coliseum 25 Heroic Healer Trinket +(67758, 0, 0, 0x00000000, 0x00000000, 0x00000000, 69632, 0x0, 0x2, 2, 0x0, 0, 0, 2000, 0), -- Item - Coliseum 25 Heroic Caster Trinket +(67771, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Coliseum 25 Heroic Melee Trinket +(68051, 1, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Overpower Ready! +(68160, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Meteor Fists +(70188, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Cloak of Darkness +(70652, 0, 15, 0x00000008, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 Tank 4P Bonus +(70727, 0, 9, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T10 2P Bonus +(70730, 0, 9, 0x00004000, 0x00001000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T10 4P Bonus +(70748, 0, 3, 0x00000000, 0x00200000, 0x00000000, 1024, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Mage T10 4P Bonus +(70756, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Holy 4P Bonus +(70761, 0, 10, 0x00000000, 0x00000000, 0x00000001, 1024, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Protection 4P Bonus +(70803, 0, 8, 0x003E0000, 0x00000008, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T10 4P Bonus +(70807, 0, 11, 0x00000000, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration 2P Bonus +(70811, 0, 11, 0x00000003, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental 2P Bonus +(70830, 0, 11, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Enhancement 2P Bonus +(70841, 0, 5, 0x00000004, 0x00000100, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Warlock T10 4P Bonus +(70854, 0, 4, 0x00000000, 0x00000010, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Warrior T10 Melee 2P Bonus +(71174, 1, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Feral Relic (Rake and Lacerate) +(71176, 0, 7, 0x00200002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Balance Relic (Moonfire and Insect Swarm) +(71178, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Restoration Relic (Rejuvenation) +(71186, 0, 10, 0x00000000, 0x00008000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Retribution Relic (Crusader Strike) +(71191, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Holy Relic (Holy Shock) +(71194, 0, 10, 0x00000000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Protection Relic (Shield of Righteousness) +(71198, 4, 11, 0x10000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental Relic (Shocks) +(71214, 0, 11, 0x00000000, 0x00000010, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Enhancement Relic (Stormstrike) +(71217, 0, 11, 0x00000000, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration Relic (Riptide) +(71226, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 DPS Relic (Obliterate, Scourge Strike, Death Strike) +(71228, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 Tank Relic (Runestrike) +(71402, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 10 Normal Melee Trinket +(71404, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Item - Icecrown Dungeon Melee Trinket +(71540, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 10 Heroic Melee Trinket +(71585, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Emblem Healer Trinket +(71602, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Normal Caster Trinket 1 Base +(71606, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 100000, 0), -- Item - Icecrown 25 Normal Caster Trinket 2 +(71611, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Normal Healer Trinket 2 +(71637, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 100000, 0), -- Item - Icecrown 25 Heroic Caster Trinket 2 +(71642, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Heroic Healer Trinket 2 +(71645, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Heroic Caster Trinket 1 Base +(71903, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 12, 0, 0, 0), -- Item - Shadowmourne Legendary +(72413, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 10, 60000, 0), -- Item - Icecrown Reputation Ring Melee +(72417, 0, 0, 0x00000000, 0x00000000, 0x00000000, 327680, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Item - Icecrown Reputation Ring Caster Trigger +(72419, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Item - Icecrown Reputation Ring Healer Trigger +(74396, 84, 3, 0x28E212F7, 0x00119048, 0x00000000, 65536, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Fingers of Frost +(75455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Melee Trinket +(75457, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Heroic Melee Trinket +(75465, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Nuker Trinket +(75474, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0); -- Item - Chamber of Aspects 25 Heroic Nuker Trinket + +-- Kill the damned thing already! +DROP TABLE IF EXISTS `spell_proc_event`; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index df292c0188..03684e3c74 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -17,17 +17,19 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "hyjal.h" #include "hyjal_trash.h" enum Spells { - SPELL_CARRION_SWARM = 31306, - SPELL_SLEEP = 31298, - SPELL_VAMPIRIC_AURA = 38196, - SPELL_INFERNO = 31299, - SPELL_IMMOLATION = 31303, - SPELL_INFERNO_EFFECT = 31302, + SPELL_CARRION_SWARM = 31306, + SPELL_SLEEP = 31298, + SPELL_VAMPIRIC_AURA = 38196, + SPELL_VAMPIRIC_AURA_HEAL = 31285, + SPELL_INFERNO = 31299, + SPELL_IMMOLATION = 31303, + SPELL_INFERNO_EFFECT = 31302 }; enum Texts @@ -261,8 +263,48 @@ public: }; +class spell_anetheron_vampiric_aura : public SpellScriptLoader +{ + public: + spell_anetheron_vampiric_aura() : SpellScriptLoader("spell_anetheron_vampiric_aura") { } + + class spell_anetheron_vampiric_aura_AuraScript : public AuraScript + { + PrepareAuraScript(spell_anetheron_vampiric_aura_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_AURA_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = damageInfo->GetDamage() * 3; + eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_anetheron_vampiric_aura_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_anetheron_vampiric_aura_AuraScript(); + } +}; + void AddSC_boss_anetheron() { new boss_anetheron(); new npc_towering_infernal(); + new spell_anetheron_vampiric_aura(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 46f18d1773..5d74d128f6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1305,6 +1305,26 @@ class spell_taldaram_ball_of_inferno_flame : public SpellScriptLoader { return new spell_taldaram_ball_of_inferno_flame_SpellScript(); } + + class spell_taldaram_ball_of_inferno_flame_AuraScript : public AuraScript + { + PrepareAuraScript(spell_taldaram_ball_of_inferno_flame_AuraScript); + + void HandleStackDrop(ProcEventInfo& /*eventInfo*/) + { + ModStackAmount(-1); + } + + void Register() override + { + OnProc += AuraProcFn(spell_taldaram_ball_of_inferno_flame_AuraScript::HandleStackDrop); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_taldaram_ball_of_inferno_flame_AuraScript(); + } }; // 72080 - Kinetic Bomb diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 89da2c8c31..5c102bcaeb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -431,7 +431,7 @@ class boss_deathbringer_saurfang : public CreatureScript case 72445: case 72446: if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY)) - target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, me, true); + target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, (Unit*)nullptr, true); break; default: break; @@ -1135,8 +1135,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) - GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true); + GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, (Unit*)nullptr, true); } void Register() override @@ -1151,6 +1150,41 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader } }; +// 72176 - Blood Beast's Blood Link +class spell_deathbringer_blood_beast_blood_link : public SpellScriptLoader +{ + public: + spell_deathbringer_blood_beast_blood_link() : SpellScriptLoader("spell_deathbringer_blood_beast_blood_link") { } + + class spell_deathbringer_blood_beast_blood_link_AuraScript : public AuraScript + { + PrepareAuraScript(spell_deathbringer_blood_beast_blood_link_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_BLOOD_LINK_DUMMY)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetProcTarget()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 3, (Unit*)nullptr, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_deathbringer_blood_beast_blood_link_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_deathbringer_blood_beast_blood_link_AuraScript(); + } +}; + class spell_deathbringer_blood_nova : public SpellScriptLoader { public: @@ -1170,8 +1204,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) - GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true); + GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, (Unit*)nullptr, true); } void Register() override @@ -1349,6 +1382,7 @@ void AddSC_boss_deathbringer_saurfang() new spell_deathbringer_blood_link_aura(); new spell_deathbringer_blood_power(); new spell_deathbringer_rune_of_blood(); + new spell_deathbringer_blood_beast_blood_link(); new spell_deathbringer_blood_nova(); new spell_deathbringer_blood_nova_targeting(); new spell_deathbringer_boiling_blood(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index ecc2ec855a..4ed62c7281 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -846,9 +846,23 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader } } + void HandleProc(ProcEventInfo& eventInfo) + { + uint32 stack = GetStackAmount(); + Unit* caster = eventInfo.GetActor(); + + int32 const mod = caster->GetMap()->Is25ManRaid() ? 1500 : 1250; + int32 dmg = 0; + for (uint8 i = 1; i <= stack; ++i) + dmg += mod * i; + + caster->CastCustomSpell(SPELL_EXPUNGED_GAS, SPELLVALUE_BASE_POINT0, dmg); + } + void Register() override { OnEffectPeriodic += AuraEffectPeriodicFn(spell_putricide_gaseous_bloat_AuraScript::HandleExtraEffect, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + OnProc += AuraProcFn(spell_putricide_gaseous_bloat_AuraScript::HandleProc); } }; @@ -1086,6 +1100,45 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader } }; +// 71770 - Ooze Spell Tank Protection +class spell_putricide_ooze_tank_protection : public SpellScriptLoader +{ + public: + spell_putricide_ooze_tank_protection() : SpellScriptLoader("spell_putricide_ooze_tank_protection") { } + + class spell_putricide_ooze_tank_protection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_putricide_ooze_tank_protection_AuraScript); + + bool Validate(SpellInfo const* spellInfo) override + { + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell) || + !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].TriggerSpell)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* actionTarget = eventInfo.GetActionTarget(); + actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_putricide_ooze_tank_protection_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_putricide_ooze_tank_protection_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_putricide_ooze_tank_protection_AuraScript(); + } +}; + class spell_putricide_choking_gas_bomb : public SpellScriptLoader { public: @@ -1610,6 +1663,7 @@ void AddSC_boss_professor_putricide() new spell_putricide_slime_puddle_aura(); new spell_putricide_unstable_experiment(); new spell_putricide_ooze_eruption_searcher(); + new spell_putricide_ooze_tank_protection(); new spell_putricide_choking_gas_bomb(); new spell_putricide_unbound_plague(); new spell_putricide_eat_ooze(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 1407b0a0c4..108eb86228 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1192,6 +1192,7 @@ class npc_crok_scourgebane : public CreatureScript } else { + // looks totally hacky to me me->ModifyHealth(me->CountPctFromMaxHealth(5)); _events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 7c4d4730b0..ce6bcb0a39 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -2037,11 +2037,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader void TriggerDamageSpellFromPlayer() { if (Player* hitTarget = GetHitPlayer()) - { - // There is some proc in this spell I have absolutely no idea of use, but just in case... - TriggerCastFlags triggerFlags = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_DISALLOW_PROC_EVENTS); - hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, triggerFlags, NULL, NULL, GetCaster()->GetGUID()); - } + hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, true, nullptr, nullptr, GetCaster()->GetGUID()); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 6e92303443..863740fa70 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -1063,6 +1063,51 @@ class spell_xt002_submerged : public SpellScriptLoader } }; +class spell_xt002_321_boombot_aura : public SpellScriptLoader +{ + public: + spell_xt002_321_boombot_aura() : SpellScriptLoader("spell_xt002_321_boombot_aura") { } + + class spell_xt002_321_boombot_aura_AuraScript : public AuraScript + { + PrepareAuraScript(spell_xt002_321_boombot_aura_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActionTarget()->GetEntry() != NPC_XS013_SCRAPBOT) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + InstanceScript* instance = eventInfo.GetActor()->GetInstanceScript(); + if (!instance) + return; + + instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_xt002_321_boombot_aura_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_xt002_321_boombot_aura_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_xt002_321_boombot_aura_AuraScript(); + } +}; + class achievement_nerf_engineering : public AchievementCriteriaScript { public: @@ -1122,6 +1167,7 @@ void AddSC_boss_xt002() new spell_xt002_heart_overload_periodic(); new spell_xt002_tympanic_tantrum(); new spell_xt002_submerged(); + new spell_xt002_321_boombot_aura(); new achievement_nerf_engineering(); new achievement_heartbreaker(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 555f81c275..9cff3247a6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -2750,6 +2750,7 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { + PreventDefaultAction(); int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60); GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, NULL, aurEff); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 715802612b..7eb24fb5dd 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -456,7 +456,11 @@ class spell_ingvar_woe_strike : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetHealInfo()->GetHeal() != 0; + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return false; + + return true; } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 4255f17005..2e0e2157e3 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -196,6 +196,57 @@ class spell_fixate : public SpellScriptLoader } }; +enum SecondWind +{ + SPELL_SECOND_WIND_TRIGGER = 42771 +}; + +// 42770 - Second Wind +class spell_uk_second_wind : public SpellScriptLoader +{ + public: + spell_uk_second_wind() : SpellScriptLoader("spell_uk_second_wind") { } + + class spell_uk_second_wind_AuraScript : public AuraScript + { + PrepareAuraScript(spell_uk_second_wind_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SECOND_WIND_TRIGGER)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return false; + + return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActionTarget(); + caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_uk_second_wind_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_uk_second_wind_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_uk_second_wind_AuraScript(); + } +}; + enum EnslavedProtoDrake { TYPE_PROTODRAKE_AT = 28, @@ -300,56 +351,11 @@ class npc_enslaved_proto_drake : public CreatureScript } }; -class spell_uk_second_wind_proc : public SpellScriptLoader -{ - public: - spell_uk_second_wind_proc() : SpellScriptLoader("spell_uk_second_wind_proc") { } - - class spell_uk_second_wind_proc_AuraScript : public AuraScript - { - PrepareAuraScript(spell_uk_second_wind_proc_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_UK_SECOUND_WIND_TRIGGER)) - return false; - return true; - } - - bool CheckProc(ProcEventInfo& eventInfo) - { - if (eventInfo.GetProcTarget() == GetTarget()) - return false; - if (!(eventInfo.GetDamageInfo() || eventInfo.GetDamageInfo()->GetSpellInfo()->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN)))) - return false; - return true; - } - - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - GetTarget()->CastCustomSpell(SPELL_UK_SECOUND_WIND_TRIGGER, SPELLVALUE_BASE_POINT0, 5, GetTarget(), true, NULL, aurEff); - } - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_uk_second_wind_proc_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_uk_second_wind_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } - - }; - - AuraScript* GetAuraScript() const override - { - return new spell_uk_second_wind_proc_AuraScript(); - } -}; - void AddSC_utgarde_keep() { new npc_dragonflayer_forge_master(); new npc_enslaved_proto_drake(); new spell_ticking_time_bomb(); new spell_fixate(); - new spell_uk_second_wind_proc(); + new spell_uk_second_wind(); } diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp new file mode 100644 index 0000000000..0aba111b6a --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008-2016 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "SpellScript.h" + +enum Spells +{ + SPELL_MARK_OF_MALICE_TRIGGERED = 33494 +}; + +class spell_mark_of_malice : public SpellScriptLoader +{ + public: + spell_mark_of_malice() : SpellScriptLoader("spell_mark_of_malice") { } + + class spell_mark_of_malice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mark_of_malice_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_MALICE_TRIGGERED)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + // just drop charges + if (aurEff->GetBase()->GetCharges() > 1) + return; + + GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_mark_of_malice_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mark_of_malice_AuraScript(); + } +}; + +void AddSC_shadow_labyrinth() +{ + new spell_mark_of_malice(); +} diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index ad71d40435..28c424d39b 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -34,16 +34,17 @@ enum Texts enum Spells { - SPELL_SHADOW_VOLLEY = 32963, - SPELL_CLEAVE = 31779, - SPELL_THUNDERCLAP = 36706, - SPELL_VOID_BOLT = 39329, - SPELL_MARK_OF_KAZZAK = 32960, - SPELL_MARK_OF_KAZZAK_DAMAGE = 32961, - SPELL_ENRAGE = 32964, - SPELL_CAPTURE_SOUL = 32966, - SPELL_TWISTED_REFLECTION = 21063, - SPELL_BERSERK = 32965, + SPELL_SHADOW_VOLLEY = 32963, + SPELL_CLEAVE = 31779, + SPELL_THUNDERCLAP = 36706, + SPELL_VOID_BOLT = 39329, + SPELL_MARK_OF_KAZZAK = 32960, + SPELL_MARK_OF_KAZZAK_DAMAGE = 32961, + SPELL_ENRAGE = 32964, + SPELL_CAPTURE_SOUL = 32966, + SPELL_TWISTED_REFLECTION = 21063, + SPELL_TWISTED_REFLECTION_HEAL = 21064, + SPELL_BERSERK = 32965, }; enum Events @@ -222,8 +223,47 @@ class spell_mark_of_kazzak : public SpellScriptLoader } }; +class spell_twisted_reflection : public SpellScriptLoader +{ + public: + spell_twisted_reflection() : SpellScriptLoader("spell_twisted_reflection") { } + + class spell_twisted_reflection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_twisted_reflection_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_TWISTED_REFLECTION_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_twisted_reflection_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_twisted_reflection_AuraScript(); + } +}; + void AddSC_boss_doomlordkazzak() { new boss_doomlord_kazzak(); new spell_mark_of_kazzak(); + new spell_twisted_reflection(); } diff --git a/src/server/scripts/Outland/outland_script_loader.cpp b/src/server/scripts/Outland/outland_script_loader.cpp index 8da9f62ea3..65488a81bf 100644 --- a/src/server/scripts/Outland/outland_script_loader.cpp +++ b/src/server/scripts/Outland/outland_script_loader.cpp @@ -37,6 +37,7 @@ void AddSC_boss_ambassador_hellmaw(); void AddSC_boss_blackheart_the_inciter(); void AddSC_boss_grandmaster_vorpil(); void AddSC_boss_murmur(); +void AddSC_shadow_labyrinth(); void AddSC_instance_shadow_labyrinth(); // Black Temple @@ -159,6 +160,7 @@ void AddOutlandScripts() AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); AddSC_boss_murmur(); + AddSC_shadow_labyrinth(); AddSC_instance_shadow_labyrinth(); // Black Temple diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index d119fd2281..872348a764 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -35,6 +35,17 @@ enum HunterCreatures NPC_HUNTER_VIPER = 19921 }; +enum PetSpellsMisc +{ + SPELL_PET_GUARD_DOG_HAPPINESS = 54445, + SPELL_PET_SILVERBACK_RANK_1 = 62800, + SPELL_PET_SILVERBACK_RANK_2 = 62801, + PET_ICON_ID_GROWL = 201, + PET_ICON_ID_CLAW = 262, + PET_ICON_ID_BITE = 1680, + PET_ICON_ID_SMACK = 473 +}; + class npc_pet_hunter_snake_trap : public CreatureScript { public: @@ -139,7 +150,156 @@ class npc_pet_hunter_snake_trap : public CreatureScript } }; +// -53178 - Guard Dog +class spell_pet_guard_dog : public SpellScriptLoader +{ + public: + spell_pet_guard_dog() : SpellScriptLoader("spell_pet_guard_dog") { } + + class spell_pet_guard_dog_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pet_guard_dog_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + // Growl shares family flags with other spells + // filter by spellIcon instead + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL) + return false; + + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true); + + float addThreat = CalculatePct(eventInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); + eventInfo.GetProcTarget()->AddThreat(caster, addThreat); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_pet_guard_dog_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pet_guard_dog_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pet_guard_dog_AuraScript(); + } +}; + +// -62764 - Silverback +class spell_pet_silverback : public SpellScriptLoader +{ + public: + spell_pet_silverback() : SpellScriptLoader("spell_pet_silverback") { } + + class spell_pet_silverback_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pet_silverback_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + // Growl shares family flags with other spells + // filter by spellIcon instead + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL) + return false; + + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 }; + + PreventDefaultAction(); + + uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1]; + eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_pet_silverback_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pet_silverback_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pet_silverback_AuraScript(); + } +}; + +// -61680 - Culling the Herd +class spell_pet_culling_the_herd : public SpellScriptLoader +{ + public: + spell_pet_culling_the_herd() : SpellScriptLoader("spell_pet_culling_the_herd") { } + + class spell_pet_culling_the_herd_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pet_culling_the_herd_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + // Claw, Bite and Smack share FamilyFlags with other spells + // filter by spellIcon instead + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return false; + + switch (spellInfo->SpellIconID) + { + case PET_ICON_ID_CLAW: + case PET_ICON_ID_BITE: + case PET_ICON_ID_SMACK: + break; + default: + return false; + } + + return true; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_pet_culling_the_herd_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pet_culling_the_herd_AuraScript(); + } +}; + void AddSC_hunter_pet_scripts() { new npc_pet_hunter_snake_trap(); + new spell_pet_guard_dog(); + new spell_pet_silverback(); + new spell_pet_culling_the_herd(); } diff --git a/src/server/scripts/Pet/pet_priest.cpp b/src/server/scripts/Pet/pet_priest.cpp index 832caf5b64..09dc6c0743 100644 --- a/src/server/scripts/Pet/pet_priest.cpp +++ b/src/server/scripts/Pet/pet_priest.cpp @@ -28,7 +28,7 @@ enum PriestSpells { SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228, - SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227, + SPELL_PRIEST_SHADOWFIEND_DEATH = 57989, SPELL_PRIEST_LIGHTWELL_CHARGES = 59907 }; @@ -70,12 +70,10 @@ class npc_pet_pri_shadowfiend : public CreatureScript { npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { } - void JustDied(Unit* /*killer*/) override + void IsSummonedBy(Unit* summoner) override { - if (me->IsSummon()) - if (Unit* owner = me->ToTempSummon()->GetSummoner()) - if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND)) - owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true); + if (summoner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND)) + DoCastAOE(SPELL_PRIEST_SHADOWFIEND_DEATH); } }; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 897f147322..bb1819d5b7 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1419,51 +1419,6 @@ class spell_gen_ds_flush_knockback : public SpellScriptLoader } }; -enum DummyTrigger -{ - SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470, - SPELL_PERSISTANT_SHIELD = 26467 -}; - -class spell_gen_dummy_trigger : public SpellScriptLoader -{ - public: - spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { } - - class spell_gen_dummy_trigger_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_dummy_trigger_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || - !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /* effIndex */) - { - int32 damage = GetEffectValue(); - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell()) - if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED) - caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_gen_dummy_trigger_SpellScript(); - } -}; - class spell_gen_dungeon_credit : public SpellScriptLoader { public: @@ -2341,6 +2296,41 @@ class spell_gen_orc_disguise : public SpellScriptLoader } }; +class spell_gen_proc_below_pct_damaged : public SpellScriptLoader +{ + public: + spell_gen_proc_below_pct_damaged(const char* name) : SpellScriptLoader(name) { } + + class spell_gen_proc_below_pct_damaged_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_proc_below_pct_damaged_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + int32 pct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + + if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage())) + return true; + + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_gen_proc_below_pct_damaged_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_proc_below_pct_damaged_AuraScript(); + } +}; + enum ParachuteSpells { SPELL_PARACHUTE = 45472, @@ -3279,6 +3269,53 @@ class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader } }; +enum VampiricTouch +{ + SPELL_VAMPIRIC_TOUCH_HEAL = 52724 +}; + +// 52723 - Vampiric Touch +// 60501 - Vampiric Touch +class spell_gen_vampiric_touch : public SpellScriptLoader +{ + public: + spell_gen_vampiric_touch() : SpellScriptLoader("spell_gen_vampiric_touch") { } + + class spell_gen_vampiric_touch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_vampiric_touch_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_TOUCH_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + Unit* caster = eventInfo.GetActor(); + int32 bp = damageInfo->GetDamage() / 2; + caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_gen_vampiric_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_vampiric_touch_AuraScript(); + } +}; + enum VehicleScaling { SPELL_GEAR_SCALING = 66668 @@ -4067,7 +4104,6 @@ void AddSC_generic_spell_scripts() new spell_gen_despawn_self(); new spell_gen_divine_storm_cd_reset(); new spell_gen_ds_flush_knockback(); - new spell_gen_dummy_trigger(); new spell_gen_dungeon_credit(); new spell_gen_elune_candle(); new spell_gen_gadgetzan_transporter_backfire(); @@ -4092,6 +4128,12 @@ void AddSC_generic_spell_scripts() new spell_gen_obsidian_armor(); new spell_gen_oracle_wolvar_reputation(); new spell_gen_orc_disguise(); + new spell_gen_proc_below_pct_damaged("spell_item_soul_harvesters_charm"); + new spell_gen_proc_below_pct_damaged("spell_item_commendation_of_kaelthas"); + new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin"); + new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin_heroic"); + new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale"); + new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale_heroic"); new spell_gen_parachute(); new spell_gen_pet_summoned(); new spell_gen_profession_research(); @@ -4115,6 +4157,7 @@ void AddSC_generic_spell_scripts() new spell_pvp_trinket_wotf_shared_cd("spell_wotf_shared_cd"); new spell_gen_turkey_marker(); new spell_gen_upper_deck_create_foam_sword(); + new spell_gen_vampiric_touch(); new spell_gen_vehicle_scaling(); new spell_gen_vendor_bark_trigger(); new spell_gen_wg_water(); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 0341b43d14..41960203cc 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -115,6 +115,143 @@ class spell_item_aegis_of_preservation : public SpellScriptLoader } }; +enum AlchemistStone +{ + SPELL_ALCHEMISTS_STONE_EXTRA_HEAL = 21399, + SPELL_ALCHEMISTS_STONE_EXTRA_MANA = 21400 +}; + +// Item - 13503: Alchemist's Stone +// Item - 35748: Guardian's Alchemist Stone +// Item - 35749: Sorcerer's Alchemist Stone +// Item - 35750: Redeemer's Alchemist Stone +// Item - 35751: Assassin's Alchemist Stone +// Item - 44322: Mercurial Alchemist Stone +// Item - 44323: Indestructible Alchemist's Stone +// Item - 44324: Mighty Alchemist's Stone + +// 17619 - Alchemist's Stone +class spell_item_alchemists_stone : public SpellScriptLoader +{ + public: + spell_item_alchemists_stone() : SpellScriptLoader("spell_item_alchemists_stone") { } + + class spell_item_alchemists_stone_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_alchemists_stone_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_ALCHEMISTS_STONE_EXTRA_HEAL) || + !sSpellMgr->GetSpellInfo(SPELL_ALCHEMISTS_STONE_EXTRA_MANA)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + Unit* caster = eventInfo.GetActionTarget(); + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + uint32 spellId; + switch (spellInfo->Effects[i].Effect) + { + case SPELL_EFFECT_HEAL: + spellId = SPELL_ALCHEMISTS_STONE_EXTRA_HEAL; + break; + case SPELL_EFFECT_ENERGIZE: + spellId = SPELL_ALCHEMISTS_STONE_EXTRA_MANA; + break; + default: + continue; + } + + int32 amount = CalculatePct(spellInfo->Effects[i].CalcValue(caster), 40); + caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_alchemists_stone_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_alchemists_stone_AuraScript(); + } +}; + +enum AngerCapacitor +{ + SPELL_MOTE_OF_ANGER = 71432, + SPELL_MANIFEST_ANGER_MAIN_HAND = 71433, + SPELL_MANIFEST_ANGER_OFF_HAND = 71434 +}; + +// Item - 50351: Tiny Abomination in a Jar +// 71406 - Anger Capacitor + +// Item - 50706: Tiny Abomination in a Jar (Heroic) +// 71545 - Anger Capacitor +template +class spell_item_anger_capacitor : public SpellScriptLoader +{ + public: + spell_item_anger_capacitor(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template + class spell_item_anger_capacitor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_anger_capacitor_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MOTE_OF_ANGER) || + !sSpellMgr->GetSpellInfo(SPELL_MANIFEST_ANGER_MAIN_HAND) || + !sSpellMgr->GetSpellInfo(SPELL_MANIFEST_ANGER_OFF_HAND)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + caster->CastSpell((Unit*)nullptr, SPELL_MOTE_OF_ANGER, true); + Aura const* motes = caster->GetAura(SPELL_MOTE_OF_ANGER); + if (!motes || motes->GetStackAmount() < Stacks) + return; + + caster->RemoveAurasDueToSpell(SPELL_MOTE_OF_ANGER); + uint32 spellId = SPELL_MANIFEST_ANGER_MAIN_HAND; + if (Player* player = caster->ToPlayer()) + if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1)) + spellId = SPELL_MANIFEST_ANGER_OFF_HAND; + + caster->CastSpell(target, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_anger_capacitor_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_anger_capacitor_AuraScript(); + } +}; + // 26400 - Arcane Shroud class spell_item_arcane_shroud : public SpellScriptLoader { @@ -144,6 +281,138 @@ class spell_item_arcane_shroud : public SpellScriptLoader } }; +enum AuraOfMadness +{ + SPELL_SOCIOPATH = 39511, // Sociopath: +35 strength(Paladin, Rogue, Druid, Warrior) + SPELL_DELUSIONAL = 40997, // Delusional: +70 attack power(Rogue, Hunter, Paladin, Warrior, Druid) + SPELL_KLEPTOMANIA = 40998, // Kleptomania: +35 agility(Warrior, Rogue, Paladin, Hunter, Druid) + SPELL_MEGALOMANIA = 40999, // Megalomania: +41 damage / healing(Druid, Shaman, Priest, Warlock, Mage, Paladin) + SPELL_PARANOIA = 41002, // Paranoia: +35 spell / melee / ranged crit strike rating(All classes) + SPELL_MANIC = 41005, // Manic: +35 haste(spell, melee and ranged) (All classes) + SPELL_NARCISSISM = 41009, // Narcissism: +35 intellect(Druid, Shaman, Priest, Warlock, Mage, Paladin, Hunter) + SPELL_MARTYR_COMPLEX = 41011, // Martyr Complex: +35 stamina(All classes) + SPELL_DEMENTIA = 41404, // Dementia: Every 5 seconds either gives you +5/-5% damage/healing. (Druid, Shaman, Priest, Warlock, Mage, Paladin) + + SPELL_DEMENTIA_POS = 41406, + SPELL_DEMENTIA_NEG = 41409, + + SAY_MADNESS = 21954 +}; + +// Item - 31859: Darkmoon Card: Madness +// 39446 - Aura of Madness +class spell_item_aura_of_madness : public SpellScriptLoader +{ + public: + spell_item_aura_of_madness() : SpellScriptLoader("spell_item_aura_of_madness") { } + + class spell_item_aura_of_madness_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_aura_of_madness_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SOCIOPATH) || + !sSpellMgr->GetSpellInfo(SPELL_DELUSIONAL) || + !sSpellMgr->GetSpellInfo(SPELL_KLEPTOMANIA) || + !sSpellMgr->GetSpellInfo(SPELL_MEGALOMANIA) || + !sSpellMgr->GetSpellInfo(SPELL_PARANOIA) || + !sSpellMgr->GetSpellInfo(SPELL_MANIC) || + !sSpellMgr->GetSpellInfo(SPELL_NARCISSISM) || + !sSpellMgr->GetSpellInfo(SPELL_MARTYR_COMPLEX) || + !sSpellMgr->GetSpellInfo(SPELL_DEMENTIA) || + !sObjectMgr->GetBroadcastText(SAY_MADNESS)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + static std::vector const triggeredSpells[MAX_CLASSES] = + { + //CLASS_NONE + { }, + //CLASS_WARRIOR + { SPELL_SOCIOPATH, SPELL_DELUSIONAL, SPELL_KLEPTOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_MARTYR_COMPLEX }, + //CLASS_PALADIN + { SPELL_SOCIOPATH, SPELL_DELUSIONAL, SPELL_KLEPTOMANIA, SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_HUNTER + { SPELL_DELUSIONAL, SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_ROGUE + { SPELL_SOCIOPATH, SPELL_DELUSIONAL, SPELL_KLEPTOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_MARTYR_COMPLEX }, + //CLASS_PRIEST + { SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_DEATH_KNIGHT + { SPELL_SOCIOPATH, SPELL_DELUSIONAL, SPELL_KLEPTOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_MARTYR_COMPLEX }, + //CLASS_SHAMAN + { SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_MAGE + { SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_WARLOCK + { SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA }, + //CLASS_UNK + { }, + //CLASS_DRUID + { SPELL_SOCIOPATH, SPELL_DELUSIONAL, SPELL_KLEPTOMANIA, SPELL_MEGALOMANIA, SPELL_PARANOIA, SPELL_MANIC, SPELL_NARCISSISM, SPELL_MARTYR_COMPLEX, SPELL_DEMENTIA } + }; + + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]); + caster->CastSpell(caster, spellId, true); + + if (roll_chance_i(10)) + caster->Unit::Say(SAY_MADNESS); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_aura_of_madness_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_aura_of_madness_AuraScript(); + } +}; + +// 41404 - Dementia +class spell_item_dementia : public SpellScriptLoader +{ + public: + spell_item_dementia() : SpellScriptLoader("spell_item_dementia") { } + + class spell_item_dementia_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_dementia_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEMENTIA_POS) || + !sSpellMgr->GetSpellInfo(SPELL_DEMENTIA_NEG)) + return false; + return true; + } + + void HandlePeriodicDummy(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_dementia_AuraScript::HandlePeriodicDummy, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_dementia_AuraScript(); + } +}; + // 64411 - Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) enum BlessingOfAncientKings { @@ -175,7 +444,11 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader { PreventDefaultAction(); - int32 absorb = int32(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), 15.0f)); + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + int32 absorb = int32(CalculatePct(healInfo->GetHeal(), 15.0f)); if (AuraEffect* protEff = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PROTECTION_OF_ANCIENT_KINGS, 0, eventInfo.GetActor()->GetGUID())) { // The shield can grow to a maximum size of 20,000 damage absorbtion @@ -201,6 +474,168 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader } }; +enum DeadlyPrecision +{ + SPELL_DEADLY_PRECISION = 71564 +}; + +// 71564 - Deadly Precision +class spell_item_deadly_precision : public SpellScriptLoader +{ + public: + spell_item_deadly_precision() : SpellScriptLoader("spell_item_deadly_precision") { } + + class spell_item_deadly_precision_charm_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_deadly_precision_charm_AuraScript); + + void HandleStackDrop(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->RemoveAuraFromStack(GetId(), GetTarget()->GetGUID()); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_deadly_precision_charm_AuraScript::HandleStackDrop, EFFECT_0, SPELL_AURA_MOD_RATING); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_deadly_precision_charm_AuraScript(); + } +}; + +// 71563 - Deadly Precision Dummy +class spell_item_deadly_precision_dummy : public SpellScriptLoader +{ + public: + spell_item_deadly_precision_dummy() : SpellScriptLoader("spell_item_deadly_precision_dummy") { } + + class spell_item_deadly_precision_dummy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_deadly_precision_dummy_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEADLY_PRECISION)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DEADLY_PRECISION); + GetCaster()->CastCustomSpell(spellInfo->Id, SPELLVALUE_AURA_STACK, spellInfo->StackAmount, GetCaster(), true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_item_deadly_precision_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_item_deadly_precision_dummy_SpellScript(); + } +}; + +enum DeathbringersWill +{ + SPELL_STRENGTH_OF_THE_TAUNKA = 71484, // +600 Strength + SPELL_AGILITY_OF_THE_VRYKUL = 71485, // +600 Agility + SPELL_POWER_OF_THE_TAUNKA = 71486, // +1200 Attack Power + SPELL_AIM_OF_THE_IRON_DWARVES = 71491, // +600 Critical + SPELL_SPEED_OF_THE_VRYKUL = 71492, // +600 Haste + + SPELL_AGILITY_OF_THE_VRYKUL_HERO = 71556, // +700 Agility + SPELL_POWER_OF_THE_TAUNKA_HERO = 71558, // +1400 Attack Power + SPELL_AIM_OF_THE_IRON_DWARVES_HERO = 71559, // +700 Critical + SPELL_SPEED_OF_THE_VRYKUL_HERO = 71560, // +700 Haste + SPELL_STRENGTH_OF_THE_TAUNKA_HERO = 71561 // +700 Strength +}; + +// Item - 50362: Deathbringer's Will +// 71519 - Item - Icecrown 25 Normal Melee Trinket + +// Item - 50363: Deathbringer's Will +// 71562 - Item - Icecrown 25 Heroic Melee Trinket +template +class spell_item_deathbringers_will : public SpellScriptLoader +{ + public: + spell_item_deathbringers_will(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template + class spell_item_deathbringers_will_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_deathbringers_will_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(Strength) || + !sSpellMgr->GetSpellInfo(Agility) || + !sSpellMgr->GetSpellInfo(AttackPower) || + !sSpellMgr->GetSpellInfo(Critical) || + !sSpellMgr->GetSpellInfo(Haste)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + static std::vector const triggeredSpells[MAX_CLASSES] = + { + //CLASS_NONE + { }, + //CLASS_WARRIOR + { Strength, Critical, Haste }, + //CLASS_PALADIN + { Strength, Critical, Haste }, + //CLASS_HUNTER + { Agility, Critical, AttackPower }, + //CLASS_ROGUE + { Agility, Haste, AttackPower }, + //CLASS_PRIEST + { }, + //CLASS_DEATH_KNIGHT + { Strength, Critical, Haste }, + //CLASS_SHAMAN + { Agility, Haste, AttackPower }, + //CLASS_MAGE + { }, + //CLASS_WARLOCK + { }, + //CLASS_UNK + { }, + //CLASS_DRUID + { Strength, Agility, Haste } + }; + + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + auto const& randomSpells = triggeredSpells[caster->getClass()]; + if (randomSpells.empty()) + return; + + uint32 spellId = Trinity::Containers::SelectRandomContainerElement(randomSpells); + caster->CastSpell(caster, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_deathbringers_will_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_deathbringers_will_AuraScript(); + } +}; + // 47770 - Roll Dice class spell_item_decahedral_dwarven_dice : public SpellScriptLoader { @@ -400,6 +835,46 @@ class spell_item_deviate_fish : public SpellScriptLoader } }; +enum DiscerningEyeBeastMisc +{ + SPELL_DISCERNING_EYE_BEAST = 59914 +}; + +// 59915 - Discerning Eye of the Beast Dummy +class spell_item_discerning_eye_beast_dummy : public SpellScriptLoader +{ + public: + spell_item_discerning_eye_beast_dummy() : SpellScriptLoader("spell_item_discerning_eye_beast_dummy") { } + + class spell_item_discerning_eye_beast_dummy_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_discerning_eye_beast_dummy_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DISCERNING_EYE_BEAST)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DISCERNING_EYE_BEAST, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_discerning_eye_beast_dummy_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_discerning_eye_beast_dummy_AuraScript(); + } +}; + // 71610, 71641 - Echoes of Light (Althor's Abacus) class spell_item_echoes_of_light : public SpellScriptLoader { @@ -458,6 +933,7 @@ class spell_item_fate_rune_of_unsurpassed_vigor : public SpellScriptLoader void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) { + PreventDefaultAction(); GetTarget()->CastSpell(GetTarget(), SPELL_UNSURPASSED_VIGOR, true); } @@ -543,6 +1019,53 @@ class spell_item_flask_of_the_north : public SpellScriptLoader } }; +enum FrozenShadoweave +{ + SPELL_SHADOWMEND = 39373 +}; + +// 39372 - Frozen Shadoweave +// Frozen Shadoweave set 3p bonus +class spell_item_frozen_shadoweave : public SpellScriptLoader +{ + public: + spell_item_frozen_shadoweave() : SpellScriptLoader("spell_item_frozen_shadoweave") { } + + class spell_item_frozen_shadoweave_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_frozen_shadoweave_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMEND)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 amount = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + Unit* caster = eventInfo.GetActor(); + caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_frozen_shadoweave_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_frozen_shadoweave_AuraScript(); + } +}; + // http://www.wowhead.com/item=10645 Gnomish Death Ray // 13280 Gnomish Death Ray enum GnomishDeathRay @@ -591,6 +1114,158 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader } }; +// Item 23004 - Idol of Longevity +// 28847 - Healing Touch Refund +enum IdolOfLongevity +{ + SPELL_HEALING_TOUCH_MANA = 28848 +}; + +class spell_item_healing_touch_refund : public SpellScriptLoader +{ + public: + spell_item_healing_touch_refund() : SpellScriptLoader("spell_item_healing_touch_refund") { } + + class spell_item_healing_touch_refund_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_healing_touch_refund_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_HEALING_TOUCH_MANA)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_healing_touch_refund_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_healing_touch_refund_AuraScript(); + } +}; + +enum Heartpierce +{ + SPELL_INVIGORATION_MANA = 71881, + SPELL_INVIGORATION_ENERGY = 71882, + SPELL_INVIGORATION_RAGE = 71883, + SPELL_INVIGORATION_RP = 71884, + + SPELL_INVIGORATION_RP_HERO = 71885, + SPELL_INVIGORATION_RAGE_HERO = 71886, + SPELL_INVIGORATION_ENERGY_HERO = 71887, + SPELL_INVIGORATION_MANA_HERO = 71888 +}; + +// Item - 49982: Heartpierce +// 71880 - Item - Icecrown 25 Normal Dagger Proc + +// Item - 50641: Heartpierce (Heroic) +// 71892 - Item - Icecrown 25 Heroic Dagger Proc +template +class spell_item_heartpierce : public SpellScriptLoader +{ + public: + spell_item_heartpierce(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template + class spell_item_heartpierce_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_heartpierce_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(Energy) || + !sSpellMgr->GetSpellInfo(Mana) || + !sSpellMgr->GetSpellInfo(Rage) || + !sSpellMgr->GetSpellInfo(RunicPower)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + + uint32 spellId; + switch (caster->getPowerType()) + { + case POWER_MANA: + spellId = Mana; + break; + case POWER_ENERGY: + spellId = Energy; + break; + case POWER_RAGE: + spellId = Rage; + break; + case POWER_RUNIC_POWER: + spellId = RunicPower; + break; + default: + return; + } + + caster->CastSpell((Unit*)nullptr, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_heartpierce_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_heartpierce_AuraScript(); + } +}; + +// 40971 - Bonus Healing (Crystal Spire of Karabor) +class spell_item_crystal_spire_of_karabor : public SpellScriptLoader +{ + public: + spell_item_crystal_spire_of_karabor() : SpellScriptLoader("spell_item_crystal_spire_of_karabor") { } + + class spell_item_crystal_spire_of_karabor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_crystal_spire_of_karabor_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + int32 pct = GetSpellInfo()->Effects[EFFECT_0].BasePoints; + if (HealInfo* healInfo = eventInfo.GetHealInfo()) + if (Unit* healTarget = healInfo->GetTarget()) + if (healTarget->GetHealth() - healInfo->GetEffectiveHeal() <= healTarget->CountPctFromMaxHealth(pct)) + return true; + + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_crystal_spire_of_karabor_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_crystal_spire_of_karabor_AuraScript(); + } +}; + // http://www.wowhead.com/item=27388 Mr. Pinchy // 33060 Make a Wish enum MakeAWish @@ -649,6 +1324,53 @@ class spell_item_make_a_wish : public SpellScriptLoader } }; +enum MarkOfConquest +{ + SPELL_MARK_OF_CONQUEST_ENERGIZE = 39599 +}; + +// Item - 27920: Mark of Conquest +// Item - 27921: Mark of Conquest +// 33510 - Health Restore +class spell_item_mark_of_conquest : public SpellScriptLoader +{ + public: + spell_item_mark_of_conquest() : SpellScriptLoader("spell_item_mark_of_conquest") { } + + class spell_item_mark_of_conquest_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_mark_of_conquest_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_CONQUEST_ENERGIZE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + if (eventInfo.GetTypeMask() & (PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS)) + { + // in that case, do not cast heal spell + PreventDefaultAction(); + // but mana instead + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true); + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_mark_of_conquest_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_mark_of_conquest_AuraScript(); + } +}; + // http://www.wowhead.com/item=32686 Mingo's Fortune Giblets // 40802 Mingo's Fortune Generator class spell_item_mingos_fortune_generator : public SpellScriptLoader @@ -859,6 +1581,138 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader } }; +// 29601 - Enlightenment (Pendant of the Violet Eye) +class spell_item_pendant_of_the_violet_eye : public SpellScriptLoader +{ + public: + spell_item_pendant_of_the_violet_eye() : SpellScriptLoader("spell_item_pendant_of_the_violet_eye") { } + + class spell_item_pendant_of_the_violet_eye_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_pendant_of_the_violet_eye_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + return spellInfo->PowerType == POWER_MANA || (spellInfo->ManaCost != 0 && spellInfo->ManaCostPercentage != 0 && spellInfo->ManaCostPerlevel != 0); + + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_pendant_of_the_violet_eye_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_pendant_of_the_violet_eye_AuraScript(); + } +}; + +enum PersistentShieldMisc +{ + SPELL_PERSISTENT_SHIELD_TRIGGERED = 26470 +}; + +// 26467 - Persistent Shield +class spell_item_persistent_shield : public SpellScriptLoader +{ + public: + spell_item_persistent_shield() : SpellScriptLoader("spell_item_persistent_shield") { } + + class spell_item_persistent_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_persistent_shield_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTENT_SHIELD_TRIGGERED)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetHeal(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + int32 bp0 = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), 15); + + // Scarab Brooch does not replace stronger shields + if (AuraEffect const* shield = target->GetAuraEffect(SPELL_PERSISTENT_SHIELD_TRIGGERED, EFFECT_0, caster->GetGUID())) + if (shield->GetAmount() > bp0) + return; + + caster->CastCustomSpell(SPELL_PERSISTENT_SHIELD_TRIGGERED, SPELLVALUE_BASE_POINT0, bp0, target, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_persistent_shield_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_persistent_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_persistent_shield_AuraScript(); + } +}; + +enum PetHealing +{ + SPELL_HEALTH_LINK = 37382 +}; + +// 37381 - Pet Healing +// Hunter T5 2P Bonus +// Warlock T5 2P Bonus +class spell_item_pet_healing : public SpellScriptLoader +{ + public: + spell_item_pet_healing() : SpellScriptLoader("spell_item_pet_healing") { } + + class spell_item_pet_healing_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_pet_healing_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_HEALTH_LINK)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + Unit* caster = eventInfo.GetActor(); + caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_pet_healing_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_pet_healing_AuraScript(); + } +}; + // 17512 - Piccolo of the Flaming Fire class spell_item_piccolo_of_the_flaming_fire : public SpellScriptLoader { @@ -1288,6 +2142,91 @@ class spell_item_six_demon_bag : public SpellScriptLoader } }; +enum SwiftHandJusticeMisc +{ + SPELL_SWIFT_HAND_OF_JUSTICE_HEAL = 59913 +}; + +// 59906 - Swift Hand of Justice Dummy +class spell_item_swift_hand_justice_dummy : public SpellScriptLoader +{ + public: + spell_item_swift_hand_justice_dummy() : SpellScriptLoader("spell_item_swift_hand_justice_dummy") { } + + class spell_item_swift_hand_justice_dummy_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_swift_hand_justice_dummy_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount()); + caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_swift_hand_justice_dummy_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_swift_hand_justice_dummy_AuraScript(); + } +}; + +enum TotemOfFlowingWater +{ + SPELL_LESSER_HEALING_WAVE_MANA = 28850 +}; + +// Item - 23005: Totem of Flowing Water +// 28849 - Lesser Healing Wave +class spell_item_totem_of_flowing_water : public SpellScriptLoader +{ + public: + spell_item_totem_of_flowing_water() : SpellScriptLoader("spell_item_totem_of_flowing_water") { } + + class spell_item_totem_of_flowing_water_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_totem_of_flowing_water_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_LESSER_HEALING_WAVE_MANA)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_totem_of_flowing_water_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_totem_of_flowing_water_AuraScript(); + } + +}; + // 28862 - The Eye of Diminution class spell_item_the_eye_of_diminution : public SpellScriptLoader { @@ -2688,6 +3627,212 @@ public: } }; +enum ShardOfTheScale +{ + SPELL_PURIFIED_CAUTERIZING_HEAL = 69733, + SPELL_PURIFIED_SEARING_FLAMES = 69729, + + SPELL_SHINY_CAUTERIZING_HEAL = 69734, + SPELL_SHINY_SEARING_FLAMES = 69730 +}; + +// Item - 49310: Purified Shard of the Scale +// 69755 - Purified Shard of the Scale - Equip Effect + +// Item - 49488: Shiny Shard of the Scale +// 69739 - Shiny Shard of the Scale - Equip Effect +template +class spell_item_shard_of_the_scale : public SpellScriptLoader +{ + public: + spell_item_shard_of_the_scale(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template + class spell_item_shard_of_the_scale_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_shard_of_the_scale_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(HealProc) || + !sSpellMgr->GetSpellInfo(DamageProc)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS) + caster->CastSpell(target, HealProc, true); + + if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG) + caster->CastSpell(target, DamageProc, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_shard_of_the_scale_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_shard_of_the_scale_AuraScript(); + } +}; + +enum SoulPreserver +{ + SPELL_SOUL_PRESERVER_DRUID = 60512, + SPELL_SOUL_PRESERVER_PALADIN = 60513, + SPELL_SOUL_PRESERVER_PRIEST = 60514, + SPELL_SOUL_PRESERVER_SHAMAN = 60515, +}; + +class spell_item_soul_preserver : public SpellScriptLoader +{ +public: + spell_item_soul_preserver() : SpellScriptLoader("spell_item_soul_preserver") { } + + class spell_item_soul_preserver_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_soul_preserver_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_DRUID) || + !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PALADIN) || + !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PRIEST) || + !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_SHAMAN)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + + switch (caster->getClass()) + { + case CLASS_DRUID: + caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, true, nullptr, aurEff); + break; + case CLASS_PALADIN: + caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PALADIN, true, nullptr, aurEff); + break; + case CLASS_PRIEST: + caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PRIEST, true, nullptr, aurEff); + break; + case CLASS_SHAMAN: + caster->CastSpell(caster, SPELL_SOUL_PRESERVER_SHAMAN, true, nullptr, aurEff); + break; + default: + break; + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_soul_preserver_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_soul_preserver_AuraScript(); + } +}; + +enum ExaltedSunwellNeck +{ + SPELL_LIGHTS_WRATH = 45479, // Light's Wrath if Exalted by Aldor + SPELL_ARCANE_BOLT = 45429, // Arcane Bolt if Exalted by Scryers + + SPELL_LIGHTS_STRENGTH = 45480, // Light's Strength if Exalted by Aldor + SPELL_ARCANE_STRIKE = 45428, // Arcane Strike if Exalted by Scryers + + SPELL_LIGHTS_WARD = 45432, // Light's Ward if Exalted by Aldor + SPELL_ARCANE_INSIGHT = 45431, // Arcane Insight if Exalted by Scryers + + SPELL_LIGHTS_SALVATION = 45478, // Light's Salvation if Exalted by Aldor + SPELL_ARCANE_SURGE = 45430, // Arcane Surge if Exalted by Scryers + + FACTION_ALDOR = 932, + FACTION_SCRYERS = 934 +}; + +// Item - 34678: Shattered Sun Pendant of Acumen +// 45481 - Sunwell Exalted Caster Neck + +// Item - 34679: Shattered Sun Pendant of Might +// 45482 - Sunwell Exalted Melee Neck + +// Item - 34680: Shattered Sun Pendant of Resolve +// 45483 - Sunwell Exalted Tank Neck + +// Item - 34677: Shattered Sun Pendant of Restoration +// 45484 Sunwell Exalted Healer Neck +template +class spell_item_sunwell_neck : public SpellScriptLoader +{ + public: + spell_item_sunwell_neck(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template + class spell_item_sunwell_neck_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_sunwell_neck_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sFactionStore.LookupEntry(FACTION_ALDOR) || + !sFactionStore.LookupEntry(FACTION_SCRYERS) || + !sSpellMgr->GetSpellInfo(Aldors) || + !sSpellMgr->GetSpellInfo(Scryers)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActor()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Player* player = eventInfo.GetActor()->ToPlayer(); + Unit* target = eventInfo.GetProcTarget(); + + // Aggression checks are in the spell system... just cast and forget + if (player->GetReputationRank(FACTION_ALDOR) == REP_EXALTED) + player->CastSpell(target, Aldors, true); + + if (player->GetReputationRank(FACTION_SCRYERS) == REP_EXALTED) + player->CastSpell(target, Scryers, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_sunwell_neck_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_sunwell_neck_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_sunwell_neck_AuraScript(); + } +}; + class spell_item_toy_train_set_pulse : public SpellScriptLoader { public: @@ -2903,6 +4048,69 @@ class spell_item_universal_remote : public SpellScriptLoader } }; +enum ZandalarianCharms +{ + SPELL_UNSTABLE_POWER_AURA_STACK = 24659, + SPELL_RESTLESS_STRENGTH_AURA_STACK = 24662 +}; + +// Item - 19950: Zandalarian Hero Charm +// 24658 - Unstable Power + +// Item - 19949: Zandalarian Hero Medallion +// 24661 - Restless Strength +class spell_item_zandalarian_charm : public SpellScriptLoader +{ + public: + spell_item_zandalarian_charm(char const* ScriptName, uint32 SpellId) : SpellScriptLoader(ScriptName), _spellId(SpellId) { } + + class spell_item_zandalarian_charm_AuraScript : public AuraScript + { + friend class spell_item_zandalarian_charm; + spell_item_zandalarian_charm_AuraScript(uint32 SpellId) : AuraScript(), _spellId(SpellId) { } + + PrepareAuraScript(spell_item_zandalarian_charm_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(_spellId)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo->Id != m_scriptSpellId) + return true; + + return false; + } + + void HandleStackDrop(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->RemoveAuraFromStack(_spellId); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_zandalarian_charm_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_zandalarian_charm_AuraScript::HandleStackDrop, EFFECT_0, SPELL_AURA_DUMMY); + } + + uint32 _spellId; + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_zandalarian_charm_AuraScript(_spellId); + } + + private: + uint32 _spellId; +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -2916,22 +4124,41 @@ void AddSC_item_spell_scripts() new spell_item_aegis_of_preservation(); new spell_item_arcane_shroud(); + new spell_item_alchemists_stone(); + new spell_item_anger_capacitor<8>("spell_item_tiny_abomination_in_a_jar"); + new spell_item_anger_capacitor<7>("spell_item_tiny_abomination_in_a_jar_hero"); + new spell_item_aura_of_madness(); + new spell_item_dementia(); new spell_item_blessing_of_ancient_kings(); + new spell_item_deadly_precision(); + new spell_item_deadly_precision_dummy(); + new spell_item_deathbringers_will("spell_item_deathbringers_will_normal"); + new spell_item_deathbringers_will("spell_item_deathbringers_will_heroic"); new spell_item_decahedral_dwarven_dice(); new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); new spell_item_desperate_defense(); new spell_item_deviate_fish(); + new spell_item_discerning_eye_beast_dummy(); new spell_item_echoes_of_light(); new spell_item_fate_rune_of_unsurpassed_vigor(); new spell_item_flask_of_the_north(); + new spell_item_frozen_shadoweave(); new spell_item_gnomish_death_ray(); + new spell_item_healing_touch_refund(); + new spell_item_heartpierce("spell_item_heartpierce"); + new spell_item_heartpierce("spell_item_heartpierce_hero"); + new spell_item_crystal_spire_of_karabor(); new spell_item_make_a_wish(); + new spell_item_mark_of_conquest(); new spell_item_mingos_fortune_generator(); new spell_item_necrotic_touch(); new spell_item_net_o_matic(); new spell_item_noggenfogger_elixir(); + new spell_item_pendant_of_the_violet_eye(); + new spell_item_persistent_shield(); + new spell_item_pet_healing(); new spell_item_piccolo_of_the_flaming_fire(); new spell_item_savory_deviate_delight(); new spell_item_scroll_of_recall(); @@ -2940,6 +4167,8 @@ void AddSC_item_spell_scripts() new spell_item_shadowmourne(); new spell_item_shadowmourne_soul_fragment(); new spell_item_six_demon_bag(); + new spell_item_swift_hand_justice_dummy(); + new spell_item_totem_of_flowing_water(); new spell_item_the_eye_of_diminution(); new spell_item_underbelly_elixir(); new spell_item_worn_troll_dice(); @@ -2972,9 +4201,18 @@ void AddSC_item_spell_scripts() new spell_item_chicken_cover(); new spell_item_muisek_vessel(); new spell_item_greatmothers_soulcatcher(); + new spell_item_shard_of_the_scale("spell_item_purified_shard_of_the_scale"); + new spell_item_shard_of_the_scale("spell_item_shiny_shard_of_the_scale"); + new spell_item_soul_preserver(); + new spell_item_sunwell_neck("spell_item_sunwell_exalted_caster_neck"); + new spell_item_sunwell_neck("spell_item_sunwell_exalted_melee_neck"); + new spell_item_sunwell_neck("spell_item_sunwell_exalted_tank_neck"); + new spell_item_sunwell_neck("spell_item_sunwell_exalted_healer_neck"); new spell_item_toy_train_set_pulse(); new spell_item_taunt_flag_targeting(); new spell_item_mind_control_cap(); new spell_item_universal_remote(); + new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK); + new spell_item_zandalarian_charm("spell_item_restless_strength", SPELL_RESTLESS_STRENGTH_AURA_STACK); } From baf1f027c140f2fbafe3094408ac2f69a066f0e5 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 4 Oct 2016 21:08:03 -0300 Subject: [PATCH 005/110] Core/Scripts: add headers required for NoPCH build --- .../Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp | 1 + src/server/scripts/Pet/pet_hunter.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp index 0aba111b6a..1f7abd5747 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "ScriptMgr.h" #include "SpellScript.h" enum Spells diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 872348a764..ed211800cd 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -22,6 +22,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" enum HunterSpells { From 627a285a716ce78fea93c9cf542df1e3a853cbdd Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 4 Oct 2016 21:10:57 -0300 Subject: [PATCH 006/110] Core/Scripts: add more headers required for NoPCH --- .../Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp | 1 + src/server/scripts/Pet/pet_hunter.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp index 1f7abd5747..b0536705bb 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -16,6 +16,7 @@ */ #include "ScriptMgr.h" +#include "SpellMgr.h" #include "SpellScript.h" enum Spells diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index ed211800cd..1dd6983ade 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -23,6 +23,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" enum HunterSpells { From 91c4b5edb074607746812473604fd178f0ce0788 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 4 Oct 2016 21:13:27 -0300 Subject: [PATCH 007/110] Core/Scripts: add even more headers --- .../Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp index b0536705bb..1b0d5c2283 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "SpellMgr.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" enum Spells { From 805c10a3653a23bd058c46eca2b16ed0058b4115 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 4 Oct 2016 21:43:45 -0300 Subject: [PATCH 008/110] Core/Spells: add proc cooldown on item equip. --- src/server/game/Entities/Player/Player.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 016a9ca2e8..f9e0e58b24 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23317,6 +23317,7 @@ void Player::ApplyEquipCooldown(Item* pItem) if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_EQUIP_COOLDOWN) return; + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { _Spell const& spellData = pItem->GetTemplate()->Spells[i]; @@ -23325,6 +23326,18 @@ void Player::ApplyEquipCooldown(Item* pItem) if (spellData.SpellId <= 0) continue; + // apply proc cooldown to equip auras if we have any + if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_EQUIP) + { + SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(spellData.SpellId); + if (!procEntry) + continue; + + if (Aura* itemAura = GetAura(spellData.SpellId, GetGUID(), pItem->GetGUID())) + itemAura->AddProcCooldown(now + procEntry->Cooldown); + continue; + } + // wrong triggering type (note: ITEM_SPELLTRIGGER_ON_NO_DELAY_USE not have cooldown) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; From 8f4fd78cbfc50f8937138cb5efdbf81382fd79c2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 5 Oct 2016 01:40:00 -0300 Subject: [PATCH 009/110] Core/Scripts: add a workaround for Will of the Forsaken shared cooldown Closes #7151 --- sql/updates/world/3.3.5/2016_10_05_03_world.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/3.3.5/2016_10_05_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_03_world.sql b/sql/updates/world/3.3.5/2016_10_05_03_world.sql new file mode 100644 index 0000000000..41f582280f --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_05_03_world.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (7744, 42292, 59752); +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_pvp_trinket_wotf_shared_cd','spell_wotf_shared_cd','spell_pvp_trinket_shared_cd'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(7744, 'spell_wotf_shared_cd'), +(42292, 'spell_pvp_trinket_shared_cd'), +(59752, 'spell_pvp_trinket_shared_cd'); From a7a024d1d6eee1c6752c57455b4d818735ea64cb Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 5 Oct 2016 03:10:05 -0300 Subject: [PATCH 010/110] Core/Auras: reset periodic aura timers by default. Except when aura comes from triggered spell --- src/server/game/Entities/Unit/Unit.cpp | 10 +-- src/server/game/Entities/Unit/Unit.h | 6 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 9 ++- .../game/Spells/Auras/SpellAuraEffects.h | 4 +- src/server/game/Spells/Auras/SpellAuras.cpp | 63 +++++++++++-------- src/server/game/Spells/Auras/SpellAuras.h | 12 ++-- src/server/game/Spells/Spell.cpp | 3 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 6 +- src/server/scripts/Spells/spell_priest.cpp | 2 + src/server/scripts/Spells/spell_warlock.cpp | 2 + 10 files changed, 62 insertions(+), 55 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0155871786..a8287893f5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3161,7 +3161,7 @@ void Unit::DeMorph() SetDisplayId(GetNativeDisplayId()); } -Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, ObjectGuid casterGUID /*= 0*/) +Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool resetPeriodicTimer /*= true*/) { ASSERT(casterGUID || caster); @@ -3184,7 +3184,7 @@ Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 // extremely rare case // let's just recreate aura if (effMask != foundAura->GetEffectMask()) - return NULL; + return nullptr; // update basepoints with new values - effect amount will be recalculated in ModStackAmount for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -3210,12 +3210,12 @@ Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 } // try to increase stack amount - foundAura->ModStackAmount(1); + foundAura->ModStackAmount(1, AURA_REMOVE_BY_DEFAULT, resetPeriodicTimer); return foundAura; } } - return NULL; + return nullptr; } void Unit::_AddAura(UnitAura* aura, Unit* caster) @@ -3823,7 +3823,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, U if (aura->IsSingleTarget()) aura->UnregisterSingleTarget(); - if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID())) + if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, nullptr, &baseDamage[0], nullptr, aura->GetCasterGUID())) { // created aura must not be single target aura,, so stealer won't loose it on recast if (newAura->IsSingleTarget()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7d741c43ba..d6ca5a0dc7 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -452,7 +452,7 @@ enum TriggerCastFlags TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements - // reuse 0x00020000 + TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting) TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks) @@ -1734,16 +1734,14 @@ class TC_GAME_API Unit : public WorldObject bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id); // aura apply/remove helpers - you should better not use these - Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty); + Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool resetPeriodicTimer = true); void _AddAura(UnitAura* aura, Unit* caster); AuraApplication * _CreateAuraApplication(Aura* aura, uint8 effMask); void _ApplyAuraEffect(Aura* aura, uint8 effIndex); void _ApplyAura(AuraApplication * aurApp, uint8 effMask); void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode); void _UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode); - void _RemoveNoStackAuraApplicationsDueToAura(Aura* aura); void _RemoveNoStackAurasDueToAura(Aura* aura); - bool _IsNoStackAuraDueToAura(Aura* appliedAura, Aura* existingAura) const; void _RegisterAuraEffect(AuraEffect* aurEff, bool apply); // m_ownedAuras container management diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 44f1bbd93d..d6c74255ac 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -629,8 +629,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru if (!m_isPeriodic) return; - Player* modOwner = caster ? caster->GetSpellModOwner() : NULL; - + Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr; // Apply casting time mods if (m_amplitude) { @@ -658,9 +657,9 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru else // aura just created or reapplied { m_tickNumber = 0; - // reset periodic timer on aura create or on reapply when aura isn't dot - // possibly we should not reset periodic timers only when aura is triggered by proc - // or maybe there's a spell attribute somewhere + + // reset periodic timer on aura create or reapply + // we don't reset periodic timers when aura is triggered by proc if (resetPeriodicTimer) { m_periodicTimer = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 4d4e121307..7cba9937f4 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -29,8 +29,8 @@ typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uin class TC_GAME_API AuraEffect { - friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount); - friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, ObjectGuid casterGUID); + friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32* baseAmount); + friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, ObjectGuid casterGUID, bool resetPeriodicTimer); friend Aura::~Aura(); private: ~AuraEffect(); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 97ab83a410..b937a5faea 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -230,7 +230,7 @@ void AuraApplication::ClientUpdate(bool remove) _target->SendMessageToSet(&data, true); } -uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner) +uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 availableEffectMask, WorldObject* owner) { ASSERT(spellProto); ASSERT(owner); @@ -239,26 +239,28 @@ uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleE { case TYPEID_UNIT: case TYPEID_PLAYER: - for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (spellProto->Effects[i].IsUnitOwnedAuraEffect()) effMask |= 1 << i; } break; case TYPEID_DYNAMICOBJECT: - for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (spellProto->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA) effMask |= 1 << i; } break; default: + ABORT(); break; } - return effMask & avalibleEffectMask; + + return effMask & availableEffectMask; } -Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool* refresh /*= NULL*/) +Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool* refresh /*= nullptr*/, bool resetPeriodicTimer /*= true*/) { ASSERT(spellproto); ASSERT(owner); @@ -266,25 +268,28 @@ Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMas ASSERT(tryEffMask <= MAX_EFFECT_MASK); if (refresh) *refresh = false; + uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner); if (!effMask) - return NULL; - if (Aura* foundAura = owner->ToUnit()->_TryStackingOrRefreshingExistingAura(spellproto, effMask, caster, baseAmount, castItem, casterGUID)) + return nullptr; + + if (Aura* foundAura = owner->ToUnit()->_TryStackingOrRefreshingExistingAura(spellproto, effMask, caster, baseAmount, castItem, casterGUID, resetPeriodicTimer)) { // we've here aura, which script triggered removal after modding stack amount // check the state here, so we won't create new Aura object if (foundAura->IsRemoved()) - return NULL; + return nullptr; if (refresh) *refresh = true; + return foundAura; } else return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID); } -Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/) +Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/) { ASSERT(spellproto); ASSERT(owner); @@ -292,7 +297,8 @@ Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject ASSERT(tryEffMask <= MAX_EFFECT_MASK); uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner); if (!effMask) - return NULL; + return nullptr; + return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID); } @@ -319,9 +325,9 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld()) // owner not in world so don't allow to own not self cast single target auras if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget()) - return NULL; + return nullptr; - Aura* aura = NULL; + Aura* aura = nullptr; switch (owner->GetTypeId()) { case TYPEID_UNIT: @@ -333,11 +339,12 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne break; default: ABORT(); - return NULL; + return nullptr; } + // aura can be removed in Unit::_AddAura call if (aura->IsRemoved()) - return NULL; + return nullptr; return aura; } @@ -774,10 +781,9 @@ void Aura::RefreshDuration(bool withMods) m_timeCla = 1 * IN_MILLISECONDS; } -void Aura::RefreshTimers() +void Aura::RefreshTimers(bool resetPeriodicTimer) { m_maxDuration = CalcMaxDuration(); - bool resetPeriodic = true; if (m_spellInfo->HasAttribute(SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER)) { int32 minAmplitude = m_maxDuration; @@ -790,15 +796,16 @@ void Aura::RefreshTimers() if (GetDuration() <= minAmplitude) { m_maxDuration += GetDuration(); - resetPeriodic = false; + resetPeriodicTimer = false; } } RefreshDuration(); + Unit* caster = GetCaster(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (HasEffect(i)) - GetEffect(i)->CalculatePeriodic(caster, resetPeriodic, false); + if (AuraEffect* aurEff = m_effects[i]) + aurEff->CalculatePeriodic(caster, resetPeriodicTimer, false); } void Aura::SetCharges(uint8 charges) @@ -895,7 +902,7 @@ void Aura::SetStackAmount(uint8 stackAmount) SetNeedClientUpdateForTargets(); } -bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode) +bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode /*= AURA_REMOVE_BY_DEFAULT*/, bool resetPeriodicTimer /*= true*/) { int32 stackAmount = m_stackAmount + num; @@ -923,7 +930,7 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode) if (refresh) { RefreshSpellMods(); - RefreshTimers(); + RefreshTimers(resetPeriodicTimer); // reset charges SetCharges(CalcMaxCharges()); @@ -1085,14 +1092,16 @@ void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint m_stackAmount = stackamount; Unit* caster = GetCaster(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (m_effects[i]) + { + if (AuraEffect* aurEff = m_effects[i]) { - m_effects[i]->SetAmount(amount[i]); - m_effects[i]->SetCanBeRecalculated((recalculateMask & (1 << i)) != 0); - m_effects[i]->CalculatePeriodic(caster, false, true); - m_effects[i]->CalculateSpellMod(); - m_effects[i]->RecalculateAmount(caster); + aurEff->SetAmount(amount[i]); + aurEff->SetCanBeRecalculated((recalculateMask & (1 << i)) != 0); + aurEff->CalculatePeriodic(caster, false, true); + aurEff->CalculateSpellMod(); + aurEff->RecalculateAmount(caster); } + } } bool Aura::HasEffectType(AuraType type) const diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 4ebe087d84..5bb7dfc7c1 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -84,13 +84,13 @@ class TC_GAME_API AuraApplication class TC_GAME_API Aura { - friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID); + friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, bool resetPeriodicTimer); public: typedef std::map ApplicationMap; - static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner); - static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty, bool* refresh = NULL); - static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty); + static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 availableEffectMask, WorldObject* owner); + static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool* refresh = nullptr, bool resetPeriodicTimer = true); + static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty); static Aura* Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, ObjectGuid casterGUID); explicit Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, ObjectGuid casterGUID); void _InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount); @@ -131,7 +131,7 @@ class TC_GAME_API Aura int32 GetDuration() const { return m_duration; } void SetDuration(int32 duration, bool withMods = false); void RefreshDuration(bool withMods = false); - void RefreshTimers(); + void RefreshTimers(bool resetPeriodicTimer); bool IsExpired() const { return !GetDuration() && !m_dropEvent; } bool IsPermanent() const { return GetMaxDuration() == -1; } @@ -146,7 +146,7 @@ class TC_GAME_API Aura uint8 GetStackAmount() const { return m_stackAmount; } void SetStackAmount(uint8 num); - bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); + bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer = true); void RefreshSpellMods(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 322fcce3ba..d30dd29a27 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2653,8 +2653,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_originalCaster) { bool refresh = false; + bool const resetPeriodicTimer = !(_triggeredCastFlags & TRIGGERED_DONT_RESET_PERIODIC_TIMER); m_spellAura = Aura::TryRefreshStackOrCreate(aurSpellInfo, effectMask, unit, - m_originalCaster, (aurSpellInfo == m_spellInfo) ? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem, ObjectGuid::Empty, &refresh); + m_originalCaster, (aurSpellInfo == m_spellInfo) ? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem, ObjectGuid::Empty, &refresh, resetPeriodicTimer); if (m_spellAura) { // Set aura stack amount to desired value diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 6259376925..f3764c6843 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -231,11 +231,7 @@ class boss_kelidan_the_breaker : public CreatureScript Talk(SAY_NOVA); - if (SpellInfo const* nova = sSpellMgr->GetSpellInfo(SPELL_BURNING_NOVA)) - { - if (Aura* aura = Aura::TryRefreshStackOrCreate(nova, MAX_EFFECT_MASK, me, me)) - aura->ApplyForTargets(); - } + me->AddAura(SPELL_BURNING_NOVA, me); if (IsHeroic()) DoTeleportAll(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index f17cbbcded..9d9955591e 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -748,12 +748,14 @@ class spell_pri_pain_and_suffering_proc : public SpellScriptLoader Unit* caster = GetCaster(); // Refresh Shadow Word: Pain on target if (Unit* target = GetHitUnit()) + { if (AuraEffect* aur = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, caster->GetGUID())) { aur->SetBonusAmount(caster->SpellDamageBonusDone(target, aur->GetSpellInfo(), 0, DOT)); aur->CalculatePeriodic(caster, false, false); aur->GetBase()->RefreshDuration(); } + } } void Register() override diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 53675688b4..6de09b0a63 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -544,6 +544,7 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) + { // Refresh corruption on target if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, caster->GetGUID())) { @@ -551,6 +552,7 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader aurEff->CalculatePeriodic(caster, false, false); aurEff->GetBase()->RefreshDuration(true); } + } } void Register() override From c6aa63536ece68d8a23fc8306f6031b1798966af Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 5 Oct 2016 13:07:44 -0300 Subject: [PATCH 011/110] Core/Unit: fix weapon skill up. Closes #18044 --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a8287893f5..5c3b18211f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1966,7 +1966,8 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr DealDamageMods(victim, damageInfo.damage, &damageInfo.absorb); SendAttackStateUpdate(&damageInfo); - TriggerAurasProcOnEvent(damageInfo); + DamageInfo dmgInfo(damageInfo); + ProcSkillsAndAuras(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, PROC_SPELL_TYPE_NONE, PROC_SPELL_PHASE_NONE, dmgInfo.GetHitMask(), nullptr, &dmgInfo, nullptr); DealMeleeDamage(&damageInfo, true); From 0b2e5adeb1f284b3369686d4e18171be7d74e248 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 00:12:11 +0100 Subject: [PATCH 012/110] Core/Globals: cache SpellSpecific and AuraState information instead of computing them each time they're needed --- src/server/game/Spells/SpellInfo.cpp | 3 +++ src/server/game/Spells/SpellInfo.h | 6 ++++++ src/server/game/Spells/SpellMgr.cpp | 17 +++++++++++++++++ src/server/game/Spells/SpellMgr.h | 1 + src/server/game/World/World.cpp | 3 +++ 5 files changed, 30 insertions(+) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a8f2b56936..4313a655eb 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1028,6 +1028,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe ChainEntry = NULL; ExplicitTargetMask = 0; + + _spellSpecific = SPELL_SPECIFIC_NORMAL; + _auraState = AURA_STATE_NONE; } SpellInfo::~SpellInfo() diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9f8859fa97..270d1c2f45 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -560,11 +560,17 @@ public: bool _IsPositiveEffect(uint8 effIndex, bool deep) const; bool _IsPositiveSpell() const; static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); + void _LoadSpellSpecific(); + void _LoadAuraState(); void _LoadImmunityInfo(); // unloading helpers void _UnloadImplicitTargetConditionLists(); +private: + SpellSpecificType _spellSpecific; + AuraStateType _auraState; + ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS]; }; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7b7f41466c..e5e68e51bc 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3821,6 +3821,23 @@ void SpellMgr::LoadSpellInfoCorrections() TC_LOG_INFO("server.loading", ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } +void SpellMgr::LoadSpellInfoSpellSpecificAndAuraState() +{ + uint32 oldMSTime = getMSTime(); + + for (SpellInfo* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + // AuraState depends on SpellSpecific + spellInfo->_LoadSpellSpecific(); + spellInfo->_LoadAuraState(); + } + + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo SpellSpecific and AuraState in %u ms", GetMSTimeDiffToNow(oldMSTime)); +} + void SpellMgr::LoadSpellInfoImmunities() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index f00300628c..9945b1da2f 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -684,6 +684,7 @@ class TC_GAME_API SpellMgr void UnloadSpellInfoImplicitTargetConditionLists(); void LoadSpellInfoCustomAttributes(); void LoadSpellInfoCorrections(); + void LoadSpellInfoSpellSpecificAndAuraState(); void LoadSpellInfoImmunities(); private: diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cf5a07bf95..e7c2c20cee 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1506,6 +1506,9 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes..."); sSpellMgr->LoadSpellInfoCustomAttributes(); + TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState..."); + sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); + TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos..."); sSpellMgr->LoadSpellInfoImmunities(); From da9de6de36913dc2cdd7e04017a7ad62cc11db97 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 00:13:26 +0100 Subject: [PATCH 013/110] Add missing change --- src/server/game/Spells/SpellInfo.cpp | 446 ++++++++++++++------------- 1 file changed, 231 insertions(+), 215 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 4313a655eb..46f4157adf 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2072,242 +2072,258 @@ uint32 SpellInfo::GetExplicitTargetMask() const AuraStateType SpellInfo::GetAuraState() const { - // Seals - if (GetSpellSpecific() == SPELL_SPECIFIC_SEAL) - return AURA_STATE_JUDGEMENT; + return _auraState; +} - // Conflagrate aura state on Immolate and Shadowflame - if (SpellFamilyName == SPELLFAMILY_WARLOCK && - // Immolate - ((SpellFamilyFlags[0] & 4) || - // Shadowflame - (SpellFamilyFlags[2] & 2))) - return AURA_STATE_CONFLAGRATE; - - // Faerie Fire (druid versions) - if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x400) - return AURA_STATE_FAERIE_FIRE; - - // Sting (hunter's pet ability) - if (GetCategory() == 1133) - return AURA_STATE_FAERIE_FIRE; - - // Victorious - if (SpellFamilyName == SPELLFAMILY_WARRIOR && SpellFamilyFlags[1] & 0x00040000) - return AURA_STATE_WARRIOR_VICTORY_RUSH; - - // Swiftmend state on Regrowth & Rejuvenation - if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x50) - return AURA_STATE_SWIFTMEND; - - // Deadly poison aura state - if (SpellFamilyName == SPELLFAMILY_ROGUE && SpellFamilyFlags[0] & 0x10000) - return AURA_STATE_DEADLY_POISON; - - // Enrage aura state - if (Dispel == DISPEL_ENRAGE) - return AURA_STATE_ENRAGE; - - // Bleeding aura state - if (GetAllEffectsMechanicMask() & 1< AuraStateType { - case 71465: // Divine Surge - case 50241: // Evasive Charges - return AURA_STATE_UNKNOWN22; - default: - break; - } + // Seals + if (GetSpellSpecific() == SPELL_SPECIFIC_SEAL) + return AURA_STATE_JUDGEMENT; - return AURA_STATE_NONE; + // Conflagrate aura state on Immolate and Shadowflame + if (SpellFamilyName == SPELLFAMILY_WARLOCK && + // Immolate + ((SpellFamilyFlags[0] & 4) || + // Shadowflame + (SpellFamilyFlags[2] & 2))) + return AURA_STATE_CONFLAGRATE; + + // Faerie Fire (druid versions) + if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x400) + return AURA_STATE_FAERIE_FIRE; + + // Sting (hunter's pet ability) + if (GetCategory() == 1133) + return AURA_STATE_FAERIE_FIRE; + + // Victorious + if (SpellFamilyName == SPELLFAMILY_WARRIOR && SpellFamilyFlags[1] & 0x00040000) + return AURA_STATE_WARRIOR_VICTORY_RUSH; + + // Swiftmend state on Regrowth & Rejuvenation + if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x50) + return AURA_STATE_SWIFTMEND; + + // Deadly poison aura state + if (SpellFamilyName == SPELLFAMILY_ROGUE && SpellFamilyFlags[0] & 0x10000) + return AURA_STATE_DEADLY_POISON; + + // Enrage aura state + if (Dispel == DISPEL_ENRAGE) + return AURA_STATE_ENRAGE; + + // Bleeding aura state + if (GetAllEffectsMechanicMask() & 1 << MECHANIC_BLEED) + return AURA_STATE_BLEEDING; + + if (GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (Effects[i].IsAura() && (Effects[i].ApplyAuraName == SPELL_AURA_MOD_STUN + || Effects[i].ApplyAuraName == SPELL_AURA_MOD_ROOT)) + return AURA_STATE_FROZEN; + + switch (Id) + { + case 71465: // Divine Surge + case 50241: // Evasive Charges + return AURA_STATE_UNKNOWN22; + default: + break; + } + + return AURA_STATE_NONE; + }(); } SpellSpecificType SpellInfo::GetSpellSpecific() const { - switch (SpellFamilyName) + return _spellSpecific; +} + +void SpellInfo::_LoadSpellSpecific() +{ + _spellSpecific = [this]()->SpellSpecificType { - case SPELLFAMILY_GENERIC: + switch (SpellFamilyName) { - // Food / Drinks (mostly) - if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) + case SPELLFAMILY_GENERIC: { - bool food = false; - bool drink = false; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + // Food / Drinks (mostly) + if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) { - if (!Effects[i].IsAura()) - continue; - switch (Effects[i].ApplyAuraName) + bool food = false; + bool drink = false; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - // Food - case SPELL_AURA_MOD_REGEN: - case SPELL_AURA_OBS_MOD_HEALTH: - food = true; - break; - // Drink - case SPELL_AURA_MOD_POWER_REGEN: - case SPELL_AURA_OBS_MOD_POWER: - drink = true; - break; - default: - break; + if (!Effects[i].IsAura()) + continue; + switch (Effects[i].ApplyAuraName) + { + // Food + case SPELL_AURA_MOD_REGEN: + case SPELL_AURA_OBS_MOD_HEALTH: + food = true; + break; + // Drink + case SPELL_AURA_MOD_POWER_REGEN: + case SPELL_AURA_OBS_MOD_POWER: + drink = true; + break; + default: + break; + } + } + + if (food && drink) + return SPELL_SPECIFIC_FOOD_AND_DRINK; + else if (food) + return SPELL_SPECIFIC_FOOD; + else if (drink) + return SPELL_SPECIFIC_DRINK; + } + // scrolls effects + else + { + SpellInfo const* firstRankSpellInfo = GetFirstRankSpell(); + switch (firstRankSpellInfo->Id) + { + case 8118: // Strength + case 8099: // Stamina + case 8112: // Spirit + case 8096: // Intellect + case 8115: // Agility + case 8091: // Armor + return SPELL_SPECIFIC_SCROLL; + case 12880: // Enrage (Enrage) + case 57518: // Enrage (Wrecking Crew) + return SPELL_SPECIFIC_WARRIOR_ENRAGE; } } - - if (food && drink) - return SPELL_SPECIFIC_FOOD_AND_DRINK; - else if (food) - return SPELL_SPECIFIC_FOOD; - else if (drink) - return SPELL_SPECIFIC_DRINK; + break; } - // scrolls effects - else + case SPELLFAMILY_MAGE: { - SpellInfo const* firstRankSpellInfo = GetFirstRankSpell(); - switch (firstRankSpellInfo->Id) + // family flags 18(Molten), 25(Frost/Ice), 28(Mage) + if (SpellFamilyFlags[0] & 0x12040000) + return SPELL_SPECIFIC_MAGE_ARMOR; + + // Arcane brillance and Arcane intelect (normal check fails because of flags difference) + if (SpellFamilyFlags[0] & 0x400) + return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE; + + if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE) + return SPELL_SPECIFIC_MAGE_POLYMORPH; + + break; + } + case SPELLFAMILY_WARRIOR: + { + if (Id == 12292) // Death Wish + return SPELL_SPECIFIC_WARRIOR_ENRAGE; + + break; + } + case SPELLFAMILY_WARLOCK: + { + // Warlock (Bane of Doom | Bane of Agony | Bane of Havoc) + if (Id == 603 || Id == 980 || Id == 80240) + return SPELL_SPECIFIC_BANE; + + // only warlock curses have this + if (Dispel == DISPEL_CURSE) + return SPELL_SPECIFIC_CURSE; + + // Warlock (Demon Armor | Demon Skin | Fel Armor) + if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) + return SPELL_SPECIFIC_WARLOCK_ARMOR; + + //seed of corruption and corruption + if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2) + return SPELL_SPECIFIC_WARLOCK_CORRUPTION; + break; + } + case SPELLFAMILY_PRIEST: + { + // Divine Spirit and Prayer of Spirit + if (SpellFamilyFlags[0] & 0x20) + return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT; + + break; + } + case SPELLFAMILY_HUNTER: + { + // only hunter stings have this + if (Dispel == DISPEL_POISON) + return SPELL_SPECIFIC_STING; + + // only hunter aspects have this (but not all aspects in hunter family) + if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) + return SPELL_SPECIFIC_ASPECT; + + break; + } + case SPELLFAMILY_PALADIN: + { + // Collection of all the seal family flags. No other paladin spell has any of those. + if (SpellFamilyFlags[1] & 0xA2000800) + return SPELL_SPECIFIC_SEAL; + + if (SpellFamilyFlags[0] & 0x00002190) + return SPELL_SPECIFIC_HAND; + + // Judgement + if (Id == 20271) + return SPELL_SPECIFIC_JUDGEMENT; + + // only paladin auras have this (for palaldin class family) + if (SpellFamilyFlags[2] & 0x00000020) + return SPELL_SPECIFIC_AURA; + + break; + } + case SPELLFAMILY_SHAMAN: + { + // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus + if (SpellFamilyFlags[1] & 0x420 + || SpellFamilyFlags[0] & 0x00000400 + || Id == 23552) + return SPELL_SPECIFIC_ELEMENTAL_SHIELD; + + break; + } + case SPELLFAMILY_DEATHKNIGHT: + if (Id == 48266 || Id == 48263 || Id == 48265) + return SPELL_SPECIFIC_PRESENCE; + break; + } + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) + { + switch (Effects[i].ApplyAuraName) { - case 8118: // Strength - case 8099: // Stamina - case 8112: // Spirit - case 8096: // Intellect - case 8115: // Agility - case 8091: // Armor - return SPELL_SPECIFIC_SCROLL; - case 12880: // Enrage (Enrage) - case 57518: // Enrage (Wrecking Crew) - return SPELL_SPECIFIC_WARRIOR_ENRAGE; + case SPELL_AURA_MOD_CHARM: + case SPELL_AURA_MOD_POSSESS_PET: + case SPELL_AURA_MOD_POSSESS: + case SPELL_AURA_AOE_CHARM: + return SPELL_SPECIFIC_CHARM; + case SPELL_AURA_TRACK_CREATURES: + /// @workaround For non-stacking tracking spells (We need generic solution) + if (Id == 30645) // Gas Cloud Tracking + return SPELL_SPECIFIC_NORMAL; + case SPELL_AURA_TRACK_RESOURCES: + case SPELL_AURA_TRACK_STEALTHED: + return SPELL_SPECIFIC_TRACKER; } } - break; } - case SPELLFAMILY_MAGE: - { - // family flags 18(Molten), 25(Frost/Ice), 28(Mage) - if (SpellFamilyFlags[0] & 0x12040000) - return SPELL_SPECIFIC_MAGE_ARMOR; - // Arcane brillance and Arcane intelect (normal check fails because of flags difference) - if (SpellFamilyFlags[0] & 0x400) - return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE; - - if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE) - return SPELL_SPECIFIC_MAGE_POLYMORPH; - - break; - } - case SPELLFAMILY_WARRIOR: - { - if (Id == 12292) // Death Wish - return SPELL_SPECIFIC_WARRIOR_ENRAGE; - - break; - } - case SPELLFAMILY_WARLOCK: - { - // Warlock (Bane of Doom | Bane of Agony | Bane of Havoc) - if (Id == 603 || Id == 980 || Id == 80240) - return SPELL_SPECIFIC_BANE; - - // only warlock curses have this - if (Dispel == DISPEL_CURSE) - return SPELL_SPECIFIC_CURSE; - - // Warlock (Demon Armor | Demon Skin | Fel Armor) - if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) - return SPELL_SPECIFIC_WARLOCK_ARMOR; - - //seed of corruption and corruption - if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2) - return SPELL_SPECIFIC_WARLOCK_CORRUPTION; - break; - } - case SPELLFAMILY_PRIEST: - { - // Divine Spirit and Prayer of Spirit - if (SpellFamilyFlags[0] & 0x20) - return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT; - - break; - } - case SPELLFAMILY_HUNTER: - { - // only hunter stings have this - if (Dispel == DISPEL_POISON) - return SPELL_SPECIFIC_STING; - - // only hunter aspects have this (but not all aspects in hunter family) - if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) - return SPELL_SPECIFIC_ASPECT; - - break; - } - case SPELLFAMILY_PALADIN: - { - // Collection of all the seal family flags. No other paladin spell has any of those. - if (SpellFamilyFlags[1] & 0xA2000800) - return SPELL_SPECIFIC_SEAL; - - if (SpellFamilyFlags[0] & 0x00002190) - return SPELL_SPECIFIC_HAND; - - // Judgement - if (Id == 20271) - return SPELL_SPECIFIC_JUDGEMENT; - - // only paladin auras have this (for palaldin class family) - if (SpellFamilyFlags[2] & 0x00000020) - return SPELL_SPECIFIC_AURA; - - break; - } - case SPELLFAMILY_SHAMAN: - { - // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus - if (SpellFamilyFlags[1] & 0x420 - || SpellFamilyFlags[0] & 0x00000400 - || Id == 23552) - return SPELL_SPECIFIC_ELEMENTAL_SHIELD; - - break; - } - case SPELLFAMILY_DEATHKNIGHT: - if (Id == 48266 || Id == 48263 || Id == 48265) - return SPELL_SPECIFIC_PRESENCE; - break; - } - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) - { - switch (Effects[i].ApplyAuraName) - { - case SPELL_AURA_MOD_CHARM: - case SPELL_AURA_MOD_POSSESS_PET: - case SPELL_AURA_MOD_POSSESS: - case SPELL_AURA_AOE_CHARM: - return SPELL_SPECIFIC_CHARM; - case SPELL_AURA_TRACK_CREATURES: - /// @workaround For non-stacking tracking spells (We need generic solution) - if (Id == 30645) // Gas Cloud Tracking - return SPELL_SPECIFIC_NORMAL; - case SPELL_AURA_TRACK_RESOURCES: - case SPELL_AURA_TRACK_STEALTHED: - return SPELL_SPECIFIC_TRACKER; - } - } - } - - return SPELL_SPECIFIC_NORMAL; + return SPELL_SPECIFIC_NORMAL; + }(); } void SpellInfo::_LoadImmunityInfo() From 754c22d3d04c28105855ae6bb84a092613bfd3ae Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 7 Oct 2016 12:52:01 -0300 Subject: [PATCH 014/110] Core/Auras: prevent stack overflow while processing SPELL_EFFECT_ADD_EXTRA_ATTACKS --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d6c74255ac..dfd7f63d5a 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1102,6 +1102,16 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())) result = false; break; + case SPELL_AURA_PROC_TRIGGER_SPELL: + case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: + { + // Don't proc extra attacks while already processing extra attack spell + uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; + if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) + if (aurApp->GetTarget()->m_extraAttacks && triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + result = false; + break; + } default: break; } From a6b4f239a434482bf7050823dad3587a494729e0 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 8 Oct 2016 22:20:49 -0300 Subject: [PATCH 015/110] Add some DamageInfo null checks --- .../FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp | 6 +++++- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 8 ++++++-- .../Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 8 ++++++-- src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp | 5 ++++- .../scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 8 ++++++-- src/server/scripts/Spells/spell_generic.cpp | 8 +++++--- src/server/scripts/Spells/spell_item.cpp | 8 ++++++-- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 979a1e21fe..2b5224947b 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -406,7 +406,11 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45)); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast(damageInfo->GetDamage()), 45); GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index fd175a6dea..ea722083f8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -730,8 +730,12 @@ class spell_blood_queen_essence_of_the_blood_queen : public SpellScriptLoader void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index ad6b23eecf..57c72aeb29 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -3010,8 +3010,12 @@ class spell_the_lich_king_dark_hunger : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = int32(eventInfo.GetDamageInfo()->GetDamage() / 2); - GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = static_cast(damageInfo->GetDamage()) / 2; + GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 5da94f99b2..66095046f6 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -604,8 +604,11 @@ class spell_oculus_temporal_rift : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 amount = aurEff->GetAmount() + eventInfo.GetDamageInfo()->GetDamage(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + int32 amount = aurEff->GetAmount() + damageInfo->GetDamage(); if (amount >= 15000) { if (Unit* caster = GetCaster()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 9cff3247a6..69404eacba 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -2751,8 +2751,12 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60); - GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast(damageInfo->GetDamage()), 60); + GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, damageInfo->GetAttacker(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index bb1819d5b7..8b0c369d5a 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -114,7 +114,8 @@ class spell_gen_adaptive_warding : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) return false; // find Mage Armor @@ -157,7 +158,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader default: return; } - GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); + GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff); } void Register() override @@ -2149,7 +2150,8 @@ class spell_gen_obsidian_armor : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) return false; if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 41960203cc..d68604ad39 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1457,8 +1457,12 @@ class spell_item_necrotic_touch : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override From c71dc17135ee68cfbae089cfa4ea02ca7973361a Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 9 Oct 2016 01:48:48 -0300 Subject: [PATCH 016/110] Core/Auras: moved check for CC auras out of proc handler, and fixed its logic --- .../game/Spells/Auras/SpellAuraEffects.cpp | 52 ++++++++++++------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dfd7f63d5a..7917fb8923 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1074,33 +1074,56 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); switch (GetAuraType()) { + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + case SPELL_AURA_MOD_ROOT: + case SPELL_AURA_TRANSFORM: + { + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + // Spell own damage at apply won't break CC + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + { + if (spellInfo == GetSpellInfo()) + { + Aura* aura = GetBase(); + // called from spellcast, should not have ticked yet + if (aura->GetDuration() == aura->GetMaxDuration()) + return false; + } + } + break; + } case SPELL_AURA_MECHANIC_IMMUNITY: case SPELL_AURA_MOD_MECHANIC_RESISTANCE: // compare mechanic if (!spellInfo || static_cast(spellInfo->Mechanic) != GetMiscValue()) - result = false; + return false; break; case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK: // skip melee hits and instant cast spells if (!spellInfo || !spellInfo->CalcCastTime()) - result = false; + return false; break; case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: // Compare casters if (GetCasterGUID() != eventInfo.GetActor()->GetGUID()) - result = false; + return false; break; case SPELL_AURA_MOD_POWER_COST_SCHOOL: case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: // Skip melee hits and spells with wrong school or zero cost if (!spellInfo || (!spellInfo->ManaCost && !spellInfo->ManaCostPercentage) || // Cost Check !(spellInfo->GetSchoolMask() & GetMiscValue())) // School Check - result = false; + return false; break; case SPELL_AURA_REFLECT_SPELLS_SCHOOL: // Skip melee hits and spells with wrong school if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())) - result = false; + return false; break; case SPELL_AURA_PROC_TRIGGER_SPELL: case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: @@ -1109,7 +1132,7 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) if (aurApp->GetTarget()->m_extraAttacks && triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) - result = false; + return false; break; } default: @@ -6055,23 +6078,12 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con void AuraEffect::HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) - return; + int32 const damageLeft = GetAmount() - static_cast(eventInfo.GetDamageInfo()->GetDamage()); - // aura own damage at apply won't break CC - if (eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST) - { - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) - if (spellInfo == GetSpellInfo()) - return; - } - - int32 damageLeft = GetAmount(); - if (damageLeft < int32(damageInfo->GetDamage())) + if (damageLeft <= 0) aurApp->GetTarget()->RemoveAura(aurApp); else - SetAmount(damageLeft - damageInfo->GetDamage()); + SetAmount(damageLeft); } void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) From a47ee2ac5afb87b60a0b66025bc478016ad0a52e Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 12 Oct 2016 01:32:40 -0300 Subject: [PATCH 017/110] Core/Spells: fix auto repeat spells triggering auras Auto repeat spells are casted as triggered and didn't register procs properly if the aura can't proc with triggered --- sql/updates/world/3.3.5/2016_10_12_00_world_335.sql | 8 ++++++++ src/server/game/Spells/Auras/SpellAuras.cpp | 4 ++-- src/server/game/Spells/SpellMgr.cpp | 3 ++- src/server/game/Spells/SpellMgr.h | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/3.3.5/2016_10_12_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql new file mode 100644 index 0000000000..7c14d28bc1 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql @@ -0,0 +1,8 @@ +UPDATE `spell_proc` SET `SpellPhaseMask`=0x2 WHERE `SpellId` IN ( +-61846, -- Aspect of the Dragonhawk +-13165, -- Aspect of the Hawk +7434, -- Fate Rune of Unsurpassed Vigor +39958, -- Skyfire Swiftness +55380, -- Skyflare Swiftness +70727 -- Item - Hunter T10 2P Bonus +); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b937a5faea..9be3bb4abe 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1756,8 +1756,8 @@ uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& event if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) return 0; - // check if aura can proc when spell is triggered - if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) + // check if aura can proc when spell is triggered (exception for hunter auto shot & wands) + if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) if (Spell const* spell = eventInfo.GetProcSpell()) if (spell->IsTriggered()) if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED)) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index e5e68e51bc..ab36f00d29 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -816,7 +816,8 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE return true; // do triggered cast checks - if (!(procEntry.AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) + // Do not consider autoattacks as triggered spells + if (!(procEntry.AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) { if (Spell const* spell = eventInfo.GetProcSpell()) { diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 9945b1da2f..d94d63095d 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -158,13 +158,14 @@ enum ProcFlags | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS, SPELL_PROC_FLAG_MASK = PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS + | PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, - SPELL_CAST_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION | RANGED_PROC_FLAG_MASK, + SPELL_CAST_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION, PERIODIC_PROC_FLAG_MASK = PROC_FLAG_DONE_PERIODIC | PROC_FLAG_TAKEN_PERIODIC, From e0c8a379c89b3e800b31a3a9a19ed4760d8e3951 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 12 Oct 2016 09:58:05 -0300 Subject: [PATCH 018/110] Core/Spell: do not automatically set proc Family Name if no Family Flags present Closes #18075 --- src/server/game/Spells/SpellMgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ab36f00d29..f8f66e017b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1995,12 +1995,15 @@ void SpellMgr::LoadSpellProcs() SpellProcEntry procEntry; procEntry.SchoolMask = 0; - procEntry.SpellFamilyName = spellInfo->SpellFamilyName; procEntry.ProcFlags = spellInfo->ProcFlags; + procEntry.SpellFamilyName = 0; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (spellInfo->Effects[i].IsEffect() && isTriggerAura[spellInfo->Effects[i].ApplyAuraName]) procEntry.SpellFamilyMask |= spellInfo->Effects[i].SpellClassMask; + if (procEntry.SpellFamilyMask) + procEntry.SpellFamilyName = spellInfo->SpellFamilyName; + procEntry.SpellTypeMask = PROC_SPELL_TYPE_MASK_ALL; procEntry.SpellPhaseMask = PROC_SPELL_PHASE_HIT; procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent From 9b5c40a201f7d93206bca6ff8f504022d6aea70d Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 12 Oct 2016 22:59:29 -0300 Subject: [PATCH 019/110] Mark Slice and Dice as positive --- src/server/game/Spells/SpellInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 46f4157adf..38c3fd9ed2 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3160,6 +3160,9 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const { // Envenom must be considered as a positive effect even though it deals damage case 32645: // Envenom + // Slice and Dice. Prevents breaking Stealth + case 5171: // Slice and Dice (Rank 1) + case 6774: // Slice and Dice (Rank 2) return true; default: break; From 7ccd58615a85b0b7381b28c9173c20513530eee5 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 13 Oct 2016 22:28:08 -0300 Subject: [PATCH 020/110] Fix dynamic linking --- src/server/game/Entities/Object/Object.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index b14d5d08a9..bae3a9ec1f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2877,17 +2877,17 @@ ObjectGuid WorldObject::GetTransGUID() const return ObjectGuid::Empty; } -template void WorldObject::GetGameObjectListWithEntryInGrid(std::list&, uint32, float) const; -template void WorldObject::GetGameObjectListWithEntryInGrid(std::deque&, uint32, float) const; -template void WorldObject::GetGameObjectListWithEntryInGrid(std::vector&, uint32, float) const; +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::list&, uint32, float) const; +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::deque&, uint32, float) const; +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::vector&, uint32, float) const; -template void WorldObject::GetCreatureListWithEntryInGrid(std::list&, uint32, float) const; -template void WorldObject::GetCreatureListWithEntryInGrid(std::deque&, uint32, float) const; -template void WorldObject::GetCreatureListWithEntryInGrid(std::vector&, uint32, float) const; +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::list&, uint32, float) const; +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::deque&, uint32, float) const; +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::vector&, uint32, float) const; -template void WorldObject::GetPlayerListInGrid(std::list&, float) const; -template void WorldObject::GetPlayerListInGrid(std::deque&, float) const; -template void WorldObject::GetPlayerListInGrid(std::vector&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector&, float) const; void WorldObject::SetAIAnimKitId(uint16 animKitId) { From d30237fb1e5753dd53833557750a9e3fd8e65a0f Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 00:57:24 +0100 Subject: [PATCH 021/110] Core/Globals: compute aura diminishing return info at startup and cache it --- src/server/game/Entities/Unit/Unit.cpp | 100 ++-- src/server/game/Entities/Unit/Unit.h | 24 +- src/server/game/Miscellaneous/SharedDefines.h | 4 +- src/server/game/Spells/Spell.cpp | 27 +- src/server/game/Spells/Spell.h | 4 - src/server/game/Spells/SpellInfo.cpp | 316 ++++++++++++ src/server/game/Spells/SpellInfo.h | 484 +++++++++--------- src/server/game/Spells/SpellMgr.cpp | 314 +----------- src/server/game/Spells/SpellMgr.h | 8 +- src/server/game/World/World.cpp | 3 + 10 files changed, 665 insertions(+), 619 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5c3b18211f..70b991fa2c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9447,60 +9447,56 @@ void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Sp DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) { - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) + DiminishingReturn& diminish = m_Diminishing[group]; + if (!diminish.hitCount) + return DIMINISHING_LEVEL_1; + + if (!diminish.hitTime) + return DIMINISHING_LEVEL_1; + + // If last spell was cast more than 15 seconds ago - reset the count. + if (!diminish.stack && GetMSTimeDiffToNow(diminish.hitTime) > 15000) { - if (i->DRGroup != group) - continue; - - if (!i->hitCount) - return DIMINISHING_LEVEL_1; - - // If last spell was cast more than 15 seconds ago - reset the count. - if (i->stack == 0 && getMSTimeDiff(i->hitTime, getMSTime()) > 15000) - { - i->hitCount = DIMINISHING_LEVEL_1; - return DIMINISHING_LEVEL_1; - } - // or else increase the count. - else - return DiminishingLevels(i->hitCount); + diminish.hitCount = DIMINISHING_LEVEL_1; + return DIMINISHING_LEVEL_1; } - return DIMINISHING_LEVEL_1; + + return DiminishingLevels(diminish.hitCount); } -void Unit::IncrDiminishing(DiminishingGroup group) +void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered) { + DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); + DiminishingLevels const maxLevel = auraSpellInfo->GetDiminishingReturnsMaxLevel(triggered); + // Checking for existing in the table - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) - { - if (i->DRGroup != group) - continue; - if (int32(i->hitCount) < GetDiminishingReturnsMaxLevel(group)) - i->hitCount += 1; - return; - } - m_Diminishing.push_back(DiminishingReturn(group, getMSTime(), DIMINISHING_LEVEL_2)); + DiminishingReturn& diminish = m_Diminishing[group]; + if (static_cast(diminish.hitCount) < maxLevel) + ++diminish.hitCount; } -float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration) +float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) { + DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); if (duration == -1 || group == DIMINISHING_NONE) return 1.0f; + int32 const limitDuration = auraSpellInfo->GetDiminishingReturnsLimitDuration(triggered); + // test pet/charm masters instead pets/charmeds - Unit const* tarGetOwner = GetCharmerOrOwner(); + Unit const* targetOwner = GetCharmerOrOwner(); Unit const* casterOwner = caster->GetCharmerOrOwner(); // Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0) - if (limitduration > 0 && duration > limitduration) + if (limitDuration > 0 && duration > limitDuration) { - Unit const* target = tarGetOwner ? tarGetOwner : this; + Unit const* target = targetOwner ? targetOwner : this; Unit const* source = casterOwner ? casterOwner : caster; if ((target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) && source->GetTypeId() == TYPEID_PLAYER) - duration = limitduration; + duration = limitDuration; } float mod = 1.0f; @@ -9509,7 +9505,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, { if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) { - DiminishingLevels diminish = Level; + DiminishingLevels diminish = previousLevel; switch (diminish) { case DIMINISHING_LEVEL_1: break; @@ -9522,12 +9518,12 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, } } // Some diminishings applies to mobs too (for example, Stun) - else if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER - && ((tarGetOwner ? (tarGetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) + else if ((auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_PLAYER + && ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) - || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL) + || auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_ALL) { - DiminishingLevels diminish = Level; + DiminishingLevels diminish = previousLevel; switch (diminish) { case DIMINISHING_LEVEL_1: break; @@ -9545,24 +9541,26 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply) { // Checking for existing in the table - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) - { - if (i->DRGroup != group) - continue; + DiminishingReturn& diminish = m_Diminishing[group]; - if (apply) - i->stack += 1; - else if (i->stack) - { - i->stack -= 1; - // Remember time after last aura from group removed - if (i->stack == 0) - i->hitTime = getMSTime(); - } - break; + if (apply) + ++diminish.stack; + else if (diminish.stack) + { + --diminish.stack; + + // Remember time after last aura from group removed + if (!diminish.stack) + diminish.hitTime = getMSTime(); } } +void Unit::ClearDiminishings() +{ + for (uint32 i = 0; i < DIMINISHING_MAX; ++i) + m_Diminishing[i].Clear(); +} + float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const { if (!spellInfo->RangeEntry) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d6ca5a0dc7..df2c17e437 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -832,11 +832,15 @@ enum UnitTypeMask struct DiminishingReturn { - DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count) - : DRGroup(group), stack(0), hitTime(t), hitCount(count) - { } + DiminishingReturn() : stack(0), hitTime(0), hitCount(DIMINISHING_LEVEL_1) { } + + void Clear() + { + stack = 0; + hitTime = 0; + hitCount = DIMINISHING_LEVEL_1; + } - DiminishingGroup DRGroup; uint16 stack; uint32 hitTime; uint32 hitCount; @@ -1287,7 +1291,7 @@ class TC_GAME_API Unit : public WorldObject typedef std::list AuraEffectList; typedef std::list AuraList; typedef std::list AuraApplicationList; - typedef std::list Diminishing; + typedef std::array Diminishing; typedef std::deque> AuraApplicationProcContainer; @@ -1304,11 +1308,11 @@ class TC_GAME_API Unit : public WorldObject void CleanupBeforeRemoveFromMap(bool finalCleanup); void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units) - DiminishingLevels GetDiminishing(DiminishingGroup group); - void IncrDiminishing(DiminishingGroup group); - float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration); - void ApplyDiminishingAura(DiminishingGroup group, bool apply); - void ClearDiminishings() { m_Diminishing.clear(); } + DiminishingLevels GetDiminishing(DiminishingGroup group); + void IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered); + float ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel); + void ApplyDiminishingAura(DiminishingGroup group, bool apply); + void ClearDiminishings(); // target dependent range checks float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 58a0919676..6fcde5f40f 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3621,7 +3621,9 @@ enum DiminishingGroup : uint16 DIMINISHING_SLEEP = 17, DIMINISHING_TAUNT = 18, DIMINISHING_LIMITONLY = 19, - DIMINISHING_DRAGONS_BREATH = 20 + DIMINISHING_DRAGONS_BREATH = 20, + + DIMINISHING_MAX }; enum SummonCategory diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d30dd29a27..331aaab882 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -591,8 +591,6 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO damage = 0; targetMissInfo = SPELL_MISS_NONE; effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH; - m_diminishLevel = DIMINISHING_LEVEL_1; - m_diminishGroup = DIMINISHING_NONE; m_damage = 0; m_healing = 0; m_procAttacker = 0; @@ -2617,16 +2615,19 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA aura_effmask |= 1 << i; // Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add - m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo, m_triggeredByAuraSpell != nullptr); - if (m_diminishGroup && aura_effmask) + bool const triggered = m_triggeredByAuraSpell != nullptr; + DiminishingGroup const diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered); + + DiminishingLevels diminishLevel = DIMINISHING_LEVEL_1; + if (diminishGroup && aura_effmask) { - m_diminishLevel = unit->GetDiminishing(m_diminishGroup); - DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup); + diminishLevel = unit->GetDiminishing(diminishGroup); + DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered); // Increase Diminishing on unit, current informations for actually casts will use values above if ((type == DRTYPE_PLAYER && (unit->GetCharmerOrOwnerPlayerOrPlayerItself() || (unit->GetTypeId() == TYPEID_UNIT && unit->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) || type == DRTYPE_ALL) - unit->IncrDiminishing(m_diminishGroup); + unit->IncrDiminishing(m_spellInfo, triggered); } if (aura_effmask) @@ -2669,8 +2670,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA // Now Reduce spell duration using data received at spell hit int32 duration = m_spellAura->GetMaxDuration(); - int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, aurSpellInfo); - float diminishMod = unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel, limitduration); + float diminishMod = unit->ApplyDiminishingToDuration(aurSpellInfo, triggered, duration, m_originalCaster, diminishLevel); // unit is immune to aura if it was diminished to 0 duration if (diminishMod == 0.0f) @@ -2685,7 +2685,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA } else { - ((UnitAura*)m_spellAura)->SetDiminishGroup(m_diminishGroup); + ((UnitAura*)m_spellAura)->SetDiminishGroup(diminishGroup); bool positive = m_spellAura->GetSpellInfo()->IsPositive(); if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID())) @@ -3525,9 +3525,6 @@ uint64 Spell::handle_delayed(uint64 t_offset) void Spell::_handle_immediate_phase() { m_spellAura = NULL; - // initialize Diminishing Returns Data - m_diminishLevel = DIMINISHING_LEVEL_1; - m_diminishGroup = DIMINISHING_NONE; // handle some immediate features of the spell here HandleThreatSpells(); @@ -4852,7 +4849,7 @@ void Spell::HandleThreatSpells() continue; // positive spells distribute threat among all units that are in combat with target, like healing - if (m_spellInfo->_IsPositiveSpell()) + if (m_spellInfo->IsPositive()) target->getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo); // for negative spells threat gets distributed among affected targets else @@ -4863,7 +4860,7 @@ void Spell::HandleThreatSpells() target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo); } } - TC_LOG_DEBUG("spells", "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); + TC_LOG_DEBUG("spells", "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->IsPositive() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); } void Spell::HandleHolyPower(Player* caster) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 57195cfedd..5bf1fd1a03 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -580,10 +580,6 @@ class TC_GAME_API Spell // used in effects handlers Aura* m_spellAura; - // this is set in Spell Hit, but used in Apply Aura handler - DiminishingLevels m_diminishLevel; - DiminishingGroup m_diminishGroup; - // ------------------------------------------- GameObject* focusObject; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 38c3fd9ed2..56ff2e375f 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2326,6 +2326,322 @@ void SpellInfo::_LoadSpellSpecific() }(); } +void SpellInfo::_LoadSpellDiminishInfo() +{ + auto diminishingGroupCompute = [this](bool triggered) -> DiminishingGroup + { + if (IsPositive()) + return DIMINISHING_NONE; + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (Effects[i].ApplyAuraName == SPELL_AURA_MOD_TAUNT) + return DIMINISHING_TAUNT; + } + + // Explicit Diminishing Groups + switch (SpellFamilyName) + { + case SPELLFAMILY_GENERIC: + { + // Pet charge effects (Infernal Awakening, Demon Charge) + if (SpellVisual[0] == 2816 && SpellIconID == 15) + return DIMINISHING_CONTROLLED_STUN; + // Frost Tomb + else if (Id == 48400) + return DIMINISHING_NONE; + // Gnaw + else if (Id == 47481) + return DIMINISHING_CONTROLLED_STUN; + // ToC Icehowl Arctic Breath + else if (SpellVisual[0] == 14153) + return DIMINISHING_NONE; + // Black Plague + else if (Id == 64155) + return DIMINISHING_NONE; + // Screams of the Dead (King Ymiron) + else if (Id == 51750) + return DIMINISHING_NONE; + break; + } + // Event spells + case SPELLFAMILY_UNK1: + return DIMINISHING_NONE; + case SPELLFAMILY_MAGE: + { + // Frostbite + if (SpellFamilyFlags[1] & 0x80000000) + return DIMINISHING_ROOT; + // Shattered Barrier + else if (SpellVisual[0] == 12297) + return DIMINISHING_ROOT; + // Deep Freeze + else if (SpellIconID == 2939 && SpellVisual[0] == 9963) + return DIMINISHING_CONTROLLED_STUN; + // Frost Nova / Freeze (Water Elemental) + else if (SpellIconID == 193) + return DIMINISHING_CONTROLLED_ROOT; + // Dragon's Breath + else if (SpellFamilyFlags[0] & 0x800000) + return DIMINISHING_DRAGONS_BREATH; + break; + } + case SPELLFAMILY_WARRIOR: + { + // Hamstring - limit duration to 10s in PvP + if (SpellFamilyFlags[0] & 0x2) + return DIMINISHING_LIMITONLY; + // Charge Stun (own diminishing) + else if (SpellFamilyFlags[0] & 0x01000000) + return DIMINISHING_CHARGE; + break; + } + case SPELLFAMILY_WARLOCK: + { + // Curses/etc + if ((SpellFamilyFlags[0] & 0x80000000) || (SpellFamilyFlags[1] & 0x200)) + return DIMINISHING_LIMITONLY; + // Seduction + else if (SpellFamilyFlags[1] & 0x10000000) + return DIMINISHING_FEAR; + // Sin and Punishment (Priest spell, don't ask) + else if (SpellIconID == 1869) + return DIMINISHING_NONE; + break; + } + case SPELLFAMILY_DRUID: + { + // Pounce + if (SpellFamilyFlags[0] & 0x20000) + return DIMINISHING_OPENING_STUN; + // Cyclone + else if (SpellFamilyFlags[1] & 0x20) + return DIMINISHING_CYCLONE; + // Entangling Roots + // Nature's Grasp + else if (SpellFamilyFlags[0] & 0x00000200) + return DIMINISHING_CONTROLLED_ROOT; + // Faerie Fire + else if (SpellFamilyFlags[0] & 0x400) + return DIMINISHING_LIMITONLY; + break; + } + case SPELLFAMILY_ROGUE: + { + // Gouge + if (SpellFamilyFlags[0] & 0x8) + return DIMINISHING_DISORIENT; + // Blind + else if (SpellFamilyFlags[0] & 0x1000000) + return DIMINISHING_FEAR; + // Cheap Shot + else if (SpellFamilyFlags[0] & 0x400) + return DIMINISHING_OPENING_STUN; + // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) + else if (SpellIconID == 163) + return DIMINISHING_LIMITONLY; + break; + } + case SPELLFAMILY_HUNTER: + { + // Hunter's Mark + if ((SpellFamilyFlags[0] & 0x400) && SpellIconID == 538) + return DIMINISHING_LIMITONLY; + // Scatter Shot (own diminishing) + else if ((SpellFamilyFlags[0] & 0x40000) && SpellIconID == 132) + return DIMINISHING_SCATTER_SHOT; + // Entrapment (own diminishing) + else if (SpellVisual[0] == 7484 && SpellIconID == 20) + return DIMINISHING_ENTRAPMENT; + // Wyvern Sting mechanic is MECHANIC_SLEEP but the diminishing is DIMINISHING_DISORIENT + else if ((SpellFamilyFlags[1] & 0x1000) && SpellIconID == 1721) + return DIMINISHING_DISORIENT; + // Freezing Arrow + else if (SpellFamilyFlags[0] & 0x8) + return DIMINISHING_DISORIENT; + break; + } + case SPELLFAMILY_PALADIN: + { + // Judgement of Justice - limit duration to 10s in PvP + if (SpellFamilyFlags[0] & 0x100000) + return DIMINISHING_LIMITONLY; + // Turn Evil + else if ((SpellFamilyFlags[1] & 0x804000) && SpellIconID == 309) + return DIMINISHING_FEAR; + break; + } + case SPELLFAMILY_SHAMAN: + { + // Storm, Earth and Fire - Earthgrab + if (SpellFamilyFlags[2] & 0x4000) + return DIMINISHING_NONE; + break; + } + case SPELLFAMILY_DEATHKNIGHT: + { + // Hungering Cold (no flags) + if (SpellIconID == 2797) + return DIMINISHING_DISORIENT; + // Mark of Blood + else if ((SpellFamilyFlags[0] & 0x10000000) && SpellIconID == 2285) + return DIMINISHING_LIMITONLY; + break; + } + default: + break; + } + + // Lastly - Set diminishing depending on mechanic + uint32 mechanic = GetAllEffectsMechanicMask(); + if (mechanic & (1 << MECHANIC_CHARM)) + return DIMINISHING_MIND_CONTROL; + if (mechanic & (1 << MECHANIC_SILENCE)) + return DIMINISHING_SILENCE; + if (mechanic & (1 << MECHANIC_SLEEP)) + return DIMINISHING_SLEEP; + if (mechanic & ((1 << MECHANIC_SAPPED) | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_SHACKLE))) + return DIMINISHING_DISORIENT; + // Mechanic Knockout, except Blast Wave + if (mechanic & (1 << MECHANIC_KNOCKOUT) && SpellIconID != 292) + return DIMINISHING_DISORIENT; + if (mechanic & (1 << MECHANIC_DISARM)) + return DIMINISHING_DISARM; + if (mechanic & (1 << MECHANIC_FEAR)) + return DIMINISHING_FEAR; + if (mechanic & (1 << MECHANIC_STUN)) + return triggered ? DIMINISHING_STUN : DIMINISHING_CONTROLLED_STUN; + if (mechanic & (1 << MECHANIC_BANISH)) + return DIMINISHING_BANISH; + if (mechanic & (1 << MECHANIC_ROOT)) + return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; + if (mechanic & (1 << MECHANIC_HORROR)) + return DIMINISHING_HORROR; + + return DIMINISHING_NONE; + }; + + auto diminishingTypeCompute = [](DiminishingGroup group) -> DiminishingReturnsType + { + switch (group) + { + case DIMINISHING_TAUNT: + case DIMINISHING_CONTROLLED_STUN: + case DIMINISHING_STUN: + case DIMINISHING_OPENING_STUN: + case DIMINISHING_CYCLONE: + case DIMINISHING_CHARGE: + return DRTYPE_ALL; + case DIMINISHING_LIMITONLY: + case DIMINISHING_NONE: + return DRTYPE_NONE; + default: + return DRTYPE_PLAYER; + } + }; + + auto diminishingMaxLevelCompute = [](DiminishingGroup group) -> DiminishingLevels + { + switch (group) + { + case DIMINISHING_TAUNT: + return DIMINISHING_LEVEL_TAUNT_IMMUNE; + default: + return DIMINISHING_LEVEL_IMMUNE; + } + }; + + auto diminishingLimitDurationCompute = [this](DiminishingGroup group) -> int32 + { + auto isGroupDurationLimited = [group]() -> bool + { + switch (group) + { + case DIMINISHING_BANISH: + case DIMINISHING_CONTROLLED_STUN: + case DIMINISHING_CONTROLLED_ROOT: + case DIMINISHING_CYCLONE: + case DIMINISHING_DISORIENT: + case DIMINISHING_ENTRAPMENT: + case DIMINISHING_FEAR: + case DIMINISHING_HORROR: + case DIMINISHING_MIND_CONTROL: + case DIMINISHING_OPENING_STUN: + case DIMINISHING_ROOT: + case DIMINISHING_STUN: + case DIMINISHING_SLEEP: + case DIMINISHING_LIMITONLY: + return true; + default: + return false; + } + }; + + if (!isGroupDurationLimited()) + return 0; + + // Explicit diminishing duration + switch (SpellFamilyName) + { + case SPELLFAMILY_DRUID: + { + // Faerie Fire - limit to 40 seconds in PvP (3.1) + if (SpellFamilyFlags[0] & 0x400) + return 40 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_HUNTER: + { + // Wyvern Sting + if (SpellFamilyFlags[1] & 0x1000) + return 6 * IN_MILLISECONDS; + // Hunter's Mark + if (SpellFamilyFlags[0] & 0x400) + return 30 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_PALADIN: + { + // Repentance - limit to 6 seconds in PvP + if (SpellFamilyFlags[0] & 0x4) + return 6 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_WARLOCK: + { + // Banish - limit to 6 seconds in PvP + if (SpellFamilyFlags[1] & 0x8000000) + return 6 * IN_MILLISECONDS; + // Curse of Tongues - limit to 12 seconds in PvP + else if (SpellFamilyFlags[2] & 0x800) + return 12 * IN_MILLISECONDS; + // Curse of Elements - limit to 120 seconds in PvP + else if (SpellFamilyFlags[1] & 0x200) + return 120 * IN_MILLISECONDS; + break; + } + default: + break; + } + + return 8 * IN_MILLISECONDS; + }; + + SpellDiminishInfo triggeredInfo, normalInfo; + triggeredInfo.DiminishGroup = diminishingGroupCompute(true); + triggeredInfo.DiminishReturnType = diminishingTypeCompute(triggeredInfo.DiminishGroup); + triggeredInfo.DiminishMaxLevel = diminishingMaxLevelCompute(triggeredInfo.DiminishGroup); + triggeredInfo.DiminishDurationLimit = diminishingLimitDurationCompute(triggeredInfo.DiminishGroup); + + normalInfo.DiminishGroup = diminishingGroupCompute(false); + normalInfo.DiminishReturnType = diminishingTypeCompute(normalInfo.DiminishGroup); + normalInfo.DiminishMaxLevel = diminishingMaxLevelCompute(normalInfo.DiminishGroup); + normalInfo.DiminishDurationLimit = diminishingLimitDurationCompute(normalInfo.DiminishGroup); + + _diminishInfoTriggered = triggeredInfo; + _diminishInfoNonTriggered = normalInfo; +} + void SpellInfo::_LoadImmunityInfo() { uint32 schoolImmunityMask = 0; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 270d1c2f45..3e1a437a80 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -313,265 +313,285 @@ struct TC_GAME_API ImmunityInfo boost::container::flat_set SpellEffectImmune; }; +struct TC_GAME_API SpellDiminishInfo +{ + DiminishingGroup DiminishGroup = DIMINISHING_NONE; + DiminishingReturnsType DiminishReturnType = DRTYPE_NONE; + DiminishingLevels DiminishMaxLevel = DIMINISHING_LEVEL_IMMUNE; + int32 DiminishDurationLimit = 0; +}; + class TC_GAME_API SpellInfo { -public: - uint32 Id; - SpellCategoryEntry const* CategoryEntry; - uint32 Dispel; - uint32 Mechanic; - uint32 Attributes; - uint32 AttributesEx; - uint32 AttributesEx2; - uint32 AttributesEx3; - uint32 AttributesEx4; - uint32 AttributesEx5; - uint32 AttributesEx6; - uint32 AttributesEx7; - uint32 AttributesEx8; - uint32 AttributesEx9; - uint32 AttributesEx10; - uint32 AttributesCu; - uint64 Stances; - uint64 StancesNot; - uint32 Targets; - uint32 TargetCreatureType; - uint32 RequiresSpellFocus; - uint32 FacingCasterFlags; - uint32 CasterAuraState; - uint32 TargetAuraState; - uint32 CasterAuraStateNot; - uint32 TargetAuraStateNot; - uint32 CasterAuraSpell; - uint32 TargetAuraSpell; - uint32 ExcludeCasterAuraSpell; - uint32 ExcludeTargetAuraSpell; - SpellCastTimesEntry const* CastTimeEntry; - uint32 RecoveryTime; - uint32 CategoryRecoveryTime; - uint32 StartRecoveryCategory; - uint32 StartRecoveryTime; - uint32 InterruptFlags; - uint32 AuraInterruptFlags; - uint32 ChannelInterruptFlags; - uint32 ProcFlags; - uint32 ProcChance; - uint32 ProcCharges; - uint32 MaxLevel; - uint32 BaseLevel; - uint32 SpellLevel; - SpellDurationEntry const* DurationEntry; - uint32 PowerType; - uint32 ManaCost; - uint32 ManaCostPerlevel; - uint32 ManaPerSecond; - uint32 ManaCostPercentage; - uint32 RuneCostID; - SpellRangeEntry const* RangeEntry; - float Speed; - uint32 StackAmount; - uint32 Totem[2]; - int32 Reagent[MAX_SPELL_REAGENTS]; - uint32 ReagentCount[MAX_SPELL_REAGENTS]; - int32 EquippedItemClass; - int32 EquippedItemSubClassMask; - int32 EquippedItemInventoryTypeMask; - uint32 TotemCategory[2]; - uint32 SpellVisual[2]; - uint32 SpellIconID; - uint32 ActiveIconID; - char* SpellName; - char* Rank; - uint32 MaxTargetLevel; - uint32 MaxAffectedTargets; - uint32 SpellFamilyName; - flag96 SpellFamilyFlags; - uint32 DmgClass; - uint32 PreventionType; - int32 AreaGroupId; - uint32 SchoolMask; - uint32 SpellDifficultyId; - uint32 SpellScalingId; - uint32 SpellAuraOptionsId; - uint32 SpellAuraRestrictionsId; - uint32 SpellCastingRequirementsId; - uint32 SpellCategoriesId; - uint32 SpellClassOptionsId; - uint32 SpellCooldownsId; - uint32 SpellEquippedItemsId; - uint32 SpellInterruptsId; - uint32 SpellLevelsId; - uint32 SpellPowerId; - uint32 SpellReagentsId; - uint32 SpellShapeshiftId; - uint32 SpellTargetRestrictionsId; - uint32 SpellTotemsId; - // SpellScalingEntry - int32 CastTimeMin; - int32 CastTimeMax; - int32 CastTimeMaxLevel; - int32 ScalingClass; - float CoefBase; - int32 CoefLevelBase; - SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; - uint32 ExplicitTargetMask; - SpellChainNode const* ChainEntry; + friend class SpellMgr; - // struct access functions - SpellTargetRestrictionsEntry const* GetSpellTargetRestrictions() const; - SpellAuraOptionsEntry const* GetSpellAuraOptions() const; - SpellAuraRestrictionsEntry const* GetSpellAuraRestrictions() const; - SpellCastingRequirementsEntry const* GetSpellCastingRequirements() const; - SpellCategoriesEntry const* GetSpellCategories() const; - SpellClassOptionsEntry const* GetSpellClassOptions() const; - SpellCooldownsEntry const* GetSpellCooldowns() const; - SpellEquippedItemsEntry const* GetSpellEquippedItems() const; - SpellInterruptsEntry const* GetSpellInterrupts() const; - SpellLevelsEntry const* GetSpellLevels() const; - SpellPowerEntry const* GetSpellPower() const; - SpellReagentsEntry const* GetSpellReagents() const; - SpellScalingEntry const* GetSpellScaling() const; - SpellShapeshiftEntry const* GetSpellShapeshift() const; - SpellTotemsEntry const* GetSpellTotems() const; + public: + uint32 Id; + SpellCategoryEntry const* CategoryEntry; + uint32 Dispel; + uint32 Mechanic; + uint32 Attributes; + uint32 AttributesEx; + uint32 AttributesEx2; + uint32 AttributesEx3; + uint32 AttributesEx4; + uint32 AttributesEx5; + uint32 AttributesEx6; + uint32 AttributesEx7; + uint32 AttributesEx8; + uint32 AttributesEx9; + uint32 AttributesEx10; + uint32 AttributesCu; + uint64 Stances; + uint64 StancesNot; + uint32 Targets; + uint32 TargetCreatureType; + uint32 RequiresSpellFocus; + uint32 FacingCasterFlags; + uint32 CasterAuraState; + uint32 TargetAuraState; + uint32 CasterAuraStateNot; + uint32 TargetAuraStateNot; + uint32 CasterAuraSpell; + uint32 TargetAuraSpell; + uint32 ExcludeCasterAuraSpell; + uint32 ExcludeTargetAuraSpell; + SpellCastTimesEntry const* CastTimeEntry; + uint32 RecoveryTime; + uint32 CategoryRecoveryTime; + uint32 StartRecoveryCategory; + uint32 StartRecoveryTime; + uint32 InterruptFlags; + uint32 AuraInterruptFlags; + uint32 ChannelInterruptFlags; + uint32 ProcFlags; + uint32 ProcChance; + uint32 ProcCharges; + uint32 MaxLevel; + uint32 BaseLevel; + uint32 SpellLevel; + SpellDurationEntry const* DurationEntry; + uint32 PowerType; + uint32 ManaCost; + uint32 ManaCostPerlevel; + uint32 ManaPerSecond; + uint32 ManaCostPercentage; + uint32 RuneCostID; + SpellRangeEntry const* RangeEntry; + float Speed; + uint32 StackAmount; + uint32 Totem[2]; + int32 Reagent[MAX_SPELL_REAGENTS]; + uint32 ReagentCount[MAX_SPELL_REAGENTS]; + int32 EquippedItemClass; + int32 EquippedItemSubClassMask; + int32 EquippedItemInventoryTypeMask; + uint32 TotemCategory[2]; + uint32 SpellVisual[2]; + uint32 SpellIconID; + uint32 ActiveIconID; + char* SpellName; + char* Rank; + uint32 MaxTargetLevel; + uint32 MaxAffectedTargets; + uint32 SpellFamilyName; + flag96 SpellFamilyFlags; + uint32 DmgClass; + uint32 PreventionType; + int32 AreaGroupId; + uint32 SchoolMask; + uint32 SpellDifficultyId; + uint32 SpellScalingId; + uint32 SpellAuraOptionsId; + uint32 SpellAuraRestrictionsId; + uint32 SpellCastingRequirementsId; + uint32 SpellCategoriesId; + uint32 SpellClassOptionsId; + uint32 SpellCooldownsId; + uint32 SpellEquippedItemsId; + uint32 SpellInterruptsId; + uint32 SpellLevelsId; + uint32 SpellPowerId; + uint32 SpellReagentsId; + uint32 SpellShapeshiftId; + uint32 SpellTargetRestrictionsId; + uint32 SpellTotemsId; + // SpellScalingEntry + int32 CastTimeMin; + int32 CastTimeMax; + int32 CastTimeMaxLevel; + int32 ScalingClass; + float CoefBase; + int32 CoefLevelBase; + SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; + uint32 ExplicitTargetMask; + SpellChainNode const* ChainEntry; - SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects); - ~SpellInfo(); + // struct access functions + SpellTargetRestrictionsEntry const* GetSpellTargetRestrictions() const; + SpellAuraOptionsEntry const* GetSpellAuraOptions() const; + SpellAuraRestrictionsEntry const* GetSpellAuraRestrictions() const; + SpellCastingRequirementsEntry const* GetSpellCastingRequirements() const; + SpellCategoriesEntry const* GetSpellCategories() const; + SpellClassOptionsEntry const* GetSpellClassOptions() const; + SpellCooldownsEntry const* GetSpellCooldowns() const; + SpellEquippedItemsEntry const* GetSpellEquippedItems() const; + SpellInterruptsEntry const* GetSpellInterrupts() const; + SpellLevelsEntry const* GetSpellLevels() const; + SpellPowerEntry const* GetSpellPower() const; + SpellReagentsEntry const* GetSpellReagents() const; + SpellScalingEntry const* GetSpellScaling() const; + SpellShapeshiftEntry const* GetSpellShapeshift() const; + SpellTotemsEntry const* GetSpellTotems() const; - uint32 GetCategory() const; - bool HasEffect(SpellEffects effect) const; - bool HasAura(AuraType aura) const; - bool HasAreaAuraEffect() const; + SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects); + ~SpellInfo(); - inline bool HasAttribute(SpellAttr0 attribute) const { return !!(Attributes & attribute); } - inline bool HasAttribute(SpellAttr1 attribute) const { return !!(AttributesEx & attribute); } - inline bool HasAttribute(SpellAttr2 attribute) const { return !!(AttributesEx2 & attribute); } - inline bool HasAttribute(SpellAttr3 attribute) const { return !!(AttributesEx3 & attribute); } - inline bool HasAttribute(SpellAttr4 attribute) const { return !!(AttributesEx4 & attribute); } - inline bool HasAttribute(SpellAttr5 attribute) const { return !!(AttributesEx5 & attribute); } - inline bool HasAttribute(SpellAttr6 attribute) const { return !!(AttributesEx6 & attribute); } - inline bool HasAttribute(SpellAttr7 attribute) const { return !!(AttributesEx7 & attribute); } - inline bool HasAttribute(SpellAttr8 attribute) const { return !!(AttributesEx8 & attribute); } - inline bool HasAttribute(SpellAttr9 attribute) const { return !!(AttributesEx9 & attribute); } - inline bool HasAttribute(SpellAttr10 attribute) const { return !!(AttributesEx10 & attribute); } - inline bool HasAttribute(SpellCustomAttributes customAttribute) const { return !!(AttributesCu & customAttribute); } + uint32 GetCategory() const; + bool HasEffect(SpellEffects effect) const; + bool HasAura(AuraType aura) const; + bool HasAreaAuraEffect() const; - bool IsExplicitDiscovery() const; - bool IsLootCrafting() const; - bool IsQuestTame() const; - bool IsProfessionOrRiding() const; - bool IsProfession() const; - bool IsPrimaryProfession() const; - bool IsPrimaryProfessionFirstRank() const; - bool IsAbilityLearnedWithProfession() const; - bool IsAbilityOfSkillType(uint32 skillType) const; + inline bool HasAttribute(SpellAttr0 attribute) const { return !!(Attributes & attribute); } + inline bool HasAttribute(SpellAttr1 attribute) const { return !!(AttributesEx & attribute); } + inline bool HasAttribute(SpellAttr2 attribute) const { return !!(AttributesEx2 & attribute); } + inline bool HasAttribute(SpellAttr3 attribute) const { return !!(AttributesEx3 & attribute); } + inline bool HasAttribute(SpellAttr4 attribute) const { return !!(AttributesEx4 & attribute); } + inline bool HasAttribute(SpellAttr5 attribute) const { return !!(AttributesEx5 & attribute); } + inline bool HasAttribute(SpellAttr6 attribute) const { return !!(AttributesEx6 & attribute); } + inline bool HasAttribute(SpellAttr7 attribute) const { return !!(AttributesEx7 & attribute); } + inline bool HasAttribute(SpellAttr8 attribute) const { return !!(AttributesEx8 & attribute); } + inline bool HasAttribute(SpellAttr9 attribute) const { return !!(AttributesEx9 & attribute); } + inline bool HasAttribute(SpellAttr10 attribute) const { return !!(AttributesEx10 & attribute); } + inline bool HasAttribute(SpellCustomAttributes customAttribute) const { return !!(AttributesCu & customAttribute); } - bool IsAffectingArea() const; - bool IsTargetingArea() const; - bool NeedsExplicitUnitTarget() const; - bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const; + bool IsExplicitDiscovery() const; + bool IsLootCrafting() const; + bool IsQuestTame() const; + bool IsProfessionOrRiding() const; + bool IsProfession() const; + bool IsPrimaryProfession() const; + bool IsPrimaryProfessionFirstRank() const; + bool IsAbilityLearnedWithProfession() const; + bool IsAbilityOfSkillType(uint32 skillType) const; - bool IsPassive() const; - bool IsRaidMarker() const; - bool IsAutocastable() const; - bool IsStackableWithRanks() const; - bool IsPassiveStackableWithRanks() const; - bool IsMultiSlotAura() const; - bool IsStackableOnOneSlotWithDifferentCasters() const; - bool IsCooldownStartedOnEvent() const; - bool IsDeathPersistent() const; - bool IsRequiringDeadTarget() const; - bool IsAllowingDeadTarget() const; - bool IsGroupBuff() const; - bool CanBeUsedInCombat() const; - bool IsPositive() const; - bool IsPositiveEffect(uint8 effIndex) const; - bool IsChanneled() const; - bool IsMoveAllowedChannel() const; - bool NeedsComboPoints() const; - bool IsNextMeleeSwingSpell() const; - bool IsBreakingStealth() const; - bool IsRangedWeaponSpell() const; - bool IsAutoRepeatRangedSpell() const; - bool HasInitialAggro() const; + bool IsAffectingArea() const; + bool IsTargetingArea() const; + bool NeedsExplicitUnitTarget() const; + bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const; - bool IsAffected(uint32 familyName, flag96 const& familyFlags) const; + bool IsPassive() const; + bool IsRaidMarker() const; + bool IsAutocastable() const; + bool IsStackableWithRanks() const; + bool IsPassiveStackableWithRanks() const; + bool IsMultiSlotAura() const; + bool IsStackableOnOneSlotWithDifferentCasters() const; + bool IsCooldownStartedOnEvent() const; + bool IsDeathPersistent() const; + bool IsRequiringDeadTarget() const; + bool IsAllowingDeadTarget() const; + bool IsGroupBuff() const; + bool CanBeUsedInCombat() const; + bool IsPositive() const; + bool IsPositiveEffect(uint8 effIndex) const; + bool IsChanneled() const; + bool IsMoveAllowedChannel() const; + bool NeedsComboPoints() const; + bool IsNextMeleeSwingSpell() const; + bool IsBreakingStealth() const; + bool IsRangedWeaponSpell() const; + bool IsAutoRepeatRangedSpell() const; + bool HasInitialAggro() const; - bool IsAffectedBySpellMods() const; - bool IsAffectedBySpellMod(SpellModifier const* mod) const; + bool IsAffected(uint32 familyName, flag96 const& familyFlags) const; - bool CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const; - bool CanDispelAura(SpellInfo const* auraSpellInfo) const; + bool IsAffectedBySpellMods() const; + bool IsAffectedBySpellMod(SpellModifier const* mod) const; - bool IsSingleTarget() const; - bool IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const; - bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInfo) const; + bool CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const; + bool CanDispelAura(SpellInfo const* auraSpellInfo) const; - SpellCastResult CheckShapeshift(uint32 form) const; - SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const; - SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const; - SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const; - SpellCastResult CheckVehicle(Unit const* caster) const; - bool CheckTargetCreatureType(Unit const* target) const; + bool IsSingleTarget() const; + bool IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const; + bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInfo) const; - SpellSchoolMask GetSchoolMask() const; - uint32 GetAllEffectsMechanicMask() const; - uint32 GetEffectMechanicMask(uint8 effIndex) const; - uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const; - Mechanics GetEffectMechanic(uint8 effIndex) const; - bool HasAnyEffectMechanic() const; - uint32 GetDispelMask() const; - static uint32 GetDispelMask(DispelType type); - uint32 GetExplicitTargetMask() const; + SpellCastResult CheckShapeshift(uint32 form) const; + SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const; + SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const; + SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const; + SpellCastResult CheckVehicle(Unit const* caster) const; + bool CheckTargetCreatureType(Unit const* target) const; - AuraStateType GetAuraState() const; - SpellSpecificType GetSpellSpecific() const; + SpellSchoolMask GetSchoolMask() const; + uint32 GetAllEffectsMechanicMask() const; + uint32 GetEffectMechanicMask(uint8 effIndex) const; + uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const; + Mechanics GetEffectMechanic(uint8 effIndex) const; + bool HasAnyEffectMechanic() const; + uint32 GetDispelMask() const; + static uint32 GetDispelMask(DispelType type); + uint32 GetExplicitTargetMask() const; - float GetMinRange(bool positive = false) const; - float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; + AuraStateType GetAuraState() const; + SpellSpecificType GetSpellSpecific() const; - int32 GetDuration() const; - int32 GetMaxDuration() const; + float GetMinRange(bool positive = false) const; + float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; - uint32 GetMaxTicks() const; + int32 GetDuration() const; + int32 GetMaxDuration() const; - uint32 CalcCastTime(uint8 level = 0, Spell* spell = NULL) const; - uint32 GetRecoveryTime() const; + uint32 GetMaxTicks() const; - int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; + uint32 CalcCastTime(uint8 level = 0, Spell* spell = NULL) const; + uint32 GetRecoveryTime() const; - bool IsRanked() const; - uint8 GetRank() const; - SpellInfo const* GetFirstRankSpell() const; - SpellInfo const* GetLastRankSpell() const; - SpellInfo const* GetNextRankSpell() const; - SpellInfo const* GetPrevRankSpell() const; - SpellInfo const* GetAuraRankForLevel(uint8 level) const; - bool IsRankOf(SpellInfo const* spellInfo) const; - bool IsDifferentRankOf(SpellInfo const* spellInfo) const; - bool IsHighRankOf(SpellInfo const* spellInfo) const; + int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; - // spell immunities - void ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const; - bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const; - bool CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const; + bool IsRanked() const; + uint8 GetRank() const; + SpellInfo const* GetFirstRankSpell() const; + SpellInfo const* GetLastRankSpell() const; + SpellInfo const* GetNextRankSpell() const; + SpellInfo const* GetPrevRankSpell() const; + SpellInfo const* GetAuraRankForLevel(uint8 level) const; + bool IsRankOf(SpellInfo const* spellInfo) const; + bool IsDifferentRankOf(SpellInfo const* spellInfo) const; + bool IsHighRankOf(SpellInfo const* spellInfo) const; - // loading helpers - void _InitializeExplicitTargetMask(); - bool _IsPositiveEffect(uint8 effIndex, bool deep) const; - bool _IsPositiveSpell() const; - static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); - void _LoadSpellSpecific(); - void _LoadAuraState(); - void _LoadImmunityInfo(); + // spell diminishing returns + DiminishingGroup GetDiminishingReturnsGroupForSpell(bool triggered) const; + DiminishingReturnsType GetDiminishingReturnsGroupType(bool triggered) const; + DiminishingLevels GetDiminishingReturnsMaxLevel(bool triggered) const; + int32 GetDiminishingReturnsLimitDuration(bool triggered) const; - // unloading helpers - void _UnloadImplicitTargetConditionLists(); + // spell immunities + void ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const; + bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const; + bool CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const; -private: - SpellSpecificType _spellSpecific; - AuraStateType _auraState; + private: + // loading helpers + void _InitializeExplicitTargetMask(); + bool _IsPositiveEffect(uint8 effIndex, bool deep) const; + bool _IsPositiveSpell() const; + static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); + void _LoadSpellSpecific(); + void _LoadAuraState(); + void _LoadSpellDiminishInfo(); + void _LoadImmunityInfo(); - ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS]; + // unloading helpers + void _UnloadImplicitTargetConditionLists(); + + SpellSpecificType _spellSpecific; + AuraStateType _auraState; + + SpellDiminishInfo _diminishInfoNonTriggered; + SpellDiminishInfo _diminishInfoTriggered; + + ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS]; }; #endif // _SPELLINFO_H diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index f8f66e017b..c407054182 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -51,305 +51,6 @@ bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) return false; } -DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered) -{ - if (spellproto->IsPositive()) - return DIMINISHING_NONE; - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (spellproto->Effects[i].ApplyAuraName == SPELL_AURA_MOD_TAUNT) - return DIMINISHING_TAUNT; - } - - // Explicit Diminishing Groups - switch (spellproto->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - // Pet charge effects (Infernal Awakening, Demon Charge) - if (spellproto->SpellVisual[0] == 2816 && spellproto->SpellIconID == 15) - return DIMINISHING_CONTROLLED_STUN; - // Frost Tomb - else if (spellproto->Id == 48400) - return DIMINISHING_NONE; - // Gnaw - else if (spellproto->Id == 47481) - return DIMINISHING_CONTROLLED_STUN; - // ToC Icehowl Arctic Breath - else if (spellproto->SpellVisual[0] == 14153) - return DIMINISHING_NONE; - // Black Plague - else if (spellproto->Id == 64155) - return DIMINISHING_NONE; - // Screams of the Dead (King Ymiron) - else if (spellproto->Id == 51750) - return DIMINISHING_NONE; - break; - } - // Event spells - case SPELLFAMILY_UNK1: - return DIMINISHING_NONE; - case SPELLFAMILY_MAGE: - { - // Frostbite - if (spellproto->SpellFamilyFlags[1] & 0x80000000) - return DIMINISHING_ROOT; - // Shattered Barrier - else if (spellproto->SpellVisual[0] == 12297) - return DIMINISHING_ROOT; - // Deep Freeze - else if (spellproto->SpellIconID == 2939 && spellproto->SpellVisual[0] == 9963) - return DIMINISHING_CONTROLLED_STUN; - // Frost Nova / Freeze (Water Elemental) - else if (spellproto->SpellIconID == 193) - return DIMINISHING_CONTROLLED_ROOT; - // Dragon's Breath - else if (spellproto->SpellFamilyFlags[0] & 0x800000) - return DIMINISHING_DRAGONS_BREATH; - break; - } - case SPELLFAMILY_WARRIOR: - { - // Hamstring - limit duration to 10s in PvP - if (spellproto->SpellFamilyFlags[0] & 0x2) - return DIMINISHING_LIMITONLY; - // Charge Stun (own diminishing) - else if (spellproto->SpellFamilyFlags[0] & 0x01000000) - return DIMINISHING_CHARGE; - break; - } - case SPELLFAMILY_WARLOCK: - { - // Curses/etc - if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) - return DIMINISHING_LIMITONLY; - // Seduction - else if (spellproto->SpellFamilyFlags[1] & 0x10000000) - return DIMINISHING_FEAR; - // Sin and Punishment (Priest spell, don't ask) - else if (spellproto->SpellIconID == 1869) - return DIMINISHING_NONE; - break; - } - case SPELLFAMILY_DRUID: - { - // Pounce - if (spellproto->SpellFamilyFlags[0] & 0x20000) - return DIMINISHING_OPENING_STUN; - // Cyclone - else if (spellproto->SpellFamilyFlags[1] & 0x20) - return DIMINISHING_CYCLONE; - // Entangling Roots - // Nature's Grasp - else if (spellproto->SpellFamilyFlags[0] & 0x00000200) - return DIMINISHING_CONTROLLED_ROOT; - // Faerie Fire - else if (spellproto->SpellFamilyFlags[0] & 0x400) - return DIMINISHING_LIMITONLY; - break; - } - case SPELLFAMILY_ROGUE: - { - // Gouge - if (spellproto->SpellFamilyFlags[0] & 0x8) - return DIMINISHING_DISORIENT; - // Blind - else if (spellproto->SpellFamilyFlags[0] & 0x1000000) - return DIMINISHING_FEAR; - // Cheap Shot - else if (spellproto->SpellFamilyFlags[0] & 0x400) - return DIMINISHING_OPENING_STUN; - // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) - else if (spellproto->SpellIconID == 163) - return DIMINISHING_LIMITONLY; - break; - } - case SPELLFAMILY_HUNTER: - { - // Hunter's Mark - if ((spellproto->SpellFamilyFlags[0] & 0x400) && spellproto->SpellIconID == 538) - return DIMINISHING_LIMITONLY; - // Scatter Shot (own diminishing) - else if ((spellproto->SpellFamilyFlags[0] & 0x40000) && spellproto->SpellIconID == 132) - return DIMINISHING_SCATTER_SHOT; - // Entrapment (own diminishing) - else if (spellproto->SpellVisual[0] == 7484 && spellproto->SpellIconID == 20) - return DIMINISHING_ENTRAPMENT; - // Wyvern Sting mechanic is MECHANIC_SLEEP but the diminishing is DIMINISHING_DISORIENT - else if ((spellproto->SpellFamilyFlags[1] & 0x1000) && spellproto->SpellIconID == 1721) - return DIMINISHING_DISORIENT; - // Freezing Arrow - else if (spellproto->SpellFamilyFlags[0] & 0x8) - return DIMINISHING_DISORIENT; - break; - } - case SPELLFAMILY_PALADIN: - { - // Judgement of Justice - limit duration to 10s in PvP - if (spellproto->SpellFamilyFlags[0] & 0x100000) - return DIMINISHING_LIMITONLY; - // Turn Evil - else if ((spellproto->SpellFamilyFlags[1] & 0x804000) && spellproto->SpellIconID == 309) - return DIMINISHING_FEAR; - break; - } - case SPELLFAMILY_SHAMAN: - { - // Storm, Earth and Fire - Earthgrab - if (spellproto->SpellFamilyFlags[2] & 0x4000) - return DIMINISHING_NONE; - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Hungering Cold (no flags) - if (spellproto->SpellIconID == 2797) - return DIMINISHING_DISORIENT; - // Mark of Blood - else if ((spellproto->SpellFamilyFlags[0] & 0x10000000) && spellproto->SpellIconID == 2285) - return DIMINISHING_LIMITONLY; - break; - } - default: - break; - } - - // Lastly - Set diminishing depending on mechanic - uint32 mechanic = spellproto->GetAllEffectsMechanicMask(); - if (mechanic & (1 << MECHANIC_CHARM)) - return DIMINISHING_MIND_CONTROL; - if (mechanic & (1 << MECHANIC_SILENCE)) - return DIMINISHING_SILENCE; - if (mechanic & (1 << MECHANIC_SLEEP)) - return DIMINISHING_SLEEP; - if (mechanic & ((1 << MECHANIC_SAPPED) | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_SHACKLE))) - return DIMINISHING_DISORIENT; - // Mechanic Knockout, except Blast Wave - if (mechanic & (1 << MECHANIC_KNOCKOUT) && spellproto->SpellIconID != 292) - return DIMINISHING_DISORIENT; - if (mechanic & (1 << MECHANIC_DISARM)) - return DIMINISHING_DISARM; - if (mechanic & (1 << MECHANIC_FEAR)) - return DIMINISHING_FEAR; - if (mechanic & (1 << MECHANIC_STUN)) - return triggered ? DIMINISHING_STUN : DIMINISHING_CONTROLLED_STUN; - if (mechanic & (1 << MECHANIC_BANISH)) - return DIMINISHING_BANISH; - if (mechanic & (1 << MECHANIC_ROOT)) - return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; - if (mechanic & (1 << MECHANIC_HORROR)) - return DIMINISHING_HORROR; - - return DIMINISHING_NONE; -} - -DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_TAUNT: - case DIMINISHING_CONTROLLED_STUN: - case DIMINISHING_STUN: - case DIMINISHING_OPENING_STUN: - case DIMINISHING_CYCLONE: - case DIMINISHING_CHARGE: - return DRTYPE_ALL; - case DIMINISHING_LIMITONLY: - case DIMINISHING_NONE: - return DRTYPE_NONE; - default: - return DRTYPE_PLAYER; - } -} - -DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_TAUNT: - return DIMINISHING_LEVEL_TAUNT_IMMUNE; - default: - return DIMINISHING_LEVEL_IMMUNE; - } -} - -int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto) -{ - if (!IsDiminishingReturnsGroupDurationLimited(group)) - return 0; - - // Explicit diminishing duration - switch (spellproto->SpellFamilyName) - { - case SPELLFAMILY_DRUID: - { - // Faerie Fire - limit to 40 seconds in PvP (3.1) - if (spellproto->SpellFamilyFlags[0] & 0x400) - return 40 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_HUNTER: - { - // Wyvern Sting - if (spellproto->SpellFamilyFlags[1] & 0x1000) - return 6 * IN_MILLISECONDS; - // Hunter's Mark - if (spellproto->SpellFamilyFlags[0] & 0x400) - return 30 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_PALADIN: - { - // Repentance - limit to 6 seconds in PvP - if (spellproto->SpellFamilyFlags[0] & 0x4) - return 6 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_WARLOCK: - { - // Banish - limit to 6 seconds in PvP - if (spellproto->SpellFamilyFlags[1] & 0x8000000) - return 6 * IN_MILLISECONDS; - // Curse of Tongues - limit to 12 seconds in PvP - else if (spellproto->SpellFamilyFlags[2] & 0x800) - return 12 * IN_MILLISECONDS; - // Curse of Elements - limit to 120 seconds in PvP - else if (spellproto->SpellFamilyFlags[1] & 0x200) - return 120 * IN_MILLISECONDS; - break; - } - default: - break; - } - - return 8 * IN_MILLISECONDS; -} - -bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_BANISH: - case DIMINISHING_CONTROLLED_STUN: - case DIMINISHING_CONTROLLED_ROOT: - case DIMINISHING_CYCLONE: - case DIMINISHING_DISORIENT: - case DIMINISHING_ENTRAPMENT: - case DIMINISHING_FEAR: - case DIMINISHING_HORROR: - case DIMINISHING_MIND_CONTROL: - case DIMINISHING_OPENING_STUN: - case DIMINISHING_ROOT: - case DIMINISHING_STUN: - case DIMINISHING_SLEEP: - case DIMINISHING_LIMITONLY: - return true; - default: - return false; - } -} - SpellMgr::SpellMgr() { } SpellMgr::~SpellMgr() @@ -3842,6 +3543,21 @@ void SpellMgr::LoadSpellInfoSpellSpecificAndAuraState() TC_LOG_INFO("server.loading", ">> Loaded SpellInfo SpellSpecific and AuraState in %u ms", GetMSTimeDiffToNow(oldMSTime)); } +void SpellMgr::LoadSpellInfoDiminishing() +{ + uint32 oldMSTime = getMSTime(); + + for (SpellInfo* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + spellInfo->_LoadSpellDiminishInfo(); + } + + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo diminishing infos in %u ms", GetMSTimeDiffToNow(oldMSTime)); +} + void SpellMgr::LoadSpellInfoImmunities() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index d94d63095d..da331974c4 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -547,13 +547,6 @@ inline bool IsProfessionOrRidingSkill(uint32 skill) bool IsPartOfSkillLine(uint32 skillId, uint32 spellId); -// spell diminishing returns -TC_GAME_API DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered); -TC_GAME_API DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group); -TC_GAME_API DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group); -TC_GAME_API int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto); -TC_GAME_API bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group); - class TC_GAME_API SpellMgr { // Constructors @@ -686,6 +679,7 @@ class TC_GAME_API SpellMgr void LoadSpellInfoCustomAttributes(); void LoadSpellInfoCorrections(); void LoadSpellInfoSpellSpecificAndAuraState(); + void LoadSpellInfoDiminishing(); void LoadSpellInfoImmunities(); private: diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e7c2c20cee..8c0d0801c9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1509,6 +1509,9 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState..."); sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); + TC_LOG_INFO("server.loading", "Loading SpellInfo diminishing infos..."); + sSpellMgr->LoadSpellInfoDiminishing(); + TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos..."); sSpellMgr->LoadSpellInfoImmunities(); From 44a779ad38358c4e654182f837a58a21223aab59 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 17 Oct 2016 02:19:29 -0300 Subject: [PATCH 022/110] Core/SpellMgr: some changes in default proc generation. Fix an issue of stealth breaking with positive and/or healing spells --- src/server/game/Spells/SpellMgr.cpp | 142 ++++++++++++++-------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c407054182..aa3ca41f43 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1462,71 +1462,6 @@ void SpellMgr::LoadSpellGroupStackRules() TC_LOG_INFO("server.loading", ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -// Used for prepare can/can't triggr aura -static bool InitTriggerAuraData(); -// Define can trigger auras -static bool isTriggerAura[TOTAL_AURAS]; -// Triggered always, even from triggered spells -static bool isAlwaysTriggeredAura[TOTAL_AURAS]; -// Prepare lists -static bool procPrepared = InitTriggerAuraData(); - -// List of auras that CAN be trigger but may not exist in spell_proc_event -// in most case need for drop charges -// in some types of aura need do additional check -// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic -bool InitTriggerAuraData() -{ - for (uint16 i = 0; i < TOTAL_AURAS; ++i) - { - isTriggerAura[i] = false; - isAlwaysTriggeredAura[i] = false; - } - isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting. Remove? - isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets" - isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus - isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; - isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; - isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; - isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_ROOT] = true; - isTriggerAura[SPELL_AURA_TRANSFORM] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; - isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; - isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; - isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; - isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; - isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; - isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; - - isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; - isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; - isAlwaysTriggeredAura[SPELL_AURA_SPELL_MAGNET] = true; - isAlwaysTriggeredAura[SPELL_AURA_SCHOOL_ABSORB] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; - - return true; -} - void SpellMgr::LoadSpellProcs() { uint32 oldMSTime = getMSTime(); @@ -1655,6 +1590,71 @@ void SpellMgr::LoadSpellProcs() TC_LOG_INFO("server.loading", ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + // Define can trigger auras + bool isTriggerAura[TOTAL_AURAS]; + // Triggered always, even from triggered spells + bool isAlwaysTriggeredAura[TOTAL_AURAS]; + // SpellTypeMask to add to the proc + uint32 spellTypeMask[TOTAL_AURAS]; + + // List of auras that CAN trigger but may not exist in spell_proc + // in most cases needed to drop charges + + // some aura types need additional checks (eg SPELL_AURA_MECHANIC_IMMUNITY needs mechanic check) + // see AuraEffect::CheckEffectProc + for (uint16 i = 0; i < TOTAL_AURAS; ++i) + { + isTriggerAura[i] = false; + isAlwaysTriggeredAura[i] = false; + spellTypeMask[i] = PROC_SPELL_TYPE_MASK_ALL; + } + + isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting, but there are some exceptions (ie 12311) + isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets" + isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus + isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; + isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; + isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_ROOT] = true; + isTriggerAura[SPELL_AURA_TRANSFORM] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; + isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; + isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; + isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; + isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; + isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; + isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; + + isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; + isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; + + spellTypeMask[SPELL_AURA_MOD_STEALTH] = PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL; + spellTypeMask[SPELL_AURA_MOD_CONFUSE] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_FEAR] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_ROOT] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_STUN] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_TRANSFORM] = PROC_SPELL_TYPE_DAMAGE; + // This generates default procs to retain compatibility with previous proc system TC_LOG_INFO("server.loading", "Generating spell proc data from SpellMap..."); count = 0; @@ -1668,7 +1668,8 @@ void SpellMgr::LoadSpellProcs() if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) continue; - bool found = false, addTriggerFlag = false; + bool addTriggerFlag = false; + uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!spellInfo->Effects[i].IsEffect()) @@ -1681,14 +1682,13 @@ void SpellMgr::LoadSpellProcs() if (!isTriggerAura[auraName]) continue; - found = true; - - if (!addTriggerFlag && isAlwaysTriggeredAura[auraName]) + procSpellTypeMask |= spellTypeMask[auraName]; + if (isAlwaysTriggeredAura[auraName]) addTriggerFlag = true; break; } - if (!found) + if (!procSpellTypeMask) continue; if (!spellInfo->ProcFlags) @@ -1705,7 +1705,7 @@ void SpellMgr::LoadSpellProcs() if (procEntry.SpellFamilyMask) procEntry.SpellFamilyName = spellInfo->SpellFamilyName; - procEntry.SpellTypeMask = PROC_SPELL_TYPE_MASK_ALL; + procEntry.SpellTypeMask = procSpellTypeMask; procEntry.SpellPhaseMask = PROC_SPELL_PHASE_HIT; procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent From b3eb7c121fa2bec6e32d8785da12c75c8f98e370 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 17 Oct 2016 04:55:44 -0300 Subject: [PATCH 023/110] Core/Unit: Change aura proc pair container to vector --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Entities/Unit/Unit.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 70b991fa2c..4c09461667 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10658,7 +10658,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg if (uint8 procEffectMask = aurApp->GetBase()->IsProcTriggeredOnEvent(aurApp, eventInfo, now)) { aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now); - aurasTriggeringProc.emplace_back(std::make_pair(procEffectMask, aurApp)); + aurasTriggeringProc.emplace_back(procEffectMask, aurApp); } } } @@ -10670,7 +10670,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg if (uint8 procEffectMask = itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) { itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now); - aurasTriggeringProc.emplace_back(std::make_pair(procEffectMask, itr->second)); + aurasTriggeringProc.emplace_back(procEffectMask, itr->second); } } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index df2c17e437..9618afbc96 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1293,7 +1293,7 @@ class TC_GAME_API Unit : public WorldObject typedef std::list AuraApplicationList; typedef std::array Diminishing; - typedef std::deque> AuraApplicationProcContainer; + typedef std::vector> AuraApplicationProcContainer; typedef std::map VisibleAuraMap; From 21ac6296befc9345e219b537a4e7ed1775c682e9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 25 Oct 2016 22:10:55 -0300 Subject: [PATCH 024/110] Core/Spells: moved handling of SPELL_ATTR0_CU_DONT_BREAK_STEALTH inside proc system. Fixes additional issues with spells that shouldn't be breaking stealth and had this attribute --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 13 +++++-------- src/server/game/Spells/Auras/SpellAuras.cpp | 8 ++++++++ src/server/game/Spells/Spell.cpp | 5 ----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 7917fb8923..4f4a3c3df2 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1085,15 +1085,12 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn return false; // Spell own damage at apply won't break CC - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo && spellInfo == GetSpellInfo()) { - if (spellInfo == GetSpellInfo()) - { - Aura* aura = GetBase(); - // called from spellcast, should not have ticked yet - if (aura->GetDuration() == aura->GetMaxDuration()) - return false; - } + Aura* aura = GetBase(); + // called from spellcast, should not have ticked yet + if (aura->GetDuration() == aura->GetMaxDuration()) + return false; } break; } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 9be3bb4abe..b675e6c5a2 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1756,6 +1756,14 @@ uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& event if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) return 0; + // check don't break stealth attr present + if (m_spellInfo->HasAura(SPELL_AURA_MOD_STEALTH)) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) + return 0; + } + // check if aura can proc when spell is triggered (exception for hunter auto shot & wands) if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) if (Spell const* spell = eventInfo.GetProcSpell()) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 331aaab882..35b7a44e94 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2580,12 +2580,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA return SPELL_MISS_EVADE; if (m_caster->_IsValidAttackTarget(unit, m_spellInfo)) - { unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); - - if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) - unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - } else if (m_caster->IsFriendlyTo(unit)) { // for delayed spells ignore negative spells (after duel end) for friendly targets From 8bf21ad927ba16b1b40ce2636d87c2cfc94ff2a9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 25 Oct 2016 22:52:38 -0300 Subject: [PATCH 025/110] Core/Unit: fix chain cc's not being diminished properly Logic fail in 9b0fa51022fba3d5ece96dd0ac8399be01ea5b0f (now diminishing info is always initialized) --- src/server/game/Entities/Unit/Unit.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4c09461667..16d9f85159 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9451,9 +9451,6 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) if (!diminish.hitCount) return DIMINISHING_LEVEL_1; - if (!diminish.hitTime) - return DIMINISHING_LEVEL_1; - // If last spell was cast more than 15 seconds ago - reset the count. if (!diminish.stack && GetMSTimeDiffToNow(diminish.hitTime) > 15000) { From 3d9c4fd3fc84a24ecc2d15e9ad3f68d47614b1ee Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 26 Oct 2016 02:16:11 -0300 Subject: [PATCH 026/110] Core/Spells: use DamageInfo struct to calc spell absorbs and resists, and use calculated proc hitMask on aura ticks --- src/server/game/Entities/Player/Player.cpp | 21 ++- src/server/game/Entities/Unit/Unit.cpp | 127 ++++++++---------- src/server/game/Entities/Unit/Unit.h | 6 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 34 ++--- src/server/game/Spells/SpellEffects.cpp | 16 ++- src/server/scripts/Commands/cs_misc.cpp | 19 +-- 6 files changed, 114 insertions(+), 109 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f9e0e58b24..7d3def9079 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -943,12 +943,21 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) // Absorb, resist some environmental damage type uint32 absorb = 0; uint32 resist = 0; - if (type == DAMAGE_LAVA) - CalcAbsorbResist(this, SPELL_SCHOOL_MASK_FIRE, DIRECT_DAMAGE, damage, &absorb, &resist); - else if (type == DAMAGE_SLIME) - CalcAbsorbResist(this, SPELL_SCHOOL_MASK_NATURE, DIRECT_DAMAGE, damage, &absorb, &resist); - - damage -= absorb + resist; + switch (type) + { + case DAMAGE_LAVA: + case DAMAGE_SLIME: + { + DamageInfo dmgInfo(this, this, damage, nullptr, type == DAMAGE_LAVA ? SPELL_SCHOOL_MASK_FIRE : SPELL_SCHOOL_MASK_NATURE, DIRECT_DAMAGE, BASE_ATTACK); + CalcAbsorbResist(dmgInfo); + absorb = dmgInfo.GetAbsorb(); + resist = dmgInfo.GetResist(); + damage = dmgInfo.GetDamage(); + break; + } + default: + break; + } DealDamageMods(this, damage, &absorb); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 16d9f85159..f11626ef00 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -644,7 +644,7 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons || HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM, excludeAura)); } -void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) +void Unit::DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) const { if (!victim || !victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks())) { @@ -1151,15 +1151,13 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage); // Calculate absorb resist - if (damage > 0) - { - CalcAbsorbResist(victim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo); - damage -= damageInfo->absorb + damageInfo->resist; - } - else + if (damage < 0) damage = 0; damageInfo->damage = damage; + DamageInfo dmgInfo(*damageInfo, SPELL_DIRECT_DAMAGE, BASE_ATTACK, PROC_HIT_NONE); + CalcAbsorbResist(dmgInfo); + damageInfo->damage = dmgInfo.GetDamage(); } void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) @@ -1351,15 +1349,17 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam { damageInfo->procVictim |= PROC_FLAG_TAKEN_DAMAGE; // Calculate absorb & resists - CalcAbsorbResist(damageInfo->target, SpellSchoolMask(damageInfo->damageSchoolMask), DIRECT_DAMAGE, damageInfo->damage, &damageInfo->absorb, &damageInfo->resist); + DamageInfo dmgInfo(*damageInfo); + CalcAbsorbResist(dmgInfo); + damageInfo->absorb = dmgInfo.GetAbsorb(); + damageInfo->resist = dmgInfo.GetResist(); + damageInfo->damage = dmgInfo.GetDamage(); if (damageInfo->absorb) damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); if (damageInfo->resist) damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); - - damageInfo->damage -= damageInfo->absorb + damageInfo->resist; } else // Impossible get negative result but.... damageInfo->damage = 0; @@ -1665,57 +1665,49 @@ uint32 Unit::CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, Spell return resistance * 10; } -void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo /*= NULL*/) +void Unit::CalcAbsorbResist(DamageInfo& damageInfo) { - if (!victim || !victim->IsAlive() || !damage) + if (!damageInfo.GetVictim() || !damageInfo.GetVictim()->IsAlive() || !damageInfo.GetDamage()) return; - DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype, BASE_ATTACK); - - uint32 spellResistance = CalcSpellResistance(victim, schoolMask, spellInfo); - dmgInfo.ResistDamage(CalculatePct(damage, spellResistance)); + uint32 spellResistance = CalcSpellResistance(damageInfo.GetVictim(), damageInfo.GetSchoolMask(), damageInfo.GetSpellInfo()); + damageInfo.ResistDamage(CalculatePct(damageInfo.GetDamage(), spellResistance)); // Ignore Absorption Auras - float auraAbsorbMod = 0; - AuraEffectList const& AbsIgnoreAurasA = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL); - for (AuraEffectList::const_iterator itr = AbsIgnoreAurasA.begin(); itr != AbsIgnoreAurasA.end(); ++itr) + float auraAbsorbMod(GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL, damageInfo.GetSchoolMask())); + + AuraEffectList const& abilityAbsorbAuras = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL); + for (AuraEffect const* aurEff : abilityAbsorbAuras) { - if (!((*itr)->GetMiscValue() & schoolMask)) + if (!(aurEff->GetMiscValue() & damageInfo.GetSchoolMask())) continue; - if ((*itr)->GetAmount() > auraAbsorbMod) - auraAbsorbMod = float((*itr)->GetAmount()); - } - - AuraEffectList const& AbsIgnoreAurasB = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL); - for (AuraEffectList::const_iterator itr = AbsIgnoreAurasB.begin(); itr != AbsIgnoreAurasB.end(); ++itr) - { - if (!((*itr)->GetMiscValue() & schoolMask)) + if (!aurEff->IsAffectingSpell(damageInfo.GetSpellInfo())) continue; - if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectingSpell(spellInfo)) - auraAbsorbMod = float((*itr)->GetAmount()); + if ((aurEff->GetAmount() > auraAbsorbMod)) + auraAbsorbMod = float(aurEff->GetAmount()); } RoundToInterval(auraAbsorbMod, 0.0f, 100.0f); - int32 absorbIgnoringDamage = CalculatePct(dmgInfo.GetDamage(), auraAbsorbMod); - dmgInfo.ModifyDamage(-absorbIgnoringDamage); + int32 absorbIgnoringDamage = CalculatePct(damageInfo.GetDamage(), auraAbsorbMod); + damageInfo.ModifyDamage(-absorbIgnoringDamage); // We're going to call functions which can modify content of the list during iteration over it's elements // Let's copy the list so we can prevent iterator invalidation - AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB)); + AuraEffectList vSchoolAbsorbCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB)); vSchoolAbsorbCopy.sort(Trinity::AbsorbAuraOrderPred()); // absorb without mana cost - for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr) + for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.GetDamage() > 0); ++itr) { AuraEffect* absorbAurEff = *itr; // Check if aura was removed during iteration - we don't need to work on such auras - AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(victim->GetGUID()); + AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID()); if (!aurApp) continue; - if (!(absorbAurEff->GetMiscValue() & schoolMask)) + if (!(absorbAurEff->GetMiscValue() & damageInfo.GetSchoolMask())) continue; // get amount which can be still absorbed by the aura @@ -1728,19 +1720,19 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe bool defaultPrevented = false; - absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented); + absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb, defaultPrevented); currentAbsorb = tempAbsorb; if (defaultPrevented) continue; // absorb must be smaller than the damage itself - currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage())); + currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(damageInfo.GetDamage())); - dmgInfo.AbsorbDamage(currentAbsorb); + damageInfo.AbsorbDamage(currentAbsorb); tempAbsorb = currentAbsorb; - absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb); + absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb); // Check if our aura is using amount to count damage if (absorbAurEff->GetAmount() >= 0) @@ -1754,16 +1746,16 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe } // absorb by mana cost - AuraEffectList vManaShieldCopy(victim->GetAuraEffectsByType(SPELL_AURA_MANA_SHIELD)); - for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr) + AuraEffectList vManaShieldCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_MANA_SHIELD)); + for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.GetDamage() > 0); ++itr) { AuraEffect* absorbAurEff = *itr; // Check if aura was removed during iteration - we don't need to work on such auras - AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(victim->GetGUID()); + AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID()); if (!aurApp) continue; // check damage school mask - if (!(absorbAurEff->GetMiscValue() & schoolMask)) + if (!(absorbAurEff->GetMiscValue() & damageInfo.GetSchoolMask())) continue; // get amount which can be still absorbed by the aura @@ -1776,14 +1768,14 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe bool defaultPrevented = false; - absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented); + absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb, defaultPrevented); currentAbsorb = tempAbsorb; if (defaultPrevented) continue; // absorb must be smaller than the damage itself - currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage())); + currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(damageInfo.GetDamage())); int32 manaReduction = currentAbsorb; @@ -1791,15 +1783,15 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (float manaMultiplier = absorbAurEff->GetSpellInfo()->Effects[absorbAurEff->GetEffIndex()].CalcValueMultiplier(absorbAurEff->GetCaster())) manaReduction = int32(float(manaReduction) * manaMultiplier); - int32 manaTaken = -victim->ModifyPower(POWER_MANA, -manaReduction); + int32 manaTaken = -damageInfo.GetVictim()->ModifyPower(POWER_MANA, -manaReduction); // take case when mana has ended up into account currentAbsorb = currentAbsorb ? int32(float(currentAbsorb) * (float(manaTaken) / float(manaReduction))) : 0; - dmgInfo.AbsorbDamage(currentAbsorb); + damageInfo.AbsorbDamage(currentAbsorb); tempAbsorb = currentAbsorb; - absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb); + absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb); // Check if our aura is using amount to count damage if (absorbAurEff->GetAmount() >= 0) @@ -1810,66 +1802,61 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe } } - dmgInfo.ModifyDamage(absorbIgnoringDamage); + damageInfo.ModifyDamage(absorbIgnoringDamage); // split damage auras - only when not damaging self - if (victim != this) + if (damageInfo.GetVictim() != this) { // We're going to call functions which can modify content of the list during iteration over it's elements // Let's copy the list so we can prevent iterator invalidation - - AuraEffectList vSplitDamagePctCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_PCT)); - for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && dmgInfo.GetDamage() > 0; ++itr) + AuraEffectList vSplitDamagePctCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_PCT)); + for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.GetDamage() > 0; ++itr) { // Check if aura was removed during iteration - we don't need to work on such auras - AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(victim->GetGUID()); + AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID()); if (!aurApp) continue; // check damage school mask - if (!((*itr)->GetMiscValue() & schoolMask)) + if (!((*itr)->GetMiscValue() & damageInfo.GetSchoolMask())) continue; // Damage can be splitted only if aura has an alive caster Unit* caster = (*itr)->GetCaster(); - if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->IsAlive()) + if (!caster || (caster == damageInfo.GetVictim()) || !caster->IsInWorld() || !caster->IsAlive()) continue; - uint32 splitDamage = CalculatePct(dmgInfo.GetDamage(), (*itr)->GetAmount()); + uint32 splitDamage = CalculatePct(damageInfo.GetDamage(), (*itr)->GetAmount()); - (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, dmgInfo, splitDamage); + (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage); // absorb must be smaller than the damage itself - splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(dmgInfo.GetDamage())); + splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(damageInfo.GetDamage())); - dmgInfo.AbsorbDamage(splitDamage); + damageInfo.AbsorbDamage(splitDamage); // check if caster is immune to damage - if (caster->IsImmunedToDamage(schoolMask)) + if (caster->IsImmunedToDamage(damageInfo.GetSchoolMask())) { - victim->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE); + damageInfo.GetVictim()->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE); continue; } uint32 split_absorb = 0; DealDamageMods(caster, splitDamage, &split_absorb); - SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitDamage, schoolMask, split_absorb, 0, false, 0, false); + SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitDamage, damageInfo.GetSchoolMask(), split_absorb, 0, false, 0, false); CleanDamage cleanDamage = CleanDamage(splitDamage, 0, BASE_ATTACK, MELEE_HIT_NORMAL); - DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false); + DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, damageInfo.GetSchoolMask(), (*itr)->GetSpellInfo(), false); // break 'Fear' and similar auras - DamageInfo damageInfo(caster, this, splitDamage, (*itr)->GetSpellInfo(), schoolMask, DIRECT_DAMAGE, BASE_ATTACK); ProcSkillsAndAuras(caster, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, PROC_HIT_NONE, nullptr, &damageInfo, nullptr); } } - - *resist = dmgInfo.GetResist(); - *absorb = dmgInfo.GetAbsorb(); } -void Unit::CalcHealAbsorb(HealInfo& healInfo) +void Unit::CalcHealAbsorb(HealInfo& healInfo) const { if (!healInfo.GetHeal()) return; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 9618afbc96..a5410a3101 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1470,7 +1470,7 @@ class TC_GAME_API Unit : public WorldObject void PlayOneShotAnimKitId(uint16 animKitId); uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } - void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); + void DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) const; uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); void Kill(Unit* victim, bool durabilityLoss = true); void KillSelf(bool durabilityLoss = true) { Kill(this, durabilityLoss); } @@ -2058,8 +2058,8 @@ class TC_GAME_API Unit : public WorldObject static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS); uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK); uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const; - void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL); - void CalcHealAbsorb(HealInfo& healInfo); + void CalcAbsorbResist(DamageInfo& damageInfo); + void CalcHealAbsorb(HealInfo& healInfo) const; void UpdateSpeed(UnitMoveType mtype); float GetSpeed(UnitMoveType mtype) const; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4f4a3c3df2..80dadf927f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5514,8 +5514,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const } } - uint32 absorb = 0; - uint32 resist = 0; CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); // AOE spells are not affected by the new periodic system. @@ -5601,13 +5599,16 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target); int32 dmg = damage; - if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE)) caster->ApplyResilience(target, &dmg); damage = dmg; - caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo()); + DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); + caster->CalcAbsorbResist(damageInfo); + damage = damageInfo.GetDamage(); + uint32 absorb = damageInfo.GetAbsorb(); + uint32 resist = damageInfo.GetResist(); TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s attacked %s for %u dmg inflicted by %u absorb is %u", GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId(), absorb); @@ -5616,8 +5617,10 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; - damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); + uint32 hitMask = damageInfo.GetHitMask(); + if (!hitMask) + hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; + if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; @@ -5628,7 +5631,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); - DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); @@ -5649,8 +5651,6 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE) return; - uint32 absorb = 0; - uint32 resist = 0; CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); bool isAreaAura = m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA); @@ -5696,26 +5696,30 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c caster->ApplyResilience(target, &dmg); damage = dmg; - caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, m_spellInfo); + DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); + caster->CalcAbsorbResist(damageInfo); + uint32 absorb = damageInfo.GetAbsorb(); + uint32 resist = damageInfo.GetResist(); TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s health leech of %s for %u dmg inflicted by %u abs is %u", GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId(), absorb); + // SendSpellNonMeleeDamageLog expects non-absorbed/non-resisted damage caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit); + damage = damageInfo.GetDamage(); // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; - uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; - damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); + uint32 hitMask = damageInfo.GetHitMask(); + if (!hitMask) + hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; + if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; if (caster->IsAlive()) - { - DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK); caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); - } int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); if (caster->IsAlive()) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a03743acba..7797176808 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -315,14 +315,18 @@ void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/) if (!unitTarget || !unitTarget->IsAlive()) return; - uint32 absorb = 0; - uint32 resist = 0; - - m_caster->CalcAbsorbResist(unitTarget, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist, m_spellInfo); - - m_caster->SendSpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_spellInfo->GetSchoolMask(), absorb, resist, false, 0, false); + // CalcAbsorbResist already in Player::EnvironmentalDamage if (unitTarget->GetTypeId() == TYPEID_PLAYER) unitTarget->ToPlayer()->EnvironmentalDamage(DAMAGE_FIRE, damage); + else + { + DamageInfo damageInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK); + m_caster->CalcAbsorbResist(damageInfo); + + uint32 absorb = damageInfo.GetAbsorb(); + uint32 resist = damageInfo.GetResist(); + m_caster->SendSpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_spellInfo->GetSchoolMask(), absorb, resist, false, 0, false); + } } void Spell::EffectSchoolDMG(SpellEffIndex effIndex) diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 89d26cc283..f4e7cb3eaf 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2335,19 +2335,20 @@ public: // melee damage by specific school if (!spellStr) { - uint32 absorb = 0; - uint32 resist = 0; + Player* attacker = handler->GetSession()->GetPlayer(); + DamageInfo dmgInfo(attacker, target, damage, nullptr, schoolmask, SPELL_DIRECT_DAMAGE, BASE_ATTACK); + attacker->CalcAbsorbResist(dmgInfo); - handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); - - if (damage <= absorb + resist) + if (!dmgInfo.GetDamage()) return true; - damage -= absorb + resist; + damage = dmgInfo.GetDamage(); - handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb); - handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); - handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); + uint32 absorb = dmgInfo.GetAbsorb(); + uint32 resist = dmgInfo.GetResist(); + attacker->DealDamageMods(target, damage, &absorb); + attacker->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, schoolmask, nullptr, false); + attacker->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 0, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); return true; } From 759e19cee73d2441fb161ebe66f864cda1c2681d Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 26 Oct 2016 02:25:23 -0300 Subject: [PATCH 027/110] Core/Unit: CalculateMeleeDamage should use unmodified damage to compute HitInfo d3a71a83387f757f87c7d27e1054498c8cc49c8f follow-up --- src/server/game/Entities/Unit/Unit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f11626ef00..1e707f683e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1353,13 +1353,14 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam CalcAbsorbResist(dmgInfo); damageInfo->absorb = dmgInfo.GetAbsorb(); damageInfo->resist = dmgInfo.GetResist(); - damageInfo->damage = dmgInfo.GetDamage(); if (damageInfo->absorb) damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); if (damageInfo->resist) damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); + + damageInfo->damage = dmgInfo.GetDamage(); } else // Impossible get negative result but.... damageInfo->damage = 0; @@ -1665,7 +1666,7 @@ uint32 Unit::CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, Spell return resistance * 10; } -void Unit::CalcAbsorbResist(DamageInfo& damageInfo) +void Unit::CalcAbsorbResist(DamageInfo& damageInfo) { if (!damageInfo.GetVictim() || !damageInfo.GetVictim()->IsAlive() || !damageInfo.GetDamage()) return; From 60b390a3e8223ab5cafbda9f76e2265f7a3ecb71 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 26 Oct 2016 22:55:56 -0300 Subject: [PATCH 028/110] Core/Auras: allow damage from periodics to trigger auras if they're not fully resisted/absorbed --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 80dadf927f..dac9df5416 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5618,11 +5618,11 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; uint32 hitMask = damageInfo.GetHitMask(); - if (!hitMask) - hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; - if (damage) + { + hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; procVictim |= PROC_FLAG_TAKEN_DAMAGE; + } int32 overkill = damage - target->GetHealth(); if (overkill < 0) @@ -5712,11 +5712,11 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; uint32 hitMask = damageInfo.GetHitMask(); - if (!hitMask) - hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; - if (damage) + { + hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL; procVictim |= PROC_FLAG_TAKEN_DAMAGE; + } if (caster->IsAlive()) caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); From c131f68f6329c7a581c3c47556ab9fb9b4592c0f Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 28 Oct 2016 01:17:06 -0300 Subject: [PATCH 029/110] Core/Unit: allow pets and totems to drop mod charges in owner auras. Needed for Cobra Strikes (re)implementation --- src/server/game/Entities/Unit/Unit.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1e707f683e..ff53b7241d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10675,6 +10675,21 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin { AuraApplicationProcContainer myAurasTriggeringProc; GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, nullptr, myProcEventInfo); + + // needed for example for Cobra Strikes, pet does the attack, but aura is on owner + if (Player* modOwner = GetSpellModOwner()) + { + if (modOwner != this && spell) + { + AuraApplicationList modAuras; + for (auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr) + { + if (spell->m_appliedMods.count(itr->second->GetBase()) != 0) + modAuras.push_back(itr->second); + } + modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo); + } + } TriggerAurasProcOnEvent(myProcEventInfo, myAurasTriggeringProc); } From d1c915e4e191ae25afdf75c39f816f72accba72c Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 28 Oct 2016 03:14:09 -0300 Subject: [PATCH 030/110] Core/Spells: require phaseMask set for trap activation procs --- src/server/game/Spells/SpellMgr.cpp | 2 +- src/server/game/Spells/SpellMgr.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index aa3ca41f43..dde0f012d8 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -537,7 +537,7 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE return false; // check spell family name/flags (if set) for spells - if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION)) + if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK)) { if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo()) if (!eventSpellInfo->IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask)) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index da331974c4..b3b1e930a9 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -163,9 +163,8 @@ enum ProcFlags | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS - | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, - - SPELL_CAST_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION, + | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG + | PROC_FLAG_DONE_TRAP_ACTIVATION, PERIODIC_PROC_FLAG_MASK = PROC_FLAG_DONE_PERIODIC | PROC_FLAG_TAKEN_PERIODIC, @@ -173,7 +172,8 @@ enum ProcFlags | PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG - | PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK, + | PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_TRAP_ACTIVATION + | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK, TAKEN_HIT_PROC_FLAG_MASK = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS From e2fb7a8218146b81102ac0051bc8dd1a32e4f846 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 29 Oct 2016 19:07:26 -0300 Subject: [PATCH 031/110] Core/Unit: send original caster in heal packet log --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ff53b7241d..49bdb502e7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6499,7 +6499,7 @@ void Unit::SendHealSpellLog(HealInfo& healInfo, bool critical /*= false*/) // we guess size WorldPacket data(SMSG_SPELLHEALLOG, 8 + 8 + 4 + 4 + 4 + 4 + 1 + 1); data << healInfo.GetTarget()->GetPackGUID(); - data << GetPackGUID(); + data << healInfo.GetHealer()->GetPackGUID(); data << uint32(healInfo.GetSpellInfo()->Id); data << uint32(healInfo.GetHeal()); data << uint32(healInfo.GetHeal() - healInfo.GetEffectiveHeal()); From c9101f6707bfe55f61bffec079476ed0212d9feb Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 30 Oct 2016 00:16:10 -0300 Subject: [PATCH 032/110] Core/Spells: workaround stealth interaction with Death and Decay and GameObject casts --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- src/server/game/Spells/Spell.cpp | 21 +++++++++++++++------ src/server/game/Spells/SpellMgr.cpp | 5 +++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 49bdb502e7..0bca67858a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8402,7 +8402,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo return false; // can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player - if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target))))) + // skip visibility check for GO casts, needs removal when go cast is implemented + if (GetEntry() != WORLD_TRIGGER && (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target))))) return false; // can't attack dead diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 35b7a44e94..8858626cbd 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2009,13 +2009,18 @@ void Spell::prepareDataForTriggerSystem() // Hunter trap spells - activation proc for Lock and Load, Entrapment and Misdirection if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && - (m_spellInfo->SpellFamilyFlags[0] & 0x18 || // Freezing and Frost Trap, Freezing Arrow - m_spellInfo->Id == 57879 || // Snake Trap - done this way to avoid double proc - m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap + (m_spellInfo->SpellFamilyFlags[0] & 0x18 || // Freezing and Frost Trap, Freezing Arrow + m_spellInfo->Id == 57879 || // Snake Trap - done this way to avoid double proc + m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap { m_procAttacker |= PROC_FLAG_DONE_TRAP_ACTIVATION; } + // also fill up other flags (DoAllEffectOnTarget only fills up flag if both are not set) + m_procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; + m_procVictim |= PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG; + } + // Hellfire Effect - trigger as DOT if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[0] & 0x00000040) { @@ -2069,7 +2074,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= return; if (checkIfValid) - if (m_spellInfo->CheckTarget(m_caster, target, implicit) != SPELL_CAST_OK) + if (m_spellInfo->CheckTarget(m_caster, target, implicit || m_caster->GetEntry() == WORLD_TRIGGER) != SPELL_CAST_OK) // skip stealth checks for GO casts return; // Check for effect immune skip if immuned @@ -5086,14 +5091,18 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (!(m_spellInfo->IsPassive() && (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster))) { // Check explicit target for m_originalCaster - todo: get rid of such workarounds - SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(m_originalCaster ? m_originalCaster : m_caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget()); + Unit* caster = m_caster; + if (m_originalCaster && m_caster->GetEntry() != WORLD_TRIGGER) // Do a simplified check for gameobject casts + caster = m_originalCaster; + + SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget()); if (castResult != SPELL_CAST_OK) return castResult; } if (Unit* target = m_targets.GetUnitTarget()) { - SpellCastResult castResult = m_spellInfo->CheckTarget(m_caster, target, false); + SpellCastResult castResult = m_spellInfo->CheckTarget(m_caster, target, m_caster->GetEntry() == WORLD_TRIGGER); // skip stealth checks for GO casts if (castResult != SPELL_CAST_OK) return castResult; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index dde0f012d8..ee02a198ed 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1643,6 +1643,8 @@ void SpellMgr::LoadSpellProcs() isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_CONFUSE] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; @@ -2840,6 +2842,9 @@ void SpellMgr::LoadSpellInfoCorrections() case 49611: // Magic Suppression - DK spellInfo->ProcCharges = 0; break; + case 52212: // Death and Decay + spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE; + break; case 37408: // Oscillation Field spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; From f5c1440d5058e080506ad7fe29e2d71963347608 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 01:21:38 +0100 Subject: [PATCH 033/110] Static analysis checks --- src/server/game/Spells/SpellMgr.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ee02a198ed..b4a4000662 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -542,11 +542,8 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo()) if (!eventSpellInfo->IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask)) return false; - } - // check spell type mask (if set) - if (eventInfo.GetTypeMask() & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)) - { + // check spell type mask (if set) if (procEntry.SpellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.SpellTypeMask)) return false; } From 030224ff32ce89624210f2180d85fd175f8b5236 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 5 Nov 2016 01:52:38 -0300 Subject: [PATCH 034/110] Core/Spells: do not add PROC_HIT_NORMAL/PROC_HIT_CRITICAL flags if damage is fully nullified - Aka: full absorbs/full resists/full blocks/immune --- src/server/game/Entities/Unit/Unit.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0bca67858a..c48fb8f959 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -113,7 +113,7 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo) break; } - if (m_absorb) + if (dmgInfo.HitInfo & (HITINFO_PARTIAL_ABSORB | HITINFO_FULL_ABSORB)) m_hitMask |= PROC_HIT_ABSORB; if (dmgInfo.HitInfo & HITINFO_FULL_RESIST) @@ -122,6 +122,8 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo) if (m_block) m_hitMask |= PROC_HIT_BLOCK; + bool const damageNullified = (dmgInfo.HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 || + (m_hitMask & (PROC_HIT_IMMUNE | PROC_HIT_FULL_BLOCK)) != 0; switch (dmgInfo.hitOutCome) { case MELEE_HIT_MISS: @@ -139,10 +141,12 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo) case MELEE_HIT_CRUSHING: case MELEE_HIT_GLANCING: case MELEE_HIT_NORMAL: - m_hitMask |= PROC_HIT_NORMAL; + if (!damageNullified) + m_hitMask |= PROC_HIT_NORMAL; break; case MELEE_HIT_CRIT: - m_hitMask |= PROC_HIT_CRITICAL; + if (!damageNullified) + m_hitMask |= PROC_HIT_CRITICAL; break; default: break; @@ -180,7 +184,10 @@ void DamageInfo::ResistDamage(uint32 amount) m_resist += amount; m_damage -= amount; if (!m_damage) + { m_hitMask |= PROC_HIT_FULL_RESIST; + m_hitMask &= ~(PROC_HIT_NORMAL | PROC_HIT_CRITICAL); + } } void DamageInfo::BlockDamage(uint32 amount) @@ -190,7 +197,10 @@ void DamageInfo::BlockDamage(uint32 amount) m_damage -= amount; m_hitMask |= PROC_HIT_BLOCK; if (!m_damage) + { m_hitMask |= PROC_HIT_FULL_BLOCK; + m_hitMask &= ~(PROC_HIT_NORMAL | PROC_HIT_CRITICAL); + } } uint32 DamageInfo::GetHitMask() const From 04b562418e1690ea68b4bae996cb6aecce6c20cd Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 7 Nov 2016 20:36:23 -0300 Subject: [PATCH 035/110] Core/Spell: make a distinction between triggered flags with debugging purposes, and don't use them when casting triggered spells --- src/server/game/Entities/Unit/Unit.h | 8 +++++++- src/server/scripts/Commands/cs_cast.cpp | 15 +++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index a5410a3101..0e5d6012fa 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -450,13 +450,19 @@ enum TriggerCastFlags TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any) TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state + // reuse = 0x00001000, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions + // reuse = 0x00004000, + // reuse = 0x00008000, TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting) TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions + TRIGGERED_FULL_MASK = 0x0007FFFF, //! Used when doing CastSpell with triggered == true + + // debug flags (used with .cast triggered commands) TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks) - TRIGGERED_FULL_MASK = 0xFFFFFFFF + TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF }; enum UnitMods diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 2731f65a47..7806c1e42c 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -99,8 +99,7 @@ public: return false; } - bool triggered = (triggeredStr != NULL); - + TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered); return true; @@ -132,8 +131,7 @@ public: return false; } - bool triggered = (triggeredStr != NULL); - + TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered); return true; @@ -167,8 +165,7 @@ public: return false; } - bool triggered = (triggeredStr != NULL); - + TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; float x, y, z; handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist); @@ -230,8 +227,7 @@ public: return false; } - bool triggered = (triggeredStr != NULL); - + TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; caster->CastSpell(caster->GetVictim(), spellId, triggered); return true; @@ -274,8 +270,7 @@ public: return false; } - bool triggered = (triggeredStr != NULL); - + TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; caster->CastSpell(x, y, z, spellId, triggered); return true; From f133041b8056ab8a61e60497a5c2845f367c0a33 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 7 Nov 2016 23:50:18 -0300 Subject: [PATCH 036/110] Core/Spell: fix interaction of on taken damage procs with triggered casts DB/Spell: Seal of Righteousness proc - Lightining and Water Shield should proc with triggered Closes #18211 --- .../world/3.3.5/2016_11_07_01_world_335.sql | 9 ++++++++ src/server/game/Spells/SpellMgr.cpp | 23 ++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/3.3.5/2016_11_07_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql new file mode 100644 index 0000000000..50aece5916 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql @@ -0,0 +1,9 @@ +UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId` IN ( +-324, -- Lightning Shield +-52127 -- Water Shield +); + +-- Seal of Righteousness +DELETE FROM `spell_proc` WHERE `SpellId` =21084; +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(21084, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index b4a4000662..98928dd02f 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1664,9 +1664,14 @@ void SpellMgr::LoadSpellProcs() if (!spellInfo) continue; + // Data already present in DB, overwrites default proc if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) continue; + // Nothing to do if no flags set + if (!spellInfo->ProcFlags) + continue; + bool addTriggerFlag = false; uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -1684,15 +1689,27 @@ void SpellMgr::LoadSpellProcs() procSpellTypeMask |= spellTypeMask[auraName]; if (isAlwaysTriggeredAura[auraName]) addTriggerFlag = true; + + // many proc auras with taken procFlag mask don't have attribute "can proc with triggered" + // they should proc nevertheless (example mage armor spells with judgement) + if (!addTriggerFlag && (spellInfo->ProcFlags & TAKEN_HIT_PROC_FLAG_MASK) != 0) + { + switch (auraName) + { + case SPELL_AURA_PROC_TRIGGER_SPELL: + case SPELL_AURA_PROC_TRIGGER_DAMAGE: + addTriggerFlag = true; + break; + default: + break; + } + } break; } if (!procSpellTypeMask) continue; - if (!spellInfo->ProcFlags) - continue; - SpellProcEntry procEntry; procEntry.SchoolMask = 0; procEntry.ProcFlags = spellInfo->ProcFlags; From fb6cde27309d6d20cffae7955b4cc564f4bc8ef4 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 8 Nov 2016 00:08:11 -0300 Subject: [PATCH 037/110] Core/Entities: add yet another utility overload to CastSpell, fixes AppVeyor build Ninja NULL->nullptr cleanup --- src/server/game/Entities/Unit/Unit.cpp | 24 +++++++++++++++++++----- src/server/game/Entities/Unit/Unit.h | 23 ++++++++++++----------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c48fb8f959..460ae5f126 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -956,7 +956,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castIte CastSpell(victim, spellId, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); } -void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags /*= TRIGGER_NONE*/, Item* castItem /*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/) +void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags /*= TRIGGER_NONE*/, Item* castItem /*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) @@ -968,7 +968,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster); } -void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/) +void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/) { CastSpell(victim, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); } @@ -977,7 +977,7 @@ void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags { SpellCastTargets targets; targets.SetUnitTarget(victim); - CastSpell(targets, spellInfo, NULL, triggerFlags, castItem, triggeredByAura, originalCaster); + CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster); } void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster) @@ -1031,7 +1031,21 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, SpellCastTargets targets; targets.SetDst(x, y, z, GetOrientation()); - CastSpell(targets, spellInfo, NULL, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); + CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); +} + +void Unit::CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster) +{ + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + { + TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUID().GetCounter() : GetEntry())); + return; + } + SpellCastTargets targets; + targets.SetDst(x, y, z, GetOrientation()); + + CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster); } void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem, AuraEffect* triggeredByAura, ObjectGuid originalCaster) @@ -1045,7 +1059,7 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI SpellCastTargets targets; targets.SetGOTarget(go); - CastSpell(targets, spellInfo, NULL, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); + CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); } // Obsolete func need remove, here only for comotability vs another patches diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0e5d6012fa..f04d594e61 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1594,17 +1594,18 @@ class TC_GAME_API Unit : public WorldObject void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype); uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); - void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); - void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); Aura* AddAura(uint32 spellId, Unit* target); Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target); void SetAuraStack(uint32 spellId, Unit* target, uint32 stack); From fcb79105331b95de03cd620fb7c7c308fbac9e84 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 9 Nov 2016 00:39:49 -0300 Subject: [PATCH 038/110] Core/Spell: reimplemented TRIGGERED_DISALLOW_PROC_EVENTS trigger flag Triggered spells shouldn't chain-trigger other spells Closes #18217 --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++++++ src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Spells/Spell.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 460ae5f126..50abb9bbd2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10730,6 +10730,11 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& aurasTriggeringProc) { + Spell const* triggeringSpell = eventInfo.GetProcSpell(); + bool const disableProcs = triggeringSpell && triggeringSpell->IsProcDisabled(); + if (disableProcs) + SetCantProc(true); + for (auto const& aurAppProc : aurasTriggeringProc) { AuraApplication* aurApp; @@ -10748,6 +10753,9 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) SetCantProc(false); } + + if (disableProcs) + SetCantProc(false); } SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index f04d594e61..17f99c99b6 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -450,7 +450,7 @@ enum TriggerCastFlags TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any) TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state - // reuse = 0x00001000, + TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default) TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions // reuse = 0x00004000, // reuse = 0x00008000, diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 5bf1fd1a03..e8ab92d73f 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -494,6 +494,7 @@ class TC_GAME_API Spell void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsTriggered() const { return (_triggeredCastFlags & TRIGGERED_FULL_MASK) != 0; } bool IsIgnoringCooldowns() const { return (_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) != 0; } + bool IsProcDisabled() const { return (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS) != 0; } bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const; From e6bdc58bf004576eff8eed71b7295672bd75e1a8 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 12 Nov 2016 18:12:26 -0300 Subject: [PATCH 039/110] Core/Unit: misc codestyle use typedef for constant reference --- src/server/game/Entities/Unit/Unit.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 50abb9bbd2..e856692f4c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7659,13 +7659,13 @@ int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const { // If m_immuneToSchool type contain this school type, IMMUNE damage. - auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) if ((itr->first & schoolMask) != 0) return true; // If m_immuneToDamage type contain magic, IMMUNE damage. - auto const& damageList = m_spellImmune[IMMUNITY_DAMAGE]; + SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE]; for (auto itr = damageList.begin(); itr != damageList.end(); ++itr) if ((itr->first & schoolMask) != 0) return true; @@ -7677,13 +7677,13 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const { uint32 schoolMask = spellInfo->GetSchoolMask(); // If m_immuneToSchool type contain this school type, IMMUNE damage. - auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) if ((itr->first & schoolMask) && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->second))) return true; // If m_immuneToDamage type contain magic, IMMUNE damage. - auto const& damageList = m_spellImmune[IMMUNITY_DAMAGE]; + SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE]; for (auto itr = damageList.begin(); itr != damageList.end(); ++itr) if ((itr->first & schoolMask) != 0) return true; @@ -7697,7 +7697,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const return false; // Single spell immunity. - auto const& idList = m_spellImmune[IMMUNITY_ID]; + SpellImmuneContainer const& idList = m_spellImmune[IMMUNITY_ID]; if (idList.count(spellInfo->Id) > 0) return true; @@ -7706,7 +7706,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const if (uint32 dispel = spellInfo->Dispel) { - auto const& dispelList = m_spellImmune[IMMUNITY_DISPEL]; + SpellImmuneContainer const& dispelList = m_spellImmune[IMMUNITY_DISPEL]; if (dispelList.count(dispel) > 0) return true; } @@ -7714,7 +7714,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const // Spells that don't have effectMechanics. if (uint32 mechanic = spellInfo->Mechanic) { - auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; + SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; if (mechanicList.count(mechanic) > 0) return true; } @@ -7734,7 +7734,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) { SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); @@ -7750,7 +7750,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const uint32 Unit::GetSchoolImmunityMask() const { uint32 mask = 0; - auto const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL]; + SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL]; for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) mask |= itr->first; @@ -7760,7 +7760,7 @@ uint32 Unit::GetSchoolImmunityMask() const uint32 Unit::GetMechanicImmunityMask() const { uint32 mask = 0; - auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; + SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) mask |= (1 << itr->first); @@ -7792,7 +7792,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons { if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) { - auto const& list = m_spellImmune[IMMUNITY_STATE]; + SpellImmuneContainer const& list = m_spellImmune[IMMUNITY_STATE]; if (list.count(aura) > 0) return true; } From b14b00da5c751187b366161e12698fa1261a0005 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 13 Nov 2016 21:44:04 -0300 Subject: [PATCH 040/110] Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks --- src/common/Utilities/Util.h | 32 +++--- src/server/game/Scripting/ScriptMgr.cpp | 21 ++-- src/server/game/Scripting/ScriptMgr.h | 5 +- src/server/game/Spells/Auras/SpellAuras.cpp | 115 +++++++++----------- src/server/game/Spells/Auras/SpellAuras.h | 4 +- src/server/game/Spells/Spell.cpp | 73 ++++++------- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellScript.cpp | 64 +++++------ src/server/game/Spells/SpellScript.h | 6 +- 9 files changed, 154 insertions(+), 168 deletions(-) diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 3edfec0688..3335179314 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -326,33 +326,35 @@ TC_COMMON_API bool StringToBool(std::string const& str); // simple class for not-modifyable list template -class HookList +class HookList final { - typedef typename std::list::iterator ListIterator; + typedef std::vector ContainerType; + private: - typename std::list m_list; + typename ContainerType _container; + public: - HookList & operator+=(T t) + typedef typename ContainerType::iterator iterator; + + HookList& operator+=(T t) { - m_list.push_back(t); - return *this; - } - HookList & operator-=(T t) - { - m_list.remove(t); + _container.push_back(t); return *this; } + size_t size() { - return m_list.size(); + return _container.size(); } - ListIterator begin() + + iterator begin() { - return m_list.begin(); + return _container.begin(); } - ListIterator end() + + iterator end() { - return m_list.end(); + return _container.end(); } }; diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index d1057f2915..749417228c 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1204,12 +1204,11 @@ void ScriptMgr::FillSpellSummary() } } -template -void CreateSpellOrAuraScripts(uint32 spellId, std::list& scriptVector, F&& extractor) +template +void CreateSpellOrAuraScripts(uint32 spellId, std::vector& scriptVector, F&& extractor, O* objectInvoker) { SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spellId); - - for (SpellScriptsContainer::iterator itr = bounds.first; itr != bounds.second; ++itr) + for (auto itr = bounds.first; itr != bounds.second; ++itr) { // When the script is disabled continue with the next one if (!itr->second.second) @@ -1220,24 +1219,28 @@ void CreateSpellOrAuraScripts(uint32 spellId, std::list& scriptVector, F&& e continue; T* script = (*tmpscript.*extractor)(); - if (!script) continue; script->_Init(&tmpscript->GetName(), spellId); + if (!script->_Load(objectInvoker)) + { + delete script; + continue; + } scriptVector.push_back(script); } } -void ScriptMgr::CreateSpellScripts(uint32 spellId, std::list& scriptVector) +void ScriptMgr::CreateSpellScripts(uint32 spellId, std::vector& scriptVector, Spell* invoker) const { - CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetSpellScript); + CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetSpellScript, invoker); } -void ScriptMgr::CreateAuraScripts(uint32 spellId, std::list& scriptVector) +void ScriptMgr::CreateAuraScripts(uint32 spellId, std::vector& scriptVector, Aura* invoker) const { - CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetAuraScript); + CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetAuraScript, invoker); } SpellScriptLoader* ScriptMgr::GetSpellScriptLoader(uint32 scriptId) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index e545982f7b..1b78edfbee 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -29,6 +29,7 @@ class AccountMgr; class AuctionHouseObject; +class Aura; class AuraScript; class Battleground; class BattlegroundMap; @@ -894,8 +895,8 @@ class TC_GAME_API ScriptMgr public: /* SpellScriptLoader */ - void CreateSpellScripts(uint32 spellId, std::list& scriptVector); - void CreateAuraScripts(uint32 spellId, std::list& scriptVector); + void CreateSpellScripts(uint32 spellId, std::vector& scriptVector, Spell* invoker) const; + void CreateAuraScripts(uint32 spellId, std::vector& scriptVector, Aura* invoker) const; SpellScriptLoader* GetSpellScriptLoader(uint32 scriptId); public: /* ServerScript */ diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b675e6c5a2..8b34ae2e52 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -369,7 +369,7 @@ m_procCooldown(std::chrono::steady_clock::time_point::min()) AuraScript* Aura::GetScriptByName(std::string const& scriptName) const { - for (std::list::const_iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) if ((*itr)->_GetScriptName()->compare(scriptName) == 0) return *itr; return NULL; @@ -390,12 +390,10 @@ void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount) Aura::~Aura() { // unload scripts - while (!m_loadedScripts.empty()) + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) { - std::list::iterator itr = m_loadedScripts.begin(); (*itr)->_Unload(); delete (*itr); - m_loadedScripts.erase(itr); } // free effects memory @@ -1896,30 +1894,21 @@ void Aura::_DeleteRemovedApplications() void Aura::LoadScripts() { - sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) + sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts, this); + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) { - if (!(*itr)->_Load(this)) - { - std::list::iterator bitr = itr; - ++itr; - delete (*bitr); - m_loadedScripts.erase(bitr); - continue; - } TC_LOG_DEBUG("spells", "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); (*itr)->Register(); - ++itr; } } bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) { bool result = true; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET); - std::list::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin(); + auto hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin(); for (; hookItr != hookItrEnd; ++hookItr) result &= hookItr->Call(*scritr, target); @@ -1930,10 +1919,10 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) void Aura::CallScriptDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL); - std::list::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin(); + auto hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin(); for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, dispelInfo); @@ -1943,10 +1932,10 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo) void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL); - std::list::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin(); + auto hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin(); for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, dispelInfo); @@ -1957,10 +1946,10 @@ void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin(); + auto effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, mode); @@ -1977,10 +1966,10 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin(); + auto effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, mode); @@ -1995,10 +1984,10 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp); - std::list::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin(); + auto effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, mode); @@ -2009,10 +1998,10 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp); - std::list::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin(); + auto effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, mode); @@ -2024,10 +2013,10 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin(); + auto effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff); @@ -2043,10 +2032,10 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC); - std::list::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin(); + auto effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff); @@ -2057,10 +2046,10 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT); - std::list::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin(); + auto effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, amount, canBeRecalculated); @@ -2071,10 +2060,10 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC); - std::list::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin(); + auto effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, isPeriodic, amplitude); @@ -2085,10 +2074,10 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD); - std::list::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin(); + auto effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, spellMod); @@ -2099,10 +2088,10 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin(); + auto effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) @@ -2117,10 +2106,10 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp); - std::list::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin(); + auto effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2131,10 +2120,10 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin(); + auto effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2145,10 +2134,10 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp); - std::list::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin(); + auto effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2159,10 +2148,10 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraAppli void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin(); + auto effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, dmgInfo, splitAmount); @@ -2174,10 +2163,10 @@ void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication con bool Aura::CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool result = true; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_PROC, aurApp); - std::list::iterator hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin(); + auto hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin(); for (; hookItr != hookItrEnd; ++hookItr) result &= hookItr->Call(*scritr, eventInfo); @@ -2190,10 +2179,10 @@ bool Aura::CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventI bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool prepare = true; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PREPARE_PROC, aurApp); - std::list::iterator effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin(); + auto effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin(); for (; effItr != effEndItr; ++effItr) effItr->Call(*scritr, eventInfo); @@ -2209,10 +2198,10 @@ bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEven bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool handled = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp); - std::list::iterator hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin(); + auto hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin(); for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, eventInfo); @@ -2225,10 +2214,10 @@ bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_PROC, aurApp); - std::list::iterator hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin(); + auto hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin(); for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, eventInfo); @@ -2239,10 +2228,10 @@ void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventI bool Aura::CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool result = true; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC, aurApp); - std::list::iterator hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin(); + auto hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin(); for (; hookItr != hookItrEnd; ++hookItr) if (hookItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) result &= hookItr->Call(*scritr, aurEff, eventInfo); @@ -2256,10 +2245,10 @@ bool Aura::CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraAppli bool Aura::CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PROC, aurApp); - std::list::iterator effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin(); + auto effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, eventInfo); @@ -2274,10 +2263,10 @@ bool Aura::CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplicatio void Aura::CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC, aurApp); - std::list::iterator effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin(); + auto effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin(); for (; effItr != effEndItr; ++effItr) if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) effItr->Call(*scritr, aurEff, eventInfo); diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 5bb7dfc7c1..e668ca78fd 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -238,9 +238,11 @@ class TC_GAME_API Aura AuraScript* GetScriptByName(std::string const& scriptName) const; - std::list m_loadedScripts; + std::vector m_loadedScripts; + private: void _DeleteRemovedApplications(); + protected: SpellInfo const* const m_spellInfo; ObjectGuid const m_casterGuid; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8858626cbd..b06f343292 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -631,12 +631,10 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO Spell::~Spell() { // unload scripts - while (!m_loadedScripts.empty()) + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) { - std::list::iterator itr = m_loadedScripts.begin(); (*itr)->_Unload(); delete (*itr); - m_loadedScripts.erase(itr); } if (m_referencedFromCurrentSpell && m_selfContainer && *m_selfContainer == this) @@ -7306,29 +7304,20 @@ void Spell::AssertEffectExecuteData() const void Spell::LoadScripts() { - sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) + sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts, this); + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) { - if (!(*itr)->_Load(this)) - { - std::list::iterator bitr = itr; - ++itr; - delete (*bitr); - m_loadedScripts.erase(bitr); - continue; - } TC_LOG_DEBUG("spells", "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); (*itr)->Register(); - ++itr; } } void Spell::CallScriptBeforeCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST); - std::list::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin(); + auto hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7338,10 +7327,10 @@ void Spell::CallScriptBeforeCastHandlers() void Spell::CallScriptOnCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST); - std::list::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin(); + auto hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7351,10 +7340,10 @@ void Spell::CallScriptOnCastHandlers() void Spell::CallScriptAfterCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST); - std::list::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin(); + auto hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7365,10 +7354,10 @@ void Spell::CallScriptAfterCastHandlers() SpellCastResult Spell::CallScriptCheckCastHandlers() { SpellCastResult retVal = SPELL_CAST_OK; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST); - std::list::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin(); + auto hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin(); for (; hookItr != hookItrEnd; ++hookItr) { SpellCastResult tempResult = (*hookItr).Call(*scritr); @@ -7383,7 +7372,7 @@ SpellCastResult Spell::CallScriptCheckCastHandlers() void Spell::PrepareScriptHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) (*scritr)->_InitHit(); } @@ -7391,9 +7380,9 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo { // execute script effect handler hooks and check if effects was prevented bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { - std::list::iterator effItr, effEndItr; + HookList::iterator effItr, effEndItr; SpellScriptHookType hookType; switch (mode) { @@ -7437,10 +7426,10 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo void Spell::CallScriptSuccessfulDispel(SpellEffIndex effIndex) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL); - std::list::iterator hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin(); + auto hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin(); for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, effIndex); @@ -7450,10 +7439,10 @@ void Spell::CallScriptSuccessfulDispel(SpellEffIndex effIndex) void Spell::CallScriptBeforeHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT); - std::list::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin(); + auto hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7463,10 +7452,10 @@ void Spell::CallScriptBeforeHitHandlers() void Spell::CallScriptOnHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT); - std::list::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin(); + auto hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7476,10 +7465,10 @@ void Spell::CallScriptOnHitHandlers() void Spell::CallScriptAfterHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT); - std::list::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin(); + auto hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin(); for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); @@ -7489,10 +7478,10 @@ void Spell::CallScriptAfterHitHandlers() void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT); - std::list::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin(); + auto hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget()) hookItr->Call(*scritr, targets); @@ -7503,10 +7492,10 @@ void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& ta void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT); - std::list::iterator hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin(); + auto hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget()) hookItr->Call(*scritr, target); @@ -7517,10 +7506,10 @@ void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffI void Spell::CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_DESTINATION_TARGET_SELECT); - std::list::iterator hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin(); + auto hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget()) hookItr->Call(*scritr, target); @@ -7535,15 +7524,15 @@ bool Spell::CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToC if (m_loadedScripts.empty()) return true; - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) + for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) { - std::list::iterator targetSelectHookEnd = (*itr)->OnObjectTargetSelect.end(), targetSelectHookItr = (*itr)->OnObjectTargetSelect.begin(); + auto targetSelectHookEnd = (*itr)->OnObjectTargetSelect.end(), targetSelectHookItr = (*itr)->OnObjectTargetSelect.begin(); for (; targetSelectHookItr != targetSelectHookEnd; ++targetSelectHookItr) if (((*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && !(*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)) || (!(*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && (*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck))) return false; - std::list::iterator areaTargetSelectHookEnd = (*itr)->OnObjectAreaTargetSelect.end(), areaTargetSelectHookItr = (*itr)->OnObjectAreaTargetSelect.begin(); + auto areaTargetSelectHookEnd = (*itr)->OnObjectAreaTargetSelect.end(), areaTargetSelectHookItr = (*itr)->OnObjectAreaTargetSelect.begin(); for (; areaTargetSelectHookItr != areaTargetSelectHookEnd; ++areaTargetSelectHookItr) if (((*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && !(*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)) || (!(*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && (*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck))) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index e8ab92d73f..5812e83803 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -674,7 +674,7 @@ class TC_GAME_API Spell void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); void CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck); - std::list m_loadedScripts; + std::vector m_loadedScripts; struct HitTriggerSpell { diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 64656c088b..32aad8a11e 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -316,35 +316,35 @@ void SpellScript::DestinationTargetSelectHandler::Call(SpellScript* spellScript, bool SpellScript::_Validate(SpellInfo const* entry) { - for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) + for (auto itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) + for (auto itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) + for (auto itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) + for (auto itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectSuccessfulDispel.begin(); itr != OnEffectSuccessfulDispel.end(); ++itr) + for (auto itr = OnEffectSuccessfulDispel.begin(); itr != OnEffectSuccessfulDispel.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSuccessfulDispel` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) + for (auto itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr) + for (auto itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr) + for (auto itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); @@ -663,99 +663,99 @@ SpellValue const* SpellScript::GetSpellValue() bool AuraScript::_Validate(SpellInfo const* entry) { - for (std::list::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr) + for (auto itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr) if (!entry->HasAreaAuraEffect() && !entry->HasEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA) && !entry->HasEffect(SPELL_EFFECT_APPLY_AURA)) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr) + for (auto itr = OnDispel.begin(); itr != OnDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr) + for (auto itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr) + for (auto itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr) + for (auto itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr) + for (auto itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr) + for (auto itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr) + for (auto itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr) + for (auto itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr) + for (auto itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr) + for (auto itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr) + for (auto itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr) + for (auto itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr) + for (auto itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr) + for (auto itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr) + for (auto itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr) + for (auto itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr) + for (auto itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr) + for (auto itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr) if (!itr->GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoCheckEffectProc` of AuraScript won't be executed", entry->Id, itr->ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr) + for (auto itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = OnProc.begin(); itr != OnProc.end(); ++itr) + for (auto itr = OnProc.begin(); itr != OnProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = AfterProc.begin(); itr != AfterProc.end(); ++itr) + for (auto itr = AfterProc.begin(); itr != AfterProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr) + for (auto itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr) + for (auto itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 47b04bfcd3..330727cdc1 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -63,9 +63,9 @@ class TC_GAME_API _SpellScript public: _SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(NULL), m_scriptSpellId(0) {} virtual ~_SpellScript() { } - virtual void _Register(); - virtual void _Unload(); - virtual void _Init(std::string const* scriptname, uint32 spellId); + void _Register(); + void _Unload(); + void _Init(std::string const* scriptname, uint32 spellId); std::string const* _GetScriptName() const; protected: From 6ef6047b0003c137fb19063f24eac06597d9f816 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 13 Nov 2016 18:46:58 -0300 Subject: [PATCH 041/110] Core/Spell: Fixed immunities for some spells (they were broken before rewrite too) - Warlord's Presence, Uncontrollable Frenzy, Free Friend - Overload, Lightning Tendrils - Fervor, Berserk - Determination --- src/server/game/Spells/SpellInfo.cpp | 115 +++++++++++++-------------- 1 file changed, 55 insertions(+), 60 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 56ff2e375f..8a171ec686 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2663,21 +2663,50 @@ void SpellInfo::_LoadImmunityInfo() { switch (miscVal) { - case 27: - mechanicImmunityMask |= (1 << MECHANIC_SILENCE); - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_SILENCE); - break; - case 96: - case 1615: + case 96: // Free Friend, Uncontrollable Frenzy, Warlord's Presence { - if (amount) + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; + + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR); + break; + } + case 1615: // Incite Rage, Wolf Spirit, Overload, Lightning Tendrils + { + switch (Id) { - mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH); + case 43292: // Incite Rage + case 49172: // Wolf Spirit + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; + + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE); + immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR); + // no break intended + case 61869: // Overload + case 63481: + case 61887: // Lightning Tendrils + case 63486: + mechanicImmunityMask |= (1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE); + + immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK); + immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK_DEST); + break; + default: + break; + } + break; + } + case 679: // Mind Control, Avenging Fury + { + if (Id == 57742) // Avenging Fury + { + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); @@ -2687,40 +2716,16 @@ void SpellInfo::_LoadImmunityInfo() } break; } - case 679: + case 1557: // Startling Roar, Warlord Roar, Break Bonds, Stormshield { - if (Id == 57742) - { - mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH); - - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT); - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE); - immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR); - } - break; - } - case 1557: - { - if (Id == 64187) + if (Id == 64187) // Stormshield { mechanicImmunityMask |= (1 << MECHANIC_STUN); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); } else { - mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH); + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); @@ -2730,28 +2735,23 @@ void SpellInfo::_LoadImmunityInfo() } break; } - case 1614: - case 1694: + case 1614: // Fixate + case 1694: // Fixated, Lightning Tendrils { immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_ATTACK_ME); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_TAUNT); break; } - case 1630: + case 1630: // Fervor, Berserk { - if (!amount) + if (Id == 64112) // Berserk { immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_ATTACK_ME); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_TAUNT); } else { - mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH); + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED); @@ -2761,17 +2761,12 @@ void SpellInfo::_LoadImmunityInfo() } break; } - case 477: - case 1733: + case 477: // Bladestorm + case 1733: // Bladestorm, Killing Spree { if (!amount) { - mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH); + mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK); immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK_DEST); @@ -2784,9 +2779,9 @@ void SpellInfo::_LoadImmunityInfo() } break; } - case 878: + case 878: // Whirlwind, Fog of Corruption, Determination { - if (amount == 1) + if (Id == 66092) // Determination { mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN) | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE); From 07a529726df9a577d8ca5c8781a7a812733b088e Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 14 Nov 2016 01:15:55 -0300 Subject: [PATCH 042/110] Core/Globals: Load spellspecific and aurastate after loading spell ranks Was breaking functionality (eg: stacking scroll auras) --- src/server/game/World/World.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 8c0d0801c9..d7f6255df9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1506,9 +1506,6 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes..."); sSpellMgr->LoadSpellInfoCustomAttributes(); - TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState..."); - sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); - TC_LOG_INFO("server.loading", "Loading SpellInfo diminishing infos..."); sSpellMgr->LoadSpellInfoDiminishing(); @@ -1577,6 +1574,9 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Spell Learn Skills..."); sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks + TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState..."); + sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); // must be after LoadSpellRanks + TC_LOG_INFO("server.loading", "Loading Spell Learn Spells..."); sSpellMgr->LoadSpellLearnSpells(); From 18a145e2c685fabf385ffd26b0b48f00de028adc Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 14 Nov 2016 02:36:33 -0300 Subject: [PATCH 043/110] Core/Utils: build fix --- src/common/Utilities/Util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 3335179314..852166c3ca 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -328,10 +328,10 @@ TC_COMMON_API bool StringToBool(std::string const& str); template class HookList final { - typedef std::vector ContainerType; - private: - typename ContainerType _container; + typedef std::vector ContainerType; + + ContainerType _container; public: typedef typename ContainerType::iterator iterator; From 679f5c51c5af5fa35360722fcb92e670a94229fd Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 14 Nov 2016 04:02:43 -0300 Subject: [PATCH 044/110] Core/Spell: fix typos --- src/server/game/Spells/SpellInfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8a171ec686..4236df7f6b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2644,14 +2644,14 @@ void SpellInfo::_LoadSpellDiminishInfo() void SpellInfo::_LoadImmunityInfo() { - uint32 schoolImmunityMask = 0; - uint32 applyHarmfulAuraImmunityMask = 0; - uint32 mechanicImmunityMask = 0; - uint32 dispelImmunity = 0; - uint32 damageImmunityMask = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { + uint32 schoolImmunityMask = 0; + uint32 applyHarmfulAuraImmunityMask = 0; + uint32 mechanicImmunityMask = 0; + uint32 dispelImmunity = 0; + uint32 damageImmunityMask = 0; + int32 miscVal = Effects[i].MiscValue; int32 amount = Effects[i].CalcValue(); @@ -2936,7 +2936,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app } } - if (uint32 damageImmunity = immuneInfo->SchoolImmuneMask) + if (uint32 damageImmunity = immuneInfo->DamageSchoolMask) target->ApplySpellImmune(Id, IMMUNITY_DAMAGE, damageImmunity, apply); for (AuraType auraType : immuneInfo->AuraTypeImmune) From 045bf711c2b38b49b9a54cf319fe38dbf38474cc Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 14 Nov 2016 04:04:30 -0300 Subject: [PATCH 045/110] Core/Unit: improved handling of some spell attributes - SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE - SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE - SPELL_ATTR3_IGNORE_HIT_RESULT --- src/server/game/Entities/Unit/Unit.cpp | 53 +++++++++++++++----------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e856692f4c..c1799fb84f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2308,7 +2308,7 @@ void Unit::SendMeleeAttackStop(Unit* victim) bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType /*attackType*/) { // These spells can't be blocked - if (spellProto && spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)) + if (spellProto && (spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK) || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))) return false; if (victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION) || victim->HasInArc(float(M_PI), this)) @@ -2371,11 +2371,6 @@ bool Unit::CanUseAttackType(uint8 attacktype) const // Melee based spells hit result calculations SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo) { - // Spells with SPELL_ATTR3_IGNORE_HIT_RESULT will additionally fully ignore - // resist and deflect chances - if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) - return SPELL_MISS_NONE; - WeaponAttackType attType = BASE_ATTACK; // Check damage class instead of attack type to correctly handle judgements @@ -2528,7 +2523,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo) { // Can`t miss on dead target (on skinning for example) - if ((!victim->IsAlive() && victim->GetTypeId() != TYPEID_PLAYER) || spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + if ((!victim->IsAlive() && victim->GetTypeId() != TYPEID_PLAYER)) return SPELL_MISS_NONE; SpellSchoolMask schoolMask = spellInfo->GetSchoolMask(); @@ -2600,6 +2595,9 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo // Resist SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool CanReflect) { + if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + return SPELL_MISS_NONE; + // Check for immune if (victim->IsImmunedToSpell(spellInfo)) return SPELL_MISS_IMMUNE; @@ -7675,6 +7673,9 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const { + if (spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) + return false; + uint32 schoolMask = spellInfo->GetSchoolMask(); // If m_immuneToSchool type contain this school type, IMMUNE damage. SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; @@ -7734,14 +7735,17 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; - for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) + if (!spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) { - SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); - if ((itr->first & spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive()) - && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) - return true; + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) + { + SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); + if ((itr->first & spellInfo->GetSchoolMask()) + && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive()) + && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) + return true; + } } return false; @@ -7788,21 +7792,24 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons return true; } - if (uint32 aura = spellInfo->Effects[index].ApplyAuraName) + if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) { - if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + if (uint32 aura = spellInfo->Effects[index].ApplyAuraName) { SpellImmuneContainer const& list = m_spellImmune[IMMUNITY_STATE]; if (list.count(aura) > 0) return true; - } - // Check for immune to application of harmful magical effects - AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); - for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) - if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school - !spellInfo->IsPositiveEffect(index)) // Harmful - return true; + if (!spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) + { + // Check for immune to application of harmful magical effects + AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); + for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) + if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school + !spellInfo->IsPositiveEffect(index)) // Harmful + return true; + } + } } return false; From 746cb97dcee468bc2d9beb09428b473621b97ab2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 14 Nov 2016 20:40:17 -0300 Subject: [PATCH 046/110] Core/Unit: don't use damage immunity to calculate hit result for the whole spell. Should be used only for damage --- src/server/game/Entities/Unit/Unit.cpp | 13 +++++++++---- src/server/game/Spells/Spell.cpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c1799fb84f..4cb8b3f9f6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -666,6 +666,12 @@ void Unit::DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) co uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellInfo const* spellProto, bool durabilityLoss) { + if (victim->IsImmunedToDamage(spellProto)) + { + SendSpellDamageImmune(victim, spellProto->Id); + return 0; + } + if (victim->IsAIEnabled) victim->GetAI()->DamageTaken(this, damage); @@ -2607,10 +2613,6 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo if (spellInfo->IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell return SPELL_MISS_NONE; - // Check for immune - if (victim->IsImmunedToDamage(spellInfo)) - return SPELL_MISS_IMMUNE; - if (this == victim) return SPELL_MISS_NONE; @@ -7673,6 +7675,9 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const { + if (!spellInfo) + return false; + if (spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) return false; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b06f343292..8a86cdff05 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2547,7 +2547,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA return SPELL_MISS_EVADE; // For delayed spells immunity may be applied between missile launch and hit - check immunity for that case - if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo))) + if (m_spellInfo->Speed && unit->IsImmunedToSpell(m_spellInfo)) return SPELL_MISS_IMMUNE; // disable effects to which unit is immune From b7b69b88bafa7e09a0ca757210334482d89674ff Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 15 Nov 2016 22:39:15 -0300 Subject: [PATCH 047/110] Core/Unit: damage immune improvements --- src/server/game/Entities/Unit/Unit.cpp | 33 ++++--------------- src/server/game/Entities/Unit/Unit.h | 1 - .../game/Spells/Auras/SpellAuraEffects.cpp | 6 ++++ src/server/game/Spells/Spell.cpp | 32 +++++++++++------- src/server/game/Spells/SpellInfo.cpp | 25 ++++++++++++++ src/server/game/Spells/SpellInfo.h | 1 + src/server/scripts/Commands/cs_misc.cpp | 16 +++++++-- .../IcecrownCitadel/boss_sindragosa.cpp | 6 ++++ 8 files changed, 80 insertions(+), 40 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4cb8b3f9f6..ab347e7c07 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -666,12 +666,6 @@ void Unit::DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) co uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellInfo const* spellProto, bool durabilityLoss) { - if (victim->IsImmunedToDamage(spellProto)) - { - SendSpellDamageImmune(victim, spellProto->Id); - return 0; - } - if (victim->IsAIEnabled) victim->GetAI()->DamageTaken(this, damage); @@ -1068,23 +1062,6 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster); } -// Obsolete func need remove, here only for comotability vs another patches -uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage) -{ - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); - if (!spellInfo) - return 0; - SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask); - damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); - damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE); - - CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); - DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); - SendSpellNonMeleeDamageLog(&damageInfo); - DealSpellDamage(&damageInfo, true); - return damageInfo.damage; -} - void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit) { if (damage < 0) @@ -1192,11 +1169,10 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) { - if (damageInfo == 0) + if (!damageInfo) return; Unit* victim = damageInfo->target; - if (!victim) return; @@ -1527,7 +1503,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) data << uint32(0); // FIX ME: Send resisted damage, both fully resisted and partly resisted victim->SendMessageToSet(&data, true); - victim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true); + victim->DealDamage(this, damage, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true); } } } @@ -2608,6 +2584,11 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo if (victim->IsImmunedToSpell(spellInfo)) return SPELL_MISS_IMMUNE; + // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply + // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit + if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo)) + return SPELL_MISS_IMMUNE; + // All positive spells can`t miss /// @todo client not show miss log for this spells - so need find info for this in dbc and use it! if (spellInfo->IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 17f99c99b6..e72b5cc9ea 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1592,7 +1592,6 @@ class TC_GAME_API Unit : public WorldObject int32 HealBySpell(HealInfo& healInfo, bool critical = false); void SendEnergizeSpellLog(Unit* victim, uint32 spellID, int32 damage, Powers powertype); void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype); - uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dac9df5416..94c5823160 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6125,6 +6125,12 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv Unit* target = aurApp->GetTarget(); Unit* triggerTarget = eventInfo.GetProcTarget(); + if (triggerTarget->HasUnitState(UNIT_STATE_ISOLATED) || triggerTarget->IsImmunedToDamage(GetSpellInfo())) + { + SendTickImmune(triggerTarget, target); + return; + } + SpellNonMeleeDamage damageInfo(target, triggerTarget, GetId(), GetSpellInfo()->SchoolMask); uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8a86cdff05..992f12b670 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2457,15 +2457,29 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Fill base damage struct (unitTarget - is real spell target) SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask); - // Add bonuses and fill damageInfo struct - caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit); - caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); + // Check damage immunity + if (unitTarget->IsImmunedToDamage(m_spellInfo)) + { + hitMask = PROC_HIT_IMMUNE; + m_damage = 0; - // Send log damage message to client - caster->SendSpellNonMeleeDamageLog(&damageInfo); + // no packet found in sniffs + } + else + { + // Add bonuses and fill damageInfo struct + caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit); + caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); - hitMask |= createProcHitMask(&damageInfo, missInfo); - procVictim |= PROC_FLAG_TAKEN_DAMAGE; + // Send log damage message to client + caster->SendSpellNonMeleeDamageLog(&damageInfo); + + hitMask |= createProcHitMask(&damageInfo, missInfo); + procVictim |= PROC_FLAG_TAKEN_DAMAGE; + + m_damage = damageInfo.damage; + caster->DealSpellDamage(&damageInfo, true); + } // Do triggers for unit if (canEffectTrigger) @@ -2477,10 +2491,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) caster->ToPlayer()->CastItemCombatSpell(spellDamageInfo); } - - m_damage = damageInfo.damage; - - caster->DealSpellDamage(&damageInfo, true); } // Passive spell hits/misses or active spells only misses (only triggers) else diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 4236df7f6b..c3a7e015e9 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1067,6 +1067,31 @@ bool SpellInfo::HasAreaAuraEffect() const return false; } +bool SpellInfo::HasOnlyDamageEffects() const +{ + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (Effects[i].IsEffect()) + { + switch (Effects[i].Effect) + { + case SPELL_EFFECT_WEAPON_DAMAGE: + case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: + case SPELL_EFFECT_NORMALIZED_WEAPON_DMG: + case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE: + case SPELL_EFFECT_SCHOOL_DAMAGE: + case SPELL_EFFECT_ENVIRONMENTAL_DAMAGE: + case SPELL_EFFECT_HEALTH_LEECH: + continue; + default: + return false; + } + } + } + + return true; +} + bool SpellInfo::IsExplicitDiscovery() const { return ((Effects[0].Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 3e1a437a80..1b85b3b959 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -451,6 +451,7 @@ class TC_GAME_API SpellInfo bool HasEffect(SpellEffects effect) const; bool HasAura(AuraType aura) const; bool HasAreaAuraEffect() const; + bool HasOnlyDamageEffects() const; inline bool HasAttribute(SpellAttr0 attribute) const { return !!(Attributes & attribute); } inline bool HasAttribute(SpellAttr1 attribute) const { return !!(AttributesEx & attribute); } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index f4e7cb3eaf..291246327f 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2356,10 +2356,22 @@ public: // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form uint32 spellid = handler->extractSpellIdFromLink((char*)args); - if (!spellid || !sSpellMgr->GetSpellInfo(spellid)) + if (!spellid) return false; - handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); + if (!spellInfo) + return false; + + Player* attacker = handler->GetSession()->GetPlayer(); + SpellNonMeleeDamage dmgInfo(attacker, target, spellid, spellInfo->GetSchoolMask()); + damage = attacker->SpellDamageBonusDone(target, spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = target->SpellDamageBonusTaken(attacker, spellInfo, damage, SPELL_DIRECT_DAMAGE); + + attacker->CalculateSpellDamageTaken(&dmgInfo, damage, spellInfo); + attacker->DealDamageMods(dmgInfo.target, dmgInfo.damage, &dmgInfo.absorb); + attacker->SendSpellNonMeleeDamageLog(&dmgInfo); + attacker->DealSpellDamage(&dmgInfo, true); return true; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 703fb6e96f..ce3b273200 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1108,6 +1108,12 @@ class spell_sindragosa_s_fury : public SpellScriptLoader if (!GetHitUnit()->IsAlive() || !_targetCount) return; + if (GetHitUnit()->IsImmunedToDamage(GetSpellInfo())) + { + GetCaster()->SendSpellDamageImmune(GetHitUnit(), GetSpellInfo()->Id); + return; + } + float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask))); uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2; uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor; From 31b1b42b0775d34eaf60de90bab937062e8ea240 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 02:10:38 +0100 Subject: [PATCH 048/110] Remove duplicate code --- src/server/game/Entities/Unit/Unit.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ab347e7c07..d27676c7be 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6650,14 +6650,14 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras if (HasUnitTypeMask(UNIT_MASK_GUARDIAN)) - DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage(); + DoneAdvertisedBenefit += static_cast(this)->GetBonusDamage(); // Check for table values - float coeff = 0.0f; + float coeff = 0.f; SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); if (bonus) { - WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; + WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); @@ -6671,12 +6671,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin { coeff = bonus->direct_damage; if (bonus->ap_bonus > 0) - { - WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; - float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); - APbonus += GetTotalAttackPowerValue(attType); DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus); - } } } From a6c7f2b98c13a990c4c9bfd193cc6cb87cef01aa Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 16 Nov 2016 04:06:32 -0300 Subject: [PATCH 049/110] Core/Spell: Fixed irregular handling of SPELLMOD_DOT --- src/server/game/Entities/Unit/Unit.cpp | 28 +++++++++++-------- .../game/Spells/Auras/SpellAuraEffects.cpp | 5 ++++ src/server/game/Spells/Auras/SpellAuras.cpp | 23 +++++++++------ src/server/game/Spells/SpellEffects.cpp | 9 ++++-- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d27676c7be..5ba0e1306d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6692,14 +6692,16 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } + float tmpDamage = (int32(pdamage) + DoneTotal); + + // DOTs calculated in AuraEffect::PeriodicDamageAurasTick // Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods. - float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype)); - // apply spellmod to Done damage (flat and pct) - if (Player* modOwner = GetSpellModOwner()) + if (damagetype != DOT) { - if (damagetype == DOT) - modOwner->ApplySpellMod(spellProto->Id, tmpDamage); - else + tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype); + + // apply spellmod to Done damage (flat and pct) + if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, tmpDamage); } @@ -7408,14 +7410,16 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui DoneTotal = 0; } + float heal = float(int32(healamount) + DoneTotal); + + // DOTs calculated in AuraEffect::HandlePeriodicHealAurasTick // Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods. - float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto)); - // apply spellmod to Done amount - if (Player* modOwner = GetSpellModOwner()) + if (damagetype != DOT) { - if (damagetype == DOT) - modOwner->ApplySpellMod(spellProto->Id, heal); - else + heal *= SpellHealingPctDone(victim, spellProto); + + // apply spellmod to Done amount + if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, heal); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 94c5823160..085f5bcece 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5665,6 +5665,9 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c else damage = std::max(int32(damage * GetDonePct()), 0); + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(GetSpellInfo()->Id, damage); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); // Calculate armor mitigation @@ -5676,12 +5679,14 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c } if (!m_spellInfo->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE)) + { if (m_spellInfo->Effects[m_effIndex].IsTargetingArea() || isAreaAura) { damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask)); if (caster->GetTypeId() != TYPEID_PLAYER) damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask)); } + } bool crit = false; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8b34ae2e52..58c76cf66e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1308,20 +1308,27 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PRIEST: if (!caster) break; + // Devouring Plague - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0)) + if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000) { + AuraEffect const* devouringPlague = GetEffect(EFFECT_0); + if (!devouringPlague) + break; + // Improved Devouring Plague if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 0)) { - uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); - damage *= caster->SpellDamagePctDone(target, GetSpellInfo(), SPELL_DIRECT_DAMAGE); - damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; - int32 heal = int32(CalculatePct(basepoints0, 15)); + int32 damage = (devouringPlague->GetAmount() + devouringPlague->GetBonusAmount()) * devouringPlague->GetDonePct(); + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(GetSpellInfo()->Id, damage); - caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); - caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0)); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); + + int32 basepoints0 = CalculatePct(devouringPlague->GetTotalTicks() * static_cast(damage), aurEff->GetAmount()); + int32 heal = CalculatePct(basepoints0, 15); + caster->CastCustomSpell(63675, SPELLVALUE_BASE_POINT0, basepoints0, target, true, nullptr, devouringPlague); + caster->CastCustomSpell(75999, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, devouringPlague); } } // Power Word: Shield diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 7797176808..6362bbc284 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1242,9 +1242,12 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) return; } - int32 tickheal = targetAura->GetAmount(); - if (Unit* auraCaster = targetAura->GetCaster()) - tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); + int32 tickheal = (targetAura->GetAmount() + targetAura->GetBonusAmount()) * targetAura->GetDonePct(); + if (Player* modOwner = m_caster->GetSpellModOwner()) + modOwner->ApplySpellMod(targetAura->GetId(), tickheal); + + unitTarget->SpellHealingBonusTaken(m_caster, targetAura->GetSpellInfo(), tickheal, DOT); + //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included From 39f5cfafc52af9d2bd3c78b0ee546c005884416f Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 16 Nov 2016 23:04:19 -0300 Subject: [PATCH 050/110] Core/Spell: spells with ignore hit result should pierce damage immunities --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5ba0e1306d..dfb81a64ce 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7658,6 +7658,9 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const if (!spellInfo) return false; + if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + return false; + if (spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) return false; From cb77d33cb9ef9c3643a6d999d7970d771bdaa7b1 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 18 Nov 2016 02:15:45 -0300 Subject: [PATCH 051/110] Core/Spell: Added the possibility to explicitly disable auraEffect procs using attributes - Renamed IsProcTriggeredOnEvent to GetProcEffectMask, since long ago this function returned bool, new name should better reflect its use --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Spells/Auras/SpellAuras.cpp | 10 +++++----- src/server/game/Spells/Auras/SpellAuras.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 3 +++ src/server/game/Spells/SpellMgr.h | 6 +++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index dfb81a64ce..c235b96abf 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10660,7 +10660,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg for (AuraApplication* aurApp : *procAuras) { ASSERT(aurApp->GetTarget() == this); - if (uint8 procEffectMask = aurApp->GetBase()->IsProcTriggeredOnEvent(aurApp, eventInfo, now)) + if (uint8 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now)) { aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now); aurasTriggeringProc.emplace_back(procEffectMask, aurApp); @@ -10672,7 +10672,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg { for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr != GetAppliedAuras().end(); ++itr) { - if (uint8 procEffectMask = itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) + if (uint8 procEffectMask = itr->second->GetBase()->GetProcEffectMask(itr->second, eventInfo, now)) { itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now); aurasTriggeringProc.emplace_back(procEffectMask, itr->second); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 58c76cf66e..2dd81b09dc 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1734,7 +1734,7 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf AddProcCooldown(now + procEntry->Cooldown); } -uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const +uint8 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const { SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()); // only auras with spell proc entry can trigger proc @@ -1786,11 +1786,11 @@ uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& event return 0; // At least one effect has to pass checks to proc aura - uint8 procEffectMask = 0; + uint8 procEffectMask = aurApp->GetEffectMask(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (aurApp->HasEffect(i)) - if (GetEffect(i)->CheckEffectProc(aurApp, eventInfo)) - procEffectMask |= (1 << i); + if (procEffectMask & (1 << i)) + if ((procEntry->AttributesMask & (PROC_ATTR_DISABLE_EFF_0 << i)) || !GetEffect(i)->CheckEffectProc(aurApp, eventInfo)) + procEffectMask &= ~(1 << i); if (!procEffectMask) return 0; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index e668ca78fd..94691e4cf6 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -204,7 +204,7 @@ class TC_GAME_API Aura bool IsUsingCharges() const { return m_isUsingCharges; } void SetUsingCharges(bool val) { m_isUsingCharges = val; } void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now); - uint8 IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; + uint8 GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; void TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 98928dd02f..24b9fc45ac 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1571,6 +1571,9 @@ void SpellMgr::LoadSpellProcs() TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask); if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id); + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if ((procEntry.AttributesMask & (PROC_ATTR_DISABLE_EFF_0 << i)) && !spellInfo->Effects[i].IsAura()) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has Attribute PROC_ATTR_DISABLE_EFF_%u, but effect %u is not an aura effect", spellInfo->Id, static_cast(i), static_cast(i)); mSpellProcMap[spellInfo->Id] = procEntry; diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index b3b1e930a9..8ca570d9e2 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -236,7 +236,11 @@ enum ProcAttributes PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000001, // requires proc target to give exp or honor for aura proc PROC_ATTR_TRIGGERED_CAN_PROC = 0x0000002, // aura can proc even with triggered spells PROC_ATTR_REQ_MANA_COST = 0x0000004, // requires triggering spell to have a mana cost for aura proc - PROC_ATTR_REQ_SPELLMOD = 0x0000008 // requires triggering spell to be affected by proccing aura to drop charges + PROC_ATTR_REQ_SPELLMOD = 0x0000008, // requires triggering spell to be affected by proccing aura to drop charges + + PROC_ATTR_DISABLE_EFF_0 = 0x0000010, // explicitly disables aura proc from effects, USE ONLY IF 100% SURE AURA SHOULDN'T PROC + PROC_ATTR_DISABLE_EFF_1 = 0x0000020, // used to avoid a console error if the spell has invalid trigger spell and handled elsewhere + PROC_ATTR_DISABLE_EFF_2 = 0x0000040 // or handling not needed }; struct SpellProcEntry From c62077237da54a4406515d6a434cb3bda24d7e2d Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 19 Nov 2016 03:05:44 -0300 Subject: [PATCH 052/110] Core/Spell: restore old proc system behaviour on auras self proc. --- .../world/3.3.5/2016_11_19_00_world_335.sql | 1 + src/server/game/Entities/Unit/Unit.cpp | 8 +-- src/server/game/Spells/Auras/SpellAuras.cpp | 38 ++++++----- src/server/game/Spells/Spell.cpp | 27 ++++---- src/server/game/Spells/Spell.h | 7 +- src/server/game/Spells/SpellMgr.cpp | 2 +- src/server/game/Spells/SpellMgr.h | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 4 +- .../boss_professor_putricide.cpp | 2 +- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 4 +- .../ShadowLabyrinth/shadow_labyrinth.cpp | 2 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 4 +- src/server/scripts/Spells/spell_generic.cpp | 4 +- src/server/scripts/Spells/spell_item.cpp | 67 ++++++++++--------- 14 files changed, 92 insertions(+), 80 deletions(-) create mode 100644 sql/updates/world/3.3.5/2016_11_19_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql new file mode 100644 index 0000000000..ae32a91d4d --- /dev/null +++ b/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId` IN (71406,71545); -- Anger Capacitor diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c235b96abf..aabb7cddd3 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5045,10 +5045,10 @@ void Unit::SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damag void Unit::ProcSkillsAndAuras(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo) { WeaponAttackType attType = damageInfo ? damageInfo->GetAttackType() : BASE_ATTACK; - if (typeMaskActor && CanProc()) + if (typeMaskActor) ProcSkillsAndReactives(false, actionTarget, typeMaskActor, hitMask, attType); - if (typeMaskActionTarget && actionTarget && actionTarget->CanProc()) + if (typeMaskActionTarget && actionTarget) actionTarget->ProcSkillsAndReactives(true, this, typeMaskActionTarget, hitMask, attType); TriggerAurasProcOnEvent(actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); @@ -10691,7 +10691,7 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin { // prepare data for self trigger ProcEventInfo myProcEventInfo(this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); - if (typeMaskActor && CanProc()) + if (typeMaskActor) { AuraApplicationProcContainer myAurasTriggeringProc; GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, nullptr, myProcEventInfo); @@ -10715,7 +10715,7 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin // prepare data for target trigger ProcEventInfo targetProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo); - if (typeMaskActionTarget && actionTarget && actionTarget->CanProc()) + if (typeMaskActionTarget && actionTarget) { AuraApplicationProcContainer targetAurasTriggeringProc; actionTarget->GetProcAurasTriggeredOnEvent(targetAurasTriggeringProc, nullptr, targetProcEventInfo); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 2dd81b09dc..c8c2897a48 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1741,6 +1741,27 @@ uint8 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, if (!procEntry) return 0; + // check spell triggering us + if (Spell const* spell = eventInfo.GetProcSpell()) + { + // Do not allow auras to proc from effect triggered from itself + if (spell->IsTriggeredByAura(m_spellInfo)) + return 0; + + // check if aura can proc when spell is triggered (exception for hunter auto shot & wands) + if (spell->IsTriggered() && !(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) + if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED)) + return 0; + } + + // check don't break stealth attr present + if (m_spellInfo->HasAura(SPELL_AURA_MOD_STEALTH)) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) + return 0; + } + // check if we have charges to proc with if (IsUsingCharges()) { @@ -1758,24 +1779,9 @@ uint8 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, return 0; // do checks against db data - if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) + if (!SpellMgr::CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) return 0; - // check don't break stealth attr present - if (m_spellInfo->HasAura(SPELL_AURA_MOD_STEALTH)) - { - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) - if (spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) - return 0; - } - - // check if aura can proc when spell is triggered (exception for hunter auto shot & wands) - if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) - if (Spell const* spell = eventInfo.GetProcSpell()) - if (spell->IsTriggered()) - if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED)) - return 0; - // do checks using conditions table if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPELL_PROC, GetId(), eventInfo.GetActor(), eventInfo.GetActionTarget())) return 0; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 992f12b670..29aad3471f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2340,7 +2340,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied // Spells with this flag cannot trigger if effect is cast on self - bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2); + bool const canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2); Unit* spellHitTarget = nullptr; if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target @@ -2770,8 +2770,8 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) // info confirmed with retail sniffs of permafrost and shadow weaving if (!m_hitTriggerSpells.empty()) { - int _duration = 0; - for (HitTriggerSpellList::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) + int32 _duration = 0; + for (auto i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) { if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance)) { @@ -7592,25 +7592,24 @@ void Spell::PrepareTriggersExecutedOnHit() // save auras which were present on spell caster on cast, to prevent triggered auras from affecting caster // and to correctly calculate proc chance when combopoints are present Unit::AuraEffectList const& targetTriggers = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_TARGET_TRIGGER); - for (Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) + for (AuraEffect const* aurEff : targetTriggers) { - if (!(*i)->IsAffectingSpell(m_spellInfo)) + if (!aurEff->IsAffectingSpell(m_spellInfo)) continue; - SpellInfo const* auraSpellInfo = (*i)->GetSpellInfo(); - uint32 auraSpellIdx = (*i)->GetEffIndex(); + + SpellInfo const* auraSpellInfo = aurEff->GetSpellInfo(); + uint32 auraSpellIdx = aurEff->GetEffIndex(); if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(auraSpellInfo->Effects[auraSpellIdx].TriggerSpell)) { // calculate the chance using spell base amount, because aura amount is not updated on combo-points change // this possibly needs fixing - int32 auraBaseAmount = (*i)->GetBaseAmount(); + int32 auraBaseAmount = aurEff->GetBaseAmount(); // proc chance is stored in effect amount - int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount); + int32 chance = m_caster->CalculateSpellDamage(nullptr, auraSpellInfo, auraSpellIdx, &auraBaseAmount); + chance *= aurEff->GetBase()->GetStackAmount(); + // build trigger and add to the list - HitTriggerSpell spellTriggerInfo; - spellTriggerInfo.triggeredSpell = spellInfo; - spellTriggerInfo.triggeredByAura = auraSpellInfo; - spellTriggerInfo.chance = chance * (*i)->GetBase()->GetStackAmount(); - m_hitTriggerSpells.push_back(spellTriggerInfo); + m_hitTriggerSpells.emplace_back(spellInfo, auraSpellInfo, chance); } } } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 5812e83803..4dec4f8e82 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -498,6 +498,8 @@ class TC_GAME_API Spell bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const; + bool IsTriggeredByAura(SpellInfo const* auraSpellInfo) const { return (auraSpellInfo == m_triggeredByAuraSpell); } + bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; } void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; } bool IsInterruptable() const { return !m_executedCurrently; } @@ -678,6 +680,9 @@ class TC_GAME_API Spell struct HitTriggerSpell { + HitTriggerSpell(SpellInfo const* spellInfo, SpellInfo const* auraSpellInfo, int32 procChance) : + triggeredSpell(spellInfo), triggeredByAura(auraSpellInfo), chance(procChance) { } + SpellInfo const* triggeredSpell; SpellInfo const* triggeredByAura; // uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now @@ -686,7 +691,7 @@ class TC_GAME_API Spell bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const; void PrepareTriggersExecutedOnHit(); - typedef std::list HitTriggerSpellList; + typedef std::vector HitTriggerSpellList; HitTriggerSpellList m_hitTriggerSpells; // effect helpers diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 24b9fc45ac..5431f85dcd 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -494,7 +494,7 @@ SpellProcEntry const* SpellMgr::GetSpellProcEntry(uint32 spellId) const return NULL; } -bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const +bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) { // proc type doesn't match if (!(eventInfo.GetTypeMask() & procEntry.ProcFlags)) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 8ca570d9e2..2e34a9dea8 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -610,7 +610,7 @@ class TC_GAME_API SpellMgr // Spell proc table SpellProcEntry const* GetSpellProcEntry(uint32 spellId) const; - bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; + static bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo); // Spell bonus data table SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 03684e3c74..c3fdb7b12f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -279,7 +279,7 @@ class spell_anetheron_vampiric_aura : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); @@ -287,7 +287,7 @@ class spell_anetheron_vampiric_aura : public SpellScriptLoader return; int32 bp = damageInfo->GetDamage() * 3; - eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true); + eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 4ed62c7281..8b738d7380 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1123,7 +1123,7 @@ class spell_putricide_ooze_tank_protection : public SpellScriptLoader PreventDefaultAction(); Unit* actionTarget = eventInfo.GetActionTarget(); - actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 2e0e2157e3..c5a0000fd8 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -227,11 +227,11 @@ class spell_uk_second_wind : public SpellScriptLoader return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); Unit* caster = eventInfo.GetActionTarget(); - caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true); + caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp index 1b0d5c2283..bcfd40234b 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -48,7 +48,7 @@ class spell_mark_of_malice : public SpellScriptLoader if (aurEff->GetBase()->GetCharges() > 1) return; - GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true); + GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 28c424d39b..4d8ca8ff2b 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -239,14 +239,14 @@ class spell_twisted_reflection : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); if (!damageInfo || !damageInfo->GetDamage()) return; - eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true); + eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 8b0c369d5a..0fac5407b3 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3294,7 +3294,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); @@ -3303,7 +3303,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader Unit* caster = eventInfo.GetActor(); int32 bp = damageInfo->GetDamage() / 2; - caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true); + caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index d68604ad39..1c89e65476 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -148,7 +148,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); @@ -172,7 +172,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader } int32 amount = CalculatePct(spellInfo->Effects[i].CalcValue(caster), 40); - caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff); } } @@ -220,7 +220,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); @@ -237,7 +237,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1)) spellId = SPELL_MANIFEST_ANGER_OFF_HAND; - caster->CastSpell(target, spellId, true); + caster->CastSpell(target, spellId, true, nullptr, aurEff); } void Register() override @@ -326,7 +326,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { static std::vector const triggeredSpells[MAX_CLASSES] = { @@ -359,7 +359,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]); - caster->CastSpell(caster, spellId, true); + caster->CastSpell(caster, spellId, true, nullptr, aurEff); if (roll_chance_i(10)) caster->Unit::Say(SAY_MADNESS); @@ -395,10 +395,10 @@ class spell_item_dementia : public SpellScriptLoader return true; } - void HandlePeriodicDummy(AuraEffect const* /*aurEff*/) + void HandlePeriodicDummy(AuraEffect const* aurEff) { PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true); + GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true, nullptr, aurEff); } void Register() override @@ -458,7 +458,7 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader protEff->GetBase()->RefreshDuration(); } else - GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override @@ -584,7 +584,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { static std::vector const triggeredSpells[MAX_CLASSES] = { @@ -616,12 +616,12 @@ class spell_item_deathbringers_will : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - auto const& randomSpells = triggeredSpells[caster->getClass()]; + std::vector const& randomSpells = triggeredSpells[caster->getClass()]; if (randomSpells.empty()) return; uint32 spellId = Trinity::Containers::SelectRandomContainerElement(randomSpells); - caster->CastSpell(caster, spellId, true); + caster->CastSpell(caster, spellId, true, nullptr, aurEff); } void Register() override @@ -1051,7 +1051,7 @@ class spell_item_frozen_shadoweave : public SpellScriptLoader int32 amount = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); Unit* caster = eventInfo.GetActor(); - caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff); } void Register() override @@ -1096,9 +1096,9 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader if (Unit* target = GetHitUnit()) { if (urand(0, 99) < 15) - caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure + caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true); // failure else - caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL); + caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true); } } @@ -1137,10 +1137,10 @@ class spell_item_healing_touch_refund : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true, nullptr, aurEff); } void Register() override @@ -1194,7 +1194,7 @@ class spell_item_heartpierce : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); @@ -1211,6 +1211,7 @@ class spell_item_heartpierce : public SpellScriptLoader case POWER_RAGE: spellId = Rage; break; + // Death Knights can't use daggers, but oh well case POWER_RUNIC_POWER: spellId = RunicPower; break; @@ -1218,7 +1219,7 @@ class spell_item_heartpierce : public SpellScriptLoader return; } - caster->CastSpell((Unit*)nullptr, spellId, true); + caster->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff); } void Register() override @@ -1348,14 +1349,14 @@ class spell_item_mark_of_conquest : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { if (eventInfo.GetTypeMask() & (PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS)) { // in that case, do not cast heal spell PreventDefaultAction(); // but mana instead - eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true, nullptr, aurEff); } } @@ -1514,7 +1515,7 @@ class spell_item_net_o_matic : public SpellScriptLoader else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) spellId = SPELL_NET_O_MATIC_TRIGGERED2; - GetCaster()->CastSpell(target, spellId, true, NULL); + GetCaster()->CastSpell(target, spellId, true, nullptr); } } @@ -1570,7 +1571,7 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break; } - caster->CastSpell(caster, spellId, true, NULL); + caster->CastSpell(caster, spellId, true, nullptr); } void Register() override @@ -1702,7 +1703,7 @@ class spell_item_pet_healing : public SpellScriptLoader int32 bp = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); Unit* caster = eventInfo.GetActor(); - caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true); + caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true, nullptr, aurEff); } void Register() override @@ -2174,7 +2175,7 @@ class spell_item_swift_hand_justice_dummy : public SpellScriptLoader Unit* caster = eventInfo.GetActor(); int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount()); - caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff); } void Register() override @@ -2212,10 +2213,10 @@ class spell_item_totem_of_flowing_water : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true, nullptr, aurEff); } void Register() override @@ -3664,17 +3665,17 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS) - caster->CastSpell(target, HealProc, true); + caster->CastSpell(target, HealProc, true, nullptr, aurEff); if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG) - caster->CastSpell(target, DamageProc, true); + caster->CastSpell(target, DamageProc, true, nullptr, aurEff); } void Register() override @@ -3810,7 +3811,7 @@ class spell_item_sunwell_neck : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); Player* player = eventInfo.GetActor()->ToPlayer(); @@ -3818,10 +3819,10 @@ class spell_item_sunwell_neck : public SpellScriptLoader // Aggression checks are in the spell system... just cast and forget if (player->GetReputationRank(FACTION_ALDOR) == REP_EXALTED) - player->CastSpell(target, Aldors, true); + player->CastSpell(target, Aldors, true, nullptr, aurEff); if (player->GetReputationRank(FACTION_SCRYERS) == REP_EXALTED) - player->CastSpell(target, Scryers, true); + player->CastSpell(target, Scryers, true, nullptr, aurEff); } void Register() override From 6aac0c207317b58b79e5b441094a7d15695e9a61 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 19 Nov 2016 13:56:19 -0300 Subject: [PATCH 053/110] Core/Entities: better support of absorb, resist and block procs --- src/server/game/Entities/Unit/Unit.cpp | 44 +++++++++++++++++++++----- src/server/game/Entities/Unit/Unit.h | 3 +- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aabb7cddd3..4fe16b6c35 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1127,6 +1127,11 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama if (victim->isBlockCritical()) value *= 2; // double blocked percent damageInfo->blocked = CalculatePct(damage, value); + if (damage <= int32(damageInfo->blocked)) + { + damageInfo->blocked = uint32(damage); + damageInfo->fullBlock = true; + } damage -= damageInfo->blocked; } @@ -1164,6 +1169,15 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama damageInfo->damage = damage; DamageInfo dmgInfo(*damageInfo, SPELL_DIRECT_DAMAGE, BASE_ATTACK, PROC_HIT_NONE); CalcAbsorbResist(dmgInfo); + damageInfo->absorb = dmgInfo.GetAbsorb(); + damageInfo->resist = dmgInfo.GetResist(); + + if (damageInfo->absorb) + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); + + if (damageInfo->resist) + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); + damageInfo->damage = dmgInfo.GetDamage(); } @@ -10548,14 +10562,13 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond hitMask |= PROC_HIT_PARRY; break; case SPELL_MISS_BLOCK: - hitMask |= PROC_HIT_BLOCK; + // spells can't be partially blocked (it's damage can though) + hitMask |= PROC_HIT_BLOCK | PROC_HIT_FULL_BLOCK; break; case SPELL_MISS_EVADE: hitMask |= PROC_HIT_EVADE; break; case SPELL_MISS_IMMUNE: - hitMask |= PROC_HIT_IMMUNE; - break; case SPELL_MISS_IMMUNE2: hitMask |= PROC_HIT_IMMUNE; break; @@ -10568,6 +10581,9 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond case SPELL_MISS_REFLECT: hitMask |= PROC_HIT_REFLECT; break; + case SPELL_MISS_RESIST: + hitMask |= PROC_HIT_FULL_RESIST; + break; default: break; } @@ -10576,15 +10592,27 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond { // On block if (damageInfo->blocked) + { hitMask |= PROC_HIT_BLOCK; + if (damageInfo->fullBlock) + hitMask |= PROC_HIT_FULL_BLOCK; + } // On absorb if (damageInfo->absorb) hitMask |= PROC_HIT_ABSORB; - // On crit - if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT) - hitMask |= PROC_HIT_CRITICAL; - else - hitMask |= PROC_HIT_NORMAL; + + // Don't set hit/crit hitMask if damage is nullified + bool const damageNullified = (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 || (hitMask & PROC_HIT_FULL_BLOCK) != 0; + if (!damageNullified) + { + // On crit + if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT) + hitMask |= PROC_HIT_CRITICAL; + else + hitMask |= PROC_HIT_NORMAL; + } + else if ((damageInfo->HitInfo & HITINFO_FULL_RESIST) != 0) + hitMask |= PROC_HIT_FULL_RESIST; } return hitMask; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e72b5cc9ea..921f69ee4f 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1019,7 +1019,7 @@ struct TC_GAME_API SpellNonMeleeDamage { SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask) : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask), - absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0) + absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false) { } Unit *target; @@ -1036,6 +1036,7 @@ struct TC_GAME_API SpellNonMeleeDamage uint32 HitInfo; // Used for help uint32 cleanDamage; + bool fullBlock; }; struct SpellPeriodicAuraLogInfo From 938f43302c742f3161ee4ca6c7eeee7288b5f86e Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 19 Nov 2016 15:43:22 -0300 Subject: [PATCH 054/110] Core/Entities: fix interaction of traps with ffa pvp and sanctuary flags --- .../game/Entities/GameObject/GameObject.cpp | 6 ++- src/server/game/Entities/Unit/Unit.cpp | 44 ++++++++++++------- .../game/Grids/Notifiers/GridNotifiers.h | 9 ++-- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 5077774494..b09bd371e9 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -564,8 +564,8 @@ void GameObject::Update(uint32 diff) if (Unit* owner = GetOwner()) { // Hunter trap: Search units which are unfriendly to the trap's owner - Trinity::NearestUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius); - Trinity::UnitLastSearcher searcher(this, target, checker); + Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius); + Trinity::UnitLastSearcher searcher(this, target, checker); VisitNearbyObject(radius, searcher); } else @@ -1880,6 +1880,8 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge trigger->SetFaction(owner->GetFaction()); if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + // copy pvp state flags from owner + trigger->SetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, owner->GetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG)); // needed for GO casts for proper target validation checks trigger->SetOwnerGUID(owner->GetGUID()); trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, owner->GetGUID()); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4fe16b6c35..9a08cab18e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5459,8 +5459,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const } // check FFA_PVP - if (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP - && target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP) + if (IsFFAPvP() && target->IsFFAPvP()) return REP_HOSTILE; if (selfPlayerOwner) @@ -8434,10 +8433,26 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster())) return false; - // can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player - // skip visibility check for GO casts, needs removal when go cast is implemented - if (GetEntry() != WORLD_TRIGGER && (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target))))) - return false; + // visibility checks + // skip visibility check for GO casts, needs removal when go cast is implemented. Also ignore for gameobject and dynauras + if (GetEntry() != WORLD_TRIGGER && (!obj || !obj->isType(TYPEMASK_GAMEOBJECT | TYPEMASK_DYNAMICOBJECT))) + { + // can't attack invisible + if (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) + { + if (obj && !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea())) + return false; + else if (!obj) + { + // ignore stealth for aoe spells. Ignore stealth if target is player and unit in combat with same player + bool const ignoreStealthCheck = (bySpell && bySpell->IsAffectingArea()) || + (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target)); + + if (!CanSeeOrDetect(target, ignoreStealthCheck)) + return false; + } + } + } // can't attack dead if ((!bySpell || !bySpell->IsAllowingDeadTarget()) && !target->IsAlive()) @@ -8472,7 +8487,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo // PvP, PvC, CvP case // can't attack friendly targets - if ( GetReactionTo(target) > REP_NEUTRAL + if (GetReactionTo(target) > REP_NEUTRAL || target->GetReactionTo(this) > REP_NEUTRAL) return false; @@ -8480,10 +8495,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo Player const* playerAffectingTarget = target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? target->GetAffectingPlayer() : nullptr; // Not all neutral creatures can be attacked (even some unfriendly faction does not react aggresive to you, like Sporaggar) - if ( - (playerAffectingAttacker && !playerAffectingTarget) || - (!playerAffectingAttacker && playerAffectingTarget) - ) + if ((playerAffectingAttacker && !playerAffectingTarget) || + (!playerAffectingAttacker && playerAffectingTarget)) { Player const* player = playerAffectingAttacker ? playerAffectingAttacker : playerAffectingTarget; Unit const* creature = playerAffectingAttacker ? target : this; @@ -8517,15 +8530,14 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo // additional checks - only PvP case if (playerAffectingAttacker && playerAffectingTarget) { - if (target->GetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG) & UNIT_BYTE2_FLAG_PVP) + if (target->IsPvP()) return true; - if (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP - && target->GetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG) & UNIT_BYTE2_FLAG_FFA_PVP) + if (IsFFAPvP() && target->IsFFAPvP()) return true; - return (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1) - || (target->GetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG) & UNIT_BYTE2_FLAG_UNK1); + return HasByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_UNK1) + || target->HasByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_UNK1); } return true; } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 9efd05ca2a..1aa5a4db32 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -893,10 +893,11 @@ namespace Trinity float i_range; }; - class NearestUnfriendlyNoTotemUnitInObjectRangeCheck + class NearestAttackableNoTotemUnitInObjectRangeCheck { public: - NearestUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { } + NearestAttackableNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { } + bool operator()(Unit* u) { if (!u->IsAlive()) @@ -905,13 +906,13 @@ namespace Trinity if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) return false; - if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem()) + if (u->GetTypeId() == TYPEID_UNIT && u->ToCreature()->IsTotem()) return false; if (!u->isTargetableForAttack(false)) return false; - if (!i_obj->IsWithinDistInMap(u, i_range) || i_funit->IsFriendlyTo(u)) + if (!i_obj->IsWithinDistInMap(u, i_range) || !i_funit->_IsValidAttackTarget(u, nullptr, i_obj)) return false; i_range = i_obj->GetDistance(*u); From c7e27dd5114d55835d0cd4db7af24b084f692769 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 19 Nov 2016 20:17:17 -0300 Subject: [PATCH 055/110] Core/Unit: do not allow judgement spells to bypass damage immunity 3f19eea5e41fd47b571c17529e08d9f8caa91705 follow-up. Without the #16658 regression --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9a08cab18e..022dc7b79e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7671,7 +7671,8 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const if (!spellInfo) return false; - if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + // for example 40175 + if (spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) return false; if (spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) From 9dca905ea431cf7689e2424b7fdd19bc7c1a545b Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 02:53:10 +0100 Subject: [PATCH 056/110] Add some missing code --- src/server/game/Entities/Unit/StatSystem.cpp | 13 +++++-- src/server/game/Entities/Unit/Unit.cpp | 35 ++----------------- .../game/Spells/Auras/SpellAuraEffects.cpp | 1 - 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index b75dd7f748..d2c16adfe1 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -178,8 +178,17 @@ void Player::UpdateSpellDamageAndHealingBonus() // Get healing bonus for all schools SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL)); // Get damage bonus for all schools - for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i))); + Unit::AuraEffectList const& modDamageAuras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); + for (uint16 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) + { + SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff) + { + if (aurEff->GetAmount() < 0 && aurEff->GetMiscValue() & (1 << i)) + negativeMod += aurEff->GetAmount(); + return negativeMod; + })); + SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i)); + } } bool Player::UpdateAllStats() diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 022dc7b79e..7f465da6eb 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6600,35 +6600,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin } } - // Custom scripted damage - switch (spellProto->SpellFamilyName) - { - case SPELLFAMILY_DEATHKNIGHT: - // Impurity (dummy effect) - if (GetTypeId() == TYPEID_PLAYER) - { - PlayerSpellMap const& playerSpells = ToPlayer()->GetSpellMap(); - for (auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr) - { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) - continue; - - switch (itr->first) - { - case 49220: - case 49633: - case 49635: - case 49636: - case 49638: - if (SpellInfo const* proto = sSpellMgr->GetSpellInfo(itr->first)) - AddPct(ApCoeffMod, proto->Effects[EFFECT_0].CalcValue()); - break; - } - } - } - break; - } - // Custom scripted damage switch (spellProto->SpellFamilyName) { @@ -6663,14 +6634,14 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras if (HasUnitTypeMask(UNIT_MASK_GUARDIAN)) - DoneAdvertisedBenefit += static_cast(this)->GetBonusDamage(); + DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage(); // Check for table values - float coeff = 0.f; + float coeff = 0.0f; SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); if (bonus) { - WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; + WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 085f5bcece..e18511f167 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4179,7 +4179,6 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(GetAmount()), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(GetAmount()), apply); } - else // Magic damage modifiers implemented in Unit::SpellBaseDamageBonusDone // This information for client side use only From 1cffe9913612bd5ecde51737e5b9852e712cdfc2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 29 Nov 2016 22:09:42 -0300 Subject: [PATCH 057/110] Core/Spells: proc spells after damage apply, not before. Fixes #13025 --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7f465da6eb..bdc9d6a941 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1974,11 +1974,11 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr DealDamageMods(victim, damageInfo.damage, &damageInfo.absorb); SendAttackStateUpdate(&damageInfo); + DealMeleeDamage(&damageInfo, true); + DamageInfo dmgInfo(damageInfo); ProcSkillsAndAuras(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, PROC_SPELL_TYPE_NONE, PROC_SPELL_PHASE_NONE, dmgInfo.GetHitMask(), nullptr, &dmgInfo, nullptr); - DealMeleeDamage(&damageInfo, true); - if (GetTypeId() == TYPEID_PLAYER) TC_LOG_DEBUG("entities.unit", "AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUID().GetCounter(), victim->GetGUID().GetCounter(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e18511f167..b9149b4a81 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5630,9 +5630,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); - caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); - caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); + + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); } void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const @@ -5722,12 +5722,11 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c procVictim |= PROC_FLAG_TAKEN_DAMAGE; } - if (caster->IsAlive()) - caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); - int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); if (caster->IsAlive()) { + caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); + float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); @@ -6075,10 +6074,10 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con spellTypeMask |= PROC_SPELL_TYPE_DAMAGE; } + caster->DealSpellDamage(&damageInfo, true); + DamageInfo dotDamageInfo(damageInfo, DOT, BASE_ATTACK, hitMask); caster->ProcSkillsAndAuras(target, procAttacker, procVictim, spellTypeMask, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &dotDamageInfo, nullptr); - - caster->DealSpellDamage(&damageInfo, true); } void AuraEffect::HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) From 50c04aad05fc1bf9c67698aa1677631b491e150a Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 3 Dec 2016 20:27:15 -0300 Subject: [PATCH 058/110] Core/SpellMgr: added a startup error for possibly unhandled procs --- src/server/game/Spells/SpellMgr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 5431f85dcd..d528de1bc1 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1711,7 +1711,18 @@ void SpellMgr::LoadSpellProcs() } if (!procSpellTypeMask) + { + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (spellInfo->Effects[i].IsAura()) + { + TC_LOG_ERROR("sql.sql", "Spell Id %u has DBC ProcFlags %u, but it's of non-proc aura type, it probably needs an entry in `spell_proc` table to be handled correctly.", spellInfo->Id, spellInfo->ProcFlags); + break; + } + } + continue; + } SpellProcEntry procEntry; procEntry.SchoolMask = 0; From 307b7367680ae1d987e30133d2f76e99e68ba5f4 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 10 Dec 2016 00:37:23 -0300 Subject: [PATCH 059/110] Core/Spell: Undefined SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION attr for now --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Spell.cpp | 64 +++++++++---------- src/server/game/Spells/Spell.h | 14 ++-- src/server/game/Spells/SpellInfo.cpp | 4 +- src/server/game/Spells/SpellInfo.h | 2 +- 5 files changed, 41 insertions(+), 45 deletions(-) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 6fcde5f40f..56a155b5b9 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -557,7 +557,7 @@ enum SpellAttr7 SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell. SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects. SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones. - SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION = 0x00100000, // 20 Blink, Divine Shield, Ice Block + SPELL_ATTR7_UNK20 = 0x00100000, // 20 Blink, Divine Shield, Ice Block SPELL_ATTR7_UNK21 = 0x00200000, // 21 Not set SPELL_ATTR7_UNK22 = 0x00400000, // 22 SPELL_ATTR7_UNK23 = 0x00800000, // 23 Motivate, Mutilate, Shattering Throw diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 29aad3471f..97375defb3 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5854,12 +5854,6 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const bool usableWhileStunned = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_STUNNED); bool usableWhileFeared = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED); bool usableWhileConfused = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED); - if (m_spellInfo->HasAttribute(SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION)) - { - usableWhileStunned = true; - usableWhileFeared = true; - usableWhileConfused = true; - } // Glyph of Pain Suppression // Allow Pain Suppression and Guardian Spirit to be cast while stunned @@ -5875,18 +5869,18 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const if (m_caster->GetCharmerGUID()) { if (Unit* charmer = m_caster->GetCharmer()) - if (charmer->GetUnitBeingMoved() != m_caster && CheckCasterNotImmunedCharmAuras(param1)) + if (charmer->GetUnitBeingMoved() != m_caster && !CheckSpellCancelsCharm(param1)) result = SPELL_FAILED_CHARMED; } - else if (unitflag & UNIT_FLAG_STUNNED && !usableWhileStunned && CheckCasterNotImmunedStunAuras(param1)) + else if (unitflag & UNIT_FLAG_STUNNED && !usableWhileStunned && !CheckSpellCancelsStun(param1)) result = SPELL_FAILED_STUNNED; - else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && CheckCasterNotImmunedSilenceAuras(param1)) + else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && !CheckSpellCancelsSilence(param1)) result = SPELL_FAILED_SILENCED; - else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && CheckCasterNotImmunedPacifyAuras(param1)) + else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && !CheckSpellCancelsPacify(param1)) result = SPELL_FAILED_PACIFIED; - else if (unitflag & UNIT_FLAG_FLEEING && !usableWhileFeared && CheckCasterNotImmunedFearAuras(param1)) + else if (unitflag & UNIT_FLAG_FLEEING && !usableWhileFeared && !CheckSpellCancelsFear(param1)) result = SPELL_FAILED_FLEEING; - else if (unitflag & UNIT_FLAG_CONFUSED && !usableWhileConfused && CheckCasterNotImmunedDisorientAuras(param1)) + else if (unitflag & UNIT_FLAG_CONFUSED && !usableWhileConfused && !CheckSpellCancelsConfuse(param1)) result = SPELL_FAILED_CONFUSED; // Attr must make flag drop spell totally immune from all effects @@ -5896,18 +5890,17 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const return SPELL_CAST_OK; } -// based on sub_00804430 from 12340 client -bool Spell::CheckCasterHasNotImmunedAuraType(AuraType auraType, uint32* param1) const +bool Spell::CheckSpellCancelsAuraEffect(AuraType auraType, uint32* param1) const { // Checking auras is needed now, because you are prevented by some state but the spell grants immunity. Unit::AuraEffectList const& auraEffects = m_caster->GetAuraEffectsByType(auraType); if (auraEffects.empty()) - return false; + return true; for (AuraEffect const* aurEff : auraEffects) { SpellInfo const* auraInfo = aurEff->GetSpellInfo(); - if (m_spellInfo->CanSpellCastOverrideAuraEffect(auraInfo, aurEff->GetEffIndex())) + if (m_spellInfo->SpellCancelsAuraEffect(auraInfo, aurEff->GetEffIndex())) continue; if (param1) @@ -5916,43 +5909,46 @@ bool Spell::CheckCasterHasNotImmunedAuraType(AuraType auraType, uint32* param1) if (!*param1) *param1 = auraInfo->Mechanic; } - return true; + + return false; } - return false; + + return true; } -bool Spell::CheckCasterNotImmunedCharmAuras(uint32* param1) const +bool Spell::CheckSpellCancelsCharm(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_CHARM, param1) || - CheckCasterHasNotImmunedAuraType(SPELL_AURA_AOE_CHARM, param1) || - CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_POSSESS, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_CHARM, param1) && + CheckSpellCancelsAuraEffect(SPELL_AURA_AOE_CHARM, param1) && + CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_POSSESS, param1); } -bool Spell::CheckCasterNotImmunedStunAuras(uint32* param1) const +bool Spell::CheckSpellCancelsStun(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_STUN, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_STUN, param1) && + CheckSpellCancelsAuraEffect(SPELL_AURA_STRANGULATE, param1); } -bool Spell::CheckCasterNotImmunedSilenceAuras(uint32* param1) const +bool Spell::CheckSpellCancelsSilence(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_SILENCE, param1) || - CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY_SILENCE, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_SILENCE, param1) && + CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY_SILENCE, param1); } -bool Spell::CheckCasterNotImmunedPacifyAuras(uint32* param1) const +bool Spell::CheckSpellCancelsPacify(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY, param1) || - CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY_SILENCE, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY, param1) && + CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY_SILENCE, param1); } -bool Spell::CheckCasterNotImmunedFearAuras(uint32* param1) const +bool Spell::CheckSpellCancelsFear(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_FEAR, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_FEAR, param1); } -bool Spell::CheckCasterNotImmunedDisorientAuras(uint32* param1) const +bool Spell::CheckSpellCancelsConfuse(uint32* param1) const { - return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_CONFUSE, param1); + return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_CONFUSE, param1); } SpellCastResult Spell::CheckArenaAndRatedBattlegroundCastRules() const diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 4dec4f8e82..359506011e 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -424,13 +424,13 @@ class TC_GAME_API Spell SpellCastResult CheckCasterAuras(uint32* param1) const; SpellCastResult CheckArenaAndRatedBattlegroundCastRules() const; - bool CheckCasterHasNotImmunedAuraType(AuraType auraType, uint32* param1) const; - bool CheckCasterNotImmunedCharmAuras(uint32* param1) const; - bool CheckCasterNotImmunedStunAuras(uint32* param1) const; - bool CheckCasterNotImmunedSilenceAuras(uint32* param1) const; - bool CheckCasterNotImmunedPacifyAuras(uint32* param1) const; - bool CheckCasterNotImmunedFearAuras(uint32* param1) const; - bool CheckCasterNotImmunedDisorientAuras(uint32* param1) const; + bool CheckSpellCancelsAuraEffect(AuraType auraType, uint32* param1) const; + bool CheckSpellCancelsCharm(uint32* param1) const; + bool CheckSpellCancelsStun(uint32* param1) const; + bool CheckSpellCancelsSilence(uint32* param1) const; + bool CheckSpellCancelsPacify(uint32* param1) const; + bool CheckSpellCancelsFear(uint32* param1) const; + bool CheckSpellCancelsConfuse(uint32* param1) const; int32 CalculateDamage(uint8 i, Unit const* target) const { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_spellValue->EffectBasePoints[i]); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index c3a7e015e9..ec181eeca3 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3054,8 +3054,8 @@ bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInf return false; } -// based on client sub_007FDFA0 -bool SpellInfo::CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const +// based on client Spell_C::CancelsAuraEffect +bool SpellInfo::SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const { if (!HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)) return false; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 1b85b3b959..a0da100966 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -570,7 +570,7 @@ class TC_GAME_API SpellInfo // spell immunities void ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const; bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const; - bool CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const; + bool SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const; private: // loading helpers From 6e62130e967c9fd83e9610d4aaab3fbabc7a7ac3 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 11 Dec 2016 15:01:13 -0300 Subject: [PATCH 060/110] Core/Spell: improved immunity logic for dispels --- .../game/Entities/Creature/Creature.cpp | 10 +++---- src/server/game/Entities/Creature/Creature.h | 4 +-- src/server/game/Entities/Player/Player.cpp | 4 +-- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Totem/Totem.cpp | 4 +-- src/server/game/Entities/Totem/Totem.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 30 +++++++++---------- src/server/game/Entities/Unit/Unit.h | 4 +-- src/server/game/Spells/Auras/SpellAuras.cpp | 4 +-- src/server/game/Spells/Spell.cpp | 8 ++--- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index de208f8970..f4bf568610 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1873,7 +1873,7 @@ void Creature::LoadMechanicTemplateImmunity() } } -bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) const +bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const { if (!spellInfo) return false; @@ -1883,7 +1883,7 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) const { if (!spellInfo->Effects[i].IsEffect()) continue; - if (!IsImmunedToSpellEffect(spellInfo, i)) + if (!IsImmunedToSpellEffect(spellInfo, i, caster)) { immunedToAllEffects = false; break; @@ -1892,15 +1892,15 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) const if (immunedToAllEffects) return true; - return Unit::IsImmunedToSpell(spellInfo); + return Unit::IsImmunedToSpell(spellInfo, caster); } -bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const +bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const { if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL) return true; - return Unit::IsImmunedToSpellEffect(spellInfo, index); + return Unit::IsImmunedToSpellEffect(spellInfo, index, caster); } bool Creature::isElite() const diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index b71437de47..6eb8f15c74 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -497,8 +497,8 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool isCanTrainingAndResetTalentsOf(Player* player) const; bool CanCreatureAttack(Unit const* victim, bool force = true) const; void LoadMechanicTemplateImmunity(); - bool IsImmunedToSpell(SpellInfo const* spellInfo) const override; // override Unit::IsImmunedToSpell - bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override; // override Unit::IsImmunedToSpellEffect + bool IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const override; + bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const override; bool isElite() const; bool isWorldBoss() const; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7d3def9079..a1139d9cba 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2225,7 +2225,7 @@ void Player::SetObjectScale(float scale) SendMovementSetCollisionHeight(scale * GetCollisionHeight(IsMounted())); } -bool Player::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const +bool Player::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const { // players are immune to taunt (the aura and the spell effect) if (spellInfo->Effects[index].IsAura(SPELL_AURA_MOD_TAUNT)) @@ -2233,7 +2233,7 @@ bool Player::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) co if (spellInfo->Effects[index].IsEffect(SPELL_EFFECT_ATTACK_ME)) return true; - return Unit::IsImmunedToSpellEffect(spellInfo, index); + return Unit::IsImmunedToSpellEffect(spellInfo, index, caster); } void Player::RegenerateAll() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2384bed559..61ff993127 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1243,7 +1243,7 @@ class TC_GAME_API Player : public Unit, public GridObject static bool BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, ByteBuffer* bitBuffer); - bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override; + bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const override; void SetInWater(bool apply); diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 9bb78f95b6..14a0ca1f19 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -143,7 +143,7 @@ void Totem::UnSummon(uint32 msTime) AddObjectToRemoveList(); } -bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const +bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const { /// @todo possibly all negative auras immune? if (GetEntry() == 5925) @@ -160,5 +160,5 @@ bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) con break; } - return Creature::IsImmunedToSpellEffect(spellInfo, index); + return Creature::IsImmunedToSpellEffect(spellInfo, index, caster); } diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index f8283a97e8..8a0edb1943 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -58,7 +58,7 @@ class TC_GAME_API Totem : public Minion void UpdateAttackPowerAndDamage(bool /*ranged*/) override { } void UpdateDamagePhysical(WeaponAttackType /*attType*/) override { } - bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override; + bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const override; protected: TotemType m_type; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bdc9d6a941..61ccecdcee 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2589,13 +2589,13 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo // Parry // For spells // Resist -SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool CanReflect) +SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect /*= false*/) { if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) return SPELL_MISS_NONE; // Check for immune - if (victim->IsImmunedToSpell(spellInfo)) + if (victim->IsImmunedToSpell(spellInfo, this)) return SPELL_MISS_IMMUNE; // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply @@ -2616,7 +2616,7 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo return SPELL_MISS_EVADE; // Try victim reflect spell - if (CanReflect) + if (canReflect) { int32 reflectchance = victim->GetTotalAuraModifier(SPELL_AURA_REFLECT_SPELLS); Unit::AuraEffectList const& mReflectSpellsSchool = victim->GetAuraEffectsByType(SPELL_AURA_REFLECT_SPELLS_SCHOOL); @@ -7665,7 +7665,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const return false; } -bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const +bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const { if (!spellInfo) return false; @@ -7698,7 +7698,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately - if (!IsImmunedToSpellEffect(spellInfo, i)) + if (!IsImmunedToSpellEffect(spellInfo, i, caster)) { immuneToAllEffects = false; break; @@ -7715,7 +7715,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const { SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); if ((itr->first & spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive()) + && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) return true; } @@ -7744,7 +7744,7 @@ uint32 Unit::GetMechanicImmunityMask() const return mask; } -bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const +bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const { if (!spellInfo || !spellInfo->Effects[index].IsEffect()) return false; @@ -7754,13 +7754,13 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons // If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effects[index].Effect; - auto const& effectList = m_spellImmune[IMMUNITY_EFFECT]; + SpellImmuneContainer const& effectList = m_spellImmune[IMMUNITY_EFFECT]; if (effectList.count(effect) > 0) return true; if (uint32 mechanic = spellInfo->Effects[index].Mechanic) { - auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; + SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; if (mechanicList.count(mechanic) > 0) return true; } @@ -7778,8 +7778,8 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons // Check for immune to application of harmful magical effects AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) - if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school - !spellInfo->IsPositiveEffect(index)) // Harmful + if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school + (!IsFriendlyTo(caster) || !spellInfo->IsPositiveEffect(index))) // Harmful return true; } } @@ -12353,15 +12353,15 @@ Aura* Unit::AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target) if (!spellInfo) return NULL; - if (target->IsImmunedToSpell(spellInfo)) + if (target->IsImmunedToSpell(spellInfo, this)) return NULL; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (!(effMask & (1<IsImmunedToSpellEffect(spellInfo, i)) - effMask &= ~(1<IsImmunedToSpellEffect(spellInfo, i, this)) + effMask &= ~(1 << i); } if (Aura* aura = Aura::TryRefreshStackOrCreate(spellInfo, effMask, target, this)) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 921f69ee4f..0158a27778 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2054,13 +2054,13 @@ class TC_GAME_API Unit : public WorldObject uint32 GetRemainingPeriodicAmount(ObjectGuid caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply); - virtual bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // redefined in Creature + virtual bool IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const; // redefined in Creature uint32 GetSchoolImmunityMask() const; uint32 GetMechanicImmunityMask() const; bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const; bool IsImmunedToDamage(SpellInfo const* spellInfo) const; - virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature + virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit* caster) const; // redefined in Creature static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS); uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index c8c2897a48..88f5313381 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -550,11 +550,11 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) // check target immunities for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { - if (itr->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex)) + if (itr->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex, caster)) itr->second &= ~(1 << effIndex); } if (!itr->second - || itr->first->IsImmunedToSpell(GetSpellInfo()) + || itr->first->IsImmunedToSpell(GetSpellInfo(), caster) || !CanBeAppliedOn(itr->first)) addUnit = false; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 97375defb3..70ded10536 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1178,7 +1178,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge // find last added target for this effect for (std::list::reverse_iterator ihit = m_UniqueTargetInfo.rbegin(); ihit != m_UniqueTargetInfo.rend(); ++ihit) { - if (ihit->effectMask & (1<effectMask & (1 << effIndex)) { referer = ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID); break; @@ -2077,7 +2077,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= // Check for effect immune skip if immuned for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) - if (target->IsImmunedToSpellEffect(m_spellInfo, effIndex)) + if (target->IsImmunedToSpellEffect(m_spellInfo, effIndex, m_caster)) effectMask &= ~(1 << effIndex); ObjectGuid targetGUID = target->GetGUID(); @@ -2557,14 +2557,14 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA return SPELL_MISS_EVADE; // For delayed spells immunity may be applied between missile launch and hit - check immunity for that case - if (m_spellInfo->Speed && unit->IsImmunedToSpell(m_spellInfo)) + if (m_spellInfo->Speed && unit->IsImmunedToSpell(m_spellInfo, m_caster)) return SPELL_MISS_IMMUNE; // disable effects to which unit is immune SpellMissInfo returnVal = SPELL_MISS_IMMUNE; for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber) if (effectMask & (1 << effectNumber)) - if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber)) + if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber, m_caster)) effectMask &= ~(1 << effectNumber); if (!effectMask) From f12035a600aa549cd01a5f0d27b348b5f59bdf50 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 12 Dec 2016 19:35:42 -0300 Subject: [PATCH 061/110] Core/Unit: added missing nullptr check in IsImmunedToSpellEffect Closes #18461 --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 61ccecdcee..8b7858d84d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7778,8 +7778,8 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit // Check for immune to application of harmful magical effects AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) - if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school - (!IsFriendlyTo(caster) || !spellInfo->IsPositiveEffect(index))) // Harmful + if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school + ((caster && !IsFriendlyTo(caster)) || !spellInfo->IsPositiveEffect(index))) // Harmful return true; } } From aee4958ed83bb1ceff962f566b59f43cb4fda452 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 12 Dec 2016 12:22:29 -0300 Subject: [PATCH 062/110] Core/Unit: added GetTotalAuraXXX overloads taking a predicate --- src/server/game/Entities/Unit/Unit.cpp | 317 +++++++++++-------------- src/server/game/Entities/Unit/Unit.h | 7 +- 2 files changed, 149 insertions(+), 175 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8b7858d84d..43947d3f5e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4559,261 +4559,230 @@ uint32 Unit::GetDoTsByCaster(ObjectGuid casterGUID) const return dots; } -int32 Unit::GetTotalAuraModifier(AuraType auratype) const +int32 Unit::GetTotalAuraModifier(AuraType auratype, std::function const& predicate) const { AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); if (mTotalAuraList.empty()) return 0; - std::map SameEffectSpellGroup; + std::map sameEffectSpellGroup; int32 modifier = 0; - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - modifier += (*i)->GetAmount(); + for (AuraEffect const* aurEff : mTotalAuraList) + { + if (predicate(aurEff)) + { + // Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup + // If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup)) + modifier += aurEff->GetAmount(); + } + } - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + // Add the highest of the Same Effect Stack Rule SpellGroups to the accumulator + for (auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr) modifier += itr->second; return modifier; } +float Unit::GetTotalAuraMultiplier(AuraType auratype, std::function const& predicate) const +{ + AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); + if (mTotalAuraList.empty()) + return 1.0f; + + std::map sameEffectSpellGroup; + float multiplier = 1.0f; + + for (AuraEffect const* aurEff : mTotalAuraList) + { + if (predicate(aurEff)) + { + // Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup + // If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup)) + AddPct(multiplier, aurEff->GetAmount()); + } + } + + // Add the highest of the Same Effect Stack Rule SpellGroups to the multiplier + for (auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr) + AddPct(multiplier, itr->second); + + return multiplier; +} + +int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype, std::function const& predicate) const +{ + AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); + if (mTotalAuraList.empty()) + return 0; + + int32 modifier = 0; + for (AuraEffect const* aurEff : mTotalAuraList) + { + if (predicate(aurEff)) + modifier = std::max(modifier, aurEff->GetAmount()); + } + + return modifier; +} + +int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype, std::function const& predicate) const +{ + AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); + if (mTotalAuraList.empty()) + return 0; + + int32 modifier = 0; + for (AuraEffect const* aurEff : mTotalAuraList) + { + if (predicate(aurEff)) + modifier = std::min(modifier, aurEff->GetAmount()); + } + + return modifier; +} + +int32 Unit::GetTotalAuraModifier(AuraType auratype) const +{ + return GetTotalAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; }); +} + float Unit::GetTotalAuraMultiplier(AuraType auratype) const { - float multiplier = 1.0f; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - AddPct(multiplier, (*i)->GetAmount()); - - return multiplier; + return GetTotalAuraMultiplier(auratype, [](AuraEffect const* /*aurEff*/) { return true; }); } int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - { - if ((*i)->GetAmount() > modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + return GetMaxPositiveAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; }); } int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - if ((*i)->GetAmount() < modifier) - modifier = (*i)->GetAmount(); - - return modifier; + return GetMaxNegativeAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; }); } int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 miscMask) const { - std::map SameEffectSpellGroup; - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - if ((*i)->GetMiscValue() & miscMask) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - modifier += (*i)->GetAmount(); - - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - modifier += itr->second; - - return modifier; + return GetTotalAuraModifier(auratype, [miscMask](AuraEffect const* aurEff) -> bool + { + if ((aurEff->GetMiscValue() & miscMask) != 0) + return true; + return false; + }); } float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 miscMask) const { - std::map SameEffectSpellGroup; - float multiplier = 1.0f; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetTotalAuraMultiplier(auratype, [miscMask](AuraEffect const* aurEff) -> bool { - if (((*i)->GetMiscValue() & miscMask)) - { - // Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup - // If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - AddPct(multiplier, (*i)->GetAmount()); - } - } - // Add the highest of the Same Effect Stack Rule SpellGroups to the multiplier - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - AddPct(multiplier, itr->second); - - return multiplier; + if ((aurEff->GetMiscValue() & miscMask) != 0) + return true; + return false; + }); } -int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 miscMask, const AuraEffect* except) const +int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 miscMask, AuraEffect const* except /*= nullptr*/) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxPositiveAuraModifier(auratype, [miscMask, except](AuraEffect const* aurEff) -> bool { - if (except != (*i) && (*i)->GetMiscValue()& miscMask && (*i)->GetAmount() > modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if (except != aurEff && (aurEff->GetMiscValue() & miscMask) != 0) + return true; + return false; + }); } int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 miscMask) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxNegativeAuraModifier(auratype, [miscMask](AuraEffect const* aurEff) -> bool { - if ((*i)->GetMiscValue()& miscMask && (*i)->GetAmount() < modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if ((aurEff->GetMiscValue() & miscMask) != 0) + return true; + return false; + }); } int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const { - std::map SameEffectSpellGroup; - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetTotalAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool { - if ((*i)->GetMiscValue() == miscValue) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - modifier += (*i)->GetAmount(); - } - - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - modifier += itr->second; - - return modifier; + if (aurEff->GetMiscValue() == miscValue) + return true; + return false; + }); } float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 miscValue) const { - std::map SameEffectSpellGroup; - float multiplier = 1.0f; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetTotalAuraMultiplier(auratype, [miscValue](AuraEffect const* aurEff) -> bool { - if ((*i)->GetMiscValue() == miscValue) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - AddPct(multiplier, (*i)->GetAmount()); - } - - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - AddPct(multiplier, itr->second); - - return multiplier; + if (aurEff->GetMiscValue() == miscValue) + return true; + return false; + }); } int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxPositiveAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool { - if ((*i)->GetMiscValue() == miscValue && (*i)->GetAmount() > modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if (aurEff->GetMiscValue() == miscValue) + return true; + return false; + }); } int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxNegativeAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool { - if ((*i)->GetMiscValue() == miscValue && (*i)->GetAmount() < modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if (aurEff->GetMiscValue() == miscValue) + return true; + return false; + }); } int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { - std::map SameEffectSpellGroup; - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetTotalAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool { - if ((*i)->IsAffectingSpell(affectedSpell)) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - modifier += (*i)->GetAmount(); - } - - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - modifier += itr->second; - - return modifier; + if (aurEff->IsAffectingSpell(affectedSpell)) + return true; + return false; + }); } float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { - std::map SameEffectSpellGroup; - float multiplier = 1.0f; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetTotalAuraMultiplier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool { - if ((*i)->IsAffectingSpell(affectedSpell)) - if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) - AddPct(multiplier, (*i)->GetAmount()); - } - - for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - AddPct(multiplier, itr->second); - - return multiplier; + if (aurEff->IsAffectingSpell(affectedSpell)) + return true; + return false; + }); } int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxPositiveAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool { - if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() > modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if (aurEff->IsAffectingSpell(affectedSpell)) + return true; + return false; + }); } int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { - int32 modifier = 0; - - AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); - for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) + return GetMaxNegativeAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool { - if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() < modifier) - modifier = (*i)->GetAmount(); - } - - return modifier; + if (aurEff->IsAffectingSpell(affectedSpell)) + return true; + return false; + }); } float Unit::GetResistanceBuffMods(SpellSchools school, bool positive) const diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0158a27778..cb49a52add 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1850,9 +1850,14 @@ class TC_GAME_API Unit : public WorldObject int32 GetMaxPositiveAuraModifier(AuraType auratype) const; int32 GetMaxNegativeAuraModifier(AuraType auratype) const; + int32 GetTotalAuraModifier(AuraType auratype, std::function const& predicate) const; + float GetTotalAuraMultiplier(AuraType auratype, std::function const& predicate) const; + int32 GetMaxPositiveAuraModifier(AuraType auratype, std::function const& predicate) const; + int32 GetMaxNegativeAuraModifier(AuraType auratype, std::function const& predicate) const; + int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const; float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const; - int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const; + int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, AuraEffect const* except = nullptr) const; int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const; int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const; From 4f3f455de45242f4daadcad3d596e3c462071b00 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 13 Dec 2016 15:15:20 -0300 Subject: [PATCH 063/110] Core/Spell: partial revert of SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE immunity handling - Bonus: without breaking Banish... yay! Closes #18370 --- src/server/game/Entities/Unit/Unit.cpp | 20 ++++++++++---------- src/server/game/Spells/SpellInfo.cpp | 11 +++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 43947d3f5e..ff2a2daf44 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7667,6 +7667,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately + if (!spellInfo->Effects[i].IsEffect()) + continue; + if (!IsImmunedToSpellEffect(spellInfo, i, caster)) { immuneToAllEffects = false; @@ -7677,17 +7680,14 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - if (!spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) { - SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; - for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) - { - SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); - if ((itr->first & spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) - && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) - return true; - } + SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); + if ((itr->first & spellInfo->GetSchoolMask()) + && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) + && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) + return true; } return false; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index ec181eeca3..c98dee5e42 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1463,6 +1463,17 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)) return true; + // these spells (Cyclone for example) can pierce all... + if (HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) + { + // ...but not these (Divine shield, Ice block, Cyclone and Banish for example) + if (!auraSpellInfo || + (auraSpellInfo->Mechanic != MECHANIC_IMMUNE_SHIELD && + auraSpellInfo->Mechanic != MECHANIC_INVULNERABILITY && + (auraSpellInfo->Mechanic != MECHANIC_BANISH || IsRankOf(auraSpellInfo)))) // Banish shouldn't be immune to itself + return true; + } + // Dispels other auras on immunity, check if this spell makes the unit immune to aura if (HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) && CanSpellProvideImmunityAgainstAura(auraSpellInfo)) return true; From 62f9b5a0a14e98543c917e757c8009f9a1d175cb Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 13 Dec 2016 15:20:14 -0300 Subject: [PATCH 064/110] Core/Misc: readd some codestyle changes inadvertently reverted --- src/server/game/Entities/Unit/Unit.cpp | 12 ++++++------ src/server/game/Spells/SpellEffects.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ff2a2daf44..c1b146d7b8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6603,14 +6603,14 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras if (HasUnitTypeMask(UNIT_MASK_GUARDIAN)) - DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage(); + DoneAdvertisedBenefit += static_cast(this)->GetBonusDamage(); // Check for table values - float coeff = 0.0f; + float coeff = 0.f; SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); if (bonus) { - WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; + WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); @@ -7810,10 +7810,10 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType float DoneTotalMod = 1.0f; // Some spells don't benefit from pct done mods - if (spellProto) + if (spellProto && !spellProto->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)) { // mods for SPELL_SCHOOL_MASK_NORMAL are already factored in base melee damage calculation - if (!spellProto->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) + if (!(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) { float maxModDamagePercentSchool = 0.0f; if (GetTypeId() == TYPEID_PLAYER) @@ -8681,7 +8681,7 @@ int32 Unit::ModifyPowerPct(Powers power, float pct, bool apply) uint32 Unit::GetAttackTime(WeaponAttackType att) const { - float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME+att) / m_modAttackSpeedPct[att]; + float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + att) / m_modAttackSpeedPct[att]; return (uint32)f_BaseAttackTime; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 6362bbc284..ec09b7f189 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3070,7 +3070,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // if (addPctMods) { percent mods are added in Unit::CalculateDamage } else { percent mods are added in Unit::MeleeDamageBonusDone } // this distinction is neccessary to properly inform the client about his autoattack damage values from Script_UnitDamage - bool addPctMods = !m_spellInfo->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL); + bool const addPctMods = !m_spellInfo->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL); if (addPctMods) { UnitMods unitMod; From d7876762f0c4793a28aecc601eb216c2c51e2d45 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 15 Dec 2016 10:01:34 -0300 Subject: [PATCH 065/110] Core/Spell: add an exception for Cyclone ignoring it's own immunity using dispel type - Unsure of what is the correct check, most generic thing I could make Closes #18479 --- src/server/game/Spells/SpellInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index c98dee5e42..a83b2da8f1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1470,7 +1470,7 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const if (!auraSpellInfo || (auraSpellInfo->Mechanic != MECHANIC_IMMUNE_SHIELD && auraSpellInfo->Mechanic != MECHANIC_INVULNERABILITY && - (auraSpellInfo->Mechanic != MECHANIC_BANISH || IsRankOf(auraSpellInfo)))) // Banish shouldn't be immune to itself + (auraSpellInfo->Mechanic != MECHANIC_BANISH || (IsRankOf(auraSpellInfo) && auraSpellInfo->Dispel != DISPEL_NONE)))) // Banish shouldn't be immune to itself, but Cyclone should return true; } From 85cfc406ddf2d58957eb40909fb5bc79191a4e18 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 15 Dec 2016 10:43:15 -0300 Subject: [PATCH 066/110] Core/Script: Implement Paralytic Poison Closes #16905 --- .../world/3.3.5/2016_12_15_00_world.sql | 3 ++ src/server/scripts/Spells/spell_generic.cpp | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sql/updates/world/3.3.5/2016_12_15_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_12_15_00_world.sql b/sql/updates/world/3.3.5/2016_12_15_00_world.sql new file mode 100644 index 0000000000..5b749f075a --- /dev/null +++ b/sql/updates/world/3.3.5/2016_12_15_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_paralytic_poison'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(35201, 'spell_gen_paralytic_poison'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 0fac5407b3..a34fdf39be 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2298,6 +2298,48 @@ class spell_gen_orc_disguise : public SpellScriptLoader } }; +enum ParalyticPoison +{ + SPELL_PARALYSIS = 35202 +}; + +// 35201 - Paralytic Poison +class spell_gen_paralytic_poison : public SpellScriptLoader +{ + public: + spell_gen_paralytic_poison() : SpellScriptLoader("spell_gen_paralytic_poison") { } + + class spell_gen_paralytic_poison_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_paralytic_poison_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PARALYSIS)) + return false; + return true; + } + + void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + GetTarget()->CastSpell((Unit*)nullptr, SPELL_PARALYSIS, true, nullptr, aurEff); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_paralytic_poison_AuraScript::HandleStun, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_paralytic_poison_AuraScript(); + } +}; + class spell_gen_proc_below_pct_damaged : public SpellScriptLoader { public: @@ -4130,6 +4172,7 @@ void AddSC_generic_spell_scripts() new spell_gen_obsidian_armor(); new spell_gen_oracle_wolvar_reputation(); new spell_gen_orc_disguise(); + new spell_gen_paralytic_poison(); new spell_gen_proc_below_pct_damaged("spell_item_soul_harvesters_charm"); new spell_gen_proc_below_pct_damaged("spell_item_commendation_of_kaelthas"); new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin"); From be418d367172565d20e5229307299e9aa87caeb8 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 15 Dec 2016 11:24:48 -0300 Subject: [PATCH 067/110] Core/Spell: fix for hitmask being ignored in finish phase procs --- src/server/game/Spells/Spell.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 70ded10536..1b7fcba5e2 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2335,7 +2335,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Fill base trigger info uint32 procAttacker = m_procAttacker; uint32 procVictim = m_procVictim; - uint32 hitMask = m_hitMask; + uint32 hitMask = PROC_HIT_NONE; m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied @@ -2518,6 +2518,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) } } + // set hitmask for finish procs + m_hitMask |= hitMask; + // spellHitTarget can be null if spell is missed in DoSpellHitOnUnit if (missInfo != SPELL_MISS_EVADE && spellHitTarget && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))) { @@ -3592,11 +3595,7 @@ void Spell::_handle_finish_phase() procAttacker = m_spellInfo->IsPositive() ? PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS : PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG; } - uint32 hitMask = m_hitMask; - if (!(hitMask & PROC_HIT_CRITICAL)) - hitMask |= PROC_HIT_NORMAL; - - m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_FINISH, hitMask, this, nullptr, nullptr); + m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_FINISH, m_hitMask, this, nullptr, nullptr); } void Spell::SendSpellCooldown() From 0814834492865b60d8b7e9fa5feee0c3b3e03902 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 28 Dec 2016 23:38:03 -0300 Subject: [PATCH 068/110] Core/Spell: reverted stun aura handling Partial revert of 50a3ce5703bdaa4fe16e2e773eabafa9a4818083 Closes #18487 Closes #18490 Closes #18497 --- src/server/game/Spells/Spell.cpp | 44 ++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1b7fcba5e2..69394ddf2c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5865,14 +5865,54 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const // Get unit state uint32 const unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); + + // this check should only be done when player does cast directly + // (ie not when it's called from a script) Breaks for example PlayerAI when charmed + /* if (m_caster->GetCharmerGUID()) { if (Unit* charmer = m_caster->GetCharmer()) if (charmer->GetUnitBeingMoved() != m_caster && !CheckSpellCancelsCharm(param1)) result = SPELL_FAILED_CHARMED; } - else if (unitflag & UNIT_FLAG_STUNNED && !usableWhileStunned && !CheckSpellCancelsStun(param1)) - result = SPELL_FAILED_STUNNED; + */ + + if (unitflag & UNIT_FLAG_STUNNED) + { + // spell is usable while stunned, check if caster has allowed stun auras, another stun types must prevent cast spell + if (usableWhileStunned) + { + static uint32 const allowedStunMask = + 1 << MECHANIC_STUN + | 1 << MECHANIC_SLEEP; + + bool foundNotStun = false; + Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); + for (AuraEffect const* stunEff : stunAuras) + { + uint32 const stunMechanicMask = stunEff->GetSpellInfo()->GetAllEffectsMechanicMask(); + if (stunMechanicMask && !(stunMechanicMask & allowedStunMask)) + { + foundNotStun = true; + + // fill up aura mechanic info to send client proper error message + if (param1) + { + *param1 = stunEff->GetSpellInfo()->Effects[stunEff->GetEffIndex()].Mechanic; + if (!*param1) + *param1 = stunEff->GetSpellInfo()->Mechanic; + } + break; + } + } + + if (foundNotStun) + result = SPELL_FAILED_STUNNED; + } + // Not usable while stunned, however spell might provide some immunity that allows to cast it anyway + else if (!CheckSpellCancelsStun(param1)) + result = SPELL_FAILED_STUNNED; + } else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && !CheckSpellCancelsSilence(param1)) result = SPELL_FAILED_SILENCED; else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && !CheckSpellCancelsPacify(param1)) From 71e33396367e238dc0a4f99e785440a3f57915e7 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 29 Dec 2016 03:34:54 -0300 Subject: [PATCH 069/110] Core/Spell: Prevent NO_TARGET auras from actually selecting target --- src/server/game/Spells/SpellInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a83b2da8f1..617cf09f8d 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -645,7 +645,9 @@ uint32 SpellEffectInfo::GetProvidedTargetMask() const uint32 SpellEffectInfo::GetMissingTargetMask(bool srcSet /*= false*/, bool dstSet /*= false*/, uint32 mask /*=0*/) const { uint32 effImplicitTargetMask = GetTargetFlagMask(GetUsedTargetObjectType()); - uint32 providedTargetMask = GetTargetFlagMask(TargetA.GetObjectType()) | GetTargetFlagMask(TargetB.GetObjectType()) | mask; + uint32 providedTargetMask = GetProvidedTargetMask() | mask; + if (!providedTargetMask) // no targets to select + return 0; // remove all flags covered by effect target mask if (providedTargetMask & TARGET_FLAG_UNIT_MASK) From c89bf30b4d1c3a59cfd2b377a7c0cd34f7eee218 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 30 Dec 2016 01:57:14 -0300 Subject: [PATCH 070/110] Missing change --- .../world/3.3.5/2016_12_30_02_world_335.sql | 5 ++++ src/server/game/Entities/Unit/Unit.cpp | 27 +++++++++++++++++++ src/server/game/Spells/Auras/SpellAuras.cpp | 18 ------------- 3 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 sql/updates/world/3.3.5/2016_12_30_02_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql b/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql new file mode 100644 index 0000000000..23954b3bee --- /dev/null +++ b/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql @@ -0,0 +1,5 @@ +UPDATE `spell_proc` SET `SpellFamilyMask2`=0, `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId`=-31571; +DELETE FROM `spell_proc` WHERE `SpellId` IN (57529, 57531); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(57529, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0), +(57531, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c1b146d7b8..f058c60ee6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7029,7 +7029,34 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto crit_chance = 0.0f; // For other schools else if (GetTypeId() == TYPEID_PLAYER) + { crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + GetFirstSchoolInMask(schoolMask)); + + // register aura mod, this is needed for Arcane Potency + if (Spell* spell = ToPlayer()->m_spellModTakingSpell) + { + std::vector affectingAuras; + (void)GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE, [&affectingAuras](AuraEffect const* aurEff) -> bool + { + affectingAuras.push_back(aurEff->GetBase()); + return true; + }); + + (void)GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, [&affectingAuras, schoolMask](AuraEffect const* aurEff) -> bool + { + if ((aurEff->GetMiscValue() & schoolMask) != 0) + { + affectingAuras.push_back(aurEff->GetBase()); + return true; + } + + return false; + }); + + for (Aura* aura : affectingAuras) + spell->m_appliedMods.insert(aura); + } + } else { crit_chance = (float)m_baseSpellCritChance; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 88f5313381..90532e89df 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1283,24 +1283,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } switch (GetId()) { - case 12536: // Clearcasting - case 12043: // Presence of Mind - // Arcane Potency - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, 2120, 0)) - { - uint32 spellId = 0; - - switch (aurEff->GetId()) - { - case 31571: spellId = 57529; break; - case 31572: spellId = 57531; break; - default: - TC_LOG_ERROR("spells", "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); - } - if (spellId) - caster->CastSpell(caster, spellId, true); - } - break; default: break; } From a15aaf68c36efac452dbb62e8dd33512cd67bba0 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 30 Dec 2016 13:59:46 -0300 Subject: [PATCH 071/110] Core/Spell: reverted changes for NO_TARGET handling Partial revert of 584d347b70be521d7431dfe1694b80f2e95b957b Closes #18666 --- src/server/game/Spells/SpellInfo.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 617cf09f8d..bd9c2feda2 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -646,8 +646,6 @@ uint32 SpellEffectInfo::GetMissingTargetMask(bool srcSet /*= false*/, bool dstSe { uint32 effImplicitTargetMask = GetTargetFlagMask(GetUsedTargetObjectType()); uint32 providedTargetMask = GetProvidedTargetMask() | mask; - if (!providedTargetMask) // no targets to select - return 0; // remove all flags covered by effect target mask if (providedTargetMask & TARGET_FLAG_UNIT_MASK) From c1accd4537314d2f0ecbf0052404d137dd8c8058 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 30 Dec 2016 15:38:33 -0300 Subject: [PATCH 072/110] Core/Player: fix some PCT_MOD charge consumption By xinef1 Closes #18516 --- src/server/game/Entities/Player/Player.cpp | 8 ++++++++ src/server/game/Entities/Player/Player.h | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a1139d9cba..49425e5773 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21357,6 +21357,14 @@ void Player::RestoreAllSpellMods(uint32 ownerAuraId /*= 0*/, Aura* aura /*= null RestoreSpellMods(spell, ownerAuraId, aura); } +bool Player::HasSpellModApplied(SpellModifier* mod, Spell* spell) +{ + if (!spell) + return false; + + return spell->m_appliedMods.count(mod->ownerAura) != 0; +} + void Player::ApplyModToSpell(SpellModifier* mod, Spell* spell) { if (!spell) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 61ff993127..25d79630cf 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1849,6 +1849,7 @@ class TC_GAME_API Player : public Unit, public GridObject void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr); void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr); static void ApplyModToSpell(SpellModifier* mod, Spell* spell); + static bool HasSpellModApplied(SpellModifier* mod, Spell* spell); void SetSpellModTakingSpell(Spell* spell, bool apply); void RemoveArenaSpellCooldowns(bool removeActivePetCooldowns = false); @@ -2912,7 +2913,7 @@ void Player::ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell /*= nullpt case SPELLMOD_CASTING_TIME: { SpellModifier* modInstantSpell = nullptr; - for (SpellModifier* mod : m_spellMods[SPELLMOD_CASTING_TIME]) + for (SpellModifier* mod : m_spellMods[op]) { if (!IsAffectedBySpellmod(spellInfo, mod, spell)) continue; @@ -2936,7 +2937,7 @@ void Player::ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell /*= nullpt case SPELLMOD_CRITICAL_CHANCE: { SpellModifier* modCritical = nullptr; - for (SpellModifier* mod : m_spellMods[SPELLMOD_CRITICAL_CHANCE]) + for (SpellModifier* mod : m_spellMods[op]) { if (!IsAffectedBySpellmod(spellInfo, mod, spell)) continue; @@ -2972,14 +2973,22 @@ void Player::ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell /*= nullpt break; case SPELLMOD_PCT: { - // skip percent mods for null basevalue (most important for spell mods with charges) + // skip percent mods with null basevalue (most important for spell mods with charges) if (basevalue == T(0)) continue; // special case (skip > 10sec spell casts for instant cast setting) - if (op == SPELLMOD_CASTING_TIME) + if (op == SPELLMOD_CASTING_TIME && mod->value <= -100 && basevalue >= T(10000)) + continue; + else if (!Player::HasSpellModApplied(mod, spell)) { - if (mod->value <= -100 && basevalue >= T(10000)) + // special case for Surge of Light, don't apply critical chance reduction if other mods not applied (ie procs while casting another spell) + // (Surge of Light is the only PCT_MOD on critical chance) + if (op == SPELLMOD_CRITICAL_CHANCE) + continue; + // special case for Backdraft, dont' apply GCD reduction if cast time reduction wasn't applied (ie when Backlash is consumed first) + // (Backdraft is the only PCT_MOD on global cooldown) + else if (op == SPELLMOD_GLOBAL_COOLDOWN) continue; } From 69625f32fec33e3080d54d8aeeda2d0caab93afb Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 30 Dec 2016 15:59:59 -0300 Subject: [PATCH 073/110] Core/Spell: kill old charge restoring system. Mods are fully handled by proc system now. - Fixes an edge case of spell failing due to out of range and re-adding charges to an existing aura. --- src/server/game/Entities/Player/Player.cpp | 55 --------------------- src/server/game/Entities/Player/Player.h | 2 - src/server/game/Spells/Auras/SpellAuras.cpp | 8 --- src/server/game/Spells/Auras/SpellAuras.h | 2 - src/server/game/Spells/Spell.cpp | 32 +++++------- 5 files changed, 12 insertions(+), 87 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 49425e5773..1ecba8f2e5 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21302,61 +21302,6 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) m_spellMods[mod->op].erase(mod); } -// Restore spellmods in case of failed cast -void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId /*= 0*/, Aura* aura /*= nullptr*/) -{ - if (!spell || spell->m_appliedMods.empty()) - return; - - std::list aurasQueue; - for (uint8 i = 0; i < MAX_SPELLMOD; ++i) - { - for (auto itr = m_spellMods[i].begin(); itr != m_spellMods[i].end(); ++itr) - { - SpellModifier* mod = *itr; - - // Spellmods without charged aura cannot be charged - if (!mod->ownerAura->IsUsingCharges()) - continue; - - // Restore only specific owner aura mods - if (ownerAuraId && mod->spellId != ownerAuraId) - continue; - - if (aura && mod->ownerAura != aura) - continue; - - // Check if mod affected this spell - // First, check if the mod aura applied at least one spellmod to this spell - Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura); - if (iterMod == spell->m_appliedMods.end()) - continue; - // Second, check if the current mod is one of those applied by the mod aura - if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags)) - continue; - - // remove from list - This will be done after all mods have been gone through - // to ensure we iterate over all mods of an aura before removing said aura - // from applied mods (Else, an aura with two mods on the current spell would - // only see the first of its modifier restored) - aurasQueue.push_back(mod->ownerAura); - - // add charges back to aura - mod->ownerAura->ModCharges(1); - } - } - - for (Aura* aura : aurasQueue) - spell->m_appliedMods.erase(aura); -} - -void Player::RestoreAllSpellMods(uint32 ownerAuraId /*= 0*/, Aura* aura /*= nullptr*/) -{ - for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (Spell* spell = m_currentSpells[i]) - RestoreSpellMods(spell, ownerAuraId, aura); -} - bool Player::HasSpellModApplied(SpellModifier* mod, Spell* spell) { if (!spell) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 25d79630cf..b9cd7867b7 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1846,8 +1846,6 @@ class TC_GAME_API Player : public Unit, public GridObject static bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr); template void ApplySpellMod(uint32 spellId, T& basevalue, Spell* spell = nullptr) const; - void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr); - void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr); static void ApplyModToSpell(SpellModifier* mod, Spell* spell); static bool HasSpellModApplied(SpellModifier* mod, Spell* spell); void SetSpellModTakingSpell(Spell* spell, bool apply); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 90532e89df..9ada736d03 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -927,7 +927,6 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode /*= AURA_REMOVE_B if (refresh) { - RefreshSpellMods(); RefreshTimers(resetPeriodicTimer); // reset charges @@ -938,13 +937,6 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode /*= AURA_REMOVE_B return false; } -void Aura::RefreshSpellMods() -{ - for (Aura::ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) - if (Player* player = appIter->second->GetTarget()->ToPlayer()) - player->RestoreAllSpellMods(0, this); -} - bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const { uint32 count = 0; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 94691e4cf6..32eaf8585e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -148,8 +148,6 @@ class TC_GAME_API Aura void SetStackAmount(uint8 num); bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer = true); - void RefreshSpellMods(); - uint8 GetCasterLevel() const { return m_casterLevel; } bool HasMoreThanOneEffectForType(AuraType auraType) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 69394ddf2c..788a61574a 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3010,13 +3010,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered triggeredByAura->GetBase()->SetDuration(0); } + // cleanup after mod system + // triggered spell pointer can be not removed in some cases if (m_caster->GetTypeId() == TYPEID_PLAYER) - { - m_caster->ToPlayer()->RestoreSpellMods(this); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - } if (param1 || param2) SendCastResult(result, ¶m1, ¶m2); @@ -3129,8 +3126,6 @@ void Spell::cancel() { case SPELL_STATE_PREPARING: CancelGlobalCooldown(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->RestoreSpellMods(this); // no break case SPELL_STATE_DELAYED: SendInterrupted(0); @@ -3225,14 +3220,12 @@ void Spell::cast(bool skipCheck) { SendCastResult(castResult, ¶m1, ¶m2); SendInterrupted(0); - //restore spell mods + + // cleanup after mod system + // triggered spell pointer can be not removed in some cases if (m_caster->GetTypeId() == TYPEID_PLAYER) - { - m_caster->ToPlayer()->RestoreSpellMods(this); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - } + finish(false); SetExecutedCurrently(false); return; @@ -3252,10 +3245,11 @@ void Spell::cast(bool skipCheck) my_trade->SetSpell(m_spellInfo->Id, m_CastItem); SendCastResult(SPELL_FAILED_DONT_REPORT); SendInterrupted(0); - m_caster->ToPlayer()->RestoreSpellMods(this); + // cleanup after mod system // triggered spell pointer can be not removed in some cases m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + finish(false); SetExecutedCurrently(false); return; @@ -3278,14 +3272,12 @@ void Spell::cast(bool skipCheck) if (m_spellState == SPELL_STATE_FINISHED) { SendInterrupted(0); - //restore spell mods + + // cleanup after mod system + // triggered spell pointer can be not removed in some cases if (m_caster->GetTypeId() == TYPEID_PLAYER) - { - m_caster->ToPlayer()->RestoreSpellMods(this); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - } + finish(false); SetExecutedCurrently(false); return; From 948335f9112c1180ad54791a625cabfb5f781bc6 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 19 Jan 2017 07:17:04 -0300 Subject: [PATCH 074/110] Core/Spell: add missing null caster check 01d272d6cb348c968c531620c341f760e50cb97b follow-up Closes #18875 --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f058c60ee6..1d45f71ca2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7710,11 +7710,13 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) { + if (!(itr->first & spellInfo->GetSchoolMask())) + continue; + SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); - if ((itr->first & spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) - && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) - return true; + if (!(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && caster && IsFriendlyTo(caster))) + if (!spellInfo->CanPierceImmuneAura(immuneSpellInfo)) + return true; } return false; From 921efdc1fa971c0b6080a9b357b10435d70bf208 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 21 Jan 2017 23:42:21 -0300 Subject: [PATCH 075/110] Core/Spell: consider spells with no targets for the purpose of finish procs Closes #18799 --- src/server/game/Spells/Spell.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 788a61574a..99a0c064a2 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2003,7 +2003,6 @@ void Spell::prepareDataForTriggerSystem() // For other spells trigger procflags are set in Spell::DoAllEffectOnTarget // Because spell positivity is dependant on target } - m_hitMask = PROC_HIT_NONE; // Hunter trap spells - activation proc for Lock and Load, Entrapment and Misdirection if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && @@ -3429,10 +3428,16 @@ void Spell::handle_immediate() // process immediate effects (items, ground, etc.) also initialize some variables _handle_immediate_phase(); - for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - DoAllEffectOnTarget(&(*ihit)); + // consider spell hit for some spells without target, so they may proc on finish phase correctly + if (m_UniqueTargetInfo.empty()) + m_hitMask = PROC_HIT_NORMAL; + else + { + for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + DoAllEffectOnTarget(&(*ihit)); + } - for (std::list::iterator ihit= m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) + for (std::list::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); FinishTargetProcessing(); From 7f4557c943678a30e1cf7151d4995c3bb4512c6f Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 23 Jan 2017 15:35:35 -0300 Subject: [PATCH 076/110] Core/Spell: add more aura types to default procs Ref #18542 --- src/server/game/Spells/SpellMgr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d528de1bc1..49d60067dc 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1641,6 +1641,15 @@ void SpellMgr::LoadSpellProcs() isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; + isTriggerAura[SPELL_AURA_MOD_INVISIBILITY] = true; + isTriggerAura[SPELL_AURA_FORCE_REACTION] = true; + isTriggerAura[SPELL_AURA_MOD_TAUNT] = true; + isTriggerAura[SPELL_AURA_MOD_DETAUNT] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_DONE] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER_PCT] = true; + isTriggerAura[SPELL_AURA_MOD_HIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_MOD_WEAPON_CRIT_PERCENT] = true; + isTriggerAura[SPELL_AURA_MOD_BLOCK_PERCENT] = true; isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; @@ -1649,6 +1658,7 @@ void SpellMgr::LoadSpellProcs() isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; + isAlwaysTriggeredAura[SPELL_AURA_MOD_INVISIBILITY] = true; spellTypeMask[SPELL_AURA_MOD_STEALTH] = PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL; spellTypeMask[SPELL_AURA_MOD_CONFUSE] = PROC_SPELL_TYPE_DAMAGE; @@ -1656,6 +1666,7 @@ void SpellMgr::LoadSpellProcs() spellTypeMask[SPELL_AURA_MOD_ROOT] = PROC_SPELL_TYPE_DAMAGE; spellTypeMask[SPELL_AURA_MOD_STUN] = PROC_SPELL_TYPE_DAMAGE; spellTypeMask[SPELL_AURA_TRANSFORM] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_INVISIBILITY] = PROC_SPELL_TYPE_DAMAGE; // This generates default procs to retain compatibility with previous proc system TC_LOG_INFO("server.loading", "Generating spell proc data from SpellMap..."); From abae9129863872789aef6597c805edffa056108f Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 23 Jan 2017 15:41:43 -0300 Subject: [PATCH 077/110] Core/Spell: modified HitMask for new default procs --- src/server/game/Spells/SpellMgr.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 49d60067dc..d9488e1be9 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1750,14 +1750,30 @@ void SpellMgr::LoadSpellProcs() procEntry.SpellPhaseMask = PROC_SPELL_PHASE_HIT; procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent - // Reflect auras should only proc off reflects for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS) || spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS_SCHOOL)) + if (!spellInfo->Effects[i].IsAura()) + continue; + + switch (spellInfo->Effects[i].ApplyAuraName) { - procEntry.HitMask = PROC_HIT_REFLECT; - break; + // Reflect auras should only proc off reflects + case SPELL_AURA_REFLECT_SPELLS: + case SPELL_AURA_REFLECT_SPELLS_SCHOOL: + procEntry.HitMask = PROC_HIT_REFLECT; + break; + // Only drop charge on crit + case SPELL_AURA_MOD_WEAPON_CRIT_PERCENT: + procEntry.HitMask = PROC_HIT_CRITICAL; + break; + // Only drop charge on block + case SPELL_AURA_MOD_BLOCK_PERCENT: + procEntry.HitMask = PROC_HIT_BLOCK; + break; + default: + continue; } + break; } procEntry.AttributesMask = 0; From 3ccdf57f4acade84a82d145dcf25ba656561e9d2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 23 Jan 2017 18:33:34 -0300 Subject: [PATCH 078/110] Core/Spell: unified handling of SPELL_ATTR5_USABLE_WHILE_* attributes Allowed mechanic mask is calculated on startup and auras checked against those mechanics Closes #18798 --- src/server/game/Spells/Spell.cpp | 101 +++++++++++++++++++-------- src/server/game/Spells/SpellInfo.cpp | 34 +++++++++ src/server/game/Spells/SpellInfo.h | 4 ++ 3 files changed, 110 insertions(+), 29 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 99a0c064a2..a4bbc60bd5 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5847,8 +5847,16 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const if (m_spellInfo->HasAttribute(SPELL_ATTR6_IGNORE_CASTER_AURAS)) return SPELL_CAST_OK; + // these attributes only show the spell as usable on the client when it has related aura applied + // still they need to be checked against certain mechanics + + // SPELL_ATTR5_USABLE_WHILE_STUNNED by default only MECHANIC_STUN (ie no sleep, knockout, freeze, etc.) bool usableWhileStunned = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_STUNNED); + + // SPELL_ATTR5_USABLE_WHILE_FEARED by default only fear (ie no horror) bool usableWhileFeared = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED); + + // SPELL_ATTR5_USABLE_WHILE_CONFUSED by default only disorient (ie no polymorph) bool usableWhileConfused = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED); // Glyph of Pain Suppression @@ -5874,39 +5882,56 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const } */ - if (unitflag & UNIT_FLAG_STUNNED) + // spell has attribute usable while having a cc state, check if caster has allowed mechanic auras, another mechanic types must prevent cast spell + auto mechanicCheck = [&](AuraType type) -> SpellCastResult { - // spell is usable while stunned, check if caster has allowed stun auras, another stun types must prevent cast spell - if (usableWhileStunned) + bool foundNotMechanic = false; + Unit::AuraEffectList const& auras = m_caster->GetAuraEffectsByType(type); + for (AuraEffect const* aurEff : auras) { - static uint32 const allowedStunMask = - 1 << MECHANIC_STUN - | 1 << MECHANIC_SLEEP; - - bool foundNotStun = false; - Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); - for (AuraEffect const* stunEff : stunAuras) + uint32 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask(); + if (mechanicMask && !(mechanicMask & GetSpellInfo()->GetAllowedMechanicMask())) { - uint32 const stunMechanicMask = stunEff->GetSpellInfo()->GetAllEffectsMechanicMask(); - if (stunMechanicMask && !(stunMechanicMask & allowedStunMask)) - { - foundNotStun = true; + foundNotMechanic = true; - // fill up aura mechanic info to send client proper error message - if (param1) - { - *param1 = stunEff->GetSpellInfo()->Effects[stunEff->GetEffIndex()].Mechanic; - if (!*param1) - *param1 = stunEff->GetSpellInfo()->Mechanic; - } - break; + // fill up aura mechanic info to send client proper error message + if (param1) + { + *param1 = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].Mechanic; + if (!*param1) + *param1 = aurEff->GetSpellInfo()->Mechanic; + } + break; + } + + if (foundNotMechanic) + { + switch (type) + { + case SPELL_AURA_MOD_STUN: + return SPELL_FAILED_STUNNED; + case SPELL_AURA_MOD_FEAR: + return SPELL_FAILED_FLEEING; + case SPELL_AURA_MOD_CONFUSE: + return SPELL_FAILED_CONFUSED; + default: + ABORT(); + return SPELL_FAILED_NOT_KNOWN; } } - if (foundNotStun) - result = SPELL_FAILED_STUNNED; + return SPELL_CAST_OK; + } + }; + + if (unitflag & UNIT_FLAG_STUNNED) + { + if (usableWhileStunned) + { + SpellCastResult mechanicResult = mechanicCheck(SPELL_AURA_MOD_STUN); + if (mechanicResult != SPELL_CAST_OK) + result = mechanicResult; } - // Not usable while stunned, however spell might provide some immunity that allows to cast it anyway else if (!CheckSpellCancelsStun(param1)) result = SPELL_FAILED_STUNNED; } @@ -5914,10 +5939,28 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const result = SPELL_FAILED_SILENCED; else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && !CheckSpellCancelsPacify(param1)) result = SPELL_FAILED_PACIFIED; - else if (unitflag & UNIT_FLAG_FLEEING && !usableWhileFeared && !CheckSpellCancelsFear(param1)) - result = SPELL_FAILED_FLEEING; - else if (unitflag & UNIT_FLAG_CONFUSED && !usableWhileConfused && !CheckSpellCancelsConfuse(param1)) - result = SPELL_FAILED_CONFUSED; + else if (unitflag & UNIT_FLAG_FLEEING) + { + if (usableWhileFeared) + { + SpellCastResult mechanicResult = mechanicCheck(SPELL_AURA_MOD_FEAR); + if (mechanicResult != SPELL_CAST_OK) + result = mechanicResult; + } + else if (!CheckSpellCancelsFear(param1)) + result = SPELL_FAILED_FLEEING; + } + else if (unitflag & UNIT_FLAG_CONFUSED) + { + if (usableWhileConfused) + { + SpellCastResult mechanicResult = mechanicCheck(SPELL_AURA_MOD_CONFUSE); + if (mechanicResult != SPELL_CAST_OK) + result = mechanicResult; + } + else if (!CheckSpellCancelsConfuse(param1)) + result = SPELL_FAILED_CONFUSED; + } // Attr must make flag drop spell totally immune from all effects if (result != SPELL_CAST_OK) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index bd9c2feda2..2424f99008 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1031,6 +1031,8 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe _spellSpecific = SPELL_SPECIFIC_NORMAL; _auraState = AURA_STATE_NONE; + + _allowedMechanicMask = 0; } SpellInfo::~SpellInfo() @@ -2920,7 +2922,34 @@ void SpellInfo::_LoadImmunityInfo() immuneInfo.AuraTypeImmune.shrink_to_fit(); immuneInfo.SpellEffectImmune.shrink_to_fit(); + + _allowedMechanicMask |= immuneInfo.MechanicImmuneMask; } + + if (HasAttribute(SPELL_ATTR5_USABLE_WHILE_STUNNED)) + { + switch (Id) + { + case 22812: // Barkskin + _allowedMechanicMask |= + (1 << MECHANIC_STUN) | + (1 << MECHANIC_FREEZE) | + (1 << MECHANIC_KNOCKOUT) | + (1 << MECHANIC_SLEEP); + break; + case 49039: // Lichborne, don't allow normal stuns + break; + default: + _allowedMechanicMask |= (1 << MECHANIC_STUN); + break; + } + } + + if (HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED)) + _allowedMechanicMask |= (1 << MECHANIC_DISORIENTED); + + if (HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED)) + _allowedMechanicMask |= (1 << MECHANIC_FEAR); } void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const @@ -3112,6 +3141,11 @@ bool SpellInfo::SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 aur return false; } +uint32 SpellInfo::GetAllowedMechanicMask() const +{ + return _allowedMechanicMask; +} + float SpellInfo::GetMinRange(bool positive) const { if (!RangeEntry) diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index a0da100966..fa08a0c871 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -572,6 +572,8 @@ class TC_GAME_API SpellInfo bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const; bool SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const; + uint32 GetAllowedMechanicMask() const; + private: // loading helpers void _InitializeExplicitTargetMask(); @@ -592,6 +594,8 @@ class TC_GAME_API SpellInfo SpellDiminishInfo _diminishInfoNonTriggered; SpellDiminishInfo _diminishInfoTriggered; + uint32 _allowedMechanicMask; + ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS]; }; From 1f6fa5446590c5ffd1ba7b3c8f5cca6fccbeed5c Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 23 Jan 2017 18:38:32 -0300 Subject: [PATCH 079/110] Core/Spell: build fix --- src/server/game/Spells/Spell.cpp | 37 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a4bbc60bd5..4cf0ca17f7 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5901,27 +5901,28 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const if (!*param1) *param1 = aurEff->GetSpellInfo()->Mechanic; } + break; } - - if (foundNotMechanic) - { - switch (type) - { - case SPELL_AURA_MOD_STUN: - return SPELL_FAILED_STUNNED; - case SPELL_AURA_MOD_FEAR: - return SPELL_FAILED_FLEEING; - case SPELL_AURA_MOD_CONFUSE: - return SPELL_FAILED_CONFUSED; - default: - ABORT(); - return SPELL_FAILED_NOT_KNOWN; - } - } - - return SPELL_CAST_OK; } + + if (foundNotMechanic) + { + switch (type) + { + case SPELL_AURA_MOD_STUN: + return SPELL_FAILED_STUNNED; + case SPELL_AURA_MOD_FEAR: + return SPELL_FAILED_FLEEING; + case SPELL_AURA_MOD_CONFUSE: + return SPELL_FAILED_CONFUSED; + default: + ABORT(); + return SPELL_FAILED_NOT_KNOWN; + } + } + + return SPELL_CAST_OK; }; if (unitflag & UNIT_FLAG_STUNNED) From 0e1cc63055a5eeea1fde6e043368c5b85b13a747 Mon Sep 17 00:00:00 2001 From: Gerhood Date: Sun, 29 Jan 2017 14:06:40 +0100 Subject: [PATCH 080/110] Core/Spells: implement Mad/Crazy Alchemist's potions --- .../world/3.3.5/9999_99_99_99_world.sql | 4 + src/server/game/Entities/Player/Player.cpp | 7 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 46 ------ src/server/game/Spells/SpellHistory.cpp | 5 +- src/server/scripts/Spells/spell_item.cpp | 138 ++++++++++++++++++ 6 files changed, 153 insertions(+), 49 deletions(-) create mode 100644 sql/updates/world/3.3.5/9999_99_99_99_world.sql diff --git a/sql/updates/world/3.3.5/9999_99_99_99_world.sql b/sql/updates/world/3.3.5/9999_99_99_99_world.sql new file mode 100644 index 0000000000..da8f466566 --- /dev/null +++ b/sql/updates/world/3.3.5/9999_99_99_99_world.sql @@ -0,0 +1,4 @@ +DELETE FROM spell_script_names WHERE spell_id IN (45051, 53750); +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(45051, 'spell_item_mad_alchemists_potion'), +(53750, 'spell_item_crazy_alchemists_potion'); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1ecba8f2e5..eaa9af716d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22365,7 +22365,12 @@ void Player::UpdatePotionCooldown(Spell* spell) } // from spell cases (m_lastPotionId set in Spell::SendSpellCooldown) else - GetSpellHistory()->SendCooldownEvent(spell->m_spellInfo, m_lastPotionId, spell); + { + if (spell->IsIgnoringCooldowns()) + return; + else + GetSpellHistory()->SendCooldownEvent(spell->m_spellInfo, m_lastPotionId, spell); + } m_lastPotionId = 0; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4cf0ca17f7..2b03702978 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4940,7 +4940,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint return SPELL_FAILED_SPELL_IN_PROGRESS; // check if we are using a potion in combat for the 2nd+ time. Cooldown is added only after caster gets out of combat - if (m_caster->ToPlayer()->GetLastPotionId() && m_CastItem && (m_CastItem->IsPotion() || m_spellInfo->IsCooldownStartedOnEvent())) + if (!IsIgnoringCooldowns() && m_caster->ToPlayer()->GetLastPotionId() && m_CastItem && (m_CastItem->IsPotion() || m_spellInfo->IsCooldownStartedOnEvent())) return SPELL_FAILED_NOT_READY; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ec09b7f189..795008bddf 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1635,52 +1635,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) return; m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power); - - // Mad Alchemist's Potion - if (m_spellInfo->Id == 45051) - { - // find elixirs on target - bool guardianFound = false; - bool battleFound = false; - Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras(); - for (Unit::AuraApplicationMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr) - { - uint32 spell_id = itr->second->GetBase()->GetId(); - if (!guardianFound) - if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN)) - guardianFound = true; - if (!battleFound) - if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE)) - battleFound = true; - if (battleFound && guardianFound) - break; - } - - // get all available elixirs by mask and spell level - std::set avalibleElixirs; - if (!guardianFound) - sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs); - if (!battleFound) - sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); - for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();) - { - SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(*itr); - if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel()) - avalibleElixirs.erase(itr++); - else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH)) - avalibleElixirs.erase(itr++); - else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE)) - avalibleElixirs.erase(itr++); - else - ++itr; - } - - if (!avalibleElixirs.empty()) - { - // cast random elixir on target - m_caster->CastSpell(unitTarget, Trinity::Containers::SelectRandomContainerElement(avalibleElixirs), true, m_CastItem); - } - } } void Spell::EffectEnergizePct(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 0609912715..70b68e1e19 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -161,6 +161,9 @@ void SpellHistory::HandleCooldowns(SpellInfo const* spellInfo, Item const* item, void SpellHistory::HandleCooldowns(SpellInfo const* spellInfo, uint32 itemID, Spell* spell /*= nullptr*/) { + if (spell && spell->IsIgnoringCooldowns()) + return; + if (Player* player = _owner->ToPlayer()) { // potions start cooldown until exiting combat @@ -174,7 +177,7 @@ void SpellHistory::HandleCooldowns(SpellInfo const* spellInfo, uint32 itemID, Sp } } - if (spellInfo->IsCooldownStartedOnEvent() || spellInfo->IsPassive() || (spell && spell->IsIgnoringCooldowns())) + if (spellInfo->IsCooldownStartedOnEvent() || spellInfo->IsPassive()) return; StartCooldown(spellInfo, itemID, spell); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 1c89e65476..d827c4961d 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -4116,6 +4116,141 @@ class spell_item_zandalarian_charm : public SpellScriptLoader uint32 _spellId; }; +// 45051 - Mad Alchemist's Potion (34440) +class spell_item_mad_alchemists_potion : public SpellScriptLoader +{ +public: + spell_item_mad_alchemists_potion() : SpellScriptLoader("spell_item_mad_alchemists_potion") {} + + class mad_alchemists_potion_SpellScript : public SpellScript + { + PrepareSpellScript(mad_alchemists_potion_SpellScript); + + void SecondaryEffect() + { + std::vector availableElixirs = + { + // Battle Elixirs + 33720, // Onslaught Elixir (28102) + 54452, // Adept's Elixir (28103) + 33726, // Elixir of Mastery (28104) + 28490, // Elixir of Major Strength (22824) + 28491, // Elixir of Healing Power (22825) + 28493, // Elixir of Major Frost Power (22827) + 54494, // Elixir of Major Agility (22831) + 28501, // Elixir of Major Firepower (22833) + 28503,// Elixir of Major Shadow Power (22835) + 38954, // Fel Strength Elixir (31679) + // Guardian Elixirs + 39625, // Elixir of Major Fortitude (32062) + 39626, // Earthen Elixir (32063) + 39627, // Elixir of Draenic Wisdom (32067) + 39628, // Elixir of Ironskin (32068) + 28502, // Elixir of Major Defense (22834) + 28514, // Elixir of Empowerment (22848) + // Other + 28489, // Elixir of Camouflage (22823) + 28496 // Elixir of the Searching Eye (22830) + }; + + Unit* target = GetCaster(); + + if (target->getPowerType() == POWER_MANA) + availableElixirs.push_back(28509); // Elixir of Major Mageblood (22840) + + uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs); + + bool useElixir = true; + + SpellGroup chosenSpellGroup = SPELL_GROUP_NONE; + if (sSpellMgr->IsSpellMemberOfSpellGroup(chosenElixir, SPELL_GROUP_ELIXIR_BATTLE)) + chosenSpellGroup = SPELL_GROUP_ELIXIR_BATTLE; + if (sSpellMgr->IsSpellMemberOfSpellGroup(chosenElixir, SPELL_GROUP_ELIXIR_GUARDIAN)) + chosenSpellGroup = SPELL_GROUP_ELIXIR_GUARDIAN; + // If another spell of the same group is already active the elixir should not be cast + if (chosenSpellGroup) + { + Unit::AuraApplicationMap& Auras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr) + { + uint32 spell_id = itr->second->GetBase()->GetId(); + if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, chosenSpellGroup) && spell_id != chosenElixir) + { + useElixir = false; + break; + } + } + } + + if (useElixir) + target->CastSpell(target, chosenElixir, true, GetCastItem()); + } + + void Register() override + { + AfterCast += SpellCastFn(mad_alchemists_potion_SpellScript::SecondaryEffect); + } + + }; + + SpellScript* GetSpellScript() const override + { + return new mad_alchemists_potion_SpellScript(); + } +}; + +// 53750 - Crazy Alchemist's Potion (40077) +class spell_item_crazy_alchemists_potion : public SpellScriptLoader +{ +public: + spell_item_crazy_alchemists_potion() : SpellScriptLoader("spell_item_crazy_alchemists_potion") {} + + class crazy_alchemists_potion_SpellScript : public SpellScript + { + PrepareSpellScript(crazy_alchemists_potion_SpellScript); + + void SecondaryEffect() + { + std::vector availableElixirs = + { + 43185, // Runic Healing Potion (33447) + 53750, // Crazy Alchemist's Potion (40077) + 53761, // Powerful Rejuvenation Potion (40087) + 53762, // Indestructible Potion (40093) + 53908, // Potion of Speed (40211) + 53909, // Potion of Wild Magic (40212) + 53910, // Mighty Arcane Protection Potion (40213) + 53911, // Mighty Fire Protection Potion (40214) + 53913, // Mighty Frost Protection Potion (40215) + 53914, // Mighty Nature Protection Potion (40216) + 53915 // Mighty Shadow Protection Potion (40217) + }; + + Unit* target = GetCaster(); + + if (!target->IsInCombat()) + availableElixirs.push_back(53753); // Potion of Nightmares (40081) + if (target->getPowerType() == POWER_MANA) + availableElixirs.push_back(43186); // Runic Mana Potion(33448) + + uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs); + + target->CastSpell(target, chosenElixir, true, GetCastItem()); + } + + void Register() override + { + AfterCast += SpellCastFn(crazy_alchemists_potion_SpellScript::SecondaryEffect); + } + + }; + + SpellScript* GetSpellScript() const override + { + return new crazy_alchemists_potion_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -4220,4 +4355,7 @@ void AddSC_item_spell_scripts() new spell_item_universal_remote(); new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK); new spell_item_zandalarian_charm("spell_item_restless_strength", SPELL_RESTLESS_STRENGTH_AURA_STACK); + + new spell_item_mad_alchemists_potion(); + new spell_item_crazy_alchemists_potion(); } From f3648242eefcb4acc05a12851fb5ca4bb7abd0e8 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 29 Jan 2017 14:07:27 +0100 Subject: [PATCH 081/110] Rename 9999_99_99_99_world.sql to 2017_01_29_00_world.sql --- .../3.3.5/{9999_99_99_99_world.sql => 2017_01_29_00_world.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/3.3.5/{9999_99_99_99_world.sql => 2017_01_29_00_world.sql} (100%) diff --git a/sql/updates/world/3.3.5/9999_99_99_99_world.sql b/sql/updates/world/3.3.5/2017_01_29_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/9999_99_99_99_world.sql rename to sql/updates/world/3.3.5/2017_01_29_00_world.sql From 288a13861dd36a7486932642b556b5dbb584e848 Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 7 Feb 2017 17:34:42 -0300 Subject: [PATCH 082/110] Core/Spell: properly add SPELLMOD_COOLDOWN to spells without initial cooldown Closes #15605 --- src/server/game/Spells/SpellHistory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 70b68e1e19..f393bf7402 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -306,10 +306,10 @@ void SpellHistory::StartCooldown(SpellInfo const* spellInfo, uint32 itemId, Spel // Now we have cooldown data (if found any), time to apply mods if (Player* modOwner = _owner->GetSpellModOwner()) { - if (cooldown > 0) + if (cooldown >= 0) modOwner->ApplySpellMod(spellInfo->Id, cooldown, spell); - if (categoryCooldown > 0 && !spellInfo->HasAttribute(SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS)) + if (categoryCooldown >= 0 && !spellInfo->HasAttribute(SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS)) modOwner->ApplySpellMod(spellInfo->Id, categoryCooldown, spell); } From 557f714a10cefc472a44c20678549f25d48cdc85 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 04:26:51 +0100 Subject: [PATCH 083/110] Fix spell dst execution time --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2b03702978..6adec7d244 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -833,7 +833,7 @@ void Spell::SelectSpellTargets() } else if (m_spellInfo->Speed > 0.0f) { - float dist = m_caster->GetDistance(*m_targets.GetDstPos()); + float dist = m_caster->GetExactDist(*m_targets.GetDstPos()); if (!m_spellInfo->HasAttribute(SPELL_ATTR9_SPECIAL_DELAY_CALCULATION)) m_delayMoment = uint64(std::floor(dist / m_spellInfo->Speed * 1000.0f)); else From bba87cfeeec519b2b94b9738ac206fc3b496bd0c Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 9 Feb 2017 18:53:55 +0100 Subject: [PATCH 084/110] Core/Auras: Allow passive auras from items to stack (cherry picked from commit 8453d7dae25823dd5d2ecf2b718a469c0553214c) --- src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 9ada736d03..8e0e95474e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1566,7 +1566,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const bool sameCaster = GetCasterGUID() == existingAura->GetCasterGUID(); // passive auras don't stack with another rank of the spell cast by same caster - if (IsPassive() && sameCaster && m_spellInfo->IsRankOf(existingSpellInfo)) + if (IsPassive() && sameCaster && (m_spellInfo->IsDifferentRankOf(existingSpellInfo) || (m_spellInfo->Id == existingSpellInfo->Id && m_castItemGuid.IsEmpty()))) return false; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) From ae4b91bcf61bfe9ffeb1af868a9b6459f682db99 Mon Sep 17 00:00:00 2001 From: xinef1 Date: Sun, 19 Feb 2017 06:10:50 +0100 Subject: [PATCH 085/110] Fixed setting and unsetting of m_spellModTakingSpell --- src/server/game/Entities/Player/Player.cpp | 16 ++------- src/server/game/Spells/Spell.cpp | 42 ++++++++++------------ src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellInfo.cpp | 4 +-- src/server/game/Spells/SpellInfo.h | 6 ++-- 5 files changed, 26 insertions(+), 43 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index eaa9af716d..662bec42dd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1220,18 +1220,6 @@ void Player::Update(uint32 p_time) m_nextMailDelivereTime = 0; } - // If this is set during update SetSpellModTakingSpell call is missing somewhere in the code - // Having this would prevent more aura charges to be dropped, so let's crash - //ASSERT (!m_spellModTakingSpell); - if (m_spellModTakingSpell) - { - //TC_LOG_FATAL("entities.player", "Player has m_pad %u during update!", m_pad); - //if (m_spellModTakingSpell) - TC_LOG_FATAL("spells", "Player::Update: Player '%s' (%s) has m_spellModTakingSpell (SpellID: %u) during update!", - GetName().c_str(), GetGUID().ToString().c_str(), m_spellModTakingSpell->m_spellInfo->Id); - m_spellModTakingSpell = nullptr; - } - // Update cinematic location, if 500ms have passed and we're doing a cinematic now. _cinematicMgr->m_cinematicDiff += p_time; if (_cinematicMgr->m_activeCinematicCameraId != 0 && GetMSTimeDiffToNow(_cinematicMgr->m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF) @@ -21325,10 +21313,10 @@ void Player::ApplyModToSpell(SpellModifier* mod, Spell* spell) void Player::SetSpellModTakingSpell(Spell* spell, bool apply) { - if (!spell || (m_spellModTakingSpell && m_spellModTakingSpell != spell)) + if (apply && m_spellModTakingSpell != nullptr) return; - if (apply && spell->getState() == SPELL_STATE_FINISHED) + if (!apply && (!m_spellModTakingSpell || m_spellModTakingSpell != spell)) return; m_spellModTakingSpell = apply ? spell : nullptr; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6adec7d244..c135651abc 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2980,12 +2980,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered } LoadScripts(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); // Fill cost data (do not use power for item casts) - m_powerCost = m_CastItem ? 0 : m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + m_powerCost = m_CastItem ? 0 : m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask, this); // Set combo point requirement if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem || !m_caster->m_playerMovingMe) @@ -3009,11 +3005,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered triggeredByAura->GetBase()->SetDuration(0); } - // cleanup after mod system - // triggered spell pointer can be not removed in some cases - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - if (param1 || param2) SendCastResult(result, ¶m1, ¶m2); else @@ -3030,10 +3021,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered { if (!player->GetCommandStatus(CHEAT_CASTTIME)) { - player->SetSpellModTakingSpell(this, true); // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) m_casttime = m_spellInfo->CalcCastTime(player->getLevel(), this); - player->SetSpellModTakingSpell(this, false); } else m_casttime = 0; // Set cast time to 0 if .cheat casttime is enabled. @@ -3163,6 +3152,23 @@ void Spell::cancel() } void Spell::cast(bool skipCheck) +{ + Player* modOwner = m_caster->GetSpellModOwner(); + Spell* lastSpellMod = nullptr; + if (modOwner) + { + lastSpellMod = modOwner->m_spellModTakingSpell; + if (lastSpellMod) + modOwner->SetSpellModTakingSpell(lastSpellMod, false); + } + + _cast(skipCheck); + + if (lastSpellMod) + modOwner->SetSpellModTakingSpell(lastSpellMod, true); +} + +void Spell::_cast(bool skipCheck) { // update pointers base at GUIDs to prevent access to non-existed already object if (!UpdatePointers()) @@ -3220,8 +3226,6 @@ void Spell::cast(bool skipCheck) SendCastResult(castResult, ¶m1, ¶m2); SendInterrupted(0); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); @@ -3245,8 +3249,6 @@ void Spell::cast(bool skipCheck) SendCastResult(SPELL_FAILED_DONT_REPORT); SendInterrupted(0); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); finish(false); @@ -3272,8 +3274,6 @@ void Spell::cast(bool skipCheck) { SendInterrupted(0); - // cleanup after mod system - // triggered spell pointer can be not removed in some cases if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); @@ -7255,13 +7255,7 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier) } } - if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->SetSpellModTakingSpell(this, true); - targetInfo.crit = m_caster->IsSpellCrit(unit, m_spellInfo, m_spellSchoolMask, m_attackType); - - if (Player* modOwner = m_caster->GetSpellModOwner()) - modOwner->SetSpellModTakingSpell(this, false); } SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& skillId, int32& reqSkillValue, int32& skillValue) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 359506011e..49bdb1b7b9 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -526,6 +526,7 @@ class TC_GAME_API Spell bool HasGlobalCooldown() const; void TriggerGlobalCooldown(); void CancelGlobalCooldown(); + void _cast(bool skipCheck = false); void SendLoot(ObjectGuid guid, LootType loottype); std::pair GetMinMaxRange(bool strict) const; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 2424f99008..3786f88f8b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3255,7 +3255,7 @@ uint32 SpellInfo::GetRecoveryTime() const return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime; } -int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const +int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, Spell* spell) const { // Spell drain all exist power on cast (Only paladin lay of Hands) if (HasAttribute(SPELL_ATTR1_DRAIN_ALL_POWER)) @@ -3332,7 +3332,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c // Apply cost mod by spell if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(Id, powerCost); + modOwner->ApplySpellMod(Id, powerCost, spell); if (!caster->IsControlledByPlayer()) { diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index fa08a0c871..0af75d3643 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -538,17 +538,17 @@ class TC_GAME_API SpellInfo SpellSpecificType GetSpellSpecific() const; float GetMinRange(bool positive = false) const; - float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; + float GetMaxRange(bool positive = false, Unit* caster = nullptr, Spell* spell = nullptr) const; int32 GetDuration() const; int32 GetMaxDuration() const; uint32 GetMaxTicks() const; - uint32 CalcCastTime(uint8 level = 0, Spell* spell = NULL) const; + uint32 CalcCastTime(uint8 level = 0, Spell* spell = nullptr) const; uint32 GetRecoveryTime() const; - int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; + int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, Spell* spell = nullptr) const; bool IsRanked() const; uint8 GetRank() const; From 9f5b3920e2b32cecb74b89745231db06e01f751a Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 21 Feb 2017 21:07:45 -0300 Subject: [PATCH 086/110] Core/Spells: fix Hand of Justice proc chance and reduce it past level 60. Ref #7789 --- sql/updates/world/3.3.5/2017_02_21_00_world.sql | 1 + src/server/game/Spells/Auras/SpellAuras.cpp | 5 +++++ src/server/game/Spells/SpellMgr.h | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/3.3.5/2017_02_21_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_02_21_00_world.sql b/sql/updates/world/3.3.5/2017_02_21_00_world.sql new file mode 100644 index 0000000000..f337d3430d --- /dev/null +++ b/sql/updates/world/3.3.5/2017_02_21_00_world.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `Chance`=2, `ProcsPerMinute`=0, `AttributesMask`=`AttributesMask`|0x80 WHERE `SpellId`=15600; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8e0e95474e..bc4cdceffd 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1844,6 +1844,11 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), chance); } + + // proc chance is reduced by an additional 3.333% per level past 60 + if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->getLevel() > 60) + chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->getLevel() - 60) * 1.f / 30.f)) * chance); + return chance; } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 2e34a9dea8..51860a95fa 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -239,8 +239,10 @@ enum ProcAttributes PROC_ATTR_REQ_SPELLMOD = 0x0000008, // requires triggering spell to be affected by proccing aura to drop charges PROC_ATTR_DISABLE_EFF_0 = 0x0000010, // explicitly disables aura proc from effects, USE ONLY IF 100% SURE AURA SHOULDN'T PROC - PROC_ATTR_DISABLE_EFF_1 = 0x0000020, // used to avoid a console error if the spell has invalid trigger spell and handled elsewhere - PROC_ATTR_DISABLE_EFF_2 = 0x0000040 // or handling not needed + PROC_ATTR_DISABLE_EFF_1 = 0x0000020, /// used to avoid a console error if the spell has invalid trigger spell and handled elsewhere + PROC_ATTR_DISABLE_EFF_2 = 0x0000040, /// or handling not needed + + PROC_ATTR_REDUCE_PROC_60 = 0x0000080 // aura should have a reduced chance to proc if level of proc Actor > 60 }; struct SpellProcEntry From 1689db145182754100f2e0efbe738861d1c2b843 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 3 Mar 2017 21:36:56 -0300 Subject: [PATCH 087/110] Core/Spells: fix some db errors --- sql/updates/world/3.3.5/2017_03_04_00_world.sql | 1 + src/server/game/Spells/SpellMgr.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/3.3.5/2017_03_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_03_04_00_world.sql b/sql/updates/world/3.3.5/2017_03_04_00_world.sql new file mode 100644 index 0000000000..874d19831e --- /dev/null +++ b/sql/updates/world/3.3.5/2017_03_04_00_world.sql @@ -0,0 +1 @@ +DELETE FROM `spell_proc` WHERE `SpellId` IN (8178, 38857); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d9488e1be9..88b8ecdd53 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2699,9 +2699,8 @@ void SpellMgr::LoadSpellInfoCorrections() } // disable proc for magnet auras, they're handled differently - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - if (spellInfo->Effects[j].IsAura(SPELL_AURA_SPELL_MAGNET)) - spellInfo->ProcFlags = 0; + if (spellInfo->HasAura(SPELL_AURA_SPELL_MAGNET)) + spellInfo->ProcFlags = 0; // due to the way spell system works, unit would change orientation in Spell::_cast if (spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)) From e9599d136bec66837ac6325cea2d4720660e313a Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 12 Mar 2017 14:29:32 -0300 Subject: [PATCH 088/110] Core/Aura: fix SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE unapply case for dead players --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b9149b4a81..4d299807a9 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3603,7 +3603,13 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 // save current health state float healthPct = target->GetHealthPct(); - bool alive = target->IsAlive(); + bool zeroHealth = !target->IsAlive(); + + // players in corpse state may mean two different states: + /// 1. player just died but did not release (in this case health == 0) + /// 2. player is corpse running (ie ghost) (in this case health == 1) + if (target->getDeathState() == CORPSE) + zeroHealth = (target->GetHealth() == 0); for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++) { @@ -3629,7 +3635,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag) // this check is total bullshit i think if (GetMiscValueB() & 1 << STAT_STAMINA && (m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)) - target->SetHealth(std::max(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0))); + target->SetHealth(std::max(CalculatePct(target->GetMaxHealth(), healthPct), (zeroHealth ? 1 : 0))); } void AuraEffect::HandleAuraModResistenceOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const From ba2e4d90ec796af6fb52a26e9576effa0cc47e32 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 12 Apr 2017 02:53:25 -0300 Subject: [PATCH 089/110] Core/Spell: fix SPELL_ATTR3_IGNORE_HIT_RESULT bypassing reflects Closes #19440 --- src/server/game/Entities/Unit/Unit.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1d45f71ca2..f8a5e58c99 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2591,18 +2591,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo // Resist SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect /*= false*/) { - if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) - return SPELL_MISS_NONE; - - // Check for immune - if (victim->IsImmunedToSpell(spellInfo, this)) - return SPELL_MISS_IMMUNE; - - // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply - // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit - if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo)) - return SPELL_MISS_IMMUNE; - // All positive spells can`t miss /// @todo client not show miss log for this spells - so need find info for this in dbc and use it! if (spellInfo->IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell @@ -2628,6 +2616,18 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo return SPELL_MISS_REFLECT; } + if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)) + return SPELL_MISS_NONE; + + // Check for immune + if (victim->IsImmunedToSpell(spellInfo, this)) + return SPELL_MISS_IMMUNE; + + // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply + // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit + if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo)) + return SPELL_MISS_IMMUNE; + switch (spellInfo->DmgClass) { case SPELL_DAMAGE_CLASS_RANGED: From 091100f79560708f107f067b47624e73f2f7ff68 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 13 Apr 2017 03:18:20 -0300 Subject: [PATCH 090/110] Core/Spell: check aura positivity per effect on spell hit - Fixes applying DR to positive effects, and changing duration of whole aura Closes #19447 --- src/server/game/Entities/Unit/Unit.cpp | 7 +++---- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Spells/Spell.cpp | 25 +++++++++++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f8a5e58c99..ddb1fdbde9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9476,11 +9476,11 @@ void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered) ++diminish.hitCount; } -float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) +bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) const { DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); if (duration == -1 || group == DIMINISHING_NONE) - return 1.0f; + return true; int32 const limitDuration = auraSpellInfo->GetDiminishingReturnsLimitDuration(triggered); @@ -9501,7 +9501,6 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trig } float mod = 1.0f; - if (group == DIMINISHING_TAUNT) { if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) @@ -9536,7 +9535,7 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trig } duration = int32(duration * mod); - return mod; + return (duration != 0); } void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index cb49a52add..ee1c2c3e00 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1317,7 +1317,7 @@ class TC_GAME_API Unit : public WorldObject DiminishingLevels GetDiminishing(DiminishingGroup group); void IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered); - float ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel); + bool ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) const; void ApplyDiminishingAura(DiminishingGroup group, bool apply); void ClearDiminishings(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c135651abc..a630dfecc1 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2645,7 +2645,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA // Select rank for aura with level requirements only in specific cases // Unit has to be target only of aura effect, both caster and target have to be players, target has to be other than unit target SpellInfo const* aurSpellInfo = m_spellInfo; - int32 basePoints[3]; + int32 basePoints[MAX_SPELL_EFFECTS]; if (scaleAura) { aurSpellInfo = m_spellInfo->GetAuraRankForLevel(unitTarget->getLevel()); @@ -2679,11 +2679,24 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA } // Now Reduce spell duration using data received at spell hit + // check whatever effects we're going to apply, diminishing returns only apply to negative aura effects + bool positive = true; + if (m_originalCaster == unit || !m_originalCaster->IsFriendlyTo(unit)) + { + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if ((effectMask & (1 << i)) && !aurSpellInfo->IsPositiveEffect(i)) + { + positive = false; + break; + } + } + } + int32 duration = m_spellAura->GetMaxDuration(); - float diminishMod = unit->ApplyDiminishingToDuration(aurSpellInfo, triggered, duration, m_originalCaster, diminishLevel); // unit is immune to aura if it was diminished to 0 duration - if (diminishMod == 0.0f) + if (!positive && !unit->ApplyDiminishingToDuration(aurSpellInfo, triggered, duration, m_originalCaster, diminishLevel)) { m_spellAura->Remove(); bool found = false; @@ -2695,11 +2708,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA } else { - ((UnitAura*)m_spellAura)->SetDiminishGroup(diminishGroup); - - bool positive = m_spellAura->GetSpellInfo()->IsPositive(); - if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID())) - positive = aurApp->IsPositive(); + static_cast(m_spellAura)->SetDiminishGroup(diminishGroup); duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive, effectMask); From 76349ea8ce59547d2c81f0812dcf6caa8d8d4c41 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 14 Apr 2017 03:47:23 -0300 Subject: [PATCH 091/110] Core/Spell: fixed SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT to actually check effects - This commit enables stack rule 3 to be properly used to fix auras that should be active but only one providing effects, even if the spell has multiple auras Closes #19454 --- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Spells/SpellMgr.cpp | 174 ++++++++++++++++++++----- src/server/game/Spells/SpellMgr.h | 11 +- 3 files changed, 151 insertions(+), 38 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ddb1fdbde9..373ceb6c88 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4574,7 +4574,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype, std::functionAddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup)) + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auratype, aurEff->GetAmount(), sameEffectSpellGroup)) modifier += aurEff->GetAmount(); } } @@ -4601,7 +4601,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype, std::functionAddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup)) + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auratype, aurEff->GetAmount(), sameEffectSpellGroup)) AddPct(multiplier, aurEff->GetAmount()); } } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 88b8ecdd53..3eef027617 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -398,32 +398,34 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& } } -bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int32 amount, std::map& groups) const +bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, AuraType auraType, int32 amount, std::map& groups) const { uint32 spellId = spellInfo->GetFirstRankSpell()->Id; - SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellId); + auto spellGroupBounds = GetSpellSpellGroupMapBounds(spellId); // Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one - for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr) + for (auto itr = spellGroupBounds.first; itr != spellGroupBounds.second; ++itr) { SpellGroup group = itr->second; - SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(group); - if (found != mSpellGroupStack.end()) + auto found = mSpellSameEffectStack.find(group); + if (found != mSpellSameEffectStack.end()) { - if (found->second == SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT) + // check auraTypes + if (!found->second.count(uint32(auraType))) + continue; + + // Put the highest amount in the map + auto groupItr = groups.find(group); + if (groupItr == groups.end()) + groups.emplace(group, amount); + else { - // Put the highest amount in the map - if (groups.find(group) == groups.end()) - groups[group] = amount; - else - { - int32 curr_amount = groups[group]; - // Take absolute value because this also counts for the highest negative aura - if (abs(curr_amount) < abs(amount)) - groups[group] = amount; - } - // return because a spell should be in only one SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group - return true; + int32 curr_amount = groups[group]; + // Take absolute value because this also counts for the highest negative aura + if (std::abs(curr_amount) < std::abs(amount)) + groupItr->second = amount; } + // return because a spell should be in only one SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group per auraType + return true; } } // Not in a SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group, so return false @@ -1365,19 +1367,19 @@ void SpellMgr::LoadSpellGroups() } int32 spell_id = fields[1].GetInt32(); - groups.insert(std::set::value_type(group_id)); - mSpellGroupSpell.insert(SpellGroupSpellMap::value_type((SpellGroup)group_id, spell_id)); + groups.insert(group_id); + mSpellGroupSpell.emplace(SpellGroup(group_id), spell_id); } while (result->NextRow()); - for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();) + for (auto itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();) { if (itr->second < 0) { if (groups.find(abs(itr->second)) == groups.end()) { TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second)); - mSpellGroupSpell.erase(itr++); + itr = mSpellGroupSpell.erase(itr); } else ++itr; @@ -1385,31 +1387,30 @@ void SpellMgr::LoadSpellGroups() else { SpellInfo const* spellInfo = GetSpellInfo(itr->second); - if (!spellInfo) { TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` does not exist", itr->second); - mSpellGroupSpell.erase(itr++); + itr = mSpellGroupSpell.erase(itr); } else if (spellInfo->GetRank() > 1) { TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` is not the first rank of the spell.", itr->second); - mSpellGroupSpell.erase(itr++); + itr = mSpellGroupSpell.erase(itr); } else ++itr; } } - for (std::set::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr) + for (auto groupItr = groups.begin(); groupItr != groups.end(); ++groupItr) { std::set spells; GetSetOfSpellsInSpellGroup(SpellGroup(*groupItr), spells); - for (std::set::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr) + for (auto spellItr = spells.begin(); spellItr != spells.end(); ++spellItr) { ++count; - mSpellSpellGroup.insert(SpellSpellGroupMap::value_type(*spellItr, SpellGroup(*groupItr))); + mSpellSpellGroup.emplace(*spellItr, SpellGroup(*groupItr)); } } @@ -1421,6 +1422,9 @@ void SpellMgr::LoadSpellGroupStackRules() uint32 oldMSTime = getMSTime(); mSpellGroupStack.clear(); // need for reload case + mSpellSameEffectStack.clear(); + + std::vector sameEffectGroups; // 0 1 QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); @@ -1443,20 +1447,126 @@ void SpellMgr::LoadSpellGroupStackRules() continue; } - SpellGroupSpellMapBounds spellGroup = GetSpellGroupSpellMapBounds((SpellGroup)group_id); - - if (spellGroup.first == spellGroup.second) + auto bounds = GetSpellGroupSpellMapBounds((SpellGroup)group_id); + if (bounds.first == bounds.second) { TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group_stack_rules` does not exist.", group_id); continue; } - mSpellGroupStack[(SpellGroup)group_id] = (SpellGroupStackRule)stack_rule; + // different container for same effect stack rules, need to check effect types + if (stack_rule != SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT) + mSpellGroupStack.emplace(SpellGroup(group_id), SpellGroupStackRule(stack_rule)); + else + sameEffectGroups.push_back(group_id); ++count; } while (result->NextRow()); TC_LOG_INFO("server.loading", ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + + count = 0; + oldMSTime = getMSTime(); + TC_LOG_INFO("server.loading", ">> Parsing SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules..."); + + for (uint32 group_id : sameEffectGroups) + { + std::set spellIds; + GetSetOfSpellsInSpellGroup(SpellGroup(group_id), spellIds); + + std::unordered_set auraTypes; + + // we have to 'guess' what effect this group corresponds to + { + std::unordered_multiset frequencyContainer; + + // only waylay for the moment (shared group) + std::vector> const SubGroups = + { + { SPELL_AURA_MOD_MELEE_HASTE, SPELL_AURA_MOD_MELEE_RANGED_HASTE, SPELL_AURA_MOD_RANGED_HASTE } + }; + + for (uint32 spellId : spellIds) + { + SpellInfo const* spellInfo = AssertSpellInfo(spellId); + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (!spellInfo->Effects[i].IsAura()) + continue; + + int32 auraName = static_cast(spellInfo->Effects[i].ApplyAuraName); + for (std::vector const& subGroup : SubGroups) + { + if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end()) + { + // count as first aura + auraName = subGroup.front(); + break; + } + } + + frequencyContainer.insert(auraName); + } + } + + uint32 auraType = 0; + size_t auraTypeCount = 0; + for (uint32 auraName : frequencyContainer) + { + size_t currentCount = frequencyContainer.count(auraName); + if (currentCount > auraTypeCount) + { + auraType = auraName; + auraTypeCount = currentCount; + } + } + + for (std::vector const& subGroup : SubGroups) + { + if (auraType == subGroup.front()) + { + auraTypes.insert(subGroup.begin(), subGroup.end()); + break; + } + } + + if (auraTypes.empty()) + auraTypes.insert(auraType); + } + + // re-check spells against guessed group + for (uint32 spellId : spellIds) + { + SpellInfo const* spellInfo = AssertSpellInfo(spellId); + + bool found = false; + while (spellInfo) + { + for (uint32 auraType : auraTypes) + { + if (spellInfo->HasAura(AuraType(auraType))) + { + found = true; + break; + } + } + + if (found) + break; + + spellInfo = spellInfo->GetNextRankSpell(); + } + + // not found either, log error + if (!found) + TC_LOG_ERROR("sql.sql", "SpellId %u listed in `spell_group` with stack rule 3 does not share aura assigned for group %u", spellId, group_id); + } + + mSpellSameEffectStack[SpellGroup(group_id)] = auraTypes; + ++count; + } + + TC_LOG_INFO("server.loading", ">> Parsed %u SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellProcs() diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 51860a95fa..099f2c454b 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -295,11 +295,11 @@ enum SpellGroup #define SPELL_GROUP_DB_RANGE_MIN 1000 // spell_id, group_id -typedef std::multimap SpellSpellGroupMap; +typedef std::unordered_multimap SpellSpellGroupMap; typedef std::pair SpellSpellGroupMapBounds; // group_id, spell_id -typedef std::multimap SpellGroupSpellMap; +typedef std::unordered_multimap SpellGroupSpellMap; typedef std::pair SpellGroupSpellMapBounds; enum SpellGroupStackRule @@ -312,7 +312,9 @@ enum SpellGroupStackRule SPELL_GROUP_STACK_RULE_MAX }; -typedef std::map SpellGroupStackMap; +typedef std::unordered_map SpellGroupStackMap; + +typedef std::unordered_map> SameEffectStackMap; struct SpellThreatEntry { @@ -606,7 +608,7 @@ class TC_GAME_API SpellMgr void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& foundSpells, std::set& usedGroups) const; // Spell Group Stack Rules table - bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int32 amount, std::map& groups) const; + bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, AuraType auraType, int32 amount, std::map& groups) const; SpellGroupStackRule CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2) const; SpellGroupStackRule GetSpellGroupStackRule(SpellGroup groupid) const; @@ -699,6 +701,7 @@ class TC_GAME_API SpellMgr SpellSpellGroupMap mSpellSpellGroup; SpellGroupSpellMap mSpellGroupSpell; SpellGroupStackMap mSpellGroupStack; + SameEffectStackMap mSpellSameEffectStack; SpellProcMap mSpellProcMap; SpellBonusMap mSpellBonusMap; SpellThreatMap mSpellThreatMap; From 9dbbe9287536b375692a7bdd0dcc939bd3b97333 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 14 Apr 2017 04:26:27 -0300 Subject: [PATCH 092/110] Core/Spell: build fix --- src/server/game/Spells/SpellMgr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 099f2c454b..699f7e02bc 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -292,6 +292,18 @@ enum SpellGroup SPELL_GROUP_CORE_RANGE_MAX = 5 }; +namespace std +{ + template<> + struct hash + { + size_t operator()(SpellGroup const& group) const + { + return hash()(uint32(group)); + } + }; +} + #define SPELL_GROUP_DB_RANGE_MIN 1000 // spell_id, group_id From eee81e3748dbcd7bf9ff8e2047077718bc1aed91 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 14 Apr 2017 04:45:12 -0300 Subject: [PATCH 093/110] Core/Spell: fix nopch build x2 --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Spells/SpellMgr.cpp | 4 ++-- src/server/game/Spells/SpellMgr.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 373ceb6c88..03bd9769d2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4574,7 +4574,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype, std::functionAddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auratype, aurEff->GetAmount(), sameEffectSpellGroup)) + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast(auratype), aurEff->GetAmount(), sameEffectSpellGroup)) modifier += aurEff->GetAmount(); } } @@ -4601,7 +4601,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype, std::functionAddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auratype, aurEff->GetAmount(), sameEffectSpellGroup)) + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast(auratype), aurEff->GetAmount(), sameEffectSpellGroup)) AddPct(multiplier, aurEff->GetAmount()); } } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 3eef027617..401bbacf28 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -398,7 +398,7 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& } } -bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, AuraType auraType, int32 amount, std::map& groups) const +bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, uint32 auraType, int32 amount, std::map& groups) const { uint32 spellId = spellInfo->GetFirstRankSpell()->Id; auto spellGroupBounds = GetSpellSpellGroupMapBounds(spellId); @@ -410,7 +410,7 @@ bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, Aur if (found != mSpellSameEffectStack.end()) { // check auraTypes - if (!found->second.count(uint32(auraType))) + if (!found->second.count(auraType)) continue; // Put the highest amount in the map diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 699f7e02bc..30869f1128 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -620,7 +620,7 @@ class TC_GAME_API SpellMgr void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& foundSpells, std::set& usedGroups) const; // Spell Group Stack Rules table - bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, AuraType auraType, int32 amount, std::map& groups) const; + bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, uint32 auraType, int32 amount, std::map& groups) const; SpellGroupStackRule CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2) const; SpellGroupStackRule GetSpellGroupStackRule(SpellGroup groupid) const; From d2d7a2cb14377d62f99da99f62297381558222fd Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 14 Apr 2017 04:36:12 -0300 Subject: [PATCH 094/110] Core/Spell: fix nopch build --- src/server/game/Spells/SpellMgr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 30869f1128..996424d4ed 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -36,6 +36,7 @@ class Player; class Unit; class ProcEventInfo; struct SkillLineAbilityEntry; +enum AuraType; // only used in code enum SpellCategories From 2ed7602af2c80e0f7bb860026f9902faa58d8265 Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 14 Apr 2017 16:52:13 -0300 Subject: [PATCH 095/110] Core/Spell: fix broken Unit::GetHighestExclusiveSameEffectSpellGroupValue - Affects 3 aura effects currently, should be rewritten with GetTotalAuraModifier maybe? --- src/server/game/Spells/SpellMgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 401bbacf28..aafdc8e36b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1454,10 +1454,10 @@ void SpellMgr::LoadSpellGroupStackRules() continue; } + mSpellGroupStack.emplace(SpellGroup(group_id), SpellGroupStackRule(stack_rule)); + // different container for same effect stack rules, need to check effect types - if (stack_rule != SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT) - mSpellGroupStack.emplace(SpellGroup(group_id), SpellGroupStackRule(stack_rule)); - else + if (stack_rule == SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT) sameEffectGroups.push_back(group_id); ++count; From 07a182f1d3b45f42bd655552279717295f75a5a2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 15 Apr 2017 15:58:56 -0300 Subject: [PATCH 096/110] Core/Spell: register spell mod owner properly on spell cast - This fixes pets and totems getting mods from owner --- src/server/game/Spells/Spell.cpp | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a630dfecc1..bfd3d943fe 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3216,11 +3216,12 @@ void Spell::_cast(bool skipCheck) m_caster->SetInFront(m_targets.GetObjectTarget()); // Should this be done for original caster? - if (m_caster->GetTypeId() == TYPEID_PLAYER) + Player* modOwner = m_caster->GetSpellModOwner(); + if (modOwner) { // Set spell which will drop charges for triggered cast spells // if not successfully cast, will be remove in finish(false) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); + modOwner->SetSpellModTakingSpell(this, true); } CallScriptBeforeCastHandlers(); @@ -3235,8 +3236,8 @@ void Spell::_cast(bool skipCheck) SendCastResult(castResult, ¶m1, ¶m2); SendInterrupted(0); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + if (modOwner) + modOwner->SetSpellModTakingSpell(this, false); finish(false); SetExecutedCurrently(false); @@ -3247,9 +3248,9 @@ void Spell::_cast(bool skipCheck) // if trade not complete then remember it in trade data if (m_targets.GetTargetMask() & TARGET_FLAG_TRADE_ITEM) { - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (modOwner) { - if (TradeData* my_trade = m_caster->ToPlayer()->GetTradeData()) + if (TradeData* my_trade = modOwner->GetTradeData()) { if (!my_trade->IsInAcceptProcess()) { @@ -3258,7 +3259,7 @@ void Spell::_cast(bool skipCheck) SendCastResult(SPELL_FAILED_DONT_REPORT); SendInterrupted(0); - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + modOwner->SetSpellModTakingSpell(this, false); finish(false); SetExecutedCurrently(false); @@ -3283,8 +3284,8 @@ void Spell::_cast(bool skipCheck) { SendInterrupted(0); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + if (modOwner) + modOwner->SetSpellModTakingSpell(this, false); finish(false); SetExecutedCurrently(false); @@ -3369,12 +3370,12 @@ void Spell::_cast(bool skipCheck) m_caster->CastSpell(m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster, *i, true); } - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (modOwner) { - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + modOwner->SetSpellModTakingSpell(this, false); //Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled. - if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) + if (modOwner->GetCommandStatus(CHEAT_COOLDOWN)) m_caster->GetSpellHistory()->ResetCooldown(m_spellInfo->Id, true); } @@ -3474,8 +3475,9 @@ uint64 Spell::handle_delayed(uint64 t_offset) return 0; } - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); + Player* modOwner = m_caster->GetSpellModOwner(); + if (modOwner) + modOwner->SetSpellModTakingSpell(this, true); uint64 next_time = 0; @@ -3518,8 +3520,8 @@ uint64 Spell::handle_delayed(uint64 t_offset) FinishTargetProcessing(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + if (modOwner) + modOwner->SetSpellModTakingSpell(this, false); // All targets passed - need finish phase if (next_time == 0) From c2fd775e5d5237700b2898eedd5a863eecb108a0 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 05:24:21 +0100 Subject: [PATCH 097/110] Add missing changes Core compiles now --- src/server/game/Spells/Spell.cpp | 1 - src/server/game/Spells/SpellInfo.cpp | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bfd3d943fe..edb56dd60b 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2011,7 +2011,6 @@ void Spell::prepareDataForTriggerSystem() m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap { m_procAttacker |= PROC_FLAG_DONE_TRAP_ACTIVATION; - } // also fill up other flags (DoAllEffectOnTarget only fills up flag if both are not set) m_procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 3786f88f8b..7d93438922 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2680,6 +2680,26 @@ void SpellInfo::_LoadSpellDiminishInfo() _diminishInfoNonTriggered = normalInfo; } +DiminishingGroup SpellInfo::GetDiminishingReturnsGroupForSpell(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishGroup : _diminishInfoNonTriggered.DiminishGroup; +} + +DiminishingReturnsType SpellInfo::GetDiminishingReturnsGroupType(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishReturnType : _diminishInfoNonTriggered.DiminishReturnType; +} + +DiminishingLevels SpellInfo::GetDiminishingReturnsMaxLevel(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishMaxLevel : _diminishInfoNonTriggered.DiminishMaxLevel; +} + +int32 SpellInfo::GetDiminishingReturnsLimitDuration(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishDurationLimit : _diminishInfoNonTriggered.DiminishDurationLimit; +} + void SpellInfo::_LoadImmunityInfo() { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) From 1a5c7aed42862d84862d3dcc9633303e83466d53 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 05:58:22 +0100 Subject: [PATCH 098/110] Remove merge error --- sql/base/auth_database.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 9baa75c683..4c9dd90027 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -649,12 +649,8 @@ CREATE TABLE `updates` ( LOCK TABLES `updates` WRITE; /*!40000 ALTER TABLE `updates` DISABLE KEYS */; -<<<<<<< HEAD INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-14 23:27:07',0),('2016_01_13_00_auth_434.sql','3E88183E1A85D11BFD74CF9A32A725C44AE02EEC','ARCHIVED','2016-01-13 01:19:16',0),('2016_03_12_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-03-12 01:19:16',0),('2016_05_15_00_auth_from_335_was_2016_05_11_00_auth.sql','C593DA4423F344FB10AAA86C20D1E87B','ARCHIVED','',0),('2016_08_28_00_auth.sql','30A76055F50A79629DB82B7BF17CE9B7','ARCHIVED','',0),('2016_09_03_02_auth_from_335_was_2016_06_06_00_auth.sql','8E1989D33A2A6CCC60B3AFAEFCBFD735','ARCHIVED','',0),('2016_09_28_00_auth.sql','1719674D3EE9E8B965BAC4042140D6BD','ARCHIVED','',0),('2016_11_06_00_auth.sql','C3B848943465F7D360EF3E01F46219E6','ARCHIVED','2016-11-06 17:11:18',0),('2017_01_07_00_auth_from_335_was_2017_01_06_00_auth.sql','D471D225E30B746E4A1736D173E83A84','ARCHIVED','2017-01-07 00:00:00',0),('2017_01_12_00_auth.sql','7EB5AAEC12EDD728EB66C89FF5E4C466','ARCHIVED','2017-01-12 00:00:00',0),('2017_02_11_00_auth.sql','16147413149F2EA1AD413FEA9C503093','ARCHIVED','2017-02-11 00:00:00',0),('2017_03_16_00_auth.sql','C1BC73E532180AE4CE5D28AF6A0730DC','RELEASED','2017-02-16 00:00:00',0),('2017_03_20_00_auth_from_335_was_2017_03_17_00_auth.sql','22FBDB54B8BC809C95E4D2AFAF1B249C','ARCHIVED','2017-03-20 16:48:01',0),('2017_04_02_00_auth.sql','2420814101287A57800A877BE699AE5F','ARCHIVED','2017-04-02 07:48:01',0),('2017_04_16_00_auth.sql','0E7939DE2187B93E351DE6174D467F0C','ARCHIVED','2017-04-16 07:48:01',0); -======= -INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',92),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-13 00:00:00',0),('2016_04_11_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-04-11 03:18:17',0),('2016_05_11_00_auth.sql','95B66235B8D67BF1CA216EB09F313C1F8F393B47','RELEASED','2016-04-16 13:17:11',0),('2016_06_06_00_auth.sql','57603BB68C340A8C919FB424452C282C47A193F7','RELEASED','2016-06-06 18:20',0),('2016_09_22_00_auth.sql','70047954E3556BFA430ADD5680EF8797F74A4B9E','RELEASED','2016-09-22 00:00:00',0); ->>>>>>> e641d0c7d7... Core/Spells: Implementation of QAston proc system /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; From 7d6884dcb53ff3908d7f61332990bcbd2a71b318 Mon Sep 17 00:00:00 2001 From: roc13x Date: Thu, 4 May 2017 21:16:50 +0100 Subject: [PATCH 099/110] Core/Spells: Fix SPELL_AURA_PROC_ON_POWER_AMOUNT Will re-implement the eclipse handling in spellscripts later --- src/server/game/Entities/Unit/Unit.cpp | 115 ------------------ .../game/Spells/Auras/SpellAuraEffects.cpp | 33 ++++- .../game/Spells/Auras/SpellAuraEffects.h | 1 + src/server/game/Spells/Auras/SpellAuras.cpp | 5 - src/server/game/Spells/SpellMgr.cpp | 1 + 5 files changed, 34 insertions(+), 121 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 03bd9769d2..0ee1efb9f0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5199,121 +5199,6 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType SendAttackStateUpdate(&dmgInfo); } -/*bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) -{ - // Get triggered aura spell info - SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); - - // Get effect index used for the proc - uint32 effIndex = triggeredByAura->GetEffIndex(); - - // Power amount required to proc the spell - int32 powerAmountRequired = triggeredByAura->GetAmount(); - // Power type required to proc - Powers powerRequired = Powers(auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].MiscValue); - - // Set trigger spell id, target, custom basepoints - uint32 trigger_spell_id = auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].TriggerSpell; - - Unit* target = NULL; - int32 basepoints0 = 0; - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - // All ok. Check current trigger spell - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id); - if (triggerEntry == NULL) - { - // Not cast unknown spell - // TC_LOG_ERROR("Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 in EffectTriggered[%d], not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); - return false; - } - - // not allow proc extra attack spell at extra attack - if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) - return false; - - if (!powerRequired || !powerAmountRequired) - { - TC_LOG_ERROR("spells", "Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); - return false; - } - - if (GetPower(powerRequired) != powerAmountRequired) - return false; - - // Custom requirements (not listed in procEx) Warning! damage dealing after this - // Custom triggered spells - switch (auraSpellInfo->SpellFamilyName) - { - case SPELLFAMILY_DRUID: - { - // Eclipse Mastery Driver Passive - if (auraSpellInfo->Id == 79577) - { - uint32 solarEclipseMarker = 67483; - uint32 lunarEclipseMarker = 67484; - - switch (effIndex) - { - case 0: - { - if (HasAura(trigger_spell_id)) - return false; - - // Do not proc if proc spell isnt starfire and starsurge - if (procSpell->Id != 2912 && procSpell->Id != 78674) - return false; - - if (HasAura(solarEclipseMarker)) - { - RemoveAurasDueToSpell(solarEclipseMarker); - CastSpell(this, lunarEclipseMarker, true); - } - break; - } - case 1: - { - if (HasAura(trigger_spell_id)) - return false; - - // Do not proc if proc spell isnt wrath and starsurge - if (procSpell->Id != 5176 && procSpell->Id != 78674) - return false; - - if (HasAura(lunarEclipseMarker)) - { - RemoveAurasDueToSpell(lunarEclipseMarker); - CastSpell(this, solarEclipseMarker, true); - } - - break; - } - } - } - break; - } - } - - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetSpellHistory()->HasCooldown(trigger_spell_id)) - return false; - - // try detect target manually if not set - if (target == NULL) - target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry && triggerEntry->IsPositive() ? this : victim; - - if (basepoints0) - CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown)); - - return true; -}*/ - void Unit::setPowerType(Powers new_powertype) { if (getPowerType() == new_powertype) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4d299807a9..0486cb7405 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -386,7 +386,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleUnused, //325 unused (4.3.4) &AuraEffect::HandlePhaseGroup, //326 SPELL_AURA_PHASE_GROUP &AuraEffect::HandleUnused, //327 unused (4.3.4) - &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in Unit::HandleAuraProcOnPowerAmount + &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in AuraEffect::HandleProc &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNoImmediateEffect, //330 SPELL_AURA_CAST_WHILE_WALKING &AuraEffect::HandleAuraForceWeather, //331 SPELL_AURA_FORCE_WEATHER @@ -1124,6 +1124,7 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn break; case SPELL_AURA_PROC_TRIGGER_SPELL: case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: + case SPELL_AURA_PROC_ON_POWER_AMOUNT: { // Don't proc extra attacks while already processing extra attack spell uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; @@ -1172,6 +1173,9 @@ void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: HandleRaidProcFromChargeWithValueAuraProc(aurApp, eventInfo); break; + case SPELL_AURA_PROC_ON_POWER_AMOUNT: + HandleProcOnPowerAmountAuraProc(aurApp, eventInfo); + break; default: break; } @@ -6239,6 +6243,33 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA target->CastCustomSpell(target, triggerSpellId, &value, NULL, NULL, true, NULL, this, GetCasterGUID()); } +void AuraEffect::HandleProcOnPowerAmountAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) +{ + Unit* triggerCaster = aurApp->GetTarget(); + Unit* triggerTarget = eventInfo.GetProcTarget(); + + int32 powerAmountRequired = GetAmount(); + Powers powerRequired = Powers(GetMiscValue()); + + if (!powerRequired || !powerAmountRequired) + { + TC_LOG_ERROR("spells", "AuraEffect::HandleProcOnPowerAmountAuraProc: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", GetId(), GetEffIndex()); + return; + } + + if (triggerCaster->GetPower(powerRequired) != powerAmountRequired) + return; + + uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; + if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) + { + TC_LOG_DEBUG("spells", "AuraEffect::HandleProcOnPowerAmountAuraProc: Triggering spell %u from aura %u proc", triggeredSpellInfo->Id, GetId()); + triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); + } + else + TC_LOG_ERROR("spells", "AuraEffect::HandleProcOnPowerAmountAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); +} + void AuraEffect::HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const { if (!(mode & AURA_EFFECT_HANDLE_REAL)) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 7cba9937f4..35621de20d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -319,6 +319,7 @@ class TC_GAME_API AuraEffect void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); + void HandleProcOnPowerAmountAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); }; namespace Trinity diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index bc4cdceffd..547f392691 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1273,11 +1273,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastSpell(target, 61634, true); } } - switch (GetId()) - { - default: - break; - } break; case SPELLFAMILY_PRIEST: if (!caster) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index aafdc8e36b..fa0ae5c000 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1760,6 +1760,7 @@ void SpellMgr::LoadSpellProcs() isTriggerAura[SPELL_AURA_MOD_HIT_CHANCE] = true; isTriggerAura[SPELL_AURA_MOD_WEAPON_CRIT_PERCENT] = true; isTriggerAura[SPELL_AURA_MOD_BLOCK_PERCENT] = true; + isTriggerAura[SPELL_AURA_PROC_ON_POWER_AMOUNT] = true; isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; From 02e174d7e936a6c23a2f0d49bc95295231121d6b Mon Sep 17 00:00:00 2001 From: roc13x Date: Fri, 5 May 2017 00:10:25 +0100 Subject: [PATCH 100/110] Cleanup --- src/server/game/Spells/Spell.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index edb56dd60b..f359c5ad75 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3380,9 +3380,6 @@ void Spell::_cast(bool skipCheck) SetExecutedCurrently(false); - //if (Creature* creatureCaster = m_caster->ToCreature()) //TODO investigate - // creatureCaster->ReleaseFocus(this); - if (!m_originalCaster) return; @@ -7741,9 +7738,6 @@ void Spell::TriggerGlobalCooldown() // Apply haste rating if (gcd > MIN_GCD && ((m_spellInfo->StartRecoveryCategory == 133 && !isMeleeOrRangedSpell))) gcd = std::min(std::max(int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_HASTE)), MIN_GCD), MAX_GCD); - - //gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); //TODO investigate - //RoundToInterval(gcd, MIN_GCD, MAX_GCD); } m_caster->GetSpellHistory()->AddGlobalCooldown(m_spellInfo, gcd); From b88200cd58941168399c790c2cde03f96f33ef4d Mon Sep 17 00:00:00 2001 From: xinef1 Date: Sun, 5 Feb 2017 23:42:31 +0100 Subject: [PATCH 101/110] Core/Misc: Various crash fixes --- .../game/AI/SmartScripts/SmartScript.cpp | 24 ++++++------- src/server/game/AI/SmartScripts/SmartScript.h | 2 +- src/server/game/Combat/ThreatManager.cpp | 3 +- src/server/game/DungeonFinding/LFGMgr.cpp | 4 +-- src/server/game/DungeonFinding/LFGMgr.h | 3 +- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 5 ++- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Groups/Group.cpp | 36 ++++++++----------- src/server/game/Handlers/LootHandler.cpp | 3 +- src/server/game/Handlers/MiscHandler.cpp | 6 ++-- src/server/game/Handlers/PetHandler.cpp | 2 +- src/server/game/Handlers/VehicleHandler.cpp | 5 ++- src/server/game/Instances/InstanceScript.cpp | 2 +- src/server/game/Maps/Map.cpp | 5 +++ src/server/game/Maps/Map.h | 5 +-- src/server/game/Maps/MapScripts.cpp | 6 ++-- src/server/game/Spells/Auras/SpellAuras.cpp | 15 +++++++- src/server/game/Spells/SpellInfo.cpp | 3 +- .../BlackrockDepths/boss_coren_direbrew.cpp | 2 +- .../boss_headless_horseman.cpp | 2 +- .../TheSlavePens/boss_ahune.cpp | 2 +- 22 files changed, 79 insertions(+), 60 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 242a5d45f8..8b4473e777 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -461,7 +461,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) if (Vehicle* vehicle = (*itr)->ToUnit()->GetVehicleKit()) for (SeatMap::iterator it = vehicle->Seats.begin(); it != vehicle->Seats.end(); ++it) - if (Player* player = ObjectAccessor::FindPlayer(it->second.Passenger.Guid)) + if (Player* player = ObjectAccessor::GetPlayer(*(*itr), it->second.Passenger.Guid)) player->AreaExploredOrEventHappens(e.action.quest.quest); if (IsPlayer(*itr)) @@ -547,7 +547,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } case SMART_ACTION_INVOKER_CAST: { - Unit* tempLastInvoker = GetLastInvoker(); + Unit* tempLastInvoker = GetLastInvoker(unit); if (!tempLastInvoker) break; @@ -805,7 +805,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u // Special handling for vehicles if (Vehicle* vehicle = unit->GetVehicleKit()) for (SeatMap::iterator it = vehicle->Seats.begin(); it != vehicle->Seats.end(); ++it) - if (Player* player = ObjectAccessor::FindPlayer(it->second.Passenger.Guid)) + if (Player* player = ObjectAccessor::GetPlayer(*unit, it->second.Passenger.Guid)) player->GroupEventHappens(e.action.quest.quest, GetBaseObject()); break; } @@ -950,7 +950,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else if (IsUnit(*itr)) // Special handling for vehicles if (Vehicle* vehicle = (*itr)->ToUnit()->GetVehicleKit()) for (SeatMap::iterator seatItr = vehicle->Seats.begin(); seatItr != vehicle->Seats.end(); ++seatItr) - if (Player* player = ObjectAccessor::FindPlayer(seatItr->second.Passenger.Guid)) + if (Player* player = ObjectAccessor::GetPlayer(*(*itr), seatItr->second.Passenger.Guid)) player->KilledMonsterCredit(e.action.killedMonster.creature); } @@ -4082,14 +4082,14 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry) } } -Unit* SmartScript::GetLastInvoker() +Unit* SmartScript::GetLastInvoker(Unit* invoker) { - WorldObject* lookupRoot = me; - if (!lookupRoot) - lookupRoot = go; + // Look for invoker only on map of base object... Prevents multithreaded crashes + if (WorldObject* baseObject = GetBaseObject()) + return ObjectAccessor::GetUnit(*baseObject, mLastInvoker); + // used for area triggers invoker cast + else if (invoker) + return ObjectAccessor::GetUnit(*invoker, mLastInvoker); - if (lookupRoot) - return ObjectAccessor::GetUnit(*lookupRoot, mLastInvoker); - - return ObjectAccessor::FindPlayer(mLastInvoker); + return nullptr; } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index d085740269..fe76520583 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -235,7 +235,7 @@ class TC_GAME_API SmartScript //TIMED_ACTIONLIST (script type 9 aka script9) void SetScript9(SmartScriptHolder& e, uint32 entry); - Unit* GetLastInvoker(); + Unit* GetLastInvoker(Unit* invoker = nullptr); ObjectGuid mLastInvoker; typedef std::unordered_map CounterMap; CounterMap mCounterList; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 6e10e8345c..2bf8132a40 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -422,7 +422,8 @@ void ThreatManager::doAddThreat(Unit* victim, float threat) { float redirectThreat = CalculatePct(threat, redirectThreadPct); threat -= redirectThreat; - _addThreat(redirectTarget, redirectThreat); + if (ThreatCalcHelper::isValidProcess(redirectTarget, GetOwner())) + _addThreat(redirectTarget, redirectThreat); } } diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9d9757b7af..5554b42fc7 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1346,7 +1346,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* @param[in] guid Group guid @param[in] dungeonId Dungeonid */ -void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId) +void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const* currMap) { uint32 gDungeonId = GetDungeon(gguid); if (gDungeonId != dungeonId) @@ -1390,7 +1390,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId) } Player* player = ObjectAccessor::FindPlayer(guid); - if (!player) + if (!player || player->FindMap() != currMap) { TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %s, Player: %s not found in world", gguid.ToString().c_str(), guid.ToString().c_str()); continue; diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 3909897612..95522d47ae 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -28,6 +28,7 @@ class Group; class Player; class Quest; +class Map; namespace lfg { @@ -309,7 +310,7 @@ class TC_GAME_API LFGMgr // World.cpp /// Finish the dungeon for the given group. All check are performed using internal lfg data - void FinishDungeon(ObjectGuid gguid, uint32 dungeonId); + void FinishDungeon(ObjectGuid gguid, uint32 dungeonId, Map const* currMap); /// Loads rewards for random dungeons void LoadRewards(); /// Loads dungeons from dbc and adds teleport coords diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index bae3a9ec1f..e58acfe9e2 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2012,7 +2012,7 @@ void WorldObject::AddObjectToRemoveList() map->AddObjectToRemoveList(this); } -TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= NULL*/, uint32 duration /*= 0*/, Unit* summoner /*= NULL*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/) +TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= nullptr*/, uint32 duration /*= 0*/, Unit* summoner /*= nullptr*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/) { uint32 mask = UNIT_MASK_SUMMON; if (properties) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 662bec42dd..6c4350fdcf 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2174,6 +2174,9 @@ void Player::RemoveFromWorld() UnsummonPetTemporaryIfAny(); ClearComboPoints(); ClearComboPointHolders(); + ObjectGuid lootGuid = GetLootGUID(); + if (!lootGuid.IsEmpty()) + m_session->DoLootRelease(lootGuid); sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); } @@ -24315,7 +24318,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const if (!player || IsAlive()) player = this; - if (player->GetMap()->IsDungeon()) + if (pRewardSource->GetMap()->IsDungeon()) return true; return pRewardSource->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0ee1efb9f0..1eb7b16035 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10833,7 +10833,7 @@ void Unit::ClearComboPointHolders() { ObjectGuid guid = *m_ComboPointHolders.begin(); - Player* player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::GetPlayer(*this, guid); if (player && player->GetComboTarget() == GetGUID()) // recheck for safe player->ClearComboPoints(); // remove also guid from m_ComboPointHolders; else diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 78e86e7b62..15143b06aa 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1028,21 +1028,18 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) Player* member = itr->GetSource(); if (!member || !member->GetSession()) continue; - if (i->AllowedForPlayer(member)) + if (member->IsAtGroupRewardDistance(pLootedObject) && i->AllowedForPlayer(member)) { - if (member->IsAtGroupRewardDistance(pLootedObject)) - { - r->totalPlayersRolling++; + r->totalPlayersRolling++; - if (member->GetPassOnGroupLoot()) - { - r->playerVote[member->GetGUID()] = PASS; - r->totalPass++; - // can't broadcast the pass now. need to wait until all rolling players are known. - } - else - r->playerVote[member->GetGUID()] = NOT_EMITED_YET; + if (member->GetPassOnGroupLoot()) + { + r->playerVote[member->GetGUID()] = PASS; + r->totalPass++; + // can't broadcast the pass now. need to wait until all rolling players are known. } + else + r->playerVote[member->GetGUID()] = NOT_EMITED_YET; } } @@ -1114,13 +1111,10 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) if (!member || !member->GetSession()) continue; - if (i->AllowedForPlayer(member)) + if (member->IsAtGroupRewardDistance(pLootedObject) && i->AllowedForPlayer(member)) { - if (member->IsAtGroupRewardDistance(pLootedObject)) - { - r->totalPlayersRolling++; - r->playerVote[member->GetGUID()] = NOT_EMITED_YET; - } + r->totalPlayersRolling++; + r->playerVote[member->GetGUID()] = NOT_EMITED_YET; } } @@ -1175,8 +1169,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) if (!playerToRoll || !playerToRoll->GetSession()) continue; - bool allowedForPlayer = i->AllowedForPlayer(playerToRoll); - if (allowedForPlayer && playerToRoll->IsAtGroupRewardDistance(lootedObject)) + if (playerToRoll->IsAtGroupRewardDistance(lootedObject) && i->AllowedForPlayer(playerToRoll)) { r->totalPlayersRolling++; if (playerToRoll->GetPassOnGroupLoot()) @@ -1251,8 +1244,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) if (!playerToRoll || !playerToRoll->GetSession()) continue; - bool allowedForPlayer = i->AllowedForPlayer(playerToRoll); - if (allowedForPlayer && playerToRoll->IsAtGroupRewardDistance(lootedObject)) + if (playerToRoll->IsAtGroupRewardDistance(lootedObject) && i->AllowedForPlayer(playerToRoll)) { r->totalPlayersRolling++; r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET; diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 7e6d4c7e02..0eaf9237b9 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -445,7 +445,8 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) return; } - Player* target = ObjectAccessor::FindPlayer(target_playerguid); + // player on other map + Player* target = ObjectAccessor::GetPlayer(*_player, target_playerguid); if (!target) { _player->SendLootError(lootguid, LOOT_ERROR_PLAYER_NOT_FOUND); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index b7450deb38..1a86813528 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1065,7 +1065,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recvData) TC_LOG_DEBUG("network", "WORLD: Received CMSG_INSPECT"); - Player* player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { TC_LOG_DEBUG("network", "CMSG_INSPECT: No player found from %s", guid.ToString().c_str()); @@ -1122,7 +1122,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recvData) recvData.ReadByteSeq(guid[6]); recvData.ReadByteSeq(guid[2]); recvData.ReadByteSeq(guid[3]); - Player* player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { TC_LOG_DEBUG("network", "CMSG_INSPECT_HONOR_STATS: No player found from %s", guid.ToString().c_str()); @@ -1567,7 +1567,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket& recvData) recvData >> guid.ReadAsPacked(); TC_LOG_DEBUG("network", "CMSG_QUERY_INSPECT_ACHIEVEMENTS [%s] Inspected Player [%s]", _player->GetGUID().ToString().c_str(), guid.ToString().c_str()); - Player* player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) return; diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 6d2b4abf2e..2962ff323d 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -711,7 +711,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) if (!_player->GetGuardianPet() && !_player->GetCharm()) return; - if (ObjectAccessor::FindPlayer(guid)) + if (guid.IsPlayer()) return; Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index fae6ccd630..93ec5c50b6 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -142,7 +142,7 @@ void WorldSession::HandleEnterPlayerVehicle(WorldPacket& data) ObjectGuid guid; data >> guid; - if (Player* player = ObjectAccessor::FindPlayer(guid)) + if (Player* player = ObjectAccessor::GetPlayer(*_player, guid)) { if (!player->GetVehicleKit()) return; @@ -150,6 +150,9 @@ void WorldSession::HandleEnterPlayerVehicle(WorldPacket& data) return; if (!player->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; + // Dont' allow players to enter player vehicle on arena + if (!_player->FindMap() || _player->FindMap()->IsBattleArena()) + return; _player->EnterVehicle(player); } diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index a4cb7049cd..bc75cc3a08 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -679,7 +679,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi if (Group* grp = player->GetGroup()) if (grp->isLFGGroup()) { - sLFGMgr->FinishDungeon(grp->GetGUID(), dungeonId); + sLFGMgr->FinishDungeon(grp->GetGUID(), dungeonId, instance); return; } } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 023b2fc288..744a93a82a 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3447,6 +3447,11 @@ void BattlegroundMap::RemoveAllPlayers() player->TeleportTo(player->GetBattlegroundEntryPoint()); } +Player* Map::GetPlayer(ObjectGuid const& guid) +{ + return ObjectAccessor::GetPlayer(this, guid); +} + AreaTrigger* Map::GetAreaTrigger(ObjectGuid const& guid) { return _objectsStore.Find(guid); diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index fb87201026..c2db734f24 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -446,8 +446,9 @@ class TC_GAME_API Map : public GridRefManager void UpdateIteratorBack(Player* player); - TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = NULL, uint32 duration = 0, Unit* summoner = NULL, uint32 spellId = 0, uint32 vehId = 0); - void SummonCreatureGroup(uint8 group, std::list* list = NULL); + TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = nullptr, uint32 duration = 0, Unit* summoner = nullptr, uint32 spellId = 0, uint32 vehId = 0); + void SummonCreatureGroup(uint8 group, std::list* list = nullptr); + Player* GetPlayer(ObjectGuid const& guid); AreaTrigger* GetAreaTrigger(ObjectGuid const& guid); Corpse* GetCorpse(ObjectGuid const& guid); Creature* GetCreature(ObjectGuid const& guid); diff --git a/src/server/game/Maps/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp index a5bdc9c2ff..aff6a27a09 100644 --- a/src/server/game/Maps/MapScripts.cpp +++ b/src/server/game/Maps/MapScripts.cpp @@ -296,7 +296,7 @@ void Map::ScriptsProcess() switch (step.sourceGUID.GetHigh()) { case HighGuid::Item: // as well as HighGuid::Container - if (Player* player = HashMapHolder::Find(step.ownerGUID)) + if (Player* player = GetPlayer(step.ownerGUID)) source = player->GetItemByGuid(step.sourceGUID); break; case HighGuid::Unit: @@ -307,7 +307,7 @@ void Map::ScriptsProcess() source = GetPet(step.sourceGUID); break; case HighGuid::Player: - source = HashMapHolder::Find(step.sourceGUID); + source = GetPlayer(step.sourceGUID); break; case HighGuid::Transport: case HighGuid::GameObject: @@ -339,7 +339,7 @@ void Map::ScriptsProcess() target = GetPet(step.targetGUID); break; case HighGuid::Player: // empty GUID case also - target = HashMapHolder::Find(step.targetGUID); + target = GetPlayer(step.targetGUID); break; case HighGuid::Transport: case HighGuid::GameObject: diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 547f392691..bb5ba386ac 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -971,8 +971,9 @@ bool Aura::CanBeSaved() const if (IsPassive()) return false; + // Check if aura is single target, not only spell info if (GetCasterGUID() != GetOwner()->GetGUID()) - if (GetSpellInfo()->IsSingleTarget()) + if (GetSpellInfo()->IsSingleTarget() || IsSingleTarget()) return false; // Can't be saved - aura handler relies on calculated amount and changes it @@ -987,6 +988,18 @@ bool Aura::CanBeSaved() const if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE)) return false; + // do not save bind sight auras + if (HasEffectType(SPELL_AURA_BIND_SIGHT)) + return false; + + // no charming auras (taking direct control) + if (HasEffectType(SPELL_AURA_MOD_POSSESS) || HasEffectType(SPELL_AURA_MOD_POSSESS_PET)) + return false; + + // no charming auras can be saved + if (HasEffectType(SPELL_AURA_MOD_CHARM) || HasEffectType(SPELL_AURA_AOE_CHARM)) + return false; + // Incanter's Absorbtion - considering the minimal duration and problems with aura stacking // we skip saving this aura // Also for some reason other auras put as MultiSlot crash core on keeping them after restart, diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7d93438922..b642e8f7bc 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -416,8 +416,7 @@ bool SpellEffectInfo::IsFarUnitTargetEffect() const return (Effect == SPELL_EFFECT_SUMMON_PLAYER) || (Effect == SPELL_EFFECT_SUMMON_RAF_FRIEND) || (Effect == SPELL_EFFECT_RESURRECT) - || (Effect == SPELL_EFFECT_RESURRECT_NEW) - || (Effect == SPELL_EFFECT_SKIN_PLAYER_CORPSE); + || (Effect == SPELL_EFFECT_RESURRECT_NEW); } bool SpellEffectInfo::IsFarDestTargetEffect() const diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp index c74c5ae0f8..b9e9e6186b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp @@ -204,7 +204,7 @@ public: { if (Group* group = players.begin()->GetSource()->GetGroup()) if (group->isLFGGroup()) - sLFGMgr->FinishDungeon(group->GetGUID(), 287); + sLFGMgr->FinishDungeon(group->GetGUID(), 287, me->GetMap()); } } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 03bc38f2bb..3102b7461d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -576,7 +576,7 @@ public: { if (Group* group = players.begin()->GetSource()->GetGroup()) if (group->isLFGGroup()) - sLFGMgr->FinishDungeon(group->GetGUID(), 285); + sLFGMgr->FinishDungeon(group->GetGUID(), 285, me->GetMap()); } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp index d2571e9d1d..702496500e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp @@ -201,7 +201,7 @@ public: { if (Group* group = players.begin()->GetSource()->GetGroup()) if (group->isLFGGroup()) - sLFGMgr->FinishDungeon(group->GetGUID(), 286); + sLFGMgr->FinishDungeon(group->GetGUID(), 286, me->GetMap()); } _JustDied(); From 0242bd6f20558c38d8ce97324d69dd42e8162264 Mon Sep 17 00:00:00 2001 From: roc13x Date: Fri, 5 May 2017 03:51:07 +0100 Subject: [PATCH 102/110] Build fix --- .../ShadowfangKeep/boss_apothecary_hummel.cpp | 2 +- .../boss_icecrown_gunship_battle.cpp | 28 +++++++++++++++++++ src/server/scripts/Pet/pet_hunter.cpp | 8 +++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index 7aadce3f4d..1ca23799f8 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -180,7 +180,7 @@ class boss_apothecary_hummel : public CreatureScript { if (Group* group = players.begin()->GetSource()->GetGroup()) if (group->isLFGGroup()) - sLFGMgr->FinishDungeon(group->GetGUID(), 288); + sLFGMgr->FinishDungeon(group->GetGUID(), 288, me->GetMap()); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 5b2d72d111..647ea05426 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -2459,6 +2459,33 @@ class spell_igb_teleport_players_on_victory : public SpellScriptLoader } }; +// 71201 - Battle Experience - proc should never happen, handled in script +class spell_igb_battle_experience_check : public SpellScriptLoader +{ +public: + spell_igb_battle_experience_check() : SpellScriptLoader("spell_igb_battle_experience_check") { } + + class spell_igb_battle_experience_check_AuraScript : public AuraScript + { + PrepareAuraScript(spell_igb_battle_experience_check_AuraScript); + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_igb_battle_experience_check_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_igb_battle_experience_check_AuraScript(); + } +}; + class achievement_im_on_a_boat : public AchievementCriteriaScript { public: @@ -2498,5 +2525,6 @@ void AddSC_boss_icecrown_gunship_battle() new spell_igb_gunship_fall_teleport(); new spell_igb_check_for_players(); new spell_igb_teleport_players_on_victory(); + new spell_igb_battle_experience_check(); new achievement_im_on_a_boat(); } diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 1dd6983ade..4082f297f0 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -185,9 +185,9 @@ class spell_pet_guard_dog : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true); + caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true, nullptr, aurEff); - float addThreat = CalculatePct(eventInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); + float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); eventInfo.GetProcTarget()->AddThreat(caster, addThreat); } @@ -232,14 +232,14 @@ class spell_pet_silverback : public SpellScriptLoader return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 }; PreventDefaultAction(); uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1]; - eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff); } void Register() override From e2ac33fdc2d1ced8d8c4ccd7e8a0a84a0d3a5e32 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 23 Feb 2017 11:27:36 -0300 Subject: [PATCH 103/110] Core/Scripts: Victory Rush and Rune Strike proc correction (d0f760420a671bc255c0d3ebec75e6837507a541 follow up) Closes #19192 --- .../world/3.3.5/2017_02_23_01_world_335.sql | 6 +++++ src/server/scripts/Spells/spell_generic.cpp | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_02_23_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_02_23_01_world_335.sql b/sql/updates/world/3.3.5/2017_02_23_01_world_335.sql new file mode 100644 index 0000000000..8985885641 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_02_23_01_world_335.sql @@ -0,0 +1,6 @@ +UPDATE `spell_proc` SET `AttributesMask`=(`AttributesMask` & ~0x10) WHERE `SpellId` IN (32216, 56817); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_proc_charge_drop_only'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(32216, 'spell_gen_proc_charge_drop_only'), +(56817, 'spell_gen_proc_charge_drop_only'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index a34fdf39be..6d38cc4729 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2375,6 +2375,32 @@ class spell_gen_proc_below_pct_damaged : public SpellScriptLoader } }; +class spell_gen_proc_charge_drop_only : public SpellScriptLoader +{ + public: + spell_gen_proc_charge_drop_only() : SpellScriptLoader("spell_gen_proc_charge_drop_only") { } + + class spell_gen_proc_charge_drop_only_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_proc_charge_drop_only_AuraScript); + + void HandleChargeDrop(ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + } + + void Register() override + { + OnProc += AuraProcFn(spell_gen_proc_charge_drop_only_AuraScript::HandleChargeDrop); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_proc_charge_drop_only_AuraScript(); + } +}; + enum ParachuteSpells { SPELL_PARACHUTE = 45472, @@ -4179,6 +4205,7 @@ void AddSC_generic_spell_scripts() new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin_heroic"); new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale"); new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale_heroic"); + new spell_gen_proc_charge_drop_only(); new spell_gen_parachute(); new spell_gen_pet_summoned(); new spell_gen_profession_research(); From ea20370fcee5e44b569c601019aec08a9b394f56 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 23 Feb 2017 11:33:40 -0300 Subject: [PATCH 104/110] Core/Scripts: kill a warning --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 6d38cc4729..97bac6c791 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2384,7 +2384,7 @@ class spell_gen_proc_charge_drop_only : public SpellScriptLoader { PrepareAuraScript(spell_gen_proc_charge_drop_only_AuraScript); - void HandleChargeDrop(ProcEventInfo& eventInfo) + void HandleChargeDrop(ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); } From 1e475a69420ea12633c28ab7c3d94daea8877dc5 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 26 Mar 2017 14:19:20 -0300 Subject: [PATCH 105/110] Core/Scripts: implemented enchant Blade Warding --- .../world/3.3.5/2017_03_26_05_world_335.sql | 6 +++ src/server/scripts/Spells/spell_generic.cpp | 49 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_03_26_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_03_26_05_world_335.sql b/sql/updates/world/3.3.5/2017_03_26_05_world_335.sql new file mode 100644 index 0000000000..d4465ea3ce --- /dev/null +++ b/sql/updates/world/3.3.5/2017_03_26_05_world_335.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_blade_warding'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(64440, 'spell_gen_blade_warding'); + +-- no cooldown +UPDATE `spell_proc` SET `Cooldown`=0 WHERE `SpellId`=64440; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 97bac6c791..3b3b8f4799 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -493,6 +493,54 @@ class spell_gen_bandage : public SpellScriptLoader } }; +// Blade Warding - 64440 +enum BladeWarding +{ + SPELL_GEN_BLADE_WARDING_TRIGGERED = 64442 +}; + +class spell_gen_blade_warding : public SpellScriptLoader +{ + public: + spell_gen_blade_warding() : SpellScriptLoader("spell_gen_blade_warding") { } + + class spell_gen_blade_warding_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_blade_warding_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_GEN_BLADE_WARDING_TRIGGERED }); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActionTarget(); + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_GEN_BLADE_WARDING_TRIGGERED); + + uint8 stacks = GetStackAmount(); + int32 bp = 0; + + for (uint8 i = 0; i < stacks; ++i) + bp += spellInfo->Effects[EFFECT_0].CalcValue(caster); + + caster->CastCustomSpell(SPELL_GEN_BLADE_WARDING_TRIGGERED, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), TRIGGERED_FULL_MASK, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_gen_blade_warding_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_blade_warding_AuraScript(); + } +}; + enum Bonked { SPELL_BONKED = 62991, @@ -4154,6 +4202,7 @@ void AddSC_generic_spell_scripts() new spell_gen_aura_service_uniform(); new spell_gen_av_drekthar_presence(); new spell_gen_bandage(); + new spell_gen_blade_warding(); new spell_gen_bonked(); new spell_gen_break_shield("spell_gen_break_shield"); new spell_gen_break_shield("spell_gen_tournament_counterattack"); From 97e8b18cebb968ec78a4be1bfec39576005ede3d Mon Sep 17 00:00:00 2001 From: roc13x Date: Fri, 5 May 2017 04:26:38 +0100 Subject: [PATCH 106/110] Core/Scripts: Import missing gen/item scripts --- src/server/scripts/Spells/spell_generic.cpp | 56 +++ src/server/scripts/Spells/spell_item.cpp | 392 +++++++++++++++++++- 2 files changed, 442 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3b3b8f4799..3503ee7829 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -493,6 +493,61 @@ class spell_gen_bandage : public SpellScriptLoader } }; +// Blood Reserve - 64568 +enum BloodReserve +{ + SPELL_GEN_BLOOD_RESERVE_AURA = 64568, + SPELL_GEN_BLOOD_RESERVE_HEAL = 64569 +}; + +class spell_gen_blood_reserve : public SpellScriptLoader +{ + public: + spell_gen_blood_reserve() : SpellScriptLoader("spell_gen_blood_reserve") { } + + class spell_gen_blood_reserve_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_blood_reserve_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo()) + if (Unit* caster = eventInfo.GetActionTarget()) + if (caster->HealthBelowPctDamaged(35, dmgInfo->GetDamage())) + return true; + + return false; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActionTarget(); + caster->CastCustomSpell(SPELL_GEN_BLOOD_RESERVE_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), caster, TRIGGERED_FULL_MASK, nullptr, aurEff); + caster->RemoveAura(SPELL_GEN_BLOOD_RESERVE_AURA); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_gen_blood_reserve_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_gen_blood_reserve_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_blood_reserve_AuraScript(); + } +}; + // Blade Warding - 64440 enum BladeWarding { @@ -4202,6 +4257,7 @@ void AddSC_generic_spell_scripts() new spell_gen_aura_service_uniform(); new spell_gen_av_drekthar_presence(); new spell_gen_bandage(); + new spell_gen_blood_reserve(); new spell_gen_blade_warding(); new spell_gen_bonked(); new spell_gen_break_shield("spell_gen_break_shield"); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index d827c4961d..efe3761c82 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1114,6 +1114,46 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader } }; +// Item 10721: Gnomish Harm Prevention Belt +// 13234 - Harm Prevention Belt +enum HarmPreventionBelt +{ + SPELL_FORCEFIELD_COLLAPSE = 13235 +}; + +class spell_item_harm_prevention_belt : public SpellScriptLoader +{ + public: + spell_item_harm_prevention_belt() : SpellScriptLoader("spell_item_harm_prevention_belt") { } + + class spell_item_harm_prevention_belt_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_harm_prevention_belt_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORCEFIELD_COLLAPSE)) + return false; + return true; + } + + void HandleProc(ProcEventInfo& /*eventInfo*/) + { + GetTarget()->CastSpell((Unit*)nullptr, SPELL_FORCEFIELD_COLLAPSE, true); + } + + void Register() override + { + OnProc += AuraProcFn(spell_item_harm_prevention_belt_AuraScript::HandleProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_harm_prevention_belt_AuraScript(); + } +}; + // Item 23004 - Idol of Longevity // 28847 - Healing Touch Refund enum IdolOfLongevity @@ -4156,7 +4196,7 @@ public: Unit* target = GetCaster(); if (target->getPowerType() == POWER_MANA) - availableElixirs.push_back(28509); // Elixir of Major Mageblood (22840) + availableElixirs.push_back(28509); // Elixir of Major Mageblood (22840) uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs); @@ -4168,13 +4208,13 @@ public: if (sSpellMgr->IsSpellMemberOfSpellGroup(chosenElixir, SPELL_GROUP_ELIXIR_GUARDIAN)) chosenSpellGroup = SPELL_GROUP_ELIXIR_GUARDIAN; // If another spell of the same group is already active the elixir should not be cast - if (chosenSpellGroup) + if (chosenSpellGroup != SPELL_GROUP_NONE) { - Unit::AuraApplicationMap& Auras = target->GetAppliedAuras(); - for (Unit::AuraApplicationMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr) + Unit::AuraApplicationMap const& auraMap = target->GetAppliedAuras(); + for (auto itr = auraMap.begin(); itr != auraMap.end(); ++itr) { - uint32 spell_id = itr->second->GetBase()->GetId(); - if (sSpellMgr->IsSpellMemberOfSpellGroup(spell_id, chosenSpellGroup) && spell_id != chosenElixir) + uint32 spellId = itr->second->GetBase()->GetId(); + if (sSpellMgr->IsSpellMemberOfSpellGroup(spellId, chosenSpellGroup) && spellId != chosenElixir) { useElixir = false; break; @@ -4251,6 +4291,336 @@ public: } }; +enum DeathChoiceSpells +{ + SPELL_DEATH_CHOICE_NORMAL_AURA = 67702, + SPELL_DEATH_CHOICE_NORMAL_AGILITY = 67703, + SPELL_DEATH_CHOICE_NORMAL_STRENGTH = 67708, + SPELL_DEATH_CHOICE_HEROIC_AURA = 67771, + SPELL_DEATH_CHOICE_HEROIC_AGILITY = 67772, + SPELL_DEATH_CHOICE_HEROIC_STRENGTH = 67773 +}; + +class spell_item_death_choice : public SpellScriptLoader +{ +public: + spell_item_death_choice() : SpellScriptLoader("spell_item_death_choice") { } + + class spell_item_death_choice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_death_choice_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_STRENGTH) || + !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_AGILITY) || + !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_STRENGTH) || + !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_AGILITY)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + float str = caster->GetStat(STAT_STRENGTH); + float agi = caster->GetStat(STAT_AGILITY); + + switch (aurEff->GetId()) + { + case SPELL_DEATH_CHOICE_NORMAL_AURA: + { + if (str > agi) + caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_STRENGTH, true, nullptr, aurEff); + else + caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_AGILITY, true, nullptr, aurEff); + break; + } + case SPELL_DEATH_CHOICE_HEROIC_AURA: + { + if (str > agi) + caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_STRENGTH, true, nullptr, aurEff); + else + caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_AGILITY, true, nullptr, aurEff); + break; + } + default: + break; + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_death_choice_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_death_choice_AuraScript(); + } +}; + +enum TrinketStackSpells +{ + SPELL_LIGHTNING_CAPACITOR_AURA = 37657, // Lightning Capacitor + SPELL_LIGHTNING_CAPACITOR_STACK = 37658, + SPELL_LIGHTNING_CAPACITOR_TRIGGER = 37661, + SPELL_THUNDER_CAPACITOR_AURA = 54841, // Thunder Capacitor + SPELL_THUNDER_CAPACITOR_STACK = 54842, + SPELL_THUNDER_CAPACITOR_TRIGGER = 54843, + SPELL_TOC25_CASTER_TRINKET_NORMAL_AURA = 67712, // Item - Coliseum 25 Normal Caster Trinket + SPELL_TOC25_CASTER_TRINKET_NORMAL_STACK = 67713, + SPELL_TOC25_CASTER_TRINKET_NORMAL_TRIGGER = 67714, + SPELL_TOC25_CASTER_TRINKET_HEROIC_AURA = 67758, // Item - Coliseum 25 Heroic Caster Trinket + SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK = 67759, + SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER = 67760, +}; + +class spell_item_trinket_stack : public SpellScriptLoader +{ +public: + spell_item_trinket_stack(char const* scriptName, uint32 stackSpell, uint32 triggerSpell) : SpellScriptLoader(scriptName), + _stackSpell(stackSpell), _triggerSpell(triggerSpell) + { + } + + class spell_item_trinket_stack_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_trinket_stack_AuraScript); + + public: + spell_item_trinket_stack_AuraScript(uint32 stackSpell, uint32 triggerSpell) : _stackSpell(stackSpell), _triggerSpell(triggerSpell) + { + } + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(_stackSpell) || !sSpellMgr->GetSpellInfo(_triggerSpell)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + + caster->CastSpell(caster, _stackSpell, true, nullptr, aurEff); // cast the stack + + Aura* dummy = caster->GetAura(_stackSpell); // retrieve aura + + //dont do anything if it's not the right amount of stacks; + if (!dummy || dummy->GetStackAmount() < aurEff->GetAmount()) + return; + + // if right amount, remove the aura and cast real trigger + caster->RemoveAurasDueToSpell(_stackSpell); + if (Unit* target = eventInfo.GetActionTarget()) + caster->CastSpell(target, _triggerSpell, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_trinket_stack_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + + private: + uint32 _stackSpell; + uint32 _triggerSpell; + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_trinket_stack_AuraScript(_stackSpell, _triggerSpell); + } + +private: + uint32 _stackSpell; + uint32 _triggerSpell; +}; + +// 57345 - Darkmoon Card: Greatness +enum DarkmoonCardSpells +{ + SPELL_DARKMOON_CARD_STRENGHT = 60229, + SPELL_DARKMOON_CARD_AGILITY = 60233, + SPELL_DARKMOON_CARD_INTELLECT = 60234, + SPELL_DARKMOON_CARD_SPIRIT = 60235, +}; + +class spell_item_darkmoon_card_greatness : public SpellScriptLoader +{ +public: + spell_item_darkmoon_card_greatness() : SpellScriptLoader("spell_item_darkmoon_card_greatness") { } + + class spell_item_darkmoon_card_greatness_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_darkmoon_card_greatness_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_STRENGHT) || + !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_AGILITY) || + !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_INTELLECT) || + !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_SPIRIT)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + float str = caster->GetStat(STAT_STRENGTH); + float agi = caster->GetStat(STAT_AGILITY); + float intl = caster->GetStat(STAT_INTELLECT); + float spi = caster->GetStat(STAT_SPIRIT); + float stat = 0.0f; + + uint32 spellTrigger = SPELL_DARKMOON_CARD_STRENGHT; + + if (str > stat) + { + spellTrigger = SPELL_DARKMOON_CARD_STRENGHT; + stat = str; + } + + if (agi > stat) + { + spellTrigger = SPELL_DARKMOON_CARD_AGILITY; + stat = agi; + } + + if (intl > stat) + { + spellTrigger = SPELL_DARKMOON_CARD_INTELLECT; + stat = intl; + } + + if (spi > stat) + { + spellTrigger = SPELL_DARKMOON_CARD_SPIRIT; + stat = spi; + } + + caster->CastSpell(caster, spellTrigger, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_darkmoon_card_greatness_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_darkmoon_card_greatness_AuraScript(); + } +}; + +// 43820 - Amani Charm of the Witch Doctor +enum CharmWitchDoctor +{ + SPELL_CHARM_WITCH_DOCTOR_PROC = 43821 +}; + +class spell_item_charm_witch_doctor : public SpellScriptLoader +{ +public: + spell_item_charm_witch_doctor() : SpellScriptLoader("spell_item_charm_witch_doctor") { } + + class spell_item_charm_witch_doctor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_charm_witch_doctor_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_CHARM_WITCH_DOCTOR_PROC)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetActionTarget(); + + if (target) + { + int32 bp = CalculatePct(target->GetCreateHealth(),aurEff->GetSpellInfo()->Effects[1].CalcValue()); + caster->CastCustomSpell(target, SPELL_CHARM_WITCH_DOCTOR_PROC, &bp, nullptr, nullptr, true, nullptr, aurEff); + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_charm_witch_doctor_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_charm_witch_doctor_AuraScript(); + } +}; + +// 27522,40336 - Mana Drain +enum ManaDrainSpells +{ + SPELL_MANA_DRAIN_ENERGIZE = 29471, + SPELL_MANA_DRAIN_LEECH = 27526 +}; + +class spell_item_mana_drain : public SpellScriptLoader +{ +public: + spell_item_mana_drain() : SpellScriptLoader("spell_item_mana_drain") { } + + class spell_item_mana_drain_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_mana_drain_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_ENERGIZE) + || !sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_LEECH)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetActionTarget(); + + if (caster->IsAlive()) + caster->CastSpell(caster, SPELL_MANA_DRAIN_ENERGIZE, true, nullptr, aurEff); + + if (target && target->IsAlive()) + caster->CastSpell(target, SPELL_MANA_DRAIN_LEECH, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_mana_drain_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_mana_drain_AuraScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -4286,6 +4656,7 @@ void AddSC_item_spell_scripts() new spell_item_flask_of_the_north(); new spell_item_frozen_shadoweave(); new spell_item_gnomish_death_ray(); + new spell_item_harm_prevention_belt(); new spell_item_healing_touch_refund(); new spell_item_heartpierce("spell_item_heartpierce"); new spell_item_heartpierce("spell_item_heartpierce_hero"); @@ -4351,6 +4722,15 @@ void AddSC_item_spell_scripts() new spell_item_toy_train_set_pulse(); new spell_item_taunt_flag_targeting(); + new spell_item_death_choice(); + new spell_item_trinket_stack("spell_item_lightning_capacitor", SPELL_LIGHTNING_CAPACITOR_STACK, SPELL_LIGHTNING_CAPACITOR_TRIGGER); + new spell_item_trinket_stack("spell_item_thunder_capacitor", SPELL_THUNDER_CAPACITOR_STACK, SPELL_THUNDER_CAPACITOR_TRIGGER); + new spell_item_trinket_stack("spell_item_toc25_normal_caster_trinket", SPELL_TOC25_CASTER_TRINKET_NORMAL_STACK, SPELL_TOC25_CASTER_TRINKET_NORMAL_TRIGGER); + new spell_item_trinket_stack("spell_item_toc25_heroic_caster_trinket", SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK, SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER); + new spell_item_darkmoon_card_greatness(); + new spell_item_charm_witch_doctor(); + new spell_item_mana_drain(); + new spell_item_mind_control_cap(); new spell_item_universal_remote(); new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK); From 7d3d3be2a80772be14571da062dd8910f2041440 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 19 May 2017 23:49:22 +0100 Subject: [PATCH 107/110] Core/Scripts: Remove happiness-related code --- src/server/scripts/Pet/pet_hunter.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 4082f297f0..89bb8a7630 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -39,7 +39,6 @@ enum HunterCreatures enum PetSpellsMisc { - SPELL_PET_GUARD_DOG_HAPPINESS = 54445, SPELL_PET_SILVERBACK_RANK_1 = 62800, SPELL_PET_SILVERBACK_RANK_2 = 62801, PET_ICON_ID_GROWL = 201, @@ -162,13 +161,6 @@ class spell_pet_guard_dog : public SpellScriptLoader { PrepareAuraScript(spell_pet_guard_dog_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS)) - return false; - return true; - } - bool CheckProc(ProcEventInfo& eventInfo) { // Growl shares family flags with other spells @@ -185,7 +177,6 @@ class spell_pet_guard_dog : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true, nullptr, aurEff); float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); eventInfo.GetProcTarget()->AddThreat(caster, addThreat); @@ -214,13 +205,6 @@ class spell_pet_silverback : public SpellScriptLoader { PrepareAuraScript(spell_pet_silverback_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS)) - return false; - return true; - } - bool CheckProc(ProcEventInfo& eventInfo) { // Growl shares family flags with other spells From 5e50bb94813cb763babd1af757ed15dae5dbeaed Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 28 May 2017 18:39:41 +0100 Subject: [PATCH 108/110] Fix warning and whitespace --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8a881314c1..0dd7a1b94c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10482,7 +10482,7 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond return hitMask; } -void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMask, uint32 hitMask, WeaponAttackType attType) +void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMask, uint32 hitMask, WeaponAttackType /*attType*/) { // Player is loaded now - do not allow passive spell casts to proc if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetSession()->PlayerLoading()) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index efe3761c82..cc4f09260d 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -121,13 +121,13 @@ enum AlchemistStone SPELL_ALCHEMISTS_STONE_EXTRA_MANA = 21400 }; -// Item - 13503: Alchemist's Stone -// Item - 35748: Guardian's Alchemist Stone -// Item - 35749: Sorcerer's Alchemist Stone -// Item - 35750: Redeemer's Alchemist Stone -// Item - 35751: Assassin's Alchemist Stone -// Item - 44322: Mercurial Alchemist Stone -// Item - 44323: Indestructible Alchemist's Stone +// Item - 13503: Alchemist's Stone +// Item - 35748: Guardian's Alchemist Stone +// Item - 35749: Sorcerer's Alchemist Stone +// Item - 35750: Redeemer's Alchemist Stone +// Item - 35751: Assassin's Alchemist Stone +// Item - 44322: Mercurial Alchemist Stone +// Item - 44323: Indestructible Alchemist's Stone // Item - 44324: Mighty Alchemist's Stone // 17619 - Alchemist's Stone From b3133ef69fe60e400905ac2f01d0d566f3c25a8e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 28 May 2017 19:09:22 +0100 Subject: [PATCH 109/110] Update spell_proc SQLs Used most recent dump of 335 spell_proc table, because many DB-only commits were not cherry-picked. Removed entries for spells that no longer exist in 434. --- .../world/3.3.5/2016_10_12_00_world_335.sql | 8 - .../world/3.3.5/2016_11_07_01_world_335.sql | 9 - .../world/3.3.5/2016_11_19_00_world_335.sql | 1 - .../world/3.3.5/2016_12_30_02_world_335.sql | 5 - .../world/3.3.5/2016_xx_xx_xx_world.sql | 1115 ----------------- .../world/3.3.5/2017_02_21_00_world.sql | 1 - .../world/3.3.5/2017_03_04_00_world.sql | 1 - ...orld_from_335_was_2016_10_05_03_world.sql} | 0 ...orld_from_335_was_2016_12_15_00_world.sql} | 0 ...world_from_335_was_2016_10_04_06_world.sql | 1055 ++++++++++++++++ ...orld_from_335_was_2017_01_29_00_world.sql} | 0 ..._from_335_was_2017_02_23_01_world_335.sql} | 0 ..._from_335_was_2017_03_26_05_world_335.sql} | 0 13 files changed, 1055 insertions(+), 1140 deletions(-) delete mode 100644 sql/updates/world/3.3.5/2016_10_12_00_world_335.sql delete mode 100644 sql/updates/world/3.3.5/2016_11_07_01_world_335.sql delete mode 100644 sql/updates/world/3.3.5/2016_11_19_00_world_335.sql delete mode 100644 sql/updates/world/3.3.5/2016_12_30_02_world_335.sql delete mode 100644 sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql delete mode 100644 sql/updates/world/3.3.5/2017_02_21_00_world.sql delete mode 100644 sql/updates/world/3.3.5/2017_03_04_00_world.sql rename sql/updates/world/{3.3.5/2016_10_05_03_world.sql => 4.3.4/2017_05_28_00_world_from_335_was_2016_10_05_03_world.sql} (100%) rename sql/updates/world/{3.3.5/2016_12_15_00_world.sql => 4.3.4/2017_05_28_01_world_from_335_was_2016_12_15_00_world.sql} (100%) create mode 100644 sql/updates/world/4.3.4/2017_05_28_02_world_from_335_was_2016_10_04_06_world.sql rename sql/updates/world/{3.3.5/2017_01_29_00_world.sql => 4.3.4/2017_05_28_03_world_from_335_was_2017_01_29_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_02_23_01_world_335.sql => 4.3.4/2017_05_28_04_world_from_335_was_2017_02_23_01_world_335.sql} (100%) rename sql/updates/world/{3.3.5/2017_03_26_05_world_335.sql => 4.3.4/2017_05_28_05_world_from_335_was_2017_03_26_05_world_335.sql} (100%) diff --git a/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql deleted file mode 100644 index 7c14d28bc1..0000000000 --- a/sql/updates/world/3.3.5/2016_10_12_00_world_335.sql +++ /dev/null @@ -1,8 +0,0 @@ -UPDATE `spell_proc` SET `SpellPhaseMask`=0x2 WHERE `SpellId` IN ( --61846, -- Aspect of the Dragonhawk --13165, -- Aspect of the Hawk -7434, -- Fate Rune of Unsurpassed Vigor -39958, -- Skyfire Swiftness -55380, -- Skyflare Swiftness -70727 -- Item - Hunter T10 2P Bonus -); diff --git a/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql deleted file mode 100644 index 50aece5916..0000000000 --- a/sql/updates/world/3.3.5/2016_11_07_01_world_335.sql +++ /dev/null @@ -1,9 +0,0 @@ -UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId` IN ( --324, -- Lightning Shield --52127 -- Water Shield -); - --- Seal of Righteousness -DELETE FROM `spell_proc` WHERE `SpellId` =21084; -INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES -(21084, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0); diff --git a/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql deleted file mode 100644 index ae32a91d4d..0000000000 --- a/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId` IN (71406,71545); -- Anger Capacitor diff --git a/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql b/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql deleted file mode 100644 index 23954b3bee..0000000000 --- a/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql +++ /dev/null @@ -1,5 +0,0 @@ -UPDATE `spell_proc` SET `SpellFamilyMask2`=0, `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId`=-31571; -DELETE FROM `spell_proc` WHERE `SpellId` IN (57529, 57531); -INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES -(57529, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0), -(57531, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0); diff --git a/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql b/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql deleted file mode 100644 index 6f5ff70297..0000000000 --- a/sql/updates/world/3.3.5/2016_xx_xx_xx_world.sql +++ /dev/null @@ -1,1115 +0,0 @@ -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (15290, 59725); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(13, 1, 59725, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Improved Spell Reflection (effect 0) will hit the potential target of the spell if target is not the same as condition target.'), -(13, 1, 15290, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Vampiric Embrace (effect 0) will hit the potential target of the spell if target is not the same as condition target.'); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=24 AND `SourceGroup`=0 AND `SourceEntry` IN (38164,70805); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(24, 0, 38164, 0, 0, 31, 1, 3, 19457, 0, 0, 0, 0, '', 'Spell Unyielding Knights can proc on actionTarget if target is unit Grillok "Darkeye".'), -(24, 0, 70805, 0, 0, 33, 1, 0, 0, 0, 1, 0, 0, '', 'Spell Item - Rogue T10 2P Bonus can proc on actionTarget if target is not the same as condition target.'); - --- Earth shield heal is DAMAGE_CLASS_NONE, it won't scale --- Entry is unneeded -DELETE FROM `spell_bonus_data` WHERE `entry`=379; - --- Remove renamed scripts -DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_dummy_trigger','spell_pri_item_greater_heal_refund'); - --- Stop console spam from dummy EFFECT_2 proc -DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_pal_seals'; -INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(20375, 'spell_pal_seals'), -- Seal of Command -(21084, 'spell_pal_seals'), -- Seal of Righteousness -(31801, 'spell_pal_seals'), -- Seal of Vengeance -(31892, 'spell_pal_seals'), -- Seal of Blood -(33127, 'spell_pal_seals'), -- Seal of Command -(38008, 'spell_pal_seals'), -- Seal of Blood -(41459, 'spell_pal_seals'), -- Seal of Blood -(53720, 'spell_pal_seals'), -- Seal of the Martyr -(53736, 'spell_pal_seals'); -- Seal of Corruption - --- Grouped several hacks and handled with AuraScript now -DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mage_fingers_of_frost'; -INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(74396, 'spell_mage_fingers_of_frost'); -- Fingers of Frost - --- Threat of Thassarian triggered spells, for easier script access -DELETE FROM `spell_ranks` WHERE `first_spell_id` IN (59133,66198,66196,66216,66188,66215); -INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES -(66198, 66198, 1), -(66198, 66972, 2), -(66198, 66973, 3), -(66198, 66974, 4), - -(66196, 66196, 1), -(66196, 66958, 2), -(66196, 66959, 3), -(66196, 66960, 4), -(66196, 66961, 5), -(66196, 66962, 6), - -(66216, 66216, 1), -(66216, 66988, 2), -(66216, 66989, 3), -(66216, 66990, 4), -(66216, 66991, 5), -(66216, 66992, 6), - -(66188, 66188, 1), -(66188, 66950, 2), -(66188, 66951, 3), -(66188, 66952, 4), -(66188, 66953, 5), - -(66215, 66215, 1), -(66215, 66975, 2), -(66215, 66976, 3), -(66215, 66977, 4), -(66215, 66978, 5), -(66215, 66979, 6); - -DELETE FROM `command` WHERE `name`='reload spell_proc_event'; --- Charges drop (previously hardcoded in SpellMgr::LoadSpellInfoCorrections) -DELETE FROM `spell_proc` WHERE `SpellId` IN (17941, 18820, 22008, 28200, 31834, 32216, 34477, 34936, 44401, 48108, 51124, 54741, 57761, 64823); -INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES -(17941, 0, 5, 0x00000001, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 0, 1), -- Shadow Trance -(18820, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x1, 0, 0x0, 0, 0, 0, 1), -- Insight -(22008, 0, 3, 0x61400035, 0x00000000, 0x00000000, 69632, 0x5, 0x1, 0, 0x0, 0, 0, 0, 1), -- Netherwind Focus -(28200, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x1, 0, 0x0, 0, 0, 0, 6), -- Ascendance -(31834, 0, 10, 0x80000000, 0x00000000, 0x00000000, 16384, 0x2, 0x1, 0, 0x0, 0, 0, 0, 1), -- Light's Grace -(32216, 0, 4, 0x00000000, 0x00000100, 0x00000000, 16, 0x1, 0x4, 0, 0x0, 0, 0, 0, 1), -- Victorious (drop charge on Victory rush cast) -(34477, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 1), -- Misdirection -(34936, 0, 5, 0x00000001, 0x00000040, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Backlash -(44401, 0, 3, 0x00000800, 0x00000000, 0x00000000, 4096, 0x5, 0x1, 0, 0x8, 0, 0, 0, 1), -- Missile Barrage -(48108, 0, 3, 0x00400000, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Hot Streak -(51124, 0, 15, 0x00000002, 0x00000006, 0x00000000, 65552, 0x1, 0x2, 0, 0x8, 0, 0, 0, 1), -- Killing Machine -(54741, 0, 3, 0x00000004, 0x00000000, 0x00000000, 65536, 0x5, 0x1, 0, 0x0, 0, 0, 0, 1), -- Firestarter -(57761, 0, 3, 0x00000001, 0x00001000, 0x00000000, 65536, 0x1, 0x1, 0, 0x8, 0, 0, 0, 1), -- Fireball! -(64823, 0, 7, 0x00000004, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 0, 1); -- Elune's Wrath - --- Port procs from spell_proc_event table -DELETE FROM `spell_proc` WHERE `SpellId` IN (-974, -1463, -10400, -11119, -11185, -12834, -13983, -14156, -15337, -16180, -18094, -18213, -20234, -20335, -27243, -29441, -29723, -29834, -30293, -30675, -31244, -31571, -31656, -31785, -31871, -31876, -34497, -34914, -44404, -44445, -44546, -46913, -46951, -47569, -48539, -48979, -49015, -49018, -49182, -49188, -49208, -49217, -49467, -51459, -51474, -51525, -51556, -51625, -51627, -51664, -53178, -53228, -53290, -53380, -53501, -53569, -53695, -54639, -54747, -59088, -61680, -62764, -63156, -63373, -64127, -65661, 1719, 11129, 12536, 15286, 16246, 16864, 16870, 17619, 20185, 20186, 22007, 24658, 24932, 26169, 26467, 28716, 28719, 28744, 28789, 28809, 28823, 28845, 28847, 28849, 29601, 32863, 36123, 38252, 39367, 44141, 70388, 30823, 31801, 32409, 33757, 37288, 37295, 37381, 37377, 39437, 37168, 37594, 38164, 39372, 40438, 40442, 40463, 40470, 40971, 42770, 45057, 46916, 47383, 71162, 71165, 49005, 49028, 49194, 49222, 49796, 51209, 51528, 51529, 51530, 51531, 51532, 51698, 51700, 51701, 52420, 52437, 53601, 53646, 53736, 54274, 54276, 54277, 54748, 54754, 54815, 54821, 54832, 54845, 54909, 54937, 54939, 55198, 55440, 55677, 56218, 56372, 56374, 56375, 56800, 57870, 58375, 58642, 58677, 58877, 59906, 59915, 37447, 61062, 61257, 62259, 62600, 62606, 63279, 63280, 63320, 64890, 64928, 65032, 67228, 69755, 69739, 69762, 70723, 70664, 70770, 70805, 70808, 70817, 70844, 70672, 72455, 72832, 72833, 71756, 72782, 72783, 72784, 71406, 71545, 71880, 71892, 71519, 71562, 71564, 71634, 71640, 71761, 71770, 72176, 75475, 75481); -INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES -(-974, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x2, 0, 0, 3000, 0), -- Earth Shield -(-1463, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 1024, 0x0, 0, 0, 0, 0), -- Mana Shield -(-10400, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Flametongue Weapon (Passive) -(-11119, 4, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ignite -(-11185, 0, 3, 0x00000080, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Improved Blizzard -(-12834, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Deep Wounds Aura -(-13983, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 24, 0x0, 0, 0, 1000, 0), -- Setup -(-14156, 0, 8, 0x003E0000, 0x00000009, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Ruthlessness -(-15337, 0, 6, 0x00802000, 0x00000002, 0x00000000, 0, 0x1, 0x2, 2, 0x2, 0, 0, 0, 0), -- Improved Spirit Tap -(-16180, 0, 11, 0x000001C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Improved Water Shield -(-18094, 0, 5, 0x0000000A, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Nightfall -(-18213, 32, 5, 0x00004000, 0x00000000, 0x00000000, 2, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Improved Drain Soul -(-20234, 0, 10, 0x00008000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Lay on Hands -(-20335, 0, 10, 0x00800000, 0x00000000, 0x00000000, 16, 0x5, 0x2, 0, 0x0, 0, 100, 0, 0), -- Heart of the Crusader -(-27243, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of corruption (Warlock) -(-29441, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x0, 8, 0x0, 0, 0, 1000, 0), -- Magic Absorption -(-29723, 0, 4, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Death -(-29834, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Second Wind (Warrior talent) -(-30293, 0, 5, 0x00000181, 0x008200C0, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Soul Leech -(-30675, 0, 11, 0x00000003, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lightning Overload -(-31244, 0, 8, 0x003A0000, 0x00000009, 0x00000000, 0, 0x5, 0x2, 11196, 0x0, 0, 0, 0, 0), -- Quick Recovery -(-31571, 0, 3, 0x00000000, 0x00000022, 0x00000008, 16384, 0x7, 0x4, 0, 0x0, 0, 0, 0, 0), -- Arcane Potency -(-31656, 4, 3, 0x08000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Empowered Fire -(-31785, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spiritual Attunement -(-31871, 0, 10, 0x00000010, 0x00000000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Divine Purpose -(-31876, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Judgements of the Wise -(-34497, 0, 9, 0x00060800, 0x00800001, 0x00000201, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Thrill of the Hunt -(-34914, 0, 6, 0x00002000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Vampiric Touch -(-44404, 0, 3, 0x20000021, 0x00009000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Missile Barrage -(-44445, 0, 3, 0x00000013, 0x00011000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hot Streak -(-44546, 0, 3, 0x000002E0, 0x00001000, 0x00000000, 69632, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brain Freeze -(-46913, 0, 4, 0x00000040, 0x00000404, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Bloodsurge -(-46951, 0, 4, 0x00000400, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sword and Board -(-47569, 0, 6, 0x00004000, 0x00000000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Shadowform -(-48539, 0, 7, 0x00000010, 0x04000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Revitalize -(-48979, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Butchery -(-49015, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Vendetta -(-49018, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Doom -(-49182, 0, 15, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blade Barrier -(-49188, 0, 15, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rime -(-49208, 0, 15, 0x00400000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Reaping -(-49217, 0, 15, 0x00000000, 0x00000000, 0x00000002, 0, 0x0, 0x0, 0, 0x0, 0, 0, 1000, 0), -- Wandering Plague -(-49467, 0, 15, 0x00000010, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Death Rune Mastery -(-51459, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Necrosis -(-51474, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Astral Shift -(-51525, 0, 11, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0 ,0x0, 0, 0, 0, 0), -- Static Shock -(-51556, 0, 11, 0x000000C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ancestral Awakening -(-51625, 0, 8, 0x1000A000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Brew -(-51627, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Turn the Tables -(-51664, 0, 8, 0x00020000, 0x00000008, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Cut to the Chase -(-53178, 0, 9, 0x00000000, 0x10000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 100, 0, 0), -- Guard Dog -(-53228, 0, 9, 0x00000020, 0x01000000, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rapid Recuperation -(-53290, 0, 9, 0x00000800, 0x00000001, 0x00000200, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Hunting Party -(-53380, 0, 10, 0x00800000, 0x00028000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Righteous Vengeance -(-53501, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Sheath of Light -(-53569, 0, 10, 0x40200000, 0x00010000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Infusion of Light -(-53695, 0, 10, 0x00800000, 0x00000000, 0x00000008, 16, 0x5, 0x2, 0, 0x2, 0, 0, 0, 0), -- Judgements of the Just -(-54639, 0, 15, 0x00400000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blood of the North -(-54747, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Burning Determination -(-59088, 0, 4, 0x00000000, 0x00000002, 0x00000000, 1024, 0x4, 0x4, 0, 0x0, 0, 0, 0, 0), -- Improved Spell Reflection -(-61680, 0, 9, 0x00000000, 0x10000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Culling the Herd -(-62764, 0, 9, 0x00000000, 0x10000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 100, 0, 0), -- Silverback -(-63156, 0, 5, 0x00000001, 0x000000C0, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Decimation -(-63373, 0, 11, 0x80000000, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Frozen Power -(-64127, 0, 6, 0x00000001, 0x00000001, 0x00000000, 0, 0x6, 0x2, 0, 0x0, 0, 0, 0, 0), -- Body and Soul -(-65661, 0, 15, 0x00400011, 0x20020004, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 100, 0, 0), -- Threat of Thassarian - -(1719, 0, 4, 0x2E600444, 0x00404745, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Recklessness -(11129, 4, 3, 0x08C00017, 0x00031048, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Combustion -(12536, 0, 3, 0x20C21AF7, 0x00029040, 0x00000000, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Mage) -(15286, 32, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vampiric Embrace -(16246, 0, 11, 0x981001C3, 0x00001400, 0x00000010, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Shaman) -(16864, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 6, 0, 0), -- Omen of Clarity -(16870, 0, 7, 0x00E3BBFF, 0x079007D3, 0x00040400, 0, 0x0, 0x1, 0, 0x4, 0, 0, 0, 0), -- Clearcasting (Druid) -(17619, 0, 13, 0x00000000, 0x00000000, 0x00000000, 32768, 0x7, 0x0, 0, 0x0, 0, 0, 0, 0), -- Alchemist's Stone -(20185, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 15, 0, 0, 0), -- Judgement of Light -(20186, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 15, 0, 0, 0), -- Judgement of Wisdom -(22007, 0, 3, 0x00200021, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Netherwind Focus -(24658, 0, 0, 0x00000000, 0x00000000, 0x00000000, 87376, 0x7, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unstable Power -(24932, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Leader of the Pack -(26169, 0, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Oracle Healing Bonus -(26467, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Persistent Shield -(28716, 0, 7, 0x00000010, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Rejuvenation - Dreamwalker Raiment 2pc -(28719, 0, 7, 0x00000020, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Healing Touch - Dreamwalker Raiment 8 pc -(28744, 0, 7, 0x00000040, 0x00000000, 0x00000000, 278528, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Regrowth - Dreamwalker Raiment 6pc -(28789, 0, 10, 0xC0000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Holy Power -(28809, 0, 6, 0x00001000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Greater Heal - Vestments of Faith 4pc -(28823, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totemic Power -(28845, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Cheat Death -(28847, 0, 7, 0x00000020, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Healing Touch Refund -(28849, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lesser Heealing Wave -(29601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x4, 0, 0, 0, 0), -- Enlightenment - -(32863, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) -(36123, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) -(38252, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) -(39367, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) -(44141, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) -(70388, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Seed of Corruption (Monster) - -(30823, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 10, 0, 0, 0), -- Shamanistic Rage -(31801, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Seal of Vengeance -(32409, 0, 0, 0x00000000, 0x00002000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadow Word: Death - do not require honor target -(33757, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 3000, 0), -- Windfury Weapon (Passive) -(37288, 0, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Restore - Malorne Raiment 2pc -(37295, 0, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Restore - Malorne Regalia 2pc -(37381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Pet Healing - -(37377, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadowflame -(39437, 4, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadowflame Hellfire and RoF - -(37168, 0, 8, 0x003E0000, 0x00000009, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Finisher Combo -(37594, 0, 6, 0x00001000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Greater Heal Refund -(38164, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unyielding Knights -(39372, 48, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Frozen Shadoweave -(40438, 0, 6, 0x00008040, 0x00000000, 0x00000000, 0, 0x3, 0x0, 0, 0x0, 0, 0, 0, 0), -- Priest Tier 6 Trinket -(40442, 0, 7, 0x00000014, 0x00000440, 0x00000000, 0, 0x7, 0x1, 0, 0x0, 0, 0, 0, 0), -- Druid Tier 6 Trinket -(40463, 0, 11, 0x00000081, 0x00000010, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shaman Tier 6 Trinket -(40470, 0, 10, 0xC0800000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 0, 0), -- Paladin Tier 6 Trinket -(40971, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Bonus Healing (Crystal Spire of Karabor) -(42770, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Second Wind (NPC aura) -(45057, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Evasive Maneuvers -(46916, 0, 4, 0x00200000, 0x00000000, 0x00000000, 0, 0x0, 0x4, 0, 0x0, 0, 0, 0, 0), -- Slam! (Bloodsurge proc) - -(47383, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core -(71162, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core -(71165, 0, 5, 0x00000000, 0x000000C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Molten Core - -(49005, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mark of Blood -(49028, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x2, 0, 0x0, 0, 0, 0, 0), -- Dancing Rune Weapon -(49194, 0, 15, 0x00000000, 0x00000000, 0x00000001, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Unholy Blight -(49222, 0, 0, 0x00000000, 0x00000000, 0x00000000, 139944, 0x0, 0x0, 0, 0x0, 0, 0, 2000, 0), -- Bone Shield -(49796, 0, 15, 0x00000002, 0x00020006, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Deathchill -(51209, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Hungering Cold - -(51528, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 4, 0, 0, 0), -- Maelstrom Weapon (Rank 1) -(51529, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 8, 0, 0, 0), -- Maelstrom Weapon (Rank 2) -(51530, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 12, 0, 0, 0), -- Maelstrom Weapon (Rank 3) -(51531, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 16, 0, 0, 0), -- Maelstrom Weapon (Rank 4) -(51532, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 20, 0, 0, 0), -- Maelstrom Weapon (Rank 5) - -(51698, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 33, 0, 0), -- Honor Among Thieves (Rank 1) -(51700, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 66, 0, 0), -- Honor Among Thieves (Rank 2) -(51701, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 100, 0, 0), -- Honor Among Thieves (Rank 3) - -(52420, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Deflection -(52437, 1, 4, 0x20000000, 0x00000000, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sudden Death proc -(53601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 1048576, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Sacred Shield -(53646, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Demonic Pact -(53736, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Seal of Corruption - -(54274, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft -(54276, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft -(54277, 0, 5, 0x00000165, 0x000310C0, 0x00000000, 0, 0x0, 0x1, 0, 0x8, 0, 0, 0, 0), -- Backdraft - -(54748, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 259, 0x0, 0, 0, 0, 0), -- Burning Determination proc -(54754, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rejuvenation -(54815, 0, 7, 0x00008000, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shred -(54821, 0, 7, 0x00001000, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rake -(54832, 0, 7, 0x00000000, 0x00001000, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Innervate -(54845, 0, 7, 0x00000004, 0x00000000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Starfire -(54909, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Demonic Pact -(54937, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Holy Light -(54939, 0, 10, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Divinity -(55198, 0, 11, 0x000001C0, 0x00000000, 0x00000000, 16384, 0x2, 0x2, 2, 0x0, 0, 0, 0, 3), -- Tidal Force -(55440, 0, 11, 0x00000040, 0x00000000, 0x00000000, 0, 0x2, 0x1, 0, 0x0, 0, 0, 0, 0), -- Glyph of Healing Wave -(55677, 0, 6, 0x00000000, 0x00000001, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Dispel Magic -(56218, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Corruption -(56372, 0, 3, 0x00000000, 0x00000080, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Ice Block -(56374, 0, 3, 0x00000000, 0x00004000, 0x00000008, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Icy Veins -(56375, 0, 3, 0x01000000, 0x00000000, 0x00000000, 65536, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Polymorph -(56800, 0, 8, 0x00000004, 0x00000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Backstab -(57870, 0, 9, 0x00800000, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Glyph of Mend Pet -(58375, 0, 4, 0x00000000, 0x00000200, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Blocking -(58642, 0, 15, 0x00000000, 0x08000000, 0x00000000, 16, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Scourge Strike -(58677, 0, 15, 0x00002000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x2, 0, 0, 0, 0), -- Glyph of Death's Embrace -(58877, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spirit Hunt -(59906, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Swift Hand of Justice -(59915, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Discerning Eye of the Beast - -(37447, 0, 3, 0x00000000, 0x00000100, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Mana Gems -(61062, 0, 3, 0x00000000, 0x00000100, 0x00000000, 16384, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Mana Gems - -(61257, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x5, 0x0, 0, 0x0, 0, 0, 0, 0), -- Runic Power Back on Snare/Root -(62259, 0, 15, 0x02000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 0, 0), -- Glyph of Death Grip -(62600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Savage Defense (Passive) -(62606, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 1027, 0x0, 0, 0, 0, 0), -- Savage Defense -(63279, 0, 11, 0x00000000, 0x00000400, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Earth Shield -(63280, 0, 11, 0x20000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Totem of Wrath -(63320, 0, 5, 0x80040000, 0x00000000, 0x00008000, 1024, 0x7, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Life Tap -(64890, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Holy 2P Bonus -(64928, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Shaman T8 Elemental 4P Bonus -(65032, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- 321-Boombot Aura - do not require experience target -(67228, 0, 11, 0x00000000, 0x00001000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T9 Elemental 4P Bonus (Lava Burst) -(69755, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Purified Shard of the Scale -(69739, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x7, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Shiny Shard of the Scale -(69762, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Unchained Magic -(70723, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Balance 4P Bonus -(70664, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Druid T10 Restoration 4P Bonus (Rejuvenation) -(70770, 0, 6, 0x00000800, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T10 Healer 2P Bonus -(70805, 0, 8, 0x00000000, 0x00020000, 0x00000000, 0, 0x4, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T10 2P Bonus -(70808, 0, 11, 0x00000100, 0x00000000, 0x00000000, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration 4P Bonus -(70817, 0, 11, 0x00000000, 0x00001000, 0x00000000, 65536, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental 4P Bonus -(70844, 0, 4, 0x00000100, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Warrior T10 Protection 4P Bonus - -(70672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat -(72455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat -(72832, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat -(72833, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Gaseous Bloat - -(71756, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc -(72782, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc -(72783, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc -(72784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Ball of Flames Proc - -(71406, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 50, 0, 0), -- Anger Capacitor -(71545, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 50, 0, 0), -- Anger Capacitor - -(71880, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 1, 0, 0, 0), -- Item - Icecrown 25 Normal Dagger Proc -(71892, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 1, 0, 0, 0), -- Item - Icecrown 25 Heroic Dagger Proc - -(71519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 105000, 0), -- Deathbringer's Will -(71562, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 105000, 0), -- Deathbringer's Will (Heroic) -(71564, 126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 2, 0x0, 0, 0, 0, 5), -- Deadly Precision -(71634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Item - Icecrown 25 Normal Tank Trinket 1 -(71640, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Item - Icecrown 25 Heroic Tank Trinket 1 -(71761, 3, 0, 0x00000000, 0x00100000, 0x00000000, 0, 0x5, 0x2, 256, 0x0, 0, 0, 0, 0), -- Deep Freeze Immunity State -(71770, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Ooze Spell Tank Protection -(72176, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blood Beast's Blood Link -(75475, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Tank Trinket -(75481, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0); -- Item - Chamber of Aspects 25 Heroic Tank Trinket - --- Add spellscripts to spells previously on giant switches in Unit.cpp -DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_rog_t10_2p_bonus'; -DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_flametongue_weapon','spell_mage_imp_blizzard','spell_warr_deep_wounds_aura','spell_rog_setup','spell_pri_improved_spirit_tap','spell_sha_imp_water_shield','spell_warl_improved_drain_soul','spell_pal_improved_lay_of_hands','spell_pal_heart_of_the_crusader','spell_warl_seed_of_corruption_dummy','spell_mage_magic_absorption','spell_warr_extra_proc','spell_warr_second_wind','spell_warl_soul_leech','spell_sha_lightning_overload','spell_rog_quick_recovery','spell_mage_arcane_potency','spell_mage_empowered_fire','spell_pal_spiritual_attunement','spell_pal_divine_purpose','spell_pal_judgements_of_the_wise','spell_hun_thrill_of_the_hunt','spell_mage_missile_barrage','spell_mage_hot_streak','spell_warr_sword_and_board','spell_pri_imp_shadowform','spell_dk_butchery','spell_item_unstable_power','spell_item_restless_strength','spell_dru_leader_of_the_pack','spell_pri_aq_3p_bonus','spell_item_persistent_shield','spell_dru_revitalize','spell_dk_death_rune','spell_dk_scent_of_blood_trigger','spell_dk_vendetta','spell_dk_sudden_doom','spell_dk_blade_barrier','spell_dk_rime','spell_dk_wandering_plague','spell_sha_astral_shift_aura','spell_dk_necrosis','spell_sha_static_shock','spell_sha_maelstrom_weapon','spell_sha_ancestral_awakening','spell_rog_deadly_brew','spell_rog_turn_the_tables','spell_rog_cut_to_the_chase','spell_pet_guard_dog','spell_hun_rapid_recuperation_trigger','spell_hun_hunting_party','spell_pal_righteous_vengeance','spell_pal_sheath_of_light','spell_pal_infusion_of_light','spell_pal_judgements_of_the_just','spell_mage_burning_determination','spell_warr_improved_spell_reflection','spell_pet_culling_the_herd','spell_pet_silverback','spell_warl_decimation','spell_sha_frozen_power','spell_pri_body_and_soul','spell_dk_threat_of_thassarian','spell_warl_seduction','spell_mage_combustion','spell_pri_vampiric_embrace','spell_dru_omen_of_clarity','spell_item_alchemists_stone','spell_pal_judgement_of_light_heal','spell_pal_judgement_of_wisdom_mana','spell_twisted_reflection','spell_dru_t3_2p_bonus','spell_dru_t3_8p_bonus','spell_dru_t3_6p_bonus','spell_pal_t3_6p_bonus','spell_pri_t3_4p_bonus','spell_sha_t3_6p_bonus','spell_warr_t3_prot_8p_bonus','spell_item_healing_touch_refund','spell_item_totem_of_flowing_water','spell_item_pendant_of_the_violet_eye','spell_sha_shamanistic_rage','spell_pal_seal_of_vengeance','spell_warl_seed_of_corruption_generic','spell_mark_of_malice','spell_item_mark_of_conquest','spell_sha_windfury_weapon','spell_dru_t4_2p_bonus','spell_pri_t5_heal_2p_bonus','spell_anetheron_vampiric_aura','spell_item_frozen_shadoweave','spell_item_aura_of_madness','spell_pri_item_t6_trinket','spell_dru_item_t6_trinket','spell_sha_item_t6_trinket','spell_pal_item_t6_trinket','spell_item_crystal_spire_of_karabor','spell_item_dementia','spell_item_pet_healing','spell_warl_t4_2p_bonus_shadow','spell_warl_t4_2p_bonus_fire','spell_mage_gen_extra_effects','spell_uk_second_wind','spell_item_commendation_of_kaelthas','spell_item_sunwell_exalted_caster_neck','spell_item_sunwell_exalted_melee_neck','spell_item_sunwell_exalted_tank_neck','spell_item_sunwell_exalted_healer_neck','spell_warl_glyph_of_corruption_nightfall','spell_dk_mark_of_blood','spell_dk_dancing_rune_weapon','spell_dk_unholy_blight','spell_dk_hungering_cold','spell_item_soul_harvesters_charm','spell_rog_turn_the_tables_proc','spell_pal_sacred_shield_dummy','spell_warl_demonic_pact','spell_pal_seal_of_corruption','spell_dru_glyph_of_rejuvenation','spell_dru_glyph_of_shred','spell_dru_glyph_of_rake','spell_dru_glyph_of_innervate','spell_dru_glyph_of_starfire_dummy','spell_pal_glyph_of_holy_light_dummy','spell_pal_glyph_of_divinity','spell_sha_tidal_force_dummy','spell_sha_glyph_of_healing_wave','spell_pri_glyph_of_dispel_magic','spell_mage_glyph_of_ice_block','spell_mage_glyph_of_icy_veins','spell_mage_glyph_of_polymorph','spell_rog_glyph_of_backstab','spell_hun_glyph_of_mend_pet','spell_pri_shadowfiend_death','spell_warr_glyph_of_blocking','spell_dk_glyph_of_scourge_strike','spell_sha_spirit_hunt','spell_hun_kill_command_pet','spell_item_swift_hand_justice_dummy','spell_item_discerning_eye_beast_dummy','spell_mage_imp_mana_gems','spell_gen_vampiric_touch','spell_dk_pvp_4p_bonus','spell_dk_glyph_of_death_grip','spell_dru_savage_defense','spell_sha_glyph_of_earth_shield','spell_sha_glyph_of_totem_of_wrath','spell_warl_glyph_of_life_tap','spell_pal_t8_2p_bonus','spell_sha_t8_elemental_4p_bonus','spell_xt002_321_boombot_aura','spell_sha_t9_elemental_4p_bonus','spell_item_purified_shard_of_the_scale','spell_item_shiny_shard_of_the_scale','spell_dru_t10_balance_4p_bonus','spell_dru_t10_restoration_4p_bonus_dummy','spell_pri_t10_heal_2p_bonus','spell_sha_t10_restoration_4p_bonus','spell_sha_t10_elemental_4p_bonus','spell_warr_item_t10_prot_4p_bonus','spell_item_tiny_abomination_in_a_jar','spell_item_tiny_abomination_in_a_jar_hero','spell_item_deadly_precision_dummy','spell_item_deadly_precision','spell_item_heartpierce','spell_item_heartpierce_hero','spell_item_deathbringers_will_normal','spell_item_deathbringers_will_heroic','spell_item_corpse_tongue_coin','spell_item_corpse_tongue_coin_heroic','spell_putricide_ooze_tank_protection','spell_deathbringer_blood_beast_blood_link','spell_item_petrified_twilight_scale','spell_item_petrified_twilight_scale_heroic'); -INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(-10400, 'spell_sha_flametongue_weapon'), -(-11185, 'spell_mage_imp_blizzard'), -(-12834, 'spell_warr_deep_wounds_aura'), -(-13983, 'spell_rog_setup'), -(-15337, 'spell_pri_improved_spirit_tap'), -(-16180, 'spell_sha_imp_water_shield'), -(-18213, 'spell_warl_improved_drain_soul'), -(-20234, 'spell_pal_improved_lay_of_hands'), -(-20335, 'spell_pal_heart_of_the_crusader'), -(-27243, 'spell_warl_seed_of_corruption_dummy'), -(-29441, 'spell_mage_magic_absorption'), - -(-29723, 'spell_warr_extra_proc'), -(-46913, 'spell_warr_extra_proc'), - -(-29834, 'spell_warr_second_wind'), -(-30293, 'spell_warl_soul_leech'), -(-30675, 'spell_sha_lightning_overload'), -(-31244, 'spell_rog_quick_recovery'), -(-31571, 'spell_mage_arcane_potency'), -(-31656, 'spell_mage_empowered_fire'), -(-31785, 'spell_pal_spiritual_attunement'), -(-31871, 'spell_pal_divine_purpose'), -(-31876, 'spell_pal_judgements_of_the_wise'), -(-34497, 'spell_hun_thrill_of_the_hunt'), -(-44404, 'spell_mage_missile_barrage'), -(-44445, 'spell_mage_hot_streak'), -(-46951, 'spell_warr_sword_and_board'), -(-47569, 'spell_pri_imp_shadowform'), -(-48979, 'spell_dk_butchery'), -(-48539, 'spell_dru_revitalize'), - -(-49208, 'spell_dk_death_rune'), -(-49467, 'spell_dk_death_rune'), -(-54639, 'spell_dk_death_rune'), - -(-49004, 'spell_dk_scent_of_blood_trigger'), -(-49015, 'spell_dk_vendetta'), -(-49018, 'spell_dk_sudden_doom'), -(-49182, 'spell_dk_blade_barrier'), -(-49188, 'spell_dk_rime'), -(-49217, 'spell_dk_wandering_plague'), -(-51474, 'spell_sha_astral_shift_aura'), -(-51459, 'spell_dk_necrosis'), -(-51525, 'spell_sha_static_shock'), -(-51556, 'spell_sha_ancestral_awakening'), -(-51625, 'spell_rog_deadly_brew'), -(-51627, 'spell_rog_turn_the_tables'), -(-51664, 'spell_rog_cut_to_the_chase'), -(-53178, 'spell_pet_guard_dog'), -(-53228, 'spell_hun_rapid_recuperation_trigger'), -(-53290, 'spell_hun_hunting_party'), -(-53380, 'spell_pal_righteous_vengeance'), -(-53501, 'spell_pal_sheath_of_light'), -(-53569, 'spell_pal_infusion_of_light'), -(-53695, 'spell_pal_judgements_of_the_just'), -(-54747, 'spell_mage_burning_determination'), -(-59088, 'spell_warr_improved_spell_reflection'), -(-61680, 'spell_pet_culling_the_herd'), -(-62764, 'spell_pet_silverback'), -(-63156, 'spell_warl_decimation'), -(-63373, 'spell_sha_frozen_power'), -(-64127, 'spell_pri_body_and_soul'), -(-65661, 'spell_dk_threat_of_thassarian'), -(6358, 'spell_warl_seduction'), -(11129, 'spell_mage_combustion'), -(15286, 'spell_pri_vampiric_embrace'), -(16864, 'spell_dru_omen_of_clarity'), -(17619, 'spell_item_alchemists_stone'), -(20185, 'spell_pal_judgement_of_light_heal'), -(20186, 'spell_pal_judgement_of_wisdom_mana'), -(21063, 'spell_twisted_reflection'), -(24658, 'spell_item_unstable_power'), -(24661, 'spell_item_restless_strength'), -(24932, 'spell_dru_leader_of_the_pack'), -(26169, 'spell_pri_aq_3p_bonus'), -(26467, 'spell_item_persistent_shield'), -(28716, 'spell_dru_t3_2p_bonus'), -(28719, 'spell_dru_t3_8p_bonus'), -(28744, 'spell_dru_t3_6p_bonus'), -(28789, 'spell_pal_t3_6p_bonus'), -(28809, 'spell_pri_t3_4p_bonus'), -(28823, 'spell_sha_t3_6p_bonus'), -(28845, 'spell_warr_t3_prot_8p_bonus'), -(28847, 'spell_item_healing_touch_refund'), -(28849, 'spell_item_totem_of_flowing_water'), -(29601, 'spell_item_pendant_of_the_violet_eye'), -(30823, 'spell_sha_shamanistic_rage'), -(31801, 'spell_pal_seal_of_vengeance'), - -(32863, 'spell_warl_seed_of_corruption_generic'), -(36123, 'spell_warl_seed_of_corruption_generic'), -(38252, 'spell_warl_seed_of_corruption_generic'), -(39367, 'spell_warl_seed_of_corruption_generic'), -(44141, 'spell_warl_seed_of_corruption_generic'), -(70388, 'spell_warl_seed_of_corruption_generic'), - -(33493, 'spell_mark_of_malice'), -(33510, 'spell_item_mark_of_conquest'), -(33757, 'spell_sha_windfury_weapon'), -(37288, 'spell_dru_t4_2p_bonus'), -(37295, 'spell_dru_t4_2p_bonus'), -(37594, 'spell_pri_t5_heal_2p_bonus'), -(38196, 'spell_anetheron_vampiric_aura'), -(39372, 'spell_item_frozen_shadoweave'), -(39446, 'spell_item_aura_of_madness'), -(40438, 'spell_pri_item_t6_trinket'), -(40442, 'spell_dru_item_t6_trinket'), -(40463, 'spell_sha_item_t6_trinket'), -(40470, 'spell_pal_item_t6_trinket'), -(40971, 'spell_item_crystal_spire_of_karabor'), -(41404, 'spell_item_dementia'), - -(37381, 'spell_item_pet_healing'), - -(37377, 'spell_warl_t4_2p_bonus_shadow'), -(39437, 'spell_warl_t4_2p_bonus_fire'), - -(44401, 'spell_mage_gen_extra_effects'), -(48108, 'spell_mage_gen_extra_effects'), -(57761, 'spell_mage_gen_extra_effects'), - -(42770, 'spell_uk_second_wind'), -(45057, 'spell_item_commendation_of_kaelthas'), -(45481, 'spell_item_sunwell_exalted_caster_neck'), -(45482, 'spell_item_sunwell_exalted_melee_neck'), -(45483, 'spell_item_sunwell_exalted_tank_neck'), -(45484, 'spell_item_sunwell_exalted_healer_neck'), - -(-18094, 'spell_warl_glyph_of_corruption_nightfall'), -(56218, 'spell_warl_glyph_of_corruption_nightfall'), - -(49005, 'spell_dk_mark_of_blood'), -(49028, 'spell_dk_dancing_rune_weapon'), -(49194, 'spell_dk_unholy_blight'), -(51209, 'spell_dk_hungering_cold'), -(52420, 'spell_item_soul_harvesters_charm'), - -(52910, 'spell_rog_turn_the_tables_proc'), -(52914, 'spell_rog_turn_the_tables_proc'), -(52915, 'spell_rog_turn_the_tables_proc'), - -(53601, 'spell_pal_sacred_shield_dummy'), - -(53646, 'spell_warl_demonic_pact'), -(54909, 'spell_warl_demonic_pact'), - -(53736, 'spell_pal_seal_of_corruption'), -(53817, 'spell_sha_maelstrom_weapon'), -(54748, 'spell_mage_burning_determination'), -(54754, 'spell_dru_glyph_of_rejuvenation'), -(54815, 'spell_dru_glyph_of_shred'), -(54821, 'spell_dru_glyph_of_rake'), -(54832, 'spell_dru_glyph_of_innervate'), -(54845, 'spell_dru_glyph_of_starfire_dummy'), -(54937, 'spell_pal_glyph_of_holy_light_dummy'), -(54939, 'spell_pal_glyph_of_divinity'), -(55198, 'spell_sha_tidal_force_dummy'), -(55440, 'spell_sha_glyph_of_healing_wave'), -(55677, 'spell_pri_glyph_of_dispel_magic'), -(56372, 'spell_mage_glyph_of_ice_block'), -(56374, 'spell_mage_glyph_of_icy_veins'), -(56375, 'spell_mage_glyph_of_polymorph'), -(56800, 'spell_rog_glyph_of_backstab'), -(57870, 'spell_hun_glyph_of_mend_pet'), -(57989, 'spell_pri_shadowfiend_death'), -(58375, 'spell_warr_glyph_of_blocking'), -(58642, 'spell_dk_glyph_of_scourge_strike'), -(58877, 'spell_sha_spirit_hunt'), -(58914, 'spell_hun_kill_command_pet'), -(59906, 'spell_item_swift_hand_justice_dummy'), -(59915, 'spell_item_discerning_eye_beast_dummy'), - -(37447, 'spell_mage_imp_mana_gems'), -(61062, 'spell_mage_imp_mana_gems'), - -(52723, 'spell_gen_vampiric_touch'), -(60501, 'spell_gen_vampiric_touch'), -(61257, 'spell_dk_pvp_4p_bonus'), -(62259, 'spell_dk_glyph_of_death_grip'), -(62600, 'spell_dru_savage_defense'), -(63279, 'spell_sha_glyph_of_earth_shield'), -(63280, 'spell_sha_glyph_of_totem_of_wrath'), -(63320, 'spell_warl_glyph_of_life_tap'), -(64890, 'spell_pal_t8_2p_bonus'), -(64928, 'spell_sha_t8_elemental_4p_bonus'), -(65032, 'spell_xt002_321_boombot_aura'), -(67228, 'spell_sha_t9_elemental_4p_bonus'), -(69755, 'spell_item_purified_shard_of_the_scale'), -(69739, 'spell_item_shiny_shard_of_the_scale'), -(70723, 'spell_dru_t10_balance_4p_bonus'), -(70664, 'spell_dru_t10_restoration_4p_bonus_dummy'), -(70770, 'spell_pri_t10_heal_2p_bonus'), -(70808, 'spell_sha_t10_restoration_4p_bonus'), -(70817, 'spell_sha_t10_elemental_4p_bonus'), -(70844, 'spell_warr_item_t10_prot_4p_bonus'), - -(71406, 'spell_item_tiny_abomination_in_a_jar'), -(71545, 'spell_item_tiny_abomination_in_a_jar_hero'), - -(71563, 'spell_item_deadly_precision_dummy'), -(71564, 'spell_item_deadly_precision'), - -(71880, 'spell_item_heartpierce'), -(71892, 'spell_item_heartpierce_hero'), - -(71519, 'spell_item_deathbringers_will_normal'), -(71562, 'spell_item_deathbringers_will_heroic'), - -(71634, 'spell_item_corpse_tongue_coin'), -(71640, 'spell_item_corpse_tongue_coin_heroic'), - -(71770, 'spell_putricide_ooze_tank_protection'), -(72176, 'spell_deathbringer_blood_beast_blood_link'), - -(75475, 'spell_item_petrified_twilight_scale'), -(75481, 'spell_item_petrified_twilight_scale_heroic'); - --- Non scripted auras from `spell_proc_event` -DELETE FROM `spell_proc` WHERE `SpellId` IN (-66799, -63730, -61846, -58872, -57878, -57470, -56636, -56342, -55666, -53709, -53671, -53551, -53527, -53486, -53256, -53234, -53221, -53215, -52795, -52127, -51940, -51692, -51672, -51634, -51562, -51523, -51521, -50880, -49223, -49219, -49149, -49027, -49004, -48988, -48516, -48506, -48496, -48483, -47580, -47516, -47509, -47263, -47258, -47245, -47201, -47195, -46945, -46867, -46854, -45234, -44557, -44449, -44442, -41635, -35541, -35100, -34950, -34935, -34753, -34500, -33881, -33191, -33150, -33142, -33076, -32385, -31833, -31569, -31124, -30881, -30701, -30299, -30160, -29593, -29074, -27811, -20925, -20500, -20210, -20177, -20049, -19572, -19184, -18119, -18096, -17793, -17106, -16958, -16952, -16880, -16487, -16257, -16256, -16176, -14892, -14531, -14186, -13754, -13165, -12966, -12319, -12311, -12298, -12289, -12281, -11255, -11213, -11180, -11095, -9799, -9452, -5952, -324, 6346, 7383, 7434, 8178, 9782, 9784, 12169, 12322, 12999, 13000, 13001, 13002, 13163, 15088, 15128, 15277, 15346, 15600, 16164, 16550, 16620, 16624, 17364, 17495, 20128, 20131, 20132, 20164, 20165, 20166, 20375, 20705, 20784, 20911, 21185, 21882, 21890, 22618, 22648, 23547, 23548, 23551, 23552, 23572, 23578, 23581, 23686, 23688, 23689, 23721, 23920, 24353, 24389, 24905, 25050, 25669, 25899, 26107, 26119, 26128, 26135, 26480, 26605, 27419, 27498, 27521, 27656, 27774, 27787, 28305, 28752, 28802, 28812, 28816, 29150, 29385, 29455, 29501, 29624, 29625, 29626, 29632, 29633, 29634, 29635, 29636, 29637, 29977, 30003, 30937, 31394, 31794, 31904, 32587, 32642, 32734, 32748, 32776, 32777, 32837, 32844, 32885, 33089, 33127, 33297, 33299, 33510, 33648, 33719, 33746, 33759, 33953, 34074, 34080, 34138, 34139, 34258, 34262, 34320, 34355, 34584, 34586, 34598, 34749, 34774, 34783, 34827, 35077, 35080, 35083, 35086, 35121, 36032, 36096, 36111, 36541, 37165, 37170, 37173, 37189, 37193, 37195, 37197, 37213, 37214, 37227, 37237, 37247, 37379, 37384, 37443, 37514, 37516, 37519, 37523, 37528, 37536, 37568, 37600, 37601, 37603, 37655, 37657, 38026, 38031, 38290, 38299, 38326, 38327, 38334, 38347, 38350, 38394, 38857, 39027, 39442, 39443, 39530, 39958, 40407, 40444, 40458, 40475, 40478, 40482, 40485, 40899, 41034, 41260, 41262, 41381, 41393, 41434, 41469, 41989, 42083, 42135, 42136, 42368, 42370, 43443, 43726, 43728, 43737, 43739, 43741, 43745, 43748, 43750, 43819, 44543, 44545, 45054, 45354, 45355, 45469, 45481, 45482, 45483, 45484, 46025, 46092, 46098, 46569, 46662, 46832, 46910, 46911, 47981, 48833, 48835, 48837, 49592, 49622, 50240, 50421, 50781, 51123, 51127, 51128, 51129, 51130, 51346, 51349, 51352, 51359, 51414, 51915, 52020, 52423, 52898, 53386, 53397, 54278, 54646, 54695, 54707, 54738, 54808, 54838, 54841, 54925, 55380, 55381, 55640, 55680, 55681, 55689, 55747, 55768, 55776, 56249, 56355, 56364, 56451, 56816, 56817, 56821, 56841, 57345, 57352, 57907, 57989, 58357, 58364, 58372, 58386, 58442, 58444, 58616, 58620, 58626, 58901, 59176, 59327, 59345, 59630, 59725, 60061, 60063, 60066, 60132, 60170, 60172, 60176, 60221, 60301, 60306, 60317, 60436, 60442, 60473, 60482, 60487, 60490, 60493, 60503, 60519, 60524, 60529, 60537, 60564, 60571, 60572, 60573, 60574, 60575, 60710, 60717, 60719, 60722, 60724, 60726, 60770, 60818, 60826, 61188, 61324, 61356, 61618, 61848, 62114, 62115, 62147, 62459, 63086, 63108, 63251, 63310, 63335, 63611, 64343, 64411, 64415, 64440, 64571, 64714, 64738, 64742, 64752, 64786, 64792, 64824, 64860, 64867, 64882, 64908, 64912, 64914, 64938, 64952, 64955, 64964, 64976, 64999, 65002, 65005, 65007, 65013, 65020, 65025, 66808, 67115, 67151, 67209, 67353, 67356, 67361, 67363, 67365, 67379, 67381, 67384, 67386, 67389, 67392, 67653, 67667, 67670, 67672, 67698, 67702, 67712, 67752, 67758, 67771, 68051, 68160, 70188, 70652, 70727, 70730, 70748, 70756, 70761, 70803, 70807, 70811, 70830, 70841, 70854, 71174, 71176, 71178, 71186, 71191, 71194, 71198, 71214, 71217, 71226, 71228, 71402, 71404, 71540, 71585, 71602, 71606, 71611, 71637, 71642, 71645, 71903, 72413, 72417, 72419, 74396, 75455, 75457, 75465, 75474); -INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES -(-66799, 0, 15, 0x00400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Desolation -(-63730, 0, 6, 0x00000800, 0x00000004, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Serendipity -(-61846, 0, 0, 0x00000000, 0x00000000, 0x00000000, 64, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Dragonhawk -(-58872, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 8259, 0x0, 0, 0, 0, 0), -- Damage Shield -(-57878, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Natural Reaction -(-57470, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Renewed Hope -(-56636, 0, 4, 0x00000020, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 6000, 0), -- Taste for Blood -(-56342, 0, 9, 0x00000018, 0x08000000, 0x00024000, 0, 0x0, 0x0, 0, 0x2, 0, 0, 0, 0), -- Lock and Load -(-55666, 0, 15, 0x00000001, 0x08000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Desecration -(-53709, 2, 10, 0x00004000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shield of the Templar -(-53671, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Judgements of the Pure -(-53551, 0, 10, 0x00001000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sacred Cleansing -(-53527, 1, 10, 0x00000000, 0x00000000, 0x00000004, 1024, 0x0, 0x2, 1, 0x0, 0, 100, 0, 0), -- Divine Guardian -(-53486, 0, 10, 0x00800000, 0x00028000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- The Art of War -(-53256, 0, 9, 0x00000800, 0x00800001, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Cobra Strikes -(-53234, 0, 9, 0x00020000, 0x00000001, 0x00000001, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Piercing Shots -(-53221, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Steady Shot -(-53215, 0, 9, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Wild Quiver -(-52795, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Borrowed Time -(-52127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Water Shield -(-51940, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 20, 0, 0), -- Earthliving Weapon (Passive) -(-51692, 0, 8, 0x00000204, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Waylay -(-51672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 1000, 0), -- Unfair Advantage -(-51634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Focused Attacks -(-51562, 0, 11, 0x00000100, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Tidal Waves -(-51523, 0, 11, 0x00000000, 0x00000001, 0x00000000, 65536, 0x0, 0x2, 0, 0x0, 0, 50, 0, 0), -- Earthen Power -(-51521, 0, 11, 0x00000000, 0x01000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Stormstrike -(-50880, 0, 15, 0x00000000, 0x04000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Icy Talons -(-49223, 0, 15, 0x00000011, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Dirge -(-49219, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Blood-Caked Blade -(-49149, 0, 15, 0x00000006, 0x00020002, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Chill of the Grave -(-49027, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 20000, 0), -- Bloodworms -(-49004, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 51, 0x0, 0, 0, 0, 0), -- Scent of Blood -(-48988, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Bloody Vengeance -(-48516, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Eclipse -(-48506, 0, 7, 0x00000005, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Earth and Moon -(-48496, 0, 7, 0x00000060, 0x02000002, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Living Seed -(-48483, 0, 7, 0x00008800, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Infected Wounds -(-47580, 0, 6, 0x00000000, 0x00000000, 0x00000040, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Pain and Suffering -(-47516, 0, 6, 0x00001800, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Grace -(-47509, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Divine Aegis -(-47263, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 20000, 0), -- Torture -(-47258, 0, 5, 0x00000000, 0x00800000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Backdraft -(-47245, 0, 5, 0x00000002, 0x00000000, 0x00000000, 262144, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Molten Core -(-47201, 0, 5, 0x00004009, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Everlasting Affliction -(-47195, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Eradication -(-46945, 0, 4, 0x00000000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Safeguard -(-46867, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Wrecking Crew -(-46854, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Trauma -(-45234, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Focused Will -(-44557, 0, 3, 0x00000020, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Enduring Winter -(-44449, 0, 3, 0x20E21277, 0x00019048, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Burnout -(-44442, 0, 3, 0x00800000, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 1000, 0), -- Firestarter -(-41635, 0, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Prayer of Mending -(-35541, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8388608, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Combat Potency -(-35100, 0, 9, 0x00001000, 0x00000000, 0x00000001, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Concussive Barrage -(-34950, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Go for the Throat -(-34935, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 8000, 0), -- Backlash -(-34753, 0, 6, 0x00001800, 0x00000004, 0x00001000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Holy Concentration -(-34500, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Expose Weakness -(-33881, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Natural Perfection -(-33191, 0, 6, 0x00008000, 0x00000400, 0x00000040, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Misery -(-33150, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Surge of Light -(-33142, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blessed Resilience -(-33076, 0, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Prayer of Mending -(-32385, 0, 5, 0x00000001, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Shadow Embrace -(-31833, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Light's Grace -(-31569, 0, 3, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Blink -(-31124, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blade Twisting -(-30881, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Nature's Guardian -(-30701, 28, 0, 0x00000000, 0x00000000, 0x00000000, 664232, 0x0, 0x0, 0, 0x0, 0, 100, 0, 0), -- Elemental Absorption -(-30299,126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Nether Protection -(-30160, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Elemental Devastation -(-29593, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 112, 0x0, 0, 0, 0, 0), -- Improved Defensive Stance -(-29074, 20, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Master of Elements -(-27811, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blessed Recovery -(-20925, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield -(-20500, 0, 4, 0x10000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Berserker Rage -(-20210, 0, 10, 0xC0000000, 0x00010000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Illumination -(-20177, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Reckoning -(-20049, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Vengeance -(-19572, 0, 9, 0x00800000, 0x00000000, 0x00000000, 262144, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Improved Mend Pet -(-19184, 0, 9, 0x00000010, 0x00002000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Entrapment -(-18119, 0, 5, 0x00000000, 0x00800000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aftermath -(-18096, 0, 5, 0x00000100, 0x00800000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Pyroclasm -(-17793, 0, 5, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Shadow Bolt -(-17106, 0, 7, 0x00080000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Intensity -(-16958, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Primal Fury -(-16952, 0, 7, 0x00039000, 0x00000400, 0x00040000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Blood Frenzy -(-16880, 72, 7, 0x00000067, 0x03800002, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Nature's Grace -(-16487, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Blood Craze -(-16257, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Flurry -(-16256, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Flurry -(-16176, 0, 11, 0x000001C0, 0x00000000, 0x00000010, 0, 0x2, 0x2, 2, 0x0, 0, 0, 0, 0), -- Ancestral Healing -(-14892, 0, 6, 0x10001E00, 0x00010004, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Inspiration -(-14531, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Martyrdom -(-14186, 0, 8, 0x40800508, 0x00000006, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Seal Fate -(-13754, 0, 8, 0x00000010, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Kick -(-13165, 0, 0, 0x00000000, 0x00000000, 0x00000000, 64, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Hawk -(-12966, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Flurry -(-12319, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Flurry -(-12311, 0, 4, 0x00000800, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Gag Order -(-12298, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Shield Specialization -(-12289, 0, 4, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Hamstring -(-12281, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 6000, 0), -- Sword Specialization -(-11255, 0, 3, 0x00004000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Counterspell -(-11213, 0, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Arcane Concentration -(-11180, 16, 3, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Winter's Chill -(-11095, 0, 3, 0x00000010, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Scorch -(-9799, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Eye for an Eye -(-9452, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 3, 0, 0, 0), -- Vindication -(-5952, 0, 8, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Throwing Specialization -(-324, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Lightning Shield -(6346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Fear Ward -(7383, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Water Bubble -(7434, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Fate Rune of Unsurpassed Vigor -(8178, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Grounding Totem Effect -(9782, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Mithril Shield Spike -(9784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Iron Shield Spike -(12169, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block -(12322, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Unbridled Wrath -(12999, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 6, 0, 0, 0), -- Unbridled Wrath -(13000, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 9, 0, 0, 0), -- Unbridled Wrath -(13001, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 12, 0, 0, 0), -- Unbridled Wrath -(13002, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 15, 0, 0, 0), -- Unbridled Wrath -(13163, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Aspect of the Monkey -(15088, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Flurry -(15128, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Flames -(15277, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Seal of Reckoning -(15346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 0, 0), -- Seal of Reckoning -(15600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Hand of Justice -(16164, 28, 0, 0x00000000, 0x00000000, 0x00000000, 65536, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Elemental Focus -(16550, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Bonespike -(16620, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 30000, 0), -- Proc Self Invulnerability -(16624, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Thorium Shield Spike -(17364, 8, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Stormstrike -(17495, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Crest of Retribution -(20128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt -(20131, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt -(20132, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt -(20164, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 5, 0, 0, 0), -- Seal of Justice -(20165, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 20, 0, 0, 0), -- Seal of Light -(20166, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 12, 0, 0, 0), -- Seal of Wisdom -(20375, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 1000, 0), -- Seal of Command -(20705, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Power Shield 500 -(20784, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Tamed Pet Passive 07 (DND) -(20911, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Blessing of Sanctuary -(21185, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Spinal Reaper -(21882, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Judgement Smite -(21890, 0, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Warrior's Wrath -(22618, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Force Reactive Disk -(22648, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Call of Eskhandar -(23547, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Parry -(23548, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Parry -(23551, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lightning Shield -(23552, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Lightning Shield -(23572, 0, 11, 0x000000C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Mana Surge -(23578, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Expose Weakness -(23581, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Bloodfang -(23686, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Lightning Strike -(23688, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aura of the Blue Dragon -(23689, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 4, 0, 0, 0), -- Heroism -(23721, 0, 9, 0x00000800, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Arcane Infused -(23920, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(24353, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Primal Instinct -(24389, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Chaos Fire -(24905, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 15, 0, 0, 0), -- Moonkin Form (Passive) -(25050, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Flames -(25669, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Decapitate -(25899, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 112, 0x0, 0, 0, 0, 0), -- Greater Blessing of Sanctuary -(26107, 0, 7, 0x00800000, 0x10000080, 0x00000000, 0, 0x0, 0x2, 116, 0x0, 0, 0, 0, 0), -- Symbols of Unending Life Finisher Bonus -(26119, 0, 10, 0x90100003, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Stormcaller Spelldamage Bonus -(26128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 8, 0x0, 0, 0, 0, 0), -- Enigma Resist Bonus -(26135, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Battlegear of Eternal Justice -(26480, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Badge of the Swarmguard -(26605, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x2, 0, 0, 0, 0), -- Bloodcrown -(27419, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Warrior's Resolve -(27498, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Crusader's Wrath -(27521, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Mana Restore -(27656, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flame Lash -(27774, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- The Furious Storm -(27787, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Rogue Armor Energize -(28305, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mana Leech -(28752, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Adrenaline Rush -(28802, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Epiphany -(28812, 0, 8, 0x02000006, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Head Rush -(28816, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 3, 0, 0, 0), -- Invigorate -(29150, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Electric Discharge -(29385, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command -(29455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Felsteel Shield Spike -(29501, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Frost Arrow -(29624, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Searing Arrow -(29625, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flaming Cannonball -(29626, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Shadow Bolt -(29632, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Shadow Shot -(29633, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Fire Blast -(29634, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Quill Shot -(29635, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Flaming Shell -(29636, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Venom Shot -(29637, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Keeper's Sting -(29977, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Combustion -(30003, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Sheen of Zanza -(30937, 32, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Shadow -(31394, 32, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Mark of Shadow -(31794, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Focused Mind -(31904, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield -(32587, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block -(32642, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Spore Cloud -(32734, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Earth Shield -(32748, 0, 8, 0x00000000, 0x00000001, 0x00000000, 320, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Throw Interrupt -(32776, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Redoubt -(32777, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Holy Shield -(32837, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Focus Trigger -(32844, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 0, 0), -- Lesser Heroism -(32885, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Infuriate -(33089, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Vigilance of the Colossus -(33127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command -(33297, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Haste Trinket -(33299, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Coilfang Slave Pens Lvl 70 Boss3a Caster Trinket -(33510, 0, 0, 0x00000000, 0x00000000, 0x00000000, 340, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Health Restore -(33648, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Reflection of Torment -(33719, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Perfect Spell Reflection -(33746, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Essence Infused Mushroom -(33759, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Power Infused Mushroom -(33953, 0, 0, 0x00000000, 0x00000000, 0x00000000, 17408, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Essence of Life -(34074, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Aspect of the Viper -(34080, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Riposte Stance -(34138, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totem of the Third Wind -(34139, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Libram of Justice -(34258, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Justice -(34262, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Mercy -(34320, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Call of the Nexus -(34355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Poison Shield -(34584, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 30000, 0), -- Love Struck -(34586, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.5, 0, 0, 0), -- Romulo's Poison -(34598, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Karazhan Caster Robe -(34749, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 8, 0x2, 0, 0, 0, 0), -- Recurring Power -(34774, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.5, 0, 20000, 0), -- Magtheridon Melee Trinket -(34783, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(34827, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Water Shield -(35077, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Defender -(35080, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 55000, 0), -- Band of the Eternal Champion -(35083, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Sage -(35086, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 55000, 0), -- Band of the Eternal Restorer -(35121, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Nether Power -(36032, 0, 3, 0x00001000, 0x00008000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Arcane Blast -(36096, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(36111, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- World Breaker -(36541, 4, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x2, 0, 0, 0, 0), -- Curse of Burning Shadows -(37165, 0, 8, 0x00200400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Haste -(37170, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 1, 0, 0, 0), -- Free Finisher Chance -(37173, 0, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 25000, 0), -- Armor Penetration -(37189, 0, 10, 0xC0000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 60000, 0), -- Recuced Holy Light Cast Time -(37193, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Infused Shield -(37195, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Judgement Group Heal -(37197, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spell Damage -(37213, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Mana Cost Reduction -(37214, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Energized -(37227, 0, 11, 0x000001C0, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 60000, 0), -- Improved Healing Wave -(37237, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Lightning Bolt Discount -(37247, 8, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Regain Mana -(37379, 32, 5, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Flameshadow -(37384, 0, 5, 0x00000001, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Corruption and Immolate -(37443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Bonus Damage -(37514, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Blade Turning -(37516, 0, 4, 0x00000400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Revenge Bonus -(37519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 48, 0x0, 0, 0, 0, 0), -- Rage Bonus -(37523, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Reinforced Shield -(37528, 0, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Overpower Bonus -(37536, 0, 4, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Improved Battle Shout -(37568, 0, 6, 0x00000800, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Greater Heal Discount -(37600, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Offensive Discount -(37601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Relentlessness -(37603, 0, 6, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadow Word Pain Damage -(37655, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Bonus Mana Regen -(37657, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 2500, 0), -- Lightning Capacitor -(38026, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 256, 0x0, 0, 0, 0, 0), -- Viscous Shield -(38031, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Shield Block -(38290, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,1.6, 0, 0, 0), -- Santos' Blessing -(38299, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 12000, 0), -- HoTs on Heals -(38326, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Threat Reduction Melee -(38327, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Threat Reduction Spell -(38334, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Proc Mana Regen -(38347, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Crit Proc Spell Damage -(38350, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Crit Proc Heal -(38394, 0, 5, 0x00000006, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Dot Heals -(38857, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Spell Ground -(39027, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Poison Shield -(39442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 1, 0x0, 0, 0, 0, 0), -- Aura of Wrath -(39443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Aura of Wrath -(39530, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Focus -(39958, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,0.7, 0, 40000, 0), -- Skyfire Swiftness -(40407, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Illidan Tank Shield -(40444, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Black Temple Tank Trinket -(40458, 0, 4, 0x02000000, 0x00000601, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Warrior Tier 6 Trinket -(40475, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 3, 0, 0, 0), -- Black Temple Melee Trinket -(40478, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Warlock Tier 6 Trinket -(40482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Mage Tier 6 Trinket -(40485, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hunter Tier 6 Trinket -(40899, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 1, 0, 0, 0), -- Felfire Proc -(41034, 126, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 1024, 0x0, 0, 0, 0, 0), -- Spell Absorption -(41260, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Aviana's Purpose -(41262, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Aviana's Will -(41381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 256, 0x0, 0, 0, 0, 0), -- Shell of Life -(41393, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 32, 0x0, 0, 0, 0, 0), -- Riposte -(41434, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 2, 0, 45000, 0), -- The Twin Blades of Azzinoth -(41469, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 7, 0, 1000, 0), -- Seal of Command -(41989, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0,0.5, 0, 0, 0), -- Fists of Fury -(42083, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Fury of the Crashing Waves -(42135, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 90000, 0), -- Lesser Rune of Warding -(42136, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 90000, 0), -- Greater Rune of Warding -(42368, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Merciless Libram of Justice -(42370, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Merciless Totem of the Third WInd -(43443, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(43726, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vengeful Libram of Justice -(43728, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Vengeful Totem of Third WInd -(43737, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Primal Instinct -(43739, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Lunar Grace -(43741, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Light's Grace -(43745, 0, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Crusader's Command -(43748, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Elemental Strength -(43750, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Energized -(43819, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Lucidity -(44543, 0, 3, 0x00100220, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 7, 0, 0), -- Fingers of Frost -(44545, 0, 3, 0x00100220, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 15, 0, 0), -- Fingers of Frost -(45054, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 15000, 0), -- Augment Pain -(45354, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Sunwell Dungeon Melee Trinket -(45355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - T7 Melee Trinket Base -(45469, 0, 15, 0x00000010, 0x00000000, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Death Strike -(45481, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Caster Neck -(45482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Melee Neck -(45483, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Tank Neck -(45484, 0, 0, 0x00000000, 0x00000000, 0x00000000, 16384, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Healer Neck -(46025, 32, 6, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blackout -(46092, 0, 10, 0x40000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brutal Libram of Justice -(46098, 0, 11, 0x00000080, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Brutal Totem of Third WInd -(46569, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Sunwell Exalted Caster Neck -(46662, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 20000, 0), -- Deathfrost -(46832, 0, 7, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Moonkin Starfire Bonus -(46910, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,5.5, 0, 0, 0), -- Furious Attacks -(46911, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,7.5, 0, 0, 0), -- Furious Attacks -(47981, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(48833, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Primal Instinct -(48835, 0, 10, 0x00800000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x2, 0, 0, 0, 0), -- Justice -(48837, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Elemental Tenacity -(49592, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8528552, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Temporal Rift -(49622, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Bonus Mana Regen -(50240, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Evasive Maneuvers -(50421, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Scent of Blood -(50781, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 6000, 0), -- Fate Rune of Primal Energy -(51123, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 1, 0, 0, 0), -- Killing Machine -(51127, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 2, 0, 0, 0), -- Killing Machine -(51128, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 4, 0, 0, 0), -- Killing Machine -(51129, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 6, 0, 0, 0), -- Killing Machine -(51130, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 8, 0, 0, 0), -- Killing Machine -(51346, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown! -(51349, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown -(51352, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown! -(51359, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x1, 0, 0, 10000, 0), -- Venture Company Beatdown -(51414, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Venomous Breath Aura -(51915, 0, 0, 0x00000000, 0x00000000, 0x00000000,16777216, 0x0, 0x0, 0, 0x0, 0, 100, 600000, 0), -- Undying Resolve -(52020, 0, 7, 0x00008000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Snap and Snarl -(52423, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 0, 0), -- Retaliation -(52898, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2, 0x0, 0, 0, 0, 0), -- Spell Damping -(53386, 0, 15, 0x82127F27, 0x000001BF, 0x00000000, 0, 0x1, 0x2, 0, 0x2, 0, 0, 0, 0), -- Cinderglacier -(53397, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Invigoration -(54278, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Empowered Imp -(54646, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Focus Magic -(54695, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Death Knight's Anguish Base -(54707, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Sonic Awareness (DND) -(54738, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Star of Light -(54808, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 60000, 0), -- Sonic Shield -(54838, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Purified Spirit -(54841, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 2500, 0), -- Thunder Capacitor -(54925, 2, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Seal of Command -(55380, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0,0.7, 0, 40000, 0), -- Skyflare Swiftness -(55381, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Mana Restore -(55640, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Lightweave Embroidery -(55680, 0, 6, 0x00000200, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Prayer of Healing -(55681, 0, 6, 0x00008000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shadow Word: Pain -(55689, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Shadow -(55747, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Argent Fury -(55768, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkglow Embroidery -(55776, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Swordguard Embroidery -(56249, 0, 5, 0x00000000, 0x00000000, 0x00000400, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Felhunter -(56355, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 64, 0x0, 0, 0, 0, 0), -- Titanium Shield Spike -(56364, 0, 3, 0x00000000, 0x01000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Remove Curse -(56451, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 3000, 0), -- Earth Shield -(56816, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 48, 0x0, 0, 0, 0, 0), -- Rune Strike -(56817, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Rune strike proc (SERVERSIDE) -(56821, 0, 8, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Sinister Strike -(56841, 0, 9, 0x00000800, 0x00000000, 0x00000000, 256, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Arcane Shot -(57345, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkmoon Card: Greatness -(57352, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Darkmoon Card: Death -(57907, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Increased Spirit -(57989, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Shadowfiend Death -(58357, 0, 4, 0x00000040, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Glyph of Heroic Strike -(58364, 0, 4, 0x00000400, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Revenge -(58372, 0, 4, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Hamstring -(58386, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 32, 0x0, 0, 0, 0, 0), -- Glyph of Overpower -(58442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 15000, 0), -- Airy Pale Ale -(58444, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 5000, 0), -- Worg Tooth Oatmeal Stout -(58616, 0, 15, 0x01000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Heart Strike -(58620, 0, 15, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Chains of Ice -(58626, 0, 15, 0x02000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Death Grip -(58901, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Tears of Anguish -(59176, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 2, 0x0, 0, 0, 0, 0), -- Spell Damping -(59327, 0, 15, 0x08000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Rune Tap -(59345, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Chagrin -(59630, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 35000, 0), -- Black Magic -(59725, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 2048, 0x0, 0, 0, 0, 0), -- Spell Reflection -(60061, 0, 0, 0x00000000, 0x00000000, 0x00000000, 294912, 0x2, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Flow of Time -(60063, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Now is the Time! -(60066, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Rage of the Unraveller -(60132, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Oblit/Scourge Strike Runic Power Up -(60170, 0, 5, 0x00000006, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Corruption Triggers Crit -(60172, 0, 5, 0x00040000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Life Tap Bonus Spirit -(60176, 0, 4, 0x00000020, 0x00000010, 0x00000000, 262144, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Bleed Cost Reduction -(60221, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Essence of Gossamer -(60301, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Meteorite Whetstone -(60306, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Vestige of Haldor -(60317, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Signet of Edward the Odd -(60436, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Grim Toll -(60442, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Bandit's Insignia -(60473, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Forge Ember -(60482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Pendulum of Telluric Currents -(60487, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 15000, 0), -- Extract of Necromatic Power -(60490, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Embrace of the Spider -(60493, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Dying Curse -(60503, 1, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Taste for Blood -(60519, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x3, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Spark of Life -(60524, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Majestic Dragon Figurine -(60529, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Forethought Talisman -(60537, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Soul of the Dead -(60564, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Savage Gladiator's Totem of Survival -(60571, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hateful Gladiator's Totem of Survival -(60572, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Gladiator's Totem of Survival -(60573, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 4 Gladiator's Totem of Survival -(60574, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 5 Gladiator's Totem of Survival -(60575, 0, 11, 0x90100000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 6 Gladiator's Totem of Survival -(60710, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Savage Gladiator's Idol of Steadfastness -(60717, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Hateful Gladiator's Idol of Steadfastness -(60719, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Deadly Gladiator's Idol of Steadfastness -(60722, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 4 Gladiator's Idol of Steadfastness -(60724, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 5 Gladiator's Idol of Steadfastness -(60726, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- LK Arena 6 Gladiator's Idol of Steadfastness -(60770, 0, 11, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Totem of the Elemental Plane -(60818, 0, 10, 0x00000000, 0x00000200, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Libram of Reciprocation -(60826, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Sigil of Haunted Dreams -(61188, 0, 5, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Chaotic Mind -(61324, 0, 10, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Justice -(61356, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 90000, 0), -- Invigorating Earthsiege Diamond Passive -(61618, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Tentacles -(61848, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Aspect of the Dragonhawk -(62114, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Flow of Knowledge -(62115, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Strength of the Titans -(62147, 0, 15, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Icy Touch Defense Increase -(62459, 0, 15, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Chains of Ice Frost Rune Refresh -(63086, 0, 9, 0x00000000, 0x00000000, 0x00010000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Raptor Strike -(63108, 0, 5, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Siphon Life -(63251, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Glory of the Jouster -(63310, 0, 5, 0x00000000, 0x00010000, 0x00000000, 65536, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Shadowflame -(63335, 0, 15, 0x00000000, 0x00000002, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Glyph of Howling Blast -(63611, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x1, 0, 0, 0, 0), -- Improved Blood Presence -(64343, 0, 3, 0x00000002, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Impact -(64411, 0, 0, 0x00000000, 0x00000000, 0x00000000, 279552, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Blessing of Ancient Kings -(64415, 0, 0, 0x00000000, 0x00000000, 0x00000000, 279552, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Val'anyr Hammer of Ancient Kings - Equip Effect -(64440, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 32, 0x0, 0, 0, 20000, 0), -- Blade Warding -(64571, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Blood Draining -(64714, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Flame of the Heavens -(64738, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Show of Faith -(64742, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Pandora's Plea -(64752, 0, 7, 0x00001000, 0x00000100, 0x00200000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Feral 2P Bonus -(64786, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Comet's Trail -(64792, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Blood of the Old God -(64824, 0, 7, 0x00200000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Balance 4P Bonus -(64860, 0, 9, 0x00000000, 0x00000001, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T8 4P Bonus -(64867, 0, 3, 0x20000021, 0x00001000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Mage T8 2P Bonus -(64882, 0, 10, 0x00000000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Protection 4P Bonus -(64908, 0, 6, 0x00002000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T8 Shadow 4P Bonus -(64912, 0, 6, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Priest T8 Healer 4P Bonus -(64914, 0, 8, 0x00010000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T8 2P Bonus -(64938, 0, 4, 0x00200040, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 0, 0), -- Item - Warrior T8 Melee 2P Bonus -(64952, 0, 7, 0x00000000, 0x00000440, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T8 Feral Relic -(64955, 0, 10, 0x00000000, 0x00000040, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T8 Protection Relic -(64964, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T8 Tank Relic -(64976, 0, 4, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Juggernaut -(64999, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x4, 0, 0, 0, 0), -- Meteoric Inspiration -(65002, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Bonus Mana Regen -(65005, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Alacrity of the Elements -(65007, 0, 0, 0x00000000, 0x00000000, 0x00000000, 81920, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Eye of the Broodmother -(65013, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Pyrite Infusion -(65020, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Mjolnir Runestone -(65025, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Dark Matter -(66808, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Meteor Fists -(67115, 0, 15, 0x01400000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Death Knight T9 Melee 2P Bonus -(67151, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Hunter T9 4P Bonus (Steady Shot) -(67209, 1, 8, 0x00100000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T9 2P Bonus (Rupture) -(67353, 0, 7, 0x00008000, 0x00100500, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred) -(67356, 8, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Restoration Relic (Rejuvenation) -(67361, 0, 7, 0x00000002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T9 Balance Relic (Moonfire) -(67363, 0, 10, 0x80000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Item - Paladin T9 Holy Relic (Judgement) -(67365, 0, 10, 0x00000000, 0x00000800, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 6000, 0), -- Item - Paladin T9 Retribution Relic (Seal of Vengeance) -(67379, 0, 10, 0x00000000, 0x00040000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T9 Protection Relic (Hammer of The Righteous) -(67381, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 10000, 0), -- Item - Death Knight T9 Tank Relic (Rune Strike) -(67384, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 80, 10000, 0), -- Item - Death Knight T9 Melee Relic (Rune Strike) -(67386, 0, 11, 0x00000001, 0x00000000, 0x00000000, 65536, 0x0, 0x1, 0, 0x0, 0, 0, 6000, 0), -- Item - Shaman T9 Elemental Relic (Lightning Bolt) -(67389, 0, 11, 0x00000100, 0x00000000, 0x00000000, 16384, 0x0, 0x1, 0, 0x0, 0, 0, 8000, 0), -- Item - Shaman T9 Restoration Relic (Chain Heal) -(67392, 0, 11, 0x00000000, 0x00000000, 0x00000004, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T9 Enhancement Relic (Lava Lash) -(67653, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4194344, 0x1, 0x0, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Tank Trinket -(67667, 0, 0, 0x00000000, 0x00000000, 0x00000000, 16384, 0x2, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Healer Trinket -(67670, 0, 0, 0x00000000, 0x00000000, 0x00000000, 65536, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 CasterTrinket -(67672, 0, 0, 0x00000000, 0x00000000, 0x00000000, 8388948, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Coliseum 5 Melee Trinket -(67698, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Item - Coliseum 25 Normal Healer Trinket -(67702, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Coliseum 25 Normal Melee Trinket -(67712, 0, 0, 0x00000000, 0x00000000, 0x00000000, 69632, 0x0, 0x2, 2, 0x0, 0, 0, 2000, 0), -- Item - Coliseum 25 Normal Caster Trinket -(67752, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Item - Coliseum 25 Heroic Healer Trinket -(67758, 0, 0, 0x00000000, 0x00000000, 0x00000000, 69632, 0x0, 0x2, 2, 0x0, 0, 0, 2000, 0), -- Item - Coliseum 25 Heroic Caster Trinket -(67771, 1, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Coliseum 25 Heroic Melee Trinket -(68051, 1, 4, 0x00000004, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Overpower Ready! -(68160, 0, 0, 0x00000000, 0x00000000, 0x00000000, 4, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Meteor Fists -(70188, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 16, 0x0, 0, 0, 0, 0), -- Cloak of Darkness -(70652, 0, 15, 0x00000008, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 Tank 4P Bonus -(70727, 0, 9, 0x00000001, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T10 2P Bonus -(70730, 0, 9, 0x00004000, 0x00001000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Hunter T10 4P Bonus -(70748, 0, 3, 0x00000000, 0x00200000, 0x00000000, 1024, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Mage T10 4P Bonus -(70756, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Holy 4P Bonus -(70761, 0, 10, 0x00000000, 0x00000000, 0x00000001, 1024, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Protection 4P Bonus -(70803, 0, 8, 0x003E0000, 0x00000008, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Rogue T10 4P Bonus -(70807, 0, 11, 0x00000000, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration 2P Bonus -(70811, 0, 11, 0x00000003, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental 2P Bonus -(70830, 0, 11, 0x00000000, 0x00020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Enhancement 2P Bonus -(70841, 0, 5, 0x00000004, 0x00000100, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Warlock T10 4P Bonus -(70854, 0, 4, 0x00000000, 0x00000010, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Warrior T10 Melee 2P Bonus -(71174, 1, 7, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Feral Relic (Rake and Lacerate) -(71176, 0, 7, 0x00200002, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Balance Relic (Moonfire and Insect Swarm) -(71178, 0, 7, 0x00000010, 0x00000000, 0x00000000, 0, 0x2, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Druid T10 Restoration Relic (Rejuvenation) -(71186, 0, 10, 0x00000000, 0x00008000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Retribution Relic (Crusader Strike) -(71191, 0, 10, 0x00000000, 0x00010000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Holy Relic (Holy Shock) -(71194, 0, 10, 0x00000000, 0x00100000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Paladin T10 Protection Relic (Shield of Righteousness) -(71198, 4, 11, 0x10000000, 0x00000000, 0x00000000, 0, 0x0, 0x0, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Elemental Relic (Shocks) -(71214, 0, 11, 0x00000000, 0x00000010, 0x00000000, 16, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Enhancement Relic (Stormstrike) -(71217, 0, 11, 0x00000000, 0x00000000, 0x00000010, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Shaman T10 Restoration Relic (Riptide) -(71226, 0, 15, 0x00000010, 0x08020000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 DPS Relic (Obliterate, Scourge Strike, Death Strike) -(71228, 0, 15, 0x00000000, 0x20000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0), -- Item - Death Knight T10 Tank Relic (Runestrike) -(71402, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 10 Normal Melee Trinket -(71404, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 2, 0x0, 0, 0, 45000, 0), -- Item - Icecrown Dungeon Melee Trinket -(71540, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 10 Heroic Melee Trinket -(71585, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Emblem Healer Trinket -(71602, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Normal Caster Trinket 1 Base -(71606, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 100000, 0), -- Item - Icecrown 25 Normal Caster Trinket 2 -(71611, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Normal Healer Trinket 2 -(71637, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0, 0x0, 0, 0, 100000, 0), -- Item - Icecrown 25 Heroic Caster Trinket 2 -(71642, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Heroic Healer Trinket 2 -(71645, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Icecrown 25 Heroic Caster Trinket 1 Base -(71903, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 12, 0, 0, 0), -- Item - Shadowmourne Legendary -(72413, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 10, 60000, 0), -- Item - Icecrown Reputation Ring Melee -(72417, 0, 0, 0x00000000, 0x00000000, 0x00000000, 327680, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Item - Icecrown Reputation Ring Caster Trigger -(72419, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 60000, 0), -- Item - Icecrown Reputation Ring Healer Trigger -(74396, 84, 3, 0x28E212F7, 0x00119048, 0x00000000, 65536, 0x0, 0x1, 0, 0x0, 0, 0, 0, 0), -- Fingers of Frost -(75455, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Melee Trinket -(75457, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x0, 0x2, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Heroic Melee Trinket -(75465, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0), -- Item - Chamber of Aspects 25 Nuker Trinket -(75474, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x1, 0, 0x0, 0, 0, 45000, 0); -- Item - Chamber of Aspects 25 Heroic Nuker Trinket - --- Kill the damned thing already! -DROP TABLE IF EXISTS `spell_proc_event`; diff --git a/sql/updates/world/3.3.5/2017_02_21_00_world.sql b/sql/updates/world/3.3.5/2017_02_21_00_world.sql deleted file mode 100644 index f337d3430d..0000000000 --- a/sql/updates/world/3.3.5/2017_02_21_00_world.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `spell_proc` SET `Chance`=2, `ProcsPerMinute`=0, `AttributesMask`=`AttributesMask`|0x80 WHERE `SpellId`=15600; diff --git a/sql/updates/world/3.3.5/2017_03_04_00_world.sql b/sql/updates/world/3.3.5/2017_03_04_00_world.sql deleted file mode 100644 index 874d19831e..0000000000 --- a/sql/updates/world/3.3.5/2017_03_04_00_world.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM `spell_proc` WHERE `SpellId` IN (8178, 38857); diff --git a/sql/updates/world/3.3.5/2016_10_05_03_world.sql b/sql/updates/world/4.3.4/2017_05_28_00_world_from_335_was_2016_10_05_03_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2016_10_05_03_world.sql rename to sql/updates/world/4.3.4/2017_05_28_00_world_from_335_was_2016_10_05_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_12_15_00_world.sql b/sql/updates/world/4.3.4/2017_05_28_01_world_from_335_was_2016_12_15_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2016_12_15_00_world.sql rename to sql/updates/world/4.3.4/2017_05_28_01_world_from_335_was_2016_12_15_00_world.sql diff --git a/sql/updates/world/4.3.4/2017_05_28_02_world_from_335_was_2016_10_04_06_world.sql b/sql/updates/world/4.3.4/2017_05_28_02_world_from_335_was_2016_10_04_06_world.sql new file mode 100644 index 0000000000..b2d7c1f1df --- /dev/null +++ b/sql/updates/world/4.3.4/2017_05_28_02_world_from_335_was_2016_10_04_06_world.sql @@ -0,0 +1,1055 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (15290, 59725); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 59725, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Improved Spell Reflection (effect 0) will hit the potential target of the spell if target is not the same as condition target.'), +(13, 1, 15290, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Vampiric Embrace (effect 0) will hit the potential target of the spell if target is not the same as condition target.'); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=24 AND `SourceGroup`=0 AND `SourceEntry` IN (38164,70805); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(24, 0, 38164, 0, 0, 31, 1, 3, 19457, 0, 0, 0, 0, '', 'Spell Unyielding Knights can proc on actionTarget if target is unit Grillok "Darkeye".'), +(24, 0, 70805, 0, 0, 33, 1, 0, 0, 0, 1, 0, 0, '', 'Spell Item - Rogue T10 2P Bonus can proc on actionTarget if target is not the same as condition target.'); + +-- Earth shield heal is DAMAGE_CLASS_NONE, it won't scale +-- Entry is unneeded +DELETE FROM `spell_bonus_data` WHERE `entry`=379; + +-- Remove renamed scripts +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_dummy_trigger','spell_pri_item_greater_heal_refund'); + +-- Stop console spam from dummy EFFECT_2 proc +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_pal_seals'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(20375, 'spell_pal_seals'), -- Seal of Command +(21084, 'spell_pal_seals'), -- Seal of Righteousness +(31801, 'spell_pal_seals'), -- Seal of Vengeance +(31892, 'spell_pal_seals'), -- Seal of Blood +(33127, 'spell_pal_seals'), -- Seal of Command +(38008, 'spell_pal_seals'), -- Seal of Blood +(41459, 'spell_pal_seals'), -- Seal of Blood +(53720, 'spell_pal_seals'), -- Seal of the Martyr +(53736, 'spell_pal_seals'); -- Seal of Corruption + +-- Grouped several hacks and handled with AuraScript now +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mage_fingers_of_frost'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(74396, 'spell_mage_fingers_of_frost'); -- Fingers of Frost + +-- Threat of Thassarian triggered spells, for easier script access +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN (59133,66198,66196,66216,66188,66215); +INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES +(66198, 66198, 1), +(66198, 66972, 2), +(66198, 66973, 3), +(66198, 66974, 4), + +(66196, 66196, 1), +(66196, 66958, 2), +(66196, 66959, 3), +(66196, 66960, 4), +(66196, 66961, 5), +(66196, 66962, 6), + +(66216, 66216, 1), +(66216, 66988, 2), +(66216, 66989, 3), +(66216, 66990, 4), +(66216, 66991, 5), +(66216, 66992, 6), + +(66188, 66188, 1), +(66188, 66950, 2), +(66188, 66951, 3), +(66188, 66952, 4), +(66188, 66953, 5), + +(66215, 66215, 1), +(66215, 66975, 2), +(66215, 66976, 3), +(66215, 66977, 4), +(66215, 66978, 5), +(66215, 66979, 6); + +DELETE FROM `command` WHERE `name`='reload spell_proc_event'; + +-- Add spellscripts to spells previously on giant switches in Unit.cpp +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_rog_t10_2p_bonus'; +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_flametongue_weapon','spell_mage_imp_blizzard','spell_warr_deep_wounds_aura','spell_rog_setup','spell_pri_improved_spirit_tap','spell_sha_imp_water_shield','spell_warl_improved_drain_soul','spell_pal_improved_lay_of_hands','spell_pal_heart_of_the_crusader','spell_warl_seed_of_corruption_dummy','spell_mage_magic_absorption','spell_warr_extra_proc','spell_warr_second_wind','spell_warl_soul_leech','spell_sha_lightning_overload','spell_rog_quick_recovery','spell_mage_arcane_potency','spell_mage_empowered_fire','spell_pal_spiritual_attunement','spell_pal_divine_purpose','spell_pal_judgements_of_the_wise','spell_hun_thrill_of_the_hunt','spell_mage_missile_barrage','spell_mage_hot_streak','spell_warr_sword_and_board','spell_pri_imp_shadowform','spell_dk_butchery','spell_item_unstable_power','spell_item_restless_strength','spell_dru_leader_of_the_pack','spell_pri_aq_3p_bonus','spell_item_persistent_shield','spell_dru_revitalize','spell_dk_death_rune','spell_dk_scent_of_blood_trigger','spell_dk_vendetta','spell_dk_sudden_doom','spell_dk_blade_barrier','spell_dk_rime','spell_dk_wandering_plague','spell_sha_astral_shift_aura','spell_dk_necrosis','spell_sha_static_shock','spell_sha_maelstrom_weapon','spell_sha_ancestral_awakening','spell_rog_deadly_brew','spell_rog_turn_the_tables','spell_rog_cut_to_the_chase','spell_pet_guard_dog','spell_hun_rapid_recuperation_trigger','spell_hun_hunting_party','spell_pal_righteous_vengeance','spell_pal_sheath_of_light','spell_pal_infusion_of_light','spell_pal_judgements_of_the_just','spell_mage_burning_determination','spell_warr_improved_spell_reflection','spell_pet_culling_the_herd','spell_pet_silverback','spell_warl_decimation','spell_sha_frozen_power','spell_pri_body_and_soul','spell_dk_threat_of_thassarian','spell_warl_seduction','spell_mage_combustion','spell_pri_vampiric_embrace','spell_dru_omen_of_clarity','spell_item_alchemists_stone','spell_pal_judgement_of_light_heal','spell_pal_judgement_of_wisdom_mana','spell_twisted_reflection','spell_dru_t3_2p_bonus','spell_dru_t3_8p_bonus','spell_dru_t3_6p_bonus','spell_pal_t3_6p_bonus','spell_pri_t3_4p_bonus','spell_sha_t3_6p_bonus','spell_warr_t3_prot_8p_bonus','spell_item_healing_touch_refund','spell_item_totem_of_flowing_water','spell_item_pendant_of_the_violet_eye','spell_sha_shamanistic_rage','spell_pal_seal_of_vengeance','spell_warl_seed_of_corruption_generic','spell_mark_of_malice','spell_item_mark_of_conquest','spell_sha_windfury_weapon','spell_dru_t4_2p_bonus','spell_pri_t5_heal_2p_bonus','spell_anetheron_vampiric_aura','spell_item_frozen_shadoweave','spell_item_aura_of_madness','spell_pri_item_t6_trinket','spell_dru_item_t6_trinket','spell_sha_item_t6_trinket','spell_pal_item_t6_trinket','spell_item_crystal_spire_of_karabor','spell_item_dementia','spell_item_pet_healing','spell_warl_t4_2p_bonus_shadow','spell_warl_t4_2p_bonus_fire','spell_mage_gen_extra_effects','spell_uk_second_wind','spell_item_commendation_of_kaelthas','spell_item_sunwell_exalted_caster_neck','spell_item_sunwell_exalted_melee_neck','spell_item_sunwell_exalted_tank_neck','spell_item_sunwell_exalted_healer_neck','spell_warl_glyph_of_corruption_nightfall','spell_dk_mark_of_blood','spell_dk_dancing_rune_weapon','spell_dk_unholy_blight','spell_dk_hungering_cold','spell_item_soul_harvesters_charm','spell_rog_turn_the_tables_proc','spell_pal_sacred_shield_dummy','spell_warl_demonic_pact','spell_pal_seal_of_corruption','spell_dru_glyph_of_rejuvenation','spell_dru_glyph_of_shred','spell_dru_glyph_of_rake','spell_dru_glyph_of_innervate','spell_dru_glyph_of_starfire_dummy','spell_pal_glyph_of_holy_light_dummy','spell_pal_glyph_of_divinity','spell_sha_tidal_force_dummy','spell_sha_glyph_of_healing_wave','spell_pri_glyph_of_dispel_magic','spell_mage_glyph_of_ice_block','spell_mage_glyph_of_icy_veins','spell_mage_glyph_of_polymorph','spell_rog_glyph_of_backstab','spell_hun_glyph_of_mend_pet','spell_pri_shadowfiend_death','spell_warr_glyph_of_blocking','spell_dk_glyph_of_scourge_strike','spell_sha_spirit_hunt','spell_hun_kill_command_pet','spell_item_swift_hand_justice_dummy','spell_item_discerning_eye_beast_dummy','spell_mage_imp_mana_gems','spell_gen_vampiric_touch','spell_dk_pvp_4p_bonus','spell_dk_glyph_of_death_grip','spell_dru_savage_defense','spell_sha_glyph_of_earth_shield','spell_sha_glyph_of_totem_of_wrath','spell_warl_glyph_of_life_tap','spell_pal_t8_2p_bonus','spell_sha_t8_elemental_4p_bonus','spell_xt002_321_boombot_aura','spell_sha_t9_elemental_4p_bonus','spell_item_purified_shard_of_the_scale','spell_item_shiny_shard_of_the_scale','spell_dru_t10_balance_4p_bonus','spell_dru_t10_restoration_4p_bonus_dummy','spell_pri_t10_heal_2p_bonus','spell_sha_t10_restoration_4p_bonus','spell_sha_t10_elemental_4p_bonus','spell_warr_item_t10_prot_4p_bonus','spell_item_tiny_abomination_in_a_jar','spell_item_tiny_abomination_in_a_jar_hero','spell_item_deadly_precision_dummy','spell_item_deadly_precision','spell_item_heartpierce','spell_item_heartpierce_hero','spell_item_deathbringers_will_normal','spell_item_deathbringers_will_heroic','spell_item_corpse_tongue_coin','spell_item_corpse_tongue_coin_heroic','spell_putricide_ooze_tank_protection','spell_deathbringer_blood_beast_blood_link','spell_item_petrified_twilight_scale','spell_item_petrified_twilight_scale_heroic'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-10400, 'spell_sha_flametongue_weapon'), +(-11185, 'spell_mage_imp_blizzard'), +(-12834, 'spell_warr_deep_wounds_aura'), +(-13983, 'spell_rog_setup'), +(-15337, 'spell_pri_improved_spirit_tap'), +(-16180, 'spell_sha_imp_water_shield'), +(-18213, 'spell_warl_improved_drain_soul'), +(-20234, 'spell_pal_improved_lay_of_hands'), +(-20335, 'spell_pal_heart_of_the_crusader'), +(-27243, 'spell_warl_seed_of_corruption_dummy'), +(-29441, 'spell_mage_magic_absorption'), + +(-29723, 'spell_warr_extra_proc'), +(-46913, 'spell_warr_extra_proc'), + +(-29834, 'spell_warr_second_wind'), +(-30293, 'spell_warl_soul_leech'), +(-30675, 'spell_sha_lightning_overload'), +(-31244, 'spell_rog_quick_recovery'), +(-31571, 'spell_mage_arcane_potency'), +(-31656, 'spell_mage_empowered_fire'), +(-31785, 'spell_pal_spiritual_attunement'), +(-31871, 'spell_pal_divine_purpose'), +(-31876, 'spell_pal_judgements_of_the_wise'), +(-34497, 'spell_hun_thrill_of_the_hunt'), +(-44404, 'spell_mage_missile_barrage'), +(-44445, 'spell_mage_hot_streak'), +(-46951, 'spell_warr_sword_and_board'), +(-47569, 'spell_pri_imp_shadowform'), +(-48979, 'spell_dk_butchery'), +(-48539, 'spell_dru_revitalize'), + +(-49208, 'spell_dk_death_rune'), +(-49467, 'spell_dk_death_rune'), +(-54639, 'spell_dk_death_rune'), + +(-49004, 'spell_dk_scent_of_blood_trigger'), +(-49015, 'spell_dk_vendetta'), +(-49018, 'spell_dk_sudden_doom'), +(-49182, 'spell_dk_blade_barrier'), +(-49188, 'spell_dk_rime'), +(-49217, 'spell_dk_wandering_plague'), +(-51474, 'spell_sha_astral_shift_aura'), +(-51459, 'spell_dk_necrosis'), +(-51525, 'spell_sha_static_shock'), +(-51556, 'spell_sha_ancestral_awakening'), +(-51625, 'spell_rog_deadly_brew'), +(-51627, 'spell_rog_turn_the_tables'), +(-51664, 'spell_rog_cut_to_the_chase'), +(-53178, 'spell_pet_guard_dog'), +(-53228, 'spell_hun_rapid_recuperation_trigger'), +(-53290, 'spell_hun_hunting_party'), +(-53380, 'spell_pal_righteous_vengeance'), +(-53501, 'spell_pal_sheath_of_light'), +(-53569, 'spell_pal_infusion_of_light'), +(-53695, 'spell_pal_judgements_of_the_just'), +(-54747, 'spell_mage_burning_determination'), +(-59088, 'spell_warr_improved_spell_reflection'), +(-61680, 'spell_pet_culling_the_herd'), +(-62764, 'spell_pet_silverback'), +(-63156, 'spell_warl_decimation'), +(-63373, 'spell_sha_frozen_power'), +(-64127, 'spell_pri_body_and_soul'), +(-65661, 'spell_dk_threat_of_thassarian'), +(6358, 'spell_warl_seduction'), +(11129, 'spell_mage_combustion'), +(15286, 'spell_pri_vampiric_embrace'), +(16864, 'spell_dru_omen_of_clarity'), +(17619, 'spell_item_alchemists_stone'), +(20185, 'spell_pal_judgement_of_light_heal'), +(20186, 'spell_pal_judgement_of_wisdom_mana'), +(21063, 'spell_twisted_reflection'), +(24658, 'spell_item_unstable_power'), +(24661, 'spell_item_restless_strength'), +(24932, 'spell_dru_leader_of_the_pack'), +(26169, 'spell_pri_aq_3p_bonus'), +(26467, 'spell_item_persistent_shield'), +(28716, 'spell_dru_t3_2p_bonus'), +(28719, 'spell_dru_t3_8p_bonus'), +(28744, 'spell_dru_t3_6p_bonus'), +(28789, 'spell_pal_t3_6p_bonus'), +(28809, 'spell_pri_t3_4p_bonus'), +(28823, 'spell_sha_t3_6p_bonus'), +(28845, 'spell_warr_t3_prot_8p_bonus'), +(28847, 'spell_item_healing_touch_refund'), +(28849, 'spell_item_totem_of_flowing_water'), +(29601, 'spell_item_pendant_of_the_violet_eye'), +(30823, 'spell_sha_shamanistic_rage'), +(31801, 'spell_pal_seal_of_vengeance'), + +(32863, 'spell_warl_seed_of_corruption_generic'), +(36123, 'spell_warl_seed_of_corruption_generic'), +(38252, 'spell_warl_seed_of_corruption_generic'), +(39367, 'spell_warl_seed_of_corruption_generic'), +(44141, 'spell_warl_seed_of_corruption_generic'), +(70388, 'spell_warl_seed_of_corruption_generic'), + +(33493, 'spell_mark_of_malice'), +(33510, 'spell_item_mark_of_conquest'), +(33757, 'spell_sha_windfury_weapon'), +(37288, 'spell_dru_t4_2p_bonus'), +(37295, 'spell_dru_t4_2p_bonus'), +(37594, 'spell_pri_t5_heal_2p_bonus'), +(38196, 'spell_anetheron_vampiric_aura'), +(39372, 'spell_item_frozen_shadoweave'), +(39446, 'spell_item_aura_of_madness'), +(40438, 'spell_pri_item_t6_trinket'), +(40442, 'spell_dru_item_t6_trinket'), +(40463, 'spell_sha_item_t6_trinket'), +(40470, 'spell_pal_item_t6_trinket'), +(40971, 'spell_item_crystal_spire_of_karabor'), +(41404, 'spell_item_dementia'), + +(37381, 'spell_item_pet_healing'), + +(37377, 'spell_warl_t4_2p_bonus_shadow'), +(39437, 'spell_warl_t4_2p_bonus_fire'), + +(44401, 'spell_mage_gen_extra_effects'), +(48108, 'spell_mage_gen_extra_effects'), +(57761, 'spell_mage_gen_extra_effects'), + +(42770, 'spell_uk_second_wind'), +(45057, 'spell_item_commendation_of_kaelthas'), +(45481, 'spell_item_sunwell_exalted_caster_neck'), +(45482, 'spell_item_sunwell_exalted_melee_neck'), +(45483, 'spell_item_sunwell_exalted_tank_neck'), +(45484, 'spell_item_sunwell_exalted_healer_neck'), + +(-18094, 'spell_warl_glyph_of_corruption_nightfall'), +(56218, 'spell_warl_glyph_of_corruption_nightfall'), + +(49005, 'spell_dk_mark_of_blood'), +(49028, 'spell_dk_dancing_rune_weapon'), +(49194, 'spell_dk_unholy_blight'), +(51209, 'spell_dk_hungering_cold'), +(52420, 'spell_item_soul_harvesters_charm'), + +(52910, 'spell_rog_turn_the_tables_proc'), +(52914, 'spell_rog_turn_the_tables_proc'), +(52915, 'spell_rog_turn_the_tables_proc'), + +(53601, 'spell_pal_sacred_shield_dummy'), + +(53646, 'spell_warl_demonic_pact'), +(54909, 'spell_warl_demonic_pact'), + +(53736, 'spell_pal_seal_of_corruption'), +(53817, 'spell_sha_maelstrom_weapon'), +(54748, 'spell_mage_burning_determination'), +(54754, 'spell_dru_glyph_of_rejuvenation'), +(54815, 'spell_dru_glyph_of_shred'), +(54821, 'spell_dru_glyph_of_rake'), +(54832, 'spell_dru_glyph_of_innervate'), +(54845, 'spell_dru_glyph_of_starfire_dummy'), +(54937, 'spell_pal_glyph_of_holy_light_dummy'), +(54939, 'spell_pal_glyph_of_divinity'), +(55198, 'spell_sha_tidal_force_dummy'), +(55440, 'spell_sha_glyph_of_healing_wave'), +(55677, 'spell_pri_glyph_of_dispel_magic'), +(56372, 'spell_mage_glyph_of_ice_block'), +(56374, 'spell_mage_glyph_of_icy_veins'), +(56375, 'spell_mage_glyph_of_polymorph'), +(56800, 'spell_rog_glyph_of_backstab'), +(57870, 'spell_hun_glyph_of_mend_pet'), +(57989, 'spell_pri_shadowfiend_death'), +(58375, 'spell_warr_glyph_of_blocking'), +(58642, 'spell_dk_glyph_of_scourge_strike'), +(58877, 'spell_sha_spirit_hunt'), +(58914, 'spell_hun_kill_command_pet'), +(59906, 'spell_item_swift_hand_justice_dummy'), +(59915, 'spell_item_discerning_eye_beast_dummy'), + +(37447, 'spell_mage_imp_mana_gems'), +(61062, 'spell_mage_imp_mana_gems'), + +(52723, 'spell_gen_vampiric_touch'), +(60501, 'spell_gen_vampiric_touch'), +(61257, 'spell_dk_pvp_4p_bonus'), +(62259, 'spell_dk_glyph_of_death_grip'), +(62600, 'spell_dru_savage_defense'), +(63279, 'spell_sha_glyph_of_earth_shield'), +(63280, 'spell_sha_glyph_of_totem_of_wrath'), +(63320, 'spell_warl_glyph_of_life_tap'), +(64890, 'spell_pal_t8_2p_bonus'), +(64928, 'spell_sha_t8_elemental_4p_bonus'), +(65032, 'spell_xt002_321_boombot_aura'), +(67228, 'spell_sha_t9_elemental_4p_bonus'), +(69755, 'spell_item_purified_shard_of_the_scale'), +(69739, 'spell_item_shiny_shard_of_the_scale'), +(70723, 'spell_dru_t10_balance_4p_bonus'), +(70664, 'spell_dru_t10_restoration_4p_bonus_dummy'), +(70770, 'spell_pri_t10_heal_2p_bonus'), +(70808, 'spell_sha_t10_restoration_4p_bonus'), +(70817, 'spell_sha_t10_elemental_4p_bonus'), +(70844, 'spell_warr_item_t10_prot_4p_bonus'), + +(71406, 'spell_item_tiny_abomination_in_a_jar'), +(71545, 'spell_item_tiny_abomination_in_a_jar_hero'), + +(71563, 'spell_item_deadly_precision_dummy'), +(71564, 'spell_item_deadly_precision'), + +(71880, 'spell_item_heartpierce'), +(71892, 'spell_item_heartpierce_hero'), + +(71519, 'spell_item_deathbringers_will_normal'), +(71562, 'spell_item_deathbringers_will_heroic'), + +(71634, 'spell_item_corpse_tongue_coin'), +(71640, 'spell_item_corpse_tongue_coin_heroic'), + +(71770, 'spell_putricide_ooze_tank_protection'), +(72176, 'spell_deathbringer_blood_beast_blood_link'), + +(75475, 'spell_item_petrified_twilight_scale'), +(75481, 'spell_item_petrified_twilight_scale_heroic'); + +-- New proc table data +DELETE FROM `spell_proc` WHERE `SpellId` IN (-65661,-64127,-63730,-63373,-63156,-62764,-61680,-57878,-57470,-56636,-56342,-55666,-54747,-53709,-53695,-53671,-53569,-53551,-53486,-53380,-53290,-53256,-53234,-53228,-53221,-53178,-52795,-52127,-51692,-51682,-51672,-51664,-51627,-51625,-51562,-51556,-51525,-51523,-51474,-51459,-49219,-49188,-49182,-49149,-49027,-49018,-49004,-48979,-48539,-48516,-48506,-48496,-48483,-47580,-47569,-47516,-47509,-47263,-47258,-47245,-47230,-47201,-47195,-46951,-46945,-46913,-46867,-45234,-44546,-44449,-44445,-44404,-41635,-35541,-35100,-34950,-34935,-34914,-34753,-34497,-33881,-33191,-33142,-33076,-32385,-31876,-31656,-31571,-31569,-31244,-31124,-30881,-30675,-30482,-30299,-30293,-30160,-29834,-29723,-29593,-29441,-29074,-27811,-27243,-20925,-20234,-20177,-20049,-19572,-19184,-18119,-18094,-17793,-17106,-16958,-16952,-16880,-16487,-16257,-16256,-16180,-16176,-14892,-14186,-14156,-13983,-13754,-13165,-12966,-12834,-12319,-12317,-12311,-12298,-12289,-11255,-11213,-11185,-11180,-11119,-11103,-11095,-10400,-9799,-7302,-7001,-5952,-1463,-1120,-974,-324,1719,5118,6346,7383,7434,9782,9784,11129,12043,12169,12322,12328,12536,13159,13234,15088,15128,15277,15286,15346,15600,16164,16166,16246,16550,16620,16624,16864,16870,17116,17364,17495,17619,17670,17941,18708,18820,20128,20131,20132,20164,20165,20705,20784,20911,21185,21882,21890,22007,22008,22618,22648,23547,23548,23551,23552,23572,23578,23581,23686,23688,23689,23721,23920,24353,24389,24658,24905,24932,25050,25669,26107,26119,26128,26135,26169,26467,26480,26605,27419,27498,27521,27656,27774,27787,28200,28305,28716,28719,28744,28752,28789,28802,28809,28812,28816,28823,28845,28847,28849,29150,29385,29455,29501,29601,29624,29625,29626,29632,29633,29634,29635,29636,29637,29977,30003,30823,30937,31394,31794,31801,31904,32216,32409,32587,32642,32734,32748,32776,32777,32837,32844,32863,32885,33089,33127,33297,33299,33510,33648,33719,33746,33757,33759,33953,34080,34138,34139,34258,34262,34320,34355,34477,34584,34586,34598,34749,34774,34783,34827,34936,35077,35080,35083,35086,35121,36032,36096,36111,36123,36541,37165,37168,37170,37173,37189,37193,37195,37197,37213,37214,37227,37237,37247,37288,37295,37377,37379,37381,37384,37443,37447,37514,37516,37519,37523,37528,37536,37568,37594,37600,37601,37603,37655,37657,38026,38031,38164,38252,38290,38299,38326,38327,38334,38347,38350,38394,39027,39367,39372,39437,39442,39443,39530,39958,40407,40438,40442,40444,40458,40463,40470,40475,40478,40482,40485,40899,40971,41034,41260,41262,41350,41381,41393,41434,41469,41989,42083,42135,42136,42368,42370,42770,43443,43726,43728,43737,43739,43741,43745,43748,43750,43819,44141,44543,44545,45054,45057,45354,45355,45469,45481,45482,45483,45484,46025,46092,46098,46569,46662,46832,46910,46916,47383,47981,48108,48504,48833,48835,48837,49028,49194,49222,49592,49622,50240,50421,50781,50908,51123,51124,51127,51128,51346,51349,51352,51359,51414,51528,51529,51530,51698,51700,51701,51915,52020,52420,52423,52437,52898,53257,53386,53397,53646,53651,53817,54274,54276,54277,54278,54646,54695,54707,54738,54741,54754,54808,54815,54821,54832,54838,54841,54845,54925,54937,54939,55198,55380,55381,55440,55640,55677,55680,55681,55689,55747,55768,55776,56218,56249,56355,56364,56372,56374,56375,56451,56800,56816,56817,56821,56841,57345,57351,57352,57529,57531,57761,57870,57907,57989,58357,58364,58372,58375,58386,58442,58444,58501,58616,58620,58626,58642,58677,58877,58901,59176,59327,59345,59630,59725,59906,59915,60061,60063,60066,60132,60170,60172,60176,60221,60301,60306,60317,60436,60442,60473,60482,60487,60490,60493,60503,60519,60524,60529,60537,60564,60571,60572,60573,60574,60575,60710,60717,60719,60722,60724,60726,60770,60818,60826,61062,61188,61257,61324,61356,61618,62114,62115,62147,62259,62459,62600,62606,63057,63086,63108,63251,63279,63280,63310,63320,63335,63611,64343,64411,64415,64440,64571,64714,64738,64742,64752,64786,64792,64823,64824,64860,64867,64882,64890,64908,64912,64914,64928,64938,64952,64955,64964,64976,64999,65002,65005,65007,65013,65020,65025,65032,66808,67115,67151,67209,67228,67353,67356,67361,67363,67365,67379,67381,67384,67386,67389,67392,67653,67667,67670,67672,67698,67702,67712,67752,67758,67771,68160,69739,69755,69762,70188,70388,70652,70664,70672,70723,70727,70730,70748,70756,70761,70770,70803,70805,70807,70808,70811,70817,70830,70841,70844,70854,71162,71165,71174,71176,71178,71186,71191,71194,71198,71214,71217,71226,71228,71402,71404,71406,71519,71540,71545,71562,71564,71571,71573,71585,71602,71606,71611,71634,71637,71640,71642,71645,71756,71761,71770,71865,71868,71880,71892,71903,72059,72176,72413,72417,72419,72455,72782,72783,72784,72832,72833,75455,75457,75465,75474,75475,75481,75490,75495); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(41350, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(72059, 0, 0, 0, 0, 0, 0, 1, 0, 1027, 2, 0, 0, 0, 0), +(57351, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(17941, 0, 5, 1, 0, 0, 65536, 1, 1, 0, 8, 0, 0, 0, 1), +(18820, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 1), +(22008, 0, 3, 1631584309, 0, 0, 69632, 5, 1, 0, 0, 0, 0, 0, 1), +(28200, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 6), +(-7001, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0), +(32216, 0, 4, 0, 256, 0, 16, 1, 4, 0, 0, 0, 0, 0, 1), +(34477, 0, 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 1), +(34936, 0, 5, 1, 64, 0, 65536, 1, 1, 0, 8, 0, 0, 0, 1), +(48108, 0, 3, 4194304, 0, 0, 65536, 1, 1, 0, 8, 0, 0, 0, 1), +(51124, 0, 15, 2, 6, 0, 65552, 1, 4, 0, 8, 0, 0, 0, 1), +(54741, 0, 3, 4, 0, 0, 65536, 5, 1, 0, 0, 0, 0, 0, 1), +(57761, 0, 3, 1, 4096, 0, 65536, 1, 1, 0, 8, 0, 0, 0, 1), +(64823, 0, 7, 4, 0, 0, 65536, 1, 1, 0, 0, 0, 0, 0, 1), +(-974, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3000, 0), +(-1463, 0, 3, 0, 0, 0, 0, 1, 0, 1024, 0, 0, 0, 0, 0), +(-10400, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-11119, 4, 3, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-11185, 0, 3, 128, 0, 0, 65536, 1, 2, 0, 2, 0, 0, 0, 0), +(-12834, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-13983, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 1000, 0), +(-14156, 0, 8, 4063232, 9, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0), +(-16180, 0, 11, 448, 0, 16, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(-18094, 0, 5, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-47230, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(-20234, 0, 10, 32768, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(-27243, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(-29441, 0, 3, 0, 0, 0, 0, 7, 0, 8, 0, 0, 0, 1000, 0), +(-29723, 0, 4, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-29834, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0), +(-30293, 0, 5, 385, 8519872, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-30675, 0, 11, 3, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-31244, 0, 8, 3801088, 9, 0, 0, 5, 2, 11196, 0, 0, 0, 0, 0), +(-31571, 0, 3, 0, 34, 0, 16384, 7, 4, 0, 2, 0, 0, 0, 0), +(-31656, 4, 3, 134217728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-31876, 0, 10, 8388608, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-34497, 0, 9, 395264, 8388609, 513, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-34914, 0, 6, 8192, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(-44404, 0, 3, 536870945, 36864, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-44445, 0, 3, 19, 69632, 0, 0, 1, 2, 0, 32, 0, 0, 0, 0), +(-44546, 0, 3, 736, 4096, 0, 69632, 0, 2, 0, 0, 0, 0, 0, 0), +(-46913, 0, 4, 64, 1028, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-46951, 0, 4, 1024, 64, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-47569, 0, 6, 16384, 0, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(-48539, 0, 7, 16, 67108864, 0, 262144, 2, 0, 0, 0, 0, 0, 0, 0), +(-48979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), +(-49018, 0, 15, 20971520, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-49182, 0, 15, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-49188, 0, 15, 0, 131072, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-51459, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0), +(-51474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-51525, 0, 11, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-51556, 0, 11, 192, 0, 16, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(-51625, 0, 8, 268476416, 0, 0, 0, 5, 2, 0, 2, 0, 0, 0, 0), +(-51627, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 0), +(-51664, 0, 8, 131072, 8, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-53178, 0, 9, 0, 268435456, 0, 65536, 4, 2, 0, 0, 0, 100, 0, 0), +(-53228, 0, 9, 32, 16777216, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0), +(-53290, 0, 9, 2048, 1, 512, 0, 1, 2, 2, 2, 0, 0, 0, 0), +(-53380, 0, 10, 8388608, 163840, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-53569, 0, 10, 1075838976, 65536, 0, 0, 3, 2, 0, 2, 0, 0, 0, 0), +(-53695, 0, 10, 8388608, 0, 8, 16, 5, 2, 0, 2, 0, 0, 0, 0), +(-54747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-61680, 0, 9, 0, 268435456, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-62764, 0, 9, 0, 268435456, 0, 65536, 4, 2, 0, 0, 0, 100, 0, 0), +(-63156, 0, 5, 1, 192, 0, 0, 1, 2, 0, 32, 0, 0, 0, 0), +(-63373, 0, 11, 2147483648, 0, 0, 65536, 1, 2, 0, 0, 0, 0, 0, 0), +(-64127, 0, 6, 1, 1, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0), +(-65661, 0, 15, 4194321, 537001988, 0, 16, 1, 2, 0, 0, 0, 100, 0, 0), +(1719, 0, 4, 778044484, 4212549, 0, 0, 1, 2, 0, 8, 0, 0, 0, 0), +(11129, 4, 3, 146800663, 200776, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(12536, 0, 3, 549591799, 168000, 0, 0, 0, 1, 0, 12, 0, 0, 0, 0), +(15286, 32, 6, 41984016, 9218, 8, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(16246, 0, 11, 2551185859, 5120, 16, 0, 0, 1, 0, 12, 0, 0, 0, 0), +(16864, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0), +(16870, 0, 7, 14924799, 126879699, 263168, 0, 0, 1, 0, 12, 0, 0, 0, 0), +(17619, 0, 13, 0, 0, 0, 32768, 7, 0, 0, 0, 0, 0, 0, 0), +(22007, 0, 3, 2097185, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(24658, 0, 0, 0, 0, 0, 87376, 7, 2, 0, 0, 0, 0, 0, 0), +(24932, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(26169, 0, 6, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(26467, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(28716, 0, 7, 16, 0, 0, 262144, 2, 0, 0, 0, 0, 0, 0, 0), +(28719, 0, 7, 32, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(28744, 0, 7, 64, 0, 0, 278528, 2, 2, 0, 0, 0, 0, 0, 0), +(28789, 0, 10, 3221225472, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(28809, 0, 6, 4096, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(28823, 0, 11, 192, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(28845, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(28847, 0, 7, 32, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(28849, 0, 11, 128, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(29601, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0), +(32863, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(36123, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(38252, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(39367, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(44141, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(70388, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(30823, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 10, 0, 0, 0), +(31801, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(32409, 0, 0, 0, 8192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(33757, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 3000, 0), +(37288, 0, 7, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(37295, 0, 7, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(37381, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(37377, 32, 5, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(39437, 4, 5, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(37168, 0, 8, 4063232, 9, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0), +(37594, 0, 6, 4096, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(38164, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(39372, 48, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(40438, 0, 6, 32832, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0), +(40442, 0, 7, 20, 1088, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0), +(40463, 0, 11, 129, 16, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0), +(40470, 0, 10, 3229614080, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0), +(40971, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(42770, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0), +(45057, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(46916, 0, 4, 2097152, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0), +(47383, 0, 5, 0, 192, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(71162, 0, 5, 0, 192, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(71165, 0, 5, 0, 192, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(49028, 0, 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0), +(49194, 0, 15, 0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(49222, 0, 0, 0, 0, 0, 139944, 1, 0, 0, 0, 0, 0, 2000, 0), +(51528, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 4, 0, 0, 0), +(51529, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 8, 0, 0, 0), +(51530, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 12, 0, 0, 0), +(51698, 0, 0, 0, 0, 0, 0, 3, 4, 2, 0, 0, 33, 0, 0), +(51700, 0, 0, 0, 0, 0, 0, 3, 4, 2, 0, 0, 66, 0, 0), +(51701, 0, 0, 0, 0, 0, 0, 3, 4, 2, 0, 0, 100, 0, 0), +(52420, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(52437, 1, 4, 536870912, 0, 0, 16, 0, 4, 0, 0, 0, 0, 0, 0), +(53646, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(54274, 0, 5, 357, 200896, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(54276, 0, 5, 357, 200896, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(54277, 0, 5, 357, 200896, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(54754, 0, 7, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0), +(54815, 0, 7, 32768, 0, 0, 16, 1, 2, 0, 0, 0, 0, 0, 0), +(54821, 0, 7, 4096, 0, 0, 16, 1, 2, 0, 0, 0, 0, 0, 0), +(54832, 0, 7, 0, 4096, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(54845, 0, 7, 4, 0, 0, 65536, 1, 2, 0, 0, 0, 0, 0, 0), +(54937, 0, 10, 2147483648, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(54939, 0, 10, 32768, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(55198, 0, 11, 448, 0, 0, 16384, 2, 2, 2, 0, 0, 0, 0, 3), +(55440, 0, 11, 64, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(55677, 0, 6, 0, 1, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0), +(56218, 0, 5, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(56372, 0, 3, 0, 128, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(56374, 0, 3, 0, 16384, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(56375, 0, 3, 16777216, 0, 0, 65536, 4, 2, 0, 0, 0, 0, 0, 0), +(56800, 0, 8, 4, 0, 0, 16, 1, 2, 0, 0, 0, 0, 0, 0), +(57870, 0, 9, 8388608, 0, 0, 262144, 2, 0, 0, 0, 0, 0, 0, 0), +(58375, 0, 4, 0, 512, 0, 16, 1, 2, 0, 0, 0, 0, 0, 0), +(58642, 0, 15, 0, 134217728, 0, 16, 1, 2, 0, 0, 0, 0, 0, 0), +(58677, 0, 15, 8192, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0), +(58877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(59906, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), +(59915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(37447, 0, 3, 0, 256, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(61062, 0, 3, 0, 256, 0, 16384, 4, 2, 0, 0, 0, 0, 0, 0), +(61257, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0), +(62259, 0, 15, 33554432, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), +(62600, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(62606, 0, 0, 0, 0, 0, 0, 0, 0, 1027, 0, 0, 0, 0, 0), +(63279, 0, 11, 0, 1024, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0), +(63280, 0, 11, 536870912, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0), +(63320, 0, 5, 2147745792, 0, 32768, 1024, 7, 2, 0, 0, 0, 0, 0, 0), +(64890, 0, 10, 0, 65536, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0), +(64928, 0, 11, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(65032, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(67228, 0, 11, 0, 4096, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(69755, 0, 0, 0, 0, 0, 0, 7, 2, 0, 0, 0, 0, 45000, 0), +(69739, 0, 0, 0, 0, 0, 0, 7, 2, 0, 0, 0, 0, 45000, 0), +(69762, 0, 0, 0, 0, 0, 87040, 0, 1, 0, 0, 0, 0, 0, 0), +(70723, 0, 7, 5, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(70664, 0, 7, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0), +(70770, 0, 6, 2048, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(70805, 0, 8, 0, 131072, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0), +(70808, 0, 11, 256, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(70817, 0, 11, 0, 4096, 0, 65536, 1, 2, 0, 0, 0, 0, 0, 0), +(70844, 0, 4, 256, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70672, 0, 0, 0, 0, 0, 0, 0, 0, 12287, 0, 0, 0, 0, 0), +(72455, 0, 0, 0, 0, 0, 0, 0, 0, 12287, 0, 0, 0, 0, 0), +(72832, 0, 0, 0, 0, 0, 0, 0, 0, 12287, 0, 0, 0, 0, 0), +(72833, 0, 0, 0, 0, 0, 0, 0, 0, 12287, 0, 0, 0, 0, 0), +(71756, 4, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(72782, 4, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(72783, 4, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(72784, 4, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(71406, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 50, 0, 0), +(71545, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 50, 0, 0), +(71880, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0), +(71892, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0), +(71519, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 105000, 0), +(71562, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 105000, 0), +(71564, 126, 0, 0, 0, 0, 0, 3, 2, 2, 0, 0, 0, 0, 5), +(71634, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(71640, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(71761, 3, 0, 0, 1048576, 0, 0, 5, 2, 256, 0, 0, 0, 0, 0), +(71770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(72176, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(75475, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 45000, 0), +(75481, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 45000, 0), +(-63730, 0, 6, 2048, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-57878, 0, 0, 0, 0, 0, 0, 1, 0, 16, 0, 0, 0, 0, 0), +(-57470, 0, 6, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 15000, 0), +(-56636, 0, 4, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6000, 0), +(-56342, 0, 9, 24, 134217728, 147456, 0, 0, 4, 0, 2, 0, 0, 0, 0), +(-55666, 0, 15, 1, 134217728, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-53709, 2, 10, 16384, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-53671, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-53551, 0, 10, 4096, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-53486, 0, 10, 8388608, 163840, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0), +(-53256, 0, 9, 2048, 8388609, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-53234, 0, 9, 131072, 1, 1, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-53221, 0, 9, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-52795, 0, 6, 1, 0, 0, 0, 0, 2, 0, 32, 0, 0, 0, 0), +(-52127, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3000, 0), +(-51692, 0, 8, 516, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-51672, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 1000, 0), +(-51562, 0, 11, 256, 0, 16, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-51523, 0, 11, 0, 1, 0, 65536, 0, 2, 0, 0, 0, 50, 0, 0), +(-49219, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0), +(-49149, 0, 15, 6, 131074, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-49027, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 20000, 0), +(-49004, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0), +(-48516, 0, 7, 5, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-48506, 0, 7, 5, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-48496, 0, 7, 96, 33554434, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-48483, 0, 7, 34816, 1088, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-47580, 0, 6, 0, 0, 64, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-47516, 0, 6, 6144, 65536, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(-47509, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(-47263, 32, 5, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 20000, 0), +(-47258, 0, 5, 0, 8388608, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-47245, 0, 5, 2, 0, 0, 262144, 0, 0, 0, 0, 0, 0, 0, 0), +(-47201, 0, 5, 16393, 262144, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-47195, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-46945, 0, 4, 0, 65536, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-46867, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-45234, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-44449, 0, 3, 551686775, 102472, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-41635, 0, 0, 0, 0, 0, 664232, 1, 0, 0, 0, 0, 0, 0, 0), +(-35541, 0, 0, 0, 0, 0, 8388608, 0, 0, 0, 0, 0, 0, 0, 0), +(-35100, 0, 9, 4096, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-34950, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-34935, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8000, 0), +(-34753, 0, 6, 6144, 4, 4096, 0, 0, 2, 2, 2, 0, 0, 0, 0), +(-33881, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-33191, 0, 6, 32768, 1024, 64, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-33142, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-33076, 0, 0, 0, 0, 0, 664232, 1, 0, 0, 0, 0, 0, 0, 0), +(-32385, 0, 5, 1, 262144, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-31569, 0, 3, 65536, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-31124, 0, 8, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-30881, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(-30299, 126, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(-30160, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-29593, 0, 0, 0, 0, 0, 0, 1, 0, 112, 0, 0, 0, 0, 0), +(-29074, 20, 3, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-27811, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-20925, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(-20177, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(-20049, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-19572, 0, 9, 8388608, 0, 0, 262144, 2, 0, 0, 0, 0, 0, 0, 0), +(-19184, 0, 9, 16, 8192, 0, 0, 0, 4, 0, 2, 0, 0, 0, 0), +(-18119, 0, 5, 0, 8388608, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-17793, 0, 5, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-17106, 0, 7, 524288, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-16958, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-16952, 0, 7, 233472, 1024, 262144, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-16880, 72, 7, 103, 58720258, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(-16487, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-16257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-16256, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-16176, 0, 11, 448, 0, 16, 0, 2, 2, 2, 0, 0, 0, 0, 0), +(-14892, 0, 6, 268443136, 65540, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0), +(-14186, 0, 8, 1107296782, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0), +(-13754, 0, 8, 16, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-13165, 0, 0, 0, 0, 0, 64, 0, 2, 0, 0, 0, 0, 0, 0), +(-12966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(-12319, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(-12311, 0, 4, 2048, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-12298, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 0), +(-12289, 0, 4, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-11255, 0, 3, 16384, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-11213, 0, 3, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(-11180, 16, 3, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-11095, 0, 3, 16, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-9799, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(-5952, 0, 8, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(-324, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3000, 0), +(6346, 0, 0, 0, 0, 0, 0, 0, 0, 256, 0, 0, 0, 0, 0), +(7383, 1, 0, 0, 0, 0, 0, 1, 0, 256, 0, 0, 0, 0, 0), +(7434, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(9782, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(9784, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(12169, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(12322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0), +(15088, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0), +(15128, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(15277, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(15346, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(15600, 0, 0, 0, 0, 0, 0, 1, 2, 0, 128, 0, 2, 0, 0), +(16164, 28, 11, 0, 0, 0, 65536, 1, 2, 2, 0, 0, 0, 0, 0), +(16550, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0), +(16620, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 30000, 0), +(16624, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(17364, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(17495, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(20128, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(20131, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(20132, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(20164, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 5, 0, 0, 0), +(20165, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 20, 0, 0, 0), +(20705, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0), +(20784, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(20911, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 0), +(21185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(21882, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0), +(21890, 0, 4, 712396527, 876, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(22618, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(22648, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0), +(23547, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0), +(23548, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(23551, 0, 11, 192, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(23552, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3000, 0), +(23572, 0, 11, 192, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(23578, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0), +(23581, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0), +(23686, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0), +(23688, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(23689, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 4, 0, 0, 0), +(23721, 0, 9, 2048, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(23920, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(24353, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(24389, 4, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(24905, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 15, 0, 0, 0), +(25050, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(25669, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0), +(26107, 0, 7, 8388608, 268435584, 0, 0, 0, 2, 116, 0, 0, 0, 0, 0), +(26119, 0, 10, 2416967683, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(26128, 0, 0, 0, 0, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0), +(26135, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(26480, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(26605, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 0, 0, 0, 0), +(27419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0), +(27498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0), +(27521, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 15000, 0), +(27656, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(27774, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(27787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0), +(28305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(28752, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(28802, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(28812, 0, 8, 33554438, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(28816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0), +(29150, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1000, 0), +(29455, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(29501, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29624, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29625, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29626, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29632, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29633, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29634, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29635, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29636, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29637, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(29977, 4, 3, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(30003, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(30937, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(31394, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(31794, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(31904, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(32587, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(32642, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(32734, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3000, 0), +(32748, 0, 8, 0, 1, 0, 320, 0, 2, 0, 0, 0, 0, 0, 0), +(32776, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(32777, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(32837, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(32844, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0), +(32885, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(33089, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(33127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1000, 0), +(33297, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(33299, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(33510, 0, 0, 0, 0, 0, 340, 1, 2, 0, 0, 3, 0, 0, 0), +(33648, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(33719, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(33746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(33759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(33953, 0, 0, 0, 0, 0, 279552, 2, 2, 0, 0, 0, 0, 45000, 0), +(34080, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0), +(34138, 0, 11, 128, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(34139, 0, 10, 1073741824, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(34258, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(34262, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(34320, 0, 0, 0, 0, 0, 0, 3, 2, 2, 0, 0, 0, 45000, 0), +(34355, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3000, 0), +(34584, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 30000, 0), +(34586, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1.5, 0, 0, 0), +(34598, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(34749, 0, 0, 0, 0, 0, 0, 0, 2, 8, 2, 0, 0, 0, 0), +(34774, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1.5, 0, 20000, 0), +(34783, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(34827, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 0, 0, 3000, 0), +(35077, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 55000, 0), +(35080, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 55000, 0), +(35083, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 55000, 0), +(35086, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 55000, 0), +(35121, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(36032, 0, 3, 4096, 32768, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(36096, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(36111, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(36541, 4, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0), +(37165, 0, 8, 2098176, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37170, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0), +(37173, 0, 8, 750519704, 262, 0, 0, 0, 2, 0, 0, 0, 0, 25000, 0), +(37189, 0, 10, 3221225472, 0, 0, 0, 0, 2, 2, 0, 0, 0, 60000, 0), +(37193, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(37195, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(37197, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(37213, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(37214, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(37227, 0, 11, 448, 0, 0, 0, 0, 2, 2, 0, 0, 0, 60000, 0), +(37237, 0, 11, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(37247, 8, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(37379, 32, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37384, 0, 5, 1, 64, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37443, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(37514, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0), +(37516, 0, 4, 1024, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37519, 0, 0, 0, 0, 0, 0, 0, 2, 48, 0, 0, 0, 0, 0), +(37523, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(37528, 0, 4, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37536, 0, 4, 65536, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37568, 0, 6, 2048, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(37600, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(37601, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(37603, 0, 6, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(37655, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 60000, 0), +(37657, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2500, 0), +(38026, 1, 0, 0, 0, 0, 0, 1, 0, 256, 0, 0, 0, 0, 0), +(38031, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(38290, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1.6, 0, 0, 0), +(38299, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 12000, 0), +(38326, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(38327, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(38334, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 60000, 0), +(38347, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 45000, 0), +(38350, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(38394, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(48504, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0), +(39027, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3000, 0), +(39442, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0), +(39443, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(39530, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(39958, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0.7, 0, 40000, 0), +(40407, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(40444, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(40458, 0, 4, 33554432, 1537, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(40475, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0), +(40478, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(40482, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(40485, 0, 9, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(40899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), +(41034, 126, 0, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0, 0, 0), +(41260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(41262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(41381, 0, 0, 0, 0, 0, 0, 1, 0, 256, 0, 0, 0, 0, 0), +(41393, 0, 0, 0, 0, 0, 0, 1, 0, 32, 0, 0, 0, 0, 0), +(41434, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 45000, 0), +(41469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1000, 0), +(41989, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0.5, 0, 0, 0), +(42083, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(42135, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 90000, 0), +(42136, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 90000, 0), +(42368, 0, 10, 1073741824, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(42370, 0, 11, 128, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43443, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(43726, 0, 10, 1073741824, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43728, 0, 11, 128, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43737, 0, 7, 0, 1088, 0, 0, 0, 2, 0, 0, 0, 0, 10000, 0), +(43739, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43741, 0, 10, 2147483648, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43745, 0, 10, 0, 512, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43748, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43750, 0, 11, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(43819, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(44543, 0, 3, 1049120, 4096, 0, 0, 0, 2, 0, 0, 0, 7, 0, 0), +(44545, 0, 3, 1049120, 4096, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0), +(45054, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15000, 0), +(45354, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(45355, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(45469, 0, 15, 16, 0, 0, 16, 0, 2, 0, 0, 0, 0, 0, 0), +(45481, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(45482, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(45483, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(45484, 0, 0, 0, 0, 0, 16384, 2, 2, 0, 0, 0, 0, 45000, 0), +(46025, 32, 6, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(46092, 0, 10, 1073741824, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(46098, 0, 11, 128, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(46569, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(46662, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 20000, 0), +(46832, 0, 7, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(46910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5.5, 0, 0, 0), +(47981, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(48833, 0, 7, 0, 1088, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(48835, 0, 10, 8388608, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0), +(48837, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(49592, 0, 0, 0, 0, 0, 8528552, 1, 0, 0, 0, 0, 0, 0, 0), +(49622, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 60000, 0), +(50240, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0), +(50421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(50781, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 6000, 0), +(51123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), +(51127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0), +(51128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0), +(51346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(51349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(51352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(51359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10000, 0), +(51414, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 45000, 0), +(51915, 0, 0, 0, 0, 0, 16777216, 0, 0, 0, 0, 0, 100, 600000, 0), +(52020, 0, 7, 32768, 1048576, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(52423, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0), +(52898, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(53386, 0, 15, 2182250279, 447, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(53397, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(54278, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(54646, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0), +(54695, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(54707, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 60000, 0), +(54738, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 45000, 0), +(54808, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 60000, 0), +(54838, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(54841, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2500, 0), +(54925, 2, 10, 0, 512, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(55380, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0.7, 0, 40000, 0), +(55381, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 15000, 0), +(55640, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(55680, 0, 6, 512, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(55681, 0, 6, 32768, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(55689, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 0, 0, 0, 0), +(55747, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(55768, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(55776, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(56249, 0, 5, 0, 0, 1024, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(56355, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0), +(56364, 0, 3, 0, 16777216, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(56451, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3000, 0), +(56816, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0), +(56817, 0, 15, 0, 536870912, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(56821, 0, 8, 2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(56841, 0, 9, 2048, 0, 0, 256, 0, 2, 0, 0, 0, 0, 0, 0), +(57345, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 45000, 0), +(57352, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(57907, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(57989, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(58357, 0, 4, 64, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(58364, 0, 4, 1024, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(58372, 0, 4, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(58386, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 0, 0, 0), +(58442, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 15000, 0), +(58444, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 5000, 0), +(58616, 0, 15, 16777216, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(58620, 0, 15, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(58626, 0, 15, 33554432, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(58901, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(59176, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0), +(59327, 0, 15, 134217728, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(59345, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(59630, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 35000, 0), +(59725, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 0, 0), +(60061, 0, 0, 0, 0, 0, 294912, 2, 0, 0, 0, 0, 0, 45000, 0), +(60063, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60066, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(60132, 0, 15, 16, 134348800, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60170, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(60172, 0, 5, 262144, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60176, 0, 4, 32, 16, 0, 262144, 0, 0, 0, 0, 0, 0, 0, 0), +(60221, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 45000, 0), +(60301, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60306, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60317, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60436, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60442, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60473, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 45000, 0), +(60482, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(60487, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15000, 0), +(60490, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(60493, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(60503, 1, 4, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60519, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 45000, 0), +(60524, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60529, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 45000, 0), +(60537, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 45000, 0), +(60564, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60571, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60572, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60573, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60574, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60575, 0, 11, 2416967680, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60710, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60717, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60719, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60722, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60724, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60726, 0, 7, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60770, 0, 11, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60818, 0, 10, 0, 512, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(60826, 0, 15, 20971520, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(61188, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(61324, 0, 10, 0, 131072, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(61356, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 90000, 0), +(61618, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(62114, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(62115, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(62147, 0, 15, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(62459, 0, 15, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(63086, 0, 9, 0, 0, 65536, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(63108, 0, 5, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(63251, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(63310, 0, 5, 0, 65536, 0, 65536, 0, 2, 0, 0, 0, 0, 0, 0), +(63335, 0, 15, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(63611, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 0), +(64343, 0, 3, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64411, 0, 0, 0, 0, 0, 279552, 2, 2, 0, 0, 0, 0, 0, 0), +(64415, 0, 0, 0, 0, 0, 279552, 2, 2, 0, 0, 0, 0, 45000, 0), +(64440, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0), +(64571, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 10000, 0), +(64714, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(64738, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(64742, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(64752, 0, 7, 4096, 256, 2097152, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(64786, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(64792, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(64824, 0, 7, 2097152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(64860, 0, 9, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64867, 0, 3, 536870945, 4096, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64882, 0, 10, 0, 1048576, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64908, 0, 6, 8192, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64912, 0, 6, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64914, 0, 8, 65536, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(64938, 0, 4, 2097216, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0), +(64952, 0, 7, 0, 1088, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64955, 0, 10, 0, 64, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64964, 0, 15, 0, 536870912, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64976, 0, 4, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(64999, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0), +(65002, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(65005, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 45000, 0), +(65007, 0, 0, 0, 0, 0, 81920, 3, 1, 0, 0, 0, 0, 0, 0), +(65013, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(65020, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(65025, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(66808, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0), +(67115, 0, 15, 20971520, 0, 0, 0, 0, 2, 0, 0, 0, 0, 45000, 0), +(67151, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(67209, 1, 8, 1048576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(67353, 0, 7, 32768, 1049856, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(67356, 8, 7, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0), +(67361, 0, 7, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(67363, 0, 10, 2147483648, 0, 0, 0, 0, 2, 0, 0, 0, 0, 10000, 0), +(67365, 0, 10, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 6000, 0), +(67379, 0, 10, 0, 262144, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(67381, 0, 15, 0, 536870912, 0, 0, 0, 2, 0, 0, 0, 0, 10000, 0), +(67384, 0, 15, 16, 134348800, 0, 0, 0, 2, 0, 0, 0, 80, 10000, 0), +(67386, 0, 11, 1, 0, 0, 65536, 0, 1, 0, 0, 0, 0, 6000, 0), +(67389, 0, 11, 256, 0, 0, 16384, 0, 1, 0, 0, 0, 0, 8000, 0), +(67392, 0, 11, 0, 0, 4, 16, 0, 2, 0, 0, 0, 0, 0, 0), +(67653, 0, 0, 0, 0, 0, 4194344, 1, 0, 0, 0, 0, 0, 45000, 0), +(67667, 0, 0, 0, 0, 0, 16384, 2, 1, 0, 0, 0, 0, 45000, 0), +(67670, 0, 0, 0, 0, 0, 65536, 1, 1, 0, 0, 0, 0, 45000, 0), +(67672, 0, 0, 0, 0, 0, 8388948, 1, 2, 0, 0, 0, 0, 45000, 0), +(67698, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(67702, 1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(67712, 0, 0, 0, 0, 0, 69632, 1, 2, 2, 0, 0, 0, 2000, 0), +(67752, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(67758, 0, 0, 0, 0, 0, 69632, 1, 2, 2, 0, 0, 0, 2000, 0), +(67771, 1, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(68160, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0), +(70188, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0), +(70652, 0, 15, 8, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70727, 0, 9, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70730, 0, 9, 16384, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(70748, 0, 3, 0, 2097152, 0, 1024, 0, 2, 0, 0, 0, 0, 0, 0), +(70756, 0, 10, 0, 65536, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(70761, 0, 10, 0, 0, 1, 1024, 0, 2, 0, 0, 0, 0, 0, 0), +(70803, 0, 8, 4063232, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70807, 0, 11, 0, 0, 16, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70811, 0, 11, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(70830, 0, 11, 0, 131072, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(70841, 0, 5, 4, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(70854, 0, 4, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(71174, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(71176, 0, 7, 2097154, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(71178, 0, 7, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0), +(71186, 0, 10, 0, 32768, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(71191, 0, 10, 0, 65536, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0), +(71194, 0, 10, 0, 1048576, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(71198, 4, 11, 268435456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(71214, 0, 11, 0, 16, 0, 16, 0, 2, 0, 0, 0, 0, 0, 0), +(71217, 0, 11, 0, 0, 16, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(71226, 0, 15, 16, 134348800, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(71228, 0, 15, 0, 536870912, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0), +(71402, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(71404, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 45000, 0), +(71540, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(71585, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 45000, 0), +(71602, 0, 0, 0, 0, 0, 65536, 1, 1, 0, 0, 0, 0, 45000, 0), +(71606, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 100000, 0), +(71611, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 45000, 0), +(71637, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 100000, 0), +(71642, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 45000, 0), +(71645, 0, 0, 0, 0, 0, 65536, 1, 1, 0, 0, 0, 0, 45000, 0), +(71903, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 12, 0, 0, 0), +(72413, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 10, 60000, 0), +(72417, 0, 0, 0, 0, 0, 327680, 1, 2, 0, 0, 0, 0, 60000, 0), +(72419, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 60000, 0), +(75455, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(75457, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 45000, 0), +(75465, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 45000, 0), +(75474, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 45000, 0), +(-12317, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), +(63057, 0, 7, 0, 262144, 0, 16384, 0, 2, 0, 0, 0, 0, 0, 0), +(71571, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(71573, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(71865, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0), +(71868, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0), +(75490, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0), +(75495, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0), +(53651, 0, 10, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0), +(53257, 0, 9, 0, 268435456, 0, 16, 1, 2, 2, 8, 0, 0, 0, 0), +(-51682, 0, 8, 0, 524288, 0, 0, 4, 2, 0, 2, 0, 0, 0, 0), +(53817, 0, 11, 451, 32768, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(12328, 0, 4, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 0), +(5118, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0), +(13159, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0), +(-7302, 0, 0, 0, 0, 0, 0, 1, 0, 1027, 2, 0, 0, 0, 0), +(-30482, 0, 0, 0, 0, 0, 0, 1, 0, 1027, 2, 0, 0, 0, 0), +(17670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0), +(50908, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0), +(58501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0), +(-1120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), +(18708, 0, 5, 536870912, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(57529, 0, 3, 1631584309, 4096, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(57531, 0, 3, 1631584309, 4096, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0), +(-11103, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0), +(13234, 0, 0, 0, 0, 0, 0, 1, 0, 1027, 2, 0, 0, 0, 0), +(12043, 0, 3, 1631584309, 4096, 0, 0, 7, 1, 0, 8, 0, 0, 0, 0), +(16166, 0, 11, 3, 4096, 0, 0, 7, 1, 0, 8, 0, 0, 0, 0), +(17116, 0, 7, 268436065, 33554464, 32768, 0, 7, 1, 0, 8, 0, 0, 0, 0); diff --git a/sql/updates/world/3.3.5/2017_01_29_00_world.sql b/sql/updates/world/4.3.4/2017_05_28_03_world_from_335_was_2017_01_29_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_01_29_00_world.sql rename to sql/updates/world/4.3.4/2017_05_28_03_world_from_335_was_2017_01_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_02_23_01_world_335.sql b/sql/updates/world/4.3.4/2017_05_28_04_world_from_335_was_2017_02_23_01_world_335.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_02_23_01_world_335.sql rename to sql/updates/world/4.3.4/2017_05_28_04_world_from_335_was_2017_02_23_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_03_26_05_world_335.sql b/sql/updates/world/4.3.4/2017_05_28_05_world_from_335_was_2017_03_26_05_world_335.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_03_26_05_world_335.sql rename to sql/updates/world/4.3.4/2017_05_28_05_world_from_335_was_2017_03_26_05_world_335.sql From 34a73e8cf13ce2435bee432cda7f043f90df8833 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 28 May 2017 19:20:48 +0100 Subject: [PATCH 110/110] Last sql --- .../2017_05_28_00_auth_from_335_was_2016_09_22_00_auth.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/auth/{3.3.5/2016_09_22_00_auth.sql => 4.3.4/2017_05_28_00_auth_from_335_was_2016_09_22_00_auth.sql} (100%) diff --git a/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql b/sql/updates/auth/4.3.4/2017_05_28_00_auth_from_335_was_2016_09_22_00_auth.sql similarity index 100% rename from sql/updates/auth/3.3.5/2016_09_22_00_auth.sql rename to sql/updates/auth/4.3.4/2017_05_28_00_auth_from_335_was_2016_09_22_00_auth.sql