// this method is used for .e faint, and is copied directly from LieDown.cs, but modified to include an emote private static void Faint( PlayerMobile pm ) { if( pm == null || pm.Deleted ) return; CombatSystemAttachment csa = CombatSystemAttachment.GetCSA( pm ); if( pm.TrippedTimer != null ) { pm.TrippedTimer.Stop(); pm.TrippedTimer.Interval = TimeSpan.FromSeconds( 0.1 ); pm.TrippedTimer.Delay = TimeSpan.FromSeconds( 0.1 ); ( (Misc.TripFoe.TripFoeTimer)pm.TrippedTimer ).m_Repeat = false; ( (Misc.TripFoe.TripFoeTimer)pm.TrippedTimer ).m_Stage = 1; pm.TrippedTimer.Start(); } else { pm.PlaySound(pm.Female ? 791 : 1063); pm.Say("*faints*"); csa.DoTrip( 3 ); ( (Misc.TripFoe.TripFoeTimer)pm.TrippedTimer ).m_Repeat = true; } }
/// <summary> /// Fully refreshes the targetted player. /// Prevents any type of pre-casting or other advantages. /// </summary> /// <param name="targ"> The target to be refreshed</param> public static void RefreshPlayer( PlayerMobile targ ) { try { if (!targ.Alive) { Mobile m = (Mobile)targ; m.Resurrect(); } targ.Mana = targ.ManaMax; targ.Hits = targ.HitsMax; targ.Stam = targ.StamMax; targ.Poison = null; targ.Say("*Refreshed!*"); targ.Say("*Debuffed!*"); if (targ.Target != null) targ.Say("I have pre-casted..."); Server.Targeting.Target.Cancel(targ); if (targ.MeleeDamageAbsorb > 0) { targ.MeleeDamageAbsorb = 0; targ.EndAction(typeof(RechargeSpell)); targ.SendMessage("Reactive armor has been nullified."); } if (targ.MagicDamageAbsorb > 0) { targ.MagicDamageAbsorb = 0; targ.SendMessage("Magic Reflection has been nullified."); } StatMod mod; mod = targ.GetStatMod("[Magic] Str Offset"); if (mod != null) targ.RemoveStatMod("[Magic] Str Offset"); mod = targ.GetStatMod("[Magic] Dex Offset"); if (mod != null) targ.RemoveStatMod("[Magic] Dex Offset"); mod = targ.GetStatMod("[Magic] Int Offset"); if (mod != null) targ.RemoveStatMod("[Magic] Int Offset"); targ.Paralyzed = false; BuffInfo.RemoveBuff(targ, BuffIcon.Clumsy); BuffInfo.RemoveBuff(targ, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(targ, BuffIcon.Weaken); BuffInfo.RemoveBuff(targ, BuffIcon.MassCurse); BuffInfo.RemoveBuff(targ, BuffIcon.Agility); BuffInfo.RemoveBuff(targ, BuffIcon.Cunning); BuffInfo.RemoveBuff(targ, BuffIcon.Strength); BuffInfo.RemoveBuff(targ, BuffIcon.Bless); } catch (Exception e) { Console.WriteLine("Error : " + e.Message); Console.WriteLine("Location : refresh() in Manager.cs"); } }
private static void Honor( PlayerMobile source, Mobile target ) { IHonorTarget honorTarget = target as IHonorTarget; if ( honorTarget == null || !source.CanBeHarmful( target, true ) ) return; if ( honorTarget.ReceivedHonorContext != null ) { if ( honorTarget.ReceivedHonorContext.Source == source ) return; if ( honorTarget.ReceivedHonorContext.CheckDistance() ) { source.SendLocalizedMessage( 1063233 ); // Somebody else is honoring this opponent return; } } if ( target.Hits < target.HitsMax ) { source.SendLocalizedMessage( 1063166 ); // You cannot honor this monster because it is too damaged. return; } if ( source.SentHonorContext != null ) source.SentHonorContext.Cancel(); new HonorContext( source, target ); source.Direction = source.GetDirectionTo( target ); if ( !source.Mounted ) source.Animate( 32, 5, 1, true, true, 0 ); // OSI apparently removed this message... it's nice though source.Say( 1063231 ); // I honor you }
private static void Honor(PlayerMobile source, Mobile target) { IHonorTarget honorTarget = target as IHonorTarget; GuardedRegion reg = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion)); Map map = source.Map; if (honorTarget == null) return; if (honorTarget.ReceivedHonorContext != null) { if (honorTarget.ReceivedHonorContext.Source == source) return; if (honorTarget.ReceivedHonorContext.CheckDistance()) { source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent return; } } if (target.Hits < target.HitsMax) { source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged. return; } BaseCreature cret = target as BaseCreature; if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer))) { if (reg == null || reg.IsDisabled()) { //Allow honor on blue if Out of guardzone } else if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0) { //Allow honor on blue if in Fel } else { source.SendLocalizedMessage(1001018); // You cannot perform negative acts return; //cannot honor in trammel town on blue } } if (Core.ML && target is PlayerMobile) { source.SendLocalizedMessage(1075614); // You cannot honor other players. return; } if (source.SentHonorContext != null) source.SentHonorContext.Cancel(); new HonorContext(source, target); source.Say("I Honor Thee"); source.Direction = source.GetDirectionTo(target); if (!source.Mounted) source.Animate(32, 5, 1, true, true, 0); }