UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

Potion Amount

Juzzver

Sorceror
At creation of a certain quantity of bottles through team, for example "[add AgilityPotion 25" issues the message:
Usage:
AgilityPotion

This is not provided possible to create a script, an example:
GreaterHealPotionBag.cs

Code:
using System;
using Server;
using Server.Items;
 
namespace Server.Items
{
    public class GreaterHealPotionBag : Bag
    {
        public override string DefaultName
        {
            get { return "a Greater Heal Potion Bag"; }
        }
 
        [Constructable]
        public GreaterHealPotionBag() : this( 20 )
        {
            Hue = 3;
        }
 
        [Constructable]
        public GreaterHealPotionBag( int amount ) : base()
        {
 
            DropItem( new GreaterHealPotion( amount ) );
        }
 
 
        public GreaterHealPotionBag( Serial serial )
            : base( serial )
        {
        }
 
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
 
            writer.Write( (int) 0 ); // version
        }
 
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
 
            int version = reader.ReadInt();
        }
    }
}

As a result we will receive an empty bag where will be located 1 invisible potion of agility
 
Not only Agility Potions, every potion has the same issue and the amount cannot be set immediately.

Until now.
Test this and bash it in RunUO, people want bags with a starter pack of agility potions!
Do this, and their admins will come here contributing to the main project, RunUO.
 

Attachments

  • Potions-amount_SVN1083.patch
    22.7 KB · Views: 3
Top