protected override void OnTarget(Mobile from, object targeted) { if (targeted is ResourceItem) { ResourceItem item = targeted as ResourceItem; if (hr.IsNeeded(item)) { LokaiSkill lokaiSkill = (LokaiSkillUtilities.XMLGetSkills(from)).Construction; SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(from, lokaiSkill, 0.0, 100.0); if (rating >= SuccessRating.PartialSuccess) { from.SendMessage("You successfully added the Resource."); hr.AddResource(item); } else { from.SendMessage("You failed to add the Resource."); switch (rating) { case SuccessRating.HazzardousFailure: { break; } //TODO: take damage or lose resource case SuccessRating.CriticalFailure: { break; } //TODO: lose the resource and take damage case SuccessRating.TooDifficult: { break; } //TODO: "you have no idea..." default: { break; } } } } else { from.SendMessage("That resource is not needed for this house."); } } else { from.SendMessage("That is not a Resource Item!"); } from.SendGump(new HouseRecipeGump(hr, from)); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is ResourceItem) { ResourceItem item = targeted as ResourceItem; if (hr.IsNeeded(item)) { fm.Say("I will give that to the workers."); hr.AddResource(item); } else { fm.Say("That resource is not needed for this house."); } } else { fm.Say("That is not a Resource Item!"); } from.SendGump(new HouseRecipeGump(hr, from)); }
public void AddResource(ResourceItem item) { for (int x = 0; x < m_Resources.Length; x++) { if (item.Name == m_Resources[x].Name) { if (m_Quantities[x] > m_Provided[x]) { if (item.Stackable) { m_Provided[x] += item.Amount; item.Delete(); } else { m_Provided[x]++; item.Delete(); } } } } }
public ThatchedRoofCottageRecipe() : base() { House = typeof(ThatchedRoofCottageDeed); Name = "Thatched Roof Cottage Recipe"; Resources = new ResourceItem[] { new WoodPanel(), new WoodDoor(), new WoodWall(), new WoodWindow(), new BrickFoundation(), new StoneStair(), new ThatchRoofing(), new WoodFlooring(), new NailSupply(), new JointSupply(), new HingeSupply(), new StainSupply() }; Quantities = new int[] { 4, 2, 11, 2, 20, 3, 400, 36, 200, 30, 6, 50 }; Provided = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; }
public WoodPlasterHouseRecipe() : base() { House = typeof(WoodPlasterHouseDeed); Name = "Wood and Plaster House Recipe"; Resources = new ResourceItem[] { new WoodPanel(), new WoodDoor(), new WoodWall(), new WoodWindow(), new BrickFoundation(), new StoneStair(), new ShingleRoofing(), new WoodFlooring(), new NailSupply(), new JointSupply(), new HingeSupply(), new PaintSupply() }; Quantities = new int[] { 4, 2, 11, 2, 20, 3, 400, 36, 200, 30, 6, 50 }; Provided = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; }
public SmallBrickHouseRecipe() : base() { House = typeof(SmallBrickHouseDeed); Name = "Small Brick House Recipe"; Resources = new ResourceItem[] { new BrickPanel(), new WoodDoor(), new BrickWall(), new BrickWindow(), new BrickFoundation(), new StoneStair(), new ShingleRoofing(), new WoodFlooring(), new MortarSupply(), new JointSupply(), new HingeSupply(), new PaintSupply() }; Quantities = new int[] { 4, 2, 11, 2, 20, 3, 400, 36, 50, 30, 6, 50 }; Provided = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; }
public FieldStoneHouseRecipe() : base() { House = typeof(FieldStoneHouseDeed); Name = "Field Stone House Recipe"; Resources = new ResourceItem[] { new StoneSlab(), new WoodDoor(), new StoneWall(), new StoneWindow(), new StoneFoundation(), new StoneStair(), new ShingleRoofing(), new WoodFlooring(), new CementSupply(), new JointSupply(), new HingeSupply(), new PaintSupply() }; Quantities = new int[] { 4, 2, 11, 2, 20, 3, 400, 36, 50, 30, 6, 50 }; Provided = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; }