本文整理汇总了C#中Server.Mobile.GetStatMod方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.GetStatMod方法的具体用法?C# Mobile.GetStatMod怎么用?C# Mobile.GetStatMod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.GetStatMod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public override bool Use( Mobile from ) {
if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
int amount = Utility.Dice( 3, 3, 3 );
int time = Utility.RandomMinMax( 5, 30 );
from.PlaySound( 0x2D6 );
if ( from.Body.IsHuman ) {
from.Animate( 34, 5, 1, true, false, 0 );
}
from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
from.PlaySound( 0x1EB );
StatMod mod = from.GetStatMod( "Concussion" );
if ( mod != null ) {
from.RemoveStatMod( "Concussion" );
from.Mana -= mod.Offset;
}
from.PlaySound( 0x1EE );
from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );
Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
from.EndAction( typeof( ClarityPotion ) );
} );
return true;
}
return false;
}
示例2: Eat
public override bool Eat( Mobile from )
{
if ( base.Eat( from ) )
{
from.PlaySound( 0xF6 );
from.PlaySound( 0x1F7 );
from.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );
IEntity mfrom = new Entity( Serial.Zero, new Point3D( from.X, from.Y, from.Z - 10 ), from.Map );
IEntity mto = new Entity( Serial.Zero, new Point3D( from.X, from.Y, from.Z + 50 ), from.Map );
Effects.SendMovingParticles( mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
StatMod mod;
mod = from.GetStatMod( "[Magic] Str Offset" );
if ( mod != null && mod.Offset < 0 )
from.RemoveStatMod( "[Magic] Str Offset" );
mod = from.GetStatMod( "[Magic] Dex Offset" );
if ( mod != null && mod.Offset < 0 )
from.RemoveStatMod( "[Magic] Dex Offset" );
mod = from.GetStatMod( "[Magic] Int Offset" );
if ( mod != null && mod.Offset < 0 )
from.RemoveStatMod( "[Magic] Int Offset" );
from.Paralyzed = false;
from.Sleep = false; // SA Mysticism Edit
EvilOmenSpell.TryEndEffect( from );
StrangleSpell.RemoveCurse( from );
CorpseSkinSpell.RemoveCurse( from );
CurseSpell.RemoveEffect( from );
BuffInfo.RemoveBuff( from, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( from, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( from, BuffIcon.Weaken );
BuffInfo.RemoveBuff( from, BuffIcon.MassCurse );
return true;
}
return false;
}
示例3: GetCursePower
public static int GetCursePower( Mobile m )
{
int power = 0;
// 1st circle debuffs
foreach ( string statModName in StatModNames )
{
if ( m.GetStatMod( statModName ) != null )
power += 1;
}
// 3rd circle debuffs
if ( EvilOmenSpell.UnderEffect( m ) )
power += 3;
if ( BloodOathSpell.UnderEffect( m ) )
power += 3;
if ( CorpseSkinSpell.UnderEffect( m ) )
power += 3;
if ( MindRotSpell.HasMindRotScalar( m ) )
power += 3;
if ( SleepSpell.IsSlept( m ) )
power += 3;
// 4th circle debuffs
if ( CurseSpell.UnderEffect( m ) )
power += 4;
// 6th circle debuffs
if ( StrangleSpell.UnderEffect( m ) )
power += 6;
// 7th circle debuffs
if ( SpellPlagueSpell.UnderEffect( m ) )
power += 7;
if ( MortalStrike.IsWounded( m ) )
power += 7;
return power;
}
示例4: AddStatBonus
public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
{
int offset = bonus;
string name = String.Format( "[Magic] {0} Offset", type );
StatMod mod = target.GetStatMod( name );
if ( mod != null && mod.Offset < 0 )
{
target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
return true;
}
else if ( mod == null || mod.Offset < offset )
{
target.AddStatMod( new StatMod( type, name, offset, duration ) );
return true;
}
return false;
}
示例5: Use
public override bool Use( Mobile from ) {
if ( from.GetStatMod( "blood-rose" ) == null ) {
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted ) {
from.Animate( 34, 5, 1, true, false, 0 );
}
int amount = Utility.Dice( 3, 3, 3 );
int time = Utility.RandomMinMax( 5, 30 );
from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
from.PlaySound( 0x1EE );
from.AddStatMod( new StatMod( StatType.All, "blood-rose", amount, TimeSpan.FromMinutes( time ) ) );
return true;
} else {
from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.
return false;
}
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !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 ) ) );
Consume();
}
}
示例7: GetRandomBuff
public BuffType GetRandomBuff(Mobile target)
{
List<BuffType> buffs = new List<BuffType>();
if (MagicReflectSpell.HasReflect(target))
buffs.Add(BuffType.MagicReflect);
if (ReactiveArmorSpell.HasArmor(target))
buffs.Add(BuffType.ReactiveArmor);
if (ProtectionSpell.HasProtection(target))
buffs.Add(BuffType.Protection);
TransformContext context = TransformationSpellHelper.GetContext(target);
if (context != null && context.Type != typeof(AnimalForm))
buffs.Add(BuffType.Transformation);
StatMod mod = target.GetStatMod("[Magic] Str Offset");
if (mod != null && mod.Offset > 0)
buffs.Add(BuffType.StrBonus);
mod = target.GetStatMod("[Magic] Dex Offset");
if (mod != null && mod.Offset > 0)
buffs.Add(BuffType.DexBonus);
mod = target.GetStatMod("[Magic] Int Offset");
if (mod != null && mod.Offset > 0)
buffs.Add(BuffType.IntBonus);
if (buffs.Count == 0)
return BuffType.None;
BuffType type = buffs[Utility.Random(buffs.Count)];
buffs.Clear();
return type;
}
示例8: Target
public void Target( BaseTalisman talis, Mobile owner, Mobile m )
{
if ( this.Parent == owner )
{
//Curse Removal
if ( talis.m_TalismanType == TalismanType.CurseRemoval )
{
m.PlaySound( 0xF6 );
m.PlaySound( 0x1F7 );
m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );
StatMod mod;
mod = m.GetStatMod( "[Magic] Str Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Str Malus" );
mod = m.GetStatMod( "[Magic] Dex Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Dex Malus" );
mod = m.GetStatMod( "[Magic] Int Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Int Malus" );
m.Paralyzed = false;
EvilOmenSpell.CheckEffect( m );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( m );
BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
BuffInfo.RemoveBuff( m, BuffIcon.Curse );
BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
if ( owner != m )
owner.SendLocalizedMessage( 1072409 ); // Your targets curses have been lifted
m.SendLocalizedMessage( 1072408 ); // Any curses on you have been lifted
}
//Damage Removal
if ( talis.m_TalismanType == TalismanType.DamageRemoval )
{
Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
Effects.PlaySound( m, m.Map, 0x201 );
BleedAttack.EndBleed( m, false );
MortalStrike.EndWound( m );
m.CurePoison( m );
BuffInfo.RemoveBuff( m, BuffIcon.Bleed );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
if ( owner != m )
owner.SendLocalizedMessage( 1072406 ); // Your Targets lasting damage effects have been removed!
m.SendLocalizedMessage( 1072405 ); // Your lasting damage effects have been removed!
}
//Ward Removal
if ( talis.m_TalismanType == TalismanType.WardRemoval )
{
Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
Effects.PlaySound( m, m.Map, 0x201 );
ProtectionSpell.RemoveWard( m );
ReactiveArmorSpell.RemoveWard( m );
MagicReflectSpell.RemoveWard( m );
TransformationSpell.RemoveContext( m, true );
ReaperFormSpell.RemoveEffects( m );
if ( StoneFormSpell.UnderEffect( m ) )
StoneFormSpell.RemoveEffects( m );
if ( owner != m )
owner.SendLocalizedMessage( 1072403 ); // Your target's wards have been removed!
m.SendLocalizedMessage( 1072402 ); // Your wards have been removed!
}
//Wildfire Removal
if ( talis.m_TalismanType == TalismanType.WildfireRemoval )
owner.SendLocalizedMessage( 1042753, "Wildfire Removal" ); // ~1_SOMETHING~ has been temporarily disabled.
//CARGE TIMER
ChargeTimeLeft = 1200;
m_ChargeTimer = new ChargeTimeLeftTimer( this );
m_ChargeTimer.Start();
m_ChargeTimeLeft3 = DateTime.Now;
}
else if ( m_TalismanType != 0 )
m.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
}
示例9: StompAttack
public void StompAttack( Mobile target )
{
if ( target.GetStatMod( "StompAttack" ) == null )
{
StatType type;
switch( Utility.Random(3) )
{
default:
case 0: type = StatType.Str; break;
case 1: type = StatType.Dex; break;
case 2: type = StatType.Int; break;
}
target.AddStatMod( new StatMod( type, "StompAttack", -( 10 + Utility.Random( 10 ) ), TimeSpan.FromSeconds( 60 + Utility.Random( 60 ) ) ) );
}
}
示例10: DoPrayerEffect
public bool DoPrayerEffect(PlayerMobile from, Mobile target)
{
if (target == null || target.Deleted || !target.Alive || target.IsDeadBondedPet)
return false;
if (from == null || from.Deleted)
return false;
if (!String.IsNullOrEmpty(m_Message))
target.SendMessage(m_Message);
target.SendSound(SoundID);
int offset = m_Intensity + PowerBonus(from);
switch (m_Effect)
{
case PrayerEffect.Strength:
{
#region Strength
string name = String.Format("[Prayer] {0} Offset", m_Effect);
StatMod mod = target.GetStatMod(name);
//one is negative and the other is positive, so adding up
if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
{
target.RemoveStatMod(name);
target.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//nothing to replace, just adding
else if (mod == null)
{
target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//replacing the current mod with a larger one
else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
{
target.RemoveStatMod(name);
target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
return false;
#endregion
}
case PrayerEffect.Dexterity:
{
#region Dexterity
string name = String.Format("[Prayer] {0} Offset", m_Effect);
StatMod mod = target.GetStatMod(name);
//one is negative and the other is positive, so adding up
if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
{
target.RemoveStatMod(name);
target.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//nothing to replace, just adding
else if (mod == null)
{
target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//replacing the current mod with a larger one
else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
{
target.RemoveStatMod(name);
target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
return false;
#endregion
}
case PrayerEffect.Intelligence:
{
#region Intelligence
string name = String.Format("[Prayer] {0} Offset", m_Effect);
StatMod mod = target.GetStatMod(name);
//one is negative and the other is positive, so adding up
if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
{
target.RemoveStatMod(name);
target.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//nothing to replace, just adding
else if (mod == null)
{
target.AddStatMod(new StatMod(StatType.Int, name, offset, TimeSpan.FromSeconds(m_Duration)));
return true;
}
//replacing the current mod with a larger one
else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
{
//.........这里部分代码省略.........
示例11: WipeMods
public static void WipeMods(Mobile m)
{
PlayerMobile pm = m as PlayerMobile;
m.DisruptiveAction();
foreach (StatType Stat in Enum.GetValues(typeof(StatType)))
{
string name = String.Format("[Magic] {0} Offset", Stat);
if (m.GetStatMod(name) != null)
m.RemoveStatMod(name);
}
if (TransformationSpellHelper.UnderTransformation(m))
TransformationSpellHelper.RemoveContext(m, true);
m.HueMod = -1;
m.NameMod = null;
PolymorphSpell.StopTimer(m);
IncognitoSpell.StopTimer(m);
DisguiseGump.StopTimer(m);
foreach (Type T in DispelActions)
m.EndAction(T);
m.BodyMod = 0;
m.HueMod = -1;
if (pm != null)
{
if (pm.BuffTable != null)
{
List<BuffInfo> list = new List<BuffInfo>();
foreach (BuffInfo buff in pm.BuffTable.Values)
{
if (!buff.RetainThroughDeath)
{
list.Add(buff);
}
}
for (int i = 0; i < list.Count; i++)
{
pm.RemoveBuff(list[i]);
}
}
pm.SavagePaintExpiration = TimeSpan.Zero;
pm.SetHairMods(-1, -1);
pm.ResendBuffs();
}
m.VirtualArmorMod = 0;
BaseArmor.ValidateMobile(m);
BaseClothing.ValidateMobile(m);
}
示例12: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.2 > Utility.RandomDouble() )
{
if ( defender.GetStatMod( "Niporailem Str Curse" ) == null )
defender.AddStatMod( new StatMod( StatType.Str, "Niporailem Str Curse", -30, TimeSpan.FromSeconds( 15.0 ) ) );
}
}
示例13: HasStatEffect
public static bool HasStatEffect( Mobile target, StatType type )
{
if ( type == StatType.All )
{
return HasStatEffect( target, StatType.Dex ) && HasStatEffect( target, StatType.Int ) && HasStatEffect( target, StatType.Str ) ;
}
else
{
StatMod mod = target.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );
return mod != null;
}
}
示例14: RemoveCurses
public static void RemoveCurses( Mobile m )
{
// play the sound
m.PlaySound( 0xF6 );
m.PlaySound( 0x1F7 );
// do the effects
m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );
IEntity from = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), m.Map );
IEntity to = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), m.Map );
Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
// remove stat mods
StatMod mod;
foreach ( string statModName in StatModNames )
{
mod = m.GetStatMod( statModName );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( statModName );
}
m.Paralyzed = false;
EvilOmenSpell.CheckEffect( m );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( m );
MortalStrike.EndWound( m );
BloodOathSpell.EndEffect( m );
SpellPlagueSpell.RemoveEffect( m );
SleepSpell.RemoveEffect( m );
MindRotSpell.ClearMindRotScalar( m );
BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
BuffInfo.RemoveBuff( m, BuffIcon.Curse );
BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
BuffInfo.RemoveBuff( m, BuffIcon.Sleep );
BuffInfo.RemoveBuff( m, BuffIcon.MassSleep );
BuffInfo.RemoveBuff( m, BuffIcon.Mindrot );
}
示例15: Refresh
/// <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>
private void Refresh(Mobile targ)
{
try
{
targ.Mana = targ.ManaMax;
targ.Hits = targ.HitsMax;
targ.Stam = targ.StamMax;
targ.Poison = null;
targ.Say("*Refreshed!*");
targ.Say("*Debuffed!*");
Server.Targeting.Target.Cancel(targ);
if (targ.MeleeDamageAbsorb > 0)
{
targ.MeleeDamageAbsorb = 0;
//targ.EndAction(typeof(RechargeSpell));
//ReactiveArmorSpell.EndArmor(targ);
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 : " + e.InnerException);
}
}