[Rules] ResurrectionEffectBlock to prevent/allow/move buffs. (#3288)

* [Rules] ResurrectionEffectsBlock to prevent/allow/move buffs.

This removes the rule ResurrectionEffectsBlock (Bool) and creates ResurrectionEffectsBlock (Int)

Default = 2

Setting to 0 = Functions as it did before any blocking changes, Focus of Spirit and Strength buffs can overwrite Resurrection Effects.

Setting to 1 = Blocks all buffs that could overwrite Resurrection Effects.

Setting to 2 = Allows all buffs that would overwrite Resurrection Effects to land, however they will be moved to a new buff slot if one is available to allow both the beneficial buff to land and detrimental effects of Resurrection Effects to stay in effect until the duration is expired.

* Update logging

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
nytmyr
2023-05-08 08:32:21 -05:00
committed by GitHub
parent 434f270f68
commit 93a4153a4b
4 changed files with 60 additions and 11 deletions
+1 -1
View File
@@ -444,7 +444,7 @@ RULE_BOOL(Spells, IllusionsAlwaysPersist, false, "Allows Illusions to persist be
RULE_BOOL(Spells, UseItemCastMessage, false, "Enable to use the \"item begins to glow\" messages when casting from an item.")
RULE_BOOL(Spells, TargetsTargetRequiresCombatRange, true, "Disable to remove combat range requirement from Target's Target Spell Target Type")
RULE_BOOL(Spells, NPCBuffLevelRestrictions, false, "Impose BuffLevelRestrictions on NPCs if true")
RULE_BOOL(Spells, ResurrectionEffectsBlock, true, "If enabled, resurrection effects cannot be overwritten.")
RULE_INT(Spells, ResurrectionEffectBlock, 2, "0 = allow overwrites/rule disabled. If set to 1 = Block all buffs that would overwrite Resurrection Effects. If set to 2 = Will not overwrite Resurrection Effects, instead moves new buff to an empty slot if available. Default is 2.")
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)
+23 -6
View File
@@ -776,6 +776,23 @@ bool IsResurrectionEffects(uint16 spell_id)
return false;
}
int8 GetResurrectionSicknessCheck(uint16 spell_id1, uint16 spell_id2)
{
if (RuleI(Spells, ResurrectionEffectBlock) == RES_EFFECTS_BLOCK) {
LogSpells("[{}] is blocked by [{}]", spells[spell_id2].name, spells[spell_id1].name);
return -1; // can't stack
}
else if (RuleI(Spells, ResurrectionEffectBlock) == RES_EFFECTS_BLOCK_WITH_BUFFS) {
LogSpells(
"[{}] is blocked by [{}], moving to empty slot if available",
spells[spell_id2].name,
spells[spell_id1].name
);
return MOVE_NEW_SLOT; // move to empty slot if available
}
return NO_RES_EFFECTS_BLOCK;
}
bool IsRuneSpell(uint16 spell_id)
{
if (IsValidSpell(spell_id))
@@ -1003,7 +1020,7 @@ bool IsFastHealSpell(uint16 spell_id)
(
spells[spell_id].effect_id[i] == SE_CurrentHP ||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
) &&
) &&
spells[spell_id].base_value[i] > 0
) {
return true;
@@ -1029,7 +1046,7 @@ bool IsVeryFastHealSpell(uint16 spell_id)
(
spells[spell_id].effect_id[i] == SE_CurrentHP ||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
) &&
) &&
spells[spell_id].base_value[i] > 0
) {
return true;
@@ -1054,8 +1071,8 @@ bool IsRegularSingleTargetHealSpell(uint16 spell_id)
(
spells[spell_id].effect_id[i] == SE_CurrentHP ||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
) &&
spells[spell_id].base_value[i] > 0 &&
) &&
spells[spell_id].base_value[i] > 0 &&
spells[spell_id].buff_duration == 0
) {
return true;
@@ -1080,8 +1097,8 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
(
spells[spell_id].effect_id[i] == SE_CurrentHP ||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
) &&
spells[spell_id].base_value[i] > 0 &&
) &&
spells[spell_id].base_value[i] > 0 &&
spells[spell_id].buff_duration == 0
) {
return true;
+6
View File
@@ -201,6 +201,11 @@
#define INSTRUMENT_LUTE 13011
#define INSTRUMENT_HORN 13012
//option types for the rule Spells:ResurrectionEffectBlock
#define NO_RES_EFFECTS_BLOCK 0
#define RES_EFFECTS_BLOCK 1
#define RES_EFFECTS_BLOCK_WITH_BUFFS 2
#define MOVE_NEW_SLOT 2
const int Z_AGGRO=10;
@@ -1505,6 +1510,7 @@ bool IsDisciplineBuff(uint16 spell_id);
bool IsDiscipline(uint16 spell_id);
bool IsCombatSkill(uint16 spell_id);
bool IsResurrectionEffects(uint16 spell_id);
int8 GetResurrectionSicknessCheck(uint16 spell_id1, uint16 spell_id2);
bool IsRuneSpell(uint16 spell_id);
bool IsMagicRuneSpell(uint16 spell_id);
bool IsManaTapSpell(uint16 spell_id);