本文整理汇总了C#中Server.Mobile.AddSkillMod方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.AddSkillMod方法的具体用法?C# Mobile.AddSkillMod怎么用?C# Mobile.AddSkillMod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.AddSkillMod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEquip
public override bool OnEquip( Mobile m )
{
base.OnEquip( m );
m_SkillMod1 = new DefaultSkillMod( SkillName.Archery, true, 10 );
m.AddSkillMod(m_SkillMod1 );
m_SkillMod2 = new DefaultSkillMod( SkillName.Tactics, true, 10 );
m.AddSkillMod(m_SkillMod2 );
m_SkillMod3 = new DefaultSkillMod( SkillName.Anatomy, true, 10 );
m.AddSkillMod(m_SkillMod3 );
return true;
/// <summary>
/// i with to make a gm clothing packet for my gm's ingame
/// </summary>
if ( m.AccessLevel <= AccessLevel.GameMaster )
{
m.SendMessage( "You are not granted to wear this item" );
this.Delete();
return false;
}
else
{
m.SendMessage( "Access Granted mighty one" );
return true;
}
}
示例2: SetMods
private void SetMods( Mobile wearer )
{
wearer.AddSkillMod( m_SkillMod0 );
wearer.AddSkillMod( m_SkillMod1 );
wearer.AddSkillMod( m_SkillMod2 );
wearer.AddStatMod( m_StatMod0 );
}
示例3: AddMods
public void AddMods( Mobile from )
{
if ( m_SkillMod0 == null )
m_SkillMod0 = new DefaultSkillMod( SkillName.EvalInt, true, 100 );
if ( m_SkillMod1 == null )
m_SkillMod1 = new DefaultSkillMod( SkillName.Tactics, true, 100 );
from.AddSkillMod( m_SkillMod0 );
from.AddSkillMod( m_SkillMod1 );
}
示例4: OnEquip
public override bool OnEquip( Mobile m )
{
base.OnEquip( m );
m_SkillMod = new DefaultSkillMod( SkillName.Fishing, true, 60 );
m.AddSkillMod(m_SkillMod );
return true;
}
示例5: DarkFireCombo
// Karmic Strike
// The attack is automatically a critical threat, but then next strike on you
// for 3 seconds will also be a critical. Unknown if Fortification applies.
public static void DarkFireCombo( Mobile from, Mobile target, ref int damage )
{
from.SendMessage( 2075, "You execute the maneuver: Karmic Strike" );
damage = (int)(damage * 1.5 );
object[] objs =
{
AosWeaponAttribute.ResistPhysicalBonus, -100,
AosWeaponAttribute.ResistFireBonus, -100,
AosWeaponAttribute.ResistColdBonus, -100,
AosWeaponAttribute.ResistPoisonBonus, -100,
AosWeaponAttribute.ResistEnergyBonus, -100
};
new EnhancementTimer( from, 5, "monk", objs ).Start();
from.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -100, TimeSpan.FromSeconds( 5 ) ) );
target.SendMessage( 2075, "Your opponent's blow hits a vital area maximizing their damage but leaves them wide open." );
target.PlaySound( 0x234 );
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile mob )
{
SkillGainContext context = (SkillGainContext)m_SkillGain[mob];
if ( context != null )
return;
context = new SkillGainContext();
m_SkillGain[mob] = context;
ArrayList mods = context.m_Mods = new ArrayList();
for ( int i = 0; i < mob.Skills.Length; ++i )
{
Skill sk = mob.Skills[i];
double baseValue = sk.Base;
if ( mob.InRange( this.GetWorldLocation(), 2 ) )
{
Container pack = mob.Backpack;
int m_Amount = mob.Backpack.GetAmount( typeof( BabyPowder ) );
if ( pack != null && pack.ConsumeTotal( typeof( BabyPowder ), m_Amount) )
{
if( m_Amount != 1 )
{
mob.AddToBackpack( new BabyPowder( m_Amount-1 ));
}
if ( baseValue > 0 )
{
SkillMod mod = new DefaultSkillMod( SkillName.Fencing, true, +(baseValue * SkillGainFactor) );
SkillMod mod1 = new DefaultSkillMod( SkillName.Parry, true, +(baseValue * SkillGainFactor) );
SkillMod mod2 = new DefaultSkillMod( SkillName.Swords, true, +(baseValue * SkillGainFactor) );
SkillMod mod3 = new DefaultSkillMod( SkillName.Archery, true, +(baseValue * SkillGainFactor) );
SkillMod mod4 = new DefaultSkillMod( SkillName.Macing, true, +(baseValue * SkillGainFactor) );
SkillMod mod5 = new DefaultSkillMod( SkillName.Tactics, true, +(baseValue * SkillGainFactor) );
SkillMod mod6 = new DefaultSkillMod( SkillName.Wrestling, true, +(baseValue * SkillGainFactor) );
mods.Add( mod );
mods.Add( mod1 );
mods.Add( mod2 );
mods.Add( mod3 );
mods.Add( mod4 );
mods.Add( mod5 );
mods.Add( mod6 );
mob.AddSkillMod( mod );
mob.AddSkillMod( mod1 );
mob.AddSkillMod( mod2 );
mob.AddSkillMod( mod3 );
mob.AddSkillMod( mod4 );
mob.AddSkillMod( mod5 );
mob.AddSkillMod( mod6 );
mob.SendMessage("You sprinkle some baby powder on your body and it makes your skin more resistant in combat.");
}
else
{
mob.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
}
}
}
}
context.m_Timer = Timer.DelayCall( SkillGainPeriod, new TimerStateCallback( ClearSkillGain_Callback ), mob );
}
示例7: OnTrigger
public override void OnTrigger(object activator, Mobile m)
{
if(m == null || (RequireIdentification && !m_Identified)) return;
if((AttachedTo is BaseArmor || AttachedTo is BaseWeapon) && (((Item)AttachedTo).Layer != Layer.Invalid))
{
// when activated via speech will apply mod when equipped by the speaker
SkillMod sm = new EquippedSkillMod( m_Skill, true, m_Value, (Item)AttachedTo, m );
m.AddSkillMod( sm );
// and then remove the attachment
Delete();
}
else
{
// when activated it will apply the skill mod that will last for the specified duration
SkillMod sm = new TimedSkillMod( m_Skill, true, m_Value, m_Duration );
m.AddSkillMod( sm );
// and then remove the attachment
Delete();
}
}
示例8: ApplySkillLoss
public static void ApplySkillLoss( Mobile mob )
{
SkillLossContext context = (SkillLossContext) m_SkillLoss[mob];
if ( context != null )
return;
context = new SkillLossContext();
m_SkillLoss[mob] = context;
ArrayList mods = context.m_Mods = new ArrayList();
for ( int i = 0; i < mob.Skills.Length; ++i )
{
Skill sk = mob.Skills[i];
double baseValue = sk.Base;
if ( baseValue > 0 )
{
SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -( baseValue * SkillLossFactor ) );
mods.Add( mod );
mob.AddSkillMod( mod );
}
}
context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob );
// Stat Loss / All of your skills have been reduced by one third.
mob.AddBuff( new BuffInfo( BuffIcon.FactionStatLoss, 1153800, 1153826, SkillLossPeriod, mob, true ) );
}
示例9: Discord
public void Discord(Mobile target)
{
if (Utility.RandomDouble() < 0.9)
{
target.AddSkillMod(new TimedSkillMod(SkillName.Fencing, true, Combatant.Skills.Fencing.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, Combatant.Skills.Wrestling.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, Combatant.Skills.Tactics.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, Combatant.Skills.Swords.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Macing, true, Combatant.Skills.Macing.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, Combatant.Skills.Focus.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Archery, true, Combatant.Skills.Archery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, Combatant.Skills.Magery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)DiscordDuration, new TimerStateCallback(Animate), target);
target.SendLocalizedMessage(1072061); // You hear jarring music, suppressing your strength.
target.PlaySound(0x58B);
}
else
{
target.SendLocalizedMessage(1072064); // You hear jarring music, but it fails to disrupt you.
target.PlaySound(0x58C);
}
m_NextDiscordTime = DateTime.Now + TimeSpan.FromSeconds(DiscordMinDelay + Utility.RandomDouble() * DiscordMaxDelay);
}
示例10: Discord
public void Discord(Mobile target)
{
if (Utility.RandomDouble() < 0.9)
{
target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, Combatant.Skills.Magery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Necromancy, true, Combatant.Skills.Necromancy.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, Combatant.Skills.Tactics.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, Combatant.Skills.Swords.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Meditation, true, Combatant.Skills.Meditation.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, Combatant.Skills.Focus.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Chivalry, true, Combatant.Skills.Chivalry.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, Combatant.Skills.Wrestling.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
target.AddSkillMod(new TimedSkillMod(SkillName.Spellweaving, true, Combatant.Skills.Spellweaving.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)DiscordDuration, new TimerStateCallback(Animate), target);
target.SendMessage("The Lich's touch weakens all of your fighting skills!");
target.PlaySound(0x458);////
}
else
{
target.SendMessage("The Lich barely misses touching you, saving you from harm!");
target.PlaySound(0x458);/////
}
m_NextDiscordTime = DateTime.Now + TimeSpan.FromSeconds(DiscordMinDelay + Utility.RandomDouble() * DiscordMaxDelay);
}
示例11: ApplySkillLoss
public static void ApplySkillLoss( Mobile mob )
{
SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];
if ( context != null )
return;
context = new SkillLossContext();
m_SkillLoss[mob] = context;
ArrayList mods = context.m_Mods = new ArrayList();
int ShortsLost = mob.ShortTermMurders/2;
double SkillLossFactor = Math.Min(ShortsLost*0.01,0.5); //1 percent per short. Max 50%.
TimeSpan SkillLossPeriod = TimeSpan.FromMinutes(10 + Math.Min(50, ShortsLost)); //10 to 60 minutes.
//mob.ShortTermMurders -= ShortsLost; //Lose half your shorts. Disable till title system set up.
for ( int i = 0; i < mob.Skills.Length; ++i )
{
Skill sk = mob.Skills[i];
double baseValue = sk.Base;
if ( baseValue > 0 )
{
SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * SkillLossFactor) );
mods.Add( mod );
mob.AddSkillMod( mod );
}
}
mob.SendMessage(String.Format("You have lost {0}% of your skill for {1} minutes for being a criminal.", (int)(SkillLossFactor*100), 10 + Math.Min(50, ShortsLost)));
context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob );
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsLockedDown )
{
if ( !from.InRange( this.Location, 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
IHouse house = HousingHelper.FindHouseAt( from );
if ( house != null )
{
from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071131 ); // Praying…
if ( m_CooldownList.Contains( from ) )
{
from.SendLocalizedMessage( 1071145 ); // In order to summon an undead again, you have to wait for at least 90 minutes.
}
else
{
Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback(
delegate
{
// Add the skill mod
SkillMod mod = new DefaultSkillMod( SkillName.SpiritSpeak, true, 5.0 );
mod.ObeyCap = true;
from.AddSkillMod( mod );
m_Table[from] = new BonusContext( Timer.DelayCall( Duration, new TimerStateCallback<Mobile>( RemoveEffect ), from ), mod );
// Set the cooldown
m_CooldownList.Add( from );
Timer.DelayCall( Cooldown, new TimerCallback( delegate { m_CooldownList.Remove( from ); } ) );
// Spawn our undead friend :)
SummonUndead( from );
from.SendLocalizedMessage( 1071148 ); // You feel a greater sense.
} ) );
}
}
else
from.SendLocalizedMessage( 502436 ); // That is not accessible.
}
else
from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
}
示例13: Apply
public virtual bool Apply(Mobile from)
{
if (TryAddBuff(from, Effect))
{
switch (Effect)
{
default:
case FishPieEffect.None: break;
case FishPieEffect.MedBoost:
TimedSkillMod mod1 = new TimedSkillMod(SkillName.Meditation, true, 10.0, Duration);
mod1.ObeyCap = true;
from.AddSkillMod(mod1);
break;
case FishPieEffect.FocusBoost:
TimedSkillMod mod2 = new TimedSkillMod(SkillName.Focus, true, 10.0, Duration);
mod2.ObeyCap = true;
from.AddSkillMod(mod2);
break;
case FishPieEffect.ColdSoak: break;
case FishPieEffect.EnergySoak: break;
case FishPieEffect.PoisonSoak: break;
case FishPieEffect.FireSoak: break;
case FishPieEffect.PhysicalSoak: break;
case FishPieEffect.WeaponDam: break;
case FishPieEffect.HitChance: break;
case FishPieEffect.DefChance: break;
case FishPieEffect.SpellDamage: break;
case FishPieEffect.ManaRegen: break;
case FishPieEffect.StamRegen: break;
case FishPieEffect.HitsRegen: break;
case FishPieEffect.SoulCharge: break;
case FishPieEffect.CastFocus: break;
}
if (Effect != FishPieEffect.None)
{
new InternalTimer(Duration, from, Effect);
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.FishPie, 1116340, LabelNumber));
}
return true;
}
else
from.SendLocalizedMessage(502173); // You are already under a similar effect.
return false;
}
示例14: AddTo
public void AddTo( Mobile m )
{
Remove();
for( int i = 0; i < 5; ++i )
{
SkillName skill;
double bonus;
if( !GetValues( i, out skill, out bonus ) )
continue;
if( m_Mods == null )
m_Mods = new List<SkillMod>();
SkillMod sk = new DefaultSkillMod( skill, true, bonus );
sk.ObeyCap = true;
m.AddSkillMod( sk );
m_Mods.Add( sk );
}
}
示例15: ApplySkillLoss
public static void ApplySkillLoss( Mobile mob )
{
PlayerMobile Killer = mob as PlayerMobile;
if ( mob.ShortTermMurders >= 5 && Killer.MurderBounty <= 0)
{
double loss = (100.0 - (19.0 + (mob.ShortTermMurders / 5.0))) / 100.0; // 20 to 30% loss
if( loss < 0.75 )
loss = 0.60;// changed to .80 from .95
else if( loss > 0.95 )
loss = 0.60; // changed to .80 from /95
TimeSpan lossperiod = TimeSpan.FromMinutes( 240.0 );
loss = 1.0 - loss;
ClearSkillLoss( mob );
SkillLossContext context = new SkillLossContext();
m_SkillLoss[mob] = context;
List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();
for ( int i = 0; i < mob.Skills.Length; ++i )
{
Skill sk = mob.Skills[i];
double baseValue = sk.Base;
if ( baseValue > 0 )
{
SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * loss) );
mods.Add( mod );
mob.AddSkillMod( mod );
}
}
mob.AddStatMod( new StatMod( StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod ) );
mob.AddStatMod( new StatMod( StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod ) );
mob.AddStatMod( new StatMod( StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod ) );
context.m_Timer = Timer.DelayCall<Mobile>( lossperiod, new TimerStateCallback<Mobile>( ClearSkillLoss_Callback ), mob );
}
else ///Removed short term statloss.
if ( mob.ShortTermMurders < 5 && Killer.MurderBounty > 0 )
{
double loss = (100.0 - (19.0 + (Killer.MurderBounty / 10000.0))) / 100.0; // 20 to 30% loss
if( loss < 0.75 )
loss = 0.60;// changed to .80 from .95
else if( loss > 0.95 )
loss = 0.60; // changed to .80 from /95
mob.SendMessage( "Current MurderBounty: " + Killer.MurderBounty);
double timeloss = (double)Killer.MurderBounty/33.3;
TimeSpan lossperiod = TimeSpan.FromMinutes( timeloss );
int m = (int)Math.Round( timeloss );
mob.SendMessage( "You have entered a bounty statloss for: " + m + " minutes.");
loss = 1.0 - loss;
ClearSkillLoss( mob );
SkillLossContext context = new SkillLossContext();
m_SkillLoss[mob] = context;
List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();
for ( int i = 0; i < mob.Skills.Length; ++i )
{
Skill sk = mob.Skills[i];
double baseValue = sk.Base;
if ( baseValue > 0 )
{
SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * loss) );
mods.Add( mod );
mob.AddSkillMod( mod );
}
}
mob.AddStatMod( new StatMod( StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod ) );
mob.AddStatMod( new StatMod( StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod ) );
mob.AddStatMod( new StatMod( StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod ) );
context.m_Timer = Timer.DelayCall<Mobile>( lossperiod, new TimerStateCallback<Mobile>( ClearSkillLoss_Callback ), mob );
}
else if ( mob.ShortTermMurders >= 5 && Killer.MurderBounty > 0 )
{
double loss = (100.0 - (19.0 + (mob.ShortTermMurders / 5.0))) / 100.0; // 20 to 30% loss
if( loss < 0.75 )
loss = 0.60;// changed to .80 from .95
else if( loss > 0.95 )
loss = 0.60; // changed to .80 from /95
mob.SendMessage( "Current MurderBounty: " + Killer.MurderBounty);
double timeloss = (double)Killer.MurderBounty/33.3;
TimeSpan lossperiod = TimeSpan.FromMinutes( timeloss + 240.0);
Killer.MurderBounty = 0;
//.........这里部分代码省略.........