protected override void OnTick()
 {
     if (_Count < 10)
     {
         CreateBlood(_tali.Location, _tali.Map, false, _tali);
         _Target.Damage(1 * _Level, _tali);
         _Count++;
     }
     else
     {
         Stop();
     }
 }
Exemple #2
0
        private static void FinishThrow(object state)
        {
            object[] states = (object[])state;

            Mobile       from = (Mobile)states[0];
            BaseCreature to   = (BaseCreature)states[1];
            Bola         b    = (Bola)states[2];
            double       diff = b.GetDifficultyFor(to);

            if (to.Mounted)
            {
                diff -= 25.0;                 // easier to knock someone off a horse than it is to tie them up
            }
            from.RevealingAction();

            if (!from.CheckTargetSkill(SkillName.Tactics, to, diff - 25.0, diff + 25.0) || DateTime.Now < (from.LastMoveTime + TimeSpan.FromSeconds(StandingDelay)))
            {
                from.SendMessage("You throw the bola but miss!");

                if (Utility.RandomDouble() < 0.7)
                {
                    Point3D p = to.Location;
                    p.X += Utility.RandomMinMax(-5, 5);
                    p.Y += Utility.RandomMinMax(-5, 5);

                    b.Uses++;
                    if (b.Uses < b.MaxUses)
                    {
                        b.MoveToWorld(p, to.Map);
                        b.Visible = true;
                    }
                    else
                    {
                        b.Delete();
                    }
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from);
                return;
            }

            to.Damage(1, from);

            //freeze target
            if (!to.Mounted)
            {
                to.CantWalk = true;
                b.DropToMobile(from, to, Point3D.Zero);
                to.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, true, "*" + to.Name + " becomes entangled in the bola*");

                double duration = 7.0 + from.Skills[SkillName.Anatomy].Value * 0.1 + from.Dex * 0.1 - to.Str / 150.0;

                Timer.DelayCall(TimeSpan.FromSeconds(duration), new TimerStateCallback(RestoreCurrentSpeed), new object[] { to, b });
            }
            else
            {
                IMount mt = to.Mount;

                if (mt != null)
                {
                    mt.Rider = null;
                }

                to.BeginAction(typeof(BaseMount));

                to.SendLocalizedMessage(1040023);                   // You have been knocked off of your mount!

                Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(ReleaseMountLock), to);
            }

            Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from);
        }