本文整理汇总了C#中Server.Mobile.Freeze方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.Freeze方法的具体用法?C# Mobile.Freeze怎么用?C# Mobile.Freeze使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.Freeze方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
return;
ClearCurrentAbility( attacker );
if( Server.Items.ParalyzingBlow.IsImmune( defender ) ) //After mana consumption intentional
{
attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
return;
}
attacker.SendLocalizedMessage( 1063356 ); // You cripple your target with a nerve strike!
defender.SendLocalizedMessage( 1063357 ); // Your attacker dealt a crippling nerve strike!
attacker.PlaySound( 0x204 );
defender.FixedEffect( 0x376A, 9, 32 );
defender.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist );
AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), 100, 0, 0, 0, 0 ); //10-25
defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
}
示例2: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
if ( !attacker.IsT2A && Layer == Layer.TwoHanded
&& (attacker.Skills[SkillName.Anatomy].Value / 100.0 * SpecialMovesController._SpearStunMaxChance) >= Utility.RandomDouble()
&& Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
{
defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!
defender.Freeze(TimeSpan.FromSeconds( SpecialMovesController._SpearStunDurationSeconds ));
attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
attacker.PlaySound( 0x11C );
}
if ( Poison != null && PoisonCharges > 0 && defender.Poison != Poison)
{
bool chargeConsume = false;
double chance =
(attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceSpears
+ (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus);
if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
{
chargeConsume = true;
--PoisonCharges;
defender.ApplyPoison( attacker, Poison );
}
if (!chargeConsume && 0.25 > Utility.RandomDouble())
--PoisonCharges;
}
}
示例3: OnHit
public override void OnHit( Mobile attacker, Mobile defender )
{
base.OnHit( attacker, defender );
if ( !Core.AOS && Layer == Layer.TwoHanded && attacker.Followers < 2 && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
{
defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
defender.Freeze( TimeSpan.FromSeconds( 3.5 ) );
attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
attacker.PlaySound( 0x11C );
}
}
示例4: OnGaveMeleeAttack
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
BaseCreature c = defender as BaseCreature;
if ( c != null && c.SummonMaster != null )
{
c.ControlTarget = c.SummonMaster;
c.ControlOrder = OrderType.Attack;
c.Combatant = c.SummonMaster;
this.Combatant = c.SummonMaster;
}
if ( defender.Player )
{
defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );
defender.SendMessage( "You feel completely numb!" );
}
}
示例5: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!Validate(attacker) || !CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender);
if (cantpara)
{
attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
defender.SendLocalizedMessage(1070813); // You resist paralysis.
}
else
{
attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
}
attacker.PlaySound(0x204);
defender.FixedEffect(0x376A, 9, 32);
defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);
if (Core.ML)
{
AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0); //0-25
if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
{
defender.Paralyze(TimeSpan.FromSeconds(2.0));
Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
}
}
else if (!cantpara)
{
AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0); //10-25
defender.Freeze(TimeSpan.FromSeconds(2.0));
Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
}
}
示例6: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
if ( !Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
{
defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
attacker.PlaySound( 0x11C );
}
if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
{
--PoisonCharges;
if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
defender.ApplyPoison( attacker, Poison );
}
}
示例7: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
if ((attacker.Skills[SkillName.Anatomy].Value / 1000.0) >= Utility.RandomDouble()) // 10% chance to paralyze at 100 anatomy.
{
defender.SendMessage( "You receive a paralyzing blow!" );
defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
attacker.SendMessage( "You deliver a paralyzing blow!" );
attacker.PlaySound( 0x11C );
}
if( Core.AOS && Poison != null && PoisonCharges > 0 )
{
--PoisonCharges;
if( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
defender.ApplyPoison( attacker, Poison );
}
}
示例8: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
return;
ClearCurrentAbility( attacker );
defender.Damage( (int) ( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.RandomMinMax( 1, 10 ) ), attacker );
double chance = (double) ( ( ( 4 * attacker.Skills[SkillName.Bushido].Value ) + 150 ) / 700 );
if ( chance < Utility.RandomDouble() )
{
attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
return;
}
if ( Server.Items.ParalyzingBlow.IsInmune( defender ) )
{
attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
return;
}
attacker.SendLocalizedMessage( 1063356 ); // You cripple your target with a nerve strike!
defender.SendLocalizedMessage( 1063357 ); // Your attacker dealt a crippling nerve strike!
attacker.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist );
defender.FixedEffect( 0x376A, 9, 32 );
defender.PlaySound( 0x204 );
defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
Server.Items.ParalyzingBlow.BeginInmunity( defender, TimeSpan.FromSeconds( 10.0 ) );
}
示例9: ShockAttack
public static void ShockAttack(BaseCreature from, Mobile target)
{
if (from.ShockAttack < 10 || from == null || target == null)
return;
int mindam = from.ShockAttack / 2;
int maxdam = from.ShockAttack;
from.Say("Shock Attack");
target.SendMessage("Your body is paralyzed from the electrical current!");
target.Freeze(TimeSpan.FromSeconds(3));
AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
}
示例10: DoSpecialAttack
//
// carry out the special attacks
//
// If you add a new attack, you must add the code here to define what it actually does when it hits
//
public void DoSpecialAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialAttack special)
{
if(attacker == null || defender == null || weapon == null || special == null) return;
attacker.SendMessage("you strike with {0}!", special.Name);
// apply the special attack
switch(special.AttackID)
{
case SpecialAttacks.TripleSlash:
{
defender.Damage( weapon.MaxDamage*3, attacker );
break;
}
case SpecialAttacks.MindDrain:
{
defender.Mana -= weapon.MaxDamage;
break;
}
case SpecialAttacks.VortexStrike:
{
attacker.PlaySound( 0x217 );
BaseCreature m = new EnergyVortex();
m.Summoned = true;
m.SummonMaster = attacker;
m.Combatant = defender;
m.MoveToWorld(defender.Location, defender.Map);
break;
}
case SpecialAttacks.StamDrain:
{
defender.Stam -= weapon.MaxDamage;
break;
}
case SpecialAttacks.PuffOfSmoke:
{
attacker.Hidden = true;
break;
}
case SpecialAttacks.GiftOfHealth:
{
attacker.FixedEffect( 0x376A, 9, 32 );
attacker.PlaySound( 0x202 );
attacker.Hits = attacker.HitsMax;
break;
}
case SpecialAttacks.ParalyzingFear:
{
// lose target focus
defender.Combatant = null;
// flee
if(defender is BaseCreature)
{
((BaseCreature)defender).BeginFlee(TimeSpan.FromSeconds(6));
}
// and become paralyzed
defender.Freeze( TimeSpan.FromSeconds(3) );
defender.FixedEffect( 0x376A, 9, 32 );
defender.PlaySound( 0x204 );
break;
}
default:
attacker.SendMessage("no effect");
break;
}
}
示例11: Decapitate
public static void Decapitate(Mobile from, Mobile target, Func<Mobile, Item> createHead = null)
{
if (from == null || target == null)
{
return;
}
Map map = target.Map;
target.Freeze(TimeSpan.FromSeconds(1.0));
int range = Utility.RandomMinMax(5, 7);
int zOffset = target.Mounted ? 20 : 10;
Point3D src = target.Location.Clone3D(0, 0, zOffset);
var points = src.GetAllPointsInRange(map, range, range);
Effects.PlaySound(target.Location, map, 0x19C);
target.Send(VNScreenLightFlash.Instance);
Timer.DelayCall(
TimeSpan.FromMilliseconds(100),
() =>
{
foreach (Point3D trg in points)
{
int bloodID = Utility.RandomMinMax(4650, 4655);
new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact(
info =>
{
new Blood(bloodID).MoveToWorld(info.Target.Location, info.Map);
Effects.PlaySound(info.Target, info.Map, 0x028);
});
}
});
target.Kill();
Timer.DelayCall(
TimeSpan.FromMilliseconds(100),
() =>
{
var corpse = target.Corpse as Corpse;
if (corpse != null && !corpse.Deleted)
{
corpse.TurnToBones();
}
});
var head = createHead != null ? createHead(target) : null;
int headID;
int headHue;
if (head != null)
{
headID = head.ItemID;
headHue = head.Hue;
}
else
{
headID = 7393;
headHue = target.SolidHueOverride >= 0 ? target.SolidHueOverride : target.Hue;
}
new MovingEffectInfo(src, src.Clone3D(0, 0, 40), map, headID, headHue).MovingImpact(
info =>
new MovingEffectInfo(
info.Target,
info.Source.Clone3D(Utility.RandomMinMax(-1, 1), Utility.RandomMinMax(-1, 1), 2),
info.Map,
headID,
headHue).MovingImpact(
hInfo =>
{
if (head != null && !head.Deleted)
{
head.MoveToWorld(hInfo.Target.Location, info.Map);
}
}));
}
示例12: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.1 > Utility.RandomDouble() )
{
defender.FixedParticles( 0x374A, 1, 17, 0x15B6, 0, 0, EffectLayer.Waist );
defender.PlaySound( 0x233 );
defender.Damage( 10, this );
switch ( Utility.Random( 3 ) )
{
case 0:
{
defender.SendLocalizedMessage( 1112391 ); // The creature's tail smashes into you!
break;
}
case 1:
{
defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );
defender.SendLocalizedMessage( 1112554 ); // You're stunned as the creature's tail knocks the wind out of you.
break;
}
case 2:
{
defender.SendLocalizedMessage( 1112555 ); // You're left confused as the creature's tail catches you right in the face!
defender.PublicOverheadMessage( MessageType.Regular, 946, 502039 ); // *looks confused*
defender.AddStatMod( new StatMod( StatType.Dex, "Boura Dex Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );
defender.AddStatMod( new StatMod( StatType.Int, "Boura Int Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );
defender.FixedParticles( 0x37B9, 1, 10, 0x232A, 5, 0, EffectLayer.Head );
defender.PlaySound( 0xF9 );
break;
}
}
}
}
示例13: DoComboAttack
//
// carry out the combo attacks
//
// If you add a new combo, you must add the code here to define what it actually does when it is activated
//
public void DoComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboAttack combo)
{
if(attacker == null || defender == null || weapon == null || combo == null) return;
attacker.SendMessage("You unleash the combo attack {0}!",combo.Name);
// apply the combo attack
switch(combo.AttackID)
{
case ComboAttacks.ThunderStrike:
{
defender.FixedEffect( 0x376A, 9, 32 );
defender.PlaySound( 0x28 );
// 5x damage
defender.Damage( weapon.MaxDamage*5, attacker );
// mana and stam drain
defender.Mana -= weapon.MaxDamage*3;
defender.Stam -= weapon.MaxDamage*3;
// full self heal
attacker.FixedEffect( 0x376A, 9, 32 );
attacker.Hits = attacker.HitsMax;
break;
}
case ComboAttacks.LightningRain:
{
defender.Damage( weapon.MaxDamage*3, attacker );
defender.Mana -= weapon.MaxDamage*7;
defender.Stam -= weapon.MaxDamage*4;
break;
}
case ComboAttacks.SqueezingFist:
{
// 5 sec paralyze
defender.FixedEffect( 0x376A, 9, 32 );
defender.PlaySound( 0x204 );
defender.Freeze( TimeSpan.FromSeconds(5) );
// 7x stam drain
defender.Stam -= weapon.MaxDamage*7;
break;
}
}
}
示例14: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if ( m != null && m is PlayerMobile && m.AccessLevel == AccessLevel.Player || m != null && m is BaseCreature && ((BaseCreature)m).Controlled )
{
if ( m != null && m.Map == this.Map && m.Alive )
{
m.Freeze( m_ParaTime );
m.SendMessage( "You become entangled in a ball of yarn!" );
}
}
return base.OnMoveOver( m );
}
示例15: OnGotMeleeAttack
public override void OnGotMeleeAttack(Mobile attacker) //taken from ElementalChamp.cs
{
base.OnGotMeleeAttack(attacker);
if (0.25 >= Utility.RandomDouble())
DrainStam();
if (Utility.Random(4) < 1)
{
Map map = this.Map;
if (map != null)
{
for (int i = 0; i < 10; ++i)
{
int x = X + (Utility.RandomMinMax(-15, 15));
int y = Y + (Utility.RandomMinMax(-15, 15));
int z = Z;
if (!map.CanFit(x, y, z, 16, false, false))
continue;
Point3D from = attacker.Location;
Point3D to = new Point3D(x, y, z);
if (!InLOS(to))
continue;
attacker.Location = to;
attacker.ProcessDelta();
attacker.Combatant = null;
attacker.Freeze(TimeSpan.FromSeconds(10.0));
Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
Effects.PlaySound(to, map, 0x1FE);
}
}
}
}