[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
This commit is contained in:
Fryguy 2024-01-07 14:53:42 -05:00 committed by GitHub
parent bc3e9e8fba
commit 9d5d13fbd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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<Paste>
AddToHateList(caster, 1,0,true,false,false,spell_id);
return true;