public override void Drink(Mobile from) { if (from.Hits < from.HitsMax) { if (from.Poisoned || MortalStrike.IsWounded(from)) { from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000); // You can not heal yourself in your current state. } else { if (from.BeginAction(typeof(BaseHealPotion))) { //Plume : Addiction if (from is PlayerMobile) { PlayerMobile drinker = from as PlayerMobile; double Addiction = drinker.CalculateHealAddiction(this); if (Addiction > 100) { drinker.SendMessage("Votre corps ne supporte plus ce traitement"); drinker.Poison = Poison.Lesser; } else { double HealScalar = Addiction / 100 * 0.95; DoHeal(from, HealScalar); } drinker.IncAddiction(this); } else { DoHeal(from); } BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from)) { this.Consume(); } Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseHealLock), from); } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion. } } } else { from.SendLocalizedMessage(1049547); // You decide against drinking this potion, as you are already at full health. } }
public override void Drink(Mobile from) { if (from.BeginAction(typeof(LightCycle))) { m_Time = IntensifiedTime ? 45 : 20; //Plume : Addiction if (from is PlayerMobile) { PlayerMobile drinker = from as PlayerMobile; double Addiction = drinker.CalculateHealAddiction(this); if (Addiction > 100) { drinker.SendMessage("Votre corps ne supporte plus ce traitement"); drinker.Poison = Poison.Lesser; drinker.Hunger = 0; } m_Time -= drinker.CalculateNightSightAddiction(this); } new LightCycle.PotionNightSightTimer(from, this).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."); } }