本文整理汇总了C#中Mobile.ApplyPoison方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.ApplyPoison方法的具体用法?C# Mobile.ApplyPoison怎么用?C# Mobile.ApplyPoison使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.ApplyPoison方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
m.Paralyzed = false;
if ( CheckResistedEasy( m ) )
{
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
else
{
if ( Caster.Skills[SkillName.Magery].Value > Utility.Random( 1, 150 ) )
m.ApplyPoison( Caster, Poison.Greater );
else
m.ApplyPoison( Caster, Poison.Regular );
if ( m.Spell is Spell )
((Spell)m.Spell).OnCasterHurt( 1 );
}
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
m.PlaySound( 0x474 );
}
FinishSequence();
}
示例2: Eat
public override bool Eat(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("Ceci doit être dans votre sac");
return false;
}
// Fill the Mobile with FillFactor
if (from is PlayerMobile)
{
CanEat = false;
Timer.DelayCall(TimeSpan.FromSeconds(3), ChangeCanEat);
// Play a random "eat" sound
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);
if (from.Hunger < 20)
from.Hunger += Utility.Random(FillFactor);
DoEffect(from);
return true;
}
return false;
}
示例3: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) )
return;
ClearCurrentAbility( attacker );
BaseWeapon weapon = attacker.Weapon as BaseWeapon;
if ( weapon == null )
return;
if ( !CheckMana( attacker, true ) )
return;
int level = attacker.Skills[SkillName.Poisoning].Fixed / 250;
Poison p = Poison.GetPoison( level );
defender.PlaySound( 0xDD );
defender.FixedParticles( 0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist );
if ( defender.ApplyPoison( attacker, p ) != ApplyPoisonResult.Immune )
{
attacker.SendLocalizedMessage( 1008096, true, defender.Name ); // You have poisoned your target :
defender.SendLocalizedMessage( 1008097, false, attacker.Name ); // : poisoned you!
Titles.AwardKarma( attacker, -10, true );
}
}
示例4: Eat
public override bool Eat(Mobile from)
{
if (CheckHunger(from))
{
from.PlaySound(Utility.Random(0x3A, 3));
if (from.Body.IsHuman && !from.Mounted)
from.Animate(34, 5, 1, true, false, 0);
if (from is PlayerMobile || !from.IsHallucinated)
{
PlayerMobile junkie = from as PlayerMobile;
junkie.Hallucinating = true;
junkie.IncAddiction(new HallucinogenPotion());
Timer.DelayCall(TimeSpan.FromMinutes(5), HallucinogenPotion.StopHallucinate, junkie);
}
else if (Poison != null)
from.ApplyPoison(Poisoner, Poison);
Consume();
return true;
}
return false;
}
示例5: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
defender.ApplyPoison( this, Poison.Deadly );
defender.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
defender.PlaySound( 0x1CB );
}
示例6: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) )
return;
ClearCurrentAbility( attacker );
BaseWeapon weapon = attacker.Weapon as BaseWeapon;
if ( weapon == null )
return;
Poison p = weapon.Poison;
if ( p == null || weapon.PoisonCharges <= 0 )
{
attacker.SendLocalizedMessage( 1061141 ); // Your weapon must have a dose of poison to perform an infectious strike!
return;
}
if ( !CheckStam( attacker, true ) )
return;
// Infectious strike special move now uses poisoning skill to help determine potency
int maxLevel = attacker.Skills[SkillName.Poisoning].Fixed / 200;
if ( maxLevel < 0 ) maxLevel = 0;
if ( p.Level > maxLevel ) p = Poison.GetPoison( maxLevel );
if ( (attacker.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble() )
{
int level = p.Level + 1;
Poison newPoison = Poison.GetPoison( level );
if ( newPoison != null )
{
p = newPoison;
attacker.SendLocalizedMessage( 1060080 ); // Your precise strike has increased the level of the poison by 1
defender.SendLocalizedMessage( 1060081 ); // The poison seems extra effective!
defender.PlaySound( 0xDD );
defender.FixedParticles( 0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist );
--weapon.PoisonCharges;
if ( defender.ApplyPoison( attacker, p ) != ApplyPoisonResult.Immune )
{
attacker.SendLocalizedMessage( 1008096, true, defender.Name ); // You have poisoned your target :
defender.SendLocalizedMessage( 1008097, false, attacker.Name ); // : poisoned you!
}
}
}
else
{
attacker.SendMessage( "Your strike was not precise enough to enhance the poison." );
}
}
示例7: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
attacker.SendMessage("You poisoning target");
defender.SendMessage("You are 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);
}
示例8: OnGotMeleeAttack
public override void OnGotMeleeAttack(Mobile attacker)
{
if (!attacker.Poisoned)
{
int poison = Utility.RandomMinMax(0, 1);
base.OnGotMeleeAttack(attacker);
attacker.ApplyPoison(attacker, Poison.GetPoison(poison));
attacker.SendMessage("You got poisoned when striking in the poisonous slimy body");
}
}
示例9: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.Paralyzed = false;
if ( CheckResisted( m ) )
{
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
else
{
int level;
double total = Caster.Skills[SkillName.Magery].Value;
total += Caster.Skills[SkillName.Poisoning].Value;
double dist = Caster.GetDistanceToSqrt(m);
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
if (total >= 200.0 && 1 > Utility.Random(10))
level = 3;
else if (total > 170.0)
level = 2;
else if (total > 130.0)
level = 1;
else
level = 0;
m.ApplyPoison( Caster, Poison.GetPoison( level ) );
}
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
m.PlaySound( 0x205 );
HarmfulSpell( m );
}
FinishSequence();
}
示例10: OnTrigger
public override void OnTrigger( Mobile from )
{
if ( m_Poison == null || !from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player )
return;
Effects.SendLocationEffect( Location, Map, GetBaseID( this.Type ) - 2, 16, 3, GetEffectHue(), 0 );
Effects.PlaySound( Location, Map, 0x231 );
from.ApplyPoison( from, m_Poison );
from.LocalOverheadMessage( MessageType.Regular, 0x22, 500855 ); // You are enveloped by a noxious gas cloud!
}
示例11: OnHit
public override void OnHit( Mobile attacker, Mobile defender )
{
base.OnHit( attacker, defender );
if ( !Core.AOS && Poison != null && PoisonCharges > 0 && !(Layer == Layer.TwoHanded) )
{
--PoisonCharges;
if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
defender.ApplyPoison( attacker, Poison );
}
}
示例12: OnHit
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
base.OnHit( attacker, defender, damageBonus );
if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
{
--PoisonCharges;
if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
defender.ApplyPoison( attacker, Poison );
}
}
示例13: OnMovement
public override void OnMovement(Mobile m, Point3D oldLocation)
{
base.OnMovement(m, oldLocation);
if (m == null || m.Deleted || m == Hydra || !m.Alive || !m.InRange3D(this, 1, -5, 5) ||
(Hydra != null && !Hydra.CanBeHarmful(m)))
{
return;
}
if (Hydra != null)
{
Hydra.DoHarmful(m, true);
}
if (m is BaseCreature && m.IsControlled())
{
m.Damage(25);
}
else if (m is PlayerMobile)
{
m.Damage(1);
}
if (m.Poisoned)
{
return;
}
if (m is PlayerMobile)
{
m.ApplyPoison(Hydra ?? m, Poison.Lesser);
}
else if (m is BaseCreature)
{
m.ApplyPoison(Hydra ?? m, Poison.Lethal);
}
}
示例14: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
m.Paralyzed = false;
if ( CheckResisted( m ) )
{
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
else
{
int level = 1;
if ( Caster.Skills[SkillName.Magery].Value < 75 )
level = 0;
if ( Utility.Random( 4 ) == 0 )
level = 2;
if ( m.ApplyPoison( Caster, Poison.GetPoison( level ) ) == ApplyPoisonResult.Poisoned )
{
if ( m.PoisonTimer != null && m.PoisonTimer.Running && m.PoisonTimer.Delay > PoisonTickDelay )
{
m.PoisonTimer.Stop();
m.PoisonTimer.Delay = PoisonTickDelay;
m.PoisonTimer.Start();
}
}
if ( m.Spell is MagerySpell && ((MagerySpell)m.Spell).State == SpellState.Casting )
m.Spell.OnCasterHurt( (level + 1)*5 );
}
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
m.PlaySound( 0x474 );
}
FinishSequence();
}
示例15: Eat
public override bool Eat(Mobile 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);
if (Utility.RandomDouble() < 0.05)
GiveToothAche(from, 0);
else
from.SendLocalizedMessage(1077387);
Consume();
return true;
}