mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 20:51:29 +00:00
Fix for minimum charm and root resist chances (was always returning 0).
Fix for pacification not doing a proper second resist check upon resisting intial pacification.
This commit is contained in:
parent
b592d2e786
commit
ccbaf337f4
@ -1233,7 +1233,7 @@ void Mob::ClearFeignMemory() {
|
|||||||
AIfeignremember_timer->Disable();
|
AIfeignremember_timer->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Charm formula is correct based on over 50 hours of personal live parsing - Kayen
|
Charm formula is correct based on over 50 hours of personal live parsing - Kayen
|
||||||
@ -1260,9 +1260,9 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (RuleB(Spells, CharismaCharmDuration))
|
if (RuleB(Spells, CharismaCharmDuration))
|
||||||
resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,0,0,true,true);
|
resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,false,0,true,true);
|
||||||
else
|
else
|
||||||
resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, 0,0, false, true);
|
resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0, false, true);
|
||||||
|
|
||||||
//2: The mob makes a resistance check against the charm
|
//2: The mob makes a resistance check against the charm
|
||||||
if (resist_check == 100)
|
if (resist_check == 100)
|
||||||
@ -1286,7 +1286,8 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
|||||||
{
|
{
|
||||||
// Assume this is a harmony/pacify spell
|
// 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.
|
// 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, true);
|
Shout("DO CHARISM CHECK ON FAIL");
|
||||||
|
resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0,true);
|
||||||
|
|
||||||
if (resist_check == 100)
|
if (resist_check == 100)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -578,7 +578,7 @@ public:
|
|||||||
void WakeTheDead(uint16 spell_id, Mob *target, uint32 duration);
|
void WakeTheDead(uint16 spell_id, Mob *target, uint32 duration);
|
||||||
void Spin();
|
void Spin();
|
||||||
void Kill();
|
void Kill();
|
||||||
bool PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id);
|
bool PassCharismaCheck(Mob* caster, uint16 spell_id);
|
||||||
bool TryDeathSave();
|
bool TryDeathSave();
|
||||||
bool TryDivineSave();
|
bool TryDivineSave();
|
||||||
void DoBuffWearOffEffect(uint32 index);
|
void DoBuffWearOffEffect(uint32 index);
|
||||||
|
|||||||
@ -3586,7 +3586,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SE_Charm: {
|
case SE_Charm: {
|
||||||
if (!caster || !PassCharismaCheck(caster, this, spell_id)) {
|
if (!caster || !PassCharismaCheck(caster, spell_id)) {
|
||||||
BuffFadeByEffect(SE_Charm);
|
BuffFadeByEffect(SE_Charm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3659,7 +3659,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
|
|||||||
if(!IsHarmonySpell(spell_id))
|
if(!IsHarmonySpell(spell_id))
|
||||||
spelltar->AddToHateList(this, aggro);
|
spelltar->AddToHateList(this, aggro);
|
||||||
else
|
else
|
||||||
if(!PassCharismaCheck(this, spelltar, spell_id))
|
if(!spelltar->PassCharismaCheck(this, spell_id))
|
||||||
spelltar->AddToHateList(this, aggro);
|
spelltar->AddToHateList(this, aggro);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -4388,7 +4388,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
level_mod += (2 * level_diff);
|
level_mod += (2 * level_diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CharismaCheck)
|
if (CharismaCheck)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -4402,7 +4402,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
*/
|
*/
|
||||||
int16 charisma = caster->GetCHA();
|
int16 charisma = caster->GetCHA();
|
||||||
|
|
||||||
if (IsFear && (spells[spell_id].targettype != 10)){
|
if (IsFear && (spells[spell_id].targettype != ST_Undead)){
|
||||||
|
|
||||||
if (charisma < 100)
|
if (charisma < 100)
|
||||||
resist_modifier -= 20;
|
resist_modifier -= 20;
|
||||||
@ -4423,8 +4423,10 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
else
|
else
|
||||||
resist_modifier += ((75 - charisma)/10) * 6; //Increase Resist Chance
|
resist_modifier += ((75 - charisma)/10) * 6; //Increase Resist Chance
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Lull spells DO NOT use regular resists on initial cast, instead they use a flat +15 modifier. Live parses confirm this.
|
//Lull spells DO NOT use regular resists on initial cast, instead they use a flat +15 modifier. Live parses confirm this.
|
||||||
//Regular resists are used when checking if mob will aggro off of a lull resist.
|
//Regular resists are used when checking if mob will aggro off of a lull resist.
|
||||||
if(!CharismaCheck && IsHarmonySpell(spell_id))
|
if(!CharismaCheck && IsHarmonySpell(spell_id))
|
||||||
@ -4452,9 +4454,8 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
//Minimum resist chance should be caclulated factoring in the RuleI(Spells, CharmBreakCheckChance)
|
//Minimum resist chance should be caclulated factoring in the RuleI(Spells, CharmBreakCheckChance)
|
||||||
if (CharmTick) {
|
if (CharmTick) {
|
||||||
|
|
||||||
int min_charmbreakchance = ((100/RuleI(Spells, CharmBreakCheckChance))/66 * 100)*2;
|
float min_charmbreakchance = ((100.0f/static_cast<float>(RuleI(Spells, CharmBreakCheckChance)))/66.0f * 100.0f)*2.0f;
|
||||||
|
if (resist_chance < static_cast<int>(min_charmbreakchance))
|
||||||
if (resist_chance < min_charmbreakchance)
|
|
||||||
resist_chance = min_charmbreakchance;
|
resist_chance = min_charmbreakchance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4462,9 +4463,9 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
//Minimum resist chance should be caclulated factoring in the RuleI(Spells, RootBreakCheckChance)
|
//Minimum resist chance should be caclulated factoring in the RuleI(Spells, RootBreakCheckChance)
|
||||||
if (IsRoot) {
|
if (IsRoot) {
|
||||||
|
|
||||||
int min_rootbreakchance = ((100/RuleI(Spells, RootBreakCheckChance))/22 * 100)*2;
|
float min_rootbreakchance = ((100.0f/static_cast<float>(RuleI(Spells, RootBreakCheckChance)))/22.0f * 100.0f)*2.0f;
|
||||||
|
|
||||||
if (resist_chance < min_rootbreakchance)
|
if (resist_chance < static_cast<int>(min_rootbreakchance))
|
||||||
resist_chance = min_rootbreakchance;
|
resist_chance = min_rootbreakchance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user