public static BandageContext BeginHeal(Mobile healer, Mobile patient) { //vira para quem vai curar SpellHelper.Turn(healer, patient); bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else { seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { //if ( dex >= 40 ) seconds = 2.0; //else // seconds = 3.0; } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } //mensagens if (patient.Alive) { healer.Emote("*{0} esta tratando os ferimentos de {1}*", healer.Name, patient.Name); if (healer.Body.Type == BodyType.Human && !healer.Mounted) { healer.Animate(10, 5, 1, true, false, 0); healer.PlaySound(72); } } else { healer.Emote("*{0} esta estancando os ferimentos de {1}*", healer.Name, patient.Name); if (healer.Body.Type == BodyType.Human && !healer.Mounted) { healer.Animate(10, 5, 4, true, false, 0); healer.PlaySound(72); } } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else { seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { seconds = 2.0; } else if (Core.AOS) { if (dex < 204) { seconds = 3.2 - (Math.Sin((double)dex / 130) * 2.5) + resDelay; } else { seconds = 0.7 + resDelay; } } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } seconds *= 1000; context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds), enhanced); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced) { bool isDeadPet = patient is BaseCreature && ((BaseCreature)patient).IsDeadPet; if (patient is IRepairableMobile) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } var delay = GetDelay(healer, patient); if (patient is PlayerMobile) { BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1002082, 1151400, delay, healer, string.Format("{0}", patient.Name))); } else { BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Veterinary, 1002167, 1151400, delay, healer, string.Format("{0}", patient.Name))); } context = new BandageContext(healer, patient, delay, enhanced); m_Table[healer] = context; if (healer != patient) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. if (healer.NetState != null && healer.NetState.IsEnhancedClient) { healer.NetState.Send(new BandageTimerPacket((int)delay.TotalSeconds)); } return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced) // TODO: Implement Pub 71 healing changes { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is IRepairableMobile) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !SplinteringWeaponContext.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = Math.Min(8, Math.Ceiling(11.0 - healer.Dex / 20)); seconds = Math.Max(seconds, 4); } else { seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { seconds = 2.0; } else if (Core.AOS) { seconds = Math.Ceiling((double)4 - healer.Dex / 60); seconds = Math.Max(seconds, 2); } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } if (patient is PlayerMobile) { BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1002082, 1151400, TimeSpan.FromSeconds(seconds), healer, String.Format("{0}", patient.Name))); } else { BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Veterinary, 1002167, 1151400, TimeSpan.FromSeconds(seconds), healer, String.Format("{0}", patient.Name))); } seconds *= 1000; context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds), enhanced); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = AOS.GeneralTimeScaling * (patient.Alive ? 0.0 : 5.0); if (onSelf) { //seconds = AOS.GeneralTimeScaling * (9.4 + (0.6 * ((double)(120 - dex) / 10))); seconds = 10.0 + (100 - (healer.Skills[SkillName.Soins].Value)) / 10; } else { /*if (dex > 150) * dex = 150; * * seconds = AOS.GeneralTimeScaling * (0.6 * ((double)(150 - dex) / 9));*/ seconds = 4.0 + (100 - (healer.Skills[SkillName.Soins].Value)) / 10; } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.GetNameUsedBy(patient)); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendAsciiMessage("That being is not damaged!"); //healer.SendLocalizedMessage( 500955 ); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendAsciiMessage("Target cannot be resurrected at that location."); //healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else { seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { //if ( dex >= 40 ) seconds = 2.0; //else // seconds = 3.0; } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } if ((patient.LastHealTime + TimeSpan.FromMinutes(3.0)) < DateTime.Now) { patient.LastHealTime = DateTime.Now; context = new BandageContext(healer, patient, TimeSpan.FromSeconds(/*seconds*/ 0.0)); } else { healer.SendAsciiMessage("This being cannot be newly bandaged yet."); } m_Table[healer] = context; /*if ( !onSelf ) * patient.SendAsciiMessage(String.Format("{0} : Attempting to heal you.", healer.Name));*/ //patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. //healer.SendAsciiMessage("You begin applying the bandages."); //healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { //if( Core.AOS ) seconds = 4 + (0.5 * ((double)(120 - dex) / 10)); Item handOne = healer.FindItemOnLayer(Layer.OneHanded); Item handTwo = healer.FindItemOnLayer(Layer.TwoHanded); bool freeHand = handOne == null; if (!freeHand) { freeHand = handTwo == null; } if (!freeHand) { seconds++; } //else // seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { if (dex >= 40) { seconds = 2.0; } else { seconds = 3.0; } } else { if (dex >= 100) { seconds = 2.0 + resDelay; } else if (dex >= 75) { seconds = 3.0 + resDelay; } else { seconds = 4.0 + resDelay; } } } if (healer.Player) { Medic med = Perk.GetByType <Medic>((Player)healer); if (med != null) { seconds -= med.GetHealTimeBonus(seconds); } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, Bandage origin) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits >= patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendAsciiMessage("That being is not damaged!"); } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { //Maka if (healer is PlayerMobile) { ((PlayerMobile)healer).WeaponTimerCheck(); } healer.RevealingAction(); if (patient.Player) { healer.DoBeneficial(patient); } bool onSelf = (healer == patient); int dex = healer.Dex; //double seconds; double bandageDelay = (patient.Alive ? 2.5 : 0.0); /* * if ( onSelf ) * { * if ( Core.AOS ) * seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm * else * seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); * } * else * { * if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary ) * { * seconds = 2.0; * } * else if ( Core.AOS ) * { * if (dex < 204) * { * seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay; * } * else * { * seconds = 0.7 + resDelay; * } * } * else * { * if ( dex >= 100 ) * seconds = 3.0 + resDelay; * else if ( dex >= 40 ) * seconds = 4.0 + resDelay; * else * seconds = 5.0 + resDelay; * } * } */ BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } //seconds *= 1000; //context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds)); context = new BandageContext(healer, patient, TimeSpan.FromSeconds(bandageDelay), origin); m_Table[healer] = context; healer.SendAsciiMessage(string.Format("You put the clean bandages on the wounded {0}.", patient.Name)); return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadFollower); PlayerMobile playerPatient = patient as PlayerMobile; if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. return(null); } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. return(null); } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! return(null); } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. return(null); } if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = 0; if (!patient.Alive) { resDelay += 5; } if (onSelf) { seconds = SkillCooldown.HealingSelfCooldown; } else { seconds = SkillCooldown.HealingOtherCooldown + resDelay; } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } double rapidTreatmentValue = healer.GetSpecialAbilityEntryValue(SpecialAbilityEffect.RapidTreatment); if (rapidTreatmentValue > 0) { seconds *= rapidTreatmentValue; } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { if (!patient.Poisoned && patient.Hits == patient.HitsMax) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = healer == patient; int dex = healer.Dex; double seconds; double resDelay = patient.Alive ? 0.0 : 5.0; if (onSelf) { seconds = 9.4 + 0.6 * ((double)(120 - dex) / 10); } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } seconds *= 1000; context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { seconds = 14 - ((healer.Skills.Healing.Value / 10)) + resDelay; if (seconds < 1) { seconds = 1; } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { //if ( dex >= 40 ) seconds = 3.0; //else // seconds = 3.0; } else { seconds = 10 - ((healer.Skills.Healing.Value / 10)) + resDelay; if (seconds < 1) { seconds = 1; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); if (DateTime.Now + TimeSpan.FromSeconds(seconds) > healer.NextCombatTime) { healer.NextCombatTime = (DateTime.Now + TimeSpan.FromSeconds(seconds)); } m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendLocalizedMessage(500955); // That being is not damaged! } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; //double seconds; double seconds = patient.Alive ? (patient.Poisoned ? 6.0 : 5.0) : 10.0; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else//was: seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); { seconds *= 3; if (healer.Skills[SkillName.Healing].Value > 90) { seconds -= 3.0 * ((healer.Skills[SkillName.Healing].Value - 90.0) / 10.0); } } } /*else * { * if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary ) * { * //if ( dex >= 40 ) * seconds = 2.0; * //else * // seconds = 3.0; * } * else * { * if ( dex >= 100 ) * seconds = 3.0 + resDelay; * else if ( dex >= 40 ) * seconds = 4.0 + resDelay; * else * seconds = 5.0 + resDelay; * } * }*/ // according to stratics: // dex | heal self | heal other | cure self | cure other // 100 | 11s | 3s | 13 | 4 seconds *= 0.74 + ((double)(100 - dex) / 75) * 0.26; BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendAsciiMessage("Bandages cannot be used on that."); } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendAsciiMessage("You cannot heal that."); } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendAsciiMessage("That being is not damaged!"); } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendAsciiMessage("Target cannot be resurrected at that location."); } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { if (Core.AOS) { seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else { seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } } else { if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary) { //if ( dex >= 40 ) seconds = 2.0; //else // seconds = 3.0; } else { if (dex >= 100) { seconds = 3.0 + resDelay; } else if (dex >= 40) { seconds = 4.0 + resDelay; } else { seconds = 5.0 + resDelay; } } } BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds)); m_Table[healer] = context; if (!onSelf) { patient.SendAsciiMessage(healer.Name + " : Attempting to heal you."); } healer.SendAsciiMessage("You begin applying the bandages."); return(context); } return(null); }