Esempio n. 1
0
        private static bool DoesKeeperHateThieves(CharacterInstance keeper, CharacterInstance ch)
        {
            if (!ch.Act.IsSet((int)PlayerFlags.Thief))
            {
                return(false);
            }

            Say.do_say(keeper, "Thieves are not welcome here!");
            Shout.do_shout(keeper, $"{ch.Name} the THIEF is over here!");
            return(true);
        }
Esempio n. 2
0
        private static bool DoesKeeperHateKillers(CharacterInstance keeper, CharacterInstance ch)
        {
            if (!ch.Act.IsSet((int)PlayerFlags.Killer))
            {
                return(true);
            }

            Say.do_say(keeper, "Murderers are not welcome here!");
            Shout.do_shout(keeper, $"{ch.Name} the KILLER is over here!");
            return(false);
        }
Esempio n. 3
0
        public static bool Execute(MobileInstance ch, IManager dbManager)
        {
            if (!ch.IsAwake() || ch.CurrentFighting != null)
            {
                return(false);
            }

            var maxEvil = 300;
            var crime   = string.Empty;
            CharacterInstance victim = null;
            CharacterInstance ech    = null;

            foreach (var vch in ch.CurrentRoom.Persons.Where(vch => vch != ch))
            {
                victim = vch;

                crime = GetCrime(victim);
                if (!string.IsNullOrEmpty(crime))
                {
                    break;
                }

                if (vch.CurrentFighting == null || vch.GetMyTarget() == ch || vch.CurrentAlignment >= maxEvil)
                {
                    continue;
                }

                maxEvil = vch.CurrentAlignment;
                ech     = victim;
            }

            if (victim != null && ch.CurrentRoom.Flags.IsSet(RoomFlags.Safe))
            {
                Yell.do_yell(ch, $"{victim.Name} is a {crime}! As well as a COWARD!");
                return(true);
            }

            if (victim != null)
            {
                Shout.do_shout(ch, $"{victim.Name} is a {crime}! PROTECT THE INNOCENT! BANZAI!!!");
                fight.multi_hit(ch, victim, Program.TYPE_UNDEFINED);
                return(true);
            }

            if (ech == null)
            {
                return(false);
            }

            comm.act(ATTypes.AT_YELL, "$n screams 'PROTECT THE INNOCENT!! BANZAI!!", ch, null, null, ToTypes.Room);
            fight.multi_hit(ch, ech, Program.TYPE_UNDEFINED);
            return(true);
        }
Esempio n. 4
0
        public static bool Execute(MobileInstance ch, IManager dbManager)
        {
            if (!ch.IsAwake() || ch.CurrentFighting != null)
            {
                return(false);
            }

            var crime = string.Empty;
            CharacterInstance victim = null;

            foreach (var vch in ch.CurrentRoom.Persons.Where(vch => vch != ch))
            {
                victim = vch;
                crime  = GetCrime(victim);
                if (!string.IsNullOrEmpty(crime))
                {
                    break;
                }
            }
            if (victim == null)
            {
                return(false);
            }

            if (ch.CurrentRoom.Flags.IsSet(RoomFlags.Safe))
            {
                Yell.do_yell(ch, $"{victim.Name} is a {crime}! As well as a COWARD!");
                return(true);
            }

            Shout.do_shout(ch, $"{victim.Name} is a {crime}! PROTECT THE INNOCENT! MORE BLOOOOD!!!");
            fight.multi_hit(ch, victim, Program.TYPE_UNDEFINED);

            if (ch.CharDied())
            {
                return(true);
            }

            var vnum = GameConstants.GetVnum("MobileCityGuard");

            var databaseMgr = (IRepositoryManager)(dbManager ?? RepositoryManager.Instance);
            var cityguard   = databaseMgr.GetEntity <MobileTemplate>(vnum);

            var newGuard = databaseMgr.CHARACTERS.Create(cityguard, null);

            ch.CurrentRoom.AddTo(newGuard);

            newGuard = databaseMgr.CHARACTERS.Create(cityguard, null);
            ch.CurrentRoom.AddTo(newGuard);
            return(true);
        }