public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                return;
            }

            MonkFists mf = sender.Mobile.FindItemOnLayer(Layer.Gloves) as MonkFists;

            if (mf == null)
            {
                sender.Mobile.SendMessage("Only monks can use this strike.");
                return;
            }

            if (info.ButtonID == 999)
            {
                new MonkCombos.WholenessOfBodyTimer(sender.Mobile).Start();

                if (sender.Mobile.HasGump(typeof(MonkStrikeGump)))
                {
                    sender.Mobile.CloseGump(typeof(MonkStrikeGump));
                }

                sender.Mobile.SendGump(new MonkStrikeGump(sender.Mobile));

                return;
            }

            switch ((MonkElement)info.ButtonID)
            {
            case MonkElement.None:
            {
                sender.Mobile.Freeze(TimeSpan.FromSeconds(1));
                sender.Mobile.Animate(17, 7, 1, true, false, 0);

                MonkSystem.AddHit(sender.Mobile, (MonkElement)info.ButtonID);

                if (sender.Mobile.HasGump(typeof(MonkStrikeGump)))
                {
                    sender.Mobile.CloseGump(typeof(MonkStrikeGump));
                }

                sender.Mobile.SendGump(new MonkStrikeGump(sender.Mobile));
                break;
            }

            case MonkElement.FireCombo:
            {
                MonkCombos.FireCombo(sender.Mobile);
                break;
            }

            case MonkElement.LightCombo:
            {
                MonkCombos.LightCombo(sender.Mobile);
                goto case MonkElement.None;
            }

            case MonkElement.LightAirCombo:
            {
                MonkCombos.LightAirCombo(sender.Mobile);
                goto case MonkElement.None;
            }

            case MonkElement.LightEarthCombo:
            {
                MonkCombos.LightEarthCombo(sender.Mobile);
                goto case MonkElement.None;
            }

            case MonkElement.LightFireCombo:
            {
                MonkCombos.LightFireCombo(sender.Mobile);
                goto case MonkElement.None;
            }

            case MonkElement.LightWaterCombo:
            {
                MonkCombos.LightWaterCombo(sender.Mobile);
                goto case MonkElement.None;
            }

            case MonkElement.LightVoidCombo:
            {
                // Moment of Clarity: Activate this to grant your allies a +5 Insight bonus to hit and to skill checks for a very short period of time.
                goto case MonkElement.None;
            }

            case MonkElement.LightSpecialOne:
            {
                mf.LightEnergy = mf.DarkEnergy = 0;
                break;
            }

            case MonkElement.LightSpecialTwo:
            {
                mf.LightEnergy = mf.DarkEnergy = 0;
                break;
            }

            case MonkElement.DarkSpecialOne:
            {
                mf.LightEnergy = mf.DarkEnergy = 0;
                break;
            }

            case MonkElement.DarkSpecialTwo:
            {
                mf.LightEnergy = mf.DarkEnergy = 0;
                break;
            }

            default:
            {
                if (Enum.IsDefined(typeof(MonkElement), info.ButtonID))
                {
                    SpecialMove.SetCurrentMove(sender.Mobile, new MonkStrike((MonkElement)info.ButtonID));
                }
                break;
            }
            }
        }
Example #2
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!MonkSystem.IsMonk(attacker))
            {
                attacker.SendMessage("Only monks can use this strike.");
                return;
            }

            MonkFists mf     = attacker.FindItemOnLayer(Layer.Gloves) as MonkFists;
            int       amount = 0;

            if (mf != null)
            {
                amount = Utility.Dice(mf.Teir, 3, (3 * mf.Teir));
            }
            else
            {
                amount = Utility.Dice(2, 6, 0);
            }

            switch (m_Element)
            {
            case MonkElement.Air:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1176, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount, 0, 0, 0, 0, 100);
                PlayPunchSound(attacker);
                break;
            }

            case MonkElement.Earth:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1191, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0);
                PlayPunchSound(attacker);
                break;
            }

            case MonkElement.Fire:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1160, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount, 0, 100, 0, 0, 0);
                PlayPunchSound(attacker);
                break;
            }

            case MonkElement.Water:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1364, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount, 0, 0, 0, 100, 0);
                PlayPunchSound(attacker);
                break;
            }

            case MonkElement.Light:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1149, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount / 2, false, 0, 0, 0, 0, 0, 0, 100 /*direct*/, false, false, false);
                PlayPunchSound(attacker);
                mf.LightEnergy += 5;
                break;
            }

            case MonkElement.Dark:
            {
                defender.FixedParticles(0x374A, 10, 20, 5013, 1108, 0, EffectLayer.Waist);
                AOS.Damage(defender, attacker, amount, false, 0, 0, 0, 0, 0, 100 /*chaos*/, 0, false, false, false);
                PlayPunchSound(attacker);
                mf.DarkEnergy += 5;
                break;
            }

            case MonkElement.AirCombo: { MonkCombos.AirCombo(attacker, defender); break; }

            case MonkElement.EarthCombo: { MonkCombos.EarthCombo(attacker, defender); break; }

            case MonkElement.FireCombo:
            {
                // Handled in MonkStrikeGump
                break;
            }

            case MonkElement.WaterCombo: { MonkCombos.WaterCombo(attacker, defender); break; }

            case MonkElement.DarkCombo: { MonkCombos.DarkCombo(attacker, defender); break; }

            case MonkElement.DarkAirCombo: { MonkCombos.DarkAirCombo(attacker, defender); break; }

            case MonkElement.DarkEarthCombo: { MonkCombos.DarkEarthCombo(attacker, defender); break; }

            case MonkElement.DarkFireCombo:
            {
                MonkCombos.DarkFireCombo(attacker, defender, ref damage);
                break;
            }

            case MonkElement.DarkWaterCombo: { MonkCombos.DarkWaterCombo(attacker, defender); break; }
            }

            if ((int)m_Element < 11)
            {
                attacker.SendMessage("You hit your opponent with an elemental attack.");
            }

            ClearCurrentMove(attacker);

            MonkSystem.AddHit(attacker, m_Element);

            if (attacker.HasGump(typeof(MonkStrikeGump)))
            {
                attacker.CloseGump(typeof(MonkStrikeGump));
            }

            attacker.SendGump(new MonkStrikeGump(attacker));
        }