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)); }