From e573bd9ea8c5ec680a129ef667172cc0cc7de436 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Thu, 8 Jan 2009 03:49:36 +0300 Subject: [PATCH] [7051] Implement some mage dummy triggers (fix typo) 44546 and ranks 44449 and ranks 54747 and ranks Signed-off-by: DiSlord --- sql/mangos.sql | 12 +++- .../7051_01_mangos_spell_proc_event.sql | 41 ++++++++++++ sql/updates/Makefile.am | 2 + src/game/SpellAuras.cpp | 4 +- src/game/SpellEffects.cpp | 3 +- src/game/SpellMgr.h | 11 ++++ src/game/Unit.cpp | 62 ++++++++++++++++--- src/shared/revision_nr.h | 2 +- 8 files changed, 123 insertions(+), 14 deletions(-) create mode 100644 sql/updates/7051_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 0082274e7..2c5910e1a 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7050_01_mangos_spell_proc_event` bit(1) default NULL + `required_7051_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -16595,6 +16595,14 @@ INSERT INTO `spell_proc_event` VALUES (44445, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (44446, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (44448, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(44449, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(44469, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(44470, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(44471, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(44472, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(44546, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(44548, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(44549, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (44835, 0x00000000, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0.000000, 0.000000, 0), (45054, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15), (45057, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30), @@ -16786,6 +16794,8 @@ INSERT INTO `spell_proc_event` VALUES (54489, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (54490, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (54738, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(54747, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0), +(54749, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0), (54754, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (54841, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (54936, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), diff --git a/sql/updates/7051_01_mangos_spell_proc_event.sql b/sql/updates/7051_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..8775ee158 --- /dev/null +++ b/sql/updates/7051_01_mangos_spell_proc_event.sql @@ -0,0 +1,41 @@ +ALTER TABLE db_version CHANGE COLUMN required_7050_01_mangos_spell_proc_event required_7051_01_mangos_spell_proc_event bit; + +-- (44546) Brain Freeze (Rank 1) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44546); +INSERT INTO `spell_proc_event` VALUES (44546, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); + +-- (44548) Brain Freeze (Rank 2) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44548); +INSERT INTO `spell_proc_event` VALUES (44548, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); + +-- (44549) Brain Freeze (Rank 3) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44549); +INSERT INTO `spell_proc_event` VALUES (44549, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); + +-- (44449) Burnout (Rank 1) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44449); +INSERT INTO `spell_proc_event` VALUES (44449, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (44469) Burnout (Rank 2) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44469); +INSERT INTO `spell_proc_event` VALUES (44469, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (44470) Burnout (Rank 3) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44470); +INSERT INTO `spell_proc_event` VALUES (44470, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (44471) Burnout (Rank 4) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44471); +INSERT INTO `spell_proc_event` VALUES (44471, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (44472) Burnout (Rank 5) +DELETE FROM `spell_proc_event` WHERE `entry` IN (44472); +INSERT INTO `spell_proc_event` VALUES (44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (54747) Burning Determination (Rank 1) +DELETE FROM `spell_proc_event` WHERE `entry` IN (54747); +INSERT INTO `spell_proc_event` VALUES (54747, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0); + +-- (54749) Burning Determination (Rank 2) +DELETE FROM `spell_proc_event` WHERE `entry` IN (54749); +INSERT INTO `spell_proc_event` VALUES (54749, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 44a6ec84d..660fb3d11 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -120,6 +120,7 @@ pkgdata_DATA = \ 7047_02_mangos_playercreateinfo_action.sql \ 7047_03_mangos_playercreateinfo_spell.sql \ 7050_01_mangos_spell_proc_event.sql \ + 7051_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -220,4 +221,5 @@ EXTRA_DIST = \ 7047_02_mangos_playercreateinfo_action.sql \ 7047_03_mangos_playercreateinfo_spell.sql \ 7050_01_mangos_spell_proc_event.sql \ + 7051_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6581df7ae..e982d1e47 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1239,6 +1239,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) case 34754: // Clearcasting case 34936: // Backlash case 48108: // Hot Streak + case 57761: // Fireball! SetAuraCharges(1); break; } @@ -4224,10 +4225,11 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 7 / 100); return; } + // Deadly Poison if (m_spellProto->SpellFamilyFlags & 0x0000000000010000) { // 0.08*$AP / 4 * amount of stack - m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 * GetStackAmount() * / 100); + m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 * GetStackAmount() / 100); return; } break; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c4ee30bfe..c060f2508 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2247,7 +2247,8 @@ void Spell::EffectPowerDrain(uint32 i) unitTarget->ModifyPower(drain_power,-new_damage); - if(drain_power == POWER_MANA) + // Don`t restore from self drain + if(drain_power == POWER_MANA && m_caster != unitTarget) { float manaMultiplier = m_spellInfo->EffectMultipleValue[i]; if(manaMultiplier==0) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index f07d2a6fb..602beb00b 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -448,6 +448,17 @@ inline uint32 GetSpellMechanicMask(SpellEntry const* spellInfo, int32 effect) return mask; } +inline uint32 GetAllSpellMechanicMask(SpellEntry const* spellInfo) +{ + uint32 mask = 0; + if (spellInfo->Mechanic) + mask |= 1<Mechanic; + for (int i=0; i< 3; ++i) + if (spellInfo->EffectMechanic[i]) + mask |= 1<EffectMechanic[i]; + return mask; +} + inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect) { if (spellInfo->EffectMechanic[effect]) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 430fe3f13..64a124e56 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4595,7 +4595,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return false; // mana cost save - basepoints0 = procSpell->manaCost * triggeredByAura->GetModifier()->m_amount/100; + int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; + basepoints0 = cost * triggeredByAura->GetModifier()->m_amount/100; if( basepoints0 <=0 ) return false; @@ -4626,6 +4627,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu mod->m_amount = 25; return true; } + // Burnout + if (dummySpell->SpellIconID == 2998) + { + if(!procSpell) + return false; + + int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; + basepoints0 = cost * triggeredByAura->GetModifier()->m_amount/100; + if( basepoints0 <=0 ) + return false; + triggered_spell_id = 44450; + target = this; + break; + } // Incanter's Regalia set (add trigger chance to Mana Shield) if (dummySpell->SpellFamilyFlags & 0x0000000000008000LL) { @@ -4694,15 +4709,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == pVictim) return false; // Need stun or root mechanic - if (procSpell->Mechanic != MECHANIC_ROOT && procSpell->Mechanic != MECHANIC_STUN) - { - int32 i; - for (i=0; i<3; i++) - if (procSpell->EffectMechanic[i] == MECHANIC_ROOT || procSpell->EffectMechanic[i] == MECHANIC_STUN) - break; - if (i == 3) - return false; - } + if (!(GetAllSpellMechanicMask(procSpell) & ((1<Id) { @@ -6100,6 +6108,40 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; break; } + // Brain Freeze + case 57761: + { + if(!procSpell) + return false; + // For trigger from Blizzard need exist Improved Blizzard + if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags & 0x0000000000000080) + { + bool found = false; + AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) + { + int32 script = (*i)->GetModifier()->m_miscvalue; + if(script==836 || script==988 || script==989) + { + found=true; + break; + } + } + if(!found) + return false; + } + break; + } + // Burning Determination + case 54748: + { + if(!procSpell) + return false; + // Need Interrupt or Silenced mechanic + if (!(GetAllSpellMechanicMask(procSpell) & ((1<HasSpellCooldown(trigger_spell_id)) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5ebbc3b04..f1fcf43c1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7050" + #define REVISION_NR "7051" #endif // __REVISION_NR_H__