예제 #1
0
 public static void GetHarvestInfo(Mobile from, TreeProductItem product)
 {
     string use = "for unknown purposes";
     switch (product.ProductType)
     {
         case TreeProductType.Crafting: use = "for various types of crafting"; break;
         case TreeProductType.Food: use = "for food"; break;
         case TreeProductType.Medicine: use = "in the healing arts"; break;
         case TreeProductType.Reagent: use = "in the practice of magic"; break;
         case TreeProductType.Spice: use = "as a culinary spice"; break;
     }
     //TEMP: Show gump or something?
     from.SendMessage("This product is called {0}. It is used {1}.", product.Name, use);
 }
예제 #2
0
        public static void Cook(TreeResourceItem resource, Mobile from, HarvestSuccessRating rating, TreeProduct product,
                                Container pack)
        {
            switch (rating)
            {
            case HarvestSuccessRating.PartialSuccess:
            case HarvestSuccessRating.Success:
            {
                TreeProductItem item = new TreeProductItem(product);
                if (item.ItemID == 0x183B && !pack.ConsumeTotal(typeof(LargeEmptyFlask), 1))
                {
                    from.SendMessage(
                        "You need an empty flask in your pack to store the {0}. The resource was lost.", item.Name);
                    resource.Consume(1);
                    item.Delete();
                }
                else if (item.ItemID == 0x1604 && !pack.ConsumeTotal(typeof(EmptyWoodenBowl), 1))
                {
                    from.SendMessage(
                        "You need an empty bowl in your pack to store the {0}. The resource was lost.", item.Name);
                    resource.Consume(1);
                    item.Delete();
                }
                else if (from.AddToBackpack(item) || item.DropToWorld(from, from.Location))
                {
                    from.SendMessage("You cook the resource and turn it in to {0}.", item.Name);
                    resource.Consume(1);
                }
                else
                {
                    from.SendMessage("Unable to create the {0}.", item.Name);
                    item.Delete();
                }
                break;
            }

            case HarvestSuccessRating.Failure:
            {
                from.SendMessage("You fail to cook the resource.");
                break;
            }
            }
        }
        public static void Cook(TreeResourceItem resource, Mobile from, SuccessRating rating, TreeProduct product, Container pack)
        {
            switch (rating)
            {
            case SuccessRating.PartialSuccess:
            case SuccessRating.Success:
            case SuccessRating.CompleteSuccess:
            case SuccessRating.ExceptionalSuccess:
            case SuccessRating.TooEasy:
            {
                TreeProductItem item = new TreeProductItem(product);
                if (item.ItemID == 0x183B && !pack.ConsumeTotal(typeof(LargeEmptyFlask), 1))
                {
                    from.SendMessage("You need an empty flask in your pack to store the {0}. The resource was lost.", item.Name);
                    resource.Consume(1);
                    item.Delete();
                }
                else if (item.ItemID == 0x1604 && !pack.ConsumeTotal(typeof(EmptyWoodenBowl), 1))
                {
                    from.SendMessage("You need an empty bowl in your pack to store the {0}. The resource was lost.", item.Name);
                    resource.Consume(1);
                    item.Delete();
                }
                else if (from.AddToBackpack(item) || item.DropToWorld(from, from.Location))
                {
                    from.SendMessage("You cook the resource and turn it in to {0}.", item.Name);
                    resource.Consume(1);
                }
                else
                {
                    from.SendMessage("Unable to create the {0}.", item.Name);
                    item.Delete();
                }
                break;
            }

            case SuccessRating.Failure:
            {
                from.SendMessage("You fail to cook the resource.");
                break;
            }

            case SuccessRating.HazzardousFailure:
            {
                from.SendMessage("You burn the resource and are left with nothing usable.");
                resource.Consume(1);
                break;
            }

            case SuccessRating.CriticalFailure:
            case SuccessRating.TooDifficult:
            {
                from.SendMessage("You burn the resource and your hands too!");
                from.Damage(Utility.RandomMinMax(1, 5));
                from.Animate(34, 5, 1, true, false, 0);
                from.Emote("Ouch!");
                resource.Consume(1);
                break;
            }

            case SuccessRating.LokaiSkillNotEnabled:
            {
                from.SendMessage("This lokaiSkill is not enabled.");         // Should never happen, but just in case...
                break;
            }
            }
        }
예제 #4
0
 public static void Cook(TreeResourceItem resource, Mobile from, HarvestSuccessRating rating, TreeProduct product,
     Container pack)
 {
     switch (rating)
     {
         case HarvestSuccessRating.PartialSuccess:
         case HarvestSuccessRating.Success:
         {
             TreeProductItem item = new TreeProductItem(product);
             if (item.ItemID == 0x183B && !pack.ConsumeTotal(typeof (LargeEmptyFlask), 1))
             {
                 from.SendMessage(
                     "You need an empty flask in your pack to store the {0}. The resource was lost.", item.Name);
                 resource.Consume(1);
                 item.Delete();
             }
             else if (item.ItemID == 0x1604 && !pack.ConsumeTotal(typeof (EmptyWoodenBowl), 1))
             {
                 from.SendMessage(
                     "You need an empty bowl in your pack to store the {0}. The resource was lost.", item.Name);
                 resource.Consume(1);
                 item.Delete();
             }
             else if (from.AddToBackpack(item) || item.DropToWorld(from, from.Location))
             {
                 from.SendMessage("You cook the resource and turn it in to {0}.", item.Name);
                 resource.Consume(1);
             }
             else
             {
                 from.SendMessage("Unable to create the {0}.", item.Name);
                 item.Delete();
             }
             break;
         }
         case HarvestSuccessRating.Failure:
         {
             from.SendMessage("You fail to cook the resource.");
             break;
         }
     }
 }