diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b0daacc54..975e9d3ef 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6825,51 +6825,114 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; // Try handle unknown trigger spells - if (sSpellStore.LookupEntry(trigger_spell_id)==NULL) + // Custom requirements (not listed in procEx) Warning! damage dealing after this + // Custom triggered spells + switch (auraSpellInfo->SpellFamilyName) { - switch (auraSpellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - //if (auraSpellInfo->Id==59532) // Abandon Passengers on Poly - //if (auraSpellInfo->Id==54775) // Abandon Vehicle on Poly - //if (auraSpellInfo->Id==34082) // Advantaged State (DND) - if (auraSpellInfo->Id == 23780) // Aegis of Preservation (Aegis of Preservation trinket) + case SPELLFAMILY_GENERIC: + switch(auraSpellInfo->Id) + { + //case 191: // Elemental Response + // switch (procSpell->School) + // { + // case SPELL_SCHOOL_FIRE: trigger_spell_id = 34192; break; + // case SPELL_SCHOOL_FROST: trigger_spell_id = 34193; break; + // case SPELL_SCHOOL_ARCANE:trigger_spell_id = 34194; break; + // case SPELL_SCHOOL_NATURE:trigger_spell_id = 34195; break; + // case SPELL_SCHOOL_SHADOW:trigger_spell_id = 34196; break; + // case SPELL_SCHOOL_HOLY: trigger_spell_id = 34197; break; + // case SPELL_SCHOOL_NORMAL:trigger_spell_id = 34198; break; + // } + // break; + //case 5301: break; // Defensive State (DND) + //case 7137: break: // Shadow Charge (Rank 1) + //case 7377: break: // Take Immune Periodic Damage + //case 13358: break; // Defensive State (DND) + //case 16092: break; // Defensive State (DND) + //case 18943: break; // Double Attack + //case 19194: break; // Double Attack + //case 19817: break; // Double Attack + //case 19818: break; // Double Attack + //case 22835: break; // Drunken Rage + // trigger_spell_id = 14822; break; + case 23780: // Aegis of Preservation (Aegis of Preservation trinket) trigger_spell_id = 23781; - //else if (auraSpellInfo->Id==43504) // Alterac Valley OnKill Proc Aura - //else if (auraSpellInfo->Id == 48876) // Beast's Mark - //{ - // trigger_spell_id = 48877; - //} - //else if (auraSpellInfo->Id == 59237) // Beast's Mark - //{ - // trigger_spell_id = 59233; - //} - //else if (auraSpellInfo->Id==46939) // Black Bow of the Betrayer - //{ - // trigger_spell_id = 29471; // gain mana - // 27526; // drain mana if possible - //} - //else if (auraSpellInfo->Id==50844) // Blood Mirror - //else if (auraSpellInfo->Id==54476) // Blood Presence - //else if (auraSpellInfo->Id==50689) // Blood Presence (Rank 1) - //else if (auraSpellInfo->Id==37030) // Chaotic Temperament - //else if (auraSpellInfo->Id==52856) // Charge - else if (auraSpellInfo->Id==43820) // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) - { + break; + //case 24949: break; // Defensive State 2 (DND) + case 27522: // Mana Drain Trigger + case 40336: // Mana Drain Trigger + // 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 (pVictim && pVictim->isAlive()) + CastSpell(pVictim, 27526, true, castItem, triggeredByAura); + return true; + case 31255: // Deadly Swiftness (Rank 1) + // whenever you deal damage to a target who is below 20% health. + if (pVictim->GetHealth() > pVictim->GetMaxHealth() / 5) + return false; + + target = this; + trigger_spell_id = 22588; + break; + //case 33207: break; // Gossip NPC Periodic - Fidget + case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) + trigger_spell_id = 33898; + break; + //case 34082: break; // Advantaged State (DND) + //case 34783: break: // Spell Reflection + //case 35205: break: // Vanish + //case 35321: break; // Gushing Wound + //case 36096: break: // Spell Reflection + //case 36207: break: // Steal Weapon + //case 36576: break: // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger + //case 37030: break; // Chaotic Temperament + //case 38363: break; // Gushing Wound + //case 39215: break; // Gushing Wound + //case 40250: break; // Improved Duration + //case 40329: break; // Demo Shout Sensor + //case 40364: break; // Entangling Roots Sensor + //case 41054: break; // Copy Weapon + // trigger_spell_id = 41055; break; + //case 41248: break; // Consuming Strikes + // trigger_spell_id = 41249; break; + //case 42730: break: // Woe Strike + //case 43453: break: // Rune Ward + //case 43504: break; // Alterac Valley OnKill Proc Aura + //case 44326: break: // Pure Energy Passive + //case 44526: break; // Hate Monster (Spar) (30 sec) + //case 44527: break; // Hate Monster (Spar Buddy) (30 sec) + //case 44819: break; // Hate Monster (Spar Buddy) (>30% Health) + //case 44820: break; // Hate Monster (Spar) (<30%) + case 45057: // Evasive Maneuvers (Commendation of Kael`thas trinket) + // reduce you below $s1% health + if (GetHealth() - damage > GetMaxHealth() * triggerAmount / 100) + return false; + break; + //case 45903: break: // Offensive State + //case 46146: break: // [PH] Ahune Spanky Hands + //case 46939: break; // Black Bow of the Betrayer + // trigger_spell_id = 29471; - gain mana + // 27526; - drain mana if possible + case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) // Pct value stored in dummy basepoints[0] = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100; target = pVictim; break; - } - //else if (auraSpellInfo->Id==41248) // Consuming Strikes - // trigger_spell_id = 41249; - //else if (auraSpellInfo->Id==45205) // Copy Offhand Weapon - //else if (auraSpellInfo->Id==57594) // Copy Ranged Weapon - //else if (auraSpellInfo->Id==41054) // Copy Weapon - // trigger_spell_id = 41055; - //else if (auraSpellInfo->Id==45343) // Dark Flame Aura - //else if (auraSpellInfo->Id==47300) // Dark Flame Aura - else if (auraSpellInfo->Id==57345) // Darkmoon Card: Greatness + //case 45205: break; // Copy Offhand Weapon + //case 45343: break; // Dark Flame Aura + //case 47300: break; // Dark Flame Aura + //case 48876: break; // Beast's Mark + // trigger_spell_id = 48877; break; + //case 49059: break; // Horde, Hate Monster (Spar Buddy) (>30% Health) + //case 50051: break; // Ethereal Pet Aura + //case 50689: break; // Blood Presence (Rank 1) + //case 50844: break; // Blood Mirror + //case 52856: break; // Charge + //case 54072: break; // Knockback Ball Passive + //case 54476: break; // Blood Presence + //case 54775: break; // Abandon Vehicle on Poly + case 57345: // Darkmoon Card: Greatness { float stat = 0.0f; // strength @@ -6880,471 +6943,454 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);} // spirit if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235; } + break; } - else if (auraSpellInfo->Id==67702) // Death's Choice, Item - Coliseum 25 Normal Melee Trinket + //case 55580: break: // Mana Link + //case 57587: break: // Steal Ranged () + //case 57594: break; // Copy Ranged Weapon + //case 59237: break; // Beast's Mark + // trigger_spell_id = 59233; break; + //case 59288: break; // Infra-Green Shield + //case 59532: break; // Abandon Passengers on Poly + //case 59735: break: // Woe Strike + 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; } - else if (auraSpellInfo->Id==67771) // Death's Choice (heroic), Item - Coliseum 25 Heroic Melee Trinket + 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; } - //else if (auraSpellInfo->Id==31255) // Deadly Swiftness (Rank 1) - //else if (auraSpellInfo->Id==5301) // Defensive State (DND) - //else if (auraSpellInfo->Id==13358) // Defensive State (DND) - //else if (auraSpellInfo->Id==16092) // Defensive State (DND) - //else if (auraSpellInfo->Id==24949) // Defensive State 2 (DND) - //else if (auraSpellInfo->Id==40329) // Demo Shout Sensor - else if (auraSpellInfo->Id == 33896) // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) - trigger_spell_id = 33898; - //else if (auraSpellInfo->Id==18943) // Double Attack - //else if (auraSpellInfo->Id==19194) // Double Attack - //else if (auraSpellInfo->Id==19817) // Double Attack - //else if (auraSpellInfo->Id==19818) // Double Attack - //else if (auraSpellInfo->Id==22835) // Drunken Rage - // trigger_spell_id = 14822; - /* - else if (auraSpellInfo->SpellIconID==191) // Elemental Response - { - switch (auraSpellInfo->Id && auraSpellInfo->AttributesEx==0) - { - case 34191: - case 34329: - case 34524: - case 34582: - case 36733: - break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Elemental Response",auraSpellInfo->Id); - return false; - } - //This generic aura self-triggers a different spell for each school of magic that lands on the wearer: - switch (procSpell->School) - { - case SPELL_SCHOOL_FIRE: trigger_spell_id = 34192; break; - case SPELL_SCHOOL_FROST: trigger_spell_id = 34193; break; - case SPELL_SCHOOL_ARCANE:trigger_spell_id = 34194; break; - case SPELL_SCHOOL_NATURE:trigger_spell_id = 34195; break; - case SPELL_SCHOOL_SHADOW:trigger_spell_id = 34196; break; - case SPELL_SCHOOL_HOLY: trigger_spell_id = 34197; break; - case SPELL_SCHOOL_NORMAL:trigger_spell_id = 34198; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u Elemental Response wrong school",auraSpellInfo->Id); - return false; - } - } - */ - //else if (auraSpellInfo->Id==40364) // Entangling Roots Sensor - //else if (auraSpellInfo->Id==33207) // Gossip NPC Periodic - Fidget - //else if (auraSpellInfo->Id==50051) // Ethereal Pet Aura - //else if (auraSpellInfo->Id==35321) // Gushing Wound - //else if (auraSpellInfo->Id==38363) // Gushing Wound - //else if (auraSpellInfo->Id==39215) // Gushing Wound - //else if (auraSpellInfo->Id==44527) // Hate Monster (Spar Buddy) (30 sec) - //else if (auraSpellInfo->Id==44819) // Hate Monster (Spar Buddy) (>30% Health) - //else if (auraSpellInfo->Id==44526) // Hate Monster (Spar) (30 sec) - //else if (auraSpellInfo->Id==44820) // Hate Monster (Spar) (<30%) - //else if (auraSpellInfo->Id==49059) // Horde, Hate Monster (Spar Buddy) (>30% Health) - //else if (auraSpellInfo->Id==40250) // Improved Duration - //else if (auraSpellInfo->Id==59288) // Infra-Green Shield - //else if (auraSpellInfo->Id==54072) // Knockback Ball Passive - else if (auraSpellInfo->Id==27522 || auraSpellInfo->Id==40336) - // Mana Drain Trigger - { - // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. - if (this && this->isAlive()) - CastSpell(this, 29471, true, castItem, triggeredByAura); - if (pVictim && pVictim->isAlive()) - CastSpell(pVictim, 27526, true, castItem, triggeredByAura); - return true; - } - //else if (auraSpellInfo->Id==55580) // Mana Link - //else if (auraSpellInfo->Id==45903) // Offensive State - //else if (auraSpellInfo->Id==44326) // Pure Energy Passive - //else if (auraSpellInfo->Id==43453) // Rune Ward - //else if (auraSpellInfo->Id== 7137) // Shadow Charge (Rank 1) - //else if (auraSpellInfo->Id==36576) // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger - //else if (auraSpellInfo->Id==34783) // Spell Reflection - //else if (auraSpellInfo->Id==36096) // Spell Reflection - //else if (auraSpellInfo->Id==57587) // Steal Ranged () - //else if (auraSpellInfo->Id==36207) // Steal Weapon - //else if (auraSpellInfo->Id== 7377) // Take Immune Periodic Damage - //else if (auraSpellInfo->Id==35205) // Vanish - //else if (auraSpellInfo->Id==42730) // Woe Strike - //else if (auraSpellInfo->Id==59735) // Woe Strike - //else if (auraSpellInfo->Id==46146) // [PH] Ahune Spanky Hands - break; - case SPELLFAMILY_MAGE: - if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed - { - switch (auraSpellInfo->Id) - { - case 31641: // Rank 1 - case 31642: // Rank 2 - trigger_spell_id = 31643; - break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id); - return false; - } - } - break; - case SPELLFAMILY_WARRIOR: - if (auraSpellInfo->Id == 50421) // Scent of Blood - trigger_spell_id = 50422; - break; - case SPELLFAMILY_WARLOCK: + } + break; + case SPELLFAMILY_MAGE: + if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed { - // Pyroclasm - if (auraSpellInfo->SpellIconID == 1137) + switch (auraSpellInfo->Id) { - if(!pVictim || !pVictim->isAlive() || pVictim == this || procSpell == NULL) + case 31641: // Rank 1 + case 31642: // Rank 2 + trigger_spell_id = 31643; + break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id); return false; - // Calculate spell tick count for spells - uint32 tick = 1; // Default tick = 1 - - // Hellfire have 15 tick - if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000040)) - tick = 15; - // Rain of Fire have 4 tick - else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020)) - tick = 4; - else - return false; - - // Calculate chance = baseChance / tick - float chance = 0; - switch (auraSpellInfo->Id) - { - case 18096: chance = 13.0f / tick; break; - case 18073: chance = 26.0f / tick; break; - } - // Roll chance - if (!roll_chance_f(chance)) - return false; - - trigger_spell_id = 18093; } - // Drain Soul - else if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) + } + // Persistent Shield (Scarab Brooch trinket) + else if(auraSpellInfo->Id == 26467) + { + // This spell originally trigger 13567 - Dummy Trigger (vs dummy efect) + basepoints[0] = damage * 15 / 100; + target = pVictim; + trigger_spell_id = 26470; + } + break; + case SPELLFAMILY_WARRIOR: + if (auraSpellInfo->Id == 50421) // Scent of Blood + trigger_spell_id = 50422; + break; + case SPELLFAMILY_WARLOCK: + { + // Pyroclasm + if (auraSpellInfo->SpellIconID == 1137) + { + if(!pVictim || !pVictim->isAlive() || pVictim == this || procSpell == NULL) + return false; + // Calculate spell tick count for spells + uint32 tick = 1; // Default tick = 1 + + // Hellfire have 15 tick + if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000040)) + tick = 15; + // Rain of Fire have 4 tick + else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020)) + tick = 4; + else + return false; + + // Calculate chance = baseChance / tick + float chance = 0; + switch (auraSpellInfo->Id) { - Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); - for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) + case 18096: chance = 13.0f / tick; break; + case 18073: chance = 26.0f / tick; break; + } + // Roll chance + if (!roll_chance_f(chance)) + return false; + + trigger_spell_id = 18093; + } + // Drain Soul + else if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) + { + Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); + for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) + { + if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113) { - if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113) - { - // Drain Soul - CastCustomSpell(this, 18371, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura); - break; - } + // Drain Soul + CastCustomSpell(this, 18371, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura); + break; } - // Not remove charge (aura removed on death in any cases) - // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura + } + // Not remove charge (aura removed on death in any cases) + // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura + return false; + } + // Nether Protection + else if (auraSpellInfo->SpellIconID == 1985) + { + if (!procSpell) + return false; + switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) + { + case SPELL_SCHOOL_NORMAL: + return false; // ignore + case SPELL_SCHOOL_HOLY: trigger_spell_id = 54370; break; + case SPELL_SCHOOL_FIRE: trigger_spell_id = 54371; break; + case SPELL_SCHOOL_NATURE: trigger_spell_id = 54375; break; + case SPELL_SCHOOL_FROST: trigger_spell_id = 54372; break; + case SPELL_SCHOOL_SHADOW: trigger_spell_id = 54374; break; + case SPELL_SCHOOL_ARCANE: trigger_spell_id = 54373; break; + default: + return false; + } + } + // Cheat Death + else if (auraSpellInfo->Id == 28845) + { + // When your health drops below 20% .... + if (GetHealth() - damage > GetMaxHealth() / 5 || GetHealth() < GetMaxHealth() / 5) + return false; + } + // Decimation + else if (auraSpellInfo->Id == 63156 || auraSpellInfo->Id == 63158) + { + // Looking for dummy effect + Aura *aur = GetAura(auraSpellInfo->Id, 1); + if (!aur) + return false; + + // If target's health is not below equal certain value (35%) not proc + if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount) + return false; + } + break; + } + case SPELLFAMILY_PRIEST: + { + // Greater Heal Refund (Avatar Raiment set) + if (auraSpellInfo->Id==37594) + { + // Not give if target already have full health + if (pVictim->GetHealth() == pVictim->GetMaxHealth()) + return false; + // If your Greater Heal brings the target to full health, you gain $37595s1 mana. + if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth()) + return false; + trigger_spell_id = 37595; + } + // Blessed Recovery + else if (auraSpellInfo->SpellIconID == 1875) + { + switch (auraSpellInfo->Id) + { + case 27811: trigger_spell_id = 27813; break; + case 27815: trigger_spell_id = 27817; break; + case 27816: trigger_spell_id = 27818; break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id); return false; } - // Nether Protection - else if (auraSpellInfo->SpellIconID == 1985) - { - if (!procSpell) - return false; - switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) - { - case SPELL_SCHOOL_NORMAL: - return false; // ignore - case SPELL_SCHOOL_HOLY: trigger_spell_id = 54370; break; - case SPELL_SCHOOL_FIRE: trigger_spell_id = 54371; break; - case SPELL_SCHOOL_NATURE: trigger_spell_id = 54375; break; - case SPELL_SCHOOL_FROST: trigger_spell_id = 54372; break; - case SPELL_SCHOOL_SHADOW: trigger_spell_id = 54374; break; - case SPELL_SCHOOL_ARCANE: trigger_spell_id = 54373; break; - default: - return false; - } - } - break; + basepoints[0] = damage * triggerAmount / 100 / 3; + target = this; } - case SPELLFAMILY_PRIEST: - { - // Greater Heal Refund - if (auraSpellInfo->Id==37594) - trigger_spell_id = 37595; - // Blessed Recovery - else if (auraSpellInfo->SpellIconID == 1875) - { - switch (auraSpellInfo->Id) - { - case 27811: trigger_spell_id = 27813; break; - case 27815: trigger_spell_id = 27817; break; - case 27816: trigger_spell_id = 27818; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id); - return false; - } - basepoints[0] = damage * triggerAmount / 100 / 3; - target = this; - } - break; - } - case SPELLFAMILY_DRUID: - { - // Druid Forms Trinket - if (auraSpellInfo->Id==37336) - { - switch(m_form) - { - case FORM_NONE: trigger_spell_id = 37344;break; - case FORM_CAT: trigger_spell_id = 37341;break; - case FORM_BEAR: - case FORM_DIREBEAR: trigger_spell_id = 37340;break; - case FORM_TREE: trigger_spell_id = 37342;break; - case FORM_MOONKIN: trigger_spell_id = 37343;break; - default: - return false; - } - } - // Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred) - else if (auraSpellInfo->Id==67353) - { - switch(m_form) - { - case FORM_CAT: trigger_spell_id = 67355; break; - case FORM_BEAR: - case FORM_DIREBEAR: trigger_spell_id = 67354; break; - default: - return false; - } - } - break; - } - case SPELLFAMILY_HUNTER: - // Piercing Shots - if (auraSpellInfo->SpellIconID == 3247 && auraSpellInfo->SpellVisual[0] == 0) - { - basepoints[0] = damage * triggerAmount / 100 / 8; - trigger_spell_id = 63468; - target = pVictim; - } - break; - case SPELLFAMILY_PALADIN: - { - /* - // Blessed Life - if (auraSpellInfo->SpellIconID == 2137) - { - switch (auraSpellInfo->Id) - { - case 31828: // Rank 1 - case 31829: // Rank 2 - case 31830: // Rank 3 - break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blessed Life", auraSpellInfo->Id); - return false; - } - } - */ - // Healing Discount - if (auraSpellInfo->Id==37705) - { - trigger_spell_id = 37706; - target = this; - } - // Soul Preserver - if (auraSpellInfo->Id==60510) - { - trigger_spell_id = 60515; - target = this; - } - // Illumination - else if (auraSpellInfo->SpellIconID==241) - { - if(!procSpell) - return false; - // procspell is triggered spell but we need mana cost of original casted spell - uint32 originalSpellId = procSpell->Id; - // Holy Shock heal - if (procSpell->SpellFamilyFlags & UI64LIT(0x0001000000000000)) - { - switch(procSpell->Id) - { - case 25914: originalSpellId = 20473; break; - case 25913: originalSpellId = 20929; break; - case 25903: originalSpellId = 20930; break; - case 27175: originalSpellId = 27174; break; - case 33074: originalSpellId = 33072; break; - case 48820: originalSpellId = 48824; break; - case 48821: originalSpellId = 48825; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); - return false; - } - } - SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); - if(!originalSpell) - { - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); - return false; - } - // percent stored in effect 1 (class scripts) base points - int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; - basepoints[0] = cost*auraSpellInfo->CalculateSimpleValue(1)/100; - trigger_spell_id = 20272; - target = this; - } - // Lightning Capacitor - else if (auraSpellInfo->Id==37657) - { - if(!pVictim || !pVictim->isAlive()) - return false; - // stacking - CastSpell(this, 37658, true, NULL, triggeredByAura); - - Aura * dummy = GetDummyAura(37658); - // release at 3 aura in stack (cont contain in basepoint of trigger aura) - if(!dummy || dummy->GetStackAmount() < triggerAmount) - return false; - - RemoveAurasDueToSpell(37658); - trigger_spell_id = 37661; - target = pVictim; - } - // Thunder Capacitor - else if (auraSpellInfo->Id == 54841) - { - if(!pVictim || !pVictim->isAlive()) - return false; - // stacking - CastSpell(this, 54842, true, NULL, triggeredByAura); - - // counting - Aura * dummy = GetDummyAura(54842); - // release at 3 aura in stack (cont contain in basepoint of trigger aura) - if(!dummy || dummy->GetStackAmount() < triggerAmount) - return false; - - RemoveAurasDueToSpell(54842); - trigger_spell_id = 54843; - target = pVictim; - } - break; - } - case SPELLFAMILY_SHAMAN: - { - // Lightning Shield (overwrite non existing triggered spell call in spell.dbc - if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000400)) - { - switch(auraSpellInfo->Id) - { - case 324: // Rank 1 - trigger_spell_id = 26364; break; - case 325: // Rank 2 - trigger_spell_id = 26365; break; - case 905: // Rank 3 - trigger_spell_id = 26366; break; - case 945: // Rank 4 - trigger_spell_id = 26367; break; - case 8134: // Rank 5 - trigger_spell_id = 26369; break; - case 10431: // Rank 6 - trigger_spell_id = 26370; break; - case 10432: // Rank 7 - trigger_spell_id = 26363; break; - case 25469: // Rank 8 - trigger_spell_id = 26371; break; - case 25472: // Rank 9 - trigger_spell_id = 26372; break; - case 49280: // Rank 10 - trigger_spell_id = 49278; break; - case 49281: // Rank 11 - trigger_spell_id = 49279; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id); - return false; - } - } - // Lightning Shield (The Ten Storms set) - else if (auraSpellInfo->Id == 23551) - { - trigger_spell_id = 23552; - target = pVictim; - } - // Damage from Lightning Shield (The Ten Storms set) - else if (auraSpellInfo->Id == 23552) - trigger_spell_id = 27635; - // Mana Surge (The Earthfury set) - else if (auraSpellInfo->Id == 23572) - { - if(!procSpell) - return false; - basepoints[0] = procSpell->manaCost * 35 / 100; - trigger_spell_id = 23571; - target = this; - } - // Nature's Guardian - else if (auraSpellInfo->SpellIconID == 2013) - { - // Check health condition - should drop to less 30% (damage deal after this!) - if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth())) - return false; - - if(pVictim && pVictim->isAlive()) - pVictim->getThreatManager().modifyThreatPercent(this,-10); - - basepoints[0] = triggerAmount * GetMaxHealth() / 100; - trigger_spell_id = 31616; - target = this; - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Acclimation - if (auraSpellInfo->SpellIconID == 1930) - { - if (!procSpell) - return false; - switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) - { - case SPELL_SCHOOL_NORMAL: - return false; // ignore - case SPELL_SCHOOL_HOLY: trigger_spell_id = 50490; break; - case SPELL_SCHOOL_FIRE: trigger_spell_id = 50362; break; - case SPELL_SCHOOL_NATURE: trigger_spell_id = 50488; break; - case SPELL_SCHOOL_FROST: trigger_spell_id = 50485; break; - case SPELL_SCHOOL_SHADOW: trigger_spell_id = 50489; break; - case SPELL_SCHOOL_ARCANE: trigger_spell_id = 50486; break; - default: - return false; - } - } - // Blood Presence - else if (auraSpellInfo->Id == 48266) - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - if (!((Player*)this)->isHonorOrXPTarget(pVictim)) - return false; - trigger_spell_id = 50475; - basepoints[0] = damage * triggerAmount / 100; - } - break; - } - default: - break; + break; } + case SPELLFAMILY_DRUID: + { + // Druid Forms Trinket + if (auraSpellInfo->Id==37336) + { + switch(m_form) + { + case FORM_NONE: trigger_spell_id = 37344;break; + case FORM_CAT: trigger_spell_id = 37341;break; + case FORM_BEAR: + case FORM_DIREBEAR: trigger_spell_id = 37340;break; + case FORM_TREE: trigger_spell_id = 37342;break; + case FORM_MOONKIN: trigger_spell_id = 37343;break; + default: + return false; + } + } + // Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred) + else if (auraSpellInfo->Id==67353) + { + switch(m_form) + { + case FORM_CAT: trigger_spell_id = 67355; break; + case FORM_BEAR: + case FORM_DIREBEAR: trigger_spell_id = 67354; break; + default: + return false; + } + } + break; + } + case SPELLFAMILY_HUNTER: + // Piercing Shots + if (auraSpellInfo->SpellIconID == 3247 && auraSpellInfo->SpellVisual[0] == 0) + { + basepoints[0] = damage * triggerAmount / 100 / 8; + trigger_spell_id = 63468; + target = pVictim; + } + // Rapid Recuperation + else if (auraSpellInfo->Id == 53228 || auraSpellInfo->Id == 53232) + { + // This effect only from Rapid Fire (ability cast) + if (!(procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020))) + return false; + } + break; + case SPELLFAMILY_PALADIN: + { + /* + // Blessed Life + if (auraSpellInfo->SpellIconID == 2137) + { + switch (auraSpellInfo->Id) + { + case 31828: // Rank 1 + case 31829: // Rank 2 + case 31830: // Rank 3 + break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blessed Life", auraSpellInfo->Id); + return false; + } + } + */ + // Healing Discount + if (auraSpellInfo->Id==37705) + { + trigger_spell_id = 37706; + target = this; + } + // Soul Preserver + if (auraSpellInfo->Id==60510) + { + trigger_spell_id = 60515; + target = this; + } + // Illumination + else if (auraSpellInfo->SpellIconID==241) + { + if(!procSpell) + return false; + // procspell is triggered spell but we need mana cost of original casted spell + uint32 originalSpellId = procSpell->Id; + // Holy Shock heal + if (procSpell->SpellFamilyFlags & UI64LIT(0x0001000000000000)) + { + switch(procSpell->Id) + { + case 25914: originalSpellId = 20473; break; + case 25913: originalSpellId = 20929; break; + case 25903: originalSpellId = 20930; break; + case 27175: originalSpellId = 27174; break; + case 33074: originalSpellId = 33072; break; + case 48820: originalSpellId = 48824; break; + case 48821: originalSpellId = 48825; break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); + return false; + } + } + SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); + if(!originalSpell) + { + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); + return false; + } + // percent stored in effect 1 (class scripts) base points + int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; + basepoints[0] = cost*auraSpellInfo->CalculateSimpleValue(1)/100; + trigger_spell_id = 20272; + target = this; + } + // Lightning Capacitor + else if (auraSpellInfo->Id==37657) + { + if(!pVictim || !pVictim->isAlive()) + return false; + // stacking + CastSpell(this, 37658, true, NULL, triggeredByAura); + + Aura * dummy = GetDummyAura(37658); + // release at 3 aura in stack (cont contain in basepoint of trigger aura) + if(!dummy || dummy->GetStackAmount() < triggerAmount) + return false; + + RemoveAurasDueToSpell(37658); + trigger_spell_id = 37661; + target = pVictim; + } + // Bonus Healing (Crystal Spire of Karabor mace) + else if (auraSpellInfo->Id == 40971) + { + // If your target is below $s1% health + if (pVictim->GetHealth() > pVictim->GetMaxHealth() * triggerAmount / 100) + return false; + } + // Thunder Capacitor + else if (auraSpellInfo->Id == 54841) + { + if(!pVictim || !pVictim->isAlive()) + return false; + // stacking + CastSpell(this, 54842, true, NULL, triggeredByAura); + + // counting + Aura * dummy = GetDummyAura(54842); + // release at 3 aura in stack (cont contain in basepoint of trigger aura) + if(!dummy || dummy->GetStackAmount() < triggerAmount) + return false; + + RemoveAurasDueToSpell(54842); + trigger_spell_id = 54843; + target = pVictim; + } + break; + } + case SPELLFAMILY_SHAMAN: + { + // Lightning Shield (overwrite non existing triggered spell call in spell.dbc + if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000400)) + { + switch(auraSpellInfo->Id) + { + case 324: // Rank 1 + trigger_spell_id = 26364; break; + case 325: // Rank 2 + trigger_spell_id = 26365; break; + case 905: // Rank 3 + trigger_spell_id = 26366; break; + case 945: // Rank 4 + trigger_spell_id = 26367; break; + case 8134: // Rank 5 + trigger_spell_id = 26369; break; + case 10431: // Rank 6 + trigger_spell_id = 26370; break; + case 10432: // Rank 7 + trigger_spell_id = 26363; break; + case 25469: // Rank 8 + trigger_spell_id = 26371; break; + case 25472: // Rank 9 + trigger_spell_id = 26372; break; + case 49280: // Rank 10 + trigger_spell_id = 49278; break; + case 49281: // Rank 11 + trigger_spell_id = 49279; break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id); + return false; + } + } + // Lightning Shield (The Ten Storms set) + else if (auraSpellInfo->Id == 23551) + { + trigger_spell_id = 23552; + target = pVictim; + } + // Damage from Lightning Shield (The Ten Storms set) + else if (auraSpellInfo->Id == 23552) + trigger_spell_id = 27635; + // Mana Surge (The Earthfury set) + else if (auraSpellInfo->Id == 23572) + { + if(!procSpell) + return false; + basepoints[0] = procSpell->manaCost * 35 / 100; + trigger_spell_id = 23571; + target = this; + } + // Nature's Guardian + else if (auraSpellInfo->SpellIconID == 2013) + { + // Check health condition - should drop to less 30% (damage deal after this!) + if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth())) + return false; + + if(pVictim && pVictim->isAlive()) + pVictim->getThreatManager().modifyThreatPercent(this,-10); + + basepoints[0] = triggerAmount * GetMaxHealth() / 100; + trigger_spell_id = 31616; + target = this; + } + break; + } + case SPELLFAMILY_DEATHKNIGHT: + { + // Acclimation + if (auraSpellInfo->SpellIconID == 1930) + { + if (!procSpell) + return false; + switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) + { + case SPELL_SCHOOL_NORMAL: + return false; // ignore + case SPELL_SCHOOL_HOLY: trigger_spell_id = 50490; break; + case SPELL_SCHOOL_FIRE: trigger_spell_id = 50362; break; + case SPELL_SCHOOL_NATURE: trigger_spell_id = 50488; break; + case SPELL_SCHOOL_FROST: trigger_spell_id = 50485; break; + case SPELL_SCHOOL_SHADOW: trigger_spell_id = 50489; break; + case SPELL_SCHOOL_ARCANE: trigger_spell_id = 50486; break; + default: + return false; + } + } + // Blood Presence + else if (auraSpellInfo->Id == 48266) + { + if (GetTypeId() != TYPEID_PLAYER) + return false; + if (!((Player*)this)->isHonorOrXPTarget(pVictim)) + return false; + trigger_spell_id = 50475; + basepoints[0] = damage * triggerAmount / 100; + } + // Blade Barrier + else if (auraSpellInfo->SpellIconID == 85) + { + if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT || + !((Player*)this)->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) + return false; + } + break; + } + default: + break; } // All ok. Check current trigger spell SpellEntry const* triggerEntry = sSpellStore.LookupEntry(trigger_spell_id); - if ( triggerEntry == NULL ) + if (!triggerEntry) { // Not cast unknown spell // sLog.outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex()); @@ -7352,100 +7398,9 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB } // not allow proc extra attack spell at extra attack - if( m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS) ) + if (m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS)) return false; - // Custom requirements (not listed in procEx) Warning! damage dealing after this - // Custom triggered spells - switch (auraSpellInfo->Id) - { - // Persistent Shield (Scarab Brooch trinket) - // This spell originally trigger 13567 - Dummy Trigger (vs dummy efect) - case 26467: - { - basepoints[0] = damage * 15 / 100; - target = pVictim; - trigger_spell_id = 26470; - break; - } - // Cheat Death - case 28845: - { - // When your health drops below 20% .... - if (GetHealth() - damage > GetMaxHealth() / 5 || GetHealth() < GetMaxHealth() / 5) - return false; - break; - } - // Deadly Swiftness (Rank 1) - case 31255: - { - // whenever you deal damage to a target who is below 20% health. - if (pVictim->GetHealth() > pVictim->GetMaxHealth() / 5) - return false; - - target = this; - trigger_spell_id = 22588; - } - // Greater Heal Refund (Avatar Raiment set) - case 37594: - { - // Not give if target already have full health - if (pVictim->GetHealth() == pVictim->GetMaxHealth()) - return false; - // If your Greater Heal brings the target to full health, you gain $37595s1 mana. - if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth()) - return false; - break; - } - // Bonus Healing (Crystal Spire of Karabor mace) - case 40971: - { - // If your target is below $s1% health - if (pVictim->GetHealth() > pVictim->GetMaxHealth() * triggerAmount / 100) - return false; - break; - } - // Evasive Maneuvers (Commendation of Kael`thas trinket) - case 45057: - { - // reduce you below $s1% health - if (GetHealth() - damage > GetMaxHealth() * triggerAmount / 100) - return false; - break; - } - // Rapid Recuperation - case 53228: - case 53232: - { - // This effect only from Rapid Fire (ability cast) - if (!(procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020))) - return false; - break; - } - // Decimation - case 63156: - case 63158: - { - // Looking for dummy effect - Aura *aur = GetAura(auraSpellInfo->Id, 1); - if (!aur) - return false; - - // If target's health is not below equal certain value (35%) not proc - if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount) - return false; - - break; - } - } - // Blade Barrier - if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85) - { - if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT || - !((Player*)this)->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) - return false; - } - // Custom basepoints/target for exist spell // dummy basepoints or other customs switch(trigger_spell_id) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 29007b5a4..ea19748cc 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8990" + #define REVISION_NR "8991" #endif // __REVISION_NR_H__