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. } }
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 (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 (!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))) { 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. } }
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 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."); } }