Beispiel #1
0
        public static Item GetPotion(Mobile from, PotionEffect[] effects)
        {
            if (from.Backpack == null)
                return null;

            Item[] items = from.Backpack.FindItemsByType(new Type[] { typeof(BasePotion), typeof(PotionKeg) });

            foreach (Item item in items)
            {
                if (item is BasePotion)
                {
                    BasePotion potion = (BasePotion)item;

                    if (Array.IndexOf(effects, potion.PotionEffect) >= 0)
                        return potion;
                }
                else
                {
                    PotionKeg keg = (PotionKeg)item;

                    if (keg.Held > 0 && Array.IndexOf(effects, keg.Type) >= 0)
                        return keg;
                }
            }

            return null;
        }
		public BasePotion( int itemID, PotionEffect effect ) : base( itemID )
		{
			m_PotionEffect = effect;

			Stackable = Core.ML;
			Weight = 1.0;
		}
Beispiel #3
0
		public BasePotion( int itemID, PotionEffect effect ) : base( itemID )
		{
			m_PotionEffect = effect;

            //Stackable = Core.ML;
		    Stackable = true;
			Weight = 0.25;
		}
Beispiel #4
0
        public BasePotion( int itemID, PotionEffect effect )
            : base(itemID)
        {
            m_PotionEffect = effect;

            Stackable = true;
            Weight = 2.0;
        }
Beispiel #5
0
        public BasePotion(int itemID, PotionEffect effect)
            : base(itemID)
        {
            this.m_PotionEffect = effect;

            this.Stackable = Core.ML;
            this.Weight = 1.0;
        }
Beispiel #6
0
		public BasePotion( int itemID, PotionEffect effect ) : base( itemID )
		{
			m_PotionEffect = effect;

			Stackable = Core.ML;
			Weight = 1.0;

			ItemValue = ItemValue.Common;
		}
Beispiel #7
0
        public BasePotion( int itemID, PotionEffect effect )
            : base(itemID)
        {
            m_PotionEffect = effect;
            m_Tasters = new ArrayList();

            Stackable = false;
            Weight = 1.0;
        }
		private static Item MakePotionKeg( PotionEffect type, int hue )
		{
			PotionKeg keg = new PotionKeg();

			keg.Held = 100;
			keg.Type = type;
			keg.Hue = hue;

			return MakeNewbie( keg );
		}
Beispiel #9
0
		private Item MakePotionKeg(PotionEffect type, int hue)
		{
			PotionKeg keg = new PotionKeg();

			keg.Held = 100;
			keg.Type = type;
			keg.Hue = hue;

			return keg;
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Type = (PotionEffect)reader.ReadInt();
					m_Held = reader.ReadInt();

					break;
				}
			}
		}
Beispiel #11
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch( version )
			{
				case 1:
				case 0:
					{
						m_Type = (PotionEffect)reader.ReadInt();
						m_Held = reader.ReadInt();

						break;
					}
			}

			if( version < 1 )
				Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateWeight ) );
		}
Beispiel #12
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_PotionEffect = (PotionEffect)reader.ReadInt();
                break;
            }
            }

            if (version == 0)
            {
                Stackable = Core.ML;
            }
        }
Beispiel #13
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_Type = (PotionEffect)reader.ReadInt();
                m_Held = reader.ReadInt();

                break;
            }
            }
            if (version < 1)
            {
                Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateWeight));
            }
        }
Beispiel #14
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_PotionEffect = (PotionEffect)reader.ReadInt();
                break;
            }
            }

            if (Weight != 2.0)
            {
                Weight = 2.0;
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            //Version 0
            if (version > 0)
            {
                m_Type = (PotionEffect)reader.ReadInt();
                Held   = reader.ReadInt();
            }

            //Version 1

            //Version 2
            if (version >= 2)
            {
                m_MaxHeld      = reader.ReadInt();
                IsPotionBarrel = reader.ReadBool();
            }
        }
Beispiel #16
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.name == "Player")
     {
         Destroy(this.gameObject);
         if (PauseMenuScript.ctrlScript.gameRunning)
         {
             if (ManaBarScript.maxMana < ManaBarScript.mana + gain)
             {
                 float currentGain = ManaBarScript.maxMana - ManaBarScript.mana;
                 GameController.ShowTextEffect(currentGain, text, col.transform);
                 ManaBarScript.mana += currentGain;
             }
             else
             {
                 GameController.ShowTextEffect(gain, text, col.transform);
                 ManaBarScript.mana += gain;
             }
             PotionEffect.ActivateEffect(col.transform, manaEffect);
         }
     }
 }
Beispiel #17
0
 private void completePotion(PotionName p)
 {
     switch(p) {
     case PotionName.None:
         itemName = "Empty";
         itemDescription = "Empty";
         weight = 0;
         value = 0;
         potionEffect = PotionEffect.None;
         potency = 0;
         break;
     case PotionName.Health:
         itemName = "Health Potion";
         itemDescription = "";
         weight = 1;
         value = 1;
         potionEffect = PotionEffect.Health;
         potency = 4;
         break;
     case PotionName.Strength:
         itemName = "Strength Potion";
         itemDescription = "";
         weight = 1;
         value = 1;
         potionEffect = PotionEffect.Strength;
         potency = 4;
         break;
     case PotionName.Dexterity:
         itemName = "Dexterity Potion";
         itemDescription = "";
         weight = 1;
         value = 1;
         potionEffect = PotionEffect.Dexterity;
         potency = 4;
         break;
     default:
         break;
     }
 }
Beispiel #18
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_PotionEffect = (PotionEffect)reader.ReadInt();
                m_Poisoner     = reader.ReadMobile();
                m_Poison       = Poison.Deserialize(reader);
                break;
            }
            }

            if (version == 0)
            {
                Stackable = false;
            }
        }
Beispiel #19
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_Type  = (PotionEffect)reader.ReadInt();
                m_Held  = reader.ReadInt();
                m_Level = (SecureLevel)reader.ReadInt();                                 //RedemptionUO Original value remove line

                break;
            }
            }

            if (version < 1)
            {
                Timer.DelayCall(TimeSpan.Zero, UpdateWeight);
            }
        }
Beispiel #20
0
        public static EodonPotionContext GetContext(Mobile m, PotionEffect effect)
        {
            if (m == null)
            {
                return(null);
            }

            if (Contexts == null || !Contexts.ContainsKey(m) || Contexts[m] == null)
            {
                return(null);
            }

            for (var index = 0; index < Contexts[m].Count; index++)
            {
                var c = Contexts[m][index];

                if (c.Type == effect)
                {
                    return(c);
                }
            }

            return(null);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_TypeName = reader.ReadString();

                goto case 0;
            }

            case 0:
            {
                m_Type = (PotionEffect)reader.ReadInt();
                m_Held = reader.ReadInt();

                break;
            }
            }
        }
Beispiel #22
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_PotionEffect = (PotionEffect)reader.ReadInt();
                break;
            }

            case 1:
            {
                if (reader.ReadBool())
                {
                    m_Tasters = reader.ReadMobileList();
                }
                goto case 0;
            }
            }
        }
Beispiel #23
0
 public EodonianPotion(int id, PotionEffect effect)
     : base(id, effect)
 {
 }
Beispiel #24
0
 public static bool IsUnderEffects(Mobile m, PotionEffect effect)
 {
     return(GetContext(m, effect) != null);
 }
Beispiel #25
0
 public static void RemoveContext(Mobile m, PotionEffect effect)
 {
     RemoveContext(m, GetContext(m, effect));
 }
Beispiel #26
0
 public BaseExplosionPotion( PotionEffect effect )
     : base(0xF0D, effect)
 {
 }
Beispiel #27
0
        public bool ApplyPotion(PotionEffect effect, bool testOnly, out int message)
        {
            if (m_PlantStatus >= PlantStatus.DecorativePlant)
            {
                message = 1053049;                 // This is a decorative plant, it does not need watering!
                return(false);
            }

            if (m_PlantStatus == PlantStatus.BowlOfDirt)
            {
                message = 1053066;                 // You should only pour potions on a plant or seed!
                return(false);
            }

            bool full = false;

            if (effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly)
            {
                if (m_PlantSystem.IsFullPoisonPotion)
                {
                    full = true;
                }
                else if (!testOnly)
                {
                    m_PlantSystem.PoisonPotion++;
                }
            }
            else if (effect == PotionEffect.CureGreater)
            {
                if (m_PlantSystem.IsFullCurePotion)
                {
                    full = true;
                }
                else if (!testOnly)
                {
                    m_PlantSystem.CurePotion++;
                }
            }
            else if (effect == PotionEffect.HealGreater)
            {
                if (m_PlantSystem.IsFullHealPotion)
                {
                    full = true;
                }
                else if (!testOnly)
                {
                    m_PlantSystem.HealPotion++;
                }
            }
            else if (effect == PotionEffect.StrengthGreater)
            {
                if (m_PlantSystem.IsFullStrengthPotion)
                {
                    full = true;
                }
                else if (!testOnly)
                {
                    m_PlantSystem.StrengthPotion++;
                }
            }
            else if (effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure ||
                     effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength)
            {
                message = 1053068;                 // This potion is not powerful enough to use on a plant!
                return(false);
            }
            else
            {
                message = 1053069;                 // You can't use that on a plant!
                return(false);
            }

            if (full)
            {
                message = 1053065;                 // The plant is already soaked with this type of potion!
                return(false);
            }
            else
            {
                message = 1053067;                 // You pour the potion over the plant.
                return(true);
            }
        }
		private const int   ExplosionRange   = 2;     // How long is the blast radius?

		public BaseFragmentationPotion( PotionEffect effect ) : base( 0xF0D, effect )
		{
		}
 public BaseShatterPotion(PotionEffect effect) : base(0xF0D, effect)
 {
 }
Beispiel #30
0
 public BaseExplodingTarPotion(PotionEffect effect) : base(0xF06, effect)
 {
     Hue = 1109;
 }
Beispiel #31
0
        public override bool OnDragDrop(Mobile from, Item item)
        {
            if (item is BasePotion)
            {
                BasePotion pot    = (BasePotion)item;
                int        toHold = Math.Min(100 - m_Held, pot.Amount);

                if (pot.PotionEffect == PotionEffect.Darkglow || pot.PotionEffect == PotionEffect.Parasitic)
                {
                    from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object.
                    return(false);
                }
                else if (toHold <= 0)
                {
                    from.SendLocalizedMessage(502233); // The keg will not hold any more!
                    return(false);
                }
                else if (m_Held == 0)
                {
                    if (GiveBottle(from, toHold))
                    {
                        m_Type = pot.PotionEffect;
                        Held   = toHold;

                        from.PlaySound(0x240);

                        from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack.

                        item.Consume(toHold);

                        if (!item.Deleted)
                        {
                            item.Bounce(from);
                        }

                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack.
                        return(false);
                    }
                }
                else if (pot.PotionEffect != m_Type)
                {
                    from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions.
                    return(false);
                }
                else
                {
                    if (GiveBottle(from, toHold))
                    {
                        Held += toHold;

                        from.PlaySound(0x240);

                        from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack.

                        item.Consume(toHold);

                        if (!item.Deleted)
                        {
                            item.Bounce(from);
                        }

                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack.
                        return(false);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object.
                return(false);
            }
        }
Beispiel #32
0
 public BaseMixture(PotionEffect p) : base(0x1FDB, p)
 {
 }
Beispiel #33
0
 public BaseCurePotion( PotionEffect effect )
     : base(0xF07, effect)
 {
 }
Beispiel #34
0
 public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect)
 {
 }
Beispiel #35
0
		public BaseRefreshPotion( PotionEffect effect ) : base( 0xF0B, effect )
		{
		}
Beispiel #36
0
 public BaseCurePotion(PotionEffect effect)
     : base(0xF07, effect)
 {
 }
		public BaseStrengthPotion( PotionEffect effect ) : base( 0xF09, effect )
		{
		}
Beispiel #38
0
 public BasePoisonPotion(PotionEffect effect)
     : base(0xF0A, effect)
 {
 }
		public BaseManaRefreshPotion( PotionEffect effect ) : base( 0xF0D, effect )
		{
			Hue = 1072;
		}
 public BaseLethargyPotion(PotionEffect effect) : base(0xE24, effect)
 {
     Hue = 1278;
 }
Beispiel #41
0
 public BaseHealPotion(PotionEffect effect) : base(0xF0C, effect)
 {
 }
Beispiel #42
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;
        }
Beispiel #43
0
		public bool ApplyPotion( PotionEffect effect, bool testOnly, out string message )
		{

			bool full = false;

			if ( effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly )
			{
				if ( IsFullPoisonPotion )
					full = true;
				else if ( !testOnly )
					potPoison++;
			}
			else if ( effect == PotionEffect.CureGreater )
			{
				if ( IsFullCurePotion )
					full = true;
				else if ( !testOnly )
					potCure++;
			}
			else if ( effect == PotionEffect.HealGreater )
			{
				if ( IsFullHealPotion )
					full = true;
				else if ( !testOnly )
					potHeal++;
			}
			else if ( effect == PotionEffect.StrengthGreater )
			{
				if ( IsFullStrengthPotion )
					full = true;
				else if ( !testOnly )
					potStrength++;
			}
			else if (effect == PotionEffect.AgilityGreater )
			{
				if ( IsFullAgilityPotion )
					full = true;
				else if ( !testOnly )
					potAgility++;
			}
			else if ( effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure ||
				effect == PotionEffect.HealLesser || effect == PotionEffect.Heal ||	effect == PotionEffect.Strength )
			{
				message = "This potion is not powerful enough to use on a beehive!";
				return false;
			}
			else
			{
				message = "You cannot use that on a beehive!";
				return false;
			}

			if ( full )
			{
				message = "The beehive is already soaked with this type of potion!";
				return false;
			}
			else
			{
				message = "You pour the potion into the beehive.";
				return true;
			}
		}
        private const int ExplosionRange = 5;     // How long is the blast radius?

        public BaseZombieKillerPotion(PotionEffect effect)
            : base(0xF0D, effect)
        {
        }
Beispiel #45
0
        public override bool OnDragDrop( Mobile from, Item item )
        {
            if ( item is BasePotion )
            {
                BasePotion pot = (BasePotion)item;

                if ( m_Held == 0 )
                {
                    if ( GiveBottle( from ) )
                    {
                        m_Type = pot.PotionEffect;
                        Held = 1;

                        from.PlaySound( 0x240 );

                        from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.

                        item.Delete();
                        return true;
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
                        return false;
                    }
                }
                else if ( pot.PotionEffect != m_Type )
                {
                    from.SendLocalizedMessage( 502236 ); // You decide that it would be a bad idea to mix different types of potions.
                    return false;
                }
                else if ( m_Held >= 100 )
                {
                    from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!
                    return false;
                }
                else
                {
                    if ( GiveBottle( from ) )
                    {
                        ++Held;
                        item.Delete();

                        from.PlaySound( 0x240 );

                        from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.

                        item.Delete();
                        return true;
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
                        return false;
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object.
                return false;
            }
        }
Beispiel #46
0
 public BaseHealPotion(PotionEffect effect)
     : base(0xF0C, effect)
 {
 }
Beispiel #47
0
 public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect)
 {
     Hue = 0x489;
 }
		//master constructor: set up type, a name, an amount, and size/offset of artwork
		public PotionEntry( Type type, string name, int amount, int height, int x, int y ) : base( type, new Type[]{ typeof( PotionKeg ) }, name, amount, height, x, y )
		{
			try
			{
				BasePotion potion = (BasePotion)Activator.CreateInstance( type );
				
				_Effect = potion.PotionEffect;
				
				potion.Delete();
			}
			catch
			{
			}
		}
Beispiel #49
0
		{
		}

		public BaseRefreshPotion( Serial serial ) : base( serial )
		public override void Deserialize( GenericReader reader )
		{
			//handle base StoreEntry deserialization first
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			switch( version )
			{
				case 0:
				default:
				{
					_Effect = (PotionEffect)reader.ReadInt();
					break;
				}
				
			}
			
		}//deserialize		
 public BaseConflagrationPotion( PotionEffect effect )
     : base(0xF06, effect)
 {
     Hue = 0x489;
 }
Beispiel #52
0
 public BaseAgilityPotion(PotionEffect effect)
     : base(0xF08, effect)
 {
 }
Beispiel #53
0
 public BaseStrengthPotion(PotionEffect effect) : base(0xF09, effect)
 {
 }
 public BaseManaRefreshPotion(PotionEffect effect) : base(0xF0D, effect)
 {
     Hue = 1072;
 }
Beispiel #55
0
        public bool ApplyPotion( PotionEffect effect, bool testOnly, out int message )
        {
            if ( m_PlantStatus >= PlantStatus.DecorativePlant )
            {
                message = 1053049; // This is a decorative plant, it does not need watering!
                return false;
            }

            if ( m_PlantStatus == PlantStatus.BowlOfDirt )
            {
                message = 1053066; // You should only pour potions on a plant or seed!
                return false;
            }

            bool full = false;

            if ( effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly )
            {
                if ( m_PlantSystem.IsFullPoisonPotion )
                {
                    full = true;
                }
                else if ( !testOnly )
                {
                    m_PlantSystem.PoisonPotion++;
                }
            }
            else if ( effect == PotionEffect.CureGreater )
            {
                if ( m_PlantSystem.IsFullCurePotion )
                {
                    full = true;
                }
                else if ( !testOnly )
                {
                    m_PlantSystem.CurePotion++;
                }
            }
            else if ( effect == PotionEffect.HealGreater )
            {
                if ( m_PlantSystem.IsFullHealPotion )
                {
                    full = true;
                }
                else if ( !testOnly )
                {
                    m_PlantSystem.HealPotion++;
                }
            }
            else if ( effect == PotionEffect.StrengthGreater )
            {
                if ( m_PlantSystem.IsFullStrengthPotion )
                {
                    full = true;
                }
                else if ( !testOnly )
                {
                    m_PlantSystem.StrengthPotion++;
                }
            }
            else if ( effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure || effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength )
            {
                message = 1053068; // This potion is not powerful enough to use on a plant!
                return false;
            }
            else
            {
                message = 1053069; // You can't use that on a plant!
                return false;
            }

            if ( full )
            {
                message = 1053065; // The plant is already soaked with this type of potion!
                return false;
            }
            else
            {
                message = 1053067; // You pour the potion over the plant.
                return true;
            }
        }
		public BaseAgilityPotion( PotionEffect effect ) : base( 0xF08, effect )
		{
		}
Beispiel #57
0
 public BaseConfusionBlastPotion(PotionEffect effect)
     : base(0xF06, effect)
 {
     Hue = 0x48D;
 }
        public override bool OnDragDrop(Mobile from, Item item)
        {
            if (item is BasePotion)
            {
                BasePotion pot = (BasePotion)item;

                if (m_Held == 0)
                {
                    if (GiveBottle(from))
                    {
                        m_Type = pot.PotionEffect;
                        Held   = 1;

                        from.PlaySound(0x240);

                        from.SendLocalizedMessage(502237);                           // You place the empty bottle in your backpack.

                        item.Delete();
                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502238);                           // You don't have room for the empty bottle in your backpack.
                        return(false);
                    }
                }
                else if (pot.PotionEffect != m_Type)
                {
                    from.SendLocalizedMessage(502236);                       // You decide that it would be a bad idea to mix different types of potions.
                    return(false);
                }
                else if (m_Held >= 100)
                {
                    from.SendLocalizedMessage(502233);                       // The keg will not hold any more!
                    return(false);
                }
                else
                {
                    if (GiveBottle(from))
                    {
                        ++Held;
                        item.Delete();

                        from.PlaySound(0x240);

                        from.SendLocalizedMessage(502237);                           // You place the empty bottle in your backpack.

                        item.Delete();
                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502238);                           // You don't have room for the empty bottle in your backpack.
                        return(false);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(502232);                   // The keg is not designed to hold that type of object.
                return(false);
            }
        }
 public BaseExplosionPotion(PotionEffect effect)
     : base(0xF0D, effect)
 {
 }
Beispiel #60
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				case 0:
				{
					m_PotionEffect = (PotionEffect)reader.ReadInt();
					break;
				}
			}

			if( version ==  0 )
				Stackable = Core.ML;
		}