public override void OnAccept() { base.OnAccept(); if (QuestHelper.TryReceiveQuestItem(Owner, typeof(TreasureHuntingBook), TimeSpan.FromDays(7))) { WoodenChest chest = new WoodenChest(); chest.DropItem(new TreasureHuntingBook()); GreaterHealPotion heals = new GreaterHealPotion { Amount = 10 }; chest.DropItem(heals); TelekinisisScroll scrolls = new TelekinisisScroll { Amount = 20 }; chest.DropItem(scrolls); chest.DropItem(new Pickaxe()); chest.DropItem(new TreasureSeekersLockpick()); Owner.Backpack.DropItem(chest); } }
public static void DrinkHeal_OnCommand(CommandEventArgs e) { GreaterHealPotion m_GreaterHealPotion = (GreaterHealPotion)e.Mobile.Backpack.FindItemByType(typeof(GreaterHealPotion)); HealPotion m_HealPotion = (HealPotion)e.Mobile.Backpack.FindItemByType(typeof(HealPotion)); LesserHealPotion m_LesserHealPotion = (LesserHealPotion)e.Mobile.Backpack.FindItemByType(typeof(LesserHealPotion)); int m_Exists = e.Mobile.Backpack.GetAmount(typeof(GreaterHealPotion)); int m_Existss = e.Mobile.Backpack.GetAmount(typeof(HealPotion)); int m_Existsss = e.Mobile.Backpack.GetAmount(typeof(LesserHealPotion)); if (m_Exists != 0) { e.Mobile.SendMessage("Heal Potion found"); m_GreaterHealPotion.OnDoubleClick(e.Mobile); } else if (m_Existss != 0) { e.Mobile.SendMessage("Heal Potion found"); m_HealPotion.OnDoubleClick(e.Mobile); } else if (m_Existsss != 0) { e.Mobile.SendMessage("Heal Potion found"); m_LesserHealPotion.OnDoubleClick(e.Mobile); } else { e.Mobile.SendMessage("Cannot find Heal Potion"); } }
public override void OnThink() { base.OnThink(); // Chug pots if (this.Poisoned) { GreaterCurePotion m_CPot = (GreaterCurePotion)this.Backpack.FindItemByType(typeof(GreaterCurePotion)); if (m_CPot != null) { m_CPot.Drink(this); } } if (this.Hits <= (this.HitsMax * .7)) // Will try to use heal pots if he's at or below 70% health { GreaterHealPotion m_HPot = (GreaterHealPotion)this.Backpack.FindItemByType(typeof(GreaterHealPotion)); if (m_HPot != null) { m_HPot.Drink(this); } } if (this.Stam <= (this.StamMax * .25)) // Will use a refresh pot if he's at or below 25% stam { TotalRefreshPotion m_RPot = (TotalRefreshPotion)this.Backpack.FindItemByType(typeof(TotalRefreshPotion)); if (m_RPot != null) { m_RPot.Drink(this); } } }
public static void DrinkHeal_OnCommand(CommandEventArgs e) { // Added to fix the missing check to region. Ugly fix but this script is so ugly anyways. :p if (e.Mobile.Region != null && !e.Mobile.Region.OnDoubleClick(e.Mobile, new HealPotion())) { return; } LesserHealPotion lh_potion = (LesserHealPotion)e.Mobile.Backpack.FindItemByType(typeof(LesserHealPotion)); HealPotion mh_potion = (HealPotion)e.Mobile.Backpack.FindItemByType(typeof(HealPotion)); GreaterHealPotion gh_potion = (GreaterHealPotion)e.Mobile.Backpack.FindItemByType(typeof(GreaterHealPotion)); int lhp = e.Mobile.Backpack.GetAmount(typeof(LesserHealPotion)); if (lhp != 0) { e.Mobile.SendMessage("Lesser heal potion found"); lh_potion.OnDoubleClick(e.Mobile); Targeting.Target.Cancel(e.Mobile); } else { int mhp = e.Mobile.Backpack.GetAmount(typeof(HealPotion)); if (mhp != 0) { e.Mobile.SendMessage("Heal potion found"); mh_potion.OnDoubleClick(e.Mobile); Targeting.Target.Cancel(e.Mobile); } else { int ghp = e.Mobile.Backpack.GetAmount(typeof(GreaterHealPotion)); if (ghp != 0) { e.Mobile.SendMessage("Greater heal potion found"); gh_potion.OnDoubleClick(e.Mobile); Targeting.Target.Cancel(e.Mobile); } else { e.Mobile.SendMessage("Healing potion not found"); } } } }
public override void OnDoubleClick(Mobile from) { BagOfReagents regBag = new BagOfReagents(50); Item[] items = new Item[] { new FlamestrikeScroll(25), new LightningScroll(25), new GreaterHealScroll(10), new MagicReflectScroll(10), new Bandage(80) }; foreach (Item i in items) { i.Weight = 0.01; regBag.DropItem(i); } Point3D itemLocation = Point3D.Zero; for (int i = 0; i < 40; ++i) { GreaterHealPotion hp = new GreaterHealPotion(); ManaPotion mana = new ManaPotion(); regBag.DropItem(hp); regBag.DropItem(mana); if (i == 0) { itemLocation = hp.Location; mana.Location = itemLocation; } else { hp.Location = itemLocation; mana.Location = itemLocation; } } if (!from.AddToBackpack(regBag)) { regBag.Delete(); } }
public override void OnDoubleClick( Mobile from ) { BagOfReagents regBag = new BagOfReagents( 50 ); Item[] items = new Item[] { new FlamestrikeScroll( 25 ), new LightningScroll( 25 ), new GreaterHealScroll( 10 ), new MagicReflectScroll( 10 ), new Bandage( 80 ) }; foreach( Item i in items ) { i.Weight = 0.01; regBag.DropItem( i ); } Point3D itemLocation = Point3D.Zero; for( int i = 0; i < 40; ++i ) { GreaterHealPotion hp = new GreaterHealPotion(); ManaPotion mana = new ManaPotion(); regBag.DropItem( hp ); regBag.DropItem( mana ); if( i == 0 ) { itemLocation = hp.Location; mana.Location = itemLocation; } else { hp.Location = itemLocation; mana.Location = itemLocation; } } if( !from.AddToBackpack( regBag ) ) regBag.Delete(); }