public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m.Player && m.Alive && InRange(m, 10) && !InRange(oldLocation, 10) && InLOS(m) && IOBSystem.IsEnemy(this, m))
            {
                Direction = GetDirectionTo(m);

                string warning = null;

                switch (Utility.Random(6))
                {
                case 0: warning = "I warn you, {0}, you would do well to leave this area before someone shows you the world of gray."; break;

                case 1: warning = "It would be wise to leave this area, {0}, lest your head become my commanders' trophy."; break;

                case 2: warning = "You are bold, {0}, for one of the meager {1}. Leave now, lest you be taught the taste of dirt."; break;

                case 3: warning = "Your presence here is an insult, {0}. Be gone now, knave."; break;

                case 4: warning = "Dost thou wish to be hung by your toes, {0}? Nay? Then come no closer."; break;

                case 5: warning = "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick."; break;
                }

                IOBAlignment faction = IOBSystem.GetIOBAlignment(m);

                Say(warning, m.Name, faction == IOBAlignment.None ? "civilians" : IOBSystem.GetIOBName(faction));
            }
        }
Beispiel #2
0
        public static bool CalcAwardInSilver(Mobile m, out int silver, out int gold)
        {
            // new award amounts
            silver = gold = 0;

            if (m == null || m is BaseCreature == false)
            {
                return(false);
            }

            BaseCreature bc = m as BaseCreature;

            // creature must be IOB aligned
            if (IOBSystem.IsIOBAligned(bc) == false)
            {
                return(false);
            }

            //creature must not be controlled
            if (bc.ControlMaster != null)
            {
                return(false);
            }

            // first find out how much gold this creature is dropping as that will be the gauge for the silver drop
            int MobGold = bc.GetGold();

            // meh, random I know
            gold   = MobGold / 2;               // cut the gold in half
            silver = MobGold / 10;              // and give him 10% in silver

            // now calc the damagers.
            bool         fail    = false;
            ArrayList    list    = BaseCreature.GetLootingRights(bc.DamageEntries);
            IOBAlignment IOBBase = IOBAlignment.None;

            for (int i = 0; i < list.Count; ++i)
            {
                DamageStore ds = (DamageStore)list[i];

                if (!ds.m_HasRight)
                {
                    continue;
                }

                if (ds.m_Mobile != null)
                {
                    // initialize the required IOBAlignment (one time)
                    if (IOBBase == IOBAlignment.None)
                    {
                        IOBBase = IOBSystem.GetIOBAlignment(ds.m_Mobile);
                    }

                    // ds.m_Mobile may be a basecreature or a playermobile
                    // 1. if the damager is not an ememy of the creature it killed, then no silver awards
                    // 2. if all damagers are not of the same alignment, then no silver awards
                    // 3. if the top damager was an interferer, no silver awards
                    if (IOBSystem.IsEnemy(ds.m_Mobile, m) == false || IOBBase != IOBSystem.GetIOBAlignment(ds.m_Mobile) || IOBBase == IOBAlignment.Healer)
                    {                           // no silver awards
                        fail = true;
                        break;
                    }
                }
            }

            // see if there were any non same-kin damagers.
            //	we won't reward silver if there was outside help
            if (fail == true)
            {
                return(false);
            }


            // okay, we have new amounts
            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Called when [enter].
        /// </summary>
        /// <param name="m">The m.</param>
        public void OnEnter(Mobile m)
        {
            if (!(m is PlayerMobile))
            {
                return;
            }
            PlayerMobile pm = (PlayerMobile)m;

            ProcessVisitor(pm);

            if (CityData.ControlingKin == IOBAlignment.None)
            {
                pm.SendMessage(string.Format("Warning: You have entered the City of {0}.  This City is under the rule of the Golem Controller Lord.", City.ToString()));
            }
            else if (pm.IOBRealAlignment == CityData.ControlingKin)
            {
                pm.SendMessage(string.Format("You have entered the friendly City of {0}.", City.ToString()));
            }
            else if (pm.IOBRealAlignment == IOBAlignment.None && CityData.GuardOption != KinCityData.GuardOptions.LordBritish)
            {
                pm.SendMessage(string.Format("Warning: You have entered the City of {0}, under the rule of {1}.  This is a Kin Wars Zone, and you may not be safe here.", City.ToString(), IOBSystem.GetIOBName(CityData.ControlingKin)));
            }
            else if (CityData.CityLeader is PlayerMobile && pm == (PlayerMobile)CityData.CityLeader)
            {
                pm.SendMessage(string.Format("You have entered the City of {0}.  This City is under your control.  Welcome back, {1}.", City.ToString(), pm.Name));
            }
            else
            {
                pm.SendMessage(string.Format("You have entered the City of {0}, under the rule of {1}.  This is a Kin Wars Zone.", City.ToString(), IOBSystem.GetIOBName(CityData.ControlingKin)));
            }
        }