diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 4e40e7e24..07a8569a6 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1393,6 +1393,7 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { Charisma ONLY effects the initial resist check when charm is cast with 10 CHA = -1 Resist mod up to 200 CHA Charisma DOES NOT extend charm durations. Base effect value of charm spells in the spell file DOES NOT effect duration OR resist rate (unclear if does anything) + Charm has a lower limit of 5% chance to break per tick, regardless of resist modifiers / level difference. */ if(!caster) return false; @@ -1402,11 +1403,6 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { float resist_check = 0; - if (RuleB(Spells, CharismaCharmDuration)) - resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,0,0,true); - else - resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster); - if(IsCharmSpell(spell_id)) { if (spells[spell_id].powerful_flag == -1) //If charm spell has this set(-1), it can not break till end of duration. @@ -1416,8 +1412,13 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { if (MakeRandomInt(0, 99) > RuleI(Spells, CharmBreakCheckChance)) return true; + if (RuleB(Spells, CharismaCharmDuration)) + resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,0,0,true,true); + else + resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, 0,0, false, true); + //2: The mob makes a resistance check against the charm - if (resist_check == 100) + if (resist_check == 100) return true; else @@ -1437,6 +1438,8 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { else { // Assume this is a harmony/pacify spell + resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster); + if (resist_check == 100) return true; } diff --git a/zone/mob.h b/zone/mob.h index ca80500d5..20da2be3e 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -190,7 +190,7 @@ public: virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration){ return duration;} virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime); float ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override = false, - int resist_override = 0, bool CharismaCheck = false); + int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false); uint16 GetSpecializeSkillValue(uint16 spell_id) const; void SendSpellBarDisable(); void SendSpellBarEnable(uint16 spellid); diff --git a/zone/spells.cpp b/zone/spells.cpp index c623a35c8..0d110a36e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4048,7 +4048,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // pvp_resist_base // pvp_resist_calc // pvp_resist_cap -float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck) +float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck, bool CharmTick) { if(!caster) @@ -4277,6 +4277,10 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use resist_chance = spells[spell_id].MinResist; } + //Charm can not have less than 5% chance to fail. + if (CharmTick && (resist_chance < 10)) + resist_chance = 10; + //Finally our roll int roll = MakeRandomInt(0, 200); if(roll > resist_chance)