bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) { /* Charm formula is correct based on over 50 hours of personal live parsing - Kayen Charisma ONLY effects the initial resist check when charm is cast with 10 CHA = -1 Resist mod up to 255 CHA (min ~ 75 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; if(spells[spell_id].ResistDiff <= -600) return true; float resist_check = 0; if(IsCharmSpell(spell_id)) { if (spells[spell_id].no_resist) //If charm spell has this set(-1), it can not break till end of duration. return true; //1: The mob has a default 25% chance of being allowed a resistance check against the charm. if (zone->random.Int(0, 99) > RuleI(Spells, CharmBreakCheckChance)) return true; if (RuleB(Spells, CharismaCharmDuration)) resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,false,0,true,true); else resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0, false, true); //2: The mob makes a resistance check against the charm if (resist_check == 100) return true; else { if (caster->IsClient()) { //3: At maxed ability, Total Domination has a 50% chance of preventing the charm break that otherwise would have occurred. int16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance; if (zone->random.Int(0, 99) < TotalDominationBonus) return true; } } } else { // Assume this is a harmony/pacify spell // If 'Lull' spell resists, do a second resist check with a charisma modifier AND regular resist checks. If resists agian you gain aggro. resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0,true); if (resist_check == 100) return true; } return false; }
bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { if(!caster) return false; if(spells[spell_id].ResistDiff <= -600) return true; //Applies additional Charisma bonus to resist rate float resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,0,0,1); 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. return true; //1: The mob has a default 25% chance of being allowed a resistance check against the charm. if (MakeRandomInt(0, 100) > RuleI(Spells, CharmBreakCheckChance)) return true; //2: The mob makes a resistance check against the charm if (resist_check == 100) return true; else { if (caster->IsClient()) { //3: At maxed ability, Total Domination has a 50% chance of preventing the charm break that otherwise would have occurred. uint16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance; if (MakeRandomInt(0, 100) < TotalDominationBonus) return true; } } } else { // Assume this is a harmony/pacify spell if (resist_check == 100) return true; } return false; }