public override void OnDoubleClick(Mobile m) { if (m == null || m.Deleted) { return; } if (!CanThrow(m, true)) { return; } if (m.Spell != null) { m.Spell.OnCasterUsingObject(this); } if (ClearHands) { m.ClearHands(); } if (DismountUser) { EtherealMount.StopMounting(m); } if (DismountUser && m.Mounted) { BaseMount.Dismount(m); } m.Target = BeginTarget(m); OnBeginTarget(m, true); }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it. } else if (!from.CanBeginAction(typeof(Bola))) { from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola! } else if (from.Target is BolaTarget) { from.SendLocalizedMessage(1049631); // This bola is already being used. } else if (!HasFreeHands(from)) { from.SendLocalizedMessage(1040015); // Your hands must be free to use this } else if (from.Mounted) { from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount } else { EtherealMount.StopMounting(from); from.Target = new BolaTarget(this); from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632); // * You begin to swing the bola...* from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... } }
protected override void OnTarget(Mobile from, object obj) { if (m_Bola.Deleted) { return; } if (obj is Mobile) { Mobile to = (Mobile)obj; if (!m_Bola.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it. } else if (!HasFreeHands(from)) { from.SendLocalizedMessage(1040015); // Your hands must be free to use this } else if (from.Mounted) { from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount } else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from)) { from.SendLocalizedMessage(1070902); // You can't use this while in an animal form! } else if (!to.Mounted && !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(to)) { from.SendLocalizedMessage(1049628); // You have no reason to throw a bola at that. } else if (!from.CanBeHarmful(to)) { } else if (from.BeginAction(typeof(Bola))) { EtherealMount.StopMounting(from); from.DoHarmful(to); m_Bola.Consume(); from.Direction = from.GetDirectionTo(to); from.Animate(11, 5, 1, true, false, 0); from.MovingEffect(to, 0x26AC, 10, 0, false, false); Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to }); } else { from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola! } } else { from.SendLocalizedMessage(1049629); // You cannot throw a bola at that. } }
public override void OnDoubleClick(Mobile from) { if (!this.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it. } else if (!from.CanBeginAction(typeof(Bola))) { from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola! } else if (from.Target is BolaTarget) { from.SendLocalizedMessage(1049631); // This bola is already being used. } else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null)) { from.SendLocalizedMessage(1040015); // Your hands must be free to use this } else if (from.Mounted) { from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount } else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from)) { from.SendLocalizedMessage(1070902); // You can't use this while in an animal form! } else if (from.Flying) { from.SendLocalizedMessage(1113414); // You cannot use this while flying! } else { EtherealMount.StopMounting(from); if (Core.AOS) { Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } } from.Target = new BolaTarget(this); from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632); // * You begin to swing the bola...* from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... } }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it. } else if (!from.CanBeginAction(typeof(Bola))) { PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // // You have to wait a few moments before you can use another bola! } else if (from.Target is BolaTarget) { PrivateOverheadMessage(MessageType.Regular, 946, 1049631, from.NetState); // This bola is already being used. } else if (from.Mounted) { PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount! } else if (from.Flying) { PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying! } else if (AnimalForm.UnderTransformation(from)) { PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form! } else { EtherealMount.StopMounting(from); if (Core.AOS) { Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } } from.Target = new BolaTarget(this); from.LocalOverheadMessage(MessageType.Emote, 201, 1049632); // * You begin to swing the bola...* from.NonlocalOverheadMessage(MessageType.Emote, 201, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... } }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendAsciiMessage("The bola must be in your pack to use it."); } else if (!from.CanBeginAction(typeof(Bola))) { from.SendAsciiMessage("You have to wait a few moments before you can use another bola!"); } else if (from.Target is BolaTarget) { from.SendAsciiMessage("This bola is already being used."); } else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null)) { from.SendAsciiMessage("Your hands must be free to use this"); } else if (from.Mounted) { from.SendAsciiMessage("You cannot use this while riding a mount."); } else { EtherealMount.StopMounting(from); Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } from.Target = new BolaTarget(this); from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632); // * You begin to swing the bola...* from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... } }
protected virtual void OnBeforeThrownAt(Mobile m, TEntity target) { if (m == null || m.Deleted || target == null || !CanThrowAt(m, target, false)) { return; } if (m.Spell != null) { m.Spell.OnCasterUsingObject(this); } if (DismountUser) { EtherealMount.StopMounting(m); } if (ClearHands) { m.ClearHands(); } if (DismountUser && m.Mounted) { BaseMount.Dismount(m); } if ((m.Direction & Direction.Running) != Direction.Running) { m.Direction = m.GetDirectionTo(target.Location); } m.Animate(11, 5, 1, true, false, 0); if (ThrowSound >= 0) { m.PlaySound(ThrowSound); } }
protected override void OnTarget(Mobile from, object obj) { if (m_Bola.Deleted) { return; } if (obj is Mobile) { Mobile to = (Mobile)obj; if (!m_Bola.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it. } else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null)) { from.SendLocalizedMessage(1040015); // Your hands must be free to use this } else if (from.Mounted) { from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount } else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from)) { from.SendLocalizedMessage(1070902); // You can't use this while in an animal form! } else if (!to.Mounted) { from.SendLocalizedMessage(1049628); // You have no reason to throw a bola at that. } else if (!from.CanBeHarmful(to)) { } else if (from.BeginAction(typeof(Bola))) { EtherealMount.StopMounting(from); Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } from.DoHarmful(to); if (Core.AOS) { BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(3.0)); } m_Bola.Consume(); from.Direction = from.GetDirectionTo(to); from.Animate(11, 5, 1, true, false, 0); from.MovingEffect(to, 0x26AC, 10, 0, false, false); Timer.DelayCall <Mobile[]>(TimeSpan.FromSeconds(0.5), new TimerStateCallback <Mobile[]>(FinishThrow), new Mobile[] { from, to }); } else { from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola! } } else { from.SendLocalizedMessage(1049629); // You cannot throw a bola at that. } }
protected override void OnTarget(Mobile from, object obj) { if (m_Bola.Deleted) { return; } if ((obj is Item)) { ((Item)obj).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049628, from.NetState); // You have no reason to throw a bola at that. return; } if (obj is Mobile) { Mobile to = (Mobile)obj; if (!m_Bola.IsChildOf(from.Backpack)) { m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it. } else if (from.Mounted) { m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount! } else if (from.Flying) { m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying! } else if (from == to) { from.SendLocalizedMessage(1005576); // You can't throw this at yourself. } else if (AnimalForm.UnderTransformation(from)) { from.PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form! } else if (!to.Mounted && !to.Flying && !AnimalForm.UnderTransformation(to)) { to.PrivateOverheadMessage(MessageType.Regular, 946, 1049628, from.NetState); // You have no reason to throw a bola at that. } else if (!from.CanBeHarmful(to)) { } else if (from.BeginAction(typeof(Bola))) { from.RevealingAction(); EtherealMount.StopMounting(from); Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } from.DoHarmful(to); BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(10.0)); Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseBolaLock), from); Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(FinishThrow), new object[] { from, to, m_Bola }); } else { m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // You have to wait a few moments before you can use another bola! } } }
protected override void OnTarget(Mobile from, object obj) { if (m_Bola.Deleted) { return; } if (obj is Mobile) { Mobile to = (Mobile)obj; if (!m_Bola.IsChildOf(from.Backpack)) { from.SendAsciiMessage("The bola must be in your pack to use it."); } else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null)) { from.SendAsciiMessage("Your hands must be free to use this."); } else if (from.Mounted) { from.SendAsciiMessage("You cannot use this while riding a mount."); } else if (!to.Mounted) { from.SendAsciiMessage("You have no reason to throw a bola at that."); } else if (!from.CanBeHarmful(to)) { } else if (from.BeginAction(typeof(Bola))) { EtherealMount.StopMounting(from); Item one = from.FindItemOnLayer(Layer.OneHanded); Item two = from.FindItemOnLayer(Layer.TwoHanded); if (one != null) { from.AddToBackpack(one); } if (two != null) { from.AddToBackpack(two); } from.DoHarmful(to); if (Core.AOS) { Timer timer = new BolaTimer(from); timer.Start(); AddContext(from, new BolaContext(timer)); } m_Bola.Consume(); from.Direction = from.GetDirectionTo(to); from.Animate(11, 5, 1, true, false, 0); from.MovingEffect(to, 0x26AC, 10, 0, false, false); Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to }); } else { from.SendAsciiMessage("You have to wait a few moments before you can use another bola!"); } } else { from.SendAsciiMessage("You cannot throw a bola at that."); } }