public override void OnDoubleClick(Mobile from) { if (from.InRange(GetWorldLocation(), 2)) { if (m_Held > 0) { Container pack = from.Backpack; if (pack != null && pack.ConsumeTotal(typeof(Bottle), 1)) { from.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle... BasePotion pot = FillBottle(); if (pack.TryDropItem(from, pot, false)) { from.SendLocalizedMessage(502243); // ...and place it into your backpack. from.PlaySound(0x240); if (--Held == 0) { from.SendLocalizedMessage(502245); // The keg is now empty. } } else { from.SendLocalizedMessage(502244); // ...but there is no room for the bottle in your backpack. pot.Delete(); } } else { // TODO: Target a bottle } } else { from.SendLocalizedMessage(502246); // The keg is empty. } } else { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } }
public override void OnDoubleClick(Mobile from) { if (!Movable) { return; } if (from.InRange(GetWorldLocation(), 1)) { if (!RequireFreeHand || HasFreeHand(from)) { if (this is BaseExplosionPotion && Amount > 1) { BasePotion pot = (BasePotion)Activator.CreateInstance(GetType()); if (pot != null) { Amount--; if (from.Backpack != null && !from.Backpack.Deleted) { from.Backpack.DropItem(pot); } else { pot.MoveToWorld(from.Location, from.Map); } pot.Drink(from); } } else { Drink(from); } } else { from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion. } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
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.Poisoned) { DoCure(from); BasePotion.PlayDrinkEffect(from); from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); from.PlaySound(0x1E0); this.Consume(); } else { from.SendLocalizedMessage(1042000); // You are not poisoned. } }
public override void Drink(Mobile from) { PlayerMobile pm = from as PlayerMobile; if (pm.Level >= RequiredLevel) { if (DoAgility(from)) { BasePotion.PlayDrinkEffect(from); this.Consume(); } } else { from.SendMessage("Your level isn't high enough to use this potion."); } }
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(); } }
public override bool Drink(Mobile from) { if (DoStrength(from)) { CustomRegion region1 = from.Region as CustomRegion; BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from))) { this.Consume(); } return(true); } return(false); }
public override void OnDoubleClick(Mobile from) { if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from)) { from.SendLocalizedMessage(1063299); // You must have a free hand to throw shuriken. return; } if (UsesRemaining > 0) { InternalTarget t = new InternalTarget(this); from.Target = t; } else { from.SendLocalizedMessage(1063297); // You have no shuriken in your ninja belt! } }
public override void Drink(Mobile from) { if (from.BeginAction(typeof(LightCycle))) { new LightCycle.NightSightTimer(from).Start(); from.LightLevel = Math.Abs(LightCycle.DungeonLevel / 2); from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist); from.PlaySound(0x1E3); BasePotion.PlayDrinkEffect(from); this.Delete(); } else { from.SendMessage("You already have nightsight."); } }
public override void Drink(Mobile from) { if (from.BeginAction(typeof(BaseHealPotion))) { from.AddSkillMod(new TimedSkillMod(SkillName.Herding, true, 25.0, TimeSpan.FromMinutes(5.0))); from.SendMessage("You have gained a major temporary boost to your Herding skill."); BasePotion.PlayDrinkEffect(from); from.PlaySound(0x5C8); this.Delete(); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(ReleaseHealLock), from); } else { from.SendMessage("You must wait 5 minutes before using another potion of this caliber."); } }
public override void Drink(Mobile from) { from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist); from.PlaySound(0x1E3); BasePotion.PlayDrinkEffect(from); if (from.Female == this.Female) { from.SendMessage("Vous buvez le tout et attendez... vous pourriez attendre très longtemps..."); this.Delete(); from.AddToBackpack(new AlchemyVial()); return; } from.Female = this.Female; from.Say("*Lâche la potion, une grimace de douleur défigurant son visage*"); this.Delete(); }
public override void Drink(Mobile from) { from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist); from.PlaySound(0x1E3); BasePotion.PlayDrinkEffect(from); from.BodyValue = 0x51; if (from.Female) { from.SendMessage("Trouvez-vous un Prince"); } else { from.SendMessage("Trouvez-vous une Princesse"); } from.Say("*Lâche la potion, une grimace de douleur défigurant son visage*"); this.Delete(); }
public override bool Drink(Mobile from) { if (from.Hits < from.HitsMax) { if (from.Poisoned && !from.IsT2A || MortalStrike.IsWounded(from)) { from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000); // You can not heal yourself in your current state. return(false); } else { if (from.BeginAction(typeof(BaseHealPotion))) { CustomRegion region1 = from.Region as CustomRegion; DoHeal(from); BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from))) { this.Consume(); } Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(Delay), new TimerStateCallback <Mobile>(ReleaseHealLock), from); } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion. return(false); } } } else { from.SendLocalizedMessage(1049547); // You decide against drinking this potion, as you are already at full health. return(false); } return(true); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is Bottle) { Bottle bottle = targeted as Bottle; Container pack = from.Backpack; from.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle... BasePotion pot = m_Keg.FillBottle(); if (pack.TryDropItem(from, pot, false)) { from.SendLocalizedMessage(502243); // ...and place it into your backpack. from.PlaySound(0x240); if (--m_Keg.Held == 0) { from.SendLocalizedMessage(502245); // The keg is now empty. } else { m_Keg.Unknown = false; } bottle.Consume(); } else { from.SendLocalizedMessage(502244); // ...but there is no room for the bottle in your backpack. from.SendLocalizedMessage(502217); // Nothing comes out of the tap! pot.Delete(); } } else { from.SendLocalizedMessage(502227); // That cannot be used to hold a potion. } }
public override void Drink(Mobile from) { PlayerMobile pm = from as PlayerMobile; if (from.Mana < from.ManaMax) { if (pm.Level >= RequiredLevel) { 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))) { DoHeal(from); BasePotion.PlayDrinkEffect(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.SendMessage("Your level isn't high enough to use this 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 ( TransformationSpellHelper.UnderTransformation( from, typeof( Spells.VampiricEmbraceSpell ) ) ) * { * from.SendLocalizedMessage( 1061652 ); // The garlic in the potion would surely kill you. * }*/ if (from.Poisoned) { DoCure(from); BasePotion.PlayDrinkEffect(from); Effects.SendTargetParticles(from, 0x373A, 10, 15, 5012, EffectLayer.Waist); from.PlaySound(0x1E0); this.Consume(); } else { from.SendLocalizedMessage(1042000); // You are not poisoned. } }
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."); } }
public override void Drink(Mobile from) { if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell))) { from.SendLocalizedMessage(1061652); // The garlic in the potion would surely kill you. } else if (from.Poisoned) { DoCure(from); BasePotion.PlayDrinkEffect(from); from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); from.PlaySound(0x1E0); this.Consume(); } else { from.SendAsciiMessage("You are not poisoned."); // You are not poisoned. } }
public override bool Drink(Mobile from) { if (from.Stam < from.StamMax) { CustomRegion region1 = from.Region as CustomRegion; from.Stam += Scale(from, (int)(Refresh * from.StamMax)); BasePotion.PlayDrinkEffect(from); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from))) { this.Consume(); } } else { from.SendMessage("You decide against drinking this potion, as you are already at full stamina."); return(false); } return(true); }
public override void Drink(Mobile from) { if (from.Mana < from.ManaMax) { if (from.BeginAction(typeof(BaseManaRefreshPotion))) { DoMana(from); BasePotion.PlayDrinkEffect(from); this.Consume(); Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseManaLock), from); } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait 10 seconds before using another mana potion."); } } else { from.SendMessage("You decide against drinking this potion, as you are already at full mana."); } }
public override void Drink(Mobile from) { if (from.RawDex > 10) { if (from.BeginAction(typeof(BaseLethargyPotion))) { DoStatLoss(from); BasePotion.PlayDrinkEffect(from); this.Consume(); new DelayTimer(from).Start(); } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait for your body to adjust to the potion."); } } else { from.SendMessage("You decide against drinking this potion, as you are already fairly slow."); } }
public override void Drink(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.CanDrink(PEffect)) { BasePotion.PlayDrinkEffect(from); this.Consume(); m_Player.SendMessage("You take a sip of the potion..."); TimerHelper m_TimerHelper = new TimerHelper((int)m_Player.Serial); m_TimerHelper.Potion = PEffect; m_TimerHelper.Duration = Scale(from, Duration); m_TimerHelper.Start(); m_Player.SetActivePotions(PEffect, true); } else { m_Player.SendMessage("You can't drink this now."); } }
public override void Drink(Mobile from) { if (from.Hits < from.HitsMax) { if (from.BeginAction(typeof(BaseHealPotion))) { DoHeal(from); BasePotion.PlayDrinkEffect(from); this.Delete(); Timer.DelayCall(TimeSpan.FromSeconds(10.0), 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.Mana < from.ManaMax) { if (from.BeginAction(typeof(BaseManaRefreshPotion))) { from.Mana += Scale(from, (int)(Refresh * from.ManaMax)); BasePotion.PlayDrinkEffect(from); Delete(); Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(20.0), new TimerStateCallback <Mobile>(ReleaseManaLock), from); } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, false, "You must wait 20 seconds before using another mana refresh potion."); } } else { from.SendMessage("You decide against drinking this potion, as you already have full mana."); } }
public double CalculateCureAddiction(BasePotion potion) { if (Addiction == null) Addiction = new double[Enum.GetValues(typeof(PotionEffect)).Length]; double CurrentAddiction = Addiction[(int)potion.PotionEffect]; double CureConsumption = CurrentAddiction + Addiction[1] * 0.08 + Addiction[2] * 0.1 + Addiction[3] * 0.14; return CureConsumption; }
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); } }
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 override void Drink(Mobile m) { if (!m.CanBeginAction(typeof(InvisibilityPotion))) { m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState); } else if (!m.CanBeginAction(typeof(LesserInvisibilityPotion))) { m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState); } else if (!m.CanBeginAction(typeof(GreaterInvisibilityPotion))) { m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState); } else { int MyHide = 100 - (int)m.Skills[SkillName.Hiding].Base; if (MyHide < 0) { MyHide = 0; } int MyStealth = 100 - (int)m.Skills[SkillName.Stealth].Base; if (MyStealth < 0) { MyStealth = 0; } object[] mods = new object[] { new DefaultSkillMod(SkillName.Hiding, true, MyHide), new DefaultSkillMod(SkillName.Stealth, true, MyStealth), }; m_Table[m] = mods; m.AddSkillMod((SkillMod)mods[0]); m.AddSkillMod((SkillMod)mods[1]); foreach (Mobile pet in World.Mobiles.Values) { if (pet is BaseCreature) { BaseCreature bc = (BaseCreature)pet; if (bc.Controlled && bc.ControlMaster == m) { pet.Hidden = true; } } } new InternalTimer(m, TimeSpan.FromMinutes(3)).Start(); BasePotion.PlayDrinkEffect(m); m.Hidden = true; m.BeginAction(typeof(GreaterInvisibilityPotion)); this.Amount--; if (this.Amount <= 0) { this.Delete(); } } }
public void IncAddiction(BasePotion potion) { if (Addiction == null) Addiction = new double[Enum.GetValues(typeof(PotionEffect)).Length]; int index = (int)potion.PotionEffect; double value = 1; if (potion.IntensifiedStrength) value += 0.5; if (potion.IntensifiedTime) value += 0.5; if (index >= Addiction.Length) return; Addiction[index]+=value; if (Math.Round(Addiction[index] / 10.0, 0) == Addiction[index] - 1) SendMessage("Vous devriez consommer moins de ce produit"); }
public override void Drink(Mobile from) { PlayerMobile player = from as PlayerMobile; if (player == null) { return; } if (this != null && ParentEntity != from.Backpack) { from.SendMessage("The potion must be in your pack to drink it."); } else { if (!from.CanBeginAction(typeof(PolymorphSpell))) { from.SendMessage("You are already under the influence of an polymorph effect."); return; } if (player.RecentlyInPlayerCombat) { from.SendMessage("You have been in combat with another player too recently to drink this."); return; } if (DisguiseTimers.IsDisguised(from)) { from.SendMessage("You cannot can drink that while being disguised."); } if (KinPaint.IsWearingKinPaint(from)) { from.SendMessage("You cannot can drink that while wearing kin paint."); return; } if (!from.CanBeginAction(typeof(IncognitoSpell)) || from.IsBodyMod) { from.SendMessage("You cannot can drink that while under the effect of a modification spell, ability, or item."); return; } from.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); from.PlaySound(0x3BD); from.Animate(34, 5, 1, true, false, 0); BasePotion.PlayDrinkEffect(from); List <int> m_PossibleBodyValues = new List <int>(); m_PossibleBodyValues.Add(1); //Ogre m_PossibleBodyValues.Add(2); //Ettin m_PossibleBodyValues.Add(3); //Zombie m_PossibleBodyValues.Add(4); //Gargoyle m_PossibleBodyValues.Add(5); //Orc Captain m_PossibleBodyValues.Add(6); //Corpser m_PossibleBodyValues.Add(9); //Daemon m_PossibleBodyValues.Add(17); //Orc m_PossibleBodyValues.Add(22); //Gazer m_PossibleBodyValues.Add(26); //Ghost m_PossibleBodyValues.Add(30); //Harpy m_PossibleBodyValues.Add(31); //Headless m_PossibleBodyValues.Add(35); //Lizardman m_PossibleBodyValues.Add(39); //Mongbat m_PossibleBodyValues.Add(45); //Ratman m_PossibleBodyValues.Add(57); //Skeleton m_PossibleBodyValues.Add(53); //Troll m_PossibleBodyValues.Add(70); //Terathan Warrior m_PossibleBodyValues.Add(71); //Terathan Drone m_PossibleBodyValues.Add(72); //Terathan Queen m_PossibleBodyValues.Add(75); //Cyclops m_PossibleBodyValues.Add(82); //Lich m_PossibleBodyValues.Add(85); //Ophidian Mage m_PossibleBodyValues.Add(86); //Ophidian Warrior m_PossibleBodyValues.Add(87); //Ophidian Queen m_PossibleBodyValues.Add(154); //Mummy m_PossibleBodyValues.Add(285); //Treestalk m_PossibleBodyValues.Add(301); //Ent m_PossibleBodyValues.Add(303); //Devourer m_PossibleBodyValues.Add(304); //Flesh Golem m_PossibleBodyValues.Add(305); //Ore Golem m_PossibleBodyValues.Add(306); //Hook Horror m_PossibleBodyValues.Add(309); //Patchwork Skeleton m_PossibleBodyValues.Add(312); //Myconid from.BodyMod = m_PossibleBodyValues[Utility.RandomMinMax(0, m_PossibleBodyValues.Count - 1)]; from.HueMod = 0; BaseArmor.ValidateMobile(from); int duration = 300; from.BeginAction(typeof(PolymorphPotion)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { from.EndAction(typeof(PolymorphPotion)); }); from.BeginAction(typeof(PolymorphSpell)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { ChangeBack(from); }); Consume(); } }
public void makeready(Mobile who) { PlayerMobile c = (PlayerMobile)who; if (!who.Alive) { who.Resurrect(); } Container bp = c.Backpack; Container bankbag = new Bag(); bankbag.Hue = 63; BankBox bank = c.BankBox; Item oncurs = c.Holding; if (oncurs != null) { bp.DropItem(oncurs); } c.SendMessage("You have 10 seconds until the duel begins"); c.SendMessage(63, "After one of you dies, both of you will be teleported out"); c.Criminal = true; c.CurePoison(c); c.Blessed = true; c.Frozen = true; c.Hits = c.HitsMax; c.Mana = c.ManaMax; c.Stam = c.StamMax; c.StatMods.Clear(); if (bp != null) { Item toDisarm = c.FindItemOnLayer(Layer.OneHanded); if (toDisarm == null || !toDisarm.Movable) { toDisarm = c.FindItemOnLayer(Layer.TwoHanded); } if (toDisarm != null) { bp.DropItem(toDisarm); } if (c.Mount != null) { IMount mount = c.Mount; mount.Rider = null; if (mount is BaseMount) { BaseMount oldMount = (BaseMount)mount; oldMount.Map = Map.Internal; c.TempMount = oldMount; } } while ((BasePotion)bp.FindItemByType(typeof(BasePotion)) != null) { BasePotion potion = (BasePotion)bp.FindItemByType(typeof(BasePotion)); bankbag.DropItem(potion); } while ((EtherealMount)bp.FindItemByType(typeof(EtherealMount)) != null) { EtherealMount mount = (EtherealMount)bp.FindItemByType(typeof(EtherealMount)); bankbag.DropItem(mount); } /*Item[] weps = bp.FindItemsByType( typeof( BaseWeapon ) ); * for ( int i = 0; i < weps.Length; ++i ) * { * Item item = (Item)weps[i]; * BaseWeapon weapon = item as BaseWeapon; * if( weapon.DamageLevel > WeaponDamageLevel.Regular ) * bankbag.DropItem( item ); * }*/ if (bankbag.Items.Count > 0) { bank.DropItem(bankbag); } else { bankbag.Delete(); } } }
public double[] CalculateStrengthAddiction(BasePotion potion) { if (Addiction == null) Addiction = new double[Enum.GetValues(typeof(PotionEffect)).Length]; double CurrentAddiction = (Addiction[(int)potion.PotionEffect]); double GlobalAddiction = CurrentAddiction + Addiction[6] * 0.1 + Addiction[7] * 0.14; return new double[] { CurrentAddiction, GlobalAddiction }; }
public static void PlayDrinkEffect( Mobile m, BasePotion potion ) { if ( m is PlayerMobile && !(m as PlayerMobile).HiddenWithSpell ) m.RevealingAction(); m.PlaySound( 0x31 ); if (potion != null) { if (!potion.EventItem || (potion.EventItem && potion.EventItemConsume)) { Bottle b = new Bottle(); if (potion.EventItem) { b.EventItem = true; b.Hue = potion.Hue; b.Name = "event Empty bottle"; } #region Add to pack or ground if overweight //Taran: Check to see if player is overweight. If they are and the item drops to the //ground then a check is made to see if it can be stacked. If it can't and more than //20 items of the same type exist in the same tile then the last item gets removed. This //check is made so thousands of items can't exist in 1 tile and crash people in the same area. if (!m.AddToBackpack(b)) { IPooledEnumerable eable = m.Map.GetItemsInRange(m.Location, 0); int amount = 0; Item toRemove = null; foreach (Item i in eable) { if (i != b && i.ItemID == b.ItemID) { if (i.StackWith(m, b, false)) { toRemove = b; break; } amount++; } } m.SendAsciiMessage("You are overweight and put the {0} on the ground.", b.Name ?? CliLoc.LocToString(b.LabelNumber)); if (toRemove != null) toRemove.Delete(); else if (amount >= 5 && amount < 20) m.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("{0} identical items on the ground detected, no more than 20 is allowed!", amount)); else if (amount >= 20) { m.LocalOverheadMessage(MessageType.Regular, 906, true, "Too many identical items on the ground, removing!"); b.Delete(); } eable.Free(); } #endregion potion.Consume(1); } } if( m.Body.IsHuman ) m.Animate(m.Mounted ? 28 : 34, 5, 1, true, false, 0); }
public double CalculateNightSightAddiction(BasePotion potion) { if (Addiction == null) Addiction = new double[Enum.GetValues(typeof(PotionEffect)).Length]; double CurrentAddiction = Addiction[(int)potion.PotionEffect]/4; return CurrentAddiction; }
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 (item is BaseExplosionPotion && ((BaseExplosionPotion)item).TimerIsRunning()) { from.SendMessage("That is about to explode!"); return(false); } 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); } }
public double[] CalculateClumsyAddiction(BasePotion potion) { if (Addiction == null) Addiction = new double[Enum.GetValues(typeof(PotionEffect)).Length]; double CurrentAddiction = (Addiction[(int)potion.PotionEffect])/2; double GlobalAddiction = CurrentAddiction + Addiction[32] * 0.05 + Addiction[33] * 0.07; return new double[] { CurrentAddiction, GlobalAddiction }; }