예제 #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
            {
                from.SendLocalizedMessage(1063299);                   // You must have a free hand to throw shuriken.
                return;
            }

            if (UsesRemaining > 0)
            {
                InternalTarget t = new InternalTarget(this);
                from.Target = t;
            }
            else
            {
                from.SendLocalizedMessage(1063297);                   // You have no shuriken in your ninja belt!
            }
        }
예제 #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_belt.Deleted)
                {
                    return;
                }
                else if (targeted is Mobile)
                {
                    if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
                    {
                        from.SendLocalizedMessage(1063299);                           // You must have a free hand to throw shuriken.
                        return;
                    }

                    Mobile m = (Mobile)targeted;

                    double dist = from.GetDistanceToSqrt(m.Location);

                    if (m.Map != from.Map || dist > 11)
                    {
                        from.SendLocalizedMessage(500446);                           // That is too far away.
                        return;
                    }
                    else if (from.InRange(m, 2))
                    {
                        from.SendLocalizedMessage(1063303);                           // Your target is too close!
                        return;
                    }

                    if (m != from && from.HarmfulCheck(m))
                    {
                        Direction to = from.GetDirectionTo(m);

                        from.Direction = to;

                        from.RevealingAction();

                        from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);

                        if (Fukiya.CheckHitChance(from, m))
                        {
                            from.MovingEffect(m, 0x27AC, 7, 1, false, false, 0x23A, 0);

                            AOS.Damage(m, from, Utility.Random(3, 5), 100, 0, 0, 0, 0);

                            if (m_belt.Poison != null && m_belt.PoisonCharges > 0)
                            {
                                --m_belt.PoisonCharges;

                                Poison poison   = m_belt.Poison;
                                int    maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
                                if (poison.Level > maxLevel)
                                {
                                    poison = Poison.GetPoison(maxLevel);
                                }

                                m.ApplyPoison(from, poison);
                            }
                        }
                        else
                        {
                            from.MovingEffect(new Shuriken(), 0x27AC, 7, 1, false, false, 0x23A, 0);

                            from.SendMessage("You miss.");
                        }

                        // Throwing a shuriken restarts you weapon's swing delay
                        from.NextCombatTime = DateTime.UtcNow + from.Weapon.GetDelay(from);

                        m_belt.UsesRemaining--;
                    }
                }
            }