private void DestroyFurniture( Mobile from, Item item ) { if ( !from.InRange( item.GetWorldLocation(), 3 ) ) { from.SendLocalizedMessage( 500446 ); // That is too far away. return; } else if ( !item.IsChildOf( from.Backpack ) && !item.Movable ) { from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here. return; } from.SendLocalizedMessage( 500461 ); // You destroy the item. Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 ); if ( item is Container ) { if ( item is TrapableContainer ) (item as TrapableContainer).ExecuteTrap( from ); ((Container)item).Destroy(); } else { item.Delete(); } }
private void DismantleItem(Mobile from, Item item) { if (!from.InRange(item.GetWorldLocation(), 2)) { from.SendMessage("You need to be closer to it."); return; } else if (!item.IsChildOf(from.Backpack) && !item.Movable) { from.SendMessage("It can't be dismantled."); return; } from.SendMessage("You dismantle the object."); Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3); if (item is Container) { if (item is TrapableContainer) (item as TrapableContainer).ExecuteTrap(from); ((Container)item).Destroy(); } else { item.Delete(); } }
public override bool OnDragDrop( Mobile from, Item dropped ){ Mobile m = from;PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { ///////////item to be dropped if( dropped is RadioactiveAcid ){ if (dropped.Amount<30) { PrivateOverheadMessage( MessageType.Regular, 1153, false, "Please return with the correct amount.", mobile.NetState );return false; } if (dropped.Amount>30) mobile.AddToBackpack( new RadioactiveAcid( (dropped.Amount-30) ) ); dropped.Delete(); ///////////the reward mobile.AddToBackpack( new Gold( 5000 ) ); if (0.20>Utility.RandomDouble()) mobile.AddToBackpack( new RadioactiveGloves( ) );//replace this ///////////thanks message PrivateOverheadMessage( MessageType.Regular, 1153, false, "Appreciate the help!!", mobile.NetState ); return true;} if ( dropped is Whip){PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );return false;} PrivateOverheadMessage( MessageType.Regular, 1153, false,"I have no need for this...", mobile.NetState ); } return false;}}}
public override bool OnDragDrop( Mobile from, Item dropped ) { PlayerMobile player = from as PlayerMobile; if ( player != null ) { QuestSystem qs = player.Quest; if ( qs is EminosUndertakingQuest ) { if ( dropped is NoteForZoel ) { QuestObjective obj = qs.FindObjective( typeof( GiveZoelNoteObjective ) ); if ( obj != null && !obj.Completed ) { dropped.Delete(); obj.Complete(); return true; } } } } return base.OnDragDrop( from, dropped ); }
public override void OnItemAdded(Item item) { if (!(item is BountyMessage)) { var bm = item as BulletinMessage; if (bm != null && bm.Poster != null) bm.Poster.SendMessage("This board is for bounty messages only."); item.Delete(); } }
public override bool OnDragDropInto( Mobile from, Item item, Point3D p ) { if ( !base.OnDragDropInto( from, item, p ) ) return false; PublicOverheadMessage( MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) ); item.Delete(); return true; }
public override bool OnDragDrop( Mobile from, Item dropped ) { if ( !base.OnDragDrop( from, dropped ) ) return false; PublicOverheadMessage( MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) ); dropped.Delete(); return true; }
public override bool OnDragDrop( Mobile from, Item dropped ){ Mobile m = from;PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { ///////////item to be dropped if( dropped is SheetMusic ){ if (dropped.Amount<8) { PrivateOverheadMessage( MessageType.Regular, 1153, false, "Please return with the correct amount.", mobile.NetState );return false; } if (dropped.Amount>8) mobile.AddToBackpack( new SheetMusic( (dropped.Amount-8) ) ); dropped.Delete(); ///////////the reward mobile.AddToBackpack( new Gold( 1000 ) ); mobile.AddToBackpack(new DawnsMusicBox()); mobile.AddToBackpack(new DawnsMusicGear()); mobile.AddToBackpack(new DawnsMusicGear()); mobile.AddToBackpack(new DawnsMusicGear()); //if( Utility.Random( 100 ) < 100 ) // switch ( Utility.Random( 4 ) ) // { // case 0: mobile.AddToBackpack( new DawnsMusicGear RandomCommon); break; // case 1: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common)); break; // case 2: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Rare)); break; // case 3: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common)); break; // } PrivateOverheadMessage( MessageType.Regular, 1153, false, "Thank you very much!", mobile.NetState ); mobile.SendGump( new LudwigFinishGump( mobile ) ); return true; } else if( dropped is SheetMusic ) { this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState ); return false; } else { this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for that!", mobile.NetState ); } } return false; }
public bool Check(Mobile from, Item item) { if (from == null || from.Deleted) { return(false); } if (item != null && !(item is MaritimeCargo)) { from.SendLocalizedMessage(1159030); // The Fellowship only requires trade cargo donations at this time. return(false); } if (item != null) { int amount = ((MaritimeCargo)item).GetAwardAmount() * 1000; if (Donations.ContainsKey(from)) { Donations[from] += amount; } else { Donations.Add(from, amount); } } from.SendLocalizedMessage(1159032, string.Format("{0}", Donations[from].ToString())); // The Fellowship thanks you for your donation. You have donated ~1_val~ worth of goods! if (Donations[from] >= 450000000) { from.SendLocalizedMessage(1152339, string.Format("{0}", Donations[from].ToString())); // A reward of ~1_ITEM~ has been placed in your backpack. from.AddToBackpack(new FellowshipCoin()); } item?.Delete(); return(true); }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToCaztor ) { dropped.Delete(); mobile.SendGump( new CaztorStartGump( mobile )); return true; } if( dropped is DeepSeaScale ) { dropped.Delete(); mobile.AddToBackpack( new SteelGears() ); mobile.AddToBackpack( new LetterToArathan() ); mobile.SendGump( new CaztorFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
public override bool OnDragDrop(Mobile from, Item dropped) { var player = from as PlayerMobile; if (player != null) { var qs = player.Quest; if (qs is UzeraanTurmoilQuest) { if (dropped is UzeraanTurmoilHorn) { if (player.Young) { var horn = (UzeraanTurmoilHorn) dropped; if (horn.Charges < 10) { SayTo(from, 1049384); // I have recharged the item for you. horn.Charges = 10; } else { SayTo(from, 1049385); // That doesn't need recharging yet. } } else { player.SendLocalizedMessage(1114333); //You must be young to have this item recharged. } return false; } if (dropped is SchmendrickScrollOfPower) { var obj = qs.FindObjective(typeof (ReturnScrollOfPowerObjective)); if (obj != null && !obj.Completed) { var cont = GetNewContainer(); cont.DropItem(new TreasureMap(player.Young ? 0 : 1, Map.Trammel)); cont.DropItem(new Shovel()); cont.DropItem(new UzeraanTurmoilHorn()); if (!player.PlaceInBackpack(cont)) { cont.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; } dropped.Delete(); obj.Complete(); return true; } } else if (dropped is QuestFertileDirt) { var obj = qs.FindObjective(typeof (ReturnFertileDirtObjective)); if (obj != null && !obj.Completed) { var cont = GetNewContainer(); if (player.Profession == 2) // magician { cont.DropItem(new BlackPearl(20)); cont.DropItem(new Bloodmoss(20)); cont.DropItem(new Garlic(20)); cont.DropItem(new Ginseng(20)); cont.DropItem(new MandrakeRoot(20)); cont.DropItem(new Nightshade(20)); cont.DropItem(new SulfurousAsh(20)); cont.DropItem(new SpidersSilk(20)); for (var i = 0; i < 3; i++) cont.DropItem(Loot.RandomScroll(0, 23, SpellbookType.Regular)); } else { cont.DropItem(new Gold(300)); cont.DropItem(new Bandage(25)); for (var i = 0; i < 5; i++) cont.DropItem(new LesserHealPotion()); } if (!player.PlaceInBackpack(cont)) { cont.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; } dropped.Delete(); obj.Complete(); return true; } } else if (dropped is QuestDaemonBlood) { var obj = qs.FindObjective(typeof (ReturnDaemonBloodObjective)); if (obj != null && !obj.Completed) { Item reward; if (player.Profession == 2) // magician { var cont = GetNewContainer(); cont.DropItem(new ExplosionScroll(4)); cont.DropItem(new MagicWizardsHat()); reward = cont; } else { BaseWeapon weapon; switch (Utility.Random(6)) { case 0: weapon = new Broadsword(); break; case 1: weapon = new Cutlass(); break; case 2: weapon = new Katana(); break; case 3: weapon = new Longsword(); break; case 4: weapon = new Scimitar(); break; default: weapon = new VikingSword(); break; } if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(weapon, 3, 20, 40); } else { weapon.DamageLevel = (WeaponDamageLevel) RandomMinMaxScaled(2, 4); weapon.AccuracyLevel = (WeaponAccuracyLevel) RandomMinMaxScaled(2, 4); weapon.DurabilityLevel = (WeaponDurabilityLevel) RandomMinMaxScaled(2, 4); } weapon.Slayer = SlayerName.Silver; reward = weapon; } if (!player.PlaceInBackpack(reward)) { reward.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; } dropped.Delete(); obj.Complete(); return true; } } else if (dropped is QuestDaemonBone) { var obj = qs.FindObjective(typeof (ReturnDaemonBoneObjective)); if (obj != null && !obj.Completed) { var cont = GetNewContainer(); cont.DropItem(new BankCheck(2000)); cont.DropItem(new EnchantedSextant()); if (!player.PlaceInBackpack(cont)) { cont.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; } dropped.Delete(); obj.Complete(); return true; } } } } return base.OnDragDrop(from, dropped); }
protected virtual void EndLockpick(object state) { object[] objs = (object[])state; ILockpickable lockpickable = objs[0] as ILockpickable; Mobile from = objs[1] as Mobile; Item item = (Item)lockpickable; if (!from.InRange(item.GetWorldLocation(), 1)) { return; } if (lockpickable.LockLevel == 0 || lockpickable.LockLevel == -255) { // LockLevel of 0 means that the door can't be picklocked // LockLevel of -255 means it's magic locked item.SendLocalizedMessageTo(from, 502073); // This lock cannot be picked by normal means return; } if (from.Skills[SkillName.Lockpicking].Value < lockpickable.RequiredSkill - SkillBonus) { /* * // Do some training to gain skills * from.CheckSkill( SkillName.Lockpicking, 0, lockpickable.LockLevel );*/ // The LockLevel is higher thant the LockPicking of the player item.SendLocalizedMessageTo(from, 502072); // You don't see how that lock can be manipulated. return; } int maxlevel = lockpickable.MaxLockLevel; int minLevel = lockpickable.LockLevel; if (lockpickable is Skeletonkey) { minLevel -= SkillBonus; maxlevel -= SkillBonus; //regulars subtract the bonus from the max level } if (this is MasterSkeletonKey || from.CheckTargetSkill(SkillName.Lockpicking, lockpickable, minLevel, maxlevel)) { // Success! Pick the lock! OnUse(); item.SendLocalizedMessageTo(from, 502076); // The lock quickly yields to your skill. from.PlaySound(0x4A); lockpickable.LockPick(from); } else { // The player failed to pick the lock BrokeLockPickTest(from); item.SendLocalizedMessageTo(from, 502075); // You are unable to pick the lock. if (item is TreasureMapChest chest) { if (TreasureMapInfo.NewSystem) { if (!chest.FailedLockpick) { chest.FailedLockpick = true; } } else if (chest.Items.Count > 0 && 0.25 > Utility.RandomDouble()) { Item toBreak = chest.Items[Utility.Random(chest.Items.Count)]; if (!(toBreak is Container)) { toBreak.Delete(); Effects.PlaySound(item.Location, item.Map, 0x1DE); from.SendMessage(0x20, "The sound of gas escaping is heard from the chest."); } } } } }
public static void PackItem( Mobile m, Item item ) { if( !m.PlaceInBackpack( item ) ) item.Delete(); }
public override bool OnDragDrop(Mobile from, Item item) { if (this.Movable != false) { from.SendMessage("This must be set in your home to use!"); return(false); } else if (item is Bottle || item is Jar || (item is CrystallineJar && item.Name == "crystalline jar")) { from.SendMessage("That is already clean!"); return(false); } else { int jar = 0; int bottle = 0; int crystal = 0; if (item is BaseMixture) { jar = 1; } else if (item is BasePotion) { bottle = 1; } else if (item is AutoResPotion) { bottle = 1; } else if (item is ShieldOfEarthPotion) { jar = 1; } else if (item is WoodlandProtectionPotion) { jar = 1; } else if (item is ProtectiveFairyPotion) { jar = 1; } else if (item is HerbalHealingPotion) { jar = 1; } else if (item is GraspingRootsPotion) { jar = 1; } else if (item is BlendWithForestPotion) { jar = 1; } else if (item is SwarmOfInsectsPotion) { jar = 1; } else if (item is VolcanicEruptionPotion) { jar = 1; } else if (item is TreefellowPotion) { jar = 1; } else if (item is StoneCirclePotion) { jar = 1; } else if (item is DruidicRunePotion) { jar = 1; } else if (item is LureStonePotion) { jar = 1; } else if (item is NaturesPassagePotion) { jar = 1; } else if (item is MushroomGatewayPotion) { jar = 1; } else if (item is RestorativeSoilPotion) { jar = 1; } else if (item is FireflyPotion) { jar = 1; } else if (item is HellsGateScroll) { jar = 1; } else if (item is ManaLeechScroll) { jar = 1; } else if (item is NecroCurePoisonScroll) { jar = 1; } else if (item is NecroPoisonScroll) { jar = 1; } else if (item is NecroUnlockScroll) { jar = 1; } else if (item is PhantasmScroll) { jar = 1; } else if (item is RetchedAirScroll) { jar = 1; } else if (item is SpectreShadowScroll) { jar = 1; } else if (item is UndeadEyesScroll) { jar = 1; } else if (item is VampireGiftScroll) { jar = 1; } else if (item is WallOfSpikesScroll) { jar = 1; } else if (item is BloodPactScroll) { jar = 1; } else if (item is GhostlyImagesScroll) { jar = 1; } else if (item is GhostPhaseScroll) { jar = 1; } else if (item is GraveyardGatewayScroll) { jar = 1; } else if (item is HellsBrandScroll) { jar = 1; } else if (item is MagicalDyes) { bottle = 1; } else if (item is BottleOfAcid) { bottle = 1; } else if (item is CrystallineJar) { crystal = 1; } else if (item is NecroSkinPotion) { jar = 1; } else if (item is UnusualDyes) { jar = 1; } else if (item is OilWood) { bottle = 1; } else if (item is OilAmethyst) { bottle = 1; } else if (item is OilCaddellite) { bottle = 1; } else if (item is OilEmerald) { bottle = 1; } else if (item is OilGarnet) { bottle = 1; } else if (item is OilIce) { bottle = 1; } else if (item is OilJade) { bottle = 1; } else if (item is OilLeather) { bottle = 1; } else if (item is OilMarble) { bottle = 1; } else if (item is OilMetal) { bottle = 1; } else if (item is OilOnyx) { bottle = 1; } else if (item is OilQuartz) { bottle = 1; } else if (item is OilRuby) { bottle = 1; } else if (item is OilSapphire) { bottle = 1; } else if (item is OilSilver) { bottle = 1; } else if (item is OilSpinel) { bottle = 1; } else if (item is OilStarRuby) { bottle = 1; } else if (item is OilTopaz) { bottle = 1; } else if (item is OilWood) { bottle = 1; } else if (item is UnknownLiquid) { bottle = 1; } else if (item is BottleOfParts) { jar = 1; } else if (item is BeverageBottle) { bottle = 1; } if (jar > 0 || bottle > 0 || crystal > 0) { string cleaned = "bottle"; string plural = ""; int give = 1; if (item.Amount > 1) { give = item.Amount; plural = "s"; } if (jar > 0) { cleaned = "jar"; from.AddToBackpack(new Jar(give)); } else if (crystal > 0) { cleaned = "crystalline flask"; from.AddToBackpack(new CrystallineJar()); } else { cleaned = "bottle"; from.AddToBackpack(new Bottle(give)); } cleaned = cleaned + plural; from.SendMessage("You thoroughly wash the " + cleaned + "."); from.PlaySound(0x026); this.Hue = Utility.RandomColor(0); item.Delete(); return(true); } else { from.SendMessage("This is for washing alchemical and herbalist containers."); return(false); } } }
private bool Resmelt(Mobile from, Item item, CraftResource resource) { try { if (CraftResources.GetType(resource) != CraftResourceType.Metal) { return(false); } CraftResourceInfo info = CraftResources.GetInfo(resource); if (info == null || info.ResourceTypes.Length == 0) { return(false); } CraftItem craftItem = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(item.GetType()); if (craftItem == null || craftItem.Resources.Count == 0) { return(false); } CraftRes craftResource = craftItem.Resources.GetAt(0); if (craftResource.Amount < 2) { return(false); // Not enough metal to resmelt } double difficulty = 0.0; switch (resource) { case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } Type resourceType = info.ResourceTypes[0]; Item ingot = (Item)Activator.CreateInstance(resourceType); double skill = Math.Max(from.Skills[SkillName.Mining].Value, from.Skills[SkillName.Blacksmith].Value); if (item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed)) { if (skill > 100.0) { skill = 100.0; } double amount = (((4 + skill) * craftResource.Amount - 4) * 0.0068); if (amount < 2) { ingot.Amount = 2; } else { ingot.Amount = (int)amount; } } else { ingot.Amount = 2; } if (difficulty > skill) { m_Failure = true; ingot.Delete(); } else { item.Delete(); } from.AddToBackpack(ingot); from.PlaySound(0x2A); from.PlaySound(0x240); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
protected override void OnTick() { Item item = (Item)m_Item; if (!m_From.InRange(item.GetWorldLocation(), 1)) { return; } if (m_Item.LockLevel == 0 || m_Item.LockLevel == -255) { // LockLevel of 0 means that the door can't be picklocked // LockLevel of -255 means it's magic locked item.SendLocalizedMessageTo(m_From, 502073); // This lock cannot be picked by normal means return; } if (m_From.Skills[SkillName.Lockpicking].Value < m_Item.RequiredSkill) { /* * // Do some training to gain skills * m_From.CheckSkill( SkillName.Lockpicking, 0, m_Item.LockLevel );*/ // The LockLevel is higher thant the LockPicking of the player m_From.SendMessage("Trying to manipulate the contraption resulted in a broken lockpick."); m_Lockpick.Consume(); return; } if (m_From.CheckTargetSkill(SkillName.Lockpicking, m_Item, m_Item.LockLevel, m_Item.MaxLockLevel)) { // Success! Pick the lock! m_From.SendMessage("Woot! You succeed at picking the lock."); m_From.PlaySound(0x4A); m_Item.LockPick(m_From); } else { // The player failed to pick the lock BrokeLockPickTest(); item.SendLocalizedMessageTo(m_From, 502075); // You are unable to pick the lock. // ==== Random Item Disintergration upon Failure ==== if ((Core.SA) && m_Item is TreasureMapChest) { int i_Num = 0; Item i_Destroy = null; BaseContainer m_chest = m_Item as BaseContainer; Item Dust = new DustPile(); for (int i = 10; i > 0; i--) { i_Num = Utility.Random(m_chest.Items.Count); // Make sure DustPiles aren't called for destruction if ((m_chest.Items.Count > 0) && m_chest.Items[i_Num] is DustPile) { for (int ci = (m_chest.Items.Count - 1); ci >= 0; ci--) { i_Num = ci; if (i_Num < 0) { i_Num = 0; } if (m_chest.Items[i_Num] is DustPile) { i_Destroy = null; } else { i_Destroy = m_chest.Items[i_Num]; i_Num = i_Num; i = 0; } // Nothing left but Dust if (ci < 0 && i > 0) { i_Destroy = null; i = 0; } } } // Item targetted =+= prepare for object DOOM! >;D else { i_Destroy = m_chest.Items[i_Num]; i = 0; } } // Delete chosen Item and drop a Dust Pile if (i_Destroy is Gold) { if (i_Destroy.Amount > 1000) { i_Destroy.Amount -= 1000; } else { i_Destroy.Delete(); } Dust.Hue = 1177; m_chest.DropItem(Dust); } else if (i_Destroy != null) { i_Destroy.Delete(); m_chest.DropItem(Dust); } Effects.PlaySound(m_chest.Location, m_chest.Map, 0x1DE); m_chest.PublicOverheadMessage(MessageType.Regular, 2004, false, "The sound of gas escaping is heard from the chest."); } } }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is LargeBOD || dropped is SmallBOD) { if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1062385); // You must have the book in your backpack to add deeds to it. return false; } else if (!from.Backpack.CheckHold(from, dropped, true, true)) return false; else if (m_Entries.Count < 500) { if (dropped is LargeBOD) m_Entries.Add(new BOBLargeEntry((LargeBOD)dropped)); else if (dropped is SmallBOD) // Sanity m_Entries.Add(new BOBSmallEntry((SmallBOD)dropped)); InvalidateProperties(); if (m_Entries.Count / 5 > m_ItemCount) { m_ItemCount++; InvalidateItems(); } from.SendSound(0x42, GetWorldLocation()); from.SendLocalizedMessage(1062386); // Deed added to book. if (from is PlayerMobile) from.SendGump(new BOBGump((PlayerMobile)from, this)); dropped.Delete(); return true; } else { from.SendLocalizedMessage(1062387); // The book is full of deeds. return false; } } from.SendLocalizedMessage(1062388); // That is not a bulk order deed. return false; }
protected override void OnTick() { gate.Delete(); Stop(); }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToOrthal ) { dropped.Delete(); mobile.SendGump( new OrthalStartGump( mobile )); return true; } if( dropped is HeadOfBritainLettuce ) { dropped.Delete(); mobile.AddToBackpack( new EnchantedRope() ); mobile.AddToBackpack( new LetterToKyvon() ); mobile.SendGump( new OrthalFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
public void EndCombine(Mobile from, object o) { if (o is Item && (((Item)o).IsChildOf(from.Backpack) || ((Item)o).IsChildOf(from.BankBox))) { Item curItem = o as Item; if (curItem is CottonSeed) { if (CottonSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((CottonSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { CottonSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is FlaxSeed) { if (FlaxSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((FlaxSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { FlaxSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is HaySeed) { if (HaySeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((HaySeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { HaySeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is OatsSeed) { if (OatsSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((OatsSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { OatsSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is RiceSeed) { if (RiceSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((RiceSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { RiceSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is SugarcaneSeed) { if (SugarcaneSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((SugarcaneSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { SugarcaneSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is WheatSeed) { if (WheatSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((WheatSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { WheatSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is BitterHopsSeed) { if (BitterHopsSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((BitterHopsSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { BitterHopsSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is ElvenHopsSeed) { if (ElvenHopsSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((ElvenHopsSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { ElvenHopsSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is SnowHopsSeed) { if (SnowHopsSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((SnowHopsSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { SnowHopsSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } else if (curItem is SweetHopsSeed) { if (SweetHopsSeed + curItem.Amount > StorageLimit) { from.SendMessage("You are trying to add " + ((SweetHopsSeed + curItem.Amount) - m_StorageLimit) + " too much! The warehouse can store only " + m_StorageLimit + " of this resource."); } else { SweetHopsSeed += curItem.Amount; curItem.Delete(); from.SendGump(new FarmersSeedBoxGump((PlayerMobile)from, this)); BeginCombine(from); } } } else { from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it. } }
public static void IDItem(Mobile from, Item examine, object o, bool automatic) { if (!examine.Movable) { from.SendMessage("That cannot move so you cannot identify it."); } else if (!from.InRange(examine.GetWorldLocation(), 3)) { from.SendMessage("You will need to get closer to identify that."); } else if (!(examine.IsChildOf(from.Backpack)) && Server.Misc.MyServerSettings.IdentifyItemsOnlyInPack()) { from.SendMessage("This must be in your backpack to identify."); } else if ((examine is UnknownLiquid) || (examine is UnknownReagent) || (examine is UnknownKeg)) { from.SendMessage("You need to use Taste Identification to identify that."); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (examine is UnknownScroll) { bool CanID = automatic; int bonus = 0; if (from.CheckTargetSkill(SkillName.ItemID, o, -5, 120)) { CanID = true; } if (from.Skills[SkillName.Inscribe].Base >= 5) { if (from.CheckSkill(SkillName.Inscribe, 0, 120)) { CanID = true; } bonus = 1; if (from.Skills[SkillName.Inscribe].Base >= 50) { bonus = 2; } } if (examine is LibraryScroll1 || examine is LibraryScroll2 || examine is LibraryScroll3 || examine is LibraryScroll4 || examine is LibraryScroll5 || examine is LibraryScroll6) { bonus = 0; } if (CanID) { from.PlaySound(0x249); if (Utility.RandomMinMax(1, 100) > 10) { UnknownScroll rolls = (UnknownScroll)examine; int scrollLevel = rolls.ScrollLevel + bonus; if (scrollLevel > 6) { scrollLevel = 6; } int paperType = 1; if (rolls.ScrollType == 1) // MAGERY { if (scrollLevel == 2) { paperType = Utility.RandomMinMax(13, 24); } else if (scrollLevel == 3) { paperType = Utility.RandomMinMax(25, 36); } else if (scrollLevel == 4) { paperType = Utility.RandomMinMax(37, 48); } else if (scrollLevel == 5) { paperType = Utility.RandomMinMax(49, 60); } else if (scrollLevel == 6) { paperType = Utility.RandomMinMax(57, 64); } else { paperType = Utility.RandomMinMax(1, 12); } } else if (rolls.ScrollType == 3) // BARD { paperType = Utility.RandomMinMax(82, 97); } else { if (scrollLevel == 2) { paperType = Utility.RandomMinMax(68, 70); } else if (scrollLevel == 3) { paperType = Utility.RandomMinMax(71, 73); } else if (scrollLevel == 4) { paperType = Utility.RandomMinMax(74, 76); } else if (scrollLevel == 5) { paperType = Utility.RandomMinMax(77, 79); } else if (scrollLevel == 6) { paperType = Utility.RandomMinMax(80, 81); } else { paperType = Utility.RandomMinMax(65, 67); } } string paperName = ""; if (paperType == 1) { from.AddToBackpack(new ReactiveArmorScroll()); paperName = "reactive armor"; } else if (paperType == 2) { from.AddToBackpack(new ClumsyScroll()); paperName = "clumsy"; } else if (paperType == 3) { from.AddToBackpack(new CreateFoodScroll()); paperName = "create food"; } else if (paperType == 4) { from.AddToBackpack(new FeeblemindScroll()); paperName = "feeblemind"; } else if (paperType == 5) { from.AddToBackpack(new HealScroll()); paperName = "heal"; } else if (paperType == 6) { from.AddToBackpack(new MagicArrowScroll()); paperName = "magic arrow"; } else if (paperType == 7) { from.AddToBackpack(new NightSightScroll()); paperName = "night sight"; } else if (paperType == 8) { from.AddToBackpack(new WeakenScroll()); paperName = "weaken"; } else if (paperType == 9) { from.AddToBackpack(new AgilityScroll()); paperName = "agility"; } else if (paperType == 10) { from.AddToBackpack(new CunningScroll()); paperName = "cunning"; } else if (paperType == 11) { from.AddToBackpack(new CureScroll()); paperName = "cure"; } else if (paperType == 12) { from.AddToBackpack(new HarmScroll()); paperName = "harm"; } else if (paperType == 13) { from.AddToBackpack(new MagicTrapScroll()); paperName = "magic trap"; } else if (paperType == 14) { from.AddToBackpack(new MagicUnTrapScroll()); paperName = "magic untrap"; } else if (paperType == 15) { from.AddToBackpack(new ProtectionScroll()); paperName = "protection"; } else if (paperType == 16) { from.AddToBackpack(new StrengthScroll()); paperName = "strength"; } else if (paperType == 17) { from.AddToBackpack(new BlessScroll()); paperName = "bless"; } else if (paperType == 18) { from.AddToBackpack(new FireballScroll()); paperName = "fireball"; } else if (paperType == 19) { from.AddToBackpack(new MagicLockScroll()); paperName = "magic lock"; } else if (paperType == 20) { from.AddToBackpack(new PoisonScroll()); paperName = "poison"; } else if (paperType == 21) { from.AddToBackpack(new TelekinisisScroll()); paperName = "telekinesis"; } else if (paperType == 22) { from.AddToBackpack(new TeleportScroll()); paperName = "teleport"; } else if (paperType == 23) { from.AddToBackpack(new UnlockScroll()); paperName = "unlock"; } else if (paperType == 24) { from.AddToBackpack(new WallOfStoneScroll()); paperName = "wall of stone"; } else if (paperType == 25) { from.AddToBackpack(new ArchCureScroll()); paperName = "arch cure"; } else if (paperType == 26) { from.AddToBackpack(new ArchProtectionScroll()); paperName = "arch protection"; } else if (paperType == 27) { from.AddToBackpack(new CurseScroll()); paperName = "curse"; } else if (paperType == 28) { from.AddToBackpack(new FireFieldScroll()); paperName = "fire field"; } else if (paperType == 29) { from.AddToBackpack(new GreaterHealScroll()); paperName = "greater heal"; } else if (paperType == 30) { from.AddToBackpack(new LightningScroll()); paperName = "lightning"; } else if (paperType == 31) { from.AddToBackpack(new ManaDrainScroll()); paperName = "mana drain"; } else if (paperType == 32) { from.AddToBackpack(new RecallScroll()); paperName = "recall"; } else if (paperType == 33) { from.AddToBackpack(new BladeSpiritsScroll()); paperName = "blade spirits"; } else if (paperType == 34) { from.AddToBackpack(new DispelFieldScroll()); paperName = "dispel field"; } else if (paperType == 35) { from.AddToBackpack(new IncognitoScroll()); paperName = "incognito"; } else if (paperType == 36) { from.AddToBackpack(new MagicReflectScroll()); paperName = "magic reflect"; } else if (paperType == 37) { from.AddToBackpack(new MindBlastScroll()); paperName = "mind blast"; } else if (paperType == 38) { from.AddToBackpack(new ParalyzeScroll()); paperName = "paralyze"; } else if (paperType == 39) { from.AddToBackpack(new PoisonFieldScroll()); paperName = "poison field"; } else if (paperType == 40) { from.AddToBackpack(new SummonCreatureScroll()); paperName = "summon creature"; } else if (paperType == 41) { from.AddToBackpack(new DispelScroll()); paperName = "dispel"; } else if (paperType == 42) { from.AddToBackpack(new EnergyBoltScroll()); paperName = "energy bolt"; } else if (paperType == 43) { from.AddToBackpack(new ExplosionScroll()); paperName = "explosion"; } else if (paperType == 44) { from.AddToBackpack(new InvisibilityScroll()); paperName = "invisibility"; } else if (paperType == 45) { from.AddToBackpack(new MarkScroll()); paperName = "mark"; } else if (paperType == 46) { from.AddToBackpack(new MassCurseScroll()); paperName = "mass curse"; } else if (paperType == 47) { from.AddToBackpack(new ParalyzeFieldScroll()); paperName = "paralyze field"; } else if (paperType == 48) { from.AddToBackpack(new RevealScroll()); paperName = "reveal"; } else if (paperType == 49) { from.AddToBackpack(new ChainLightningScroll()); paperName = "chain lightning"; } else if (paperType == 50) { from.AddToBackpack(new EnergyFieldScroll()); paperName = "energy field"; } else if (paperType == 51) { from.AddToBackpack(new FlamestrikeScroll()); paperName = "flamestrike"; } else if (paperType == 52) { from.AddToBackpack(new GateTravelScroll()); paperName = "gate travel"; } else if (paperType == 53) { from.AddToBackpack(new ManaVampireScroll()); paperName = "mana vampire"; } else if (paperType == 54) { from.AddToBackpack(new MassDispelScroll()); paperName = "mass dispel"; } else if (paperType == 55) { from.AddToBackpack(new MeteorSwarmScroll()); paperName = "meteor swarm"; } else if (paperType == 56) { from.AddToBackpack(new PolymorphScroll()); paperName = "polymorph"; } else if (paperType == 57) { from.AddToBackpack(new EarthquakeScroll()); paperName = "earthquake"; } else if (paperType == 58) { from.AddToBackpack(new EnergyVortexScroll()); paperName = "energy vortex"; } else if (paperType == 59) { from.AddToBackpack(new ResurrectionScroll()); paperName = "resurrection"; } else if (paperType == 60) { from.AddToBackpack(new SummonAirElementalScroll()); paperName = "summon air elemental"; } else if (paperType == 61) { from.AddToBackpack(new SummonDaemonScroll()); paperName = "summon daemon"; } else if (paperType == 62) { from.AddToBackpack(new SummonEarthElementalScroll()); paperName = "summon earth elemental"; } else if (paperType == 63) { from.AddToBackpack(new SummonFireElementalScroll()); paperName = "summon fire elemental"; } else if (paperType == 64) { from.AddToBackpack(new SummonWaterElementalScroll()); paperName = "summon water elemental"; } else if (paperType == 65) { from.AddToBackpack(new CurseWeaponScroll()); paperName = "curse weapon"; } else if (paperType == 66) { from.AddToBackpack(new BloodOathScroll()); paperName = "blood oath"; } else if (paperType == 67) { from.AddToBackpack(new CorpseSkinScroll()); paperName = "corpse skin"; } else if (paperType == 68) { from.AddToBackpack(new EvilOmenScroll()); paperName = "evil omen"; } else if (paperType == 69) { from.AddToBackpack(new PainSpikeScroll()); paperName = "pain spike"; } else if (paperType == 70) { from.AddToBackpack(new WraithFormScroll()); paperName = "wraith form"; } else if (paperType == 71) { from.AddToBackpack(new MindRotScroll()); paperName = "mind rot"; } else if (paperType == 72) { from.AddToBackpack(new SummonFamiliarScroll()); paperName = "summon familiar"; } else if (paperType == 73) { from.AddToBackpack(new AnimateDeadScroll()); paperName = "animate dead"; } else if (paperType == 74) { from.AddToBackpack(new HorrificBeastScroll()); paperName = "horrific beast"; } else if (paperType == 75) { from.AddToBackpack(new PoisonStrikeScroll()); paperName = "poison strike"; } else if (paperType == 76) { from.AddToBackpack(new WitherScroll()); paperName = "wither"; } else if (paperType == 77) { from.AddToBackpack(new StrangleScroll()); paperName = "strangle"; } else if (paperType == 78) { from.AddToBackpack(new LichFormScroll()); paperName = "lich form"; } else if (paperType == 79) { from.AddToBackpack(new ExorcismScroll()); paperName = "exorcism"; } else if (paperType == 80) { from.AddToBackpack(new VengefulSpiritScroll()); paperName = "vengeful spirit"; } else if (paperType == 81) { from.AddToBackpack(new VampiricEmbraceScroll()); paperName = "vampiric embrace"; } else if (paperType == 82) { from.AddToBackpack(new ArmysPaeonScroll()); paperName = "army's paeon sheet music"; } else if (paperType == 83) { from.AddToBackpack(new EnchantingEtudeScroll()); paperName = "enchanting etude sheet music"; } else if (paperType == 84) { from.AddToBackpack(new EnergyCarolScroll()); paperName = "energy carol sheet music"; } else if (paperType == 85) { from.AddToBackpack(new EnergyThrenodyScroll()); paperName = "energy threnody sheet music"; } else if (paperType == 86) { from.AddToBackpack(new FireCarolScroll()); paperName = "fire carol sheet music"; } else if (paperType == 87) { from.AddToBackpack(new FireThrenodyScroll()); paperName = "fire threnody sheet music"; } else if (paperType == 88) { from.AddToBackpack(new FoeRequiemScroll()); paperName = "foe requiem sheet music"; } else if (paperType == 89) { from.AddToBackpack(new IceCarolScroll()); paperName = "ice carol sheet music"; } else if (paperType == 90) { from.AddToBackpack(new IceThrenodyScroll()); paperName = "ice threnody sheet music"; } else if (paperType == 91) { from.AddToBackpack(new KnightsMinneScroll()); paperName = "knight's minne sheet music"; } else if (paperType == 92) { from.AddToBackpack(new MagesBalladScroll()); paperName = "mage's ballad sheet music"; } else if (paperType == 93) { from.AddToBackpack(new MagicFinaleScroll()); paperName = "magic finale sheet music"; } else if (paperType == 94) { from.AddToBackpack(new PoisonCarolScroll()); paperName = "poison carol sheet music"; } else if (paperType == 95) { from.AddToBackpack(new PoisonThrenodyScroll()); paperName = "poison threnody sheet music"; } else if (paperType == 96) { from.AddToBackpack(new SheepfoeMamboScroll()); paperName = "shepherd's dance sheet music"; } else { from.AddToBackpack(new SinewyEtudeScroll()); paperName = "sinewy etude sheet music"; } from.SendMessage("This seems to be a scroll of " + paperName + "."); } else { string paperName = "useless scribbles"; switch (Utility.RandomMinMax(1, 6)) { case 1: paperName = "useless scribbles"; break; case 2: paperName = "a useless recipe"; break; case 3: paperName = "a useless list of monsters"; break; case 4: paperName = "useless writings"; break; case 5: paperName = "a useless drawing"; break; case 6: paperName = "a useless map"; break; } from.SendMessage("This seems to be " + paperName + "."); } } else { int nReaction = Utility.RandomMinMax(0, 10); if (nReaction > 8) { from.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist); from.PlaySound(0x205); int nPoison = Utility.RandomMinMax(0, 10); if (nPoison > 9) { from.ApplyPoison(from, Poison.Deadly); } else if (nPoison > 7) { from.ApplyPoison(from, Poison.Greater); } else if (nPoison > 4) { from.ApplyPoison(from, Poison.Regular); } else { from.ApplyPoison(from, Poison.Lesser); } from.SendMessage("You accidentally trigger a poison spell!"); } else if (nReaction > 6) { from.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); from.PlaySound(0x208); Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.RandomMinMax(5, 40), 0, 100, 0, 0, 0); from.SendMessage("You accidentally trigger a fire spell!"); } else if (nReaction > 4) { from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); from.PlaySound(0x307); Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.RandomMinMax(5, 40), 0, 100, 0, 0, 0); from.SendMessage("You accidentally trigger an explosion spell!"); } else { from.SendMessage("Failing to read the scroll, you throw it out."); } } examine.Delete(); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (examine is UnknownWand) { if (from.CheckTargetSkill(SkillName.ItemID, o, -5, 120) || automatic) { Server.Items.UnknownWand.WandType(examine, from, from); } else { int nReaction = Utility.RandomMinMax(0, 10); if (nReaction > 6) { from.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); from.PlaySound(0x208); Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.RandomMinMax(5, 40), 0, 100, 0, 0, 0); from.SendMessage("The wands bursts into flames!"); } else if (nReaction > 4) { from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); from.PlaySound(0x307); Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.RandomMinMax(5, 40), 0, 100, 0, 0, 0); from.SendMessage("The wand explodes in your hands!"); } else { from.SendMessage("Failing to figure out the wand, you throw it out."); } } examine.Delete(); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (examine is UnidentifiedArtifact) { UnidentifiedArtifact relic = (UnidentifiedArtifact)examine; if (relic.IDAttempt > 5 && !automatic) { from.SendMessage("Only a vendor can identify this item now as too many attempts were made."); } else if (from.CheckTargetSkill(SkillName.ItemID, o, -5, 120) || automatic) { Container pack = (Container)relic; List <Item> items = new List <Item>(); foreach (Item item in pack.Items) { items.Add(item); } foreach (Item item in items) { from.AddToBackpack(item); } from.SendMessage("You successfully identify the artifact."); relic.Delete(); } else { relic.IDAttempt = relic.IDAttempt + 1; from.SendMessage("You can't seem to identify this artifact."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (examine is UnidentifiedItem) { UnidentifiedItem relic = (UnidentifiedItem)examine; if (relic.IDAttempt > 5 && !automatic) { from.SendMessage("Only a vendor can identify this item now as too many attempts were made."); } else if (relic.SkillRequired != "ItemID" && !automatic) { from.SendMessage("You are using the wrong skill to figure this out."); } else if (from.CheckTargetSkill(SkillName.ItemID, o, -5, 120) || automatic) { Container pack = (Container)relic; List <Item> items = new List <Item>(); foreach (Item item in pack.Items) { items.Add(item); } foreach (Item item in items) { from.AddToBackpack(item); } from.SendMessage("You successfully identify the item."); relic.Delete(); } else { relic.IDAttempt = relic.IDAttempt + 1; from.SendMessage("You can't seem to identify this item."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (Server.Misc.RelicItems.IsRelicItem(examine) == true) { from.SendMessage(Server.Misc.RelicItems.IdentifyRelicValue(from, from, examine)); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (o is Item) { if (o is BaseWeapon || o is BaseArmor) { from.SendMessage("You will need to use arms lore on that type of item."); } else { from.SendMessage("This item has already been examined by someone."); } } else if (o is Mobile) { ((Mobile)o).OnSingleClick(from); } else { from.SendLocalizedMessage(500353); // You are not certain... } }
protected override void OnTick() { m_IceBlock.Delete(); }
protected override void OnTick() { if (m_Item.Deleted) { return; } Mobile spawn; switch (Utility.Random(12)) { default: case 0: spawn = new Skeleton(); break; case 1: spawn = new Zombie(); break; case 2: spawn = new Wraith(); break; case 3: spawn = new Spectre(); break; case 4: spawn = new Ghoul(); break; case 5: spawn = new Mummy(); break; case 6: spawn = new Bogle(); break; case 7: spawn = new RottingCorpse(); break; case 8: spawn = new BoneKnight(); break; case 9: spawn = new SkeletalKnight(); break; case 10: spawn = new Lich(); break; case 11: spawn = new LichLord(); break; } spawn.MoveToWorld(m_Item.Location, m_Item.Map); m_Item.Delete(); }
public static bool GetColor(Item item, Mobile from) { bool machineWorked = false; string name = ""; int color = 0; string material = ""; if ((item.Name).Contains("Beskar")) { material = "Beskar"; } else if ((item.Name).Contains("Carbonite")) { material = "Carbonite"; } else if ((item.Name).Contains("Phrik")) { material = "Phrik"; } else if ((item.Name).Contains("Cortosis")) { material = "Cortosis"; } else if ((item.Name).Contains("Songsteel")) { material = "Songsteel"; } else if ((item.Name).Contains("Agrinium")) { material = "Agrinium"; } else if ((item.Name).Contains("Durasteel")) { material = "Durasteel"; } else if ((item.Name).Contains("Titanium")) { material = "Titanium"; } else if ((item.Name).Contains("Laminasteel")) { material = "Laminasteel"; } else if ((item.Name).Contains("Neuranium")) { material = "Neuranium"; } else if ((item.Name).Contains("Promethium")) { material = "Promethium"; } else if ((item.Name).Contains("Quadranium")) { material = "Quadranium"; } else if ((item.Name).Contains("Durite")) { material = "Durite"; } else if ((item.Name).Contains("Farium")) { material = "Farium"; } else if ((item.Name).Contains("Trimantium")) { material = "Trimantium"; } else if ((item.Name).Contains("Xonolite")) { material = "Xonolite"; } else if ((item.Name).Contains("Veshok")) { material = "Veshok"; } else if ((item.Name).Contains("Cosian")) { material = "Cosian"; } else if ((item.Name).Contains("Greel")) { material = "Greel"; } else if ((item.Name).Contains("Teej")) { material = "Teej"; } else if ((item.Name).Contains("Kyshyyyk")) { material = "Kyshyyyk"; } else if ((item.Name).Contains("Laroon")) { material = "Laroon"; } else if ((item.Name).Contains("Borl")) { material = "Borl"; } else if ((item.Name).Contains("Japor")) { material = "Japor"; } else if ((item.Name).Contains("Adesote")) { material = "Adesote"; } else if ((item.Name).Contains("Nylonite")) { material = "Nylonite"; } else if ((item.Name).Contains("Biomesh")) { material = "Biomesh"; } else if ((item.Name).Contains("Cerlin")) { material = "Cerlin"; } else if ((item.Name).Contains("Polyfiber")) { material = "Polyfiber"; } else if ((item.Name).Contains("Durafiber")) { material = "Durafiber"; } else if ((item.Name).Contains("Syncloth")) { material = "Syncloth"; } else if ((item.Name).Contains("Hypercloth")) { material = "Hypercloth"; } else if ((item.Name).Contains("Flexicris")) { material = "Flexicris"; } else if ((item.Name).Contains("Thermoweave")) { material = "Thermoweave"; } else if ((item.Name).Contains("Nylar")) { material = "Nylar"; } else if ((item.Name).Contains("Twi'lek")) { material = "Twi'lek"; } else if ((item.Name).Contains("Rodian")) { material = "Rodian"; } else if ((item.Name).Contains("Martian")) { material = "Martian"; } else if ((item.Name).Contains("Cardassian")) { material = "Cardassian"; } else if ((item.Name).Contains("Xindi")) { material = "Xindi"; } else if ((item.Name).Contains("Tusken")) { material = "Tusken"; } else if ((item.Name).Contains("Andorian")) { material = "Andorian"; } else if ((item.Name).Contains("Zabrak")) { material = "Zabrak"; } color = Server.Misc.MaterialInfo.GetSpaceAceColors(material); if (color == 0x6F6) { name = "Rodian Green Dye"; machineWorked = true; } else if (color == 0x6F8) { name = "Veshok Gray Dye"; machineWorked = true; } else if (color == 0x701) { name = "Zabrak Red Dye"; machineWorked = true; } else if (color == 0x705) { name = "Kyshyyyk Gold Dye"; machineWorked = true; } else if (color == 0x776) { name = "Tusken Yellow Dye"; machineWorked = true; } else if (color == 0x77F) { name = "Martian Green Dye"; machineWorked = true; } else if (color == 0x7A9) { name = "Durasteel Gray Dye"; machineWorked = true; } else if (color == 0x825) { name = "Andorian Blue Dye"; machineWorked = true; } else if (color == 0x829) { name = "Carbonite Gray Dye"; machineWorked = true; } else if (color == 0x82C) { name = "Cortosis Purple Dye"; machineWorked = true; } else if (color == 0x870) { name = "Neuranium Red Dye"; machineWorked = true; } else if (color == 0x877) { name = "Xindi Gray Dye"; machineWorked = true; } else if (color == 0x8C1) { name = "Agrinium Gray Dye"; machineWorked = true; } else if (color == 0x8D7) { name = "Titanium Blue Dye"; machineWorked = true; } else if (color == 0xAF8) { name = "Twi'lek Purple Dye"; machineWorked = true; } else if (color == 0xB42) { name = "Songsteel White Dye"; machineWorked = true; } if (machineWorked) { from.RevealingAction(); from.PlaySound(0x23E); Item bottle = from.Backpack.FindItemByType(typeof(Bottle)); if (bottle.Amount > 1) { bottle.Amount = bottle.Amount - 1; } else { bottle.Delete(); } from.SendMessage("You place a vial of " + name + " in your pack."); SpaceDyes vial = new SpaceDyes(); vial.Name = name; vial.Hue = color; vial.vialHue = color; from.AddToBackpack(vial); } return(machineWorked); }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToArathan ) { dropped.Delete(); mobile.SendGump( new ArathanStartGump( mobile )); return true; } if( dropped is SeafaringBracelet ) { dropped.Delete(); mobile.AddToBackpack( new GemOfControl() ); mobile.SendGump( new ArathanFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
protected override void GenerateTreasure() { this.DropItem(new Gold(600, 900)); List <Item> gems = new List <Item>(); for (int i = 0; i < 9; i++) { Item gem = Loot.RandomGem(); Type gemType = gem.GetType(); foreach (Item listGem in gems) { if (listGem.GetType() == gemType) { listGem.Amount++; gem.Delete(); break; } } if (!gem.Deleted) { gems.Add(gem); } } foreach (Item gem in gems) { this.DropItem(gem); } if (0.2 > Utility.RandomDouble()) { this.DropItem(new BagOfReagents(50)); } for (int i = 0; i < 2; i++) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } this.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } this.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); } this.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); this.DropItem(item); } } this.Solution = new PuzzleChestSolution(); }
protected override void OnTick() { m_terre.Delete(); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (!HasAccess(from)) { from.SendLocalizedMessage(1073821); // You do not have access to that item for use with the aquarium. return(false); } if (m_VacationLeft > 0) { from.SendLocalizedMessage(1074427); // The aquarium is in vacation mode. return(false); } bool takeItem = true; if (dropped is FishBowl) { FishBowl bowl = (FishBowl)dropped; if (bowl.Empty || !AddFish(from, bowl.Fish)) { return(false); } bowl.InvalidateProperties(); takeItem = false; } else if (dropped is BaseFish) { BaseFish fish = (BaseFish)dropped; if (!AddFish(from, fish)) { return(false); } } else if (dropped is VacationWafer) { m_VacationLeft = VacationWafer.VacationDays; dropped.Delete(); from.SendLocalizedMessage(1074428, m_VacationLeft.ToString()); // The aquarium will be in vacation mode for ~1_DAYS~ days } else if (dropped is AquariumFood) { m_Food.Added += 1; dropped.Delete(); from.SendLocalizedMessage(1074259, "1"); // ~1_NUM~ unit(s) of food have been added to the aquarium. } else if (dropped is BaseBeverage) { BaseBeverage beverage = (BaseBeverage)dropped; if (beverage.IsEmpty || !beverage.Pourable || beverage.Content != BeverageType.Water) { from.SendLocalizedMessage(500840); // Can't pour that in there. return(false); } m_Water.Added += 1; beverage.Quantity -= 1; from.PlaySound(0x4E); from.SendLocalizedMessage(1074260, "1"); // ~1_NUM~ unit(s) of water have been added to the aquarium. takeItem = false; } else if (!AddDecoration(from, dropped)) { takeItem = false; } from.CloseGump(typeof(AquariumGump)); InvalidateProperties(); if (takeItem) { from.PlaySound(0x42); } return(takeItem); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is RecallRune) { if (this.IsLockedDown && from.AccessLevel < AccessLevel.GameMaster) { from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } else if (this.IsOpen(from)) { from.SendLocalizedMessage(1005571); // You cannot place objects in the book while viewing the contents. } else if (this.m_Entries.Count < 16) { RecallRune rune = (RecallRune)dropped; if (rune.Marked && rune.TargetMap != null) { this.m_Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House)); dropped.Delete(); from.Send(new PlaySound(0x42, this.GetWorldLocation())); string desc = rune.Description; if (desc == null || (desc = desc.Trim()).Length == 0) { desc = "(indescript)"; } from.SendMessage(desc); return(true); } else { from.SendLocalizedMessage(502409); // This rune does not have a marked location. } } else { from.SendLocalizedMessage(502401); // This runebook is full. } } else if (dropped is RecallScroll) { if (this.m_CurCharges < this.m_MaxCharges) { from.Send(new PlaySound(0x249, this.GetWorldLocation())); int amount = dropped.Amount; if (amount > (this.m_MaxCharges - this.m_CurCharges)) { dropped.Consume(this.m_MaxCharges - this.m_CurCharges); this.m_CurCharges = this.m_MaxCharges; } else { this.m_CurCharges += amount; dropped.Delete(); return(true); } } else { from.SendLocalizedMessage(502410); // This book already has the maximum amount of charges. } } return(false); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (info.ButtonID == 1) { from.AddToBackpack(new HolidayTreeNew1Deed()); m_Tree.Delete(); } else if (info.ButtonID == 2) { from.AddToBackpack(new HolidayTreeNew2Deed()); m_Tree.Delete(); } else if (info.ButtonID == 3) { from.AddToBackpack(new HolidayTreeNew3Deed()); m_Tree.Delete(); } else if (info.ButtonID == 4) { from.AddToBackpack(new HolidayTreeNew4Deed()); m_Tree.Delete(); } else if (info.ButtonID == 5) { from.AddToBackpack(new HolidayTreeNew5Deed()); m_Tree.Delete(); } else if (info.ButtonID == 6) { from.AddToBackpack(new HolidayTreeNew6Deed()); m_Tree.Delete(); } }
protected override void OnTick() { m_Item.Delete(); }
public override void OnDoubleClick(Mobile from) { if (from.Talisman != this) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (m_ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Charges == 0 && m_MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { Type type = GetSummoner(); if (m_Summoner != null && !m_Summoner.IsEmpty) { type = m_Summoner.Type; } if (type != null) { object obj; try { obj = Activator.CreateInstance(type); } catch { obj = null; } if (obj is Item) { Item item = (Item)obj; int count = 1; if (m_Summoner != null && m_Summoner.Amount > 1) { if (item.Stackable) { item.Amount = m_Summoner.Amount; } else { count = m_Summoner.Amount; } } if (from.Backpack == null || count * item.Weight > from.Backpack.MaxWeight || from.Backpack.Items.Count + count > from.Backpack.MaxItems) { from.SendLocalizedMessage(500720); // You don't have enough room in your backpack! item.Delete(); item = null; return; } for (int i = 0; i < count; i++) { from.PlaceInBackpack(item); if (i + 1 < count) { item = Activator.CreateInstance(type) as Item; } } if (item is Board) { from.SendLocalizedMessage(1075000); // You have been given some wooden boards. } else if (item is IronIngot) { from.SendLocalizedMessage(1075001); // You have been given some ingots. } else if (item is Bandage) { from.SendLocalizedMessage(1075002); // You have been given some clean bandages. } else if (m_Summoner != null && m_Summoner.Name != null) { from.SendLocalizedMessage(1074853, m_Summoner.Name.ToString()); // You have been given ~1_name~ } } else if (obj is BaseCreature) { BaseCreature mob = (BaseCreature)obj; if ((m_Creature != null && !m_Creature.Deleted) || from.Followers + mob.ControlSlots > from.FollowersMax) { from.SendLocalizedMessage(1074270); // You have too many followers to summon another one. mob.Delete(); return; } BaseCreature.Summon(mob, from, from.Location, mob.BaseSoundID, TimeSpan.FromMinutes(10)); Effects.SendLocationParticles(EffectItem.Create(mob.Location, mob.Map, EffectItem.DefaultDuration), 0x3728, 1, 10, 0x26B6); mob.Summoned = false; mob.ControlOrder = OrderType.Friend; m_Creature = mob; } OnAfterUse(from); } if (m_Removal != TalismanRemoval.None) { from.Target = new TalismanTarget(this); } } }
public static bool Gold(Mobile from, Item item) { if (item is Gold) { Party party = Party.Get(from); if (party != null) { int dividedGold = item.Amount / party.Members.Count; if (dividedGold > 0) { item.Delete(); for (int j = 0; j < party.Members.Count; j++) { PartyMemberInfo info = party.Members[j] as PartyMemberInfo; if (info != null && info.Mobile != null && info.Mobile is PlayerMobile) { PlayerMobile pm = info.Mobile as PlayerMobile; if (pm.Backpack != null) { if (pm != from) { pm.SendMessage("{0} takes gold from the corpse and divides equally among the party members: {1} for each.", from.Name, dividedGold); } else { pm.SendMessage("You take gold from the corpse and divide equally among the party members: {0} for each.", dividedGold); } Item playerGold = pm.Backpack.FindItemByType(typeof(Gold)); Gold gold = new Gold(dividedGold); if (playerGold != null) { playerGold.Amount += gold.Amount; } else { pm.Backpack.AddItem(gold); } if (pm != from && WeightOverloading.IsOverloaded(pm)) { pm.SendMessage("{0} keeps your share, cause you are overloaded.", from.Name); from.SendMessage("You keep {0}'s share, who is overloaded.", pm.Name); Item goldAdded = pm.Backpack.FindItemByType(typeof(Gold)); goldAdded.Amount -= gold.Amount; Item goldReturned = from.Backpack.FindItemByType(typeof(Gold)); goldReturned.Amount += gold.Amount; } else { pm.PlaySound(gold.GetDropSound()); } } } } return true; } } } return false; }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is RecallRune || dropped is ShipRune) { if (IsLockedDown && from.AccessLevel < AccessLevel.GameMaster) { from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down. } else if (IsOpen(from)) { from.SendLocalizedMessage(1005571); // You cannot place objects in the book while viewing the contents. } else if (m_Entries.Count < MaxEntries) { if (dropped is RecallRune) { RecallRune rune = (RecallRune)dropped; if (rune.Marked && rune.TargetMap != null) { m_Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House)); dropped.Delete(); from.Send(new PlaySound(0x42, GetWorldLocation())); string desc = rune.Description; if (desc == null || (desc = desc.Trim()).Length == 0) { desc = "(indescript)"; } from.SendMessage(desc); return(true); } else { from.SendLocalizedMessage(502409); // This rune does not have a marked location. } } else if (dropped is ShipRune) { ShipRune rune = (ShipRune)dropped; if (rune.Galleon != null && !rune.Galleon.Deleted) { m_Entries.Add(new RunebookEntry(Point3D.Zero, null, rune.Galleon.ShipName, null, rune.Galleon)); dropped.Delete(); from.Send(new PlaySound(0x42, GetWorldLocation())); string desc = rune.Galleon.ShipName; if (desc == null || (desc = desc.Trim()).Length == 0) { desc = "an unnamed ship"; } from.SendMessage(desc); return(true); } else { if (rune.DockedBoat != null) { from.SendMessage("You cannot place a rune to a docked boat in the runebook."); } else { from.SendLocalizedMessage(502409); // This rune does not have a marked location. } } } } else { from.SendLocalizedMessage(502401); // This runebook is full. } } else if (dropped is RecallScroll) { if (m_CurCharges < m_MaxCharges) { from.Send(new PlaySound(0x249, GetWorldLocation())); int amount = dropped.Amount; if (amount > (m_MaxCharges - m_CurCharges)) { dropped.Consume(m_MaxCharges - m_CurCharges); m_CurCharges = m_MaxCharges; } else { m_CurCharges += amount; dropped.Delete(); return(true); } } else { from.SendLocalizedMessage(502410); // This book already has the maximum amount of charges. } } return(false); }
public override void DropItem( Item dropped ) { if( !dropped.EventItem ) base.DropItem( dropped ); else dropped.Delete(); }
public static bool ProcessDragonEgg(Mobile m, Mobile vet, Item dropped) { DragonEgg egg = (DragonEgg)dropped; if (Server.Misc.Worlds.GetRegionName(vet.Map, vet.Location) != egg.AnimalTrainerLocation) { return(false); } int vetSkill = (int)(m.Skills[SkillName.Veterinary].Value); if (vetSkill > 100) { vetSkill = 100; } int GoldReturn = 0; if (vetSkill > 0) { GoldReturn = (int)(egg.NeedGold * (vetSkill * 0.005)); } int HaveIngredients = 0; if (egg.HavePotionB >= 0) { HaveIngredients++; } if (egg.HavePotionC >= 0) { HaveIngredients++; } if (egg.HavePotionD >= 0) { HaveIngredients++; } if (egg.HaveGold >= egg.NeedGold) { HaveIngredients++; } if (egg.HavePotionA >= 0) { HaveIngredients++; } if (HaveIngredients < 5) { return(false); } int followers = 3; if ((dropped.Name).Contains(" dragon")) { followers = 2; } if ((m.Followers + followers) > m.FollowersMax) { vet.Say("You have too many followers with you to hatch this egg."); return(false); } if (GoldReturn > 0) { m.AddToBackpack(new Gold(GoldReturn)); vet.Say("Here is " + GoldReturn.ToString() + " gold back for all of your help."); } BaseCreature dragon = new Dragons(egg.DragonBody, egg.DragonType); dragon.OnAfterSpawn(); dragon.Controlled = true; dragon.ControlMaster = m; dragon.IsBonded = true; dragon.MoveToWorld(m.Location, m.Map); dragon.ControlTarget = m; dragon.YellHue = 1; dragon.ControlOrder = OrderType.Follow; string style = "dragon"; if (followers == 3) { style = "wyrm"; dragon.Name = (dragon.Name).Replace(" dragon", " wyrm"); } LoggingFunctions.LogGenericQuest(m, "has hatched a " + style + ""); m.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Your " + style + " has hatched.", m.NetState); m.PlaySound(0x041); dropped.Delete(); return(true); }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) { from.SendMessage("You are too far away to use that!"); } else { if (ac.ItemID == 0x945) { ac.ItemID = 0x8D4; Effects.PlaySound(from.Location, from.Map, 0x4B9); from.SendMessage("You put out the fireplace!"); } else if (ac.ItemID == 0x8D4) { Container pack = from.Backpack; if (pack == null) { return; } int res = pack.ConsumeTotal( new Type[] { typeof(Log) }, new int[] { 3 }); switch (res) { case 0: { from.SendMessage("You must have 3 logs to put in fireplace"); break; } default: { Effects.PlaySound(from.Location, from.Map, 0x137); from.SendMessage("You put the logs in fireplace!"); ac.ItemID = 0x943; break; } } } else if (ac.ItemID == 0x943) { Item matchlight = from.Backpack.FindItemByType(typeof(MatchLight)); if (matchlight != null) { matchlight.Delete(); ac.ItemID = 0x945; ac.Light = LightType.Circle225; Effects.PlaySound(from.Location, from.Map, 0x4BA); from.SendMessage("You light the fireplace!"); } else { if (matchlight == null) { from.SendMessage("You must have a match to light the fireplace"); } } } else { return; } } }
private bool Resmelt(Mobile from, Item item, CraftResource resource) { try { if (CraftResources.GetType(resource) != CraftResourceType.Metal) { return(false); } CraftResourceInfo info = CraftResources.GetInfo(resource); if (info == null || info.ResourceTypes.Length == 0) { return(false); } CraftItem craftItem = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(item.GetType()); if (craftItem == null || craftItem.Resources.Count == 0) { return(false); } CraftRes craftResource = craftItem.Resources.GetAt(0); if (craftResource.Amount < 2) { return(false); // Not enough metal to resmelt } var difficulty = resource switch { CraftResource.DullCopper => 65.0, CraftResource.ShadowIron => 70.0, CraftResource.Copper => 75.0, CraftResource.Bronze => 80.0, CraftResource.Gold => 85.0, CraftResource.Agapite => 90.0, CraftResource.Verite => 95.0, CraftResource.Valorite => 99.0, _ => 0.0 }; Type resourceType = info.ResourceTypes[0]; Item ingot = (Item)ActivatorUtil.CreateInstance(resourceType); if (item is DragonBardingDeed || (item is BaseArmor armor && armor.PlayerConstructed) || (item is BaseWeapon weapon && weapon.PlayerConstructed) || (item is BaseClothing clothing && clothing.PlayerConstructed)) { double mining = from.Skills.Mining.Value; if (mining > 100.0) { mining = 100.0; } double amount = ((4 + mining) * craftResource.Amount - 4) * 0.0068; if (amount < 2) { ingot.Amount = 2; } else { ingot.Amount = (int)amount; } } else { ingot.Amount = 2; } if (difficulty > from.Skills.Mining.Value) { m_Failure = true; ingot.Delete(); } else { item.Delete(); } from.AddToBackpack(ingot); from.PlaySound(0x2A); from.PlaySound(0x240); return(true); }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { bool creatureWarned = true; if (from.Blessed) { from.SendMessage("You cannot open that while in this state."); } else if (!from.InRange(GetWorldLocation(), 2)) { from.SendMessage("You will have to get closer to open that."); } else if (from.Backpack.FindItemByType(typeof(SearchPage)) != null || from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null || from.Backpack.FindItemByType(typeof(VortexCube)) != null || from.Backpack.FindItemByType(typeof(AlienEgg)) != null || from.Backpack.FindItemByType(typeof(DragonEgg)) != null || from.Backpack.FindItemByType(typeof(CourierMail)) != null) { int EmptyBox = 1; if (from.Backpack.FindItemByType(typeof(CourierMail)) != null) { Item mail = from.Backpack.FindItemByType(typeof(CourierMail)); CourierMail envelope = (CourierMail)mail; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (envelope.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && envelope.owner == from && envelope.DungeonMap == from.Map && envelope.MsgComplete == 0) { envelope.MsgComplete = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + envelope.SearchItem + "."); from.SendSound(0x3D); EmptyBox = 0; } } if (from.Backpack.FindItemByType(typeof(VortexCube)) != null) { Item cubes = from.Backpack.FindItemByType(typeof(VortexCube)); VortexCube cube = (VortexCube)cubes; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (cube.CubeOwner == from) { if (cube.LocationKeyLaw == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyLaw == 0) { cube.HasKeyLaw = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Law!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Key of Law."); EmptyBox = 0; } if (cube.LocationKeyBalance == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyBalance == 0) { cube.HasKeyBalance = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Balance!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Key of Balance."); EmptyBox = 0; } if (cube.LocationKeyChaos == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyChaos == 0) { cube.HasKeyChaos = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Chaos!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Key of Chaos."); EmptyBox = 0; } int crystals = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple; if (crystals < 6 && cube.LocationCrystal == Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) { if (cube.HasCrystalRed == 0) { cube.HasCrystalRed = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the red Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the red Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalBlue == 0) { cube.HasCrystalBlue = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalBlue == 0) { cube.HasCrystalBlue = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalGreen == 0) { cube.HasCrystalGreen = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the green Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the green Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalYellow == 0) { cube.HasCrystalYellow = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the yellow Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the yellow Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalWhite == 0) { cube.HasCrystalWhite = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the white Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the white Void Crystal."); EmptyBox = 0; } else if (cube.HasCrystalPurple == 0) { cube.HasCrystalPurple = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the purple Void Crystal!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the purple Void Crystal."); EmptyBox = 0; } cube.TextCrystal = Server.Items.CubeOnCorpse.GetRumor(); cube.LocationCrystal = Server.Items.CubeOnCorpse.PickDungeon(); int crystal = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple; if (crystal > 5) { cube.TextCrystal = ""; cube.LocationCrystal = ""; } } } } if (from.Backpack.FindItemByType(typeof(AlienEgg)) != null) { Item eggs = from.Backpack.FindItemByType(typeof(AlienEgg)); AlienEgg egg = (AlienEgg)eggs; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) { bool pickNewEggSpot = false; if (egg.HaveRod < 1) { pickNewEggSpot = true; egg.HaveRod = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the rod of amber!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HaveYellowCrystal < 1) { pickNewEggSpot = true; egg.HaveYellowCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the sun crystal!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HaveRedCrystal < 1) { pickNewEggSpot = true; egg.HaveRedCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blood crystal!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HavePotion < 1) { pickNewEggSpot = true; egg.HavePotion = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of growth!"); from.SendSound(0x3D); EmptyBox = 0; } if (pickNewEggSpot) { egg.PieceRumor = Server.Items.CubeOnCorpse.GetRumor(); egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon(); } } } else { EmptyBox++; } if (from.Backpack.FindItemByType(typeof(DragonEgg)) != null) { Item eggs = from.Backpack.FindItemByType(typeof(DragonEgg)); DragonEgg egg = (DragonEgg)eggs; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) { bool pickNewEggSpot = false; if (egg.HavePotionA < 1) { pickNewEggSpot = true; egg.HavePotionA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the elixir of the flame!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HavePotionB < 1) { pickNewEggSpot = true; egg.HavePotionB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of the earth!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HavePotionC < 1) { pickNewEggSpot = true; egg.HavePotionC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the mixture of the sea!"); from.SendSound(0x3D); EmptyBox = 0; } else if (egg.HavePotionD < 1) { pickNewEggSpot = true; egg.HavePotionD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the oil of the winds!"); from.SendSound(0x3D); EmptyBox = 0; } if (pickNewEggSpot) { egg.PieceRumor = Server.Items.CubeOnCorpse.GetRumor(); egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon(); } } } if (from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null) { Container pack = from.Backpack; List <DDRelicTablet> rock = pack.FindItemsByType <DDRelicTablet>(); for (int i = 0; i < rock.Count; ++i) { DDRelicTablet stone = rock[i]; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (stone.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) { if (stone.SearchReal >= Utility.RandomMinMax(1, 100)) { Item item = null; string itemName = stone.SearchType; Type itemType = ScriptCompiler.FindTypeByName(itemName); if (itemType != null) { item = (Item)Activator.CreateInstance(itemType); from.AddToBackpack(item); LoggingFunctions.LogFoundItemQuest(from, stone.SearchItem); from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + stone.SearchItem + "."); from.SendSound(0x3D); } } else if (1 == Utility.RandomMinMax(1, 2)) { Item item = null; string itemName = stone.SearchType; Type itemType = ScriptCompiler.FindTypeByName(itemName); if (itemType != null) { item = (Item)Activator.CreateInstance(itemType); Item fake = new BrokenGear(); fake.ItemID = item.ItemID; fake.Hue = item.Hue; fake.Weight = item.Weight; fake.Name = "Fake " + stone.SearchItem; item.Delete(); from.AddToBackpack(fake); } from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + stone.SearchItem + " appears to be a fake."); from.SendSound(0x5B3); } else { from.SendMessage(""); from.LocalOverheadMessage(MessageType.Emote, 0x22, true, "The tablet for the " + stone.SearchItem + " seems to be false."); from.PlaySound(0x5B3); } from.SendMessage("The tablet crumbles to dust!"); stone.Delete(); EmptyBox = 0; } } } if (from.Backpack.FindItemByType(typeof(SearchPage)) != null) { Item scroll = from.Backpack.FindItemByType(typeof(SearchPage)); SearchPage page = (SearchPage)scroll; int LeadToAnotherSpot = 100 - page.LegendPercent; int monsters = 0; foreach (Mobile monster in this.GetMobilesInRange(5)) { if (monster is BaseCreature) { Mobile leader = ((BaseCreature)monster).GetMaster(); if (leader is PlayerMobile) { } else { ++monsters; } } } if (monsters > 0 && creatureWarned) { creatureWarned = false; from.SendMessage("You cannot open this with too many creatures around."); } else if (LeadToAnotherSpot >= Utility.RandomMinMax(1, 100)) { from.PlaySound(0x249); SearchPage.PickSearchLocation(page, page.SearchDungeon, from); from.SendMessage("You didn't find it, but you did get another clue."); from.SendMessage("so you update your notes for the new place to search."); EmptyBox = 0; } else if (page.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && page.owner == from && page.DungeonMap == from.Map) { if (page.LegendReal == 1) { Item item = null; string itemName = page.SearchType; Type itemType = ScriptCompiler.FindTypeByName(itemName); if (itemType != null) { item = (Item)Activator.CreateInstance(itemType); from.AddToBackpack(item); LoggingFunctions.LogFoundItemQuest(from, page.SearchItem); from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + page.SearchItem + "."); from.SendSound(0x3D); } } else if (page.LegendPercent >= Utility.RandomMinMax(1, 200)) { int nGold = page.LegendPercent * 100; string sGold = nGold.ToString(); from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The legend was false, but there was " + sGold + " gold in here."); from.SendSound(0x2E6); from.AddToBackpack(new Gold(nGold)); } else if (1 == Utility.RandomMinMax(1, 2)) { Item item = null; string itemName = page.SearchType; Type itemType = ScriptCompiler.FindTypeByName(itemName); if (itemType != null) { item = (Item)Activator.CreateInstance(itemType); Item fake = new BrokenGear(); fake.ItemID = item.ItemID; fake.Hue = item.Hue; fake.Weight = item.Weight; fake.Name = "Fake " + page.SearchItem; item.Delete(); from.AddToBackpack(fake); } from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + page.SearchItem + " appears to be a fake."); from.SendSound(0x3D); } else { from.SendMessage(""); from.LocalOverheadMessage(MessageType.Emote, 0x22, true, "The legends of the " + page.SearchItem + " seemed to be false."); from.PlaySound(0x249); } scroll.Delete(); SearchPage.ArtifactQuestTimeAllowed(from); EmptyBox = 0; } } if (EmptyBox == 1) { from.SendMessage("The chest appears to be empty."); } } else { from.SendMessage("The chest appears to be empty."); } }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToSevargas ) { dropped.Delete(); mobile.SendGump( new SevargasStartGump( mobile )); return true; } if( dropped is HumongousFish ) { dropped.Delete(); mobile.AddToBackpack( new GlowingShipModel() ); mobile.AddToBackpack( new LetterToFlint() ); mobile.SendGump( new SevargasFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
private void DestroyFurniture( Mobile from, Item item ) { if ( !from.InRange( item.GetWorldLocation(), 3 ) || !from.InLOS(item) ) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } if ( !item.IsChildOf( from.Backpack ) && !item.Movable ) { from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here. return; } from.SendLocalizedMessage( 500461 ); // You destroy the item. Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 ); if ( item is Container ) { if ( item is TrapableContainer ) (item as TrapableContainer).ExecuteTrap( from ); ((Container)item).Destroy(); } else { item.Delete(); } }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToSnyden ) { dropped.Delete(); mobile.SendGump( new SnydenStartGump( mobile )); return true; } if( dropped is DecayingHead ) { dropped.Delete(); mobile.AddToBackpack( new ReinforcedHinge() ); mobile.AddToBackpack( new LetterToBarthus() ); mobile.SendGump( new SnydenFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
public Item Mutate(Mobile from, int luckChance, Item item) { if (item == null) return null; if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; //Taran: Below we remove the items we don't want mobs to drop while (weapon is BaseKnife || weapon is Pickaxe || weapon is Hatchet || weapon is BaseStaff) { weapon.Delete(); weapon = BaseWeapon.CreateRandomWeapon(); } if (m_WeaponModifiers != null) m_WeaponModifiers.Mutate(weapon); //if (5 > Utility.Random(100)) // weapon.Slayer = SlayerName.Silver; //if (from != null && weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100)) // weapon.Slayer = SlayerGroup.GetLootSlayerType(from.GetType()); weapon.Identified = true; } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (m_ArmorModifiers != null) m_ArmorModifiers.Mutate(armor); armor.Identified = true; } else if (item is BaseInstrument) { SlayerName slayer = SlayerGroup.GetLootSlayerType(from.GetType()); if (slayer == SlayerName.None) { item.Delete(); return null; } BaseInstrument instr = (BaseInstrument)item; instr.Quality = InstrumentQuality.Regular; instr.Slayer = slayer; } return item; }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToBarthus ) { dropped.Delete(); mobile.SendGump( new BarthusStartGump( mobile )); return true; } if( dropped is KegOfBritishAle ) { dropped.Delete(); mobile.AddToBackpack( new SturdyAxle() ); mobile.AddToBackpack( new LetterToCaztor() ); mobile.SendGump( new BarthusFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToKyvon ) { dropped.Delete(); mobile.SendGump( new KyvonStartGump( mobile )); return true; } if( dropped is MoldedCheese ) { dropped.Delete(); mobile.AddToBackpack( new SpecialSeaMap() ); mobile.AddToBackpack( new LetterToSevargas() ); mobile.SendGump( new KyvonFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
public void DeleteKey(object state) { Item from = (Item)state; from.Delete(); }
protected override void OnTick() { m_Blood.Delete(); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Trophy.Deleted) { return; } if (targeted is Fish || targeted is BigFish) { Item fish = (Item)targeted; Item trophy = new MountedTrophyHead(); trophy.Name = "mounted fish"; trophy.ItemID = 0x1E69; from.AddToBackpack(trophy); from.SendMessage("You mount the fish on the base."); fish.Delete(); m_Trophy.Delete(); } else if (targeted is NewFish) { Item fish = (Item)targeted; Item trophy = new MountedTrophyHead(); trophy.Hue = fish.Hue; trophy.Name = "mounted " + fish.Name; trophy.ItemID = 0x44E8; from.AddToBackpack(trophy); from.SendMessage("You mount the fish on the base."); fish.Delete(); m_Trophy.Delete(); } else if (!(targeted is Corpse)) { from.SendMessage("That cannot be mounted as a trophy!"); return; } else { Region reg = Region.Find(from.Location, from.Map); object obj = targeted; if (obj is Corpse) { obj = ((Corpse)obj).Owner; } if (obj != null) { Corpse c = (Corpse)targeted; if (c.VisitedByTaxidermist == true) { from.SendMessage("This has already been claimed as a trophy!"); return; } else { string trophyName = c.Name; if (c.m_Owner.Title != "") { trophyName = trophyName + " " + c.m_Owner.Title; } int trophyColor = c.Hue; int trophyID = 0; if ((typeof(AncientWyrm) == c.Owner.GetType()) || (typeof(CaddelliteDragon) == c.Owner.GetType()) || (typeof(DragonKing) == c.Owner.GetType()) || (typeof(SlasherOfVoid) == c.Owner.GetType()) || (typeof(VolcanicDragon) == c.Owner.GetType()) || (typeof(AshDragon) == c.Owner.GetType()) || (typeof(BottleDragon) == c.Owner.GetType()) || (typeof(RadiationDragon) == c.Owner.GetType()) || (typeof(CrystalDragon) == c.Owner.GetType()) || (typeof(VoidDragon) == c.Owner.GetType()) || (typeof(ElderDragon) == c.Owner.GetType()) || (typeof(DeepSeaDragon) == c.Owner.GetType()) || (typeof(ShadowWyrm) == c.Owner.GetType()) || (typeof(ZombieDragon) == c.Owner.GetType())) { trophyID = 0x21FB; if (typeof(ShadowWyrm) == c.Owner.GetType()) { trophyColor = 0x966; } else if (typeof(DragonKing) == c.Owner.GetType()) { trophyColor = 0xA65; } } else if ((typeof(Dragons) == c.Owner.GetType())) { trophyID = 0x270D; } else if ((typeof(Wyrms) == c.Owner.GetType())) { if (c.Amount == 12) { trophyID = 0x270D; } else if (c.Amount == 46) { trophyID = 0x270D; } else { trophyID = 0x33FD; } } else if ((typeof(GrayDragon) == c.Owner.GetType()) || (typeof(BlueDragon) == c.Owner.GetType()) || (typeof(MetalDragon) == c.Owner.GetType()) || (typeof(Dragon) == c.Owner.GetType()) || (typeof(StoneDragon) == c.Owner.GetType()) || (typeof(WhiteDragon) == c.Owner.GetType()) || (typeof(BlackDragon) == c.Owner.GetType()) || (typeof(GreenDragon) == c.Owner.GetType()) || (typeof(DragonGolem) == c.Owner.GetType())) { trophyID = 0x2235; } else if ((typeof(NightWyrm) == c.Owner.GetType()) || (typeof(OnyxWyrm) == c.Owner.GetType()) || (typeof(EmeraldWyrm) == c.Owner.GetType()) || (typeof(AmethystWyrm) == c.Owner.GetType()) || (typeof(SapphireWyrm) == c.Owner.GetType()) || (typeof(GarnetWyrm) == c.Owner.GetType()) || (typeof(TopazWyrm) == c.Owner.GetType()) || (typeof(RubyWyrm) == c.Owner.GetType()) || (typeof(SpinelWyrm) == c.Owner.GetType()) || (typeof(QuartzWyrm) == c.Owner.GetType()) || (typeof(JungleWyrm) == c.Owner.GetType()) || (typeof(DesertWyrm) == c.Owner.GetType()) || (typeof(MountainWyrm) == c.Owner.GetType()) || (typeof(IceDragon) == c.Owner.GetType()) || (typeof(LavaDragon) == c.Owner.GetType()) || (typeof(WhiteWyrm) == c.Owner.GetType())) { trophyID = 0x393B; } else if ((typeof(GemDragon) == c.Owner.GetType()) || (typeof(GhostDragyn) == c.Owner.GetType())) { trophyID = 0x392F; } else if ((typeof(Lizardman) == c.Owner.GetType()) || (typeof(LizardmanArcher) == c.Owner.GetType())) { trophyID = 0x393F; } else if ((typeof(Sakleth) == c.Owner.GetType()) || (typeof(MutantLizardman) == c.Owner.GetType()) || (typeof(Grathek) == c.Owner.GetType()) || (typeof(Sleestax) == c.Owner.GetType()) || (typeof(SaklethArcher) == c.Owner.GetType()) || (typeof(SaklethMage) == c.Owner.GetType()) || (typeof(SaklethArcher) == c.Owner.GetType())) { trophyID = 0x33AB; } else if ((typeof(Goblin) == c.Owner.GetType()) || (typeof(GoblinArcher) == c.Owner.GetType())) { trophyID = 0x3937; } else if ((typeof(Ratman) == c.Owner.GetType()) || (typeof(RatmanMage) == c.Owner.GetType()) || (typeof(RatmanArcher) == c.Owner.GetType())) { trophyID = 0x392B; } else if ((typeof(Bugbear) == c.Owner.GetType())) { trophyID = 0x3935; } else if ((typeof(MinotaurCaptain) == c.Owner.GetType()) || (typeof(MutantMinotaur) == c.Owner.GetType()) || (typeof(MinotaurSmall) == c.Owner.GetType()) || (typeof(MinotaurScout) == c.Owner.GetType()) || (typeof(Minotaur) == c.Owner.GetType())) { trophyID = 0x3944; } else if ((typeof(Cyclops) == c.Owner.GetType()) || (typeof(ZornTheBlacksmith) == c.Owner.GetType()) || (typeof(ShamanicCyclops) == c.Owner.GetType())) { trophyID = 0x3931; } else if ((typeof(StoneGiant) == c.Owner.GetType()) || (typeof(IceGiant) == c.Owner.GetType()) || (typeof(LavaGiant) == c.Owner.GetType()) || (typeof(MountainGiant) == c.Owner.GetType())) { trophyID = 0x3912; } else if (typeof(UndeadGiant) == c.Owner.GetType()) { trophyID = 0x21F9; } else if ((typeof(Titan) == c.Owner.GetType()) || (typeof(ElderTitan) == c.Owner.GetType())) { trophyID = 0x21F7; } else if ((typeof(TundraOgre) == c.Owner.GetType()) || (typeof(OgreMagi) == c.Owner.GetType()) || (typeof(Ogre) == c.Owner.GetType())) { trophyID = 0x33E1; } else if ((typeof(Ettin) == c.Owner.GetType()) || (typeof(ArcticEttin) == c.Owner.GetType()) || (typeof(AncientEttin) == c.Owner.GetType())) { trophyID = 0x393D; } else if (typeof(EttinShaman) == c.Owner.GetType()) { trophyID = 0x33A7; } else if ((typeof(HillGiant) == c.Owner.GetType()) || (typeof(HillGiantShaman) == c.Owner.GetType())) { trophyID = 0x33A9; } else if ((typeof(FireGargoyle) == c.Owner.GetType()) || (typeof(Gargoyle) == c.Owner.GetType()) || (typeof(AncientGargoyle) == c.Owner.GetType()) || (typeof(GhostGargoyle) == c.Owner.GetType()) || (typeof(MutantGargoyle) == c.Owner.GetType()) || (typeof(CosmicGargoyle) == c.Owner.GetType()) || (typeof(SpectralGargoyle) == c.Owner.GetType()) || (typeof(ZombieGargoyle) == c.Owner.GetType()) || (typeof(GargoyleMarble) == c.Owner.GetType()) || (typeof(StygianGargoyle) == c.Owner.GetType()) || (typeof(StygianGargoyleLord) == c.Owner.GetType()) || (typeof(CodexGargoyleA) == c.Owner.GetType()) || (typeof(CodexGargoyleB) == c.Owner.GetType()) || (typeof(GargoyleWarrior) == c.Owner.GetType()) || (typeof(StoneGargoyle) == c.Owner.GetType()) || (typeof(ShadowDemon) == c.Owner.GetType())) { trophyID = 0x3933; } else if ((typeof(GargoyleRuby) == c.Owner.GetType()) || (typeof(GargoyleEmerald) == c.Owner.GetType()) || (typeof(GargoyleAmethyst) == c.Owner.GetType()) || (typeof(GargoyleSapphire) == c.Owner.GetType()) || (typeof(Tarjan) == c.Owner.GetType()) || (typeof(BloodDemigod) == c.Owner.GetType()) || (typeof(Xurtzar) == c.Owner.GetType()) || (typeof(AbysmalDaemon) == c.Owner.GetType()) || (typeof(RadiationDemon) == c.Owner.GetType()) || (typeof(Balron) == c.Owner.GetType()) || (typeof(DeepSeaDevil) == c.Owner.GetType()) || (typeof(Devil) == c.Owner.GetType()) || (typeof(BloodDemon) == c.Owner.GetType()) || (typeof(IceFiend) == c.Owner.GetType()) || (typeof(Demon) == c.Owner.GetType()) || (typeof(ForestDemon) == c.Owner.GetType()) || (typeof(FireDemon) == c.Owner.GetType()) || (typeof(Daemon) == c.Owner.GetType())) { if (typeof(IceFiend) == c.Owner.GetType()) { trophyColor = 0x482; } else if (typeof(DeepSeaDevil) == c.Owner.GetType()) { trophyColor = 1365; } else if (typeof(Balron) == c.Owner.GetType() && trophyColor == 0) { trophyColor = 0x430; } trophyID = 0x33A1; } else if ((typeof(GargoyleOnyx) == c.Owner.GetType()) || (typeof(BlackGateDemon) == c.Owner.GetType())) { trophyID = 0x392C; trophyColor = 0; } else if ((typeof(BrownBear) == c.Owner.GetType()) || (typeof(GrizzlyBear) == c.Owner.GetType())) { trophyID = 0x1E67; } else if ((typeof(SabretoothBear) == c.Owner.GetType()) || (typeof(DeathBear) == c.Owner.GetType()) || (typeof(DireBear) == c.Owner.GetType()) || (typeof(ElderBrownBear) == c.Owner.GetType()) || (typeof(GreatBear) == c.Owner.GetType())) { trophyID = 0x339B; } else if (typeof(CaveBear) == c.Owner.GetType()) { trophyID = 0x339D; } else if ((typeof(ElderBlackBear) == c.Owner.GetType()) || (typeof(BlackBear) == c.Owner.GetType()) || (typeof(KodiakBear) == c.Owner.GetType())) { trophyID = 0x3399; trophyColor = 0; } else if ((typeof(ElderBlackBear) == c.Owner.GetType()) || (typeof(BlackBear) == c.Owner.GetType()) || (typeof(KodiakBear) == c.Owner.GetType())) { trophyID = 0x3399; trophyColor = 0; } else if (typeof(PolarBear) == c.Owner.GetType()) { trophyID = 0x1E6C; trophyColor = 0; } else if (typeof(ElderPolarBear) == c.Owner.GetType()) { trophyID = 0x339F; } else if ((typeof(OgreLord) == c.Owner.GetType()) || (typeof(ArcticOgreLord) == c.Owner.GetType())) { trophyID = 0x3378; } else if (typeof(Cerberus) == c.Owner.GetType()) { trophyID = 0x335A; } else if (typeof(Drake) == c.Owner.GetType()) { trophyID = 0x3368; } else if (typeof(SwampDrake) == c.Owner.GetType()) { trophyID = 0x3385; } else if (typeof(AncientDrake) == c.Owner.GetType()) { trophyID = 0x3358; } else if (typeof(Owlbear) == c.Owner.GetType()) { trophyID = 0x337B; } else if (typeof(AbysmalOgre) == c.Owner.GetType()) { trophyID = 0x3354; } else if (typeof(SeaDrake) == c.Owner.GetType()) { trophyID = 0x3381; } else if (typeof(AncientCyclops) == c.Owner.GetType()) { trophyID = 0x3356; } else if (typeof(StormGiant) == c.Owner.GetType()) { trophyID = 0x335C; } else if (typeof(CloudGiant) == c.Owner.GetType()) { trophyColor = 0xB70; trophyID = 0x335C; } else if (typeof(StarGiant) == c.Owner.GetType() && c.Amount == 770) { trophyColor = 0xB73; trophyID = 0x3352; } else if (typeof(StarGiant) == c.Owner.GetType()) { trophyColor = 0xB73; trophyID = 0x3374; } else if (typeof(DemonOfTheSea) == c.Owner.GetType()) { trophyID = 0x337D; } else if (typeof(DragonGhost) == c.Owner.GetType()) { trophyID = 0x337F; } else if ((typeof(Tiger) == c.Owner.GetType()) || (typeof(SabretoothTiger) == c.Owner.GetType())) { trophyID = 0x3389; trophyColor = 0; } else if ((typeof(WhiteTiger) == c.Owner.GetType()) || (typeof(PredatorHellCat) == c.Owner.GetType())) { trophyID = 0x3389; } else if ((typeof(Lion) == c.Owner.GetType()) || (typeof(Manticore) == c.Owner.GetType()) || (typeof(Chimera) == c.Owner.GetType())) { trophyID = 0x3376; } else if (typeof(Exodus) == c.Owner.GetType()) { trophyID = 0x338D; } else if ((typeof(Wyvra) == c.Owner.GetType()) || (typeof(Hydra) == c.Owner.GetType()) || (typeof(EnergyHydra) == c.Owner.GetType())) { trophyID = 0x3372; if (typeof(Hydra) == c.Owner.GetType()) { trophyColor = 0xA5D; } } else if (typeof(SkeletalDragon) == c.Owner.GetType()) { trophyID = 0x33B3; } else if (typeof(Dracolich) == c.Owner.GetType()) { trophyID = 0x3364; } else if (typeof(SwampThing) == c.Owner.GetType()) { trophyID = 0x3387; } else if (typeof(Griffon) == c.Owner.GetType()) { trophyID = 0x3370; } else if (typeof(Walrus) == c.Owner.GetType()) { trophyID = 0x33DF; } else if (typeof(Meglasaur) == c.Owner.GetType()) { trophyID = 0x3362; } else if (typeof(Stegosaurus) == c.Owner.GetType()) { trophyID = 0x3393; } else if (typeof(Tyranasaur) == c.Owner.GetType()) { trophyID = 0x3391; } else if (typeof(DragonTurtle) == c.Owner.GetType()) { trophyID = 0x3366; } else if (typeof(DeepSeaGiant) == c.Owner.GetType()) { trophyID = 0x3360; } else if (typeof(Trollbear) == c.Owner.GetType()) { trophyID = 0x33E3; } else if (typeof(Satan) == c.Owner.GetType()) { trophyID = 0x33AF; } else if (typeof(SeaGiant) == c.Owner.GetType()) { trophyID = 0x3383; } else if (typeof(SandGiant) == c.Owner.GetType() || typeof(AbyssGiant) == c.Owner.GetType()) { trophyID = 0x3352; if (typeof(SandGiant) == c.Owner.GetType()) { trophyColor = 0x96D; } } else if (typeof(JungleGiant) == c.Owner.GetType()) { trophyID = 0x3374; } else if (typeof(ForestGiant) == c.Owner.GetType() || typeof(FireGiant) == c.Owner.GetType()) { trophyID = 0x336C; if (typeof(FireGiant) == c.Owner.GetType()) { trophyColor = 0xA93; } } else if ((typeof(ZombieGiant) == c.Owner.GetType()) || (typeof(FleshGolem) == c.Owner.GetType()) || (typeof(AncientFleshGolem) == c.Owner.GetType())) { trophyID = 0x336A; } else if (typeof(FrostGiant) == c.Owner.GetType()) { trophyID = 0x336E; } else if ((typeof(SeaTroll) == c.Owner.GetType()) || (typeof(FrostTroll) == c.Owner.GetType()) || (typeof(FrostTrollShaman) == c.Owner.GetType()) || (typeof(SwampTroll) == c.Owner.GetType()) || (typeof(TrollWitchDoctor) == c.Owner.GetType()) || (typeof(Troll) == c.Owner.GetType())) { trophyID = 0x1E6D; } else if ((typeof(Orc) == c.Owner.GetType()) || (typeof(OrcBomber) == c.Owner.GetType()) || (typeof(OrcCaptain) == c.Owner.GetType()) || (typeof(OrcishLord) == c.Owner.GetType()) || (typeof(OrcishMage) == c.Owner.GetType()) || (typeof(Urk) == c.Owner.GetType()) || (typeof(UrkShaman) == c.Owner.GetType()) || (typeof(Urc) == c.Owner.GetType()) || (typeof(UrcShaman) == c.Owner.GetType()) || (typeof(UrcBowman) == c.Owner.GetType()) || (typeof(OrkMage) == c.Owner.GetType()) || (typeof(OrkMonks) == c.Owner.GetType()) || (typeof(OrkRogue) == c.Owner.GetType()) || (typeof(OrkWarrior) == c.Owner.GetType())) { trophyID = 0x1E6B; trophyColor = 0; } else if (typeof(GreatHart) == c.Owner.GetType() || typeof(Antelope) == c.Owner.GetType()) { trophyID = 0x1E68; } else if ((typeof(Gorilla) == c.Owner.GetType()) || (typeof(Infected) == c.Owner.GetType()) || (typeof(Ape) == c.Owner.GetType())) { trophyID = 0x1E6A; if (typeof(Infected) != c.Owner.GetType()) { trophyColor = 0; } } else if ((typeof(Yeti) == c.Owner.GetType())) { trophyID = 0x1E6A; trophyColor = 0x47E; } else if ((typeof(Pixie) == c.Owner.GetType())) { switch (Utility.RandomMinMax(0, 4)) { case 0: trophyID = 0x2A79; break; case 1: trophyID = 0x2A75; break; case 2: trophyID = 0x2A71; break; case 3: trophyID = 0x2A77; break; case 4: trophyID = 0x2A73; break; } } else if ((typeof(Unicorn) == c.Owner.GetType())) { trophyID = 0x33B1; } else if ((typeof(DarkUnicorn) == c.Owner.GetType())) { trophyID = 0x335E; } else if (typeof(Nightmare) == c.Owner.GetType() || typeof(AncientNightmare) == c.Owner.GetType() || typeof(Placeron) == c.Owner.GetType()) { trophyID = 0x33AD; } else if ((typeof(Wyvern) == c.Owner.GetType()) || (typeof(Teradactyl) == c.Owner.GetType())) { trophyID = 0x33B5; } else if (typeof(AncientWyvern) == c.Owner.GetType()) { trophyID = 0x3397; } else if (typeof(IceDevil) == c.Owner.GetType()) { trophyID = 0x338F; } else if (typeof(Xenomorph) == c.Owner.GetType()) { trophyID = 0x33B9; trophyColor = 0; } else if (typeof(Hippogriff) == c.Owner.GetType()) { trophyID = 0x33DD; } else if (typeof(HellBeast) == c.Owner.GetType()) { trophyID = 0x33DB; } else if (typeof(Styguana) == c.Owner.GetType()) { trophyID = 0x33B7; } else if (typeof(Watcher) == c.Owner.GetType()) { trophyID = 0x33BB; } else if (typeof(CragCat) == c.Owner.GetType()) { trophyID = 0x33BD; } else if (typeof(PrimevalGreenDragon) == c.Owner.GetType()) { trophyID = 0x33C1; } else if (typeof(PrimevalNightDragon) == c.Owner.GetType()) { trophyID = 0x33D3; } else if (typeof(PrimevalRedDragon) == c.Owner.GetType()) { trophyID = 0x33C5; } else if (typeof(PrimevalRoyalDragon) == c.Owner.GetType()) { trophyID = 0x33C3; } else if (typeof(PrimevalRunicDragon) == c.Owner.GetType()) { trophyID = 0x33BF; } else if (typeof(PrimevalSeaDragon) == c.Owner.GetType()) { trophyID = 0x33C7; } else if (typeof(ReanimatedDragon) == c.Owner.GetType()) { trophyID = 0x33D5; } else if (typeof(VampiricDragon) == c.Owner.GetType()) { trophyID = 0x33CD; } else if (typeof(PrimevalAbysmalDragon) == c.Owner.GetType()) { trophyID = 0x33CB; } else if (typeof(PrimevalAmberDragon) == c.Owner.GetType()) { trophyID = 0x33D1; } else if (typeof(PrimevalBlackDragon) == c.Owner.GetType()) { trophyID = 0x33A3; } else if (typeof(PrimevalDragon) == c.Owner.GetType()) { trophyID = 0x33D9; } else if (typeof(PrimevalSilverDragon) == c.Owner.GetType()) { trophyID = 0x33A5; } else if (typeof(PrimevalVolcanicDragon) == c.Owner.GetType()) { trophyID = 0x33CF; } else if (typeof(PrimevalFireDragon) == c.Owner.GetType()) { trophyID = 0x33D7; } else if (typeof(PrimevalStygianDragon) == c.Owner.GetType()) { trophyID = 0x33C9; } else if (typeof(TitanLithos) == c.Owner.GetType()) { trophyID = 0x338B; } else if (typeof(TitanPyros) == c.Owner.GetType()) { trophyID = 0x338D; } else if (typeof(TitanHydros) == c.Owner.GetType()) { trophyID = 0x338F; } if (trophyID > 0) { MountedTrophyHead trophy = new MountedTrophyHead(); trophy.Hue = trophyColor; trophy.Name = "mounted head of " + trophyName; trophy.ItemID = trophyID; trophy.AnimalWhere = "From " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location); if (c.m_Killer != null && c.m_Killer is PlayerMobile) { string trophyKiller = c.m_Killer.Name + " the " + Server.Misc.GetPlayerInfo.GetSkillTitle(c.m_Killer); trophy.AnimalKiller = "Slain by " + trophyKiller; } from.AddToBackpack(trophy); from.SendMessage("You mount the head on the base."); c.VisitedByTaxidermist = true; m_Trophy.Delete(); } else { from.SendMessage("That cannot be mounted as a trophy!"); return; } } } else { from.SendMessage("That cannot seem to mount this as a trophy!"); return; } } }
public override bool OnDragDrop(Mobile from, Item dropped) { var player = from as PlayerMobile; if (player != null) { if (dropped is Seed) { var qs = player.Quest as SolenMatriarchQuest; if (qs != null && qs.RedSolen == RedSolen) { SayTo(player, 1054080); // Thank you for that plant seed. Those have such wonderful flavor. } else { QuestSystem newQuest = new SolenMatriarchQuest(player, RedSolen); if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof (SolenMatriarchQuest))) { newQuest.SendOffer(); } else { newQuest.AddConversation( new DontOfferConversation(SolenMatriarchQuest.IsFriend(player, RedSolen))); } } dropped.Delete(); return true; } if (dropped is ZoogiFungus) { OnGivenFungi(player, (ZoogiFungus) dropped); return dropped.Deleted; } } return base.OnDragDrop(from, dropped); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is Key) { if (m_Keys.Count < 16) { Key key = (Key)dropped; if (key.KeyValue != 0) { m_Keys.Add(new KeyringEntry(key.KeyValue, key.Link, key.MaxRange, key.ItemID, key.LootType, key.Description)); dropped.Delete(); //from.Send( new PlaySound( 0x42, GetWorldLocation() ) ); this.Weight = this.Weight + 1; switch (m_Keys.Count) { case 0: { this.ItemID = 0x1011; break; } case 1: { this.ItemID = 0x1769; break; } case 3: { this.ItemID = 0x176A; break; } case 5: { this.ItemID = 0x176B; break; } } return(true); } else { from.SendAsciiMessage("This key is blank."); return(false); } } else { from.SendAsciiMessage("This key ring is full"); return(false); } } return(false); }
public override bool OnDragDrop(Mobile from, Item dropped) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if (mobile != null) { if (dropped is Gold && dropped.Amount == 5) { mobile.AddToBackpack(new QuestScroll(1)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold && dropped.Amount == 10) { mobile.AddToBackpack(new QuestScroll(2)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold && dropped.Amount == 15) { mobile.AddToBackpack(new QuestScroll(3)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold && dropped.Amount == 20) { mobile.AddToBackpack(new QuestScroll(4)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold && dropped.Amount == 25) { mobile.AddToBackpack(new QuestScroll(5)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold && dropped.Amount == 30) { mobile.AddToBackpack(new QuestScroll(6)); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Return the Quest parchment to me when you are done...for your reward.", mobile.NetState); return true; } else if (dropped is Gold) { this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "That is not the amount I am looking for.", mobile.NetState); return false; } else if (dropped is QuestScroll) { QuestScroll m_Quest = (QuestScroll)dropped; if (m_Quest.NNeed > m_Quest.NGot) { mobile.AddToBackpack(dropped); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "You have not completed this quest.", mobile.NetState); return false; } string sMessage = ""; if (m_Quest.NType == 1) { sMessage = "I see you were victorious. Here is your reward."; } else { sMessage = "Ahh...you have found " + m_Quest.NItemName + "! Here is your reward"; } if (Utility.RandomMinMax(1, 4) == 1) { mobile.AddToBackpack(new Gold(m_Quest.NLevel * Utility.RandomMinMax(125, 200))); } else { mobile.AddToBackpack(new Gold(m_Quest.NLevel * Utility.RandomMinMax(75, 150))); Item item; if (Core.AOS) item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); else item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max, m_Quest.NLevel); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } mobile.AddToBackpack(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max, m_Quest.NLevel); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } mobile.AddToBackpack(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max, m_Quest.NLevel); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); } mobile.AddToBackpack(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max, m_Quest.NLevel); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); mobile.AddToBackpack(item); } } this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, mobile.NetState); dropped.Delete(); return true; } else { mobile.AddToBackpack(dropped); this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState); return true; } } return false; }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is RecallScroll) { Item scrolls = dropped as Item; int amount = scrolls.Amount; if (amount <= 0) { return(false); //amount should not be zero, but better safe than sorry. } int count = 0; //this keeps track of the count of scrolls added to each runebook int total = 0; //this keeps track of the total added to all runebooks for (int x = 0; x < 51; x++) { if (Books[x].Entries.Count < 16) //check each runebook { if (Books[x].CurCharges < Books[x].MaxCharges) //if there is space for more charges... { from.Send(new PlaySound(0x249, from.Location)); if (amount > (Books[x].MaxCharges - Books[x].CurCharges)) //if the amount of scrolls is > than space free { count = Books[x].MaxCharges - Books[x].CurCharges; scrolls.Consume(count); Books[x].CurCharges = Books[x].MaxCharges; total += count; amount -= count; } else //otherwise we just add/delete whatever scrolls are left { Books[x].CurCharges += amount; scrolls.Delete(); total += amount; amount = 0; } } } if (amount <= 0) { from.SendMessage("{0} Recall Scrolls were added.", total.ToString()); return(true); } } } else if (dropped is RecallRune) { for (int x = 0; x < 51; x++) { if (Books[x].Entries.Count < 16) { RecallRune rune = (RecallRune)dropped; if (rune.Marked && rune.TargetMap != null) { Books[x].Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House)); dropped.Delete(); from.Send(new PlaySound(0x42, GetWorldLocation())); string desc = rune.Description; if (desc == null || (desc = desc.Trim()).Length == 0) { desc = "(indescript)"; } from.SendMessage(desc); return(true); } else { from.SendLocalizedMessage(502409); // This rune does not have a marked location. } } } from.SendLocalizedMessage(502401); // This runebook is full. } else if (dropped is Runebook) { for (int x = 0; x < 51; x++) { if (Books[x].Entries.Count == 0) { Runebook rb = dropped as Runebook; for (int y = 0; y < rb.Entries.Count; y++) { RunebookEntry rune = rb.Entries[y] as RunebookEntry; Books[x].Entries.Add(new RunebookEntry(rune.Location, rune.Map, rune.Description, rune.House)); } Books[x].Name = rb.Name; dropped.Delete(); return(true); } } from.SendLocalizedMessage(502401); // This runebook is full. } return(false); }
public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; if ( mobile != null) { if( dropped is LetterToFlint ) { dropped.Delete(); mobile.SendGump( new FlintStartGump( mobile )); return true; } if( dropped is LargeEggs ) { dropped.Delete(); mobile.AddToBackpack( new SacredAnchor() ); mobile.SendGump( new FlintFinishGump( mobile )); return true; } else { mobile.SendMessage("I have no need for this item."); } } else { PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState ); } return false; }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is StaticTarget) { StaticTarget targ = (StaticTarget)targeted; if (IsValidTile(targ.ItemID) && (from.Map == Map.Felucca || from.Map == Map.Trammel)) { bool alter = from.Map.GetItemsInRange(targ.Location, 5).Where(x => x is ExodusTomeAltar).Any(); if (alter) { from.SendLocalizedMessage(1153590); // An altar has already been built here. } else if (ExodusTomeAltar.Altar == null && VerLorRegController.Active && VerLorRegController.Mobile != null && CheckExodus()) { Point3D p = Point3D.Zero; if (from.Region.IsPartOf("Shrine of Compassion")) { p = new Point3D(1858, 875, 12); } else if (from.Region.IsPartOf("Shrine of Honesty")) { p = new Point3D(4209, 564, 60); } else if (from.Region.IsPartOf("Shrine of Honor")) { p = new Point3D(1727, 3528, 15); } else if (from.Region.IsPartOf("Shrine of Humility")) { p = new Point3D(4274, 3697, 12); } else if (from.Region.IsPartOf("Shrine of Justice")) { p = new Point3D(1301, 634, 28); } else if (from.Region.IsPartOf("Shrine of Sacrifice")) { p = new Point3D(3355, 290, 16); } else if (from.Region.IsPartOf("Shrine of Spirituality")) { p = new Point3D(1606, 2490, 20); } else if (from.Region.IsPartOf("Shrine of Valor")) { p = new Point3D(2492, 3931, 17); } else { from.SendLocalizedMessage(500269); // You cannot build that there. return; } if (p != Point3D.Zero) { ExodusTomeAltar altar = new ExodusTomeAltar(from); altar.MoveToWorld(p, from.Map); altar.Owner = from; m_Deed.Delete(); } } else { from.SendLocalizedMessage(1075213); // The master of this realm has already been summoned and is engaged in combat. Your opportunity will come after he has squashed the current batch of intruders! } } else { from.SendLocalizedMessage(500269); // You cannot build that there. } } else { from.SendLocalizedMessage(500269); // You cannot build that there. } }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is TreasureMap) { if (!CheckAccess(from)) { from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down. } /* else if (IsOpen(from)) { from.SendLocalizedMessage( 1005571 ); // You cannot place objects in the book while viewing the contents. } */ else if (m_Entries.Count < 32) { var tmap = (TreasureMap)dropped; if (tmap.Completed) { from.SendMessage("This map is completed and can not be stored in this book"); InvalidateProperties(); dropped.Delete(); return false; } if (tmap.ChestMap != null) { m_Entries.Add(new TMapBookEntry(tmap.Level, tmap.Decoder, tmap.ChestMap, tmap.ChestLocation, tmap.Bounds)); InvalidateProperties(); dropped.Delete(); from.Send(new PlaySound(0x42, GetWorldLocation())); from.CloseGump(typeof(TMapBookGump)); return true; } from.SendMessage("This map is invalid"); } else { from.SendMessage("This TMap Book is full"); } } return false; }
public static void ConvertToBoards(Item log, Mobile from) { if (!log.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1054107); // This item must be in your backpack to be used. } else { double skillBase = from.Skills[Lumberjacking.System.Definition.Skill].Base; double reqSkill = 0.0; HarvestResource[] lumberResources = Lumberjacking.System.Definition.Resources; for (int i = 0; i < lumberResources.Length; i++) { for (int j = 0; j < lumberResources[i].Types.Length; j++) { if (lumberResources[i].Types[j] == log.GetType()) { reqSkill = lumberResources[i].ReqSkill; } } } if (skillBase >= reqSkill) { Item board; if (log.GetType() == typeof(OakLog)) { board = new OakBoard(log.Amount); } else if (log.GetType() == typeof(AshLog)) { board = new AshBoard(log.Amount); } else if (log.GetType() == typeof(YewLog)) { board = new YewBoard(log.Amount); } else if (log.GetType() == typeof(HeartwoodLog)) { board = new HeartwoodBoard(log.Amount); } else if (log.GetType() == typeof(BloodwoodLog)) { board = new BloodwoodBoard(log.Amount); } else if (log.GetType() == typeof(FrostwoodLog)) { board = new FrostwoodBoard(log.Amount); } else { board = new Board(log.Amount); } log.Delete(); from.AddToBackpack(board); } else { from.SendLocalizedMessage(1072652); // You cannot work this strange and unusual wood. } } }