public static bool UnequipPirateItems(Mobile m) { ArrayList ItemsToMove = new ArrayList(); ArrayList ItemsToDelete = new ArrayList(); Bag bag = new Bag(); BankBox bankBox = m.BankBox; if (bankBox == null || !bankBox.TryDropItem(m, bag, false)) { bag.Delete(); return(false); } Bag bag2 = new Bag(); bag2.Name = "Pirate Curse Unequiped Items"; bag2.Hue = m.Hue; Container pack = m.Backpack; if (pack == null && !pack.CheckHold(m, bag2, false, true)) { bag2.Delete(); return(false); } pack.AddItem(bag2); foreach (Item item in m.Items) { if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack) { if (item.Layer == Layer.OneHanded || item.Layer == Layer.Shirt || item.Layer == Layer.Pants || item.Layer == Layer.Helm || item.Layer == Layer.Shoes) { ItemsToDelete.Add(item); } else { ItemsToMove.Add(item); } } } foreach (Item item in ItemsToDelete) { bag.AddItem(item); } bag.Delete(); foreach (Item item in ItemsToMove) { bag2.AddItem(item); } RestorePlayerItems(m); return(true); }
public void OnOptionSelected(Mobile from, int choice) { Bag bag = new Bag { Hue = 2758 }; switch (choice) { default: bag.Delete(); break; case 1: { bag.DropItem(new OpalEncrustedMobius()); from.AddToBackpack(bag); Delete(); break; } case 2: { bag.DropItem(new OpalStandingHarp()); from.AddToBackpack(bag); Delete(); break; } case 3: { bag.DropItem(new OrnamentalOpal()); from.AddToBackpack(bag); Delete(); break; } } }
public void OnOptionSelected(Mobile from, int choice) { Bag bag = new Bag { Hue = 2751 }; switch (choice) { default: bag.Delete(); break; case 1: { bag.DropItem(new SilverPlatedLamppost()); from.AddToBackpack(bag); Delete(); break; } case 2: { bag.DropItem(new SilverPlatedBubblingCauldronDeed()); from.AddToBackpack(bag); Delete(); break; } case 3: { bag.DropItem(new SilverPlatedTome()); from.AddToBackpack(bag); Delete(); break; } } }
public void OnOptionSelected(Mobile from, int choice) { Bag bag = new Bag(); bag.Hue = 2720; switch (choice) { default: bag.Delete(); break; case 1: bag.DropItem(new BrassOrrery()); from.AddToBackpack(bag); Delete(); break; case 2: bag.DropItem(new PersonalTelescope()); from.AddToBackpack(bag); Delete(); break; } }
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 void OnOptionSelected(Mobile from, int choice) { Bag bag = new Bag { Hue = 1286 }; bool chance = Utility.RandomDouble() < .1; Item item; switch (choice) { default: bag.Delete(); break; case 1: { item = new CopperWings(); if (chance) { item.Hue = 2951; } bag.DropItem(item); from.AddToBackpack(bag); Delete(); break; } case 2: { item = new CopperPortrait1(); if (chance) { item.Hue = 2951; } bag.DropItem(item); item = new CopperPortrait2(); if (chance) { item.Hue = 2951; } bag.DropItem(item); from.AddToBackpack(bag); Delete(); break; } case 3: { item = new CopperShipReliefAddonDeed(); if (chance) { item.Hue = 2951; } bag.DropItem(item); from.AddToBackpack(bag); Delete(); break; } case 4: item = new CopperSunflower(); if (chance) { item.Hue = 2951; } bag.DropItem(item); from.AddToBackpack(bag); Delete(); break; } }
public bool GiveReward(Mobile to) { Bag bag = new Bag(); bag.DropItem(new Gold(Utility.RandomMinMax(500, 1000))); if (Utility.RandomBool()) { BaseWeapon weapon = Loot.RandomWeapon(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(weapon, 2, 20, 30); } else { weapon.DamageLevel = (WeaponDamageLevel)BaseCreature.RandomMinMaxScaled(2, 3); weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 3); weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); } bag.DropItem(weapon); } else { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrJewelry(); if (item is BaseArmor) BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 2, 20, 30); else if (item is BaseJewel) BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 2, 20, 30); } else { BaseArmor armor = Loot.RandomArmorOrShield(); item = armor; armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled(2, 3); armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); } bag.DropItem(item); } bag.DropItem(new Obsidian()); if (to.PlaceInBackpack(bag)) { return true; } else { bag.Delete(); return false; } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case (int)Buttons.B_OK: int counter = 0; foreach (Item item in m_foundItems) if (item.IsChildOf(from.Backpack)) counter++; if (counter >= m_npc.ArtifactAmount) { Bag rewardBag = new Bag(); rewardBag.Hue = Utility.RandomDyedHue(); LootPackEntry.AddRandomLoot(rewardBag, 5, 600, 5, 5, 50, 100); rewardBag.DropItem(new Bandage(Utility.RandomMinMax(200, 300))); rewardBag.DropItem(new Gold(2000, 4000)); rewardBag.DropItem(new TreasureMap(Utility.RandomMinMax(2, 6), Map.Felucca)); // Add Artifact *** if (0.40 > Utility.RandomDouble()) rewardBag.DropItem(new HarvesterOfTheGhost()); if (from.PlaceInBackpack(rewardBag)) { foreach (Item item in m_foundItems) item.Delete(); m_npc.Say(1070984, "Reward Bag"); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack. } else { rewardBag.Delete(); from.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. } } break; } }
private void ReadyPlayer(Mobile m) { if (!m_ScoreTable.ContainsKey(m.Serial)) m_ScoreTable.Add(m.Serial, new ScoreKeeper(m)); if (!m_UseSphereRules) { #region DistroCode bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed; bool MagicArmor = MagicArmorRule == pMagicArmorRule.Allowed; bool Potions = PotionRule == pPotionRule.Allowed; bool Bandages = BandageRule == pBandaidRule.Allowed; bool Pets = PetRule == pPetRule.Allowed; bool Mounts = MountRule == pMountRule.Allowed; if (!m.Alive) m.Resurrect(); Container bp = m.Backpack; Container bag = new Bag(); bag.Hue = 38; BankBox bank = m.BankBox; Item oncurs = m.Holding; if (oncurs != null) bp.DropItem(oncurs); m.CurePoison(m); m.Hits = m.HitsMax; m.Mana = m.ManaMax; m.Stam = m.StamMax; m.StatMods.Clear(); List<Item> items = new List<Item>(); foreach (Layer layer in PvpCore.EquipmentLayers) { Item item = m.FindItemOnLayer(layer); if (item != null) { if (item is BaseWeapon && !MagicWeapons) { BaseWeapon weapon = (BaseWeapon)item; if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular) items.Add(weapon); else if (weapon.DamageLevel != WeaponDamageLevel.Regular) items.Add(weapon); else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular) items.Add(weapon); } else if (item is BaseArmor && !MagicArmor) { BaseArmor armor = (BaseArmor)item; if (armor.Durability != ArmorDurabilityLevel.Regular) items.Add(armor); else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular) items.Add(armor); } } } if (m.Backpack != null) { foreach (Item item in m.Backpack.Items) { if (item != null) { if (item is BaseWeapon && !MagicWeapons) { BaseWeapon weapon = (BaseWeapon) item; if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular) items.Add(weapon); else if (weapon.DamageLevel != WeaponDamageLevel.Regular) items.Add(weapon); else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular) items.Add(weapon); } else if (item is BaseArmor && !MagicArmor) { BaseArmor armor = (BaseArmor) item; if (armor.Durability != ArmorDurabilityLevel.Regular) items.Add(armor); else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular) items.Add(armor); } else if (item is BasePotion && !Potions) items.Add(item); else if (item is EtherealMount && !Mounts) items.Add(item); else if (item is Bandage && !Bandages) items.Add(item); } } } if (!Mounts) { if (m.Mount != null) { IMount mount = m.Mount; mount.Rider = null; if (mount is BaseMount) { if (mount is BaseCreature) { BaseCreature bc = (BaseCreature)mount; bc.ControlTarget = null; bc.ControlOrder = OrderType.Stay; bc.Internalize(); bc.SetControlMaster(null); bc.SummonMaster = null; bc.IsStabled = true; m.Stabled.Add(bc); MountCollection.Add(m.Serial, bc); m.SendMessage(38, "Your mount has been moved to the your stables"); } } } } if (items.Count > 0) m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank."); foreach (Item item in items) bag.AddItem(item); if (bag.Items.Count > 0) bank.DropItem(bag); else bag.Delete(); #endregion } if (m_EventSupplier != null) m_EventSupplier.OnMoveOver(m); Contestants.Add(m); SpawnMobile(m); if ( m_GiveHorses ) DMHorse.TryGiveHorse(m); if (m.NetState != null) { m.SendMessage(38, "You have joined a deathmatch"); m.SendMessage(38, "You can check the score with \".DMScore\""); } }
private static void CreateItens(bool pImportItensToPlayer) { Bag bagItens = new Bag(); bagItens.Name = "Itens de " + sphereCharName; bagItens.Hue = 1153; Bag bagGold = new Bag(); Bag bagOres = new Bag(); Bag bagIngots = new Bag(); Bag bagArmor = new Bag(); Bag bagWeapon = new Bag(); Bag bagMount = new Bag(); Bag bagOther = new Bag(); Bag bagPotion = new Bag(); Bag bagRegs = new Bag(); Bag bagCloth = new Bag(); Bag bagContainer = new Bag(); Bag bagMaps = new Bag(); Bag bagPlateOutras = new Bag(); bagPlateOutras.Hue = DimensionsNewAge.Scripts.HueOreConst.HueIron; bagArmor.DropItem(bagPlateOutras); Bag bagPlateRusty = new Bag(); bagPlateRusty.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRusty; bagArmor.DropItem(bagPlateRusty); Bag bagPlateOldCopper = new Bag(); bagArmor.DropItem(bagPlateOldCopper); bagPlateOldCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueOldCopper; Bag bagPlateDullCopper = new Bag(); bagArmor.DropItem(bagPlateDullCopper); bagPlateDullCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueDullCopper; Bag bagPlateRuby = new Bag(); bagPlateRuby.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRuby; bagArmor.DropItem(bagPlateRuby); Bag bagPlateCopper = new Bag(); bagPlateCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueCopper; bagArmor.DropItem(bagPlateCopper); Bag bagPlateBronze = new Bag(); bagPlateBronze.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBronze; bagArmor.DropItem(bagPlateBronze); Bag bagPlateShadowIron = new Bag(); bagPlateShadowIron.Hue = DimensionsNewAge.Scripts.HueOreConst.HueShadow; bagArmor.DropItem(bagPlateShadowIron); Bag bagPlateSilver = new Bag(); bagPlateSilver.Hue = DimensionsNewAge.Scripts.HueOreConst.HueSilver; bagArmor.DropItem(bagPlateSilver); Bag bagPlateMercury = new Bag(); bagPlateMercury.Hue = DimensionsNewAge.Scripts.HueOreConst.HueMercury; bagArmor.DropItem(bagPlateMercury); Bag bagPlateRose = new Bag(); bagPlateRose.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRose; bagArmor.DropItem(bagPlateRose); Bag bagPlateGold = new Bag(); bagPlateGold.Hue = DimensionsNewAge.Scripts.HueOreConst.HueGold; bagArmor.DropItem(bagPlateGold); Bag bagPlateAgapite = new Bag(); bagPlateAgapite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAgapite; bagArmor.DropItem(bagPlateAgapite); Bag bagPlateVerite = new Bag(); bagPlateVerite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueVerite; bagArmor.DropItem(bagPlateVerite); Bag bagPlatePlutonio = new Bag(); bagPlatePlutonio.Hue = DimensionsNewAge.Scripts.HueOreConst.HuePlutonio; bagArmor.DropItem(bagPlatePlutonio); Bag bagPlateBloodRock = new Bag(); bagPlateBloodRock.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBloodRock; bagArmor.DropItem(bagPlateBloodRock); Bag bagPlateValorite = new Bag(); bagPlateValorite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueValorite; bagArmor.DropItem(bagPlateValorite); Bag bagPlateBlackRock = new Bag(); bagPlateBlackRock.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBlackRock; bagArmor.DropItem(bagPlateBlackRock); Bag bagPlateMytheril = new Bag(); bagPlateMytheril.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAqua; bagArmor.DropItem(bagPlateMytheril); Bag bagPlateAqua = new Bag(); bagPlateAqua.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAqua; bagArmor.DropItem(bagPlateAqua); bagItens.DropItem(bagOres); bagItens.DropItem(bagIngots); bagItens.DropItem(bagArmor); bagItens.DropItem(bagWeapon); bagItens.DropItem(bagMount); bagItens.DropItem(bagOther); bagItens.DropItem(bagGold); bagItens.DropItem(bagPotion); bagItens.DropItem(bagRegs); bagItens.DropItem(bagCloth); bagItens.DropItem(bagContainer); bagItens.DropItem(bagMaps); Spellbook book = new Spellbook(); book.Content = ulong.MaxValue; bagItens.DropItem(book); bagItens.DropItem(new Runebook()); bagItens.DropItem(new Runebook()); if (pImportItensToPlayer) { foreach (Mobile mobile in World.Mobiles.Values) { if (mobile is PlayerMobile && mobile.Account.Username == runuoAccName && mobile.Name == runuoCharName) { mobile.BankBox.DropItem(bagItens); break; } } } else { caller.Backpack.DropItem(bagItens); } foreach (SphereItemClass sphereItem in sphereItensListToAcc) { try { object item; if (sphereItem.itemType == typeof(TreasureMap)) item = new TreasureMap(new Random().Next(1, 3), Map.Felucca); else item = RewardUtil.CreateRewardInstance(sphereItem.itemType); if (item is Item) { if (((Item)item).Stackable) { ((Item)item).Amount = sphereItem.qtAmount; } } if (item is BaseOre) { bagOres.DropItem((Item)item); } else if (item is Gold) { bagGold.DropItem((Item)item); } else if (item is BaseIngot) { bagIngots.DropItem((Item)item); } else if (item is BaseWeapon) { bagWeapon.DropItem((Item)item); } else if (item is BaseReagent) { bagRegs.DropItem((Item)item); } else if (item is LockableContainer) { bagContainer.DropItem((Item)item); } else if (item is TreasureMap) { bagMaps.DropItem((Item)item); } else if (item is BaseArmor) { bagPlateOutras.DropItem((Item)item); if (item is PlateChestRusty || item is PlateArmsRusty || item is PlateLegsRusty || item is PlateCloseHelmRusty || item is PlateGorgetRusty || item is PlateGlovesRusty || item is SwordRusty || item is WarMaceRusty || item is KryssRusty || item is WarMaceRusty || item is HeaterShieldRusty || item is BowRusty) { bagPlateRusty.DropItem((Item)item); } if (item is PlateChestOldCopper || item is PlateArmsOldCopper || item is PlateLegsOldCopper || item is PlateCloseHelmOldCopper || item is PlateGorgetOldCopper || item is PlateGlovesOldCopper || item is SwordOldCopper || item is WarMaceOldCopper || item is KryssOldCopper || item is WarMaceOldCopper || item is HeaterShieldOldCopper || item is BowOldCopper) { bagPlateOldCopper.DropItem((Item)item); } if (item is PlateChestDullCopper || item is PlateArmsDullCopper || item is PlateLegsDullCopper || item is PlateCloseHelmDullCopper || item is PlateGorgetDullCopper || item is PlateGlovesDullCopper || item is SwordDullCopper || item is WarMaceDullCopper || item is KryssDullCopper || item is WarMaceDullCopper || item is HeaterShieldDullCopper || item is BowDullCopper) { bagPlateDullCopper.DropItem((Item)item); } if (item is PlateChestRuby || item is PlateArmsRuby || item is PlateLegsRuby || item is PlateCloseHelmRuby || item is PlateGorgetRuby || item is PlateGlovesRuby || item is SwordRuby || item is WarMaceRuby || item is KryssRuby || item is WarMaceRuby || item is HeaterShieldRuby || item is BowRuby) { bagPlateRuby.DropItem((Item)item); } if (item is PlateChestCopper || item is PlateArmsCopper || item is PlateLegsCopper || item is PlateCloseHelmCopper || item is PlateGorgetCopper || item is PlateGlovesCopper || item is SwordCopper || item is WarMaceCopper || item is KryssCopper || item is WarMaceCopper || item is HeaterShieldCopper || item is BowCopper) { bagPlateCopper.DropItem((Item)item); } if (item is PlateChestBronze || item is PlateArmsBronze || item is PlateLegsBronze || item is PlateCloseHelmBronze || item is PlateGorgetBronze || item is PlateGlovesBronze || item is SwordBronze || item is WarMaceBronze || item is KryssBronze || item is WarMaceBronze || item is HeaterShieldBronze || item is BowBronze) { bagPlateBronze.DropItem((Item)item); } if (item is PlateChestShadow || item is PlateArmsShadow || item is PlateLegsShadow || item is PlateCloseHelmShadow || item is PlateGorgetShadow || item is PlateGlovesShadow || item is SwordShadow || item is WarMaceShadow || item is KryssShadow || item is WarMaceShadow || item is HeaterShieldShadow || item is BowShadow) { bagPlateShadowIron.DropItem((Item)item); } if (item is PlateChestSilver || item is PlateArmsSilver || item is PlateLegsSilver || item is PlateCloseHelmSilver || item is PlateGorgetSilver || item is PlateGlovesSilver || item is SwordSilver || item is WarMaceSilver || item is KryssSilver || item is WarMaceSilver || item is HeaterShieldSilver || item is BowSilver) { bagPlateSilver.DropItem((Item)item); } if (item is PlateChestMercury || item is PlateArmsMercury || item is PlateLegsMercury || item is PlateCloseHelmMercury || item is PlateGorgetMercury || item is PlateGlovesMercury || item is SwordMercury || item is WarMaceMercury || item is KryssMercury || item is WarMaceMercury || item is HeaterShieldMercury || item is BowMercury) { bagPlateMercury.DropItem((Item)item); } if (item is PlateChestRose || item is PlateArmsRose || item is PlateLegsRose || item is PlateCloseHelmRose || item is PlateGorgetRose || item is PlateGlovesRose || item is SwordRose || item is WarMaceRose || item is KryssRose || item is WarMaceRose || item is HeaterShieldRose || item is BowRose) { bagPlateRose.DropItem((Item)item); } if (item is PlateChestGold || item is PlateArmsGold || item is PlateLegsGold || item is PlateCloseHelmGold || item is PlateGorgetGold || item is PlateGlovesGold || item is SwordGold || item is WarMaceGold || item is KryssGold || item is WarMaceGold || item is HeaterShieldGold || item is BowGold) { bagPlateGold.DropItem((Item)item); } if (item is PlateChestAgapite || item is PlateArmsAgapite || item is PlateLegsAgapite || item is PlateCloseHelmAgapite || item is PlateGorgetAgapite || item is PlateGlovesAgapite || item is SwordAgapite || item is WarMaceAgapite || item is KryssAgapite || item is WarMaceAgapite || item is HeaterShieldAgapite || item is BowAgapite) { bagPlateAgapite.DropItem((Item)item); } if (item is PlateChestVerite || item is PlateArmsVerite || item is PlateLegsVerite || item is PlateCloseHelmVerite || item is PlateGorgetVerite || item is PlateGlovesVerite || item is SwordVerite || item is WarMaceVerite || item is KryssVerite || item is WarMaceVerite || item is HeaterShieldVerite || item is BowVerite) { bagPlateVerite.DropItem((Item)item); } if (item is PlateChestPlutonio || item is PlateArmsPlutonio || item is PlateLegsPlutonio || item is PlateCloseHelmPlutonio || item is PlateGorgetPlutonio || item is PlateGlovesPlutonio || item is SwordPlutonio || item is WarMacePlutonio || item is KryssPlutonio || item is WarMacePlutonio || item is HeaterShieldPlutonio || item is BowPlutonio) { bagPlatePlutonio.DropItem((Item)item); } if (item is PlateChestBloodRock || item is PlateArmsBloodRock || item is PlateLegsBloodRock || item is PlateCloseHelmBloodRock || item is PlateGorgetBloodRock || item is PlateGlovesBloodRock || item is SwordBloodRock || item is WarMaceBloodRock || item is KryssBloodRock || item is WarMaceBloodRock || item is HeaterShieldBloodRock || item is BowBloodRock) { bagPlateBloodRock.DropItem((Item)item); } if (item is PlateChestValorite || item is PlateArmsValorite || item is PlateLegsValorite || item is PlateCloseHelmValorite || item is PlateGorgetValorite || item is PlateGlovesValorite || item is SwordValorite || item is WarMaceValorite || item is KryssValorite || item is WarMaceValorite || item is HeaterShieldValorite || item is BowValorite) { bagPlateValorite.DropItem((Item)item); } if (item is PlateChestBlackRock || item is PlateArmsBlackRock || item is PlateLegsBlackRock || item is PlateCloseHelmBlackRock || item is PlateGorgetBlackRock || item is PlateGlovesBlackRock || item is SwordBlackRock || item is WarMaceBlackRock || item is KryssBlackRock || item is WarMaceBlackRock || item is HeaterShieldBlackRock || item is BowBlackRock) { bagPlateBlackRock.DropItem((Item)item); } if (item is PlateChestMytheril || item is PlateArmsMytheril || item is PlateLegsMytheril || item is PlateCloseHelmMytheril || item is PlateGorgetMytheril || item is PlateGlovesMytheril || item is SwordMytheril || item is WarMaceMytheril || item is KryssMytheril || item is WarMaceMytheril || item is HeaterShieldMytheril || item is BowMytheril) { bagPlateMytheril.DropItem((Item)item); } if (item is PlateChestAqua || item is PlateArmsAqua || item is PlateLegsAqua || item is PlateCloseHelmAqua || item is PlateGorgetAqua || item is PlateGlovesAqua || item is SwordAqua || item is WarMaceAqua || item is KryssAqua || item is WarMaceAqua || item is HeaterShieldAqua || item is BowAqua) { bagPlateAqua.DropItem((Item)item); } } else if (item is BaseClothing) { bagCloth.DropItem((Item)item); } else if (item is BasePotion) { //for (int i = 0; i <= sphereItem.qtAmount - 1; i++) //{ // object itemPotion = RewardUtil.CreateRewardInstance(sphereItem.itemType); // bagPotion.DropItem((Item)itemPotion); //} bagPotion.DropItem((Item)item); } else if (item is BaseCreature) { if (sphereItem.Hue != 1) { ((BaseCreature)item).Hue = sphereItem.Hue; } ShrinkItem shrunkenPet = new ShrinkItem((BaseCreature)item); bagMount.DropItem(shrunkenPet); } else { bagOther.DropItem((Item)item); } if (item is Server.Mobiles.Horse && sphereItem.Hue != 1) { ((Server.Mobiles.Horse)item).Hue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue); ((Server.Mobiles.Horse)item).Name = "Wild Horse"; } if (item is Server.Items.MagicDyeTub && sphereItem.Hue != 1) ((Server.Items.MagicDyeTub)item).DyedHue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue); if (item is Server.Items.BaseClothing && sphereItem.Hue != 1) ((Server.Items.BaseClothing)item).Hue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue); } catch (Exception ex) { Logger.LogSphereImport(string.Format("CreateItens ERRO " + ex.Message), sphereCharName); } } if (bagOres.Items.Count == 0) bagOres.Delete(); if (bagIngots.Items.Count == 0) bagIngots.Delete(); if (bagArmor.Items.Count == 0) bagArmor.Delete(); if (bagWeapon.Items.Count == 0) bagWeapon.Delete(); if (bagMount.Items.Count == 0) bagMount.Delete(); if (bagOther.Items.Count == 0) bagOther.Delete(); if (bagGold.Items.Count == 0) bagGold.Delete(); if (bagPotion.Items.Count == 0) bagPotion.Delete(); if (bagRegs.Items.Count == 0) bagRegs.Delete(); if (bagCloth.Items.Count == 0) bagCloth.Delete(); if (bagContainer.Items.Count == 0) bagContainer.Delete(); if (bagMaps.Items.Count == 0) bagMaps.Delete(); if (bagPlateOutras.Items.Count == 0) bagPlateOutras.Delete(); if (bagPlateRusty.Items.Count == 0) bagPlateRusty.Delete(); if (bagPlateOldCopper.Items.Count == 0) bagPlateOldCopper.Delete(); if (bagPlateDullCopper.Items.Count == 0) bagPlateDullCopper.Delete(); if (bagPlateRuby.Items.Count == 0) bagPlateRuby.Delete(); if (bagPlateCopper.Items.Count == 0) bagPlateCopper.Delete(); if (bagPlateBronze.Items.Count == 0) bagPlateBronze.Delete(); if (bagPlateShadowIron.Items.Count == 0) bagPlateShadowIron.Delete(); if (bagPlateSilver.Items.Count == 0) bagPlateSilver.Delete(); if (bagPlateMercury.Items.Count == 0) bagPlateMercury.Delete(); if (bagPlateRose.Items.Count == 0) bagPlateRose.Delete(); if (bagPlateGold.Items.Count == 0) bagPlateGold.Delete(); if (bagPlateAgapite.Items.Count == 0) bagPlateAgapite.Delete(); if (bagPlateVerite.Items.Count == 0) bagPlateVerite.Delete(); if (bagPlatePlutonio.Items.Count == 0) bagPlatePlutonio.Delete(); if (bagPlateBloodRock.Items.Count == 0) bagPlateBloodRock.Delete(); if (bagPlateValorite.Items.Count == 0) bagPlateValorite.Delete(); if (bagPlateBlackRock.Items.Count == 0) bagPlateBlackRock.Delete(); if (bagPlateMytheril.Items.Count == 0) bagPlateMytheril.Delete(); if (bagPlateAqua.Items.Count == 0) bagPlateAqua.Delete(); }
private bool AddReward(PlayerMobile player) { Bag rewardBag = new Bag(); rewardBag.Hue = Utility.RandomDyedHue(); LootPackEntry.AddRandomLoot(rewardBag, 5, 50, 5, 5, 50, 100); rewardBag.DropItem(new Gold(2000, 4000)); if (0.05 > Utility.RandomDouble()) rewardBag.DropItem(new BloodPentagramPartDeed()); if (player.PlaceInBackpack(rewardBag)) return true; else { rewardBag.Delete(); player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. return false; } }
public virtual void AddLootPouch(LootPack pack) { if (Summoned) return; Container backpack = Backpack; if (backpack == null) { backpack = new Backpack(); backpack.Movable = false; AddItem(backpack); } //find top most container while (backpack.FindItemByType(typeof(Backpack)) != null) backpack = (Container)backpack.FindItemByType(typeof(Backpack)); Container LootBag = new Bag(); backpack.DropItem(LootBag); pack.Generate(this, LootBag, m_Spawning, m_KillersLuck); if (LootBag.Items.Count <= 0) LootBag.Delete(); }
private bool DeliveryConversion() { const int amountCap = 60000; double exchangeRate = AutoDonate.CMOptions.ExchangeRate; DonationProfile dp = AutoDonate.Find(DeliverTo.Account); Container bank = DeliverTo.BankBox; if (bank != null) { Bag bag = new Bag(); if (IsGift) { bag.Name = "A Donation Gift Bag"; bag.Hue = 1152; string text = dp.Gifts.ContainsKey(ID) ? dp.Gifts[ID] : null; if (String.IsNullOrWhiteSpace(text)) { text = "Hi, " + DeliverTo.RawName + ", "; text += "Here is a gift, a token of my appreciation. "; text += "Don't spend it all in one place! "; text += "Regards, " + DeliverFrom.RawName; } bag.DropItem(new DonationGiftBook(DeliverFrom, text)); } else { bag.Name = "A Donation Reward Bag"; bag.Hue = 1152; } long exchanged = (long)(Credit * exchangeRate); while (exchanged >= amountCap) { Item cur = AutoDonate.CMOptions.CurrencyType.CreateInstance(); cur.Amount = amountCap; bag.DropItem(cur); if (cur.IsChildOf(bag)) { exchanged -= cur.Amount; } } if (exchanged > 0) { Item cur = AutoDonate.CMOptions.CurrencyType.CreateInstance(); cur.Amount = (int)exchanged; bag.DropItem(cur); if (cur.IsChildOf(bag)) { exchanged -= cur.Amount; } } if (exchanged > 0) { bag.Delete(); return false; } bank.DropItem(bag); dp.Credits -= Credit; } return true; }
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 override void OnTalk(PlayerMobile player, bool contextMenu) { Direction = GetDirectionTo(player); QuestSystem qs = player.Quest; // Doing this quest if (qs is CursedCaveQuest) { if (qs.IsObjectiveInProgress(typeof(CursedCaveBeginObjective))) { qs.AddConversation(new DuringKillTaskConversation()); } else { QuestObjective obj = qs.FindObjective(typeof(ReportBackObjective)); if (obj != null && !obj.Completed) { Bag rewardBag = new Bag(); rewardBag.Hue = Utility.RandomDyedHue(); LootPackEntry.AddRandomLoot(rewardBag, 5, 600, 5, 5, 50, 100); rewardBag.DropItem(new Bandage(Utility.RandomMinMax(200, 300))); rewardBag.DropItem(new Gold(2000, 4000)); if (0.08 > Utility.RandomDouble()) rewardBag.DropItem(new TreasureMap(6, Map.Felucca)); else rewardBag.DropItem(new TreasureMap(Utility.RandomMinMax(3, 5), Map.Felucca)); // Add Artifact *** if (0.05 > Utility.RandomDouble()) { if (GetBestFightingSkill(player) == SkillName.Archery) rewardBag.DropItem(new BowOfHephaestus()); else rewardBag.DropItem(new LongswordOfJustice()); } else if (0.2 > Utility.RandomDouble()) { int rnd = Utility.Random(5); switch (rnd) { case 0: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateChest), "Platemail Tunic", Utility.Random(5))); break; //Up to 4 props + Chivalry case 1: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateArms), "Platemail Arms", Utility.Random(5))); break; case 2: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateGloves), "Platemail Gloves", Utility.Random(5))); break; case 3: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateLegs), "Platemail Legs", Utility.Random(5))); break; case 4: rewardBag.DropItem(CreatePaladinArmor(typeof(PlateGorget), "Platemail Gorget", Utility.Random(5))); break; } } if (player.PlaceInBackpack(rewardBag)) { obj.Complete(); if (!player.KarmaLocked) player.Karma = Math.Min(15000, player.Karma + 1500); } else { rewardBag.Delete(); player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. } } } } else { // Busy with another quest if (qs != null) { qs.AddConversation(new DontOfferConversation()); } // Offer Quest else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(CursedCaveQuest))) { Direction = GetDirectionTo(player); new CursedCaveQuest(player).SendOffer(); } } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseHouseDoor) { from.SendMessage("Ce n'est pas conseillé de faire ceci sur une porte de maison..."); return; } BaseDoor door = targeted as BaseDoor; if (door == null) { from.SendMessage("Vous devez cibler une porte et non un " + targeted.GetType().Name); return; } if (door.KeyValue != 0) { from.SendMessage("La porte possède déjà un KeyValue !"); return; } door.KeyValue = (uint)door.Serial.Value; Bag keysBag = new Bag(); keysBag.Hue = Utility.RandomDyedHue(); for (int i = 1; i <= m_Quantity; i++) { Key k = new Key(door.KeyValue); keysBag.DropItem(k); } if (keysBag.Items.Count > 0) from.Backpack.AddItem(keysBag); else keysBag.Delete(); }
private void PackUpItems() { if (c_House == null) { return; } Container bag = new Bag(); bag.Name = "Town House Belongings"; foreach (Item item in new ArrayList(c_House.LockDowns)) { item.IsLockedDown = false; item.Movable = true; c_House.LockDowns.Remove(item); bag.DropItem(item); } foreach (SecureInfo info in new ArrayList(c_House.Secures)) { info.Item.IsLockedDown = false; info.Item.IsSecure = false; info.Item.Movable = true; info.Item.SetLastMoved(); c_House.Secures.Remove(info); bag.DropItem(info.Item); } foreach ( Item item in c_Blocks.SelectMany( rect => Map.GetItemsInBounds(rect) .Where( item => !(item is HouseSign) && !(item is BaseDoor) && !(item is BaseMulti) && !(item is BaseAddon) && !(item is AddonComponent) && item.Visible && !item.IsLockedDown && !item.IsSecure && item.Movable && item.Map == c_House.Map && c_House.Region.Contains(item.Location)))) { bag.DropItem(item); } if (bag.Items.Count == 0) { bag.Delete(); return; } c_House.Owner.BankBox.DropItem(bag); }
public override void OnResponse( NetState state, RelayInfo info ) { PlayerMobile pm = m_Mobile as PlayerMobile; if ( info.ButtonID == 1 && !m_House.Deleted && pm != null ) { if ( m_House.IsOwner( m_Mobile ) ) { if ( m_House.FindGuildstone() != null ) { m_Mobile.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside. return; } /*else if ( m_House.PlayerVendors.Count > 0 ) { m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving. return; }*/ else if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 ) { m_Mobile.SendLocalizedMessage( 1062679 ); // You cannot do that while you still have contract vendors or unclaimed contract vendor inventory in your house. return; } else if ( m_House.HasRentedVendors ) { m_Mobile.SendLocalizedMessage( 1062680 ); // You cannot do that that while you still have contract vendors in your house. return; } else if ( m_House.VendorInventories.Count > 0 ) { m_Mobile.SendLocalizedMessage( 1062681 ); // You cannot do that that while you still have unclaimed contract vendor inventory in your house. return; } Item toGive = null; if ( m_House.IsAosRules ) { if (m_House.Price > 0) { Bag bag = new Bag(); bag.DropItem(new BankCheck(m_House.Price)); Item deed = m_House.GetDeed(); if (deed != null) // deed == null <=> No deed exists for the house type { bag.DropItem(deed); toGive = bag as Item; } else bag.Delete(); } else toGive = m_House.GetDeed(); } else { toGive = m_House.GetDeed(); if ( toGive == null && m_House.Price > 0 ) toGive = new BankCheck( m_House.Price ); } if ( toGive != null ) { BankBox box = m_Mobile.BankBox; if ( box != null && box.TryDropItem( m_Mobile, toGive, false ) ) { if (toGive is BankCheck) m_Mobile.SendLocalizedMessage(1060397, ((BankCheck)toGive).Worth.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box. else if (toGive is HouseDeed) m_Mobile.SendMessage("The house deed has been placed in your bank box."); else if (toGive is Container) m_Mobile.SendMessage("The house deed and a check containing the house value have been placed in your bank box."); if ( pm.HasDonated ) { m_House.KillVendors( true ); HouseDecayingCrate crate = m_House.MoveAllDecayingToCrate(); if ( crate.Items.Count == 0 ) crate.Delete(); else m_Mobile.BankBox.DropItem( crate ); } m_Mobile.CloseGump( typeof( ConfirmCommitGump ) ); m_House.RemoveKeys( m_Mobile ); m_House.Delete(); } else { toGive.Delete(); m_Mobile.SendLocalizedMessage( 500390 ); // Your bank box is full. } } else m_Mobile.SendMessage( "Unable to refund house. Please contact a Developer." ); } else m_Mobile.SendLocalizedMessage( 501320 ); // Only the house owner may do this. } }
protected void PackUpItems() { if ( c_House == null ) return; Container bag = new Bag(); bag.Name = "Town House Belongings"; foreach( Item item in new ArrayList( c_House.LockDowns ) ) { item.IsLockedDown = false; item.Movable = true; c_House.LockDowns.Remove( item ); bag.DropItem( item ); } foreach( SecureInfo info in new ArrayList( c_House.Secures ) ) { info.Item.IsLockedDown = false; info.Item.IsSecure = false; info.Item.Movable = true; info.Item.SetLastMoved(); c_House.Secures.Remove( info ); bag.DropItem( info.Item ); } foreach( Item item in World.Items.Values ) { if ( item is HouseSign || item is BaseDoor || item is BaseMulti || item is BaseAddon || item is AddonComponent || !item.Visible || item.IsLockedDown || item.IsSecure || !item.Movable || item.Map != c_House.Map || !c_House.Region.Contains( item.Location ) ) continue; bag.DropItem( item ); } if ( bag.Items.Count == 0 ) { bag.Delete(); return; } c_House.Owner.BankBox.DropItem( bag ); }
public bool GiveReward( Mobile to ) { Bag bag = new Bag(); bag.DropItem( new Gold( Utility.RandomMinMax( 500, 1000 ) ) ); if ( Utility.RandomBool() ) { BaseWeapon weapon = Loot.RandomWeapon(); int damageLevel = BaseCreature.RandomMinMaxScaled(2, 3); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { bag.DropItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) bag.DropItem(new Platinum(platAmount)); damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled( 2, 3 ); weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 ); bag.DropItem( weapon ); } else { Item item; // if Core.AOS //item = Loot.RandomArmorOrShieldOrJewelry(); BaseArmor armor = Loot.RandomArmorOrShield(); item = armor; armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled( 2, 3 ); armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled( 2, 3 ); bag.DropItem( item ); } bag.DropItem( new ObsidianStatue() ); if ( to.PlaceInBackpack( bag ) ) { return true; } else { bag.Delete(); return false; } }