本文整理汇总了C#中Mobile.AddStatMod方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.AddStatMod方法的具体用法?C# Mobile.AddStatMod怎么用?C# Mobile.AddStatMod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.AddStatMod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyAgeStatMod
private static TimeSpan AutoRenewDelay = TimeSpan.FromDays( 15 ); // How many Earth Days are equivalent to One Year for characters?
#endregion Fields
#region Methods
public static void ApplyAgeStatMod( Mobile from )
{
try
{
double age = double.Parse( ((Account)from.Account).GetTag( "Age of " + (from.RawName) ) );
double strBonus, dexBonus, intBonus;
if ( age < topStrAge )
strBonus = age / topStrAge * maxBonus;
else
strBonus = (topStrAge / age * maxBonus) + (topStrAge / age * maxBonus - maxBonus);
if ( age < topDexAge )
dexBonus = age / topDexAge * maxBonus;
else
dexBonus = (topDexAge / age * maxBonus) + (topDexAge / age * maxBonus - maxBonus);
if ( age < topIntAge )
intBonus = age / topIntAge * maxBonus ;
else
intBonus = (topIntAge / age * maxBonus) + (topIntAge / age * maxBonus - maxBonus);
from.AddStatMod( new StatMod( StatType.Str, "AgeModStr", (int)strBonus, TimeSpan.Zero ) );
from.AddStatMod( new StatMod( StatType.Dex, "AgeModDex", (int)dexBonus, TimeSpan.Zero ) );
from.AddStatMod( new StatMod( StatType.Int, "AgeModInt", (int)intBonus, TimeSpan.Zero ) );
}
catch
{
from.SendMessage( 33, "Your age is not defined as a number! Report it to a staff member urgently!" );
}
}
示例2: OnEquip
public override bool OnEquip( Mobile m )
{
string modName = this.Serial.ToString();
m.AddStatMod( new StatMod( StatType.Int, modName + "Int", (int)(.5 * m.ManaMax ), TimeSpan.Zero ) );
m.SendMessage( "You feel smarter now!" );
return base.OnEquip( m );
}
示例3: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.Neck ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Helm ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );
List<AttributeMod> mods = new List<AttributeMod>();
mods.Add( new AttributeMod( MagicalAttribute.ReflectPhysical, 25 ) );
mods.Add( new AttributeMod( MagicalAttribute.Luck, 100 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
m.AddStatMod( new StatMod( StatType.Str, "DarkwoodSetStr", 10, TimeSpan.Zero ) );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例4: SetMods
private void SetMods( Mobile wearer )
{
wearer.AddSkillMod( m_SkillMod0 );
wearer.AddSkillMod( m_SkillMod1 );
wearer.AddSkillMod( m_SkillMod2 );
wearer.AddStatMod( m_StatMod0 );
}
示例5: ApplyBonus
public static void ApplyBonus( Mobile m )
{
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
List<object> mods = new List<object>();
mods.Add( new AttributeMod( MagicalAttribute.BonusInt, 6 ) );
mods.Add( new AttributeMod( MagicalAttribute.RegenMana, 2 ) );
mods.Add( new AttributeMod( MagicalAttribute.DefendChance, 10 ) );
mods.Add( new AttributeMod( MagicalAttribute.LowerManaCost, 5 ) );
mods.Add( new AttributeMod( MagicalAttribute.LowerRegCost, 40 ) );
mods.Add( new ResistanceMod( ResistanceType.Physical, 28 ) );
mods.Add( new ResistanceMod( ResistanceType.Fire, 28 ) );
mods.Add( new ResistanceMod( ResistanceType.Cold, 28 ) );
mods.Add( new ResistanceMod( ResistanceType.Poison, 28 ) );
mods.Add( new ResistanceMod( ResistanceType.Energy, 28 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
m.AddStatMod( new StatMod( StatType.Int, "SorcerersSetInt", 6, TimeSpan.Zero ) );
m.FindItemOnLayer( Layer.InnerTorso ).InvalidateProperties();
m.FindItemOnLayer( Layer.Pants ).InvalidateProperties();
m.FindItemOnLayer( Layer.Arms ).InvalidateProperties();
m.FindItemOnLayer( Layer.Gloves ).InvalidateProperties();
m.FindItemOnLayer( Layer.Helm ).InvalidateProperties();
m.FindItemOnLayer( Layer.Neck ).InvalidateProperties();
}
示例6: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (Parent != from)
{
from.SendMessage("The Sword must be eqquiped to use.");
}
else if (from.Title != "Merlin's Apprentance")
{
from.Title = "Merlin's Apprentance";
from.BoltEffect(0);
from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
m_StatMod0 = new StatMod(StatType.Str, "MOD0", 10, TimeSpan.Zero);
m_StatMod1 = new StatMod(StatType.Int, "MOD1", 10, TimeSpan.Zero);
from.AddStatMod(m_StatMod0);
from.AddStatMod(m_StatMod1);
this.WeaponAttributes.HitLeechHits = 65;
this.WeaponAttributes.HitLeechMana = 45;
this.Attributes.WeaponSpeed = 30;
}
else
{
from.BoltEffect(0);
from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
from.Title = null;
from.RemoveStatMod("MOD0");
from.RemoveStatMod("MOD1");
this.WeaponAttributes.HitLeechHits = 25;
this.WeaponAttributes.HitLeechMana = 25;
this.Attributes.WeaponSpeed = 15;
}
}
示例7: Eat
}// fruit bowl
public override bool Eat(Mobile from)
{
if (FillHunger(from, this.FillFactor))
{
string modName = this.Serial.ToString();
from.AddStatMod(new StatMod(StatType.Str, modName + "Str", (int)(from.RawStr * 0.08), TimeSpan.FromSeconds(75)));
from.PlaySound(0x1EA);
from.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
this.Consume();
return true;
}
return false;
}
示例8: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );
// +10 dex (total)
m.AddStatMod( new StatMod( StatType.Dex, "AssassinSetDex", 12, TimeSpan.Zero ) );
// +30 stealth (total)
SkillMod skillmod = new DefaultSkillMod( SkillName.Stealth, true, 30.0 );
skillmod.ObeyCap = true;
m_Table.Add( m, skillmod );
m.AddSkillMod( skillmod );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例9: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon );
ApplyBonus( m.FindItemOnLayer( Layer.TwoHanded ) as BaseShield );
List<AttributeMod> mods = new List<AttributeMod>();
mods.Add( new AttributeMod( MagicalAttribute.WeaponSpeed, 35 ) );
mods.Add( new AttributeMod( MagicalAttribute.DefendChance, 10 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
// +10 str (total)
m.AddStatMod( new StatMod( StatType.Str, "JuggernautSetStr", 10, TimeSpan.Zero ) );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例10: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.Cloak ) as Feathernock );
ApplyBonus( m.FindItemOnLayer( Layer.TwoHanded ) as Swiftflight );
List<AttributeMod> mods = new List<AttributeMod>();
mods.Add( new AttributeMod( MagicalAttribute.WeaponSpeed, 30 ) );
mods.Add( new AttributeMod( MagicalAttribute.AttackChance, 15 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
// +8 dex (total)
m.AddStatMod( new StatMod( StatType.Dex, "MarksmanSetStr", 8, TimeSpan.Zero ) );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例11: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );
List<AttributeMod> mods = new List<AttributeMod>();
mods.Add( new AttributeMod( MagicalAttribute.SpellDamage, 15 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
// +10 int (total)
m.AddStatMod( new StatMod( StatType.Int, "LeafweaveSetInt", 10, TimeSpan.Zero ) );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例12: OnTarget
public override void OnTarget( Mobile target )
{
if ( CheckHSequence( target ) )
{
if ( target.GetStatMod( "MindBlast" ) == null )
{
int offset = (int)(target.Skills[SkillName.Magery].Value / 2);
offset += (int)(target.Skills[SkillName.Necromancy].Value / 2);
offset += (int)(target.Skills[SkillName.EvalInt].Value / 4);
offset += (int)(target.Skills[SkillName.SpiritSpeak].Value / 4);
if ( target is PlayerMobile )
offset /= 2;
offset -= ((int)ScaleBySkill( target, SkillName.MagicResist )) -5;
if ( offset < 15 )
offset = 15;
int duration = (int)(Caster.Skills[CastSkill].Value * 2);
target.AddStatMod( new StatMod( StatType.Int, "MindBlast", -offset, TimeSpan.FromSeconds( duration ) ) );
target.AddSkillMod( new TimedSkillMod( SkillName.Meditation, true, -offset, TimeSpan.FromSeconds( duration ) ) );
target.AddSkillMod( new TimedSkillMod( SkillName.Focus, true, -offset, TimeSpan.FromSeconds( duration ) ) );
target.SendMessage("Your mind has been blown!");
SpellHelper.Damage( this, target, offset * 2, 0, 0, 100, 0, 0 );
}
target.FixedParticles( 0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head );
target.PlaySound( 0x213 );
BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
}
FinishSequence();
}
示例13: SetMods
private void SetMods( Mobile m )
{
m.AddStatMod( m_StatMod0 );
}
示例14: AddStatBonuses
public virtual void AddStatBonuses( Mobile parent )
{
if ( parent == null )
return;
int strBonus = ComputeStatBonus( StatType.Str );
int dexBonus = ComputeStatBonus( StatType.Dex );
int intBonus = ComputeStatBonus( StatType.Int );
if ( strBonus == 0 && dexBonus == 0 && intBonus == 0 )
return;
string modName = this.Serial.ToString();
if ( strBonus != 0 )
parent.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );
if ( dexBonus != 0 )
parent.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );
if ( intBonus != 0 )
parent.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
}
示例15: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
}
else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
{
from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.
}
else
{
from.PlaySound(0x1EE);
from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));
this.Consume();
}
}