Beispiel #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();
                LokaiSkill lokaiSkill = (LokaiSkillUtilities.XMLGetSkills(from)).PickPocket;

                if (targeted is Mobile)
                {
                    Mobile    mobile = targeted as Mobile;
                    Container pack   = mobile.Backpack;

                    if (!from.InRange(mobile.Location, 1))
                    {
                        from.NextSkillTime = Core.TickCount;
                        from.SendMessage("You are too far away to do that.");
                        return;
                    }
                    else if (pack == null)
                    {
                        from.NextSkillTime = Core.TickCount;
                        from.SendMessage("That target has no backpack.");
                        return;
                    }
                    else if (!from.CheckAlive())
                    {
                        from.NextSkillTime = Core.TickCount;
                        from.SendMessage("You cannot do that while you are dead.");
                        return;
                    }
                    else if (!mobile.CheckAlive())
                    {
                        from.NextSkillTime = Core.TickCount;
                        from.SendMessage("That is dead, so you cannot do that.");
                        return;
                    }
                    else if (mobile == from)
                    {
                        from.NextSkillTime = Core.TickCount;
                        from.SendMessage("You wish to pick your own pocket?");
                        return;
                    }
                    else
                    {
                        bool withoutNotice = true;
                        if (targeted is PlayerMobile)
                        {
                            if (ALLOW_PLAYER_THEFT)
                            {
                                SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(from, lokaiSkill, 40.0, 100.0);
                                withoutNotice = PickTry(from, mobile, rating, lokaiSkill, pack);
                            }
                            else
                            {
                                from.SendMessage("Pick-pocketing players is not allowed around here!");
                            }
                        }
                        else if (targeted is BaseVendor)
                        {
                            SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(from, lokaiSkill, 0.0, 60.0);
                            withoutNotice = PickTry(from, mobile, rating, lokaiSkill, pack);
                        }
                        else if (targeted is BaseCreature &&
                                 (!((targeted as BaseCreature).Controlled && (targeted as BaseCreature).ControlMaster == from)))
                        {
                            SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(from, lokaiSkill, 20.0, 80.0);
                            withoutNotice = PickTry(from, mobile, rating, lokaiSkill, pack);
                        }
                        else
                        {
                            from.NextSkillTime = Core.TickCount;
                            from.SendMessage("You may not pick their pocket.");
                            return;
                        }

                        if (!withoutNotice)
                        {
                            if (mobile is PlayerMobile)
                            {
                                from.CriminalAction(true);
                                from.OnHarmfulAction(mobile, from.Criminal);
                            }
                            else if (mobile is BaseVendor)
                            {
                                mobile.Direction = mobile.GetDirectionTo(from);
                                from.Direction   = from.GetDirectionTo(mobile);
                                mobile.Animate(31, 5, 1, true, false, 0);
                                mobile.Say(Utility.RandomList(1005560, 1013046, 1079127, 1013038, 1013039, 1010634));
                                from.Animate(20, 5, 1, true, false, 0);
                                from.Damage(Math.Max((Utility.Random(3) + 3), (int)(from.Hits / (Utility.Random(8) + 8))));
                            }
                            else if (mobile is BaseCreature)
                            {
                                (mobile as BaseCreature).AggressiveAction(from, from.Criminal);
                            }
                        }
                    }
                }
                else
                {
                    from.SendMessage("That does not have a pocket you can pick.");
                }
            }
Beispiel #2
0
        public static TimeSpan OnUse(Mobile from)
        {
            if (from.NextSkillTime > Core.TickCount)
            {
                double time = (double)(from.NextSkillTime - Core.TickCount);
                from.SendMessage("You must wait another {0} seconds before using this lokaiSkill.", time.ToString("F1"));
                return(TimeSpan.FromSeconds(time));
            }

            LokaiSkill          lokaiSkill = (LokaiSkillUtilities.XMLGetSkills(from)).SpeakToAnimals;
            List <BaseCreature> animals    = new List <BaseCreature>();

            int Max = from.FollowersMax - from.Followers;
            int Cur = 0;

            foreach (Mobile mob in from.GetMobilesInRange(10))
            {
                if (mob is BaseCreature)
                {
                    BaseCreature creature = mob as BaseCreature;
                    if (creature.AI == AIType.AI_Animal && AllowPackAnimal(creature, lokaiSkill) &&
                        !creature.Controlled && creature.Combatant != from)
                    {
                        if (Cur >= Max)
                        {
                            break;
                        }
                        Cur++;
                        animals.Add(creature);
                    }
                }
            }
            if (animals.Count <= 0)
            {
                from.SendMessage("You are unable to find any animals nearby with which you can speak.");
                from.NextSkillTime = Core.TickCount + (int)TimeSpan.FromSeconds(4.0).TotalSeconds;
            }
            else
            {
                SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(from, lokaiSkill, 0.0, 100.0);
                if (rating >= SuccessRating.PartialSuccess)
                {
                    int count = 3;
                    switch (rating)
                    {
                    case SuccessRating.PartialSuccess: count++; break;

                    case SuccessRating.Success: count += 3; break;

                    case SuccessRating.CompleteSuccess: count += 6; break;

                    case SuccessRating.ExceptionalSuccess: count += 9; break;

                    case SuccessRating.TooEasy: count += 12; break;
                    }
                    from.PublicOverheadMessage(MessageType.Emote, 0x47, true, "** Begins to call to the animals. **");
                    from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                    new InternalTimer(from, count, count + 5, animals).Start();
                }
                else
                {
                    from.SendMessage("You fail to speak to the surrounding animals.");
                }
            }
            return(TimeSpan.FromSeconds(3.0));
        }