public override void Drink(Mobile from) { if (from.Stam < from.StamMax) { from.Stam += Scale(from, (int)(Refresh * from.StamMax)); BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from)) { this.Consume(); } } else { from.SendMessage("You decide against drinking this potion, as you are already at full stamina."); } }
public override void Drink(Mobile from) { if (from.BeginAction(typeof(LightCycle))) { new LightCycle.NightSightTimer(from).Start(); from.LightLevel = LightCycle.DungeonLevel / 2; from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist); from.PlaySound(0x1E3); BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from)) { this.Consume(); } } else { from.SendMessage("You already have nightsight."); } }
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 (toHold <= 0) { from.SendLocalizedMessage(502233); // The keg will not hold any more! return(false); } else if (m_Held == 0) { #region Mondain's Legacy if ((int)pot.PotionEffect >= (int)PotionEffect.Invisibility) { from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object. return(false); } #endregion 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); } }