Ejemplo n.º 1
0
        public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
        {
            if (!Controller.InUse)
            {
                return(false);
            }

            if (m is PlayerMobile)
            {
            }
            else
            {
                return(false);
            }

            if (!Field_Config.InAField((PlayerMobile)m))
            {
                return(false);
            }

            return(base.OnMoveInto(m, d, newLocation, oldLocation));
        }
Ejemplo n.º 2
0
        public bool CanTarget(Mobile from, object o)
        {
            PlayerMobile pm = (PlayerMobile)from;
            PlayerMobile target;

            if (o is PlayerMobile)
            {
                target = (PlayerMobile)o;
            }
            else
            {
                pm.SendMessage("You must target another player.");
                return(false);
            }

            if (target.Criminal)
            {
                //pm.SendMessage("They are criminal and cannot participate in a duel.");
                //return false;
            }

            if (target.Combatant != null)
            {
                pm.SendMessage("They are in combat and cannot participate.");
                return(false);
            }

            if (target.Aggressed.Count > 0 || target.Aggressors.Count > 0)
            {
                //pm.SendMessage("They have been in combat recently and cannot participate.");
                //return false;
            }

            if (!target.Alive)
            {
                pm.SendMessage("Only living players can participate in a duel.");
                return(false);
            }

            if (Field_Config.InAField(target) || Duel_Config.InADuel(target))
            {
                pm.SendMessage("They are already in a field duel.");
                return(false);
            }

            if (!Field_Config.AllowSameIPFields && SameIP(pm, (PlayerMobile)target))
            {
                pm.SendMessage("You cannot duel them as there account is sharing the same ip as yours.");
                return(false);
            }

            if (!Field_Config.AllowFactionersToField)
            {
                if (Faction.Find(target) != null)
                {
                    pm.SendMessage("Factioners cannot duel.");
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 3
0
        public static int Handle_Notoriety(Mobile from, Mobile target)
        {
            //BaseCreature targetPet = null;
            //BaseCreature fromPet = null;
            if (from is PlayerMobile && target is PlayerMobile)
            {
                if (Field_Config.InAField((PlayerMobile)from) && Field_Config.InAField((PlayerMobile)target))
                {
                    if (!Field_Config.FieldStarted((PlayerMobile)from))
                    {
                        return(NotorietyHandlers.MobileNotoriety2(from, target));
                    }

                    if (Field_Config.IsAlly((PlayerMobile)from, (PlayerMobile)target))
                    {
                        return(Notoriety.Ally);
                    }
                    if (Field_Config.IsEnemy((PlayerMobile)from, (PlayerMobile)target))
                    {
                        return(Notoriety.Enemy);
                    }
                }
                else if (Field_Config.InAField((PlayerMobile)from) || Field_Config.InAField((PlayerMobile)target))
                {
                    return(NotorietyHandlers.MobileNotoriety2(from, target));
                }
            }
            else if (from is PlayerMobile && target is BaseCreature)
            {
                BaseCreature targetPet = (BaseCreature)target;
                if (Field_Config.InAField((PlayerMobile)from) && Field_Config.InAField((PlayerMobile)targetPet.ControlMaster) && targetPet.Controlled)
                {
                    if (!Field_Config.FieldStarted((PlayerMobile)from))
                    {
                        return(NotorietyHandlers.MobileNotoriety2(from, target));
                    }

                    if (Field_Config.IsAlly((PlayerMobile)from, (PlayerMobile)targetPet.ControlMaster))
                    {
                        return(Notoriety.Ally);
                    }
                    if (Field_Config.IsEnemy((PlayerMobile)from, (PlayerMobile)targetPet.ControlMaster))
                    {
                        return(Notoriety.Enemy);
                    }
                }
            }
            else if (from is BaseCreature && target is PlayerMobile)
            {
                BaseCreature fromPet = (BaseCreature)from;
                if (Field_Config.InAField((PlayerMobile)fromPet.ControlMaster) && Field_Config.InAField((PlayerMobile)target) && fromPet.Controlled)
                {
                    if (!Field_Config.FieldStarted((PlayerMobile)fromPet.ControlMaster))
                    {
                        return(NotorietyHandlers.MobileNotoriety2(from, target));
                    }

                    if (Field_Config.IsAlly((PlayerMobile)fromPet.ControlMaster, (PlayerMobile)target))
                    {
                        return(Notoriety.Ally);
                    }
                    if (Field_Config.IsEnemy((PlayerMobile)fromPet.ControlMaster, (PlayerMobile)target))
                    {
                        return(Notoriety.Enemy);
                    }
                }
            }
            else if (from is BaseCreature && target is BaseCreature)
            {
                BaseCreature fromPet   = (BaseCreature)from;
                BaseCreature targetPet = (BaseCreature)target;
                if (Field_Config.InAField((PlayerMobile)fromPet.ControlMaster) && Field_Config.InAField((PlayerMobile)targetPet.ControlMaster) && fromPet.Controlled && targetPet.Controlled)
                {
                    if (!Field_Config.FieldStarted((PlayerMobile)fromPet.ControlMaster))
                    {
                        return(NotorietyHandlers.MobileNotoriety2(from, target));
                    }

                    if (Field_Config.IsAlly((PlayerMobile)fromPet.ControlMaster, (PlayerMobile)targetPet.ControlMaster))
                    {
                        return(Notoriety.Ally);
                    }
                    if (Field_Config.IsEnemy((PlayerMobile)fromPet.ControlMaster, (PlayerMobile)targetPet.ControlMaster))
                    {
                        return(Notoriety.Enemy);
                    }
                }
            }

            return(NotorietyHandlers.MobileNotoriety2(from, target));
        }