mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10998] Re-write work proc of stackable spells with charges in more simple way
Some spells have procCharges > 0 and in same time maxStack > 1. It's support has been implemented more year ago but current way work with single aura from stack remove at proc always made some spells work wrongly (7 spells (with ranks) in 3.3.5a). In fact only 3 spell (with ranks) need this "one from stack" way and all form its have similarity: Its apply max stack from start and decrease stacks at proc hit. Another prove for correctness this way: in 2.x exist single spell with charges and maxstack that expect full aura stack remove. So implemented opposition way: normal aura proc remove always full aura holder stack. Special 3 cases have overwrite code for work with stack in correct for its way. Fixed work: * items 31857 and 50259 * recipe 46027 effects. * talent 63730 and ranks Affected by code changes talents 51528 and 55166 tested and work. Spell 34026 use similar decrease stack at hit but req. independent patch for full implemention, so not work.
This commit is contained in:
parent
d6eef703ce
commit
b7f4a41fcd
9 changed files with 63 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue