本文整理汇总了C#中Server.Mobile.Kill方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.Kill方法的具体用法?C# Mobile.Kill怎么用?C# Mobile.Kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.Kill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGotMeleeAttack
public override void OnGotMeleeAttack(Mobile attacker)
{
base.OnGotMeleeAttack(attacker);
if ( attacker is BaseCreature )
{
BaseCreature c = (BaseCreature)attacker;
if (c.Controlled && c.ControlMaster != null)
{
c.ControlMaster.SendMessage("The Recluse is immune to your pets attack.");
this.Combatant = c.ControlMaster;
c.Kill();
this.Emote("Your pet has been killed!", c.Name);
}
else if (attacker.BodyValue != 400 || attacker.BodyValue != 401 || attacker.BodyValue != 605 || attacker.BodyValue != 606)
{
attacker.Kill();
this.Emote("Your Summons has been killed!");
}
else if (attacker is EvolutionDragon)
{
attacker.Kill();
this.Emote("Your Evo pet has been killed!");
}
else if (attacker is VoltSpider)
{
attacker.Kill();
this.Emote("Your Hatched pet has been killed!");
}
}
}
示例2: TakeMoney
public static void TakeMoney( Mobile m, DialogNPC npc )
{
if ( !Server.Mobiles.Banker.Withdraw( m, 500 ) )
{
npc.SayTo( m, "Trying to cheat me of 500 gold huh? DIE!" );
m.Kill();
}
}
示例3: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!Validate(attacker) || !CheckMana(attacker, true ))
return;
//{
// SolidHueOverride == 340;
// defender;
//}
ClearCurrentAbility(attacker);
attacker.Kill();
IMount mount = defender.Mount;
if (defender.Mounted)
mount.Rider = null;
if (defender.BodyMod == 155 )
{
defender.SendMessage("The Recluse senses you have been bitten already!");
attacker.Kill();
}
else
{
defender.SendGump(new RecluseInfectedGump());
defender.PlaySound(0x474);
defender.FixedParticles(0x37B9, 244, 25, 9944, 31, 0, EffectLayer.Waist);
defender.BodyMod = 155;
defender.Hue = 340;
defender.AddToBackpack(new RecluseStingMarker());
// Do not reset timer if one is already in place.
if (!IsWounded(defender))
BeginWound(defender, defender.Player ? PlayerDuration : NPCDuration);
}
}
示例4: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
return;
int firstOne = Utility.Random( 1, 6 );
int secondOne = Utility.Random( 1, 6 );
if ((firstOne + secondOne) <= 5) {
this.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "{0} is dead!", from.Name, firstOne, secondOne) );
from.BoltEffect( 0 );
from.Kill();
} else {
this.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "{0} survives!", from.Name, firstOne, secondOne) );
}
}
示例5: OnMoveOver
public override bool OnMoveOver(Mobile m)
{
if (!m_AllowCreatures && !m.Player)
return true;
Item c = m.FindItemOnLayer(Layer.Bracelet) as BraceletOfTalon;
if (c != null)
{
m.SendMessage("You feel as if you're being protected from some evil force");
return true;
}
else
{
m.Kill();
return true;
}
}
示例6: OnMoveOver
public override bool OnMoveOver(Mobile m)
{
if (!m_AllowCreatures && !m.Player)
return true;
Item a = m.Backpack.FindItemByType(typeof(SphereOfProtection));
if (!m_AllowCreatures && !m.Player)
return true;
if (a != null)
{
m.SendMessage("You feel as if you're being protected from some evil force");
return true;
}
else
{
m.Kill();
return true;
}
}
示例7: OnExit
public override void OnExit(Mobile m)
{
PlayerMobile pm = m as PlayerMobile;
if (m_Controller.ShowExitMessage)
m.SendMessage("You have left {0}", this.Name);
if (pm != null)
{
if (m_Controller.KillExit && pm.GameParticipant)
{
m.SendMessage(32, "You cannot leave the area while a game is taking place!");
m.Kill();
}
if (m_Controller.NoStatLoss)
{
if (pm.InStat)
{
BaseShieldGuard.ApplySkillLoss(pm);
}
}
if (m_Controller.IsT2AZone)
{
m.IsT2A = false;
if (m is PlayerMobile)
{
PvPTemplates.PvPTemplates.FetchProfile(m as PlayerMobile).ClearDelta();
}
}
}
base.OnExit(m);
}
示例8: OnGotMeleeAttack
public override void OnGotMeleeAttack(Mobile attacker)
{
int bonusdmg = (Math.Max((int)attacker.Skills[SkillName.Chivalry].Value,(int)attacker.Skills[SkillName.Blacksmith].Value)/20);
AOS.Damage(this, attacker, bonusdmg, true, 0, 0, 0, 0, 0, 0, 100, false, false, false);
if(attacker is BaseCreature)
{
Say("Meurt, toi qui n'est pas digne de me reconnaitre");
attacker.Kill();
}
if (attacker.FindItemOnLayer(Layer.OneHanded) is BaseWeapon)
{
BaseWeapon wpn = (BaseWeapon)attacker.FindItemOnLayer(Layer.OneHanded);
if (wpn.Resource < CraftResource.MGlowing && Utility.RandomDouble()<.10)
{
Emote("Votre arme perce sa lumière, vous offrant un second souffle");
attacker.Heal(Utility.Random(1,15));
}
}
base.OnGotMeleeAttack(attacker);
}
示例9: Target
public void Target(Mobile ma)
{
BaseCreature m = ma as BaseCreature;
if (ma is CharmedMobile)
{
ma.Kill();
Caster.SendMessage("You free them from their charm!");
}
else if (m != null)
{
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m.Controlled || m.Summoned)
{
Caster.SendMessage("That target is already under somone's control!");
}
else if (!m.Alive)
{
Caster.SendMessage("The dead are beyond your charms.");
}
else if (!m.Tamable || m.Blessed)
{
Caster.SendMessage("You have no chance of charming that!");
}
else if (Caster.Followers >= 1)
{
Caster.SendMessage("You couldn't control that if you did charm it!");
}
else if (CheckHSequence(m))
{
SpellHelper.Turn(Caster, m);
if (!m.Controlled && m != null && !m.Deleted)
{
double taming;
if (m.MinTameSkill <= 1.0)
taming = 1.0;
else
taming = m.MinTameSkill;
double charmchance = (Caster.Skills[SkillName.Magery].Value / taming);
if (charmchance <= 0.5)
{
Caster.SendMessage("You have no chance of charming them.");
}
else if (charmchance >= 0.9)
{
Caster.SendMessage("You charm them!");
Point3D mloc = new Point3D(m.X, m.Y, m.Z);
CharmedMobile dg = new CharmedMobile(m);
dg.Owner = m;
dg.Body = m.Body;
dg.AI = m.AI;
dg.Hue = m.Hue;
dg.Name = m.Name;
dg.SpeechHue = m.SpeechHue;
dg.Fame = m.Fame;
dg.Karma = m.Karma;
dg.EmoteHue = m.EmoteHue;
dg.Title = m.Title;
dg.Criminal = (m.Criminal);
dg.Str = m.Str;
dg.Int = m.Int;
dg.Hits = m.Hits;
dg.Dex = m.Dex;
dg.Mana = m.Mana;
dg.Stam = m.Stam;
dg.VirtualArmor = (m.VirtualArmor);
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
dg.SetSkill(SkillName.Magery, m.Skills[SkillName.Magery].Value);
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
dg.Kills = (m.Kills);
//.........这里部分代码省略.........
示例10: 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);
}
}));
}
示例11: OnGotMeleeAttack
public override void OnGotMeleeAttack( Mobile attacker )
{
attacker.Kill();
}
示例12: Damage
public override void Damage( Mobile m )
{
base.Damage( m );
if ( m.Alive )
{
if ( m.Location.X > 6484 && m.Location.Y > 500 )
m.Kill();
else
{
m.FixedParticles( 0x36B0, 1, 14, 0x26BB, 0x3F, 0x7, EffectLayer.Waist );
m.PlaySound( 0x229 );
int damage = 0;
damage += (int) Math.Pow( m.Location.X - 6200, 0.5 );
damage += (int) Math.Pow( m.Location.Y - 330, 0.5 );
if ( damage > 20 )
m.SendLocalizedMessage( 1074567 ); // The acid river is much stronger here. You realize that allowing the acid to touch your flesh will surely kill you.
else if ( damage > 10 )
m.SendLocalizedMessage( 1074566 ); // The acid river has gotten deeper. The concentration of acid is significantly stronger.
else
m.SendLocalizedMessage( 1074565 ); // The acid river burns your skin.
AOS.Damage( m, damage, 0, 0, 0, 100, 0 );
}
}
}
示例13: LeaveGame
public void LeaveGame( Mobile m )
{
CTFTeam t = GetTeam( m );
if ( t != null )
t.RemoveMember( m );
if ( m.AccessLevel == AccessLevel.Player && !m.Blessed )
{
if ( m.Alive )
{
m.Kill();
if ( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.Delete();
}
m.Resurrect();
}
Item robe = m.FindItemOnLayer( Layer.OuterTorso );
if ( robe is CTFRobe )
robe.Delete();
if ( m.Backpack != null )
{
Item[] robes = m.Backpack.FindItemsByType( typeof( CTFRobe ) );
for(int i=0;i<robes.Length;i++)
robes[i].Delete();
}
m.Delta( MobileDelta.Noto );
}
示例14: AddWebCase
public void AddWebCase( Mobile m )
{
new WebCase().MoveToWorld( m.Location, m.Map );
PublicOverheadMessage( MessageType.Emote, 0x47E, true, "*Your pets are nothing but food for me!*" );
m.PlaySound( 922 );
m.Kill();
}
示例15: FinalEffect
public static void FinalEffect(Mobile caster, Mobile target, int effect)
{
IPooledEnumerable eable = caster.Map.GetMobilesInRange(caster.Location, caster.ManaMax / 10);
foreach (Mobile m in eable)
{
if ( ((PlayerMobile)caster).AllyList.Contains( m ) )
{
int heal = m.HitsMax * effect;
m.PlaySound(0x1F2);
m.FixedEffect(0x376A, 9, 32);
m.Hits += heal;
m.LocalOverheadMessage(MessageType.Regular, 170, false, "+" + heal);
}
}
eable.Free();
caster.SendMessage("You have sacrificed yourself!");
caster.DoSpeech("*collapses with a thud!*", new int[] { -1 }, MessageType.Emote, caster.EmoteHue);
caster.Kill();
}