public void DoMining() { if (Map == null || Map == Map.Internal) { return; } // We may not mine while we are fighting if (Combatant != null) { return; } HarvestSystem system = Mining.System; HarvestDefinition def = Mining.System.OreAndStone; // Our target is the land tile under us Map map = Map; Point3D loc = Location; int x = 0, y = 0; GetMiningOffset(Direction, ref x, ref y); loc.X += x; loc.Y += y; int tileId = map.Tiles.GetLandTile(loc.X, loc.Y).ID & 0x3FFF; if (!def.Validate(tileId)) { return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null || bank.Current < def.ConsumedPerHarvest) { return; } HarvestVein vein = bank.Vein; if (vein == null) { return; } HarvestResource primary = vein.PrimaryResource; HarvestResource fallback = def.Resources[0]; HarvestResource resource = system.MutateResource(this, null, def, map, loc, vein, primary, fallback); double skillBase = Skills[def.Skill].Base; Type type = null; if (skillBase >= resource.ReqSkill && CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill)) { type = system.GetResourceType(this, null, def, map, loc, resource); if (type != null) { type = system.MutateType(type, this, null, def, map, loc, resource); } if (type != null) { Item item = system.Construct(type, this, null); if (item == null) { type = null; } else { if (item.Stackable) { int amount = def.ConsumedPerHarvest; int feluccaAmount = def.ConsumedPerFeluccaHarvest; bool inFelucca = (map == Map.Felucca); if (inFelucca) { item.Amount = feluccaAmount; } else { item.Amount = amount; } } bank.Consume(item.Amount, this); item.MoveToWorld(loc, map); system.DoHarvestingEffect(this, null, def, map, loc); system.DoHarvestingSound(this, null, def, null); // Mine for gems BonusHarvestResource bonus = def.GetBonusResource(); if (bonus != null && bonus.Type != null && skillBase >= bonus.ReqSkill) { Item bonusItem = system.Construct(bonus.Type, this, null); bonusItem.MoveToWorld(loc, map); } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else { /* * if ( targeted is StaticTarget ) * { * int itemID = ((StaticTarget)targeted).ItemID; * * if ( itemID == 0xD15 || itemID == 0xD16 ) // red mushroom * { * PlayerMobile player = from as PlayerMobile; * * if ( player != null ) * { * QuestSystem qs = player.Quest; * * if ( qs is WitchApprenticeQuest ) * { * FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective; * * if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms ) * { * player.SendLocalizedMessage( 1055036 ); // You slice a red cap mushroom from its stem. * obj.Complete(); * return; * } * } * } * } * * } */ HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(def, 5); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } }
public void Prospect(Mobile from, object toProspect) { if (!IsChildOf(from.Backpack) && Parent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } HarvestSystem system = Mining.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } else if (vein != defaultVein) { from.SendLocalizedMessage(1049049); // That ore looks to be prospected already. return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. } else if (veinIndex >= def.Veins.Length - 1) { from.SendLocalizedMessage(1049061); // You cannot improve valorite ore through prospecting. } else { bank.Vein = def.Veins[veinIndex + 1]; from.SendLocalizedMessage(1049050 + veinIndex); --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else { HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.GetCurrentFor(from) < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(def, 5); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is ForestWyrm && ((ForestWyrm)targeted).HasBarding) { ForestWyrm pet = (ForestWyrm)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } #region CropSystem else if (targeted is Weeds) { ((Weeds)targeted).Delete(); from.SendMessage("You slice the roots of the weed and toss them away."); } else if (targeted is Food && ((Food)targeted).SeedType != null) { try { Food food = targeted as Food; int amount = (food.Amount * Utility.RandomMinMax(2, 6)); Item seed = Activator.CreateInstance(food.SeedType, amount) as Item; if (seed != null) { from.AddToBackpack(seed); from.SendMessage(String.Format("You slice open the plant{0} and remove {1} seeds.", (food.Amount > 1 ? "s" : ""), (food.Amount > 1 ? "their" : "its"))); } food.Delete(); } catch { } } else if (targeted is Flax) { int amount = (((Flax)targeted).Amount * Utility.RandomMinMax(2, 6)); from.AddToBackpack(new FlaxSeed(amount)); from.SendMessage("You cut off the stalk of the flax and throw it away, keeping the seeds for later use."); ((Flax)targeted).Delete(); } else if (targeted is WheatSheaf) { int amount = (((WheatSheaf)targeted).Amount * Utility.RandomMinMax(3, 8)); from.AddToBackpack(new WheatSeed(amount)); from.SendMessage("You split open the wheat and take all the seeds you can find."); ((WheatSheaf)targeted).Delete(); } else if (targeted is Rose) { from.AddToBackpack(new RoseBud(Utility.RandomMinMax(3, 6))); from.SendMessage("You break away the petals of the flowers and gently remove the buds."); ((Rose)targeted).Delete(); } #endregion else { HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(5, from); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { if (targeted is Item) { Item item = targeted as Item; if (item.IsLockedDown || (item.RootParent is Container && (!item.Movable || !((Container)item.RootParent).LiftOverride))) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! return; } } if (((ICarvable)targeted).Carve(from, m_Item) && Siege.SiegeShard) { Siege.CheckUsesRemaining(from, m_Item); } } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; if (Siege.SiegeShard && m_Item is IUsesRemaining) { Siege.CheckUsesRemaining(from, m_Item); } } } else { if (targeted is Mobile) { ((Mobile)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500450, from.NetState); // You can only skin dead creatures. return; } else if (targeted is StaticTarget) { int itemID = ((StaticTarget)targeted).ItemID; if (itemID == 0xD15 || itemID == 0xD16) // red mushroom { PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is WitchApprenticeQuest) { FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective; if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms) { player.SendLocalizedMessage(1055036); // You slice a red cap mushroom from its stem. obj.Complete(); if (Siege.SiegeShard && m_Item is IUsesRemaining) { Siege.CheckUsesRemaining(from, m_Item); } return; } } } } } HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(5, from); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } if (Siege.SiegeShard && m_Item is IUsesRemaining) { Siege.CheckUsesRemaining(from, m_Item); } } } } }
public void Prospect(Mobile from, object toProspect) { if (!this.IsChildOf(from.Backpack) && this.Parent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } HarvestSystem system = Mining.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } //else if (vein != defaultVein) //daat99 OWLTR start - prospected sticks else if (vein != defaultVein || (OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING) && (bank.Vein).IsProspected)) //daat99 OWLTR end - prospected sticks { from.SendLocalizedMessage(1049049); // That ore looks to be prospected already. return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. } // else if (veinIndex >= (def.Veins.Length - 1)) // { // from.SendLocalizedMessage(1049061); // You cannot improve valorite ore through prospecting. // } //daat99 OWLTR start - prospecting else if (!OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING)) { if (veinIndex >= (def.Veins.Length - 1)) { from.SendMessage("You cannot improve Platinum ore through prospecting."); // You cannot improve valorite ore through prospecting. } else { bank.Vein = def.Veins[veinIndex + 1]; //from.SendLocalizedMessage( 1049050 + veinIndex ); switch (veinIndex) { case 0: from.SendLocalizedMessage(1049050); break;//Dull Copper case 1: from.SendLocalizedMessage(1049051); break;//Shadow Iron case 2: from.SendLocalizedMessage(1049052); break;//Copper case 3: from.SendLocalizedMessage(1049053); break;//Bronze case 4: from.SendLocalizedMessage(1049054); break;//Gold case 5: from.SendLocalizedMessage(1049055); break;//Agapite case 6: from.SendLocalizedMessage(1049056); break;//Verite case 7: from.SendLocalizedMessage(1049057); break;//Valorite case 8: from.SendMessage("You sift through the ore and find blaze ore can be mined there"); break; case 9: from.SendMessage("You sift through the ore and find ice ore can be mined there"); break; case 10: from.SendMessage("You sift through the ore and find toxic ore can be mined there"); break; case 11: from.SendMessage("You sift through the ore and find electrum ore can be mined there"); break; case 12: from.SendMessage("You sift through the ore and find platinum ore can be mined there"); break; } --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } } else { (bank.Vein).IsProspected = true; from.SendMessage("You sift through the ore increasing your chances to find better ores"); //daat99 OWLTR end - prospecting // bank.Vein = def.Veins[veinIndex + 1]; // from.SendLocalizedMessage(1049050 + veinIndex); --this.UsesRemaining; if (this.UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. this.Delete(); } } }
public void DoMining() { if (Map == null || Map == Map.Internal) { return; } // We may not mine while we are fighting if (Combatant != null) { return; } if (this.Backpack.TotalWeight >= this.Backpack.MaxWeight) { Emote(String.Format("My backpack is full and cannot hold anymore!", Name)); if (m_MiningTimer != null && m_MiningTimer.Running) { m_MiningTimer.Stop(); Emote(String.Format("{0} stops mining", Name)); } } HarvestSystem system = Mining.System; HarvestDefinition def = Mining.System.OreAndStone; // Our target is the land tile under us Map map = this.Map; Point3D loc = this.Location; int x = 0, y = 0; GetMiningOffset(this.Direction, ref x, ref y); loc.X += x; loc.Y += y; int tileId = map.Tiles.GetLandTile(loc.X, loc.Y).ID & (0x3FFF | 0x4000); foreach (StaticTile staticTile in this.GetStaticTilesInRange(map, 0)) { if ((staticTile.ID >= 1339 && staticTile.ID >= 1359) || (staticTile.ID >= 1361 && staticTile.ID >= 1363) || staticTile.ID == 1386) { tileId = staticTile.ID; } } if (!def.Validate(tileId) && !def.ValidateSpecial(tileId)) { return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); bool available = (bank != null && bank.Current >= def.ConsumedPerHarvest); if (!available) { Emote(String.Format("There is no metal here to mine")); return; } if (bank == null || bank.Current < def.ConsumedPerHarvest) { return; } HarvestVein vein = bank.Vein; if (vein == null) { return; } HarvestResource primary = vein.PrimaryResource; HarvestResource fallback = def.Resources[0]; HarvestResource resource = system.MutateResource(this, null, def, map, loc, vein, primary, fallback); double skillBase = this.Skills[def.Skill].Base; Type type = null; if (skillBase >= resource.ReqSkill && this.CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill)) { type = system.GetResourceType(this, null, def, map, loc, resource); if (type != null) { type = system.MutateType(type, this, null, def, map, loc, resource); } if (type != null) { Item item = system.Construct(type, this, null); if (item == null) { type = null; } else { if (item.Stackable) { int amount = def.ConsumedPerHarvest; int feluccaAmount = def.ConsumedPerFeluccaHarvest; bool inFelucca = (map == Map.Felucca); if (inFelucca) { item.Amount = feluccaAmount; } else { item.Amount = amount; } } bank.Consume(item.Amount, this); Container pack = this.Backpack; if (pack == null) { return; } this.Hue = item.Hue; pack.DropItem(item); if (item.ItemID == 6583) { item.Delete(); } else { Smelt(item); } // item.MoveToWorld(loc, map); system.DoHarvestingEffect(this, null, def, map, loc); system.DoHarvestingSound(this, null, def, null); // Mine for gems BonusHarvestResource bonus = def.GetBonusResource(); if (bonus != null && bonus.Type != null && skillBase >= bonus.ReqSkill) { Item bonusItem = system.Construct(bonus.Type, this, null); //item.MoveToWorld(loc, map); //pack.DropItem( bonusItem ); pack.TryDropItem(this, bonusItem, false); } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is Container) { Container body = (Container)targeted; if (body.ItemID >= 0x4B5A && body.ItemID <= 0x4BAB) { body.ItemID = Utility.RandomList(0xECA, 0xECB, 0xECC, 0xECD, 0xECE, 0xECF, 0xED0, 0xED1, 0xED2); body.Hue = 0; from.CriminalAction(true); Misc.Titles.AwardKarma(from, -50, true); body.DropItem(new BodyPart(0x1D9F)); body.DropItem(new BodyPart(0x1DA4)); body.DropItem(new BodyPart(0x1DA2)); body.DropItem(new BodyPart(0x1DA3)); body.DropItem(new BodyPart(0x1DA1)); body.DropItem(new BodyPart(0x1DA0)); from.SendMessage("You hack up the body into bloody pieces."); } } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else { HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendMessage("There is not enough here to harvest."); //from.SendLocalizedMessage( 500493 ); // There's not enough wood here to harvest. } else { bank.Consume(5, from); if (tileID == 0x4D96 || tileID == 0x4D9A) // apples { Item item = new Apple(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put an apple into your backpack."); } else { from.SendMessage("You can't place any apples into your backpack!"); item.Delete(); } } else if (tileID == 0x4DA6 || tileID == 0x4DAA) // pears { Item item = new Pear(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put a pear into your backpack."); } else { from.SendMessage("You can't place any pears into your backpack!"); item.Delete(); } } else if (tileID == 0x4D9E || tileID == 0x4DA2) // peaches { Item item = new Peach(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put a peach into your backpack."); } else { from.SendMessage("You can't place any peaches into your backpack!"); item.Delete(); } } else if (tileID == 0x4CDA || tileID == 0x4CDB || tileID == 0x4CDC || tileID == 0x4CDD || tileID == 0x4CDE || tileID == 0x4CDF) // acorns { Item item = new Acorn(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put an acorn into your backpack."); } else { from.SendMessage("You can't place any acorns into your backpack!"); item.Delete(); } } else if (tileID == 0x4CA8 || tileID == 0x4CAA || tileID == 0x4CAB) // bananas { Item item = new Banana(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put a banana into your backpack."); } else { from.SendMessage("You can't place any bananas into your backpack!"); item.Delete(); } } else if (tileID == 0x4C95) // coconut { Item item = new Coconut(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put a coconut into your backpack."); } else { from.SendMessage("You can't place any coconuts into your backpack!"); item.Delete(); } } else if (tileID == 0x4C96) // dates { Item item = new Dates(); if (from.PlaceInBackpack(item)) { from.SendMessage("You put some dates into your backpack."); } else { from.SendMessage("You can't place any dates into your backpack!"); item.Delete(); } } else { Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (this.m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, this.m_Item); } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else { HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this.m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(5, from); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { from.Animate(32, 5, 1, true, false, 0); ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is Log) { BaseTool tools = new FletcherTools(); from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), "Main", tools)); if (tools != null) { tools.Delete(); } } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else { if (targeted is StaticTarget) { int itemID = ((StaticTarget)targeted).ItemID; if (itemID == 0xD15 || itemID == 0xD16) // red mushroom { PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is WitchApprenticeQuest) { FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective; if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms) { player.SendLocalizedMessage(1055036); // You slice a red cap mushroom from its stem. obj.Complete(); return; } } } } } HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendAsciiMessage("You can't use a bladed item on that!"); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendAsciiMessage("You can't use a bladed item on that!"); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendAsciiMessage("There's not enough wood here to harvest."); // There's not enough wood here to harvest. } else { bank.Consume(5, from); Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendAsciiMessage("You put some kindling into your backpack."); // You put some kindling into your backpack. from.SendAsciiMessage("An axe would probably get you more wood."); // An axe would probably get you more wood. } else { from.SendAsciiMessage("You can't place any kindling into your backpack!"); // You can't place any kindling into your backpack! item.Delete(); } } } } }
public void Prospect(Mobile from, object toProspect) { if (!IsChildOf(from.Backpack) && Parent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } HarvestSystem system = Lumberjacking.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } else if (vein != defaultVein) { from.SendLocalizedMessage(1049049); // That ore looks to be prospected already. return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. } else if (veinIndex >= (def.Veins.Length - 1)) { if (veinIndex >= (def.Veins.Length - 1)) { from.SendMessage("You cannot improve frostwood through prospecting."); } else { bank.Vein = def.Veins[veinIndex + 1]; switch (veinIndex) { case 0: from.SendMessage("You sift through the tree and find oak wood can be lumberjacked there"); break; //Pine case 1: from.SendMessage("You sift through the tree and find ash wood can be lumberjacked there"); break; //Ash case 2: from.SendMessage("You sift through the tree and find yew wood can be lumberjacked there"); break; //Mohogany case 3: from.SendMessage("You sift through the tree and find heartwood wood can be lumberjacked there"); break; //Yew case 4: from.SendMessage("You sift through the tree and find bloodwood can be lumberjacked there"); break; //Oak case 5: from.SendMessage("You sift through the tree and find frostwood wood can be lumberjacked there"); break; //Zircote } --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else if (targeted is Head) { Head targ = (Head)targeted; if (from.Karma > -1500) { from.SendMessage("Vous n'avez pas le profil d'un dépeceur de crâne..."); return; } if (from.Dex <= Utility.Random(110)) { from.SendMessage("Vous avez été trop maladroit et avez raté le dépeçage"); targ.Delete(); return; } from.SendMessage("Vous achevez d'enlever la chair du crâne."); from.AddToBackpack(new Skull()); targ.Consume(); } else if (targeted is Pumpkin) { Pumpkin targ = (Pumpkin)targeted; if (from.Dex <= Utility.Random(100)) { from.SendMessage("Vous avez été trop maladroit et avez raté votre tracé"); targ.Consume(); return; } int karma = 0; if (from.Karma > 100) { karma++; } else if (from.Karma < -100) { karma--; } int chance = Utility.Random(4) + karma; if (chance >= 2) { from.AddToBackpack(new SmileyPumpkin()); } else { from.AddToBackpack(new EvilPumpkin()); } from.SendMessage("Vous taillez la citrouille selon votre humeur"); targ.Consume(); } else { if (targeted is StaticTarget) { int itemID = ((StaticTarget)targeted).ItemID; if (itemID == 0xD15 || itemID == 0xD16) // red mushroom { PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is WitchApprenticeQuest) { FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective; if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms) { player.SendLocalizedMessage(1055036); // You slice a red cap mushroom from its stem. obj.Complete(); return; } } } } } HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { bank.Consume(5, from); if (map.Season == (int)ServerSeasons.Season.Spring && Utility.RandomDouble() < 0.33) { from.PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, false, "De la sève se met à couler du tronc, souhaitez-vous la recueillir?", from.NetState); from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnSelectTarget)); return; } Item item = new Kindling(); if (from.PlaceInBackpack(item)) { from.SendLocalizedMessage(500491); // You put some kindling into your backpack. from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! item.Delete(); } } } } }
public void Prospect(Mobile from, object toProspect) { if (!IsChildOf(from.Backpack) && Parent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } HarvestSystem system = Lumberjacking.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } else if (vein != defaultVein || (OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING) && (bank.Vein).IsProspected)) { from.SendMessage("That tree looks to be prospected already"); // That ore looks to be prospected already. return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. } else if (!OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING)) { if (veinIndex >= (def.Veins.Length - 1)) { from.SendMessage("You cannot improve petrefied wood through prospecting."); } else { bank.Vein = def.Veins[veinIndex + 1]; switch (veinIndex) { case 0: from.SendMessage("You sift through the tree and find oak wood can be lumberjacked there"); break; //Pine case 1: from.SendMessage("You sift through the tree and find ash wood can be lumberjacked there"); break; //Ash case 2: from.SendMessage("You sift through the tree and find yew wood can be lumberjacked there"); break; //Mohogany case 3: from.SendMessage("You sift through the tree and find heartwood wood can be lumberjacked there"); break; //Yew case 4: from.SendMessage("You sift through the tree and find bloodwood can be lumberjacked there"); break; //Oak case 5: from.SendMessage("You sift through the tree and find frostwood wood can be lumberjacked there"); break; //Zircote case 6: from.SendMessage("You sift through the tree and find ebony wood can be lumberjacked there"); break; //Ebony case 7: from.SendMessage("You sift through the tree and find bamboo wood can be lumberjacked there"); break; //Bamboo case 8: from.SendMessage("You sift through the tree and find purpleheart wood can be lumberjacked there"); break; //Purple Heart case 9: from.SendMessage("You sift through the tree and find redwood wood can be lumberjacked there"); break; //Redwood case 10: from.SendMessage("You sift through the tree and find petrified wood can be lumberjacked there"); break; //Petrified } --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } } else { (bank.Vein).IsProspected = true; from.SendMessage("You sift through the tree increasing your chances to find better woods"); --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } }
public void Prospect(Mobile from, object toProspect) { if (!IsChildOf(from.Backpack) && Parent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } HarvestSystem system = Mining.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. return; } else if (vein != defaultVein) { from.SendLocalizedMessage(1049049); // That ore looks to be prospected already. return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that. } else if (veinIndex >= (def.Veins.Length - 1)) { //from.SendLocalizedMessage( 1049061 ); // You cannot improve valorite ore through prospecting. from.SendMessage("You cannot improve Sunstone ore through prospecting."); } else { bank.Vein = def.Veins[veinIndex + 1]; //from.SendLocalizedMessage( 1049050 + veinIndex ); switch (veinIndex) { case 0: from.SendLocalizedMessage(1049050); break; // dull copper case 1: from.SendLocalizedMessage(1049051); break; // shadow iron case 2: from.SendLocalizedMessage(1049052); break; // copper case 3: from.SendLocalizedMessage(1049053); break; // bronze case 4: from.SendLocalizedMessage(1049054); break; // gold case 5: from.SendLocalizedMessage(1049055); break; // agapite case 6: from.SendLocalizedMessage(1049056); break; // verite case 7: from.SendLocalizedMessage(1049057); break; // valorite //case 8: from.SendMessage ( "You sift through the ore and find platinum ore can be mined there!" ); break; //case 9: from.SendMessage ( "You sift through the ore and find that mythril ore can be mined there!" ); break; case 8: from.SendMessage("You sift through the ore and find silver ore can be mined there!"); break; //case 11: from.SendMessage ( "You sift through the ore and find that obsidian ore can be mined there!" ); break; case 9: from.SendMessage("You sift through the ore and find that jade ore can be mined there!"); break; case 10: from.SendMessage("You sift through the ore and find that moonstone ore can be mined there!"); break; case 11: from.SendMessage("You sift through the ore and find that sunstone ore can be mined there!"); break; //case 15: from.SendMessage ( "You sift through the ore and find that bloodstone ore can be mined there!" ); break; } --UsesRemaining; if (UsesRemaining <= 0) { from.SendLocalizedMessage(1049062); // You have used up your prospector's tool. Delete(); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ICarvable) { ((ICarvable)targeted).Carve(from, m_Item); } else if (targeted is SwampDragon && ((SwampDragon)targeted).HasBarding) { SwampDragon pet = (SwampDragon)targeted; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1053022); // You cannot remove barding from a swamp dragon you do not own. } else { pet.HasBarding = false; } } else { if (targeted is StaticTarget) { int itemID = ((StaticTarget)targeted).ItemID; if (itemID == 0xD15 || itemID == 0xD16) // red mushroom { PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is WitchApprenticeQuest) { FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective; if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms) { player.SendLocalizedMessage(1055036); // You slice a red cap mushroom from its stem. obj.Complete(); return; } } } } } HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, m_Item, targeted, out tileID, out map, out loc)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else if (!def.Validate(tileID)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } if (bank.Current < 5) { from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { new InternalTimer(from, bank, 2).Start(); } } } }
public void Prospect(Mobile from, object toProspect) { if (!IsChildOf(from.Backpack) && Parent != from) { from.SendAsciiMessage("That must be in your pack for you to use it."); return; } HarvestSystem system = Mining.System; int tileID; Map map; Point3D loc; if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc)) { from.SendAsciiMessage("You cannot use your prospector tool on that."); // return; } HarvestDefinition def = system.GetDefinition(tileID); if (def == null || def.Veins.Length <= 1) { from.SendAsciiMessage("You cannot use your prospector tool on that."); // return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { from.SendAsciiMessage("You cannot use your prospector tool on that."); // return; } HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein; if (vein == null || defaultVein == null) { from.SendAsciiMessage("You cannot use your prospector tool on that."); // return; } else if (vein != defaultVein) { from.SendAsciiMessage("That ore looks to be prospected already."); // return; } int veinIndex = Array.IndexOf(def.Veins, vein); if (veinIndex < 0) { from.SendAsciiMessage("You cannot use your prospector tool on that."); // } else if (veinIndex >= (def.Veins.Length - 1)) { from.SendAsciiMessage("You cannot improve valorite ore through prospecting."); // } else { bank.Vein = def.Veins[veinIndex + 1]; if (veinIndex == 0) { from.SendAsciiMessage("You sift through the ore and find dull copper can be mined there."); } else if (veinIndex == 1) { from.SendAsciiMessage("You sift through the ore and find shadow iron can be mined there."); } else if (veinIndex == 2) { from.SendAsciiMessage("You sift through the ore and find copper ore can be mined there."); } else if (veinIndex == 3) { from.SendAsciiMessage("You sift through the ore and find bronze can be mined there."); } else if (veinIndex == 4) { from.SendAsciiMessage("You sift through the ore and find gold ore can be mined there."); } else if (veinIndex == 5) { from.SendAsciiMessage("You sift through the ore and find agapite can be mined there."); } else if (veinIndex == 6) { from.SendAsciiMessage("You sift through the ore and find verite can be mined there."); } else if (veinIndex == 7) { from.SendAsciiMessage("You sift through the ore and find valorite can be mined there."); } else { from.SendAsciiMessage("bug"); } --UsesRemaining; if (UsesRemaining <= 0) { from.SendAsciiMessage("You have used up your prospector's tool."); // Delete(); } } }