Merge master to movement_manager, fix for merge failure

This commit is contained in:
KimLS
2018-10-14 17:23:11 -07:00
75 changed files with 4554 additions and 2031 deletions
+9 -4
View File
@@ -97,10 +97,11 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates
continue;
}
if (AIspells[i].min_hp != 0 && GetIntHPRatio() < AIspells[i].min_hp)
// we reuse these fields for heal overrides
if (AIspells[i].type != SpellType_Heal && AIspells[i].min_hp != 0 && GetIntHPRatio() < AIspells[i].min_hp)
continue;
if (AIspells[i].max_hp != 0 && GetIntHPRatio() > AIspells[i].max_hp)
if (AIspells[i].type != SpellType_Heal && AIspells[i].max_hp != 0 && GetIntHPRatio() > AIspells[i].max_hp)
continue;
if (iSpellTypes & AIspells[i].type) {
@@ -137,9 +138,13 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates
&& tar->DontHealMeBefore() < Timer::GetCurrentTime()
&& !(tar->IsPet() && tar->GetOwner()->IsClient()) //no buffing PC's pets
) {
uint8 hpr = (uint8)tar->GetHPRatio();
if(hpr <= 35 || (!IsEngaged() && hpr <= 50) || (tar->IsClient() && hpr <= 99)) {
auto hp_ratio = tar->GetIntHPRatio();
int min_hp = AIspells[i].min_hp; // well 0 is default, so no special case here
int max_hp = AIspells[i].max_hp ? AIspells[i].max_hp : RuleI(Spells, AI_HealHPPct);
if (EQEmu::ValueWithin(hp_ratio, min_hp, max_hp) || (tar->IsClient() && hp_ratio <= 99)) { // not sure about client bit, leaving it
uint32 tempTime = 0;
AIDoSpellCast(i, tar, mana_cost, &tempTime);
tar->SetDontHealMeBefore(tempTime);