From 9d5d13fbd0add00006fd2237cc0b1ab869012269 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Sun, 7 Jan 2024 14:53:42 -0500 Subject: [PATCH] [Rule] Casting Charm on over level = Aggro (#3886) Casting charm on target with level above max level of spell will give resist message and aggro --- common/ruletypes.h | 1 + zone/spells.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index 8867d82e4..f8697f6c3 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -472,6 +472,7 @@ RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal RULE_BOOL(Spells, UseLegacyFizzleCode, false, "Enable will turn on the legacy fizzle code which is far stricter and more accurate to 2001/2002 testing.") RULE_BOOL(Spells, LegacyManaburn, false, "Enable to have the legacy manaburn system from 2003 and earlier.") RULE_BOOL(Spells, EvacClearAggroInSameZone, false, "Enable to clear aggro on clients when evacing in same zone.") +RULE_BOOL(Spells, CharmAggroOverLevel, false, "Enabling this rule will cause Charm casts over level to show resisted and cause aggro. Early EQ style.") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/spells.cpp b/zone/spells.cpp index c72d79783..d8312069e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4961,6 +4961,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(GetLevel() > spells[spell_id].max_value[effect_index] && spells[spell_id].max_value[effect_index] != 0) { LogSpells("Our level ([{}]) is higher than the limit of this Charm spell ([{}])", GetLevel(), spells[spell_id].max_value[effect_index]); + if (RuleB(Spells, CharmAggroOverLevel)) { + int64 aggro = caster->CheckAggroAmount(spell_id, this); + aggro > 0 ? AddToHateList(caster, aggro) : AddToHateList(caster, 1, 0, true, false, false, spell_id); + caster->MessageString(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name); + return true; + } + caster->MessageString(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up AddToHateList(caster, 1,0,true,false,false,spell_id); return true;