diff options
Diffstat (limited to 'src')
31 files changed, 3266 insertions, 1763 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 98c2a1a56ff..adb2fa337cc 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5158,323 +5158,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { 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; - } - // Vampiric Touch (generic, used by some boss) - case 52723: - case 60501: - { - triggered_spell_id = 52724; - basepoints0 = damage / 2; - target = this; - break; - } - // Purified Shard of the Scale - Onyxia 10 Caster Trinket - case 69755: - { - triggered_spell_id = (procFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS) ? 69733 : 69729; - break; - } - // Shiny Shard of the Scale - Onyxia 25 Caster Trinket - case 69739: - { - triggered_spell_id = (procFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS) ? 69734 : 69730; - break; - } - case 71519: // Deathbringer's Will Normal - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - std::vector<uint32> 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<uint32> 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) @@ -5491,626 +5174,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case SPELLFAMILY_MAGE: - { - 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 && dummySpell->IconFileDataId == 136193) - { - // 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; - } - break; - } - break; - } - case SPELLFAMILY_DRUID: - { - switch (dummySpell->Id) - { - // Leader of the Pack - case 24932: - { - if (triggerAmount <= 0) - return false; - target = this; - triggered_spell_id = 68285; - break; - } - // Healing Touch (Dreamwalker Raiment set) - case 28719: - { - if (!procSpell) - return false; - // mana back - std::vector<SpellInfo::CostData> costs = procSpell->CalcPowerCost(this, procSpell->GetSchoolMask()); - auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; }); - if (m == costs.end()) - return false; - - basepoints0 = int32(CalculatePct(m->Amount, 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 - 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; - SpellEffectInfo const* effect = triggeredSpell->GetEffect(DIFFICULTY_NONE, EFFECT_0); - if (!effect) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / effect->ApplyAuraPeriod); - // 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->Id != 774) - 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: - { - switch (dummySpell->Id) - { - // 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->Id == 71433 || procSpell->Id == 71434); - - 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; - } - // 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; - } - // Frozen Power - case 63374: - { - triggered_spell_id = 63685; - 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; - if (SpellEffectInfo const* effect = triggeredSpell->GetEffect(DIFFICULTY_NONE, EFFECT_0)) - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / effect->ApplyAuraPeriod); - } - 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; - if (SpellEffectInfo const* effect = triggeredSpell->GetEffect(DIFFICULTY_NONE, EFFECT_0)) - { - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / effect->ApplyAuraPeriod); - // 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, flag128(0x10000000, 0x0, 0x0), GetGUID())) - { - Aura* flameShock = aurEff->GetBase(); - int32 maxDuration = flameShock->GetMaxDuration(); - int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetPeriod(); - - 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; - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // 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; - - SpellNonMeleeDamage log(pPet, pPet->GetVictim(), procSpell->Id, procSpell->GetSpellXSpellVisualId(pPet), procSpell->GetSchoolMask()); - log.damage = procDmg; - pPet->DealDamage(pPet->GetVictim(), procDmg, NULL, SPELL_DIRECT_DAMAGE, procSpell->GetSchoolMask(), procSpell, true); - pPet->SendSpellNonMeleeDamageLog(&log); - break; - } - else - return false; - } - // 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->GetAllEffectsMechanicMask() & ((1<<MECHANIC_ROOT)|(1<<MECHANIC_SNARE)))) - return false; - triggered_spell_id = 61258; - target = this; - break; - } - break; - } - case SPELLFAMILY_PET: - { - break; - } default: break; } @@ -6138,96 +5201,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere 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: - { - *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: - 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: - { - if (SpellEffectInfo const* effect = triggeredByAura->GetSpellEffectInfo(EFFECT_0)) - { - int32 bp0 = CalculatePct(GetMaxHealth(), effect->CalcValue()); - CastCustomSpell(this, 59913, &bp0, NULL, NULL, true); - *handled = true; - } - break; - } - } - - break; - case SPELLFAMILY_PALADIN: - { - break; - } - case SPELLFAMILY_MAGE: - { - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - break; - } - case SPELLFAMILY_WARRIOR: - { - switch (dummySpell->Id) - { - // Item - Warrior T10 Protection 4P Bonus - case 70844: - { - if (SpellEffectInfo const* effect = triggeredByAura->GetSpellEffectInfo(EFFECT_1)) - { - int32 basepoints0 = CalculatePct(GetMaxHealth(), effect->CalcValue()); - CastCustomSpell(this, 70845, &basepoints0, NULL, NULL, 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 @@ -6261,133 +5234,10 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (m_extraAttacks && triggerEntry->HasEffect(GetMap()->GetDifficultyID(), 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: - { - 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 108869: - // Can proc only if target has hp below 25% - if (!victim || !victim->HealthBelowPct(triggeredByAura->GetSpellEffectInfo()->CalcValue())) - return false; - break; - // Deathbringer Saurfang - Blood Beast's Blood Link - case 72176: - basepoints0 = 3; - break; - // 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): - // Cast positive spell on enemy target - case 7099: // Curse of Mending - case 39703: // Curse of Mending - case 29494: // Temptation - { - target = victim; - break; - } - // Finish movies that add combo - case 14189: // Seal Fate (Netherblade set) - { - 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) - return false; - - std::vector<SpellInfo::CostData> costs = procSpell->CalcPowerCost(this, procSpell->GetSchoolMask()); - auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA && cost.Amount > 0; }); - if (m == costs.end()) - return false; - break; - } // Maelstrom Weapon case 53817: { @@ -6398,22 +5248,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(this, 70831, true, castItem, triggeredByAura); 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; - } - // Body and Soul - case 65081: - { - // Proc only from PW:S cast - if (!procSpell || !(procSpell->SpellFamilyFlags[0] & 0x00000001)) - return false; - break; - } } // extra attack should hit same target @@ -11674,7 +10508,7 @@ 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, &handled)) + if (!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; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0cb343202da..f5213b7b172 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2386,7 +2386,6 @@ class TC_GAME_API Unit : public WorldObject 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); - 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); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 8a770ca225e..fd5c3d70158 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4644,10 +4644,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 diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 5cf6c6aecbd..1ce3e577e52 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -537,12 +537,18 @@ void SpellHistory::AddCooldown(uint32 spellId, uint32 itemId, Clock::time_point void SpellHistory::ModifyCooldown(uint32 spellId, int32 cooldownModMs) { + Clock::duration offset = std::chrono::duration_cast<Clock::duration>(std::chrono::milliseconds(cooldownModMs)); + ModifyCooldown(spellId, offset); +} + +void SpellHistory::ModifyCooldown(uint32 spellId, Clock::duration offset) +{ auto itr = _spellCooldowns.find(spellId); - if (!cooldownModMs || itr == _spellCooldowns.end()) + if (!offset.count() || itr == _spellCooldowns.end()) return; Clock::time_point now = Clock::now(); - Clock::duration offset = std::chrono::duration_cast<Clock::duration>(std::chrono::milliseconds(cooldownModMs)); + if (itr->second.CooldownEnd + offset > now) itr->second.CooldownEnd += offset; else @@ -553,7 +559,7 @@ void SpellHistory::ModifyCooldown(uint32 spellId, int32 cooldownModMs) WorldPackets::Spells::ModifyCooldown modifyCooldown; modifyCooldown.IsPet = _owner != playerOwner; modifyCooldown.SpellID = spellId; - modifyCooldown.DeltaTime = cooldownModMs; + modifyCooldown.DeltaTime = std::chrono::duration_cast<std::chrono::milliseconds>(offset).count(); playerOwner->SendDirectMessage(modifyCooldown.Write()); } } diff --git a/src/server/game/Spells/SpellHistory.h b/src/server/game/Spells/SpellHistory.h index 6e1c35b4f52..d554dde8553 100644 --- a/src/server/game/Spells/SpellHistory.h +++ b/src/server/game/Spells/SpellHistory.h @@ -100,6 +100,7 @@ public: void AddCooldown(uint32 spellId, uint32 itemId, Clock::time_point cooldownEnd, uint32 categoryId, Clock::time_point categoryEnd, bool onHold = false); void ModifyCooldown(uint32 spellId, int32 cooldownModMs); + void ModifyCooldown(uint32 spellId, Clock::duration cooldownMod); void ResetCooldown(uint32 spellId, bool update = false); void ResetCooldown(CooldownStorageType::iterator& itr, bool update = false); template<typename Predicate> diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 73b9cc836b1..1f41c7a25e6 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 5c532b2f22e..e7ad42644d7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1498,6 +1498,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 (Valanar) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 462dd4c3525..c907aa14c3c 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 991a09ce75e..c5dbb76de87 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -838,9 +838,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); } }; @@ -1077,6 +1091,50 @@ 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 + { + SpellEffectInfo const* effect0 = spellInfo->GetEffect(EFFECT_0); + if (!effect0 || !sSpellMgr->GetSpellInfo(effect0->TriggerSpell)) + return false; + + SpellEffectInfo const* effect1 = spellInfo->GetEffect(EFFECT_1); + if (!effect1 || !sSpellMgr->GetSpellInfo(effect1->TriggerSpell)) + return false; + + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* actionTarget = eventInfo.GetActionTarget(); + actionTarget->CastSpell((Unit*)nullptr, aurEff->GetSpellEffectInfo()->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: @@ -1597,6 +1655,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 4330a899608..2d3be44b1f8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1189,7 +1189,8 @@ class npc_crok_scourgebane : public CreatureScript } else { - me->DealHeal(me, me->CountPctFromMaxHealth(5)); + // looks totally hacky to me + me->ModifyHealth(me->CountPctFromMaxHealth(5)); _events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); } break; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 8474e29d8a2..67f66aa0e2e 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -2042,11 +2042,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 cc7835e3070..358eedf1809 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 fe8863c103f..58287a34710 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 df6c4a22f45..97362f2c947 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 4255f170054..11060b4c983 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -21,11 +21,6 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" -enum Spells -{ - SPELL_UK_SECOUND_WIND_TRIGGER = 42771 -}; - uint32 ForgeSearch[3] = { GO_GLOWING_ANVIL_1, @@ -196,6 +191,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 +346,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 00000000000..326959cb765 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#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 ad71d404351..28c424d39b6 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 8da9f62ea30..65488a81bf1 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_priest.cpp b/src/server/scripts/Pet/pet_priest.cpp index 832caf5b64d..09dc6c07439 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_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index aaeedc0e705..a137267f4d0 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -65,9 +65,10 @@ enum DeathKnightSpells SPELL_DK_GLYPH_OF_THE_SKELETON = 146652, SPELL_DK_IMPROVED_BLOOD_PRESENCE = 50371, SPELL_DK_IMPROVED_SOUL_REAPER = 157342, + SPELL_DK_MARK_OF_BLOOD_HEAL = 206945, + SPELL_DK_NECROSIS_EFFECT = 216974, SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, - SPELL_DK_SCENT_OF_BLOOD = 49509, - SPELL_DK_SCENT_OF_BLOOD_TRIGGERED = 50421, + SPELL_DK_RUNIC_RETURN = 61258, SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, SPELL_DK_SHADOW_OF_DEATH = 164047, SPELL_DK_SOUL_REAPER_DAMAGE = 114867, @@ -77,6 +78,11 @@ enum DeathKnightSpells SPELL_DK_WILL_OF_THE_NECROPOLIS = 157335 }; +enum Misc +{ + NPC_DK_DANCING_RUNE_WEAPON = 27893 +}; + // 70656 - Advantage (T10 4P Melee Bonus) class spell_dk_advantage_t10_4p : public SpellScriptLoader { @@ -322,10 +328,6 @@ class spell_dk_blood_boil : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) override { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD_TRIGGERED)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD)) - return false; if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PLAGUE)) return false; if (!sSpellMgr->GetSpellInfo(SPELL_DK_FROST_FEVER)) @@ -340,10 +342,7 @@ class spell_dk_blood_boil : public SpellScriptLoader Unit* caster = GetCaster(); - if (caster->HasAura(SPELL_DK_SCENT_OF_BLOOD)) - return; - - for (auto target : targets) + for (WorldObject* target : targets) { if (bpDuration && ffDuration) break; @@ -358,7 +357,7 @@ class spell_dk_blood_boil : public SpellScriptLoader } } - void HandleDummy(SpellEffIndex /*effIndex*/) + void HandleEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); Unit* target = GetHitUnit(); @@ -368,34 +367,22 @@ class spell_dk_blood_boil : public SpellScriptLoader if (bpDuration) caster->CastSpell(target, SPELL_DK_BLOOD_PLAGUE, true); - if (!caster->HasAura(SPELL_DK_SCENT_OF_BLOOD)) + if (Aura* bp = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID())) { - if (Aura* bp = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID())) - { - bp->SetDuration(bpDuration); - bp->SetMaxDuration(bpDuration); - } - if (Aura* ff = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID())) - { - ff->SetDuration(ffDuration); - ff->SetMaxDuration(ffDuration); - } + bp->SetDuration(bpDuration); + bp->SetMaxDuration(bpDuration); + } + if (Aura* ff = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID())) + { + ff->SetDuration(ffDuration); + ff->SetMaxDuration(ffDuration); } - } - - void HandleEnergize(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - - if (caster->HasAura(SPELL_DK_SCENT_OF_BLOOD)) - caster->CastSpell(caster, SPELL_DK_SCENT_OF_BLOOD_TRIGGERED, true); } void Register() override { OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_blood_boil_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); - OnEffectHitTarget += SpellEffectFn(spell_dk_blood_boil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnEffectHitTarget += SpellEffectFn(spell_dk_blood_boil_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_ENERGIZE); + OnEffectHitTarget += SpellEffectFn(spell_dk_blood_boil_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } private: @@ -409,6 +396,72 @@ class spell_dk_blood_boil : public SpellScriptLoader } }; +// 49028 - Dancing Rune Weapon +/// 7.1.5 +class spell_dk_dancing_rune_weapon : public SpellScriptLoader +{ + public: + spell_dk_dancing_rune_weapon() : SpellScriptLoader("spell_dk_dancing_rune_weapon") { } + + class spell_dk_dancing_rune_weapon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_dancing_rune_weapon_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sObjectMgr->GetCreatureTemplate(NPC_DK_DANCING_RUNE_WEAPON)) + return false; + return true; + } + + // This is a port of the old switch hack in Unit.cpp, it's not correct + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* drw = nullptr; + for (Unit* controlled : caster->m_Controlled) + { + if (controlled->GetEntry() == NPC_DK_DANCING_RUNE_WEAPON) + { + drw = controlled; + break; + } + } + + if (!drw || !drw->GetVictim()) + return; + + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 amount = static_cast<int32>(damageInfo->GetDamage()) / 2; + SpellNonMeleeDamage log(drw, drw->GetVictim(), spellInfo->Id, spellInfo->GetSpellXSpellVisualId(drw), spellInfo->GetSchoolMask()); + log.damage = amount; + drw->DealDamage(drw->GetVictim(), amount, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true); + drw->SendSpellNonMeleeDamageLog(&log); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_dancing_rune_weapon_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_dancing_rune_weapon_AuraScript(); + } +}; + // 43265 - Death and Decay /// 6.x class spell_dk_death_and_decay : public SpellScriptLoader @@ -895,6 +948,79 @@ class spell_dk_icebound_fortitude : public SpellScriptLoader } }; +// 206940 - Mark of Blood +/// 7.1.5 +class spell_dk_mark_of_blood : public SpellScriptLoader +{ + public: + spell_dk_mark_of_blood() : SpellScriptLoader("spell_dk_mark_of_blood") { } + + class spell_dk_mark_of_blood_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_mark_of_blood_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_MARK_OF_BLOOD_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + caster->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_mark_of_blood_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_mark_of_blood_AuraScript(); + } +}; + +// 207346 - Necrosis +/// 7.1.5 +class spell_dk_necrosis : public SpellScriptLoader +{ + public: + spell_dk_necrosis() : SpellScriptLoader("spell_dk_necrosis") { } + + class spell_dk_necrosis_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_necrosis_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_NECROSIS_EFFECT)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_NECROSIS_EFFECT, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_necrosis_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_necrosis_AuraScript(); + } +}; + // 121916 - Glyph of the Geist (Unholy) /// 6.x, does this belong here or in spell_generic? apply this in creature_template_addon? sniffs say this is always cast on raise dead. class spell_dk_pet_geist_transform : public SpellScriptLoader @@ -964,6 +1090,52 @@ class spell_dk_pet_skeleton_transform : public SpellScriptLoader } }; +// 61257 - Runic Power Back on Snare/Root +/// 7.1.5 +class spell_dk_pvp_4p_bonus : public SpellScriptLoader +{ + public: + spell_dk_pvp_4p_bonus() : SpellScriptLoader("spell_dk_pvp_4p_bonus") { } + + class spell_dk_pvp_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_pvp_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_RUNIC_RETURN)) + 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_SNARE))) != 0; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_DK_RUNIC_RETURN, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dk_pvp_4p_bonus_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dk_pvp_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_pvp_4p_bonus_AuraScript(); + } +}; + // 46584 - Raise Dead /// 6.x class spell_dk_raise_dead : public SpellScriptLoader @@ -1211,6 +1383,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_army_periodic_taunt(); new spell_dk_army_transform(); new spell_dk_blood_boil(); + new spell_dk_dancing_rune_weapon(); new spell_dk_death_and_decay(); new spell_dk_death_coil(); new spell_dk_death_gate(); @@ -1222,8 +1395,11 @@ void AddSC_deathknight_spell_scripts() new spell_dk_glyph_of_deaths_embrace(); new spell_dk_glyph_of_runic_power(); new spell_dk_icebound_fortitude(); + new spell_dk_mark_of_blood(); + new spell_dk_necrosis(); new spell_dk_pet_geist_transform(); new spell_dk_pet_skeleton_transform(); + new spell_dk_pvp_4p_bonus(); new spell_dk_raise_dead(); new spell_dk_soul_reaper(); new spell_dk_unholy_blight(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 484f5e24082..0008c41b1bf 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -30,6 +30,11 @@ enum DruidSpells { + SPELL_DRUID_BLESSING_OF_THE_CLAW = 28750, + SPELL_DRUID_BLESSING_OF_REMULOS = 40445, + SPELL_DRUID_BLESSING_OF_ELUNE = 40446, + SPELL_DRUID_BLESSING_OF_CENARIUS = 40452, + SPELL_DRUID_EXHILARATE = 28742, SPELL_DRUID_FERAL_CHARGE_BEAR = 16979, SPELL_DRUID_FERAL_CHARGE_CAT = 49376, SPELL_DRUID_FORMS_TRINKET_BEAR = 37340, @@ -39,6 +44,8 @@ enum DruidSpells SPELL_DRUID_FORMS_TRINKET_TREE = 37342, SPELL_DRUID_IDOL_OF_FERAL_SHADOWS = 34241, SPELL_DRUID_IDOL_OF_WORSHIP = 60774, + SPELL_DRUID_INFUSION = 37238, + SPELL_DRUID_LANGUISH = 71023, SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778, SPELL_DRUID_LIVING_SEED_HEAL = 48503, @@ -48,6 +55,9 @@ enum DruidSpells SPELL_DRUID_STAMPEDE_BAER_RANK_1 = 81016, SPELL_DRUID_STAMPEDE_CAT_RANK_1 = 81021, SPELL_DRUID_STAMPEDE_CAT_STATE = 109881, + SPELL_DRUID_REJUVENATION_T10_PROC = 70691, + SPELL_DRUID_BALANCE_T10_BONUS = 70718, + SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721, SPELL_DRUID_SUNFIRE_DAMAGE = 164815, SPELL_DRUID_SURVIVAL_INSTINCTS = 50322 }; @@ -530,54 +540,41 @@ public: } }; -// 62606 - Savage Defense -class spell_dru_savage_defense : public SpellScriptLoader +// 16864 - Omen of Clarity +class spell_dru_omen_of_clarity : public SpellScriptLoader { -public: - spell_dru_savage_defense() : SpellScriptLoader("spell_dru_savage_defense") { } - - class spell_dru_savage_defense_AuraScript : public AuraScript - { - PrepareAuraScript(spell_dru_savage_defense_AuraScript); - public: - spell_dru_savage_defense_AuraScript() - { - absorbPct = 0; - } + spell_dru_omen_of_clarity() : SpellScriptLoader("spell_dru_omen_of_clarity") { } - private: - uint32 absorbPct; - - bool Load() override + class spell_dru_omen_of_clarity_AuraScript : public AuraScript { - absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster()); - return true; - } + PrepareAuraScript(spell_dru_omen_of_clarity_AuraScript); - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BALANCE_T10_BONUS) || + !sSpellMgr->GetSpellInfo(SPELL_DRUID_BALANCE_T10_BONUS_PROC)) + return false; + return true; + } - void Absorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) - { - absorbAmount = uint32(CalculatePct(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct)); - aurEff->SetAmount(0); - } + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + Unit* target = GetTarget(); + if (target->HasAura(SPELL_DRUID_BALANCE_T10_BONUS)) + target->CastSpell((Unit*)nullptr, SPELL_DRUID_BALANCE_T10_BONUS_PROC, true, nullptr); + } - void Register() override + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_omen_of_clarity_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_savage_defense_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_savage_defense_AuraScript::Absorb, EFFECT_0); + return new spell_dru_omen_of_clarity_AuraScript(); } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_dru_savage_defense_AuraScript(); - } }; // 52610 - Savage Roar @@ -872,6 +869,238 @@ public: } }; +// 28744 - Regrowth +class spell_dru_t3_6p_bonus : public SpellScriptLoader +{ + public: + spell_dru_t3_6p_bonus() : SpellScriptLoader("spell_dru_t3_6p_bonus") { } + + class spell_dru_t3_6p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_t3_6p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BLESSING_OF_THE_CLAW)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_t3_6p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_t3_6p_bonus_AuraScript(); + } +}; + +// 28719 - Healing Touch +class spell_dru_t3_8p_bonus : public SpellScriptLoader +{ + public: + spell_dru_t3_8p_bonus() : SpellScriptLoader("spell_dru_t3_8p_bonus") { } + + class spell_dru_t3_8p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_t3_8p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_EXHILARATE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + Unit* caster = eventInfo.GetActor(); + std::vector<SpellInfo::CostData> costs = spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()); + auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; }); + if (m == costs.end()) + return; + + int32 amount = CalculatePct(m->Amount, aurEff->GetAmount()); + caster->CastCustomSpell(SPELL_DRUID_EXHILARATE, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_t3_8p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_t3_8p_bonus_AuraScript(); + } +}; + +// 37288 - Mana Restore +// 37295 - Mana Restore +class spell_dru_t4_2p_bonus : public SpellScriptLoader +{ + public: + spell_dru_t4_2p_bonus() : SpellScriptLoader("spell_dru_t4_2p_bonus") { } + + class spell_dru_t4_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_t4_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INFUSION)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_INFUSION, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_t4_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_t4_2p_bonus_AuraScript(); + } +}; + +// 40442 - Druid Tier 6 Trinket +class spell_dru_item_t6_trinket : public SpellScriptLoader +{ + public: + spell_dru_item_t6_trinket() : SpellScriptLoader("spell_dru_item_t6_trinket") { } + + class spell_dru_item_t6_trinket_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_item_t6_trinket_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BLESSING_OF_REMULOS) || + !sSpellMgr->GetSpellInfo(SPELL_DRUID_BLESSING_OF_ELUNE) || + !sSpellMgr->GetSpellInfo(SPELL_DRUID_BLESSING_OF_CENARIUS)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + uint32 spellId; + int32 chance; + + // Starfire + if (spellInfo->SpellFamilyFlags[0] & 0x00000004) + { + spellId = SPELL_DRUID_BLESSING_OF_REMULOS; + chance = 25; + } + // Rejuvenation + else if (spellInfo->SpellFamilyFlags[0] & 0x00000010) + { + spellId = SPELL_DRUID_BLESSING_OF_ELUNE; + chance = 25; + } + // Mangle (Bear) and Mangle (Cat) + else if (spellInfo->SpellFamilyFlags[1] & 0x00000440) + { + spellId = SPELL_DRUID_BLESSING_OF_CENARIUS; + chance = 40; + } + else + return; + + if (roll_chance_i(chance)) + eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_item_t6_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_item_t6_trinket_AuraScript(); + } +}; + +// 70723 - Item - Druid T10 Balance 4P Bonus +class spell_dru_t10_balance_4p_bonus : public SpellScriptLoader +{ + public: + spell_dru_t10_balance_4p_bonus() : SpellScriptLoader("spell_dru_t10_balance_4p_bonus") { } + + class spell_dru_t10_balance_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_t10_balance_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LANGUISH)) + 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(); + Unit* target = eventInfo.GetProcTarget(); + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_LANGUISH); + int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + // Add remaining ticks to damage done + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_DRUID_LANGUISH, SPELL_AURA_PERIODIC_DAMAGE); + + caster->CastCustomSpell(SPELL_DRUID_LANGUISH, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dru_t10_balance_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_t10_balance_4p_bonus_AuraScript(); + } +}; + // 70691 - Item T10 Restoration 4P Bonus class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader { @@ -927,6 +1156,61 @@ public: } }; +// 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation) +class spell_dru_t10_restoration_4p_bonus_dummy : public SpellScriptLoader +{ + public: + spell_dru_t10_restoration_4p_bonus_dummy() : SpellScriptLoader("spell_dru_t10_restoration_4p_bonus_dummy") { } + + class spell_dru_t10_restoration_4p_bonus_dummy_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_t10_restoration_4p_bonus_dummy_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_REJUVENATION_T10_PROC)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || spellInfo->Id == SPELL_DRUID_REJUVENATION_T10_PROC) + return false; + + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return false; + + Player* caster = eventInfo.GetActor()->ToPlayer(); + if (!caster) + return false; + + return caster->GetGroup() || caster != eventInfo.GetProcTarget(); + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 amount = static_cast<int32>(eventInfo.GetHealInfo()->GetHeal()); + eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_REJUVENATION_T10_PROC, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dru_t10_restoration_4p_bonus_dummy_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dru_t10_restoration_4p_bonus_dummy_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_t10_restoration_4p_bonus_dummy_AuraScript(); + } +}; + class RaidCheck { public: @@ -1009,15 +1293,21 @@ void AddSC_druid_spell_scripts() new spell_dru_living_seed(); new spell_dru_living_seed_proc(); new spell_dru_moonfire(); + new spell_dru_omen_of_clarity(); new spell_dru_predatory_strikes(); new spell_dru_rip(); - new spell_dru_savage_defense(); new spell_dru_savage_roar(); new spell_dru_stampede(); new spell_dru_starfall_dummy(); new spell_dru_sunfire(); new spell_dru_survival_instincts(); new spell_dru_swift_flight_passive(); + new spell_dru_t3_6p_bonus(); + new spell_dru_t3_8p_bonus(); + new spell_dru_t4_2p_bonus(); + new spell_dru_item_t6_trinket(); + new spell_dru_t10_balance_4p_bonus(); new spell_dru_t10_restoration_4p_bonus(); + new spell_dru_t10_restoration_4p_bonus_dummy(); new spell_dru_wild_growth(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index fafd1652597..9d23f016a76 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -173,67 +173,6 @@ class spell_gen_adaptive_warding : public SpellScriptLoader } }; -enum AlchemistStone -{ - ALECHEMIST_STONE_HEAL = 21399, - ALECHEMIST_STONE_MANA = 21400, -}; - -// 17619 - Alchemist Stone -class spell_gen_alchemist_stone : public SpellScriptLoader -{ - public: - spell_gen_alchemist_stone() : SpellScriptLoader("spell_gen_alchemist_stone") { } - - class spell_gen_alchemist_stone_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_alchemist_stone_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_HEAL) || - !sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_MANA)) - return false; - return true; - } - - bool CheckProc(ProcEventInfo& eventInfo) - { - return eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_POTION; - } - - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - - uint32 spellId = 0; - int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f); - - if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_HEAL)) - spellId = ALECHEMIST_STONE_HEAL; - else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_ENERGIZE)) - spellId = ALECHEMIST_STONE_MANA; - - if (!spellId) - return; - - GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); - } - - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_gen_alchemist_stone_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_gen_alchemist_stone_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_gen_alchemist_stone_AuraScript(); - } -}; - class spell_gen_allow_cast_from_item_only : public SpellScriptLoader { public: @@ -1467,51 +1406,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: @@ -2664,6 +2558,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()->GetEffect(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, @@ -3629,6 +3558,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 @@ -4623,7 +4599,6 @@ void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); new spell_gen_adaptive_warding(); - new spell_gen_alchemist_stone(); new spell_gen_allow_cast_from_item_only(); new spell_gen_animal_blood(); new spell_gen_aura_of_anger(); @@ -4651,7 +4626,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_fishing(); @@ -4677,6 +4651,12 @@ void AddSC_generic_spell_scripts() new spell_gen_on_tournament_mount(); 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(); @@ -4700,6 +4680,7 @@ void AddSC_generic_spell_scripts() new spell_pvp_trinket_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_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 54761ee98f9..8c9ebcfad20 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -35,6 +35,8 @@ enum HunterSpells { SPELL_HUNTER_BESTIAL_WRATH = 19574, SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353, + SPELL_HUNTER_EXHILARATION = 109304, + SPELL_HUNTER_EXHILARATION_PET = 128594, SPELL_HUNTER_FIRE = 82926, SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS = 91954, SPELL_HUNTER_IMPROVED_MEND_PET = 24406, @@ -47,14 +49,12 @@ enum HunterSpells SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711, SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045, - SPELL_HUNTER_RAPID_RECUPERATION = 58883, SPELL_HUNTER_READINESS = 23989, SPELL_HUNTER_SERPENT_STING = 1978, SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302, SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418, SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443, SPELL_HUNTER_T9_4P_GREATNESS = 68130, - SPELL_HUNTER_THRILL_OF_THE_HUNT = 34720, SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481 }; @@ -233,6 +233,44 @@ class spell_hun_disengage : public SpellScriptLoader } }; +// 212658 - Hunting Party +class spell_hun_hunting_party : public SpellScriptLoader +{ + public: + spell_hun_hunting_party() : SpellScriptLoader("spell_hun_hunting_party") { } + + class spell_hun_hunting_party_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_hunting_party_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_HUNTER_EXHILARATION, + SPELL_HUNTER_EXHILARATION_PET + }); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_HUNTER_EXHILARATION, Seconds(aurEff->GetAmount())); + GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_HUNTER_EXHILARATION_PET, Seconds(aurEff->GetAmount())); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_hun_hunting_party_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_hun_hunting_party_AuraScript(); + } +}; + // -19572 - Improved Mend Pet class spell_hun_improved_mend_pet : public SpellScriptLoader { @@ -522,11 +560,13 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* owner = caster->GetOwner()) + { if (!caster->HasAura(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) { owner->CastCustomSpell(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true); caster->CastSpell(caster, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true); } + } } void Register() override @@ -541,54 +581,6 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader } }; -// -53228 - Rapid Recuperation -class spell_hun_rapid_recuperation : public SpellScriptLoader -{ - public: - spell_hun_rapid_recuperation() : SpellScriptLoader("spell_hun_rapid_recuperation") { } - - class spell_hun_rapid_recuperation_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_rapid_recuperation_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_RAPID_RECUPERATION)) - return false; - return true; - } - - void HandleAbilityCast(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) - { - // This effect only from Rapid Fire (ability cast) - if (!(eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[0] & 0x20)) - PreventDefaultAction(); - } - - void HandleFocusRegen(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - // This effect only from Rapid Killing (focus regen) - if (!(eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x01000000)) - return; - - int32 focus = aurEff->GetAmount(); - GetTarget()->CastCustomSpell(SPELL_HUNTER_RAPID_RECUPERATION, SPELLVALUE_BASE_POINT0, focus, GetTarget(), true, NULL, aurEff); - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_hun_rapid_recuperation_AuraScript::HandleAbilityCast, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); - OnEffectProc += AuraEffectProcFn(spell_hun_rapid_recuperation_AuraScript::HandleFocusRegen, EFFECT_1, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_hun_rapid_recuperation_AuraScript(); - } -}; - // 23989 - Readiness class spell_hun_readiness : public SpellScriptLoader { @@ -979,48 +971,6 @@ public: } }; -// 34497 - Thrill of the Hunt -class spell_hun_thrill_of_the_hunt : public SpellScriptLoader -{ - public: - spell_hun_thrill_of_the_hunt() : SpellScriptLoader("spell_hun_thrill_of_the_hunt") { } - - class spell_hun_thrill_of_the_hunt_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_thrill_of_the_hunt_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_THRILL_OF_THE_HUNT)) - return false; - return true; - } - - void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - std::vector<SpellInfo::CostData> costs = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), SpellSchoolMask(eventInfo.GetDamageInfo()->GetSchoolMask())); - auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_FOCUS; }); - if (m != costs.end()) - { - int32 focus = CalculatePct(m->Amount, aurEff->GetAmount()); - if (focus > 0) - GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_THRILL_OF_THE_HUNT, &focus, NULL, NULL, true, NULL, aurEff); - } - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_hun_thrill_of_the_hunt_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_hun_thrill_of_the_hunt_AuraScript(); - } -}; - // -56333 - T.N.T. class spell_hun_tnt : public SpellScriptLoader { @@ -1068,6 +1018,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_chimera_shot(); new spell_hun_cobra_shot(); new spell_hun_disengage(); + new spell_hun_hunting_party(); new spell_hun_improved_mend_pet(); new spell_hun_last_stand_pet(); new spell_hun_masters_call(); @@ -1075,7 +1026,6 @@ void AddSC_hunter_spell_scripts() new spell_hun_misdirection_proc(); new spell_hun_pet_carrion_feeder(); new spell_hun_pet_heart_of_the_phoenix(); - new spell_hun_rapid_recuperation(); new spell_hun_readiness(); new spell_hun_ready_set_aim(); new spell_hun_roar_of_sacrifice(); @@ -1085,6 +1035,5 @@ void AddSC_hunter_spell_scripts() new spell_hun_tame_beast(); new spell_hun_target_only_pet_and_owner(); new spell_hun_t9_4p_bonus(); - new spell_hun_thrill_of_the_hunt(); new spell_hun_tnt(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index ad22ed56433..fe2c7b3b170 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -114,6 +114,139 @@ class spell_item_aegis_of_preservation : public SpellScriptLoader } }; +enum AlchemistStone +{ + SPELL_ALCHEMIST_STONE_EXTRA_HEAL = 21399, + SPELL_ALCHEMIST_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 Stone +class spell_item_alchemist_stone : public SpellScriptLoader +{ + public: + spell_item_alchemist_stone() : SpellScriptLoader("spell_item_alchemist_stone") { } + + class spell_item_alchemist_stone_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_alchemist_stone_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_ALCHEMIST_STONE_EXTRA_HEAL) || + !sSpellMgr->GetSpellInfo(SPELL_ALCHEMIST_STONE_EXTRA_MANA)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_POTION; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId = 0; + int32 amount = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f); + + if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_HEAL)) + spellId = SPELL_ALCHEMIST_STONE_EXTRA_HEAL; + else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_ENERGIZE)) + spellId = SPELL_ALCHEMIST_STONE_EXTRA_MANA; + + if (!spellId) + return; + + GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, GetTarget(), true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_item_alchemist_stone_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_alchemist_stone_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_alchemist_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 <uint8 StackAmount> +class spell_item_anger_capacitor : public SpellScriptLoader +{ + public: + spell_item_anger_capacitor(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint8 Stacks> + 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<StackAmount>(); + } +}; + // 26400 - Arcane Shroud class spell_item_arcane_shroud : public SpellScriptLoader { @@ -143,6 +276,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) || + !sBroadcastTextStore.LookupEntry(SAY_MADNESS)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + static std::vector<uint32> 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 { @@ -174,7 +439,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, EFFECT_0, eventInfo.GetActor()->GetGUID())) { // The shield can grow to a maximum size of 20,000 damage absorbtion @@ -200,6 +469,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 <uint32 StrengthSpellId, uint32 AgilitySpellId, uint32 APSpellId, uint32 CriticalSpellId, uint32 HasteSpellId> +class spell_item_deathbringers_will : public SpellScriptLoader +{ + public: + spell_item_deathbringers_will(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint32 Strength, uint32 Agility, uint32 AttackPower, uint32 Critical, uint32 Haste> + 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<uint32> 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<StrengthSpellId, AgilitySpellId, APSpellId, CriticalSpellId, HasteSpellId>(); + } +}; + // 47770 - Roll Dice class spell_item_decahedral_dwarven_dice : public SpellScriptLoader { @@ -399,6 +830,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 { @@ -457,6 +928,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); } @@ -548,6 +1020,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<int32>(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 @@ -596,6 +1115,122 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader } }; +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 <uint32 EnergySpellId, uint32 ManaSpellId, uint32 RageSpellId, uint32 RPSpellId> +class spell_item_heartpierce : public SpellScriptLoader +{ + public: + spell_item_heartpierce(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint32 Energy, uint32 Mana, uint32 Rage, uint32 RunicPower> + 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<EnergySpellId, ManaSpellId, RageSpellId, RPSpellId>(); + } +}; + +// 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 Validate(SpellInfo const* spellInfo) override + { + return spellInfo->GetEffect(EFFECT_0); + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + int32 pct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(); + if (HealInfo* healInfo = eventInfo.GetHealInfo()) + if (Unit* healTarget = healInfo->GetTarget()) + // @todo: fix me 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 @@ -654,6 +1289,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 @@ -864,6 +1546,143 @@ 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()) + { + std::vector<SpellInfo::CostData> costs = spellInfo->CalcPowerCost(GetTarget(), spellInfo->GetSchoolMask()); + auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA && cost.Amount > 0; }); + if (m != costs.end()) + return true; + } + + 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<int32>(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 { @@ -1291,6 +2110,49 @@ 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(); + } +}; + // 28862 - The Eye of Diminution class spell_item_the_eye_of_diminution : public SpellScriptLoader { @@ -2754,6 +3616,64 @@ 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 <uint32 HealProcSpellId, uint32 DamageProcSpellId> +class spell_item_shard_of_the_scale : public SpellScriptLoader +{ + public: + spell_item_shard_of_the_scale(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint32 HealProc, uint32 DamageProc> + 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<HealProcSpellId, DamageProcSpellId>(); + } +}; + enum SoulPreserver { SPELL_SOUL_PRESERVER_DRUID = 60512, @@ -2818,6 +3738,90 @@ public: } }; +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 <uint32 AldorSpellId, uint32 ScryersSpellId> +class spell_item_sunwell_neck : public SpellScriptLoader +{ + public: + spell_item_sunwell_neck(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint32 Aldors, uint32 Scryers> + 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<AldorSpellId, ScryersSpellId>(); + } +}; + class spell_item_toy_train_set_pulse : public SpellScriptLoader { public: @@ -3201,6 +4205,69 @@ class spell_item_taunt_flag_targeting : 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; +}; + class spell_item_artifical_stamina : public SpellScriptLoader { public: @@ -3522,22 +4589,40 @@ void AddSC_item_spell_scripts() new spell_item_aegis_of_preservation(); new spell_item_arcane_shroud(); + new spell_item_alchemist_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_STRENGTH_OF_THE_TAUNKA, SPELL_AGILITY_OF_THE_VRYKUL, SPELL_POWER_OF_THE_TAUNKA, SPELL_AIM_OF_THE_IRON_DWARVES, SPELL_SPEED_OF_THE_VRYKUL>("spell_item_deathbringers_will_normal"); + new spell_item_deathbringers_will<SPELL_STRENGTH_OF_THE_TAUNKA_HERO, SPELL_AGILITY_OF_THE_VRYKUL_HERO, SPELL_POWER_OF_THE_TAUNKA_HERO, SPELL_AIM_OF_THE_IRON_DWARVES_HERO, SPELL_SPEED_OF_THE_VRYKUL_HERO>("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_heartpierce<SPELL_INVIGORATION_ENERGY, SPELL_INVIGORATION_MANA, SPELL_INVIGORATION_RAGE, SPELL_INVIGORATION_RP>("spell_item_heartpierce"); + new spell_item_heartpierce<SPELL_INVIGORATION_ENERGY_HERO, SPELL_INVIGORATION_MANA_HERO, SPELL_INVIGORATION_RAGE_HERO, SPELL_INVIGORATION_RP_HERO>("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(); @@ -3546,6 +4631,7 @@ 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_the_eye_of_diminution(); new spell_item_underbelly_elixir(); new spell_item_wormhole_pandaria(); @@ -3579,7 +4665,13 @@ 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_PURIFIED_CAUTERIZING_HEAL, SPELL_PURIFIED_SEARING_FLAMES>("spell_item_purified_shard_of_the_scale"); + new spell_item_shard_of_the_scale<SPELL_SHINY_CAUTERIZING_HEAL, SPELL_SHINY_SEARING_FLAMES>("spell_item_shiny_shard_of_the_scale"); new spell_item_soul_preserver(); + new spell_item_sunwell_neck<SPELL_LIGHTS_WRATH, SPELL_ARCANE_BOLT>("spell_item_sunwell_exalted_caster_neck"); + new spell_item_sunwell_neck<SPELL_LIGHTS_STRENGTH, SPELL_ARCANE_STRIKE>("spell_item_sunwell_exalted_melee_neck"); + new spell_item_sunwell_neck<SPELL_LIGHTS_WARD, SPELL_ARCANE_INSIGHT>("spell_item_sunwell_exalted_tank_neck"); + new spell_item_sunwell_neck<SPELL_LIGHTS_SALVATION, SPELL_ARCANE_SURGE>("spell_item_sunwell_exalted_healer_neck"); new spell_item_toy_train_set_pulse(); new spell_item_death_choice(); new spell_item_trinket_stack("spell_item_lightning_capacitor", SPELL_LIGHTNING_CAPACITOR_STACK, SPELL_LIGHTNING_CAPACITOR_TRIGGER); @@ -3589,6 +4681,8 @@ void AddSC_item_spell_scripts() new spell_item_darkmoon_card_greatness(); new spell_item_mana_drain(); new spell_item_taunt_flag_targeting(); + 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_artifical_stamina(); new spell_item_artifical_damage(); new spell_item_talisman_of_ascendance(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index f375de663ff..41a545ce5e7 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -31,10 +31,6 @@ enum MageSpells { - SPELL_ARCANCE_POTENCY_RANK_1 = 31571, - SPELL_ARCANCE_POTENCY_RANK_2 = 31572, - SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1 = 57529, - SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2 = 57531, SPELL_MAGE_BLAZING_BARRIER_TRIGGER = 235314, SPELL_MAGE_COLD_SNAP = 11958, SPELL_MAGE_CONJURE_REFRESHMENT = 116136, @@ -46,6 +42,7 @@ enum MageSpells SPELL_MAGE_IMPROVED_POLYMORPH_STUN_RANK_1 = 83046, SPELL_MAGE_IMPROVED_POLYMORPH_MARKER = 87515, SPELL_MAGE_IGNITE = 12654, + SPELL_MAGE_MANA_SURGE = 37445, SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077, SPELL_MAGE_PERMAFROST = 91394, SPELL_MAGE_SLOW = 31589, @@ -75,54 +72,6 @@ enum MiscSpells SPELL_MAGE_CHILLED = 205708 }; -// -31571 - Arcane Potency -class spell_mage_arcane_potency : public SpellScriptLoader -{ - public: - spell_mage_arcane_potency () : SpellScriptLoader("spell_mage_arcane_potency") { } - - class spell_mage_arcane_potency_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_arcane_potency_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_1) || - !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_2) || - !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1) || - !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2)) - return false; - return true; - } - - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - uint32 spellId = 0; - - if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_1) - spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1; - else if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_2) - spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2; - if (!spellId) - return; - - GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); - - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_mage_arcane_potency_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_mage_arcane_potency_AuraScript(); - } -}; - // 235313 - Blazing Barrier class spell_mage_blazing_barrier : public SpellScriptLoader { @@ -171,6 +120,37 @@ class spell_mage_blazing_barrier : public SpellScriptLoader } }; +// 198063 - Burning Determination +class spell_mage_burning_determination : public SpellScriptLoader +{ + public: + spell_mage_burning_determination() : SpellScriptLoader("spell_mage_burning_determination") { } + + class spell_mage_burning_determination_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_burning_determination_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + if (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE))) + return true; + + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_mage_burning_determination_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mage_burning_determination_AuraScript(); + } +}; + // 11958 - Cold Snap class spell_mage_cold_snap : public SpellScriptLoader { @@ -338,45 +318,34 @@ class spell_mage_focus_magic : public SpellScriptLoader } }; -// 56372 - Glyph of Ice Block -class spell_mage_glyph_of_ice_block : public SpellScriptLoader +// 195283 - Hot Streak +class spell_mage_hot_streak : public SpellScriptLoader { public: - spell_mage_glyph_of_ice_block() : SpellScriptLoader("spell_mage_glyph_of_ice_block") { } + spell_mage_hot_streak() : SpellScriptLoader("spell_mage_hot_streak") { } - class spell_mage_glyph_of_ice_block_AuraScript : public AuraScript + class spell_mage_hot_streak_AuraScript : public AuraScript { - PrepareAuraScript(spell_mage_glyph_of_ice_block_AuraScript); + PrepareAuraScript(spell_mage_hot_streak_AuraScript); bool Validate(SpellInfo const* /*spellInfo*/) override { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_NOVA)) - return false; return true; } - bool CheckProc(ProcEventInfo& /*eventInfo*/) - { - return GetTarget()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - PreventDefaultAction(); - // Remove Frost Nova cooldown - GetTarget()->GetSpellHistory()->ResetCooldown(SPELL_MAGE_FROST_NOVA, true); } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_mage_glyph_of_ice_block_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_ice_block_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_mage_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; AuraScript* GetAuraScript() const override { - return new spell_mage_glyph_of_ice_block_AuraScript(); + return new spell_mage_hot_streak_AuraScript(); } }; @@ -449,6 +418,42 @@ class spell_mage_glyph_of_polymorph : public SpellScriptLoader } }; +// 37447 - Improved Mana Gems +// 61062 - Improved Mana Gems +class spell_mage_imp_mana_gems : public SpellScriptLoader +{ + public: + spell_mage_imp_mana_gems() : SpellScriptLoader("spell_mage_imp_mana_gems") { } + + class spell_mage_imp_mana_gems_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_imp_mana_gems_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_MANA_SURGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MAGE_MANA_SURGE, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_mage_imp_mana_gems_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mage_imp_mana_gems_AuraScript(); + } +}; + // 44457 - Living Bomb class spell_mage_living_bomb : public SpellScriptLoader { @@ -1140,17 +1145,18 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader void AddSC_mage_spell_scripts() { - new spell_mage_arcane_potency(); new spell_mage_blazing_barrier(); + new spell_mage_burning_determination(); new spell_mage_cold_snap(); new spell_mage_cone_of_cold(); new spell_mage_conjure_refreshment(); new spell_mage_focus_magic(); + new spell_mage_hot_streak(); new spell_mage_ice_barrier(); new spell_mage_ignite(); - new spell_mage_glyph_of_ice_block(); new spell_mage_glyph_of_icy_veins(); new spell_mage_glyph_of_polymorph(); + new spell_mage_imp_mana_gems(); new spell_mage_living_bomb(); new spell_mage_master_of_elements(); new spell_mage_nether_vortex(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 020c8fc9e8e..f9b245ef053 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -45,10 +45,17 @@ enum PaladinSpells SPELL_PALADIN_DIVINE_STEED_BLOODELF = 221886, SPELL_PALADIN_DIVINE_STEED_TAUREN = 221885, SPELL_PALADIN_DIVINE_STORM_DAMAGE = 224239, + SPELL_PALADIN_ENDURING_LIGHT = 40471, + SPELL_PALADIN_ENDURING_JUDGEMENT = 40472, SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 = 9799, SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE = 25997, SPELL_PALADIN_FORBEARANCE = 25771, SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, + SPELL_PALADIN_HOLY_MENDING = 64891, + SPELL_PALADIN_HOLY_POWER_ARMOR = 28790, + SPELL_PALADIN_HOLY_POWER_ATTACK_POWER = 28791, + SPELL_PALADIN_HOLY_POWER_SPELL_POWER = 28793, + SPELL_PALADIN_HOLY_POWER_MP5 = 28795, SPELL_PALADIN_HOLY_SHOCK_R1 = 20473, SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912, SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914, @@ -736,6 +743,65 @@ class spell_pal_item_healing_discount : public SpellScriptLoader } }; +// 40470 - Paladin Tier 6 Trinket +class spell_pal_item_t6_trinket : public SpellScriptLoader +{ + public: + spell_pal_item_t6_trinket() : SpellScriptLoader("spell_pal_item_t6_trinket") { } + + class spell_pal_item_t6_trinket_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_item_t6_trinket_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ENDURING_LIGHT) || + !sSpellMgr->GetSpellInfo(SPELL_PALADIN_ENDURING_JUDGEMENT)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + uint32 spellId; + int32 chance; + + // Holy Light & Flash of Light + if (spellInfo->SpellFamilyFlags[0] & 0xC0000000) + { + spellId = SPELL_PALADIN_ENDURING_LIGHT; + chance = 15; + } + // Judgements + else if (spellInfo->SpellFamilyFlags[0] & 0x00800000) + { + spellId = SPELL_PALADIN_ENDURING_JUDGEMENT; + chance = 50; + } + else + return; + + if (roll_chance_i(chance)) + eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pal_item_t6_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pal_item_t6_trinket_AuraScript(); + } +}; + // 20271 - Judgement /// Updated 4.3.4 class spell_pal_judgement : public SpellScriptLoader @@ -763,11 +829,13 @@ class spell_pal_judgement : public SpellScriptLoader for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) { if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2) + { if (sSpellMgr->GetSpellInfo((*i)->GetAmount())) { spellId = (*i)->GetAmount(); break; } + } } GetCaster()->CastSpell(GetHitUnit(), spellId, true); @@ -797,8 +865,9 @@ class spell_pal_lay_on_hands : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) override { - if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE) || - !sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) return false; return true; } @@ -808,11 +877,8 @@ class spell_pal_lay_on_hands : public SpellScriptLoader Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) if (caster == target) - if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || - target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) - { + if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) return SPELL_FAILED_TARGET_AURASTATE; - } return SPELL_CAST_OK; } @@ -871,7 +937,11 @@ class spell_pal_light_s_beacon : public SpellScriptLoader { PreventDefaultAction(); - uint32 heal = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount()); + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + uint32 heal = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()); Unit::AuraList const& auras = GetCaster()->GetSingleCastAuras(); for (Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) @@ -1161,6 +1231,120 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader } }; +// 28789 - Holy Power +class spell_pal_t3_6p_bonus : public SpellScriptLoader +{ + public: + spell_pal_t3_6p_bonus() : SpellScriptLoader("spell_pal_t3_6p_bonus") { } + + class spell_pal_t3_6p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_t3_6p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_POWER_ARMOR) || + !sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_POWER_ATTACK_POWER) || + !sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_POWER_SPELL_POWER) || + !sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_POWER_MP5)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId; + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + switch (target->getClass()) + { + case CLASS_PALADIN: + case CLASS_PRIEST: + case CLASS_SHAMAN: + case CLASS_DRUID: + spellId = SPELL_PALADIN_HOLY_POWER_MP5; + break; + case CLASS_MAGE: + case CLASS_WARLOCK: + spellId = SPELL_PALADIN_HOLY_POWER_SPELL_POWER; + break; + case CLASS_HUNTER: + case CLASS_ROGUE: + spellId = SPELL_PALADIN_HOLY_POWER_ATTACK_POWER; + break; + case CLASS_WARRIOR: + spellId = SPELL_PALADIN_HOLY_POWER_ARMOR; + break; + default: + return; + } + + caster->CastSpell(target, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pal_t3_6p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pal_t3_6p_bonus_AuraScript(); + } +}; + +// 64890 Item - Paladin T8 Holy 2P Bonus +class spell_pal_t8_2p_bonus : public SpellScriptLoader +{ + public: + spell_pal_t8_2p_bonus() : SpellScriptLoader("spell_pal_t8_2p_bonus") { } + + class spell_pal_t8_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_t8_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_MENDING)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_HOLY_MENDING); + int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + // Add remaining ticks to damage done + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PALADIN_HOLY_MENDING, SPELL_AURA_PERIODIC_HEAL); + + caster->CastCustomSpell(SPELL_PALADIN_HOLY_MENDING, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pal_t8_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pal_t8_2p_bonus_AuraScript(); + } +}; void AddSC_paladin_spell_scripts() { @@ -1178,6 +1362,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_hand_of_sacrifice(); new spell_pal_holy_shock(); new spell_pal_item_healing_discount(); + new spell_pal_item_t6_trinket(); new spell_pal_judgement(); new spell_pal_lay_on_hands(); new spell_pal_light_s_beacon(); @@ -1186,4 +1371,6 @@ void AddSC_paladin_spell_scripts() new spell_pal_shield_of_the_righteous(); new spell_pal_templar_s_verdict(); new spell_pal_seal_of_righteousness(); + new spell_pal_t3_6p_bonus(); + new spell_pal_t8_2p_bonus(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index a815f8d893b..1244f8983e5 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -35,6 +35,8 @@ enum PriestSpells SPELL_PRIEST_ANGELIC_FEATHER_TRIGGER = 121536, SPELL_PRIEST_ANGELIC_FEATHER_AURA = 121557, SPELL_PRIEST_ANGELIC_FEATHER_AREATRIGGER = 158624, + SPELL_PRIEST_ARMOR_OF_FAITH = 28810, + SPELL_PRIEST_BLESSED_HEALING = 70772, SPELL_PRIEST_BODY_AND_SOUL = 64129, SPELL_PRIEST_BODY_AND_SOUL_DISPEL = 64136, SPELL_PRIEST_BODY_AND_SOUL_SPEED = 65081, @@ -42,6 +44,8 @@ enum PriestSpells SPELL_PRIEST_DISPEL_MAGIC_FRIENDLY = 97690, SPELL_PRIEST_DISPEL_MAGIC_HOSTILE = 97691, SPELL_PRIEST_DIVINE_AEGIS = 47753, + SPELL_PRIEST_DIVINE_BLESSING = 40440, + SPELL_PRIEST_DIVINE_WRATH = 40441, SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675, SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC = 55677, SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL = 56131, @@ -56,6 +60,7 @@ enum PriestSpells SPELL_PRIEST_LEAP_OF_FAITH_TRIGGERED = 92572, SPELL_PRIEST_LEVITATE_EFFECT = 111759, SPELL_PRIEST_MANA_LEECH_PROC = 34650, + SPELL_PRIEST_ORACULAR_HEAL = 26170, SPELL_PRIEST_PENANCE_R1 = 47540, SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, SPELL_PRIEST_PENANCE_R1_HEAL = 47757, @@ -117,6 +122,51 @@ class RaidCheck Unit const* _caster; }; +// 26169 - Oracle Healing Bonus +class spell_pri_aq_3p_bonus : public SpellScriptLoader +{ + public: + spell_pri_aq_3p_bonus() : SpellScriptLoader("spell_pri_aq_3p_bonus") { } + + class spell_pri_aq_3p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_aq_3p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ORACULAR_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + if (caster == eventInfo.GetProcTarget()) + return; + + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), 10); + caster->CastCustomSpell(SPELL_PRIEST_ORACULAR_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pri_aq_3p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pri_aq_3p_bonus_AuraScript(); + } +}; + +// 64129 - Body and Soul class spell_pri_body_and_soul : public SpellScriptLoader { public: @@ -295,7 +345,11 @@ class spell_pri_divine_aegis : public SpellScriptLoader { PreventDefaultAction(); - int32 absorb = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()); + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + int32 absorb = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()); // Multiple effects stack, so let's try to find this aura. if (AuraEffect const* aegis = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PRIEST_DIVINE_AEGIS, EFFECT_0)) @@ -375,8 +429,12 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader { PreventDefaultAction(); + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL); - int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks(DIFFICULTY_NONE)); + int32 heal = int32(CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks(DIFFICULTY_NONE)); GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff); } @@ -428,41 +486,6 @@ class spell_pri_improved_power_word_shield : public SpellScriptLoader } }; -// 37594 - Greater Heal Refund -class spell_pri_item_greater_heal_refund : public SpellScriptLoader -{ - public: - spell_pri_item_greater_heal_refund() : SpellScriptLoader("spell_pri_item_greater_heal_refund") { } - - class spell_pri_item_greater_heal_refund_AuraScript : public AuraScript - { - PrepareAuraScript(spell_pri_item_greater_heal_refund_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY)) - return false; - return true; - } - - void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff); - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_pri_item_greater_heal_refund_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_pri_item_greater_heal_refund_AuraScript(); - } -}; - // 47788 - Guardian Spirit class spell_pri_guardian_spirit : public SpellScriptLoader { @@ -563,6 +586,47 @@ class spell_pri_hymn_of_hope : public SpellScriptLoader } }; +// 40438 - Priest Tier 6 Trinket +class spell_pri_item_t6_trinket : public SpellScriptLoader +{ + public: + spell_pri_item_t6_trinket() : SpellScriptLoader("spell_pri_item_t6_trinket") { } + + class spell_pri_item_t6_trinket_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_item_t6_trinket_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_BLESSING) || + !sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_WRATH)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_HEAL) + caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_BLESSING, true); + + if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_DAMAGE) + caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_WRATH, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pri_item_t6_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pri_item_t6_trinket_AuraScript(); + } +}; + // 92833 - Leap of Faith class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader { @@ -1050,6 +1114,137 @@ class spell_pri_shadowform : public SpellScriptLoader } }; +// 28809 - Greater Heal +class spell_pri_t3_4p_bonus : public SpellScriptLoader +{ + public: + spell_pri_t3_4p_bonus() : SpellScriptLoader("spell_pri_t3_4p_bonus") { } + + class spell_pri_t3_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_t3_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ARMOR_OF_FAITH)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pri_t3_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pri_t3_4p_bonus_AuraScript(); + } +}; + +// 37594 - Greater Heal Refund +class spell_pri_t5_heal_2p_bonus : public SpellScriptLoader +{ + public: + spell_pri_t5_heal_2p_bonus() : SpellScriptLoader("spell_pri_t5_heal_2p_bonus") { } + + class spell_pri_t5_heal_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_t5_heal_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (HealInfo* healInfo = eventInfo.GetHealInfo()) + if (Unit* healTarget = healInfo->GetTarget()) + // @todo: fix me later if (healInfo->GetEffectiveHeal()) + if (healTarget->GetHealth() >= healTarget->GetMaxHealth()) + return true; + + return false; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_pri_t5_heal_2p_bonus_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pri_t5_heal_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pri_t5_heal_2p_bonus_AuraScript(); + } +}; + +// 70770 - Item - Priest T10 Healer 2P Bonus +class spell_pri_t10_heal_2p_bonus : public SpellScriptLoader +{ + public: + spell_pri_t10_heal_2p_bonus() : SpellScriptLoader("spell_pri_t10_heal_2p_bonus") { } + + class spell_pri_t10_heal_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_t10_heal_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_BLESSED_HEALING)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_BLESSED_HEALING); + int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + + // Add remaining ticks to healing done + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PRIEST_BLESSED_HEALING, SPELL_AURA_PERIODIC_HEAL); + + caster->CastCustomSpell(SPELL_PRIEST_BLESSED_HEALING, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pri_t10_heal_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pri_t10_heal_2p_bonus_AuraScript(); + } +}; + // 15286 - Vampiric Embrace class spell_pri_vampiric_embrace : public SpellScriptLoader { @@ -1076,10 +1271,14 @@ class spell_pri_vampiric_embrace : public SpellScriptLoader void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 self = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount())); - int32 team = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount() / 2)); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 selfHeal = int32(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount())); + int32 teamHeal = selfHeal / 2; - GetTarget()->CastCustomSpell((Unit*)NULL, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &team, &self, NULL, true, NULL, aurEff); + GetTarget()->CastCustomSpell((Unit*)NULL, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &teamHeal, &selfHeal, NULL, true, NULL, aurEff); } void Register() override @@ -1143,13 +1342,17 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) + { if (Unit* target = GetUnitOwner()) + { if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { int32 damage = aurEff->GetAmount() * 8; // backfire damage caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } + } + } } bool CheckProc(ProcEventInfo& eventInfo) @@ -1159,6 +1362,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { + PreventDefaultAction(); eventInfo.GetProcTarget()->CastSpell((Unit*)NULL, SPELL_GEN_REPLENISHMENT, true, NULL, aurEff); } @@ -1267,6 +1471,7 @@ public: void AddSC_priest_spell_scripts() { + new spell_pri_aq_3p_bonus(); new spell_pri_body_and_soul(); new spell_pri_circle_of_healing(); new spell_pri_dispel_magic(); @@ -1275,8 +1480,8 @@ void AddSC_priest_spell_scripts() new spell_pri_glyph_of_prayer_of_healing(); new spell_pri_hymn_of_hope(); new spell_pri_improved_power_word_shield(); - new spell_pri_item_greater_heal_refund(); new spell_pri_guardian_spirit(); + new spell_pri_item_t6_trinket(); new spell_pri_leap_of_faith_effect_trigger(); new spell_pri_levitate(); new spell_pri_lightwell_renew(); @@ -1288,6 +1493,9 @@ void AddSC_priest_spell_scripts() new spell_pri_power_word_shield(); new spell_pri_prayer_of_mending_heal(); new spell_pri_shadowform(); + new spell_pri_t3_4p_bonus(); + new spell_pri_t5_heal_2p_bonus(); + new spell_pri_t10_heal_2p_bonus(); new spell_pri_vampiric_embrace(); new spell_pri_vampiric_embrace_target(); new spell_pri_vampiric_touch(); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 4ddf06e7b5e..6c8e6410bca 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -49,13 +49,11 @@ enum RogueSpells SPELL_ROGUE_VANISH_AURA = 11327, SPELL_ROGUE_PREY_ON_THE_WEAK = 58670, SPELL_ROGUE_SHIV_TRIGGERED = 5940, - SPELL_ROGUE_SILCE_AND_DICE = 5171, SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST = 57933, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628, SPELL_ROGUE_SERRATED_BLADES_R1 = 14171, SPELL_ROGUE_RUPTURE = 1943, - SPELL_ROGUE_HONOR_AMONG_THIEVES = 51698, - SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 51699, + SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE = 51699, SPELL_ROGUE_T5_2P_SET_BONUS = 37169 }; @@ -224,35 +222,6 @@ class spell_rog_crippling_poison : public SpellScriptLoader } }; -// -51664 - Cut to the Chase -class spell_rog_cut_to_the_chase : public SpellScriptLoader -{ - public: - spell_rog_cut_to_the_chase () : SpellScriptLoader("spell_rog_cut_to_the_chase") { } - - class spell_rog_cut_to_the_chase_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_cut_to_the_chase_AuraScript); - - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - if (Aura* aur = GetTarget()->GetAura(SPELL_ROGUE_SILCE_AND_DICE)) - aur->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true); - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_rog_cut_to_the_chase_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_rog_cut_to_the_chase_AuraScript(); - } -}; - // 2818 - Deadly Poison class spell_rog_deadly_poison : public SpellScriptLoader { @@ -907,7 +876,8 @@ public: } }; -// 51701 - Honor Among Thieves +// 198031 - Honor Among Thieves +/// 7.1.5 class spell_rog_honor_among_thieves : public SpellScriptLoader { public: @@ -917,12 +887,20 @@ public: { PrepareAuraScript(spell_rog_honor_among_thieves_AuraScript); + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE + }); + } + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); - Unit* target = GetUnitOwner(); - target->CastSpell(target, SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE, TRIGGERED_FULL_MASK, nullptr, aurEff); } void Register() override @@ -937,33 +915,6 @@ public: } }; -// 70805 - Rogue T10 2P Bonus -- THIS SHOULD BE REMOVED WITH NEW PROC SYSTEM. -class spell_rog_t10_2p_bonus : public SpellScriptLoader -{ -public: - spell_rog_t10_2p_bonus() : SpellScriptLoader("spell_rog_t10_2p_bonus") { } - - class spell_rog_t10_2p_bonus_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_t10_2p_bonus_AuraScript); - - bool CheckProc(ProcEventInfo& eventInfo) - { - return eventInfo.GetActor() == eventInfo.GetActionTarget(); - } - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_rog_t10_2p_bonus_AuraScript::CheckProc); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_rog_t10_2p_bonus_AuraScript(); - } -}; - // 2098 - Eviscerate class spell_rog_eviscerate : public SpellScriptLoader { @@ -1031,7 +982,6 @@ void AddSC_rogue_spell_scripts() new spell_rog_blade_flurry(); new spell_rog_cheat_death(); new spell_rog_crippling_poison(); - new spell_rog_cut_to_the_chase(); new spell_rog_deadly_poison(); new spell_rog_killing_spree(); new spell_rog_master_of_subtlety(); @@ -1045,7 +995,6 @@ void AddSC_rogue_spell_scripts() new spell_rog_tricks_of_the_trade_proc(); new spell_rog_serrated_blades(); new spell_rog_honor_among_thieves(); - new spell_rog_t10_2p_bonus(); new spell_rog_eviscerate(); new spell_rog_envenom(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index ac383e3dedc..6ed2e92592d 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -34,15 +34,18 @@ enum ShamanSpells { SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281, SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911, + SPELL_SHAMAN_CHAINED_HEAL = 70809, SPELL_SHAMAN_CRASH_LIGHTNING_CLEAVE = 187878, SPELL_SHAMAN_EARTH_SHIELD_HEAL = 204290, SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE = 170374, SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC = 170377, SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE = 170379, + SPELL_SHAMAN_ELECTRIFIED = 64930, SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT = 118522, SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE = 173183, SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY = 173184, SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166, + SPELL_SHAMAN_ENERGY_SURGE = 40465, SPELL_SHAMAN_EXHAUSTION = 57723, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED = 8349, SPELL_SHAMAN_FLAME_SHOCK = 8050, @@ -55,12 +58,18 @@ enum ShamanSpells SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE = 27635, SPELL_SHAMAN_ITEM_MANA_SURGE = 23571, SPELL_SHAMAN_LAVA_BURST = 51505, + SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE = 71824, SPELL_SHAMAN_LAVA_LASH_SPREAD_FLAME_SHOCK = 105792, SPELL_SHAMAN_LAVA_SURGE = 77762, SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD = 210621, SPELL_SHAMAN_PATH_OF_FLAMES_TALENT = 201909, + SPELL_SHAMAN_POWER_SURGE = 40466, SPELL_SHAMAN_SATED = 57724, SPELL_SHAMAN_TIDAL_WAVES = 53390, + SPELL_SHAMAN_TOTEMIC_POWER_MP5 = 28824, + SPELL_SHAMAN_TOTEMIC_POWER_SPELL_POWER = 28825, + SPELL_SHAMAN_TOTEMIC_POWER_ATTACK_POWER = 28826, + SPELL_SHAMAN_TOTEMIC_POWER_ARMOR = 28827, SPELL_SHAMAN_WINDFURY_ATTACK = 25504 }; @@ -576,7 +585,7 @@ class spell_sha_item_lightning_shield : public SpellScriptLoader return true; } - void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, NULL, aurEff); @@ -584,7 +593,7 @@ class spell_sha_item_lightning_shield : public SpellScriptLoader void Register() override { - OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -611,7 +620,7 @@ class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader return true; } - void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, NULL, aurEff); @@ -619,7 +628,7 @@ class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader void Register() override { - OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_trigger_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_sha_item_lightning_shield_trigger_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -646,9 +655,18 @@ class spell_sha_item_mana_surge : public SpellScriptLoader return true; } - void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetSpellInfo() != nullptr; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + std::vector<SpellInfo::CostData> costs = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask()); auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; }); if (m != costs.end()) @@ -661,7 +679,8 @@ class spell_sha_item_mana_surge : public SpellScriptLoader void Register() override { - OnEffectProc += AuraEffectProcFn(spell_sha_item_mana_surge_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + DoCheckProc += AuraCheckProcFn(spell_sha_item_mana_surge_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_item_mana_surge_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -671,6 +690,71 @@ class spell_sha_item_mana_surge : public SpellScriptLoader } }; +// 40463 - Shaman Tier 6 Trinket +class spell_sha_item_t6_trinket : public SpellScriptLoader +{ + public: + spell_sha_item_t6_trinket() : SpellScriptLoader("spell_sha_item_t6_trinket") { } + + class spell_sha_item_t6_trinket_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_item_t6_trinket_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ENERGY_SURGE) || + !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_POWER_SURGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo) + return; + + uint32 spellId; + int32 chance; + + // Lesser Healing Wave + if (spellInfo->SpellFamilyFlags[0] & 0x00000080) + { + spellId = SPELL_SHAMAN_ENERGY_SURGE; + chance = 10; + } + // Lightning Bolt + else if (spellInfo->SpellFamilyFlags[0] & 0x00000001) + { + spellId = SPELL_SHAMAN_ENERGY_SURGE; + chance = 15; + } + // Stormstrike + else if (spellInfo->SpellFamilyFlags[1] & 0x00000010) + { + spellId = SPELL_SHAMAN_POWER_SURGE; + chance = 50; + } + else + return; + + if (roll_chance_i(chance)) + eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_item_t6_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_item_t6_trinket_AuraScript(); + } +}; + // 70811 - Item - Shaman T10 Elemental 2P Bonus class spell_sha_item_t10_elemental_2p_bonus : public SpellScriptLoader { @@ -941,6 +1025,264 @@ class spell_sha_tidal_waves : public SpellScriptLoader } }; +// 28823 - Totemic Power +class spell_sha_t3_6p_bonus : public SpellScriptLoader +{ + public: + spell_sha_t3_6p_bonus() : SpellScriptLoader("spell_sha_t3_6p_bonus") { } + + class spell_sha_t3_6p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_t3_6p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_POWER_ARMOR) || + !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_POWER_ATTACK_POWER) || + !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_POWER_SPELL_POWER) || + !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_POWER_MP5)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId; + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + switch (target->getClass()) + { + case CLASS_PALADIN: + case CLASS_PRIEST: + case CLASS_SHAMAN: + case CLASS_DRUID: + spellId = SPELL_SHAMAN_TOTEMIC_POWER_MP5; + break; + case CLASS_MAGE: + case CLASS_WARLOCK: + spellId = SPELL_SHAMAN_TOTEMIC_POWER_SPELL_POWER; + break; + case CLASS_HUNTER: + case CLASS_ROGUE: + spellId = SPELL_SHAMAN_TOTEMIC_POWER_ATTACK_POWER; + break; + case CLASS_WARRIOR: + spellId = SPELL_SHAMAN_TOTEMIC_POWER_ARMOR; + break; + default: + return; + } + + caster->CastSpell(target, spellId, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_t3_6p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_t3_6p_bonus_AuraScript(); + } +}; + +// 64928 - Item - Shaman T8 Elemental 4P Bonus +class spell_sha_t8_elemental_4p_bonus : public SpellScriptLoader +{ + public: + spell_sha_t8_elemental_4p_bonus() : SpellScriptLoader("spell_sha_t8_elemental_4p_bonus") { } + + class spell_sha_t8_elemental_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_t8_elemental_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELECTRIFIED)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_ELECTRIFIED); + int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + + // Add remaining ticks to healing done + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_ELECTRIFIED, SPELL_AURA_PERIODIC_DAMAGE); + + caster->CastCustomSpell(SPELL_SHAMAN_ELECTRIFIED, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_t8_elemental_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_t8_elemental_4p_bonus_AuraScript(); + } +}; + +// 67228 - Item - Shaman T9 Elemental 4P Bonus (Lava Burst) +class spell_sha_t9_elemental_4p_bonus : public SpellScriptLoader +{ + public: + spell_sha_t9_elemental_4p_bonus() : SpellScriptLoader("spell_sha_t9_elemental_4p_bonus") { } + + class spell_sha_t9_elemental_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_t9_elemental_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE); + int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + + // Add remaining ticks to healing done + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE); + + caster->CastCustomSpell(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_t9_elemental_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_t9_elemental_4p_bonus_AuraScript(); + } +}; + +// 70817 - Item - Shaman T10 Elemental 4P Bonus +class spell_sha_t10_elemental_4p_bonus : public SpellScriptLoader +{ + public: + spell_sha_t10_elemental_4p_bonus() : SpellScriptLoader("spell_sha_t10_elemental_4p_bonus") { } + + class spell_sha_t10_elemental_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_t10_elemental_4p_bonus_AuraScript); + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + // try to find spell Flame Shock on the target + AuraEffect* flameShock = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, flag128(0x10000000), caster->GetGUID()); + if (!flameShock) + return; + + Aura* flameShockAura = flameShock->GetBase(); + + int32 maxDuration = flameShockAura->GetMaxDuration(); + int32 newDuration = flameShockAura->GetDuration() + aurEff->GetAmount() * IN_MILLISECONDS; + + flameShockAura->SetDuration(newDuration); + // is it blizzlike to change max duration for FS? + if (newDuration > maxDuration) + flameShockAura->SetMaxDuration(newDuration); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_t10_elemental_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_t10_elemental_4p_bonus_AuraScript(); + } +}; + +// 70808 - Item - Shaman T10 Restoration 4P Bonus +class spell_sha_t10_restoration_4p_bonus : public SpellScriptLoader +{ + public: + spell_sha_t10_restoration_4p_bonus() : SpellScriptLoader("spell_sha_t10_restoration_4p_bonus") { } + + class spell_sha_t10_restoration_4p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_t10_restoration_4p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_CHAINED_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + HealInfo* healInfo = eventInfo.GetHealInfo(); + if (!healInfo || !healInfo->GetHeal()) + return; + + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_CHAINED_HEAL); + int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount()); + amount /= spellInfo->GetMaxTicks(DIFFICULTY_NONE); + + // Add remaining ticks to healing done + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_CHAINED_HEAL, SPELL_AURA_PERIODIC_HEAL); + + caster->CastCustomSpell(SPELL_SHAMAN_CHAINED_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_t10_restoration_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_t10_restoration_4p_bonus_AuraScript(); + } +}; + // 33757 - Windfury class spell_sha_windfury : public SpellScriptLoader { @@ -995,6 +1337,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_item_lightning_shield(); new spell_sha_item_lightning_shield_trigger(); new spell_sha_item_mana_surge(); + new spell_sha_item_t6_trinket(); new spell_sha_item_t10_elemental_2p_bonus(); new spell_sha_item_t18_elemental_4p_bonus(); new spell_sha_lava_burst(); @@ -1002,5 +1345,10 @@ void AddSC_shaman_spell_scripts() new spell_sha_lava_surge_proc(); new spell_sha_path_of_flames_spread(); new spell_sha_tidal_waves(); + new spell_sha_t3_6p_bonus(); + new spell_sha_t8_elemental_4p_bonus(); + new spell_sha_t9_elemental_4p_bonus(); + new spell_sha_t10_elemental_4p_bonus(); + new spell_sha_t10_restoration_4p_bonus(); new spell_sha_windfury(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 88cab7f8076..aa4f3cc5086 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -64,6 +64,8 @@ enum WarlockSpells SPELL_WARLOCK_NETHER_TALENT = 91713, SPELL_WARLOCK_RAIN_OF_FIRE = 5740, SPELL_WARLOCK_RAIN_OF_FIRE_DAMAGE = 42223, + SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE = 27285, + SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC = 32865, SPELL_WARLOCK_SHADOW_TRANCE = 17941, SPELL_WARLOCK_SHADOW_WARD = 6229, SPELL_WARLOCK_SOULSHATTER = 32835, @@ -72,7 +74,9 @@ enum WarlockSpells SPELL_WARLOCK_SOUL_SWAP_MOD_COST = 92794, SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER = 92795, SPELL_WARLOCK_UNSTABLE_AFFLICTION = 30108, - SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 + SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, + SPELL_WARLOCK_SHADOWFLAME = 37378, + SPELL_WARLOCK_FLAMESHADOW = 37379, }; enum MiscSpells @@ -930,39 +934,114 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; -// -18094 - Nightfall -// 56218 - Glyph of Corruption -class spell_warl_shadow_trance_proc : public SpellScriptLoader +// 27243 - Seed of Corruption +class spell_warl_seed_of_corruption_dummy : public SpellScriptLoader { public: - spell_warl_shadow_trance_proc() : SpellScriptLoader("spell_warl_shadow_trance_proc") { } + spell_warl_seed_of_corruption_dummy() : SpellScriptLoader("spell_warl_seed_of_corruption_dummy") { } - class spell_warl_shadow_trance_proc_AuraScript : public AuraScript + class spell_warl_seed_of_corruption_dummy_AuraScript : public AuraScript { - PrepareAuraScript(spell_warl_shadow_trance_proc_AuraScript); + PrepareAuraScript(spell_warl_seed_of_corruption_dummy_AuraScript); bool Validate(SpellInfo const* /*spellInfo*/) override { - if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SHADOW_TRANCE)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE)) return false; return true; } - void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo) + return; + + int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); + if (amount > 0) + { + const_cast<AuraEffect*>(aurEff)->SetAmount(amount); + if (!GetTarget()->HealthBelowPctDamaged(1, damageInfo->GetDamage())) + return; + } + + Remove(); + + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->CastSpell(eventInfo.GetActionTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_dummy_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warl_seed_of_corruption_dummy_AuraScript(); + } +}; + +// 32863 - Seed of Corruption +// 36123 - Seed of Corruption +// 38252 - Seed of Corruption +// 39367 - Seed of Corruption +// 44141 - Seed of Corruption +// 70388 - Seed of Corruption +// Monster spells, triggered only on amount drop (not on death) +class spell_warl_seed_of_corruption_generic : public SpellScriptLoader +{ + public: + spell_warl_seed_of_corruption_generic() : SpellScriptLoader("spell_warl_seed_of_corruption_generic") { } + + class spell_warl_seed_of_corruption_generic_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_seed_of_corruption_generic_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_SHADOW_TRANCE, true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo) + return; + + int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); + if (amount > 0) + { + const_cast<AuraEffect*>(aurEff)->SetAmount(amount); + return; + } + + Remove(); + + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->CastSpell(eventInfo.GetActionTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC, true); } void Register() override { - OnEffectProc += AuraEffectProcFn(spell_warl_shadow_trance_proc_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_generic_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); } }; AuraScript* GetAuraScript() const override { - return new spell_warl_shadow_trance_proc_AuraScript(); + return new spell_warl_seed_of_corruption_generic_AuraScript(); } }; @@ -1275,6 +1354,45 @@ class spell_warl_soulshatter : public SpellScriptLoader } }; +// 37377 - Shadowflame +// 39437 - Shadowflame Hellfire and RoF +template <uint32 TriggerSpellId> +class spell_warl_t4_2p_bonus : public SpellScriptLoader +{ + public: + spell_warl_t4_2p_bonus(char const* ScriptName) : SpellScriptLoader(ScriptName) { } + + template <uint32 Trigger> + class spell_warl_t4_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_t4_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(Trigger)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* caster = eventInfo.GetActor(); + caster->CastSpell(caster, Trigger, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warl_t4_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warl_t4_2p_bonus_AuraScript<TriggerSpellId>(); + } +}; + // 30108, 34438, 34439, 35183 - Unstable Affliction /// Updated 4.3.4 class spell_warl_unstable_affliction : public SpellScriptLoader @@ -1377,7 +1495,8 @@ void AddSC_warlock_spell_scripts() new spell_warl_nether_ward_overrride(); new spell_warl_seduction(); new spell_warl_seed_of_corruption(); - new spell_warl_shadow_trance_proc(); + new spell_warl_seed_of_corruption_dummy(); + new spell_warl_seed_of_corruption_generic(); new spell_warl_shadow_ward(); new spell_warl_soul_leech(); new spell_warl_soul_swap(); @@ -1385,6 +1504,8 @@ void AddSC_warlock_spell_scripts() new spell_warl_soul_swap_exhale(); new spell_warl_soul_swap_override(); new spell_warl_soulshatter(); + new spell_warl_t4_2p_bonus<SPELL_WARLOCK_FLAMESHADOW>("spell_warl_t4_2p_bonus_shadow"); + new spell_warl_t4_2p_bonus<SPELL_WARLOCK_SHADOWFLAME>("spell_warl_t4_2p_bonus_fire"); new spell_warl_unstable_affliction(); new spell_warl_rain_of_fire(); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index a91c067d506..5b0f82b44fc 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -61,6 +61,7 @@ enum WarriorSpells SPELL_WARRIOR_SHOCKWAVE = 46968, SPELL_WARRIOR_SHOCKWAVE_STUN = 132168, SPELL_WARRIOR_SLAM = 50782, + SPELL_WARRIOR_STOICISM = 70845, SPELL_WARRIOR_STORM_BOLT_STUN = 132169, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1 = 12723, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 = 26654, @@ -267,6 +268,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader } }; +// 5308 - Execute /// Updated 4.3.4 class spell_warr_execute : public SpellScriptLoader { @@ -426,59 +428,70 @@ public: } }; -// 59725 - Improved Spell Reflection -class spell_warr_improved_spell_reflection : public SpellScriptLoader +// 5246 - Intimidating Shout +class spell_warr_intimidating_shout : public SpellScriptLoader { public: - spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { } + spell_warr_intimidating_shout() : SpellScriptLoader("spell_warr_intimidating_shout") { } - class spell_warr_improved_spell_reflection_SpellScript : public SpellScript + class spell_warr_intimidating_shout_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); + PrepareSpellScript(spell_warr_intimidating_shout_SpellScript); void FilterTargets(std::list<WorldObject*>& unitList) { - if (GetCaster()) - unitList.remove(GetCaster()); + unitList.remove(GetExplTargetWorldObject()); } void Register() override { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); } }; SpellScript* GetSpellScript() const override { - return new spell_warr_improved_spell_reflection_SpellScript(); + return new spell_warr_intimidating_shout_SpellScript(); } }; -// 5246 - Intimidating Shout -class spell_warr_intimidating_shout : public SpellScriptLoader +// 70844 - Item - Warrior T10 Protection 4P Bonus +/// 7.1.5 +class spell_warr_item_t10_prot_4p_bonus : public SpellScriptLoader { public: - spell_warr_intimidating_shout() : SpellScriptLoader("spell_warr_intimidating_shout") { } + spell_warr_item_t10_prot_4p_bonus() : SpellScriptLoader("spell_warr_item_t10_prot_4p_bonus") { } - class spell_warr_intimidating_shout_SpellScript : public SpellScript + class spell_warr_item_t10_prot_4p_bonus_AuraScript : public AuraScript { - PrepareSpellScript(spell_warr_intimidating_shout_SpellScript); + PrepareAuraScript(spell_warr_item_t10_prot_4p_bonus_AuraScript); - void FilterTargets(std::list<WorldObject*>& unitList) + bool Validate(SpellInfo const* /*spellInfo*/) override { - unitList.remove(GetExplTargetWorldObject()); + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_STOICISM)) + return false; + return true; + } + + void HandleProc(ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* target = eventInfo.GetActionTarget(); + int32 bp0 = CalculatePct(target->GetMaxHealth(), GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()); + target->CastCustomSpell(SPELL_WARRIOR_STOICISM, SPELLVALUE_BASE_POINT0, bp0, (Unit*)nullptr, true); } void Register() override { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnProc += AuraProcFn(spell_warr_item_t10_prot_4p_bonus_AuraScript::HandleProc); } }; - SpellScript* GetSpellScript() const override + AuraScript* GetAuraScript() const override { - return new spell_warr_intimidating_shout_SpellScript(); + return new spell_warr_item_t10_prot_4p_bonus_AuraScript(); } }; @@ -1063,7 +1076,6 @@ class spell_warr_sword_and_board : public SpellScriptLoader { PrepareAuraScript(spell_warr_sword_and_board_AuraScript); - private: bool Validate(SpellInfo const* /*spellInfo*/) override { if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SHIELD_SLAM)) @@ -1071,7 +1083,7 @@ class spell_warr_sword_and_board : public SpellScriptLoader return true; } - void OnProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) { // Remove cooldown on Shield Slam if (Player* player = GetTarget()->ToPlayer()) @@ -1080,7 +1092,7 @@ class spell_warr_sword_and_board : public SpellScriptLoader void Register() override { - OnEffectProc += AuraEffectProcFn(spell_warr_sword_and_board_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_warr_sword_and_board_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -1090,6 +1102,41 @@ class spell_warr_sword_and_board : public SpellScriptLoader } }; +// 28845 - Cheat Death +class spell_warr_t3_prot_8p_bonus : public SpellScriptLoader +{ + public: + spell_warr_t3_prot_8p_bonus() : SpellScriptLoader("spell_warr_t3_prot_8p_bonus") { } + + class spell_warr_t3_prot_8p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_t3_prot_8p_bonus_AuraScript); + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActionTarget()->HealthBelowPct(20)) + return true; + + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (damageInfo && damageInfo->GetDamage()) + if (GetTarget()->HealthBelowPctDamaged(20, damageInfo->GetDamage())) + return true; + + return false; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_warr_t3_prot_8p_bonus_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warr_t3_prot_8p_bonus_AuraScript(); + } +}; + // 34428 - Victory Rush class spell_warr_victory_rush : public SpellScriptLoader { @@ -1242,8 +1289,8 @@ void AddSC_warrior_spell_scripts() new spell_warr_execute(); new spell_warr_heroic_leap(); new spell_warr_heroic_leap_jump(); - new spell_warr_improved_spell_reflection(); new spell_warr_intimidating_shout(); + new spell_warr_item_t10_prot_4p_bonus(); new spell_warr_lambs_to_the_slaughter(); new spell_warr_last_stand(); new spell_warr_overpower(); @@ -1259,6 +1306,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_sudden_death(); new spell_warr_sweeping_strikes(); new spell_warr_sword_and_board(); + new spell_warr_t3_prot_8p_bonus(); new spell_warr_victory_rush(); new spell_warr_vigilance(); new spell_warr_vigilance_trigger(); |
