Exemplo n.º 1
0
        public override bool OnDragDrop(Mobile from, Item item)
        {
            if (item is BasePotion)
            {
                BasePotion pot = (BasePotion)item;

                if (pot.PotionEffect != m_Type && m_Held != 0)
                {
                    from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions.
                }
                else if (m_Held >= m_MaxAmount)
                {
                    from.SendLocalizedMessage(502233); // The keg will not hold any more!
                }
                else if (pot.Amount > (m_MaxAmount - m_Held))
                {
                    from.SendAsciiMessage("That keg can't contain all those potions!");
                }
                else
                {
                    if (m_Held == 0)
                    {
                        m_Type = pot.PotionEffect;
                    }

                    int toConsume = m_MaxAmount - m_Held;

                    if (toConsume > pot.Amount)
                    {
                        toConsume = pot.Amount;
                    }

                    m_Held += toConsume;

                    pot.Consume(toConsume);

                    Bottle emptyBottles = new Bottle(toConsume);

                    if (!from.AddToBackpack(emptyBottles))
                    {
                        from.SendAsciiMessage(string.Format("You are too heavey, you place the bottle{0} on the ground.", emptyBottles.Amount == 1 ? string.Empty : "s"));
                        emptyBottles.MoveToWorld(from.Location);
                    }
                    else
                    {
                        from.SendAsciiMessage(string.Format("You place the empty bottle{0} in your backpack.", emptyBottles.Amount == 1 ? string.Empty : "s"));
                    }

                    ColorKeg();
                    from.PlaySound(0x240);
                }
            }
            else
            {
                from.SendLocalizedMessage(502232);                   // The keg is not designed to hold that type of object.
            }
            //Always return false
            return(false);
        }
Exemplo n.º 2
0
		public override bool OnDragDrop( Mobile from, Item item )
		{
			if ( item is BasePotion )
			{
				BasePotion pot = (BasePotion)item;

                if (pot.PotionEffect != m_Type && m_Held != 0)
                    from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions.
                else if (m_Held >= m_MaxAmount)
                    from.SendLocalizedMessage(502233); // The keg will not hold any more!
                else if (pot.Amount > (m_MaxAmount - m_Held))
                    from.SendAsciiMessage("That keg can't contain all those potions!");
                else
                {
                    if ( m_Held == 0)
                    {
                        m_Type = pot.PotionEffect;
                    }

                    int toConsume = m_MaxAmount - m_Held;

                    if (toConsume > pot.Amount)
                        toConsume = pot.Amount;

                    m_Held += toConsume;

                    pot.Consume(toConsume);

                    Bottle emptyBottles = new Bottle(toConsume);

                    if (!from.AddToBackpack(emptyBottles))
                    {
                        from.SendAsciiMessage(string.Format("You are too heavey, you place the bottle{0} on the ground.", emptyBottles.Amount == 1 ? string.Empty : "s"));
                        emptyBottles.MoveToWorld(from.Location);
                    }
                    else
                        from.SendAsciiMessage(string.Format("You place the empty bottle{0} in your backpack.", emptyBottles.Amount == 1 ? string.Empty : "s"));

                    ColorKeg();
                    from.PlaySound(0x240);
                }
			}
			else
				from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object.

            //Always return false
            return false;
        }
Exemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                PlantPigment pigment = targeted as PlantPigment;

                if (null == pigment)
                {
                    from.SendLocalizedMessage(1112124); // You may only mix this with another non-saturated plant pigment.
                    return;
                }

                if (from.Skills[SkillName.Alchemy].Base < 75.0 && from.Skills[SkillName.Cooking].Base < 75.0)
                {
                    from.SendLocalizedMessage(1112214); // You lack the alchemy or cooking skills to mix plant pigments.
                }
                else if ((PlantPigmentHue.White == pigment.PigmentHue || PlantPigmentHue.Black == pigment.PigmentHue ||
                          PlantPigmentHue.White == m_Item.PigmentHue || PlantPigmentHue.Black == m_Item.PigmentHue) &&
                         from.Skills[SkillName.Alchemy].Base < 100.0 &&
                         from.Skills[SkillName.Cooking].Base < 100.0)
                {
                    from.SendLocalizedMessage(1112213); // You lack the alchemy or cooking skills to mix so unstable a pigment.
                }
                else if (m_Item.PigmentHue == pigment.PigmentHue)
                {
                    from.SendLocalizedMessage(1112242); // You decide not to waste pigments by mixing two identical colors.
                }
                else if ((m_Item.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)) ==
                         (pigment.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)))
                {
                    from.SendLocalizedMessage(1112243); // You decide not to waste pigments by mixing variations of the same hue.
                }
                else if ((PlantPigmentHue.White == m_Item.PigmentHue && PlantPigmentHueInfo.IsBright(pigment.PigmentHue)) ||
                         (PlantPigmentHue.White == pigment.PigmentHue && PlantPigmentHueInfo.IsBright(m_Item.PigmentHue)))
                {
                    from.SendLocalizedMessage(1112241); // This pigment is too diluted to be faded further.
                }
                else if (!PlantPigmentHueInfo.IsMixable(pigment.PigmentHue))
                {
                    from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
                }
                else
                {
                    PlantPigmentHue newHue = PlantPigmentHueInfo.Mix(m_Item.PigmentHue, pigment.PigmentHue);
                    if (PlantPigmentHue.None == newHue)
                    {
                        from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
                    }
                    else
                    {
                        pigment.PigmentHue = newHue;
                        Bottle bottle = new Bottle();
                        bottle.MoveToWorld(m_Item.Location, m_Item.Map);
                        m_Item.Delete();
                        from.PlaySound(0x240);
                    }
                }
            }
Exemplo n.º 4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Item.Deleted)
                    return;

                PlantPigment pigment = targeted as PlantPigment;
                if (null == pigment)
                {
                    from.SendLocalizedMessage(1112124); // You may only mix this with another non-saturated plant pigment.
                    return;
                }

                if (from.Skills[SkillName.Alchemy].Base < 75.0 && from.Skills[SkillName.Cooking].Base < 75.0)
                {
                    from.SendLocalizedMessage(1112214); // You lack the alchemy or cooking skills to mix plant pigments.
                }
                else if ((PlantPigmentHue.White == pigment.PigmentHue || PlantPigmentHue.Black == pigment.PigmentHue ||
                          PlantPigmentHue.White == this.m_Item.PigmentHue || PlantPigmentHue.Black == this.m_Item.PigmentHue) &&
                         from.Skills[SkillName.Alchemy].Base < 100.0 &&
                         from.Skills[SkillName.Cooking].Base < 100.0)
                {
                    from.SendLocalizedMessage(1112213); // You lack the alchemy or cooking skills to mix so unstable a pigment.
                }
                else if (this.m_Item.PigmentHue == pigment.PigmentHue)
                {
                    from.SendLocalizedMessage(1112242); // You decide not to waste pigments by mixing two identical colors.
                }
                else if ((this.m_Item.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)) ==
                         (pigment.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)))
                {
                    from.SendLocalizedMessage(1112243); // You decide not to waste pigments by mixing variations of the same hue.
                }
                else if ((PlantPigmentHue.White == this.m_Item.PigmentHue && PlantPigmentHueInfo.IsBright(pigment.PigmentHue)) ||
                         (PlantPigmentHue.White == pigment.PigmentHue && PlantPigmentHueInfo.IsBright(this.m_Item.PigmentHue)))
                {
                    from.SendLocalizedMessage(1112241); // This pigment is too diluted to be faded further.
                }
                else if (!PlantPigmentHueInfo.IsMixable(pigment.PigmentHue))
                    from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
                else
                {
                    PlantPigmentHue newHue = PlantPigmentHueInfo.Mix(this.m_Item.PigmentHue, pigment.PigmentHue);
                    if (PlantPigmentHue.None == newHue)
                        from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
                    else
                    {
                        pigment.PigmentHue = newHue;
                        Bottle bottle = new Bottle();
                        bottle.MoveToWorld(this.m_Item.Location, this.m_Item.Map);
                        this.m_Item.Delete();
                        from.PlaySound(0x240);
                    }
                }
            }
        public override void OnSpeech(SpeechEventArgs e)
        {
            #region Here is the list of Random Words you can use
            string dat_Facet = TalkingNPCsXMLReader.RandomName("dat_Facet");
            string dat_TownRegion = TalkingNPCsXMLReader.RandomName("dat_TownRegion");
            string dat_DungeonRegion = TalkingNPCsXMLReader.RandomName("dat_DungeonRegion");
            string dat_NoHousingRegion = TalkingNPCsXMLReader.RandomName("dat_NoHousingRegion");
            string dat_Other = TalkingNPCsXMLReader.RandomName("dat_Other");
            string dat_Shrine = TalkingNPCsXMLReader.RandomName("dat_Shrine");
            string dat_article1 = TalkingNPCsXMLReader.RandomName("dat_article");
            string dat_article2 = TalkingNPCsXMLReader.RandomName("dat_article");
            string dat_noun1 = TalkingNPCsXMLReader.RandomName("dat_noun");
            string dat_noun2 = TalkingNPCsXMLReader.RandomName("dat_noun");
            string dat_noun3 = TalkingNPCsXMLReader.RandomName("dat_noun");
            string dat_noun4 = TalkingNPCsXMLReader.RandomName("dat_noun");
            string dat_verb1 = TalkingNPCsXMLReader.RandomName("dat_verb");
            string dat_verb2 = TalkingNPCsXMLReader.RandomName("dat_verb");
            string dat_verbing1 = TalkingNPCsXMLReader.RandomName("dat_verbing");
            string dat_verbing2 = TalkingNPCsXMLReader.RandomName("dat_verbing");
            string dat_verb3rd1 = TalkingNPCsXMLReader.RandomName("dat_verb3rd");
            string dat_verb3rd2 = TalkingNPCsXMLReader.RandomName("dat_verb3rd");
            string dat_verbed1 = TalkingNPCsXMLReader.RandomName("dat_verbed");
            string dat_verbed2 = TalkingNPCsXMLReader.RandomName("dat_verbed");
            string dat_preposition1 = TalkingNPCsXMLReader.RandomName("dat_preposition");
            string dat_preposition2 = TalkingNPCsXMLReader.RandomName("dat_preposition");
            string dat_adj1 = TalkingNPCsXMLReader.RandomName("dat_adj");
            string dat_adj2 = TalkingNPCsXMLReader.RandomName("dat_adj");
            string dat_Greeting = TalkingNPCsXMLReader.RandomName("dat_Greeting");
            string dat_Language1 = TalkingNPCsXMLReader.RandomName("dat_Language");
            string dat_Language2 = TalkingNPCsXMLReader.RandomName("dat_Language");
            string dat_Language3 = TalkingNPCsXMLReader.RandomName("dat_Language");
            string dat_Armor = TalkingNPCsXMLReader.RandomName("dat_Armor");
            string dat_Creature1 = TalkingNPCsXMLReader.RandomName("dat_Creature");
            string dat_Creature2 = TalkingNPCsXMLReader.RandomName("dat_Creature");
            string dat_Room1 = TalkingNPCsXMLReader.RandomName("dat_Room");
            string dat_Room2 = TalkingNPCsXMLReader.RandomName("dat_Room");
            string dat_Furniture1 = TalkingNPCsXMLReader.RandomName("dat_Furniture");
            string dat_Furniture2 = TalkingNPCsXMLReader.RandomName("dat_Furniture");
            string dat_Liquid1 = TalkingNPCsXMLReader.RandomName("dat_Liquid");
            string dat_Number1 = TalkingNPCsXMLReader.RandomName("dat_Number");
            string dat_PlayingCards = TalkingNPCsXMLReader.RandomName("dat_PlayingCards");
            string dat_MinocShop = TalkingNPCsXMLReader.RandomName("dat_MinocShop");
            string dat_MinocShopQuestItem = TalkingNPCsXMLReader.RandomName("dat_MinocShopQuestItem");
            #endregion

            string playername = e.Mobile.Name;
            string speech = e.Speech.ToLower();

            #region Player says "Hi"
            for (int i = 0; i < Greetings.Length; i++)
                if (speech == Greetings[i])
                {
                    switch (Utility.Random(4))  //picks one of the following
                    {
                        case 0:
                            { Say(String.Format("{0} {1}, I am {2} a {3} do you want to assist?", dat_Greeting, playername, dat_verb1, dat_Creature1)); break; }
                        case 1:
                            { Say(String.Format("That {0} bottle. Oh, {1} {2}!", dat_adj1, dat_Greeting, playername)); break; }
                        case 2:
                            { Say(String.Format("{0}{1} are so..ah, uhm. {2} {3}", dat_adj1, dat_Creature1, dat_Greeting, playername)); break; }
                        case 3:
                            { Say(String.Format("{0} {1} {2}, AGH! My spell! {3} you are so distracting.", dat_Language1, dat_Language2, dat_Language3, playername)); break; }
                    }
                }
            #endregion

            #region Player says "Yes" or some other response
            for (int i = 0; i < Response.Length; i++)
                if (speech == Response[i])
                {
                    if (m_ItemHasBeenReturned == true)
                    {
                        switch (Utility.Random(4))  //picks one of the following
                        {
                            case 0:
                                {
                                    Say(String.Format("{0} help me find my {1} bottle.  It should be around here somewhere, just hand it to me.", playername, dat_noun1));
                                    break;
                                }
                            case 1:
                                {
                                    dat_article1 = char.ToUpper(dat_article1[0]) + dat_article1.Substring(1);
                                    Say(String.Format("{0} somewhere around here I have a {1} bottle.", playername, dat_noun1));
                                    break;
                                }
                            case 2:
                                {
                                    dat_article1 = char.ToUpper(dat_article1[0]) + dat_article1.Substring(1);
                                    Say(String.Format("I am {0} a {1} potion and need my {2} bottle.", dat_verb1, dat_adj1, dat_noun1));
                                    break;
                                }
                            case 3:
                                {
                                    dat_article1 = char.ToUpper(dat_article1[0]) + dat_article1.Substring(1);
                                    Say(String.Format("Maybe some blood of {0} would work.  No I need a bottle of {1}.", dat_Creature1, dat_noun1));
                                    break;
                                }
                        }


                        //Choose Item Location
                        int x = Location.X + Utility.RandomMinMax(-5, 5);
                        int y = Location.Y + Utility.RandomMinMax(-5, 5);
                        int z = Map.GetAverageZ(x, y);

                        if (Map.CanFit(x, y, Location.Z, 1))
                        {
                            Item item = new Bottle();
                            item.Name = String.Format("{0} bottle", dat_noun1);
                            item.MoveToWorld(new Point3D(x, y, Location.Z), Map);
                            m_ItemHasBeenReturned = false;
                            ProfessorItemTimer t = new ProfessorItemTimer();
                            t.Start();
                        }
                        else if (Map.CanFit(x, y, z, 1))
                        {
                            Item item = new Bottle();
                            item.Name = String.Format("{0} bottle", dat_noun1);
                            item.MoveToWorld(new Point3D(x, y, z), Map);
                            m_ItemHasBeenReturned = false;
                            ProfessorItemTimer t = new ProfessorItemTimer();
                            t.Start();
                        }
                    }
                    else
                    {
                        Say(String.Format("A bottle, {0} or {1}.  Hurry any bottle will due!", dat_adj1, dat_noun1));
                    }
                }
            #endregion
        }