예제 #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.RootParent != from)                                        // TODO: Previous implementation allowed use on ground, without house protection checks. What is the correct behavior?
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1042001); // That must be in your pack for you to use it.
                return;
            }

            AnimalFormContext animalContext = AnimalForm.GetContext(from);

            if (Core.ML && animalContext != null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1080073); // You cannot use a Crystal Ball of Pet Summoning while in animal form.
                return;
            }

            if (Pet == null)
            {
                LinkPet(from);
            }
            else
            {
                CastSummonPet(from);
            }
        }
예제 #2
0
        private static void FinishThrow(object state)
        {
            object[] states = (object[])state;

            Mobile from = (Mobile)states[0];
            Mobile to   = (Mobile)states[1];


            if (Core.AOS)
            {
                new Bola().MoveToWorld(to.Location, to.Map);
            }

            to.Damage(1, from);

            if (to is ChaosDragoon || to is ChaosDragoonElite)
            {
                from.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount.
            }
            IMount            mt      = to.Mount;
            AnimalFormContext context = AnimalForm.GetContext(to);

            if (mt != null && !(to is ChaosDragoon || to is ChaosDragoonElite))
            {
                mt.Rider = null;

                to.SendLocalizedMessage(1040023);                   // You have been knocked off of your mount!
                from.SendMessage("You knock them from their mount!");
            }

            if (to is PlayerMobile)
            {
                if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(to))
                {
                    to.SendLocalizedMessage(1114066, from.Name); // ~1_NAME~ knocked you out of animal form!
                }
                else if (to.Mounted)
                {
                    to.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
                }
                else if (to.Flying)
                {
                    to.SendMessage(1113590, from.Name); // You have been grounded by ~1_NAME~!
                }

                (to as PlayerMobile).SetMountBlock(BlockMountType.Dazed, TimeSpan.FromSeconds(Core.ML ? 10 : 3), true);
            }

            if (Core.AOS && from is PlayerMobile) /* only failsafe, attacker should already be dismounted */
            {
                (from as PlayerMobile).SetMountBlock(BlockMountType.BolaRecovery, TimeSpan.FromSeconds(Core.ML ? 10 : 3), true);
            }

            Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from);
        }
예제 #3
0
        public static int GetDefenseCap(Mobile m)
        {
            AnimalFormContext context = AnimalForm.GetContext(m);

            if (context != null && context.Type == typeof(WildWhiteTiger))
            {
                return(5);
            }

            return(0);
        }
예제 #4
0
        public static int GetDamageBonus(Mobile m)
        {
            AnimalFormContext context = AnimalForm.GetContext(m);

            if (context != null && context.Type == typeof(WildWhiteTiger))
            {
                return((int)(((m.Skills[SkillName.Ninjitsu].Value + m.Skills[SkillName.Stealth].Value + (MasteryInfo.GetMasteryLevel(m, SkillName.Ninjitsu) * 40)) / 3) / 10) / 2);
            }

            return(0);
        }
예제 #5
0
        private static void FinishThrow(object state)
        {
            object[] states = (object[])state;

            Mobile from = (Mobile)states[0];
            Mobile to   = (Mobile)states[1];


            if (Core.AOS)
            {
                new Bola().MoveToWorld(to.Location, to.Map);
            }

            to.Damage(1, from);

            if (to is ChaosDragoon || to is ChaosDragoonElite)
            {
                from.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount.
            }
            IMount            mt      = to.Mount;
            AnimalFormContext context = AnimalForm.GetContext(to);

            if (mt != null && !(to is ChaosDragoon || to is ChaosDragoonElite))
            {
                mt.Rider = null;

                to.SendLocalizedMessage(1040023);                   // You have been knocked off of your mount!
                from.SendMessage("You knock them from their mount!");
            }

            if (AnimalForm.UnderTransformation(to) && context != null)
            {
                Server.Spells.Ninjitsu.AnimalForm.RemoveContext(to, context, true);
                to.SendMessage("{0} knocked you out of animal form!", from.Name);
                from.SendMessage("You've knocked {0} out of animal form!", to.Name);
            }

            if (to.Flying)
            {
                to.Flying = false;
                to.SendMessage("You've been grounded by {0}", from.Name);
                from.SendMessage("You've grounded {0}", to.Name);
            }

            BaseMount.SetMountPrevention(to, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));

            Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseBolaLock), from);
        }
예제 #6
0
파일: AOS.cs 프로젝트: alucardxlx/Casiopia
        public void CheckCancelMorph(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            double minSkill, maxSkill;

            AnimalFormContext acontext = AnimalForm.GetContext(m);
            TransformContext  context  = TransformationSpellHelper.GetContext(m);

            if (context != null)
            {
                Spell spell = context.Spell as Spell;
                spell.GetCastSkills(out minSkill, out maxSkill);
                if (m.Skills[spell.CastSkill].Value < minSkill)
                {
                    TransformationSpellHelper.RemoveContext(m, context, true);
                }
            }
            if (acontext != null)
            {
                int i;
                for (i = 0; i < AnimalForm.Entries.Length; ++i)
                {
                    if (AnimalForm.Entries[i].Type == acontext.Type)
                    {
                        break;
                    }
                }
                if (m.Skills[SkillName.Ninjitsu].Value < AnimalForm.Entries[i].ReqSkill)
                {
                    AnimalForm.RemoveContext(m, true);
                }
            }
            if (!m.CanBeginAction(typeof(PolymorphSpell)) && m.Skills[SkillName.Magery].Value < 66.1)
            {
                m.BodyMod = 0;
                m.HueMod  = -1;
                m.NameMod = null;
                m.EndAction(typeof(PolymorphSpell));
                BaseArmor.ValidateMobile(m);
                BaseClothing.ValidateMobile(m);
            }
            if (!m.CanBeginAction(typeof(IncognitoSpell)) && m.Skills[SkillName.Magery].Value < 38.1)
            {
                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).SetHairMods(-1, -1);
                }
                m.BodyMod = 0;
                m.HueMod  = -1;
                m.NameMod = null;
                m.EndAction(typeof(IncognitoSpell));
                BaseArmor.ValidateMobile(m);
                BaseClothing.ValidateMobile(m);
                BuffInfo.RemoveBuff(m, BuffIcon.Incognito);
            }
            return;
        }
예제 #7
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form.
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && AnimalForm.GetContext(Caster) == null))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                AnimalFormContext context = AnimalForm.GetContext(Caster);
                int mana = ScaleMana(RequiredMana);

                Ninjitsu.AnimalForm.AddLastAnimalForm(Caster, 16);

                if (mana > Caster.Mana)
                {
                    Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (context != null)
                {
                    AnimalForm.RemoveContext(Caster, context, true);
                    Caster.Mana -= mana;

                    BuffInfo.RemoveBuff(Caster, BuffIcon.WhiteTigerForm);
                    return;
                }
                else
                {
                    double ninjitsu = Caster.Skills.Ninjitsu.Value;

                    if (ninjitsu < RequiredSkill + 37.5)
                    {
                        double chance = (ninjitsu - RequiredSkill) / 37.5;

                        if (chance < Utility.RandomDouble())
                        {
                            DoFizzle();
                            return;
                        }
                    }
                }

                Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                Caster.Mana -= mana;

                Caster.CheckSkill(SkillName.Ninjitsu, 0.0, 90.0);

                BaseMount.BaseDismount(Caster);

                int bodyMod = Caster.Female ? 1255 : 1254;
                int hueMod  = 2500;

                Caster.BodyMod = bodyMod;
                Caster.HueMod  = hueMod;

                Caster.SendSpeedControl(SpeedControlType.MountSpeed);

                Timer timer = new AnimalFormTimer(Caster, bodyMod, hueMod);
                timer.Start();

                int skills = (int)((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value + (GetMasteryLevel() * 40)) / 3);

                AnimalForm.AddContext(Caster, new AnimalFormContext(timer, null, true, typeof(WildWhiteTiger), null));
                Caster.CheckStatTimers();

                int bleedMod = (int)(((Caster.Skills[SkillName.Ninjitsu].Value + Caster.Skills[SkillName.Stealth].Value + (GetMasteryLevel() * 40)) / 3) / 10);
                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.WhiteTigerForm, 1155911, 1156060, string.Format("{0}\t{1}\t{2}\t{3}", "20", "5", "", bleedMod.ToString())));
                // +~1_ARG~ Defense Chance Increase.<br>+~2_ARG~ Max Defense Chance Increase Cap.<br> Chance to evade attacks.<br>Applies bleed to victim with a max damage of ~4_ARG~.

                Caster.Delta(MobileDelta.WeaponDamage);
            }

            FinishSequence();
        }
예제 #8
0
        public static bool IsActive(Mobile m)
        {
            AnimalFormContext context = AnimalForm.GetContext(m);

            return(context != null && context.Type == typeof(WildWhiteTiger));
        }
예제 #9
0
        private TimeSpan ComputedSpeed( bool onHorse, bool running, AnimalFormContext context )
        {
            if ( CombatSystemAttachment.GetCSA( this ).BullRushing )
            {
                this.Send( SpeedMode.Run );
                return ( Mobile.RunMount );
            }

            if( !onHorse && !this.CanRun || !CombatSystemAttachment.GetCSA( this ).CanRun() )
            {
                this.Send( SpeedMode.Walk );
                return ( Mobile.WalkFoot );
            }

            else
            {
                if( this.EscortPrisoner != null && this.Feats.GetFeatLevel(FeatList.EscortPrisoner) < 2 )
                {
                    this.Send( SpeedMode.Walk );
                    return ( Mobile.WalkFoot );
                }

                else
                {
                    if( onHorse || ( context != null && context.SpeedBoost ) )
                    {
                        if( onHorse && running )
                            HandleFallFromHorse();

                        this.Send( SpeedMode.Disabled );
                        return ( running ? Mobile.RunMount : Mobile.WalkMount );
                    }

                    else
                    {
                        if( this.SpeedHack )
                        {
                            this.Send( SpeedMode.Run );
                            return ( running ? Mobile.RunMount : Mobile.WalkMount );
                        }

                        this.Send( SpeedMode.Disabled );
                        return ( running ? Mobile.RunFoot : Mobile.WalkFoot );
                    }
                }
            }
        }