Fixed Merc lack of use of heal over time spells (causing excessive healing), fixed pet mitigation/AC issues.

This commit is contained in:
badcaptain 2013-04-02 19:09:32 -04:00
parent 24d4eaf65d
commit a787a7ce72
2 changed files with 17 additions and 15 deletions

View File

@ -562,7 +562,14 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit)
}
else if(IsNPC())
{
armor = spellbonuses.AC + itembonuses.AC + (CastToNPC()->GetRawAC() / RuleR(Combat, NPCACFactor)) + 1;
armor = CastToNPC()->GetRawAC();
if(!IsPet())
{
armor = (armor / RuleR(Combat, NPCACFactor));
}
armor += spellbonuses.AC + itembonuses.AC + 1;
}
if(GetClass() == WIZARD || GetClass() == MAGICIAN || GetClass() == NECROMANCER || GetClass() == ENCHANTER)

View File

@ -2237,10 +2237,6 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
if(numToHeal > 2) {
selectedMercSpell = GetBestMercSpellForGroupHeal(this);
if(selectedMercSpell.spellid == 0) {
selectedMercSpell = GetBestMercSpellForRegularSingleTargetHeal(this);
}
}
if(tar && selectedMercSpell.spellid == 0) {
@ -2267,7 +2263,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
selectedMercSpell = GetBestMercSpellForRegularSingleTargetHeal(this);
}
}
else if (tar->GetHPRatio() < 75) {
else if (tar->GetHPRatio() < 80) {
selectedMercSpell = GetBestMercSpellForPercentageHeal(this);
//get regular heal
@ -2278,18 +2274,14 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
else {
//check for heal over time. if not present, try it first
if(!tar->FindType(SE_HealOverTime)) {
selectedMercSpell = GetBestMercSpellForRegularSingleTargetHeal(this);
}
selectedMercSpell = GetBestMercSpellForHealOverTime(this);
//get regular heal
if(selectedMercSpell.spellid == 0) {
selectedMercSpell = GetBestMercSpellForRegularSingleTargetHeal(this);
//get regular heal
if(selectedMercSpell.spellid == 0) {
selectedMercSpell = GetBestMercSpellForRegularSingleTargetHeal(this);
}
}
}
if(selectedMercSpell.spellid == 0) {
selectedMercSpell = GetFirstMercSpellForSingleTargetHeal(this);
}
}
if(selectedMercSpell.spellid > 0) {
@ -5598,6 +5590,9 @@ void Client::SpawnMercOnZone()
GetMercInfo().SuspendedTime = 0;
// Get merc, assign it to client & spawn
if(database.LoadMercInfo(this)) {
if(!CheckCanUnsuspendMerc()){
return;
}
Merc* merc = Merc::LoadMerc(this, &zone->merc_templates[GetMercInfo().MercTemplateID], 0, true);
SpawnMerc(merc, false);
SendMercTimerPacket(merc->GetID(), 5, GetMercInfo().SuspendedTime, GetMercInfo().MercTimerRemaining, RuleI(Mercs, SuspendIntervalMS));