本文整理汇总了C#中Mobile.CheckSkill方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CheckSkill方法的具体用法?C# Mobile.CheckSkill怎么用?C# Mobile.CheckSkill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.CheckSkill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
* making them more vulnerable to Fire and Poison damage,
* but increasing their resistance to Physical and Cold damage.
*
* The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
*
* NOTE: Algorithm above is fixed point, should be:
* ((ss-mr)/2.5) + 40
*
* NOTE: Resistance is not checked if targeting yourself
*/
ExpireTimer timer = (ExpireTimer)m_Table[m];
if ( timer != null )
timer.DoExpire();
else
m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
m.PlaySound( 0x1BB );
double ss = GetDamageSkill( Caster );
double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );
ResistanceMod[] mods = new ResistanceMod[4]
{
new ResistanceMod( ResistanceType.Fire, -15 ),
new ResistanceMod( ResistanceType.Poison, -15 ),
new ResistanceMod( ResistanceType.Cold, +10 ),
new ResistanceMod( ResistanceType.Physical, +10 )
};
timer = new ExpireTimer( m, mods, duration );
timer.Start();
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );
m_Table[m] = timer;
for ( int i = 0; i < mods.Length; ++i )
m.AddResistanceMod( mods[i] );
HarmfulSpell( m );
}
FinishSequence();
}
示例2: OnUse
public static TimeSpan OnUse( Mobile m )
{
if ( !m.Hidden )
{
m.SendLocalizedMessage( 502725 ); // You must hide first
}
else if ( m.Skills[SkillName.Hiding].Base < HidingRequirement )
{
m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding.
m.RevealingAction();
}
else if( !m.CanBeginAction( typeof( Stealth ) ) )
{
m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
m.RevealingAction();
}
else
{
int armorRating = GetArmorRating( m );
if( armorRating >= (Core.AOS ? 42 : 26) ) //I have a hunch '42' was chosen cause someone's a fan of DNA
{
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), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2) ) )
{
int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));
if( steps < 1 )
steps = 1;
m.AllowedStealthSteps = steps;
// ------ NERUN's DISTRO - Orc Scout bug fix -----
if ( m is PlayerMobile )
{
PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
pm.IsStealthing = true;
}
/*
PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
if( pm != null )
pm.IsStealthing = true;
*/
// ------ END
m.SendLocalizedMessage( 502730 ); // You begin to move quietly.
return TimeSpan.FromSeconds( 10.0 );
}
else
{
m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
m.RevealingAction();
}
}
return TimeSpan.FromSeconds( 10.0 );
}
示例3: OnUse
public static TimeSpan OnUse( Mobile m )
{
if ( !m.Hidden )
{
m.SendLocalizedMessage( 502725 ); // You must hide first
}
else if ( m.Skills[SkillName.Hiding].Base < 80.0 )
{
m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding.
}
else if ( m.CheckSkill( SkillName.Stealth, 0.0, 100.0 ) )
{
int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 100.0 : 5.0));
if ( steps < 1 )
steps = 1;
m.AllowedStealthSteps = steps;
m.SendLocalizedMessage( 502730 ); // You begin to move quietly.
return TimeSpan.FromSeconds( 10.0 );
}
else
{
m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
m.RevealingAction();
}
return TimeSpan.FromSeconds( 10.0 );
}
示例4: CheckRepairDifficulty
private bool CheckRepairDifficulty( Mobile mob, SkillName skill, int curHits, int maxHits )
{
double difficulty = GetRepairDifficulty( curHits, maxHits ) * 0.1;
if( m_Deed != null )
{
double value = m_Deed.SkillLevel;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if( value < minSkill )
return false; // Too difficult
else if( value >= maxSkill )
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
return (chance >= Utility.RandomDouble());
}
else
{
return mob.CheckSkill( skill, difficulty - 25.0, difficulty + 25.0 );
}
}
示例5: OnUse
public static TimeSpan OnUse( Mobile m )
{
m.RevealingAction();
if ( m.CheckSkill( SkillName.SpiritSpeak, 0, 100 ) )
{
if ( !m.CanHearGhosts )
{
Timer t = new SpiritSpeakTimer( m );
double secs = m.Skills[SkillName.SpiritSpeak].Base / 50;
secs *= 90;
if ( secs < 15 )
secs = 15;
t.Delay = TimeSpan.FromSeconds( secs );//15seconds to 3 minutes
t.Start();
m.CanHearGhosts = true;
}
m.PlaySound( 0x24A );
m.SendLocalizedMessage( 502444 );//You contact the neitherworld.
}
else
{
m.SendLocalizedMessage( 502443 );//You fail to contact the neitherworld.
m.CanHearGhosts = false;
}
return TimeSpan.FromSeconds( 1.0 );
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else if ( from.CheckSkill( SkillName.Camping, 0.0, 100.0 ) )
{
Point3D loc;
if ( Parent == null )
loc = Location;
else
loc = from.Location;
Consume();
new Campfire().MoveToWorld( loc, from.Map );
}
else
{
from.SendLocalizedMessage( 501696 ); // You fail to ignite the campfire.
if ( Utility.RandomBool() )
{
from.SendMessage( "You lost some kindling." );
Consume();
}
}
}
示例7: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (SummonScalar == 0)
{
base.OnDoubleClick(from);
}
else
{
if (!from.CheckSkill(SkillName.Mysticism, 0, 35))
{
from.SendMessage("Le mécanisme, sous vos mains non initiées en magie, s'abime");
Durability--;
}
else
{
from.SendMessage("La bestiole prend vie");
IronBeetle beetle = new IronBeetle();
beetle.SummonScalar = this.SummonScalar;
beetle.Controlled = true;
beetle.ControlMaster = from;
beetle.Crafted = true;
beetle.MoveToWorld(from.Location, from.Map);
this.Delete();
}
if (Durability == 0)
{
from.SendMessage("Vous détruisez la carapace");
Delete();
}
}
base.OnDoubleClick(from);
}
示例8: Target
public void Target( Mobile m )
{
if ( HasMindRotScalar( m ) )
{
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
/* Attempts to place a curse on the Target that increases the mana cost of any spells they cast,
* for a duration based off a comparison between the Caster's Spirit Speak skill and the Target's Resisting Spells skill.
* The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 50 ) + 20 seconds.
*/
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.PlaySound( 0x1FB );
m.PlaySound( 0x258 );
m.FixedParticles( 0x373A, 1, 17, 9903, 15, 4, EffectLayer.Head );
TimeSpan duration = TimeSpan.FromSeconds( (((GetDamageSkill( Caster ) - GetResistSkill( m )) / 5.0) + 20.0) * (m.Player ? 1.0 : 2.0 ) );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
if ( m.Player )
SetMindRotScalar( Caster, m, 1.25, duration );
else
SetMindRotScalar( Caster, m, 2.00, duration );
HarmfulSpell( m );
}
FinishSequence();
}
示例9: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (!this.VerifyMove(from))
return;
if (!from.InRange(this.GetWorldLocation(), 2))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
return;
}
Point3D fireLocation = this.GetFireLocation(from);
if (fireLocation == Point3D.Zero)
{
from.SendLocalizedMessage(501695); // There is not a spot nearby to place your campfire.
}
else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0))
{
from.SendLocalizedMessage(501696); // You fail to ignite the campfire.
}
else
{
this.Consume();
if (!this.Deleted && this.Parent == null)
from.PlaceInBackpack(this);
new Campfire().MoveToWorld(fireLocation, from.Map);
}
}
示例10: PowerTarget
public void PowerTarget(Mobile from, object obj)
{
if (!(obj is IronBeetleBody))
{
m_From.SendMessage("Cela ne servirait à rien sur cet objet");
return;
}
IronBeetleBody targ = (IronBeetleBody)obj;
if (targ.SummonScalar != 0)
{
from.SendMessage("Ce corps est déjà été imprégné d'une âme");
return;
}
from.SendMessage("L'esprit contenu dans le Crystal se dissipe sur la carapace");
targ.SummonScalar = m_Crystal.Completion / 100;
if (!from.CheckSkill(SkillName.Mysticism, 60))
{
from.SendMessage("Le crystal se brise pendant le transfert");
m_Crystal.Delete();
}
m_Crystal.Completion = 0;
return;
}
示例11: Target
public void Target( Mobile m )
{
if ( Caster == m || !(m is PlayerMobile || m is BaseCreature) ) // only PlayerMobile and BaseCreature implement blood oath checking
{
Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
}
else if ( m_OathTable.Contains( Caster ) )
{
Caster.SendLocalizedMessage( 1061607 ); // You are already bonded in a Blood Oath.
}
else if ( m_OathTable.Contains( m ) )
{
if ( m.Player )
Caster.SendLocalizedMessage( 1061608 ); // That player is already bonded in a Blood Oath.
else
Caster.SendLocalizedMessage( 1061609 ); // That creature is already bonded in a Blood Oath.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
/* Temporarily creates a dark pact between the caster and the target.
* Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
* The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
*
* NOTE: The above algorithm must be fixed point, it should be:
* ((ss-rm)/8)+8
*/
ExpireTimer timer = (ExpireTimer)m_Table[m];
if ( timer != null )
timer.DoExpire();
m_OathTable[Caster] = Caster;
m_OathTable[m] = Caster;
Caster.PlaySound( 0x175 );
Caster.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
Caster.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );
m.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
m.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );
TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
timer = new ExpireTimer ( Caster, m, duration );
timer.Start ();
BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString () ) );
BuffInfo.AddBuff ( m, new BuffInfo ( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString () ) );
m_Table[m] = timer;
}
FinishSequence();
}
示例12: OnUse
public static TimeSpan OnUse( Mobile m )
{
m.RevealingAction();
if ( m.Target != null )
{
m.SendLocalizedMessage( 501845 ); // You are busy doing something else and cannot focus.
return TimeSpan.FromSeconds( 5.0 );
}
else if ( m.Hits < (m.HitsMax / 10) ) // Less than 10% health
{
m.SendLocalizedMessage( 501849 ); // The mind is strong but the body is weak.
return TimeSpan.FromSeconds( 5.0 );
}
else if ( m.Mana >= m.ManaMax )
{
m.SendLocalizedMessage( 501846 ); // You are at peace.
return TimeSpan.FromSeconds( 5.0 );
}
else
{
Item oneHanded = m.FindItemOnLayer( Layer.OneHanded );
Item twoHanded = m.FindItemOnLayer( Layer.TwoHanded );
if ( Core.AOS )
{
if ( !CheckOkayHolding( oneHanded ) )
m.AddToBackpack( oneHanded );
if ( !CheckOkayHolding( twoHanded ) )
m.AddToBackpack( twoHanded );
}
else if ( !CheckOkayHolding( oneHanded ) || !CheckOkayHolding( twoHanded ) )
{
m.SendLocalizedMessage( 502626 ); // Your hands must be free to cast spells or meditate.
return TimeSpan.FromSeconds( 2.5 );
}
if ( m.CheckSkill( SkillName.Meditation, 0, 100 ) )
{
m.SendLocalizedMessage( 501851 ); // You enter a meditative trance.
m.Meditating = true;
if ( m.Player || m.Body.IsHuman )
m.PlaySound( 0xF9 );
}
else
{
m.SendLocalizedMessage( 501850 ); // You cannot focus your concentration.
}
return TimeSpan.FromSeconds( 10.0 );
}
}
示例13: OnPickedInstrument
public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
{
from.RevealingAction();
if (!BaseInstrument.CheckMusicianship(from))
{
from.SendLocalizedMessage(500612); // You play poorly, and there is no effect.
instrument.PlayInstrumentBadly(from);
instrument.ConsumeUse(from);
}
else if (!from.CheckSkill(SkillName.Peacemaking, 0.0, 100.0))
{
from.SendLocalizedMessage(500613); // You attempt to calm everyone, but fail.
instrument.PlayInstrumentBadly(from);
instrument.ConsumeUse(from);
}
else
{
instrument.PlayInstrumentWell(from);
instrument.ConsumeUse(from);
Map map = from.Map;
if (map != null)
{
int range = BaseInstrument.GetBardRange(from, SkillName.Peacemaking);
bool calmed = false;
foreach (Mobile m in from.GetMobilesInRange(range))
{
#region Dueling
if (m.Region is Engines.ConPVP.SafeZone)
continue;
#endregion
BaseCreature bc = m as BaseCreature;
if ((bc != null && bc.Uncalmable) || m == from || !m.Alive)
continue;
calmed = true;
m.SendLocalizedMessage(500616); // You hear lovely music, and forget to continue battling!
m.Combatant = null;
if (!m.Player)
m.Warmode = false;
if (bc != null && !bc.BardPacified)
bc.Pacify(from, DateTime.Now + TimeSpan.FromSeconds(2.5));
}
if (!calmed)
from.SendLocalizedMessage(1049648); // You play hypnotic music, but there is nothing in range for you to calm.
else
from.SendLocalizedMessage(500615); // You play your hypnotic music, stopping the battle.
}
}
}
示例14: Use
public void Use( Mobile from, BaseWeapon weapon )
{
BeginSwing();
from.Direction = from.GetDirectionTo( GetWorldLocation() );
weapon.PlaySwingAnimation( from );
from.CheckSkill( weapon.Skill, m_MinSkill, m_MaxSkill );
}
示例15: OnUse
public static TimeSpan OnUse( Mobile m )
{
m.RevealingAction();
if ( m.Target != null )
{
m.SendLocalizedMessage( 501845 ); // You are busy doing something else and cannot focus.
return TimeSpan.FromSeconds( 5.0 );
}
else if ( m.Hits < (m.HitsMax / 10) ) // Less than 10% health
{
m.SendLocalizedMessage( 501849 ); // The mind is strong but the body is weak.
return TimeSpan.FromSeconds( 5.0 );
}
else if ( m.Mana >= m.ManaMax )
{
m.SendLocalizedMessage( 501846 ); // You are at peace.
return TimeSpan.FromSeconds( 5.0 );
}
else
{
Item oneHanded = m.FindItemOnLayer( Layer.OneHanded );
Item twoHanded = m.FindItemOnLayer( Layer.TwoHanded );
if ( !CheckOkayHolding( oneHanded ) || !CheckOkayHolding( twoHanded ) )
{
m.SendLocalizedMessage( 502626 ); // Your hands must be free to cast spells or meditate.
return TimeSpan.FromSeconds( 2.5 );
}
double skillVal = m.Skills[SkillName.Meditation].Value;
double chance = (50.0 + (( skillVal - ( m.ManaMax - m.Mana ) ) * 2)) / 100;
if ( chance > Utility.RandomDouble() )
{
m.CheckSkill( SkillName.Meditation, 0.0, 100.0 );
m.SendLocalizedMessage( 501851 ); // You enter a meditative trance.
m.Meditating = true;
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.ActiveMeditation, 1075657 ) );
if ( m.Player || m.Body.IsHuman )
m.PlaySound( 0xF9 );
}
else
{
m.SendLocalizedMessage( 501850 ); // You cannot focus your concentration.
}
return TimeSpan.FromSeconds( 10.0 );
}
}