public virtual void Heal( Mobile patient )
{
if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) )
{
StopHeal();
return;
}
bool onSelf = ( patient == this );
if ( !patient.Alive )
{
}
else if ( patient.Poisoned )
{
int poisonLevel = patient.Poison.Level;
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1;
if ( ( healing >= 60.0 && anatomy >= 60.0 ) && chance > Utility.RandomDouble() )
{
if ( patient.CurePoison( this ) )
{
patient.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula
CheckSkill( SkillName.Anatomy, 0.0, 100.0 );
}
}
}
else if ( BleedAttack.IsBleeding( patient ) )
{
patient.SendLocalizedMessage( 1060167 ); // The bleeding wounds have healed, you are no longer bleeding!
BleedAttack.EndBleed( patient, false );
}
else
{
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = ( healing + 10.0 ) / 100.0;
if ( chance > Utility.RandomDouble() )
{
double min, max;
min = ( anatomy / 10.0 ) + ( healing / 6.0 ) + 4.0;
max = ( anatomy / 8.0 ) + ( healing / 3.0 ) + 4.0;
if ( onSelf )
max += 10;
double toHeal = min + ( Utility.RandomDouble() * ( max - min ) );
toHeal *= HealScalar;
patient.Heal( (int)toHeal );
CheckSkill( SkillName.Healing, 0.0, 90.0 );
CheckSkill( SkillName.Anatomy, 0.0, 100.0 );
}
}
HealEffect( patient );
StopHeal();
if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) )
HealStart( patient );
}