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 override bool DoEffect(Mobile from, Mobile target) { if ( target.Alive && from.CanBeBeneficial( target ) && from.CanSee( target ) && from.InLOS( target ) ) { from.DoBeneficial( target ); SpellHelper.Turn( from, target ); int toHeal = Utility.RandomMinMax( m_Min, m_Max ); if ( from != target && from.NetState != null ) from.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (target.Hits+toHeal > target.HitsMax ? target.HitsMax - target.Hits : toHeal).ToString(), "" ) ); target.Heal( toHeal ); target.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist ); target.PlaySound( 0x202 ); return true; } return false; }
public override bool DoEffect( Mobile from, Mobile target ) { if ( !SpellHelper.HasStatEffect( from, m_Stat ) && from.InLOS( target ) && target.Alive && from.CanBeBeneficial( target ) ) { from.DoBeneficial( target ); SpellHelper.Turn( from, target ); if ( m_Stat != StatType.All ) { SpellHelper.AddStatBonus( null, target, m_Stat ); } else { SpellHelper.AddStatBonus( null, target, StatType.Str ); SpellHelper.DisableSkillCheck = true; SpellHelper.AddStatBonus( null, target, StatType.Dex ); SpellHelper.AddStatBonus( null, target, StatType.Int ); SpellHelper.DisableSkillCheck = false; } target.FixedParticles( m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer ); target.PlaySound( m_Snd ); return true; } else { return false; } }
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 ) { 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 ) ); 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 && !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.55 + (0.1 * ((double)(0 - 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 = 2.0 + resDelay; else if ( dex >= 40 ) seconds = 3.0 + resDelay; else seconds = 4.0 + resDelay; } } if( seconds < 2.0 ) seconds = 2.0; BandageContext context = GetContext( healer ); if ( context != null ) context.StopHeal(); CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(healer); csa.Interrupted(true); if (healer is PlayerMobile) ((PlayerMobile)healer).ClearHands(true); else healer.ClearHands(); 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.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, Bandage bandage ) { bool isDeadPet = ( patient is BaseCreature && ( (BaseCreature) patient ).IsDeadPet ); if ( patient is BaseCreature && ( (BaseCreature) patient ).IsGolem ) { // Bandages cannot be used on that. healer.SendLocalizedMessage( 500970 ); } else if ( patient is BaseCreature && ( (BaseCreature) patient ).IsAnimatedDead ) { // You cannot heal that. healer.SendLocalizedMessage( 500951 ); } else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet ) { // That being is not damaged! healer.SendLocalizedMessage( 500955 ); } else if ( !patient.Alive && ( patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false ) ) ) { // Target cannot be resurrected at that location. healer.SendLocalizedMessage( 501042 ); } 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 = 5 + ( 0.5 * ( (double) ( 120 - dex ) / 10 ) ); // TODO: Verify algorithm } else { if ( GetPrimarySkill( patient, healer ) == SkillName.Veterinary ) seconds = 2; else seconds = 4 - ( (double) ( dex / 60 ) ) + resDelay; } if ( seconds < 1 ) seconds = 1; if ( seconds > 8 ) seconds = 8; BandageContext context = GetContext( healer ); if ( context != null ) context.RefreshTimer( TimeSpan.FromSeconds( seconds ) ); else m_Table[healer] = context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ), bandage ); if ( !onSelf ) patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. if ( healer.Client != null ) healer.Client.Send( new CooldownInfo( bandage, (int) seconds ) ); BuffInfo.AddBuff( healer, new BuffInfo( BuffIcon.Healing, 1151311, 1151400, TimeSpan.FromSeconds( seconds ), healer, patient.Name ) ); healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages. return context; } return null; }
public override bool DoEffect(Mobile from, Mobile target) { if ( from.CanBeBeneficial( target ) && target.Alive && from.Alive && from.InLOS( target ) && !ProtectionSpell.Registry.ContainsKey( target ) ) { from.DoBeneficial( target ); SpellHelper.Turn( from, target ); int val = Utility.Random( 5 ) + 6; target.VirtualArmorMod += val; ProtectionSpell.Registry.Add( target, val ); new ProtectionSpell.InternalTimer( TimeSpan.FromSeconds( 30 + Utility.Random( 60 ) ), target, val ).Start(); target.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist ); target.PlaySound( 0x1F7 ); return true; } return false; }
public override bool DoEffect(Mobile from, Mobile target) { if ( !target.Hidden && from.InLOS( target ) && target.Alive && from.CanBeBeneficial( target ) ) { from.DoBeneficial( target ); SpellHelper.Turn( from, target ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( target.X, target.Y, target.Z + 16 ), target.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 ); target.PlaySound( 0x3C4 ); target.Hidden = true; InvisibilitySpell.RemoveTimer( target ); Timer t = new InvisibilitySpell.InternalTimer( target, TimeSpan.FromSeconds( 30 + Utility.Random( 91 ) ) ); t.Start(); InvisibilitySpell.m_Table[target] = t; return true; } else { return false; } }
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 MedKitContext BeginHeal( Mobile healer, Mobile patient ) { bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet ); if ( patient is Golem ) { healer.SendLocalizedMessage( 500970 ); // MedKits cannot be used on that. } else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead ) { healer.SendLocalizedMessage( 500951 ); // You cannot heal that. } else if ( patient.Poisoned || BleedAttack.IsBleeding( patient ) ) { healer.SendMessage("You cannot do that right now."); } else if (!patient.Alive) { healer.SendMessage("It's too late for them."); } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial( patient ); bool onSelf = ( healer == patient ); int dex = healer.Dex; double seconds = 10; double resDelay = ( patient.Alive ? 0.0 : 5.0 ); MedKitContext context = GetContext( healer ); if ( context != null ) context.StopHeal(); seconds *= 1000; context = new MedKitContext( healer, patient, TimeSpan.FromMilliseconds( seconds ) ); m_Table[healer] = context; if ( !onSelf ) patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. healer.SendMessage("You begin working on the patient..."); return context; } return null; }
public void OnTarget( Mobile from, object targeted ) { if ( this.Deleted || this.Amount <= 0 ) return; Mobile targ = targeted as Mobile; if ( from.NextSkillTime > DateTime.Now ) { from.SendSkillMessage(); // You must wait... } else if ( targ == null || targ.Deleted || !targ.Alive || !( targ.Body.IsHuman || targ.Body.IsAnimal || targ.Body.IsSea || (targ is BaseCreature && ((BaseCreature)targ).Controled && !((BaseCreature)targ).Summoned) ) ) { // you can heal anything tamable... I guess. from.SendLocalizedMessage( 500951 ); // You cannot heal that. } else if ( !from.InRange( targ, 3 ) ) { from.SendLocalizedMessage( 500295 ); // You are too far away to do that. } else if ( Notoriety.Compute( from, targ ) == Notoriety.Enemy ) // || Server.Misc.NotorietyHandlers.CheckAggressor( from.Aggressors, targ ) || Server.Misc.NotorietyHandlers.CheckAggressed( from.Aggressed, targ ) ) { from.SendAsciiMessage( "You cannot heal them right now." ); } else if ( !from.CanSee( targ ) || !from.InLOS( targ ) ) { from.SendAsciiMessage( "You can't see that." ); } else if ( targ.Hits >= targ.HitsMax ) { from.SendLocalizedMessage( 500955 ); // That being is not damaged! } else if ( !targ.CanBeginAction( typeof( Bandage ) ) || !from.CanBeBeneficial( targ, true, true ) ) { from.SendAsciiMessage( "This being cannot be newly bandaged yet." ); } else { from.DoBeneficial( targ ); from.RevealingAction(); this.Consume(); int damage = targ.HitsMax - targ.Hits; int sk = damage * 100 / targ.HitsMax; int healed = 1; SkillName skill = GetSkillFor( targ ); if ( from.CheckSkill( skill, sk - 25.0, sk + 25.0 ) ) { targ.PlaySound( 0x57 ); double scale = ( 75.0 + from.Skills[skill].Value - sk ) / 100.0; if ( scale > 1.0 ) scale = 1.0; else if ( scale < 0.5 ) scale = 0.5; healed = (int)( damage * scale ); if ( healed < 1 ) healed = 1; else if ( healed > 100 ) healed = 100; } targ.Hits += healed; if ( healed > 1 ) from.SendAsciiMessage( "You apply the bandages." ); else from.SendAsciiMessage( "You apply the bandages, but they barely help." ); targ.BeginAction( typeof( Bandage ) ); new BandageExpire( targ ).Start(); } }