Esempio n. 1
0
 public DefensiveAnimalAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.Explore;
     //	reg.RegisterAssertion( new Assert( bc.Card1 ) );
     //	reg.RegisterAction( new Action( bc.Start ) );
 }
Esempio n. 2
0
 public SummonedAI( Mobile s, BaseCreature bc )
     : base(AITypes.Custom, bc)
 {
     summonedFrom = s;
     //	Automate reg = new Automate();
     bc.AIState = AIStates.Follow;
     bc.AIStance = AIStances.Defensive;
 }
Esempio n. 3
0
 public StandingGuardAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.Pause1;
     CustomBehaviours.Add( CustomBehavioursTypes.Stay );
     CustomBehaviours.Add( CustomBehavioursTypes.KeepOrientation );
 }
Esempio n. 4
0
 public StandingNpcAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.Explore;
     //	reg.RegisterAssertion( new Assert( bc.Card1 ) );
     //	reg.RegisterAction( new Action( bc.Start ) );
     CustomBehaviours.Add( CustomBehavioursTypes.Stay );
     CustomBehaviours.Add( CustomBehavioursTypes.KeepOrientation );
 }
Esempio n. 5
0
 public static bool InActivePVPCombat(BaseCreature bc)
 {
     return(bc.Combatant != null && bc.ControlOrder != OrderType.Follow && bc.Combatant is PlayerMobile);
 }
Esempio n. 6
0
 private static int GetMaxMovementDex(BaseCreature bc)
 {
     return(bc.IsMonster ? 150 : 200);
 }
Esempio n. 7
0
 public BaseAIType(AITypes _aiType, BaseCreature bc)
 {
     aiType = _aiType;
     from   = bc;
 }
Esempio n. 8
0
		public static void Add( BaseCreature bc, float X, float Y, float Z, ushort MapId )
		{
			bc.X = X;
			bc.Y = Y;
			bc.Z = Z;
			bc.MapId = MapId;
			if ( !World.Loading )
				World.allMobiles.Add( bc, true );				
		}
 public GroupInteligentSpellCasterAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.LookingForPrey;
 }
Esempio n. 10
0
 public BaseAIType( AITypes _aiType, BaseCreature bc )
 {
     aiType = _aiType;
     from = bc;
 }
Esempio n. 11
0
        public void Summon(Mobile c)
        {
            if (c.Summon != null)
            {
                c.Summon.Delete();
                if (World.allMobiles.Contains(c.Summon))
                {
                    World.Remove(c.Summon, c);
                }
            }
            ConstructorInfo ci = World.MobilePool(mountId);
            BaseCreature    bc = (BaseCreature)ci.Invoke(null);

            bc.Faction    = c.Faction;
            bc.AIEngine   = new SummonedAI(c, bc);
            bc.SummonedBy = c;
            c.Summon      = bc;
            bc.Level      = c.Level;
            bc.Stamina    = bc.Str = bc.Iq = bc.Spirit = bc.HitPoints = bc.BaseHitPoints = bc.Agility = bc.BaseMana = 0;
            bc.InitStats();
            //	bc.AIEngine = new SummonedAI( c, bc );
            if (c.Classe == Classes.Warlock)
            {
                #region Fel Intellect
                if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417)
                {
                    if (c.HaveTalent(Talents.FelIntellect))
                    {
                        AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelIntellect);
                        float      bm = (float)bc.BaseMana;
                        bm         += bm * ((float)ae.S1) / 100f;
                        bc.BaseMana = bc.Mana = (int)bm;
                    }
                }
                #endregion
                #region Fel Stamina
                if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417)
                {
                    if (c.HaveTalent(Talents.FelStamina))
                    {
                        AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelStamina);
                        float      bm = (float)bc.BaseHitPoints;
                        bm += bm * ((float)ae.S1) / 100f;
                        bc.BaseHitPoints = bc.HitPoints = (int)bm;
                    }
                }
                #endregion
            }

            World.Add(bc, c.X, c.Y, c.Z, c.MapId);
            if (c is Character)
            {
                //	c.SendSmallUpdate( new int[] { (int)UpdateFields.UNIT_FIELD_CHARM, (int)UpdateFields.UNIT_FIELD_SUMMON }, new object[] { bc.Guid, bc.Guid } );

                Character ch     = c as Character;
                int       offset = 4;
                Converter.ToBytes(1, c.tempBuff, ref offset);
                Converter.ToBytes((byte)0, c.tempBuff, ref offset);
                c.PrepareUpdateData(c.tempBuff, ref offset, UpdateType.UpdateFull, false);
                //				bc.PrepareUpdateData( c.tempBuff, ref offset , UpdateType.UpdateFull, false );
                ch.Send(OpCodes.SMSG_UPDATE_OBJECT, c.tempBuff, offset);
                ch.ItemsUpdate();

                if (bc.Id == 89 || bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 304 || bc.Id == 417)
                {
                    ch.SendPetActionBar();
                }
            }
        }
Esempio n. 12
0
        public static string BritanniaHigh(BaseCreature m_Mobile, SpeechEventArgs e)
        {
            Mobile from     = e.Mobile;
            string response = null;
            string town     = GetLocation(m_Mobile);
            string MyName   = m_Mobile.Name;

            if (Insensitive.Speech(e.Speech, "hello") || Insensitive.Speech(e.Speech, "hi") || (Insensitive.Speech(e.Speech, "good") && Insensitive.Speech(e.Speech, "see") && Insensitive.Speech(e.Speech, "thee")))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("What dost thou want?"); break;

                    case 1: response = ("Uh huh?"); break;

                    case 2: response = ("Yeah, what?"); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("Hello."); break;

                    case 1: response = ("Hi."); break;

                    case 2: response = ("Greetings."); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("Hello, {0}.", e.Mobile.Female ? "milady" : "milord"); break;

                    case 1: response = ("Hi."); break;

                    case 2: response = String.Format("Greetings, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                    }
                }
            }
            if ((Insensitive.Speech(e.Speech, "how") && Insensitive.Speech(e.Speech, "you")) || (Insensitive.Speech(e.Speech, "how") && Insensitive.Speech(e.Speech, "thou")))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("Horrible!"); break;

                    case 1: response = ("None of thy business!"); break;

                    case 2: response = ("Get thee away from me!"); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("I'm doing relatively well."); break;

                    case 1: response = ("Just fine."); break;

                    case 2: response = ("I am well."); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("I am well, {0}. I hope thou art the same.", e.Mobile.Female ? "milady" : "milord"); break;

                    case 1: response = ("Doing great!"); break;

                    case 2: response = String.Format("As well as I can be, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                    }
                }
            }
            if ((Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "thou") && Insensitive.Speech(e.Speech, "live")) || (Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "you") && Insensitive.Speech(e.Speech, "live")) || (Insensitive.Speech(e.Speech, "thou") && Insensitive.Speech(e.Speech, "live")) || (Insensitive.Speech(e.Speech, "you") && Insensitive.Speech(e.Speech, "live")) || Insensitive.Speech(e.Speech, "what city are you from") || Insensitive.Speech(e.Speech, "what town are you from") || (Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "you") && Insensitive.Speech(e.Speech, "from")) || (Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "thou") && Insensitive.Speech(e.Speech, "from")))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("I live here!"); break;

                    case 1: response = ("None of thy business!"); break;

                    case 2: response = ("I live in the bottom of the ocean!  I only come here during the day!"); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(5))
                    {
                    case 0: response = String.Format("I live here in {0}.", town); break;

                    case 1: response = String.Format("I live in {0}.", town); break;

                    case 2: response = String.Format("Here. In {0}.", town); break;

                    case 3: response = String.Format("Right here.  In {0}.", town); break;

                    case 4: response = "I live in the town that thou art standing in."; break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(4))
                    {
                    case 0: response = String.Format("I live here in {0}.", town); break;

                    case 1: response = String.Format("Here, {0}.", e.Mobile.Female ? "milady" : "milord"); break;

                    case 2: response = String.Format("Right here.  In {0}, {1}.", town, e.Mobile.Female ? "milady" : "milord"); break;

                    case 3: response = String.Format("I live in the town that thou art standing in, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                    }
                }
            }
            if ((Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "am") && Insensitive.Speech(e.Speech, "i")) || Insensitive.Speech(e.Speech, "what town am I in") || (Insensitive.Speech(e.Speech, "what") && Insensitive.Speech(e.Speech, "town is this")))
            {
                switch (Utility.Random(3))
                {
                case 0: response = String.Format("Thou art in {0}.", town); break;

                case 1: response = String.Format("Thou art a visitor of {0}.", town); break;

                case 2: response = String.Format("If thou art lost, then know that thou art in {0}.", town); break;
                }
            }
            if ((Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "thou") && Insensitive.Speech(e.Speech, "work")) || (Insensitive.Speech(e.Speech, "where") && Insensitive.Speech(e.Speech, "you") && Insensitive.Speech(e.Speech, "work")))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("I work here, moron!"); break;

                    case 1: response = ("None of thy business!"); break;

                    case 2: response = ("I work out of a cave!  What dost thou think, imbecile!"); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("I work here in {0}.", town); break;

                    case 1: response = String.Format("Here. In {0}.", town); break;

                    case 2: response = String.Format("I work in the town that thou art in.", town); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("I work here in {0}.", town); break;

                    case 1: response = String.Format("Here. In {0}, {1}.", town, e.Mobile.Female ? "milady" : "milord"); break;

                    case 2: response = String.Format("I work in this town, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                    }
                }
            }
            if (Insensitive.Speech(e.Speech, "thanks") || Insensitive.Speech(e.Speech, "thank you") || Insensitive.Speech(e.Speech, "thank thee") || Insensitive.Speech(e.Speech, "thank ye") || Insensitive.Speech(e.Speech, "appreciate"))
            {
                switch (Utility.Random(4))
                {
                case 0: response = "Thou'rt welcome."; break;

                case 1: response = "'Twas nothing."; break;

                case 2: response = "Certainly, thou art welcome."; break;

                case 3: response = "Not a problem."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "bye") || Insensitive.Speech(e.Speech, "farewell") || (Insensitive.Speech(e.Speech, "fare") && Insensitive.Speech(e.Speech, "well")) || Insensitive.Speech(e.Speech, "chow") || Insensitive.Speech(e.Speech, "ciao") || (Insensitive.Speech(e.Speech, "see") && Insensitive.Speech(e.Speech, "ya")) || Insensitive.Speech(e.Speech, "seeya") || Insensitive.Speech(e.Speech, "see you") || Insensitive.Speech(e.Speech, "cya"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = "Goodbye."; break;

                case 1: response = "Farewell."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "who are you") || Insensitive.Speech(e.Speech, "what's your name") || Insensitive.Speech(e.Speech, "what is your name") || Insensitive.Speech(e.Speech, "who art thou") || Insensitive.Speech(e.Speech, "who are ye") || (Insensitive.Speech(e.Speech, "who") && Insensitive.Speech(e.Speech, "you")) || Insensitive.Speech(e.Speech, "what are you called") || Insensitive.Speech(e.Speech, "what art thou called") || Insensitive.Speech(e.Speech, "what are ye called") || Insensitive.Speech(e.Speech, "know your name") || Insensitive.Speech(e.Speech, "know thy name") || Insensitive.Speech(e.Speech, "know yer name") || Insensitive.Speech(e.Speech, "what is thy name") || Insensitive.Speech(e.Speech, "what's thy name"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = String.Format("My name is {0}.", MyName); break;

                case 1: response = String.Format("I am {0}, {1}.", MyName, e.Mobile.Female ? "milady" : "milord"); break;

                case 2: response = String.Format("Thou mayest call me {0}.", MyName); break;
                }
            }
            if ((Insensitive.Speech(e.Speech, "Is") && Insensitive.Speech(e.Speech, "name")) || Insensitive.Speech(e.Speech, "What's thy name"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = String.Format("I am {0}.", MyName); break;

                case 1: response = String.Format("My name, {1}, is {0}.", MyName, e.Mobile.Female ? "madam" : "sir"); break;

                case 2: response = String.Format("If thou art looking for {0} then thou hast found me.", MyName); break;
                }
            }
            if (Insensitive.Equals(e.Speech, "name"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = String.Format("If thou'rt asking for my name, {0}, please be more specific.", e.Mobile.Female ? "milady" : "milord"); break;

                case 1: response = String.Format("Please be more specific, if thou'rt asking for my name, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if ((Insensitive.Speech(e.Speech, "make") && Insensitive.Speech(e.Speech, "money")) || (Insensitive.Speech(e.Speech, "earn") && Insensitive.Speech(e.Speech, "money")) || (Insensitive.Speech(e.Speech, "get") && Insensitive.Speech(e.Speech, "money")))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(4))
                    {
                    case 0: response = ("Oh, well there's stealing, begging, scavenging... many ways for one such as thee to find money."); break;

                    case 1: response = ("I'm sure that thou can find many varied ways to take money. Like stealing things and selling them back to their owners, killing people..."); break;

                    case 2: response = ("Just lift money from people whho have it. That's what thy type would do anyway."); break;

                    case 3: response = ("Thou can always beg for thy gold."); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(7))
                    {
                    case 0: response = ("If thou dost want to earn money, practice a skill. Make things and sell them to the public. Most shopkeepers will let thee use the tools and materials that they aren't using."); break;

                    case 1: response = ("If thou art able to hunt the wild animals, sometimes thou can sell the meat that thou dost carve from them to a butcher."); break;

                    case 2: response = ("If thou can get an axe, perhaps thou could cut some trees into useful boards for woodworkers. They may be willing to pay thee for tham."); break;

                    case 3: response = ("If thou dost happen upon some ore, go to the blacksmith's shop and try to craft some armor or weapons. I have heard that it just takes practice."); break;

                    case 4: response = ("I have heard that the great dungeons sometimes have great treasures."); break;

                    case 5: response = ("Tanners will buy hides and pelts that thou dost take from the animals thou dost hunt."); break;

                    case 6: response = ("Thou can sell feathers from birds to a bowyer. And a cook may purchase the bird itself from thee."); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(4))
                    {
                    case 0: response = "There are many different ways to make money in Britannia. Thou can sell raw materials to merchants, make and sell goods, sell the meat that thou dost find hunting... there are many ways."; break;

                    case 1: response = "The merchants will usually let people practice skills in their shops. All thou dost need is raw materials, and sometimes tools."; break;

                    case 2: response = "Some will stoop to stealing or killing to get their money, so be careful where thou dost walk. Make use of thy skills. Make something and sell it to a merchant."; break;

                    case 3: response = "Hunting seems to be a very profitable source of income. Most cooks will purchase fowl and fish from thee, butchers will pay thee for meat, and tanners for the pelts and hides."; break;
                    }
                }
            }
            if (Insensitive.Speech(e.Speech, "camp"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "It's essential to have good kindling and a bedroll if thou dost want to camp."; break;

                case 1: response = "I never leave the city without a bedroll on which to sleep and some kindling for a fire."; break;

                case 2: response = "Kindling for a fire and a bedroll for thy comfort is all thou dost need to make camp."; break;
                }
            }
            if ((Insensitive.Speech(e.Speech, "how") && Insensitive.Speech(e.Speech, "quit")) || (Insensitive.Speech(e.Speech, "log") && Insensitive.Speech(e.Speech, "off")) || Insensitive.Speech(e.Speech, "logoff"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = "Making camp, if thou art in the wilds, and paying for a room in an Inn are the ways to give thyself a rest from this world."; break;

                case 1: response = "If thou art wanting a respite from the rigors of Britannia, then thou can make a camp or check in to an Inn, whichever is the most convenient."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "bedroll"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = "Bedrolls can be purchased from a provisioner."; break;

                case 1: response = "If thou dost need a bedroll, I think a provisioner might help thee."; break;

                case 2: response = "I think thou can find a bedroll at a provisioner's shop, if that is what thou art looking for."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "kindling"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = "If thou dost use an axe on some wood, thou should get kindling from it. Otherwise, I think a provisioner will carry some for those wanting to camp in the wild."; break;

                case 1: response = "Thou shouldst be able to get kindling from any wood thou finds. If thou has an axe, of course."; break;

                case 2: response = "A provisioner can supply thee with kindling if thou dost lack the means to make thy own."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "cave") || Insensitive.Speech(e.Speech, "dungeon") || Insensitive.Speech(e.Speech, "destard") || Insensitive.Speech(e.Speech, "despise") || Insensitive.Speech(e.Speech, "shame") || Insensitive.Speech(e.Speech, "deceit") || Insensitive.Speech(e.Speech, "hythloth") || Insensitive.Speech(e.Speech, "wrong") || Insensitive.Speech(e.Speech, "covetous"))
            {
                switch (Utility.Random(5))
                {
                case 0: response = "There are many as yet unmapped places beneath Britannia. 'Tis rumored to be riches and magic in them. And creatures that will rend the flesh from thy bones."; break;

                case 1: response = "The places under Britannia - some call them 'dungeons' - are spposed to be rich with treasures and gold. They are also guarded by horrible creatures that want nothing more than to dine on humans."; break;

                case 2: response = "I know of seven dungeons in Britannia. Covetous, Despise, Deceit, and... a, uh, few others."; break;

                case 3: response = "Let's see... I remember the names of Shame, Wrong, Despise, and Hythloth. I've never owned a map of Britannia myself."; break;

                case 4: response = "I think the dungeons that people tend to forget are Destard, Covetous, and Hythloth. I think."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "gold") || Insensitive.Speech(e.Speech, "treasure"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Thou can find a good deal of treasure under Britannia. Look to the caves and what thou call dungeons."; break;

                case 1: response = "Some of the more dangerous creatures will carry gold that they've scavenged."; break;

                case 2: response = "If thou art needing gold, either find it in the dungeons, or scavenge it from monsters thou have killed. Thou will find it either way, if thou dost survive."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Britannia"))
            {
                if (from.Karma <= -60)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "What wouldst thou have me say about Britannia, save that $rogues/foul wenches$ such as thee do much to bespoil its name."; break;

                    case 1: response = String.Format("Britannia? I ask thee not to speak of this land while in my company, {0}!", e.Mobile.Female ? "witch" : "varlet"); break;

                    case 2: response = String.Format("{0}! Thou carest not for Britannia! Thus, I ask thee to remove the name of Lord British's realm from thy mind.", e.Mobile.Female ? "Foul wench" : "Scoundrel"); break;
                    }
                }
                else if (from.Karma >= 60)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Ah, thou dost speak of fair Britannia. Lord British, himself, wouldst be proud of thine efforts to keep it peaceful. Yet, those who travel claim it is but one realm of many."; break;

                    case 1: response = "I cannot speak but fondly on my homeland, the very land thou dost seek to keep safe. Yet I would not forgo an opportunity to see other lands."; break;

                    case 2: response = "I have lived in Britannia all my life, and so I thank thee for thine efforts to improve the lives of all who live here."; break;
                    }
                }
                else
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Ah, fair Britannia. Those who travel claim it is but one realm of many."; break;

                    case 1: response = "I cannot speak but fondly on my homeland. Yet I would not forgo an opportunity to see other lands."; break;

                    case 2: response = "I have lived in Britannia all my life. I do love it so."; break;
                    }
                }
            }
            if (Insensitive.Speech(e.Speech, "Buccaneer's Den") || Insensitive.Speech(e.Speech, "Buccaneers Den"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Buccaneer's Den? Why, 'tis nothing more than a hiding place for pirates!"; break;

                case 1: response = "'Tis where the scum of the realm go to lick their wounds."; break;

                case 2: response = String.Format("I would not live in Buccaneer's Den if I were thee, {0}, for it is home to the most vile men and women to sail the seas.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Britain") || Insensitive.Speech(e.Speech, "capital"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Britain is the capital of all Britannia, land of Lord British."; break;

                case 1: response = "Lord British, sovereign of all Britannia, resides in Britain."; break;

                case 2: response = "Britain is home to Lord British, himself. 'Tis the capital of Britannia."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Cove"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Cove? Thou shouldst find it North and East of Britain."; break;

                case 1: response = "Cove is not much of a city. 'Tis more of a village, to be truthful."; break;

                case 2: response = "Just Northeast of Britain is Cove."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Jhelom"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Jhelom is an outpost for mercenaries and sellswords."; break;

                case 1: response = "Jhelom? 'Tis a town of sword arms looking for work. Thou canst find it off the southwestern coast of mainland Britannia."; break;

                case 2: response = "Some say Jhelom is as rough as Buccaneer's Den, with half the scoundrels and twice the bruises."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Magincia"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Magincia is a city spanning nearly an entire island, outside of Britanny Bay."; break;

                case 1: response = "Magincia? 'Tis a city of arrogance and pride, I think."; break;

                case 2: response = String.Format("Quite a lovely place, {0}. And shouldst thou doubt my word, just ask someone who resides there.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Minoc"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Minoc is a mining town now."; break;

                case 1: response = "Minoc? Why it was once home to the best artisans in the realm, but now that rich deposits of precious metals have been discovered in the mountains, 'tis full of miners."; break;

                case 2: response = String.Format("Minoc lies on the northern coast of the mainland, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Serpent's Hold") || Insensitive.Speech(e.Speech, "Serpents Hold"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Serpent's Hold is where the best knights are trained. 'Tis located in the Cape of Heroes, off the southeastern edge of the mainland."; break;

                case 1: response = "Serpent's Hold is the fortification Lord British granted to his loyal knights, those of the Order of the Silver Serpent."; break;

                case 2: response = "Serpent's Hold? Art thou interested in becoming a member of Lord British's royal order of Knights -- the Order of the Silver Serpent? If such is true, then thou shouldst go to Serpent's Hold."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Skara Brae"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Skara Brae is an island. Thou canst find it off the western coast of Britannia."; break;

                case 1: response = "The most skilled trackers in the land learn their craft on the island of Skara Brae."; break;

                case 2: response = "Many talented shipwrights live on Skara Brae, though the island is actually known for the many trackers who teach their skills there."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Trinsic"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Though Serpent's Hold may be home to valiant knights, and Jhelom home to skilled mercenaries, Trinsic is where one shouldst go to find the most honorable warriors of the realm."; break;

                case 1: response = "Though known as a haven for men and women of honor who wish to hone their martial skills, Trinsic also supports a large guild of architects and engineers."; break;

                case 2: response = "Trinsic? Why, thou couldst find thy way there by merely following the south road from Britain."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Vesper"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Vesper? 'Tis a city in northeastern Britannia. Ore from the mines of Minoc are sent down river to be unloaded in Vesper."; break;

                case 1: response = String.Format("Much of the crafts forged in Minoc find their way to Vesper by way of the river, {0}.", e.Mobile.Female ? "milady" : "milord"); break;

                case 2: response = "Some claim Vesper is merely an extension of Minoc, calling it nothing more than a large marketplace for artisans to sell their wares."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Yew"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Yew is a small, peaceful community of farmers in northwestern Britannia."; break;

                case 1: response = "The High Court of Britannia is in Yew. 'Tis there that important cases that concern all of Britannia are decided, many of which are determined by Lord British, himself."; break;

                case 2: response = "They say farmers and criminals are all who go to Yew, $milord/milady$, save for those hoping to visit one of the two."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Britanny Bay"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "'Tis the bay that touches the city of Britain."; break;

                case 1: response = "Britanny Bay is the body of water on the edge of Britannia's capital."; break;

                case 2: response = "Britanny Bay? Why, 'tis the waters that border the ports of Britain."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Order of the Silver Serpent") || Insensitive.Speech(e.Speech, "Knights"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "'Tis the order of knights who served Lord British in the battle against Lord Robere."; break;

                case 1: response = "When Lord Robere challenged Lord British for his share of the realm, Lord British's faithful knights defended the kingdom."; break;

                case 2: response = "Only the bravest knights belong to the Order of the Silver Serpent. 'Twas they who defeated the forces of Lord Robere."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Robere") || Insensitive.Speech(e.Speech, "Lord Robere"))
            {
                switch (Utility.Random(4))
                {
                case 0: response = "History claims that Lord Robere was once an honorable man. But he was overcome with greed and sought to take the entire realm by force."; break;

                case 1: response = "Years ago, Lord Robere made claims to the lands under Lord British's domain. Were it not for the stout knights in the Order of the Silver Serpent, Lord Robere could very well have conquered the entire realm."; break;

                case 2: response = "Though a kind and generous man in his youth, Lord Robere thirsted for power in his later years, so legends say."; break;

                case 3: response = "Had not the Order of the Silver Serpent been ready to fight for Lord British, this very land could have belonged to the ambitious conqueror."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Lord British") || Insensitive.Speech(e.Speech, "ruler") || Insensitive.Speech(e.Speech, "king"))
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    if (from.Karma <= -60)
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = "Love him like thine own brother, they say.  Fine, say I, but must I be so unnkind to mine own flesh and blood?"; break;

                        case 1: response = "Yes, it seems Lord British doth possess a rare gift for leadership...and I wish he would give it back."; break;

                        case 2: response = String.Format("Wert thou not so masterful, {0}, I would compare THEE to our illustrious ruler... but only a fool would confuse a fine {1} such as thee with Britannia'a royalty.", e.Mobile.Female ? "Milady" : "Milord", e.Mobile.Female ? "soul" : "man"); break;
                        }
                    }
                    else if (from.Karma >= 60)
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = "Ah, thou dost speak of fair Britannia. Lord British, himself, wouldst be proud of thine efforts to keep it peaceful. Yet, those who travel claim it is but one realm of many."; break;

                        case 1: response = "I cannot speak but fondly on my homeland, the very land thou dost seek to keep safe. Yet I would not forgo an opportunity to see other lands."; break;

                        case 2: response = "I have lived in Britannia all my life, and so I thank thee for thine efforts to improve the lives of all who live here."; break;
                        }
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = "Hmmm...  yes, Lord British. That's a difficult one...."; break;

                        case 1: response = "I care not for his empty promises or hollow beliefs, for they brought me nothing vain hope."; break;

                        case 2: response = String.Format("Please accept mine apology, o' noble {0}, but I care little about sharing mine opinions on Lord Britsh with thee.", e.Mobile.Female ? "lady" : "lord"); break;
                        }
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("I have always find Lord British to be fair and just in his rule."); break;

                    case 1: response = ("From my liege I ask no more than a strong but gently, guiding hand. Thus far, Lord British has shown just that."); break;

                    case 2: response = ("Lord British governs as any wise ruler would -- with an even hand and a thoughtful eye."); break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    if (from.Karma <= -60)
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = "Though thou might never know such, Lord British has done much to make our land one of prosperity."; break;

                        case 1: response = "Fear not, troubled soul. The worries that thou might have about our land will soon be made to vanish by Lord British."; break;

                        case 2: response = String.Format("It may not be apparent to thee, {0}, but Lord British's guidance has made Britannia great.", e.Mobile.Female ? "Milady" : "Milord", e.Mobile.Female ? "soul" : "man"); break;
                        }
                    }
                    else if (from.Karma >= 60)
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = String.Format("As thou must surely know, {0} {1}, Lord British is the reason our land has prospered so.", e.Mobile.Female ? "Milady" : "Milord", e.Mobile.Name); break;

                        case 1: response = "I have little fear that all will be well in Britannia."; break;

                        case 2: response = String.Format("As must be plainly apparent to thee, {0}, Lord British's guidance has made Britannia great.", e.Mobile.Female ? "Milady" : "Milord"); break;
                        }
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: response = "Lord British is a kind and generous ruler."; break;

                        case 1: response = "I do not know of another who would rule as fairly in Lord British's stead."; break;

                        case 2: response = "In truth, Lord British does his best to address any concerns we seem to have."; break;
                        }
                    }
                }
            }
            if (Insensitive.Speech(e.Speech, "weather"))
            {
                response = "Ah, the weather... 'Tis an interesting thing, really. No matter what the season, no matter what enchantments are cast, our land is almost always blessed with clear and beautiful blue skies.";
            }
            if (Insensitive.Speech(e.Speech, "concerns") || Insensitive.Speech(e.Speech, "troubles"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Various issues surface from time to time, such as taxation, invasion, protection form creatures of the wild."; break;

                case 1: response = "Any land experiences difficult times, but it takes a wise ruler to lead his people through them."; break;

                case 2: response = "Surely thou dost understand -- life cannot always be free of trouble."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "blackthorn"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "I've heard that Lord Blackthorn has written a couple of books describing his philosophies in-depth. If thou dost find these, I imagine thou wouldst be able to say better than I what Blackthorn is about."; break;

                case 1: response = "Lord Blackthorn and Lord British are still friends, or so I've heard. They just envision different futures for Britannia."; break;

                case 2: response = "Lord Blackthorn wishes the freedom of choice in ALL things extended to everyone. Some say that he'd even sees the Orcs and Lizardmen as equals to the humans in Britannia."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "shamino"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Lord Shamino? Ah, yes, Lord British's friend and ally, I believe."; break;

                case 1: response = "The name is familiar to me... ah, yes -- I believe he is the infrequent guest of Lord British."; break;

                case 2: response = String.Format("Not a name bandied about often, to be sure, kind {0}. I suspect thou'rt refering to the oft-time companion of Lord British, himself.", e.Mobile.Female ? "lady" : "sir"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Iolo"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Iolo? Ah, yes, Lord British's friend and ally, I believe."; break;

                case 1: response = "The name is familiar to me... ah, yes -- I believe he is the infrequent guest of Lord British."; break;

                case 2: response = String.Format("Not a name bandied about often, to be sure, kind {0}. I suspect thou'rt refering to the oft-time companion of Lord British, himself.", e.Mobile.Female ? "lady" : "sir"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "Dupre"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Dupre? Ah, yes, Lord British's friend and ally, I believe. If thou wert to search for him, I wouldst most recommend a tavern."; break;

                case 1: response = "The name is familiar to me... ah, yes -- I believe he is the infrequent guest of Lord British. Mayhaps thou wilt find him sampling the local spirits."; break;

                case 2: response = String.Format("Not a name bandied about often, to be sure, kind {0}. I suspect thou'rt refering to the oft-time fighting companion of Lord British, himself.", e.Mobile.Female ? "lady" : "sir"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "New Magincia"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "New Magincia? Is there something wrong with the original?"; break;

                case 1: response = String.Format("Forgive me, {0}, but I think thou dost suffer the madness of the drink.", e.Mobile.Female ? "milady" : "milord"); break;

                case 2: response = String.Format("I have not heard of such a place, {0}. I suppose it could be a colony of Britannians who have settled in a new territory.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "colony"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = String.Format("I know not of any, {0}.", e.Mobile.Female ? "milady" : "milord"); break;

                case 1: response = "Rumors abound that Lord British wishes to send adventurous and resourceful individuals to settle unexplored areas."; break;

                case 2: response = String.Format("I know not of which thou doth speak, {0}.", e.Mobile.Female ? "milady" : "milord"); break;
                }
            }
            if (Insensitive.Speech(e.Speech, "virtue") || Insensitive.Speech(e.Speech, "virtues") || Insensitive.Speech(e.Speech, "shrines") || Insensitive.Speech(e.Speech, "truth") || Insensitive.Speech(e.Speech, "love") || Insensitive.Speech(e.Speech, "courage") || Insensitive.Speech(e.Speech, "spirituality") || Insensitive.Speech(e.Speech, "valor") || Insensitive.Speech(e.Speech, "honor") || Insensitive.Speech(e.Speech, "justice") || Insensitive.Speech(e.Speech, "sacrifice") || Insensitive.Speech(e.Speech, "honesty") || Insensitive.Speech(e.Speech, "humility") || Insensitive.Speech(e.Speech, "compassion"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Shrines to the virtues are spread around our land. I've heard that they can even resurrect the dead."; break;

                case 1: response = "Rest and health can be found at the shrines."; break;

                case 2: response = "The shrines are rumored to have the power to resurrect the dead."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "avatar"))
            {
                switch (Utility.Random(4))
                {
                case 0: response = "Who?"; break;

                case 1: response = "I'm sorry, I know not of whom thou doth speak."; break;

                case 2: response = "I have never heard of this tar person."; break;

                case 3: response = "I cannot help thee."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "moongates"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = "The moongates? They are... doors to different parts of Britannia. Except the destinations of the doors change with the phases of the two moons."; break;

                case 1: response = "Thou shouldst learn to use the moongates if thou dost plan to travel far. The key is in the phases of the moons."; break;

                case 2: response = "If thou dost use the moongates to travel, then thou might not end up where thou had planned, unless thou hast learned how to use them correctly."; break;
                }
            }
            if (Insensitive.Speech(e.Speech, "moons"))
            {
                response = "Our moons are called Trammel and Felucca. They control the moongates.";
            }
            return(response);
        }
Esempio n. 13
0
 public PredatorAI(BaseCreature bc) : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.LookingForPrey;
 }
Esempio n. 14
0
        public static string FarewellMedium(BaseCreature m_Mobile, Mobile from)
        {
            string response = null;

            //Dastardly
            if (from.Karma <= -60)
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Good riddance."; break;

                    case 1: response = String.Format("Look, everyone, {0} did not kill me!", from.Name); break;

                    case 2: response = "Thou didst not kill me?!"; break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Good riddance!"; break;

                    case 1: response = String.Format("I spoke with {0} and I lived...!", from.Name); break;

                    case 2: response = "Goodbye."; break;
                    }
                }
            }
            //Famous
            else if (from.Karma >= 60)
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Finally! Go away."; break;

                    case 1: response = "Thank thee for ending thy interruption."; break;

                    case 2: response = "Goodbye."; break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("An honor to speak with thee, {0}.", from.Name); break;

                    case 1: response = String.Format("Farewell, {0}.", from.Name); break;

                    case 2: response = String.Format("Goodbye, {0}.", from.Name); break;
                    }
                }
            }
            //Annonymous
            else
            {
                if (m_Mobile.Attitude == AttitudeLevel.Wicked)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Finally! Go away."; break;

                    case 1: response = "Thank thee for ending thy interruption."; break;

                    case 2: response = "Goodbye."; break;
                    }
                }
                else if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Farewell."; break;

                    case 1: response = "Goodbye."; break;

                    case 2: response = "Good day, then."; break;
                    }
                }
            }

            return(response);
        }
Esempio n. 15
0
        public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive, int armorIgnore)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
                return 0;


            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
                Mobiles.MeerMage.StopEffect(m, true);

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return damage;
            }
            bool Stalker = false;
            TeiravonMobile TavMobile;
            double var = 1;
            if (from != null && from is TeiravonMobile)
            {
                TavMobile = from as TeiravonMobile;
                var = .9 - (TavMobile.PlayerLevel * .01);
                if (TavMobile.HasFeat(TeiravonMobile.Feats.StalkingPrey))
                    Stalker = true;
            }

            if (from != null && Spells.Third.BlessSpell.narindun.Contains(from))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(from, m, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, from, m.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            if (from !=null && Spells.Third.BlessSpell.narindun.Contains(m))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(m, from, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, m, from.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (Spells.Third.BlessSpell.saerin.Contains(m))
                resPhys = 95;

            if (armorIgnore > 0 )
            {
                double f = (100 - armorIgnore) / 100.0;
                resPhys =(int)(resPhys * f);
                resFire = (int)(resFire * f);
                resCold = (int)(resCold * f);
                resPois = (int)(resPois * f);
                resNrgy = (int)(resNrgy * f);
            }
            if (from != null && IsTracking(from, m) && Stalker)
            {
                resPhys = (int)(resPhys * var);
                resFire = (int)(resFire * var);
                resCold = (int)(resCold * var);
                resPois = (int)(resPois * var);
                resNrgy = (int)(resNrgy * var);
            }

            if (m_ArmorIgnore)
                resPhys = resFire = resCold = resPois = resNrgy = 0;

            if (Spells.Third.BlessSpell.saerin.Contains(m) && resPhys < 50)
                resPhys = 50;

            int totalDamage;



            totalDamage = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

            if (totalDamage < 1)
                totalDamage = 1;

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
                totalDamage = m.Hits;

            if (from != null)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - resPhys)) / 10000, reflectPhys), m);
                    }
                }
            }

            if (from != null && Spells.Third.BlessSpell.valar.Contains(m))
            {
                ArrayList TargList = new ArrayList();

                foreach (Mobile x in m.GetMobilesInRange(2))
                {
                    if (x != m && x.AccessLevel <= m.AccessLevel && !x.Blessed)
                        TargList.Add(x);

                }

                if (TargList.Count > 0)
                {
                    m.FixedParticles(0x376A, 9, 32, 5005, 2634, 2, EffectLayer.Waist);
                    totalDamage = totalDamage / TargList.Count;
                    for (int i = 0; i < TargList.Count; ++i)
                    {
                        Mobile dude = TargList[i] as Mobile;
                        dude.Damage(totalDamage, from);
                    }
                }
            }

            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;
                if (((tav.IsOrc() && tav.HasFeat(TeiravonMobile.Feats.Tuffness) || tav.HasFeat(TeiravonMobile.Feats.PhysicalResistance)) && from != null && from != tav))
                {
                    double reduce = (((double)(100 - Utility.RandomMinMax(0, 5)) - (double)(tav.PlayerLevel / 1.75)) / (double)100);

                    int temp = totalDamage;

                    totalDamage = (int)((double)totalDamage * (double)reduce);

                    if (temp - totalDamage < 1)
                        totalDamage -= 1;

                    if (totalDamage < 0)
                        totalDamage = 0;

                    if (Utility.RandomMinMax(1, 20) > 19)
                    {
                        totalDamage = 0;
                        tav.SendMessage("Your tough skin deflects the attack!");
                        from.SendMessage("{0} deflects the attack!", tav.Name);
                    }

                }
            }

            if (Spells.Third.BlessSpell.kamalini.Contains(m) && (((DateTime)Spells.Third.BlessSpell.kamalini[m] + TimeSpan.FromSeconds(3)).CompareTo(DateTime.Now)) < 0)
            {
                IPooledEnumerable eable = m.GetMobilesInRange(2);
                ArrayList targets = new ArrayList();
                int total = 0;
                foreach (Mobile t in eable)
                {
                    if (t.AccessLevel > m.AccessLevel || t.Blessed || t == m)
                        continue;
                    targets.Add(t);
                }
                eable.Free();

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile x = (Mobile)targets[i];
                    total += (int)(x.Hits * .03);
                }
                if (total > 2)
                {
                    m.Heal(Utility.RandomMinMax((int)(total * .75), total));
                    m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                    Spells.Third.BlessSpell.kamalini[m] = DateTime.Now;
                }
            }
            m.Damage(totalDamage, from);
            return totalDamage;
        }
Esempio n. 16
0
        public static string ReGreetingLow(BaseCreature m_Mobile, Mobile from)
        {
            string response = null;

            if (m_Mobile.Attitude == AttitudeLevel.Wicked)
            {
                switch (Utility.Random(3))
                {
                case 0: response = "Uh what? Hello. Hm. Could thou repeat that?"; break;

                case 1: response = String.Format("Er... Did thee say, 'hello,' {0}?", from.Name); break;

                case 2: response = "Uh. What?"; break;
                }
            }

            //Dastardly
            if (from.Karma <= -60)
            {
                if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(4))
                    {
                    case 0: response = "Say 'hello' again and I pour slop on thy armor."; break;

                    case 1: response = "WHAT?!?!"; break;

                    case 2: response = "I'm not worthy, but hello anyways."; break;

                    case 3: response = "Are ye talkin' to me? Ye must be, I see no others afoot."; break;
                    }
                }
            }
            //Famous
            else if (from.Karma >= 60)
            {
                if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = String.Format("Hello, {0}. Again, that is.", from.Name); break;

                    case 1: response = "What? I'm confused now. Hello, I guess."; break;

                    case 2: response = String.Format("I'm not smart. {0} is smart. Hello {0}.", from.Name); break;
                    }
                }
            }
            //Annonymous
            else
            {
                if (m_Mobile.Attitude == AttitudeLevel.Neutral || m_Mobile.Attitude == AttitudeLevel.Goodhearted)
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = "Canst thou say that again?"; break;

                    case 1: response = "I hear thee. Do I say 'hello' now?"; break;

                    case 2: response = "Thou art broing."; break;
                    }
                }
            }

            return(response);
        }
Esempio n. 17
0
 public TravellerSalesmanAI(BaseCreature bc) : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.LookingForPrey;
 }
Esempio n. 18
0
 public AgressiveAnimalAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     From.AIState = AIStates.Explore;
 }
Esempio n. 19
0
 private static bool IsControlOrderWithMe(BaseCreature pet)
 {
     return(pet.ControlOrder == OrderType.Guard || pet.ControlOrder == OrderType.Follow || pet.ControlOrder == OrderType.Come);
 }
Esempio n. 20
0
 public TravellerSalesmanAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.LookingForPrey;
 }
Esempio n. 21
0
        private static void Honor(PlayerMobile source, Mobile target)
        {
            IHonorTarget  honorTarget = target as IHonorTarget;
            GuardedRegion reg         = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion));
            Map           map         = source.Map;

            if (honorTarget == null)
            {
                return;
            }

            if (honorTarget.ReceivedHonorContext != null)
            {
                if (honorTarget.ReceivedHonorContext.Source == source)
                {
                    return;
                }

                if (honorTarget.ReceivedHonorContext.CheckDistance())
                {
                    source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent
                    return;
                }
            }

            if (target.Hits < target.HitsMax)
            {
                source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged.
                return;
            }

            BaseCreature cret = target as BaseCreature;

            if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer)))
            {
                if (reg == null || reg.IsDisabled())
                {
                    //Allow honor on blue if Out of guardzone
                }
                else if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0)
                {
                    //Allow honor on blue if in Fel
                }
                else
                {
                    source.SendLocalizedMessage(1001018); // You cannot perform negative acts
                    return;                               //cannot honor in trammel town on blue
                }
            }

            if (Core.ML && target is PlayerMobile)
            {
                source.SendLocalizedMessage(1075614); // You cannot honor other players.
                return;
            }

            if (source.SentHonorContext != null)
            {
                source.SentHonorContext.Cancel();
            }

            new HonorContext(source, target);

            source.Direction = source.GetDirectionTo(target);

            if (!source.Mounted)
            {
                source.Animate(32, 5, 1, true, true, 0);
            }

            BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Honored, 1075649, 1153815, String.Format("{0}", target.Name)));
            BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Perfection, 1153786, 1151394, String.Format("0\t{0}", target.Name)));
        }
Esempio n. 22
0
 public PredatorAI( BaseCreature bc )
     : base(AITypes.NonAgressiveAnimalAI, bc)
 {
     //	Automate reg = new Automate();
     From.AIState = AIStates.LookingForPrey;
 }
Esempio n. 23
0
        public static string BritainHigh(BaseCreature m_Mobile, SpeechEventArgs e)
        {
            string response = null;

            if (e.HasKeyword(0x0122)) // *where am i"
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("Why, thou'rt in the city of Britain, of course."); break;

                case 1: response = ("Thou art in Britain."); break;

                case 2: response = (String.Format("Thou art in Britain, {0}.", e.Mobile.Female ? "milady" : "milord")); break;
                }
            }
            else if (e.HasKeyword(0x0125)) // *dummies*, *dummy*, *training dummies*, *training dummy*
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("The Cavalry Guild in Northeast Britain has sword-training dummies, if that is what thou art looking for."); break;

                case 1: response = ("Thou can work on thy swordplay at the old keep, south of Lord British's castle."); break;

                case 2: response = ("I think that Blackthorn's castle has some training devices, but I'm not certain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "thief") || Insensitive.Speech(e.Speech, "thiev") || Insensitive.Speech(e.Speech, "steal"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("I know naught of thieves!"); break;

                case 1: response = ("Indeed, there be thievery in Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "smith"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Which sort of smith? Weaponsmith, blacksmith?"); break;

                case 1: response = ("There are many sorts of smith."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "blacksmith"))
            {
                response = ("There is a blacksmith beside the castle moat on the northern edge of town.");
            }
            else if (Insensitive.Speech(e.Speech, "weaponsmith"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou mightest wish to check at the armourer's, or the castle."); break;

                case 1: response = ("Thou canst buy weapons at the blacksmith's shop."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "conservatory") || Insensitive.Speech(e.Speech, "bard") || Insensitive.Speech(e.Speech, "minstrel") || Insensitive.Speech(e.Speech, "musician") || Insensitive.Speech(e.Speech, "troubad"))
            {
                response = ("The center of the musical arts in Britain is the Bardic Conservatory on the north side of town.");
            }
            else if (Insensitive.Speech(e.Speech, "mage tower") || Insensitive.Speech(e.Speech, "mage guild") || Insensitive.Speech(e.Speech, "mage"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Mage Tower is the building with all the arches, made of grey stone, on the north side of the town."); break;

                case 1: response = ("Ah, the Mage Guild is housed within a tower of many arches, with pools of water beside it."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "mage's shop") || Insensitive.Speech(e.Speech, "magic") || Insensitive.Speech(e.Speech, "magic shop") || Insensitive.Speech(e.Speech, "mage shop"))
            {
                switch (Utility.Random(5))
                {
                case 0: response = ("There are three or four merchants of the arcane in Britain."); break;

                case 1: response = ("The magic shop The Sorcerer's Delight is also known as the Mage Tower. Thou can purchase magical items there."); break;

                case 2: response = ("Ethral Goods Magic Shop has magical items for sale, and it boasts the only alchemist in Britain."); break;

                case 3: response = ("The magic shop Incantations and Enchantments is situated by the park in eastern Britain."); break;

                case 4: response = ("Sage Advice Magic Shop can sell thee some arcane items, if that is thy desire."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Sorcerer's Delight"))
            {
                response = ("Thou can purchase arcane goods at the Sorcerer's Delight - which some call the Mage Tower. It can be found in northern Britain, next to the Conservatory of Music.");
            }
            else if (Insensitive.Speech(e.Speech, "Ethral") || Insensitive.Speech(e.Speech, "Ethral Goods"))
            {
                response = ("Thou can find the Ethral Goods Magic Shop just south of the Main Gate. Next to the Premier Provisioner's shop.");
            }
            else if (Insensitive.Speech(e.Speech, "Incantations and Enchantments") || Insensitive.Speech(e.Speech, "Incantations"))
            {
                response = ("Incantations and Enchantments is in the middle of eastern Britain, on the south side of the park.");
            }
            else if (Insensitive.Speech(e.Speech, "Sage Advice"))
            {
                response = ("Thou can get to the Sage Advice Magic Shop on the east side of the river.");
            }
            else if (Insensitive.Speech(e.Speech, "stables"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Aside from Lord British's stables, the only ones I can think of lie on the western bank of the river."); break;

                case 1: response = ("Try the stables beside the Mage Tower."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "vet"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a doctor of animals whose shop lies beside The Bucking Horse Stables."); break;

                case 1: response = ("The city's sole veterinarian lives by the river, by the Mage's Bridge."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "theatre"))
            {
                response = ("Lord British supports the arts. There is a public theatre across from the Bardic Conservatory.");
            }
            else if (Insensitive.Speech(e.Speech, "woodworker"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A goodly carpenter lives not far from the market square before the castle gate."); break;

                case 1: response = ("There is a woodworker near the city library."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "theatre"))
            {
                response = ("There are many guilds in this city. 'Tis the benefit of living in Lord British's capital.");
            }
            else if (Insensitive.Speech(e.Speech, "mining guild") || Insensitive.Speech(e.Speech, "miners"))
            {
                response = ("There is a Mining Guild beside the city library.");
            }
            else if (Insensitive.Speech(e.Speech, "baker") || Insensitive.Speech(e.Speech, "bread"))
            {
                response = ("There's a baker on the market square before the castle gate.");
            }
            else if (Insensitive.Speech(e.Speech, "tanner") || Insensitive.Speech(e.Speech, "leather"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A tanner's shop exists by Poor Gate, 'gainst the old city wall."); break;

                case 1: response = ("There is a leatherworker's shop facing the market square."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "healer"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a healer on the market square, near the Main Gate."); break;

                case 1: response = ("If thou dost walk north through the main gates, thou will be facing the healer's shop."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bowyer") || Insensitive.Speech(e.Speech, "fletcher"))
            {
                response = ("Try the bowyer just East of the theatre.");
            }
            else if (Insensitive.Speech(e.Speech, "butcher"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The butcher can be found between the docks, near the customs house."); break;

                case 1: response = ("In Southern Britain on the waterfront there is a butcher. His shop is between the two docks."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "armour") || Insensitive.Speech(e.Speech, "armor"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is an armourer's shop beside the Mage Gate. Just South of the old city wall."); break;

                case 1: response = ("Strength and Steel Armory is located in front of the Mage's Tower in Northern Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "inn"))
            {
                switch (Utility.Random(4))
                {
                case 0: response = ("If there be one thing Britain is not lacking, it be inns!"); break;

                case 1: response = ("The Wayfarer's Inn is just to the East of the Mage's Bridge."); break;

                case 2: response = ("An inn called Sweet Dreams lies next to the Main Gate, just East of the healer's shop."); break;

                case 3: response = ("The North Side Inn is way up in North Britain, just past the Mage's Tower."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Wayfarer's Inn") || Insensitive.Speech(e.Speech, "Wayfarers Inn"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("'Tis South of the Cavalry Guild by the Mage's Gate."); break;

                case 1: response = ("The Wayfarer's Inn is beside the Mage's Gate, on the East side of the river."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Sweet Dreams"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Sweet Dreams Inn is quite upscale!"); break;

                case 1: response = ("Despite its name, the Sweet Dreams inn is quite good. It is near the Main Gate."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Northside"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Northside Inn is situated on the lake that surrounds Blackthorn's Castle."); break;

                case 1: response = ("The Northside Inn is quite good. It is just North of the Music Conservatory."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "alchemist"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The alchemist can be found with the mages in the the magic shop in front of the Main Gate."); break;

                case 1: response = ("Ethral Goods Magic Shop has an alchemist. Try there."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "weaponeer") || Insensitive.Speech(e.Speech, "weaponsmith"))
            {
                response = ("The blacksmith North of the Miner's Guild can probably sell thee anything thou might need.");
            }
            else if (Insensitive.Speech(e.Speech, "mechanician"))
            {
                response = ("The guildhall of the Mechanicians, or the Tinkers as some call them, is right beside Poor Gate.");
            }
            else if (Insensitive.Speech(e.Speech, "artisan"))
            {
                response = ("There be a guildhall for the artisans of the town outside the old walls, south of the Armorer's.");
            }
            else if (Insensitive.Speech(e.Speech, "provision"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("One can purchase provisions at any of a number of shops."); break;

                case 1: response = ("There is a provisioner's directly before the Main Gate."); break;

                case 2: response = ("A quite well-appointed provisioner's exists East of the river, just North of the Lighthouse."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "jewel"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a jeweler's just to the South of the Artist's guild."); break;

                case 1: response = ("About as far East as thou can go, there is a jeweler's shop sitting next to the park."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bank"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The First Bank of Britain lies next to the jeweler's, beside the moat."); break;

                case 1: response = ("The bank is outside the old walls, next to the moat."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "clothes") || (Insensitive.Speech(e.Speech, "clothiers")))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A goodly shop for clothing is next to the Blue Boar Tavern."); break;

                case 1: response = ("Thou canst purchase clothes on the East side of the river, near the Cypress Bridge."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "tavern"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("If thou seekest a place to drink, well, there are many choices!"); break;

                case 1: response = ("There's the Salty Dog, The Unicorn's Horn, The Cat's Lair, and The Blue Boar taverns, here in Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Salty Dog"))
            {
                response = ("The Salty Dog is a tavern overlooking the park, right next to The Wayfarer's Inn.");
            }
            else if (Insensitive.Speech(e.Speech, "Unicorn Horn"))
            {
                response = ("'Tis an expensive place, but the Unicorn Horn, overlooking the ocean on the east side, serves a decent ale.");
            }
            else if (Insensitive.Speech(e.Speech, "Blue Boar"))
            {
                response = ("The Blue Boar is just North of the library, on the river.");
            }
            else if (Insensitive.Speech(e.Speech, "Cat's Lair"))
            {
                response = ("The Cat's Lair is a bit disreputable, as it lies near the docks, but its beer is good.");
            }
            else if (Insensitive.Speech(e.Speech, "shipwright") || Insensitive.Speech(e.Speech, "oaken oar") || Insensitive.Speech(e.Speech, "boats") || Insensitive.Speech(e.Speech, "ships"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The place to buy waterfaring vessels is the Oaken Oar."); break;

                case 1: response = ("The Oaken Oar houses excellent shipwrights. It is on the waterfront by the mouth of the Narrow Neck."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "cartographer") || Insensitive.Speech(e.Speech, "map"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Cartographer's can usually be found sharing space with shipwrights."); break;

                case 1: response = ("If there's not a mapmaker to be found at the Oaken Oar, then I can't help thee much."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "customs") || Insensitive.Speech(e.Speech, "customs house"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Customs office checks imported goods. 'Tis on the waterfront."); break;

                case 1: response = ("Smugglers from Buccaneer's Den have taken to going to Vesper since the Customs House opened on the waterfront."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "train") || Insensitive.Speech(e.Speech, "weapons trainer"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou canst be trained in weapons at the weapons trainer. But thou shouldst be warned that 'tis expensive. He caters to the nobility."); break;

                case 1: response = ("The weapons trainer? Ah, that is on the north edge of town, on the eastern bank of the river. 'Tis called the Cavalry Guild."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "lighthouse"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("'Tis being repaired, but it stands on the promontory o'erlooking Brittany Bay."); break;

                case 1: response = ("The lighthouse is a most imposing sight, but 'twas badly damaged in a storm, and 'tis inoperable."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Lord British"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("He liveth here, in Britain, in his castle."); break;

                case 1: response = ("Lord British doth reside in his castle, but the gates are always open."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "LB"))
            {
                response = ("LB? Mayhap thou means Lord British ....");
            }
            else if (Insensitive.Speech(e.Speech, "castle"))
            {
                if (Insensitive.Speech(e.Speech, "blackthorn's castle"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("Blackthorn stays out of sight mostly, sequestered in his castle up North of Britain."); break;

                    case 1: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                    }
                }
                else
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("Lord British's castle is quite huge. A moat encircles it. Thou canst not miss it."); break;

                    case 1: response = ("Lord British's castle forms the western side of the city. Only farms lie beyond it."); break;

                    case 2: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                    }
                }
            }
            else if (Insensitive.Speech(e.Speech, "blackthorn"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Blackthorn stays out of sight mostly, sequestered in his castle up North of Britain."); break;

                case 1: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "old keep") || Insensitive.Speech(e.Speech, "fighter") || Insensitive.Speech(e.Speech, "warrior"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("The Warrior's Guild is housed in the Old Keep."); break;

                case 1: response = ("The Old Keep, where the Warrior's Guild is headquartered, was once the castle hereabouts, but now we have Lord British's castle."); break;

                case 2: response = ("'Tis crumbling into the Narrows, but the home of the Warrior's Guild is the Old Keep."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "farms") || Insensitive.Speech(e.Speech, "farmers"))
            {
                response = ("The farms in this area are all in the countryside, to the west of Lord British's castle. Thou must cross the Narrows and follow the road there.");
            }
            else if (Insensitive.Speech(e.Speech, "river"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Britain is bounded by two rivers. The Narrows is on the west and Brittany River on the east."); break;

                case 1: response = ("When most people say the river, they mean Brittany River, which runs through the middle of the city."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "narrows") || Insensitive.Speech(e.Speech, "narrows neck") || Insensitive.Speech(e.Speech, "neck"))
            {
                response = ("Narrows Neck is the name for the river mouth on the southwestern side of Britain.");
            }
            else if (Insensitive.Speech(e.Speech, "Brittany River"))
            {
                response = ("That's the river that runs down the middle of the city.");
            }
            else if (Insensitive.Speech(e.Speech, "gate"))
            {
                if (Insensitive.Speech(e.Speech, "River's Gate"))
                {
                    response = ("The Southernmost bridge is called River's Gate.");
                }
                else if (Insensitive.Speech(e.Speech, "poor gate"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("That is the name of the old gate beside the castle moat, for once the poor came in through there to go to market. It is quite narrow."); break;

                    case 1: response = ("Poor Gate is on the south wall, beside the Tinker's Guild."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Main gate"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("The Main Gate is quite majestic! The space before it is paved with grey and red stones, and there be guard towers on either side."); break;

                    case 1: response = ("The Main Gate divides the central city from the waterfront."); break;
                    }
                }
                else
                {
                    response = ("There are two gates in the old city walls. The Poor Gate, and the Main Gate are the names.");
                }
            }
            else if (Insensitive.Speech(e.Speech, "city wall") || Insensitive.Speech(e.Speech, "wall"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("When Britain was but a young city, 'twas enclosed by a wall. But it has long since outgrown it."); break;

                case 1: response = ("Thou canst see that the old city walls are of a different vintage stone than the castle proper. 'Twas built before the current castle buildings."); break;

                case 2: response = ("The northern side of the old city wall hath disappeared completely. 'Tis said the Mage Tower was built from its fragments."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bridge"))
            {
                if (Insensitive.Speech(e.Speech, "Northern bridge") || Insensitive.Speech(e.Speech, "Great Northern") || Insensitive.Speech(e.Speech, "Great bridge"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                    case 1: response = ("The Great Northern Bridge is built fairly high above the water."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Cypress Bridge"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("Cypress Bridge is named for the trees which greet thee coming and going across it."); break;

                    case 1: response = ("The Cypress Bridge is surrounded on one side by a tailor's shop and on the other by a magic shop."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Mage's Bridge"))
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("The bridge next to the Mage's tower is thus called the Mage's Bridge."); break;

                    case 1: response = ("Mage's Bridge was once a gate leading into the city, but the old wall has outlived its usefulness and most of it has been torn down."); break;

                    case 2: response = ("The Mage's Bridge is so named for the fact that the Mage's Tower almost overlooks it."); break;
                    }
                }
                else
                {
                    switch (Utility.Random(6))
                    {
                    case 0: response = ("There are many bridges across the Brittany. There's the Great Northern Bridge at the north-most end, the Mage's Bridge, then the one we call Virtue's Pass. South of that there's Cypress Bridge, and the River's Gate Bridge. And, of course, the Gung-Farmer's Bridge connects Britain with the farmlands to the West."); break;

                    case 1: response = ("The bridge next to the Mage's tower is thus called the Mage's Bridge."); break;

                    case 2: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                    case 3: response = ("Cypress Bridge is named for the trees which greet thee coming and going across it."); break;

                    case 4: response = ("Virtue's Pass connects to Virtue's Path, which will take thee into Lord British's Castle."); break;

                    case 5: response = ("There is the Gung-Farmer's Bridge, which leadeth across Narrows Neck."); break;
                    }
                }
            }
            else if (Insensitive.Speech(e.Speech, "Great Northern"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                case 1: response = ("The Great Northern Bridge is built fairly high above the water."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Virtue's Pass"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Virtue's Pass connects to Virtue's Path, which will take thee into Lord British's Castle."); break;

                case 1: response = ("There used to be a gate at Virtue's Pass, it was torn down some time ago."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Gung-Farmer") || Insensitive.Speech(e.Speech, "Gung Farmer"))
            {
                response = ("The Gung-Farmer's Bridge connects all the farms with Britain proper.");
            }
            else if (Insensitive.Speech(e.Speech, "ankh") || Insensitive.Speech(e.Speech, "death") || Insensitive.Speech(e.Speech, "temple") || Insensitive.Contains(e.Speech, "resur"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou mayst find the temple, where thou canst be resurrected, directly by Mage Gate Bridge."); break;

                case 1: response = ("The ankh in the temple is capable of restoring life to the dead. 'Tis in northern part of town, beside the river."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "paws"))
            {
                response = ("Paws? Take a look at the feet of a dog!");
            }
            else if (Insensitive.Speech(e.Speech, "guardhouse") || Insensitive.Speech(e.Speech, "guard house"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There are two guardhouses. One near the Gung-Farmer's Bridge, and the other next to Virtue's Pass."); break;

                case 1: response = ("One Guardhouse is right beside the Cat's Lair Tavern."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "waterfront"))
            {
                response = ("The waterfront is what many call everything south of the old city wall. Properly speaking, it runneth along the river from River's Gate Bridge, down along the water to the Oaken Oar and the Narrows.");
            }
            else if (Insensitive.Speech(e.Speech, "moat"))
            {
                response = ("Long ago the Narrows were dug up to meet the moat, and now 'tis fed from the water of Brittany Bay.");
            }
            else if (Insensitive.Speech(e.Speech, "brittany bay"))
            {
                response = ("'Tis the bay on our southern coast.");
            }
            else if (Insensitive.Speech(e.Speech, "ocean"))
            {
                response = ("The ocean is to the south of Britain.");
            }
            else if (Insensitive.Speech(e.Speech, "undead") || Insensitive.Speech(e.Speech, "skeleton") || Insensitive.Speech(e.Speech, "graves") || Insensitive.Speech(e.Speech, "graveyard") || Insensitive.Speech(e.Speech, "crypt") || Insensitive.Speech(e.Speech, "cemetery") || Insensitive.Speech(e.Speech, "mausoleum"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("Ah, 'tis a terrible thing, but the graveyard far to the north has become infested with the living bones of the dead."); break;

                case 1: response = ("We have had to abandon our mausoleums, for the cemetery north of here has been touched by magic and is now filled with undead skeletons."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "orc") || Insensitive.Speech(e.Speech, "camp"))
            {
                response = ("There is a plague of orcs on the western side of the farms--if thou seekest their encampments, that is the place to look.");
            }

            return(response);
        }
Esempio n. 24
0
		public override void Deserialize( GenericReader gr )
		{
			base.Deserialize( gr );
			int version = gr.ReadInt();
			if ( version > 6 )
			{
				int nreput = gr.ReadInt();
				for(int t = 0;t < nreput;t++ )
				{
					int krep = gr.ReadInt();
					int vrep = gr.ReadInt();
					reputationAdjustments[ krep ] = vrep;
				}
			}
			if ( version > 5 )
			{
				int nact = gr.ReadInt();
				for(int t = 0;t < nact;t++ )
					actionBar.Add( new Action( gr ) );
			}
			if ( version > 4 )
			{
				int nf = gr.ReadInt();
				for(int t = 0;t < nf;t++ )
				{
					UInt64 gu = (UInt64)gr.ReadInt64();
					friends.Add( gu );
					string user = gr.ReadString();
					friends.Add( user );
				}
			}
			if ( version > 2 )
			{
				BindingPointX = gr.ReadFloat();
				BindingPointY = gr.ReadFloat();
				BindingPointZ = gr.ReadFloat();
				BindingPointMapId = (UInt16)gr.ReadInt();
			}
			if ( version > 1 )
			{
				bool pa = gr.ReadBool();
				if ( pa )
				{
					petActions = new int[ 11 ];
					for(int t = 0;t < 11;t++ )
						petActions[ t ] = gr.ReadInt();
				}
			}
			int sum = gr.ReadInt();
			if ( sum != 0 )
			{
				UInt64 g = gr.ReadInt64();
				if ( version > 7 )
				{
					int sid = gr.ReadInt();
					Summon = new BaseCreature( gr );
					Summon.Id = sid;
				}
			//	Summon = (Mobile)MobileList.TempSummon[ g ];
				Summon.SummonedBy = this;					
				( Summon as BaseCreature ).AIEngine = new SummonedAI( this, Summon as BaseCreature );
			}
			sum = gr.ReadInt();
			if ( sum != 0 )
			{
				Charm = (Mobile)MobileList.TempSummon[ gr.ReadInt64() ];
				Charm.CharmedBy = this;
				( Charm as BaseCreature ).AIEngine = new SummonedAI( this, Charm as BaseCreature );
			}
			CorpseLocationX = gr.ReadFloat();
			CorpseLocationY = gr.ReadFloat();
			CorpseLocationZ = gr.ReadFloat();
			if ( version > 3 )
				CorpseMapId = (ushort)gr.ReadShort();
			corpsGuid = gr.ReadInt64();
			zones = new uint[ 32 ];
			for(int t = 0;t < 32;t++ )
				zones[ t ] = (uint)gr.ReadInt();
			int exi = gr.ReadInt();
			if ( exi == 1 )
			{
				mark = new Position( gr.ReadFloat(), gr.ReadFloat(), gr.ReadFloat(), gr.ReadInt() );
			}
			ammoType = gr.ReadInt();
			race = (Races)gr.ReadByte();
			if ( version == 0 )
				Classe = (Classes)gr.ReadByte();
			gender = gr.ReadByte();
			skin = gr.ReadByte();
			face = gr.ReadByte();
			hairStyle = gr.ReadByte();
			hairColour = gr.ReadByte();
			facialHair = gr.ReadByte();

			copper = (uint)gr.ReadInt();
			int nactq = 20;
			for(int t = 0;t < nactq;t++ )
			{
				int vv = gr.ReadInt();
				if ( vv == 1 )
				{
					ActiveQuest aq = new ActiveQuest( gr );
					if ( aq.Id > 0 )
						AddQuest( aq );
				}
			}

			int nq = gr.ReadInt();
			for(int t = 0;t < nq;t++ )
			{
				int id = gr.ReadInt();
				questsDone[ id ] = true;
			}
			for(int g = 0;g < 8;g++ )
			{
				int field = gr.ReadInt();
				TaxiField[ g ] = (uint)field;
			}
		//	RunSpeed = 11f;
			
		}
Esempio n. 25
0
        public static void DoMoves(BaseCreature from, Mobile target)
        {
            switch (Utility.Random(3))
            {
            case 0:

                if (Utility.Random(500) <= from.RoarAttack)
                {
                    int power;
                    int mindam;
                    int maxdam;

                    if (from.RoarAttack > 3)
                    {
                        mindam = from.RoarAttack / 3;
                        maxdam = from.RoarAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    if (from.RoarAttack > 10)
                    {
                        power = from.RoarAttack / 10;
                    }
                    else
                    {
                        power = 1;
                    }

                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in from.GetMobilesInRange(power))
                    {
                        if (m != from)
                        {
                            targets.Add(m);
                        }
                    }

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = (BaseCreature)m;

                            bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20);
                        }
                    }
                }

                break;

            case 1:

                if (Utility.Random(500) <= from.PetPoisonAttack)
                {
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    Effects.PlaySound(target.Location, target.Map, 0x229);

                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    int level = from.PetPoisonAttack / 20;

                    if (level > 5)
                    {
                        level = 5;
                    }

                    target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
                }

                break;

            case 2:

                if (Utility.Random(500) <= from.FireBreathAttack)
                {
                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    from.PlaySound(Core.AOS ? 0x15E : 0x44B);
                    target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    target.PlaySound(0x208);

                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);

                    Timer t = new FireBreathDOT(target, from, from.FireBreathAttack);
                    t.Start();
                }

                break;
            }
        }