本文整理汇总了C#中Server.Mobile.ApplyPoison方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.ApplyPoison方法的具体用法?C# Mobile.ApplyPoison怎么用?C# Mobile.ApplyPoison使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.ApplyPoison方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Eat
public override sealed bool Eat(Mobile from)
{
if (from == null || from.Deleted)
{
return false;
}
if (CheckHunger(from))
{
from.PlaySound(Utility.Random(0x3A, 3));
if (from.Body.IsHuman && !from.Mounted)
{
from.Animate(34, 5, 1, true, false, 0);
}
if (Poison != null)
{
from.ApplyPoison(Poisoner, Poison);
}
OnEaten(from);
Consume();
return true;
}
return false;
}
示例2: Eat
public override bool Eat( Mobile from )
{
if ( !CheckCooldown( from ) )
return false;
// The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
from.SendLocalizedMessage( 1074847 );
m_InfluenceList.Add( from );
m_CooldownTable.Add( from, DateTime.Now + Cooldown );
Timer.DelayCall( Duration, new TimerStateCallback( delegate { m_InfluenceList.Remove( from ); } ), from );
// Play a random "eat" sound
from.PlaySound( Utility.Random( 0x3A, 3 ) );
from.Animate( 6 );
if ( Poison != null )
from.ApplyPoison( Poisoner, Poison );
Consume();
return true;
}
示例3: 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;
}
}
示例4: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!Validate(attacker) || !CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
attacker.SendMessage("You poisoned your target.");
defender.SendMessage("You've been poisoned.");
int level;
if (Core.AOS)
{
if (attacker.InRange(defender, 2))
{
int total = (attacker.Skills.Poisoning.Fixed) / 2;
if (total >= 1000)
level = 3;
else if (total > 850)
level = 2;
else if (total > 650)
level = 1;
else
level = 0;
}
else
{
level = 0;
}
}
else
{
double total = attacker.Skills[SkillName.Poisoning].Value;
double dist = attacker.GetDistanceToSqrt(defender);
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
if (total >= 200.0 && 1 > Utility.Random(10))
level = 3;
else if (total > (Core.AOS ? 170.1 : 170.0))
level = 2;
else if (total > (Core.AOS ? 130.1 : 130.0))
level = 1;
else
level = 0;
}
defender.ApplyPoison(attacker, Poison.GetPoison(level));
defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
defender.PlaySound(0x474);
}
示例5: ExecuteTrap
public override void ExecuteTrap( Mobile from )
{
base.ExecuteTrap( from );
Effects.SendLocationEffect( new Point3D( this.Door.X, this.Door.Y, this.Door.Z ), this.Door.Map, 0x11A6, 16, 3 );
Effects.PlaySound( this.Door.Location, this.Door.Map, 0x231 );
from.ApplyPoison( this.Owner, Poison.Lethal );
try
{
foreach( Mobile m in this.Door.GetMobilesInRange( 2 ) )
{
if( from.Alive )
from.ApplyPoison( this.Owner, Poison.Deadly );
}
}
catch { }
}
示例6: OnHit
public override void OnHit( Mobile attacker, Mobile defender )
{
base.OnHit( attacker, defender );
if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
{
--PoisonCharges;
if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
defender.ApplyPoison( attacker, Poison );
}
}
示例7: OnMovement
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( m.InRange( Location, 1 ) )
{
if ( m.Alive )
{
m.PlaySound( 0x813 );
m.ApplyPoison( m, Poison.Deadly );
}
}
}
示例8: OnHit
public override void OnHit( Mobile attacker, Mobile defender )
{
base.OnHit( attacker, defender );
if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
{
--PoisonCharges;
if ( Utility.RandomDouble() < PoisonChance && !defender.Poisoned )
{
defender.ApplyPoison( attacker, Poison );
defender.SayTo( defender, true, "{0} has just poisoned you!", attacker.Name );
}
}
}
示例9: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
if ( Poison != null && PoisonCharges > 0 && ( !defender.Player || attacker.Followers < 5 ) )
{
double chance =
(attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceKnives
+ (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus)
- (attacker.Followers * SpecialMovesController._PoisonChancePenaltyPerFollower);
if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
{
defender.ApplyPoison( attacker, Poison );
--PoisonCharges;
}
}
}
示例10: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
//from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
from.SendMessage( "You decide against eating it while incognitoed " );
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
from.SendMessage( "You can not be polymorphed at this time" );
}
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
{
//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
from.SendMessage( "You decide against eating it while polymorphed" );
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask || from.FindItemOnLayer( Layer.Helm ) is OrcishKinRPMask )
{
//from.SendLocalizedMessage( 501605 ); // You are already disguised.
from.SendMessage( "You decide against eating it while as your disguised" );
}
else
{
from.BodyMod = ( from.Female ? 186 : 185 );
from.HueMod = 0;
if ( from is PlayerMobile )
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
//from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
from.SendMessage( "You now bear the markings of the undead pirates. This will last about a week" );
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
from.Animate( 34, 5, 1, true, false, 0 );
from.ApplyPoison( from, Poison.Lethal );
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例11: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
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._PoisonChanceSwords
+ (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus);
if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
{
chargeConsume = true;
defender.ApplyPoison( attacker, Poison );
--PoisonCharges;
}
if (!chargeConsume && 0.25 > Utility.RandomDouble())
--PoisonCharges;
}
}
示例12: 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 );
}
}
示例13: 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 );
}
}
示例14: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
from.SendMessage( "You decide against eating it while in incognito." );
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
from.SendMessage( "You can not be polymorphed at this time." );
//else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) )
// from.SendMessage( "You decide against eating it while polymorphed." );
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
from.SendMessage( "You decide against eating it while in your disguise." );
else
{
if ( from is PlayerMobile )
{
PlayerMobile pm = from as PlayerMobile;
if ( pm.SavagePaintExpiration > TimeSpan.Zero )
from.SendMessage( "You already have the markings of another tribe." );
else
{
from.BodyMod = ( from.Female ? 186 : 185 );
from.HueMod = 0;
pm.SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
//from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
from.SendMessage( "You now bear the markings of the undead pirates. This will last about a week." );
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
from.Animate( 34, 5, 1, true, false, 0 );
from.ApplyPoison( from, Poison.Greater );
Consume();
}
}
}
}
else
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
示例15: OnHit
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
{
if ( this.Charges >= 1 && Utility.RandomDouble() <= .2 && defender.Poisoned == false)
{
int poisontype = 0;
poisontype += (int)( (attacker.Skills.Poisoning.Value / 50) - (defender.Skills.Poisoning.Value / 100) );
if ( poisontype < 0 ) poisontype = 0;
if ( poisontype > 4 ) poisontype = 4;
switch(poisontype)
{
case 0: default: Poison = Poison.Lesser; break;
case 1 :Poison = Poison.Regular; break;
case 2: Poison = Poison.Greater; break;
case 3: Poison = Poison.Deadly; break;
case 4: Poison = Poison.Lethal; break;
}
defender.ApplyPoison(attacker, Poison);
attacker.SendMessage("Venom Strikes! {0}", Convert.ToString(Poison) );
this.Charges -= 1;
attacker.Karma -= 25;
}
base.OnHit(attacker, defender, damageBonus);
}