public virtual void FinishHarvesting(Mobile from, Item tool, HarvestDefinition def, object toHarvest, object locked) { from.EndAction(locked); if (!CheckHarvest(from, tool)) { return; } int tileID; Map map; Point3D loc; if (toHarvest is NubiaSpecialHarvest) { from.SendMessage("SPECIAL HARVEST 2"); return; } if (!GetHarvestDetails(from, tool, toHarvest, out tileID, out map, out loc)) { OnBadHarvestTarget(from, tool, toHarvest); return; } else if (!def.Validate(tileID)) { OnBadHarvestTarget(from, tool, toHarvest); return; } if (!CheckRange(from, tool, def, map, loc, true)) { return; } else if (!CheckResources(from, tool, def, map, loc, true)) { return; } else if (!CheckHarvest(from, tool, def, toHarvest)) { return; } if (SpecialHarvest(from, tool, def, map, loc)) { return; } HarvestBank bank = def.GetBank(map, loc.X, loc.Y); if (bank == null) { return; } HarvestVein vein = bank.Vein; if (vein != null) { vein = MutateVein(from, tool, def, bank, toHarvest, vein); } if (vein == null) { return; } HarvestResource primary = vein.PrimaryResource; HarvestResource fallback = vein.FallbackResource; HarvestResource resource = MutateResource(from, tool, def, map, loc, vein, primary, fallback); Type type = null; //if ( skillBase >= resource.ReqSkill && from.CheckSkill( def.Skill, resource.MinSkill, resource.MaxSkill ) ) NubiaMobile mob = from as NubiaMobile; bool check = mob.Competences[def.Skill].roll(resource.DD); mob.Competences.wait(1); // Console.WriteLine("Harvest Base comp " + def.Skill.ToString() + " DD " + resource.DD + " success: " + check); if (check) { type = GetResourceType(from, tool, def, map, loc, resource); if (type != null) { type = MutateType(type, from, tool, def, map, loc, resource); } if (type != null) { Item item = Construct(type, from); if (item == null) { type = null; } else { //The whole harvest system is kludgy and I'm sure this is just adding to it. if (item.Stackable) { int amount = def.ConsumedPerHarvest; int feluccaAmount = def.ConsumedPerFeluccaHarvest; int racialAmount = (int)Math.Ceiling(amount * 1.1); int feluccaRacialAmount = (int)Math.Ceiling(feluccaAmount * 1.1); bool eligableForRacialBonus = (def.RaceBonus && from.Race == Race.Human); bool inFelucca = (map == Map.Felucca); if (eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount) { item.Amount = feluccaRacialAmount; } else if (inFelucca && bank.Current >= feluccaAmount) { item.Amount = feluccaAmount; } else if (eligableForRacialBonus && bank.Current >= racialAmount) { item.Amount = racialAmount; } else { item.Amount = amount; } } bank.Consume(item.Amount, from); if (Give(from, item, def.PlaceAtFeetIfFull)) { SendSuccessTo(from, item, resource); } else { SendPackFullTo(from, item, def, resource); item.Delete(); } BonusHarvestResource bonus = def.GetBonusResource(); if (bonus != null && bonus.Type != null) { Item bonusItem = Construct(bonus.Type, from); if (Give(from, bonusItem, true)) //Bonuses always allow placing at feet, even if pack is full irregrdless of def { bonus.SendSuccessTo(from); } else { item.Delete(); } } if (tool is IUsesRemaining) { IUsesRemaining toolWithUses = (IUsesRemaining)tool; toolWithUses.ShowUsesRemaining = true; if (toolWithUses.UsesRemaining > 0) { --toolWithUses.UsesRemaining; } if (toolWithUses.UsesRemaining < 1) { tool.Delete(); def.SendMessageTo(from, def.ToolBrokeMessage); } } } } } if (type == null) { def.SendMessageTo(from, def.FailMessage); } OnHarvestFinished(from, tool, def, vein, bank, resource, toHarvest); }