diff --git a/sql/mangos.sql b/sql/mangos.sql index 60f7222d8..186ae65cd 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_10993_01_mangos_loot_template` bit(1) default NULL + `required_10998_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17442,6 +17442,7 @@ INSERT INTO `spell_proc_event` VALUES (63335, 0x00, 15, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63373, 0x00, 11, 0x80000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), (63534, 0x00, 6, 0x00000040, 0x00000040, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0), +(64440, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0), (64952, 0x00, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (64964, 0x00, 15, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63611, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00050014, 0x00000000, 0.000000, 0.000000, 0), @@ -17493,6 +17494,7 @@ INSERT INTO `spell_proc_event` VALUES (71540, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), (71545, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,45.000000, 0), (71562, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000,105), +(71564, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (71585, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), (71602, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), (71606, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000,100), diff --git a/sql/updates/10998_01_mangos_spell_proc_event.sql b/sql/updates/10998_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..82252b6c5 --- /dev/null +++ b/sql/updates/10998_01_mangos_spell_proc_event.sql @@ -0,0 +1,6 @@ +ALTER TABLE db_version CHANGE COLUMN required_10993_01_mangos_loot_template required_10998_01_mangos_spell_proc_event bit; + +DELETE FROM spell_proc_event WHERE entry IN (64440, 71564); +INSERT INTO spell_proc_event VALUES +(71564, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(64440, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 4d2b349d2..98fc1ca9e 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -150,6 +150,7 @@ pkgdata_DATA = \ 10988_01_mangos_mangos_string.sql \ 10989_01_mangos_loot_template.sql \ 10993_01_mangos_loot_template.sql \ + 10998_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -280,4 +281,5 @@ EXTRA_DIST = \ 10988_01_mangos_mangos_string.sql \ 10989_01_mangos_loot_template.sql \ 10993_01_mangos_loot_template.sql \ + 10998_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 14597ad14..991d011f8 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -130,12 +130,6 @@ class MANGOS_DLL_SPEC SpellAuraHolder if (m_procCharges == 0) return false; - // exist spells that have maxStack > 1 and m_procCharges > 0 (==1 in fact) - // all like stacks have 1 value in one from this fields - // so return true for allow remove one aura from stacks as expired - if (GetStackAmount() > 1) - return true; - m_procCharges--; SendAuraUpdate(false); return m_procCharges == 0; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0648b6f4c..0e61310db 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9848,7 +9848,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag removedSpells.unique(); // Remove auras from removedAuras for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();++i) - RemoveAuraHolderFromStack(*i); + RemoveAurasDueToSpell(*i); } } diff --git a/src/game/Unit.h b/src/game/Unit.h index 8a0672f91..ecaf54420 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1887,9 +1887,10 @@ class MANGOS_DLL_SPEC Unit : public WorldObject SpellAuraProcResult HandleModPowerCostSchoolAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleMechanicImmuneResistanceAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleModDamageFromCasterAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - SpellAuraProcResult HandleMaelstromWeaponAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleAddFlatModifierAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleAddPctModifierAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleModDamagePercentDoneAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModRating(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleNULLProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) { // no proc handler for this aura type diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 5b1eec78e..62b8d0d7a 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -139,7 +139,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]= &Unit::HandleNULLProc, //104 SPELL_AURA_WATER_WALK &Unit::HandleNULLProc, //105 SPELL_AURA_FEATHER_FALL &Unit::HandleNULLProc, //106 SPELL_AURA_HOVER - &Unit::HandleNULLProc, //107 SPELL_AURA_ADD_FLAT_MODIFIER + &Unit::HandleAddFlatModifierAuraProc, //107 SPELL_AURA_ADD_FLAT_MODIFIER &Unit::HandleAddPctModifierAuraProc, //108 SPELL_AURA_ADD_PCT_MODIFIER &Unit::HandleNULLProc, //109 SPELL_AURA_ADD_TARGET_TRIGGER &Unit::HandleNULLProc, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT @@ -221,7 +221,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]= &Unit::HandleNULLProc, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE &Unit::HandleNULLProc, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE &Unit::HandleNULLProc, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE - &Unit::HandleNULLProc, //189 SPELL_AURA_MOD_RATING + &Unit::HandleModRating, //189 SPELL_AURA_MOD_RATING &Unit::HandleNULLProc, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN &Unit::HandleNULLProc, //191 SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED &Unit::HandleNULLProc, //192 SPELL_AURA_HASTE_MELEE @@ -304,7 +304,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]= &Unit::HandleNULLProc, //269 SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL &Unit::HandleNULLProc, //270 SPELL_AURA_MOD_IGNORE_TARGET_RESIST (unused in 3.2.2a) &Unit::HandleModDamageFromCasterAuraProc, //271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER - &Unit::HandleMaelstromWeaponAuraProc, //272 SPELL_AURA_MAELSTROM_WEAPON (unclear use for aura, it used in (3.2.2a...3.3.0) in single spell 53817 that spellmode stacked and charged spell expected to be drop as stack + &Unit::HandleNULLProc, //272 SPELL_AURA_MAELSTROM_WEAPON (unclear use for aura, it used in (3.2.2a...3.3.0) in single spell 53817 that spellmode stacked and charged spell expected to be drop as stack &Unit::HandleNULLProc, //273 SPELL_AURA_X_RAY (client side implementation) &Unit::HandleNULLProc, //274 proc free shot? &Unit::HandleNULLProc, //275 SPELL_AURA_MOD_IGNORE_SHAPESHIFT Use SpellClassMask for spell select @@ -2875,6 +2875,16 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d return SPELL_AURA_PROC_FAILED; break; } + case 64440: // Blade Warding + { + trigger_spell_id = 64442; + + // need scale damage base at stack size + if (SpellEntry const* trigEntry = sSpellStore.LookupEntry(trigger_spell_id)) + basepoints[EFFECT_INDEX_0] = trigEntry->CalculateSimpleValue(EFFECT_INDEX_0) * triggeredByAura->GetStackAmount(); + + break; + } case 67702: // Death's Choice, Item - Coliseum 25 Normal Melee Trinket { float stat = 0.0f; @@ -3735,10 +3745,17 @@ SpellAuraProcResult Unit::HandleModDamageFromCasterAuraProc(Unit* pVictim, uint3 return triggeredByAura->GetCasterGuid() == pVictim->GetObjectGuid() ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; } -SpellAuraProcResult Unit::HandleMaelstromWeaponAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) +SpellAuraProcResult Unit::HandleAddFlatModifierAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const * /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { - // remove all stack; - RemoveSpellsCausingAura(SPELL_AURA_MAELSTROM_WEAPON); + SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); + + if (spellInfo->Id == 55166) // Tidal Force + { + // Remove only single aura from stack + if (triggeredByAura->GetStackAmount() > 1 && !triggeredByAura->GetHolder()->ModStackAmount(-1)) + return SPELL_AURA_PROC_CANT_TRIGGER; + } + return SPELL_AURA_PROC_OK; } @@ -3750,6 +3767,16 @@ SpellAuraProcResult Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 switch(spellInfo->SpellFamilyName) { + case SPELLFAMILY_GENERIC: + { + if (spellInfo->Id == 34027) // Kill Command + { + // Remove only single aura from stack + if (triggeredByAura->GetStackAmount() > 1 && !triggeredByAura->GetHolder()->ModStackAmount(-1)) + return SPELL_AURA_PROC_CANT_TRIGGER; + } + break; + } case SPELLFAMILY_MAGE: { // Combustion @@ -3811,3 +3838,17 @@ SpellAuraProcResult Unit::HandleModDamagePercentDoneAuraProc(Unit* /*pVictim*/, return SPELL_AURA_PROC_OK; } + +SpellAuraProcResult Unit::HandleModRating(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const * /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) +{ + SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); + + if (spellInfo->Id == 71564) // Deadly Precision + { + // Remove only single aura from stack + if (triggeredByAura->GetStackAmount() > 1 && !triggeredByAura->GetHolder()->ModStackAmount(-1)) + return SPELL_AURA_PROC_CANT_TRIGGER; + } + + return SPELL_AURA_PROC_OK; +} diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a0fc25df7..ece1259eb 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 "10997" + #define REVISION_NR "10998" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index ab44a3b2a..a9f8bb3f7 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_10973_01_characters_game_event_status" - #define REVISION_DB_MANGOS "required_10993_01_mangos_loot_template" + #define REVISION_DB_MANGOS "required_10998_01_mangos_spell_proc_event" #define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version" #endif // __REVISION_SQL_H__