public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } if (attacker.Mounted && !(defender.Weapon is Lance)) // TODO: Should there be a message here? { return; } ClearCurrentAbility(attacker); IMount mount = defender.Mount; if (mount == null) { attacker.SendLocalizedMessage(1060848); // This attack only works on mounted targets return; } if (!CheckMana(attacker, true)) { return; } attacker.SendLocalizedMessage(1060082); // The force of your attack has dislodged them from their mount! if (attacker.Mounted) { defender.SendLocalizedMessage(1062315); // You fall off your mount! } else { defender.SendLocalizedMessage(1060083); // You fall off of your mount and take damage! } defender.PlaySound(0x140); defender.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist); mount.Rider = null; BaseMount.SetMountPrevention(defender, BlockMountType.Dazed, DefenderRemountDelay); BaseMount.SetMountPrevention(attacker, BlockMountType.DismountRecovery, AttackerRemountDelay); if (!attacker.Mounted) { AOS.Damage(defender, attacker, Utility.RandomMinMax(15, 25), 100, 0, 0, 0, 0); } }
private static void FinishThrow(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Mobile to = (Mobile)states[1]; if (Core.AOS) { new Bola().MoveToWorld(to.Location, to.Map); } if (to is ChaosDragoon || to is ChaosDragoonElite) { from.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mt = to.Mount; if (mt != null && !(to is ChaosDragoon || to is ChaosDragoonElite)) { mt.Rider = null; } if (to is PlayerMobile) { if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(to)) { to.SendLocalizedMessage(1114066, from.Name); // ~1_NAME~ knocked you out of animal form! } else if (to.Mounted) { to.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } (to as PlayerMobile).SetMountBlock(BlockMountType.Dazed, TimeSpan.FromSeconds(Core.ML ? 10 : 3), true); } else { to.Mount.Rider = null; } if (Core.AOS && from is PlayerMobile) /* only failsafe, attacker should already be dismounted */ { (from as PlayerMobile).SetMountBlock(BlockMountType.BolaRecovery, TimeSpan.FromSeconds(Core.ML ? 10 : 3), true); } to.Damage(1); Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from); }
public static void Dismount(Mobile m) { IMount mount = m.Mount; if (mount != null) { mount.Rider = null; if (m is Player) { EventDispatcher.InvokePlayerDismounted(new PlayerEventArgs((Player)m)); } } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } if (defender is ChaosDragoon || defender is ChaosDragoonElite) { return; } ClearCurrentAbility(attacker); if (CheckMountedNoLance(attacker, defender)) { attacker.SendLocalizedMessage(1060089); // You fail to execute your special move return; } IMount mount = defender.Mount; if (mount == null && !defender.Flying && !Spells.Ninjitsu.AnimalForm.UnderTransformation(defender)) { attacker.SendLocalizedMessage(1060848); // This attack only works on mounted or flying targets return; } if (!CheckMana(attacker, true)) { return; } if (attacker is LesserHiryu && 0.8 >= Utility.RandomDouble()) { return; //Lesser Hiryu have an 80% chance of missing this attack } defender.PlaySound(0x140); defender.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist); int delay = attacker.Weapon is BaseRanged ? 8 : 10; DoDismount(attacker, defender, mount, delay); if (!attacker.Mounted) { AOS.Damage(defender, attacker, Utility.RandomMinMax(15, 25), 100, 0, 0, 0, 0); } }
public override void OnEnter(Mobile m) { if (m is PlayerMobile) { //Dismount players entering. IMount mount = m.Mount; if (mount != null) { mount.Rider = null; } ((PlayerMobile)m).AutoStablePets(); } }
private static void FinishThrow(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Mobile to = (Mobile)states[1]; new Bola().MoveToWorld(to.Location, to.Map); to.Damage(1, from); if (to.Mounted) { if (to is ChaosDragoon || to is ChaosDragoonElite) { from.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mt = to.Mount; if (mt != null && !(to is ChaosDragoon || to is ChaosDragoonElite)) { mt.Rider = null; } to.SendLocalizedMessage(1040023); // You have been knocked off of your mount! BaseMount.SetMountPrevention(to, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0)); } else { if (from.Dex < Utility.RandomMinMax(1, 100)) { if (to.Dex < Utility.RandomMinMax(1, 100)) { to.Freeze(TimeSpan.FromSeconds(2.0)); from.SendMessage("You throw the bola, and it entangles your foe!"); to.SendMessage("You are entangled in a bola!"); } else { from.SendMessage("You throw the bola, but they dodge out of the way."); } } else { from.SendMessage("You throw the bola, but miss."); } } Timer.DelayCall(TimeSpan.FromSeconds(20.0), new TimerStateCallback(ReleaseBolaLock), from); }
public override void OnDismounted(Mobile m, IMount mount) { if (m == null || m.Deleted) { return; } if (mount is BaseCreature) { InvalidateStray((BaseCreature)mount); } m.SendMessage("You have been dismounted. If your mount was not an ethereal, it has been stabled."); }
public static void DismountStable(Mobile m) { IMount mount = m.Mount; if (mount != null) { mount.Rider = null; } if (m is PlayerMobile) { var player = m as PlayerMobile; player.AutoStablePets(); } }
public override void AddEffect() { if (Parent is Mobile) { Mobile from = (Mobile)Parent; if (from.Mounted) { IMount mount = (IMount)from.Mount; mount.Rider = null; } from.BodyMod = from.Female ? 400 : 401; TransformationSpellHelper.AddContext(from, new TransformContext(null, typeof(HalloweenMask), null)); } }
/// <nodoc /> public Mount(IMount template, PathRemapper pathRemapper) : base(template, pathRemapper) { Contract.Assume(template != null); Contract.Assume(pathRemapper != null); Name = pathRemapper.Remap(template.Name); Path = pathRemapper.Remap(template.Path); TrackSourceFileChanges = template.TrackSourceFileChanges; IsWritable = template.IsWritable; IsReadable = template.IsReadable; IsSystem = template.IsSystem; IsScrubbable = template.IsScrubbable; AllowCreateDirectory = template.AllowCreateDirectory; }
public static void Morph(Mobile from, int body) { if (CheckMorph(from, body)) { IMount mount = from.Mount; if (mount != null) { mount.Rider = null; } from.BodyMod = body; if (body == 0xEE || body == 0xCD) { from.AddSkillMod((SkillMod)mods[0]); } if (body == 0x51) { from.HueMod = 0x5A3; } if (body == 0x19 || body == 0xF6) { from.Hits += 20; } if (body == 0x84 || body == 0x7A || body == 0xF6 || body == 0x19 || body == 0xDC || body == 0xDA) { from.Send(new FastMovePacket(true)); } m_Table[from] = true; m_Table2[from] = body; } else { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. from.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); from.PlaySound(0x1D6); from.NextSpellTime = DateTime.Now; } }
private static void FinishThrow(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Mobile to = (Mobile)states[1]; if (Core.AOS) { new Bola().MoveToWorld(to.Location, to.Map); } to.Damage(1, from); if (to is ChaosDragoon || to is ChaosDragoonElite) { from.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mt = to.Mount; AnimalFormContext context = AnimalForm.GetContext(to); if (mt != null && !(to is ChaosDragoon || to is ChaosDragoonElite)) { mt.Rider = null; to.SendLocalizedMessage(1040023); // You have been knocked off of your mount! from.SendMessage("You knock them from their mount!"); } if (AnimalForm.UnderTransformation(to) && context != null) { Server.Spells.Ninjitsu.AnimalForm.RemoveContext(to, context, true); to.SendMessage("{0} knocked you out of animal form!", from.Name); from.SendMessage("You've knocked {0} out of animal form!", to.Name); } if (to.Flying) { to.Flying = false; to.SendMessage("You've been grounded by {0}", from.Name); from.SendMessage("You've grounded {0}", to.Name); } BaseMount.SetMountPrevention(to, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0)); Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from); }
public override bool OnBeforeDeath() { IMount mount = Mount; if (mount != null) { mount.Rider = null; } if (mount is Mobile mobile) { mobile.Delete(); } return(base.OnBeforeDeath()); }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender); if (defender.Mounted && defender.Mount != null) { int chance = (attacker.Str + attacker.Dex - defender.VirtualArmor) / 2; IMount mt = defender.Mount; if (mt.Rider != null && (Utility.Random(100) < chance)) { mt.Rider = null; defender.SendMessage("You have been dismounted!"); attacker.SendMessage("You dismounted your foe!"); } } }
protected override void OnTarget(Mobile from, object target) { if (target is Mobile) { Mobile m = (Mobile)target; if (m.Mounted) { IMount mount = m.Mount; mount.Rider = null; } m.Animate(22, 5, 1, true, false, 0); from.PlaySound(948); from.Emote("*Slap*"); m.Emote("*Ouch!*"); } }
public override bool OnBeforeDeath() { IMount mount = this.Mount; if (mount != null) { mount.Rider = null; } if (mount is Mobile) { ((Mobile)mount).Kill(); } return(base.OnBeforeDeath()); }
public override bool OnBeforeDeath() { IMount mount = this.Mount; if (mount != null) { if (mount is SwampDragon) { ((SwampDragon)mount).HasBarding = false; } mount.Rider = null; } return(base.OnBeforeDeath()); }
public override void OnDeath(Container c) { base.OnDeath(c); IMount mount = this.Mount; if (mount != null) { mount.Rider = null; } if (mount is Mobile) { ((Mobile)mount).Kill(); } }
protected override bool OnBeforeDeath() { IMount mount = this.Mount; if (mount != null) { mount.Rider = null; } if (mount is Mobile) { ((Mobile)mount).Delete(); } return(base.OnBeforeDeath()); }
public virtual void AddEffect() { if (Parent is Mobile) { Mobile from = (Mobile)Parent; if (from.Mounted) { IMount mount = (IMount)from.Mount; mount.Rider = null; } from.BodyMod = BodyMod; from.HueMod = HueMod; TransformationSpellHelper.AddContext(from, new TransformContext(null, new List <ResistanceMod>(), typeof(HalloweenMask), null)); } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!defender.Mounted && !defender.Flying && (!Core.ML || !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(defender))) { attacker.SendLocalizedMessage(1060848); // This attack only works on mounted targets ClearCurrentAbility(attacker); return; } if (!this.Validate(attacker) || !this.CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5); if (!attacker.Mounted) { IMount mount = defender.Mount; Server.Items.Dismount.DoDismount(attacker, defender, mount, 10, true); if (mount is Mobile) { AOS.Damage((Mobile)mount, attacker, amount, 100, 0, 0, 0, 0); } defender.PlaySound(0x140); defender.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist); } else { AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0); if (Server.Items.ParalyzingBlow.IsImmune(defender)) //Does it still do damage? { attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. defender.SendLocalizedMessage(1070813); // You resist paralysis. } else { defender.Paralyze(TimeSpan.FromSeconds(3.0)); Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration); } } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } if (!CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); IMount mount_defender = defender.Mount; IMount mount_attacker = attacker.Mount; if (mount_defender == null) { attacker.SendLocalizedMessage(1060848); // This attack only works on mounted targets return; } if (mount_attacker == null) { defender.FixedParticles(0x376A, 9, 32, 0x13AF, 0, 0, EffectLayer.RightFoot); mount_defender.Rider = null; if (mount_defender is Mobile) { Mobile m = (Mobile)mount_defender; int value = (int)(0.4 * m.Hits); AOS.Damage((Mobile)mount_defender, attacker, value, 100, 0, 0, 0, 0); } defender.BeginAction(typeof(BaseMount)); Timer.DelayCall(BlockMountDuration, new TimerStateCallback(ReleaseMountLock), defender); } else { AOS.Damage(defender, attacker, Utility.Random(5, 10), 100, 0, 0, 0, 0); defender.Freeze(TimeSpan.FromSeconds(3.0)); // is correct? } }
public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message) { if (!dismounted.Mounted && !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted) && !dismounted.Flying) { return; } if (dismounted is ChaosDragoonElite) { dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mount = dismounted.Mount; if (mount != null) { mount.Rider = null; if (message) { dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } } else if (Core.ML && Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted)) { Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true); } else if (dismounted.Flying) { if (!OnFlightPath(dismounted)) { dismounted.Flying = false; dismounted.Freeze(TimeSpan.FromSeconds(1)); dismounted.Animate(AnimationType.Land, 0); BuffInfo.RemoveBuff(dismounted, BuffIcon.Fly); } } else { return; } if (delay != TimeSpan.MinValue) { SetMountPrevention(dismounted, mount, blockmounttype, delay); } }
public void Polymorph(Mobile m) { if (!m.CanBeginAction(typeof(PolymorphSpell)) || !m.CanBeginAction(typeof(IncognitoSpell)) || m.IsBodyMod) { return; } IMount mount = m.Mount; if (mount != null) { mount.Rider = null; } if (m.Mounted) { return; } if (m.Flying) { m.Flying = false; } if (m.BeginAction(typeof(PolymorphSpell))) { Item disarm = m.FindItemOnLayer(Layer.OneHanded); if (disarm != null && disarm.Movable) { m.AddToBackpack(disarm); } disarm = m.FindItemOnLayer(Layer.TwoHanded); if (disarm != null && disarm.Movable) { m.AddToBackpack(disarm); } m.BodyMod = 42; m.HueMod = 0; new ExpirePolymorphTimer(m).Start(); } }
public static long Measure(IMount mount, FilePath path) { path = path.UnRoot(); if (mount.Exists(path)) { long size = MeasureImpl(mount, path); if (path.IsEmpty && mount.IsDir(path)) { size -= BLOCK_SIZE; // Get the root directory for free } return(size); } else { return(0); } }
/// <summary> /// Adds the appearance. /// </summary> /// <param name="outfit">The outfit.</param> /// <param name="mount">The mount.</param> public void AddAppearance(IOutfit outfit, IMount mount) { AddUInt16(outfit.SpriteId); if (outfit.SpriteId != 0) { AddByte(outfit.Head); AddByte(outfit.Body); AddByte(outfit.Legs); AddByte(outfit.Feet); AddByte(outfit.Addons); } else { AddUInt16(outfit.Item); } AddUInt16(mount?.SpriteId ?? 0); }
public static readonly TimeSpan BlockMountDuration = TimeSpan.FromSeconds(3.0); // TODO: Taken from bola script, needs to be verified public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } ClearCurrentAbility(attacker); IMount mount = defender.Mount; if (mount == null) { attacker.SendLocalizedMessage(1060848); // This attack only works on mounted targets return; } if (!CheckMana(attacker, true)) { return; } attacker.SendLocalizedMessage(1060082); // The force of your attack has dislodged them from their mount! if (attacker.Mounted) { defender.SendLocalizedMessage(1062315); // You fall off your mount! } else { defender.SendLocalizedMessage(1060083); // You fall off of your mount and take damage! } defender.PlaySound(0x140); defender.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist); mount.Rider = null; defender.BeginAction(typeof(BaseMount)); Timer.DelayCall(BlockMountDuration, new TimerStateCallback(ReleaseMountLock), defender); if (!attacker.Mounted) { AOS.Damage(defender, attacker, Utility.RandomMinMax(15, 25), 100, 0, 0, 0, 0); } }
public override void OnCast() { TransformationSpellHelper.OnCast(Caster, this); if (CheckSequence()) { RemoveEffect(Caster); object[] mods = new object[] { new StatMod(StatType.Str, "[Cleric] Str Offset", 20, TimeSpan.Zero), new StatMod(StatType.Dex, "[Cleric] Dex Offset", 20, TimeSpan.Zero), new StatMod(StatType.Int, "[Cleric] Int Offset", 20, TimeSpan.Zero), new DefaultSkillMod(SkillName.Macing, true, 20), new DefaultSkillMod(SkillName.Healing, true, 20), new DefaultSkillMod(SkillName.Anatomy, true, 20) }; m_Table[Caster] = mods; Caster.AddStatMod((StatMod)mods[0]); Caster.AddStatMod((StatMod)mods[1]); Caster.AddStatMod((StatMod)mods[2]); Caster.AddSkillMod((SkillMod)mods[3]); Caster.AddSkillMod((SkillMod)mods[4]); Caster.AddSkillMod((SkillMod)mods[5]); double span = 10.0 * ClericDivineFocusSpell.GetScalar(Caster); new InternalTimer(Caster, TimeSpan.FromMinutes((int)span)).Start(); IMount mount = Caster.Mount; if (mount != null) { mount.Rider = null; } Caster.BodyMod = 123; Caster.BeginAction(typeof(ClericAngelicFaithSpell)); Caster.PlaySound(0x165); Caster.FixedParticles(0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head); } FinishSequence(); }
protected override bool IsSpecialMount(IMount mount) { var root = mount.RootDirectory; if (root.StartsWith("/var/lib/")) { // Could be /var/lib/docker when docker uses zfs. Very unlikely that a useful mount is located in /var/lib. return(true); } if (root.StartsWith("/snap/")) { // Mount point for snap packages return(true); } return(false); }
public static void StablePet(Mobile from, BaseCreature pet) { if (pet == null || pet.Deleted || !(pet is BaseCreature) || from == null || from.Deleted) { return; } if (pet.ControlMaster == null) { from.SendMessage("This creature has no owner."); } else if (pet.IsStabled) { from.SendMessage("The pet is already stabled."); } else { Mobile owner = pet.ControlMaster; if (owner.Stabled.Count >= Server.Mobiles.AnimalTrainer.GetMaxStabled(owner)) { from.SendMessage("Warning: The owner has not enough free stable slots. Forcing GM stable..."); } if (pet is IMount) { IMount bm = (IMount)pet; bm.Rider = null; } pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster(null); pet.SummonMaster = null; pet.IsStabled = true; //pet.SetChargeDate( owner ); owner.Stabled.Add(pet); from.SendMessage("The pet is now stabled."); } }
public virtual void OnDismounted(Mobile m, IMount mount) { if (m != null && !m.Deleted && mount != null) { m.SendMessage("You have been dismounted."); } }
public override void OnDismounted(Mobile m, IMount mount) { if (m == null || m.Deleted) { return; } if (mount is BaseCreature) { InvalidateStray((BaseCreature) mount); } m.SendMessage("You have been dismounted. If your mount was not an ethereal, it has been stabled."); }
public static void mountIMount(string mountPath, IMount mount) { records.Add(new Record(mount, mountPath)); }
public Record(IMount mount, string mountPath) { this.mount = mount; this.mountPath = mountPath; }
public virtual void DoDuel( Mobile from, Mobile to ) { NetState fromns = from.NetState; NetState tons = to.NetState; m_FromMount = from.Mount; if ( m_FromMount != null ) m_FromMount.Rider = null; m_From.MoveToWorld( FromStart, Map.Felucca ); from.Direction = Direction.South; from.MagicDamageAbsorb = 0; from.MeleeDamageAbsorb = 0; from.StunReady = false; from.DisarmReady = false; from.Mana = from.ManaMax; from.Stam = from.StamMax; //from.Target.Cancel( from ); if ( fromns != null ) fromns.Send( CancelTarget.Instance ); Target fromtarg = from.Target; //if ( fromtarg != null ) // fromtarg.OnTargetCancel( from, TargetCancelType.Canceled ); from.Frozen = true; m_ToMount = to.Mount; if ( m_ToMount != null ) m_ToMount.Rider = null; m_To.MoveToWorld( ToStart, Map.Felucca ); to.Direction = Direction.North; to.MagicDamageAbsorb = 0; to.MeleeDamageAbsorb = 0; to.StunReady = false; to.DisarmReady = false; to.Mana = to.ManaMax; to.Stam = to.StamMax; //to.Target.Cancel( to ); if ( tons != null ) tons.Send( CancelTarget.Instance ); Target totarg = to.Target; //if ( totarg != null ) // totarg.OnTargetCancel( to, TargetCancelType.Canceled ); to.Frozen = true; ((PlayerMobile)m_From).PermaFlags.Add( (PlayerMobile)to ); ((PlayerMobile)m_To).PermaFlags.Add( (PlayerMobile)from ); ((PlayerMobile)m_From).Delta( MobileDelta.Noto ); ((PlayerMobile)m_To).Delta( MobileDelta.Noto ); DuelWall wall = new DuelWall( NorthSouth, from, to ); wall.MoveToWorld( WallArea, Map.Felucca ); m_From.SendAsciiMessage( "Duel Started" ); m_To.SendAsciiMessage( "Duel Started" ); }
public virtual void OnDismounted(Mobile m, IMount mount) { if (m != null && !m.Deleted) { m.SendMessage(mount != null ? "You have been dismounted." : "You have been wing clipped."); } }