public static OnUse ( Mobile m ) : System.TimeSpan | ||
m | Mobile | |
return | System.TimeSpan |
public static TimeSpan OnUse(Mobile m) { if (!m.Hidden) { Hiding.OnUse(m); if (!m.Hidden) // Si le jet est raté. { return(TempsJetRate); } else { return(OnUse(m)); } } else if (!m.CanBeginAction(typeof(Stealth))) { m.SendLocalizedMessage(1063086); // You cannot use this skill right now. } else { if (m.CheckSkill(SkillName.Infiltration, (m.Skills[SkillName.Infiltration].Value * ScalMalusArmure(m)))) { int steps = (int)(m.Skills[SkillName.Infiltration].Value / Diviseur); // A 100, 20 steps, ou 4 steps en courrant. // Malus de dex sur le nombre de pas possible. int val = (int)(steps * ScalMalusArmure(m)); if (val != steps) { steps = val; m.SendMessage("Vous n'êtes pas assez agile pour vous déplacer efficacement avec cette armure."); } if (steps < 1) { steps = 1; } m.AllowedStealthSteps = steps; m.SendLocalizedMessage(502730); // You begin to move quietly. return(TempsJetReussit); } else { m.SendLocalizedMessage(502731); // You fail in your attempt to move unnoticed. m.RevealingAction(); return(TempsJetRate); } } return(TempsJetImposs); }
public static TimeSpan OnUse(Mobile m) { if (m is TeiravonMobile && ((TeiravonMobile)m).m_Revealed + TimeSpan.FromSeconds(3.0) > DateTime.Now) { m.SendMessage("You cannot find any cover so quickly after being revealed."); return(TimeSpan.FromSeconds(1.0)); } if (!m.Hidden) { Hiding.OnUse(m); } /* * else if ( m.Skills[SkillName.Hiding].Base < ((Core.SE) ? 50.0 : 80.0) ) * { * m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding. * } */ /*else if ( CheckNear( m ) ) * { * m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed. * m.RevealingAction(); * }*/ else { // int armorRating = (int) m.ArmorRating; // if ( armorRating > 25 ) // { // m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor. // m.RevealingAction(); // } // else if ( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), 80.0 + (armorRating * 2) ) ) int armorRating = 0; BaseArmor bam; Item item; item = m.FindItemOnLayer(Layer.TwoHanded); if (item is BaseShield) { if (item is Buckler) { armorRating++; } else if (item is HeaterShield) { armorRating += 5; } else { armorRating += 3; } } item = m.FindItemOnLayer(Layer.InnerTorso); if (item is BaseArmor) { bam = (BaseArmor)item; if (bam is DrowChainChest || bam is ElvenChainChest) { armorRating += (((int)bam.MaterialType - 4) * 4); } else { armorRating += ((int)bam.MaterialType * 4); } } item = m.FindItemOnLayer(Layer.Pants); if (item is BaseArmor) { bam = (BaseArmor)item; if (bam is DrowChainLegs || bam is ElvenChainLegs) { armorRating += (((int)bam.MaterialType - 4) * 4); } else { armorRating += ((int)bam.MaterialType * 3); } } item = m.FindItemOnLayer(Layer.Arms); if (item is BaseArmor) { bam = (BaseArmor)item; armorRating += ((int)bam.MaterialType * 2); } item = m.FindItemOnLayer(Layer.Helm); if (item is BaseArmor) { bam = (BaseArmor)item; if (bam is DrowChainCoif || bam is ElvenChainCoif) { armorRating += (((int)bam.MaterialType - 4) * 4); } else { armorRating += ((int)bam.MaterialType * 2); } } item = m.FindItemOnLayer(Layer.Gloves); if (item is BaseArmor) { bam = (BaseArmor)item; armorRating += ((int)bam.MaterialType * 1); } item = m.FindItemOnLayer(Layer.Neck); if (item is BaseArmor) { bam = (BaseArmor)item; armorRating += ((int)bam.MaterialType * 1); } // m.SendMessage("{0} to {1}", -20.0 + armorRating, 80.0 + armorRating); if (m.CheckSkill(SkillName.Stealth, -30.0 + (armorRating), 80.0 + (armorRating))) { int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0)); if (steps < 1) { steps = 1; } if (m is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)m; if (m_Player.HasFeat(TeiravonMobile.Feats.AdvancedStealth)) { steps += 15; } } m.AllowedStealthSteps = steps; m.SendLocalizedMessage(502730); // You begin to move quietly. return(TimeSpan.FromSeconds(3.0)); } else { m.SendLocalizedMessage(502731); // You fail in your attempt to move unnoticed. m.RevealingAction(); } } return(TimeSpan.FromSeconds(3.0)); }