From f42b0351fd279e829b2be8f0d7656b62f8e410ce Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 24 Jul 2016 22:24:53 -0400 Subject: [PATCH] Improve list of skipped effects in stacking code This is the list according to the client (RoF2) Please report any stacking anomalies --- common/spdat.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ common/spdat.h | 1 + zone/spells.cpp | 24 ++------------- 3 files changed, 80 insertions(+), 22 deletions(-) diff --git a/common/spdat.cpp b/common/spdat.cpp index 572df1afb..74362cea0 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -1121,6 +1121,83 @@ bool IsCastWhileInvis(uint16 spell_id) return false; } +bool IsEffectIgnoredInStacking(int spa) +{ + // this should match RoF2 + switch (spa) { + case SE_SeeInvis: + case SE_DiseaseCounter: + case SE_PoisonCounter: + case SE_Levitate: + case SE_InfraVision: + case SE_UltraVision: + case SE_CurrentHPOnce: + case SE_CurseCounter: + case SE_ImprovedDamage: + case SE_ImprovedHeal: + case SE_SpellResistReduction: + case SE_IncreaseSpellHaste: + case SE_IncreaseSpellDuration: + case SE_IncreaseRange: + case SE_SpellHateMod: + case SE_ReduceReagentCost: + case SE_ReduceManaCost: + case SE_FcStunTimeMod: + case SE_LimitMaxLevel: + case SE_LimitResist: + case SE_LimitTarget: + case SE_LimitEffect: + case SE_LimitSpellType: + case SE_LimitSpell: + case SE_LimitMinDur: + case SE_LimitInstant: + case SE_LimitMinLevel: + case SE_LimitCastTimeMin: + case SE_LimitCastTimeMax: + case SE_StackingCommand_Block: + case SE_StackingCommand_Overwrite: + case SE_PetPowerIncrease: + case SE_SkillDamageAmount: + case SE_ChannelChanceSpells: + case SE_Blank: + case SE_FcDamageAmt: + case SE_SpellDurationIncByTic: + case SE_FcSpellVulnerability: + case SE_FcDamageAmtIncoming: + case SE_FcDamagePctCrit: + case SE_FcDamageAmtCrit: + case SE_ReduceReuseTimer: + case SE_LimitCombatSkills: + case SE_BlockNextSpellFocus: + case SE_SpellTrigger: + case SE_LimitManaMin: + case SE_CorruptionCounter: + case SE_ApplyEffect: + case SE_NegateSpellEffect: + case SE_LimitSpellGroup: + case SE_LimitManaMax: + case SE_FcHealAmt: + case SE_FcHealPctIncoming: + case SE_FcHealAmtIncoming: + case SE_FcHealPctCritIncoming: + case SE_FcHealAmtCrit: + case SE_LimitClass: + case SE_LimitRace: + case SE_FcBaseEffects: + case 415: + case SE_SkillDamageAmount2: + case SE_FcLimitUse: + case SE_FcIncreaseNumHits: + case SE_LimitUseMin: + case SE_LimitUseType: + case SE_GravityEffect: + case 425: + return true; + default: + return false; + } +} + uint32 GetNimbusEffect(uint16 spell_id) { if (IsValidSpell(spell_id)) diff --git a/common/spdat.h b/common/spdat.h index b06c50293..e44bf8e08 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -904,6 +904,7 @@ uint32 GetPartialMagicRuneAmount(uint32 spell_id); bool NoDetrimentalSpellAggro(uint16 spell_id); bool IsStackableDot(uint16 spell_id); bool IsCastWhileInvis(uint16 spell_id); +bool IsEffectIgnoredInStacking(int spa); int CalcPetHp(int levelb, int classb, int STA = 75); const char *GetRandPetName(); diff --git a/zone/spells.cpp b/zone/spells.cpp index 4b12e7c4e..9e8297e3a 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2926,28 +2926,8 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if(effect1 != effect2) continue; - //Effects which really aren't going to affect stacking. - if(effect1 == SE_CurrentHPOnce || - effect1 == SE_CurseCounter || - effect1 == SE_DiseaseCounter || - effect1 == SE_PoisonCounter){ - continue; - } - - /* - Skip check if effect is SE_Limit* - skip checking effect2 since we know they are equal - */ - if(effect1 == SE_LimitMaxLevel || - effect1 == SE_LimitResist || - effect1 == SE_LimitTarget || - effect1 == SE_LimitEffect || - effect1 == SE_LimitSpellType || - effect1 == SE_LimitSpell || - effect1 == SE_LimitMinDur || - effect1 == SE_LimitInstant || - effect1 == SE_LimitMinLevel || - effect1 == SE_LimitCastTimeMin) + // big ol' list according to the client, wasn't that nice! + if (IsEffectIgnoredInStacking(effect1)) continue; /*