ImaNewb

Member
I am using RunUO 2.2 and I am trying to make potions show up on vendors as different names other than Refresh Potion, Agility Potion etc. I want to make them say the color Red potion, Blue Potion etc. I seem to be doin this wrong. Below is what I changed in SBAlchemist.cs . I have also tried using a string name but that doesn't seem work either. No matter what the SB Items on the alchemist remain the same. What am I doing wrong?

Untitled.png

C#:
using System;
using System.Collections.Generic;
using Server.Items;

namespace Server.Mobiles
{
    public class SBAlchemist : SBInfo
    {
        private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
        private IShopSellInfo m_SellInfo = new InternalSellInfo();

        public SBAlchemist()
        {
        }

        public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
        public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }

        public class InternalBuyInfo : List<GenericBuyInfo>
        {
            public InternalBuyInfo()
            {

                Add( new GenericBuyInfo( "1023851", typeof( RefreshPotion ), 15, 9, 0xF0B, 0 ) );//1023851 Red Potion
                Add( new GenericBuyInfo( "1023848", typeof( AgilityPotion ), 15, 9, 0xF08, 0 ) );//1023848 Blue Potion
                Add( new GenericBuyInfo( "1023846", typeof( NightSightPotion ), 15, 9, 0xF06, 0 ) );//1023846 Blsck Potion
                Add( new GenericBuyInfo( "1023852", typeof( LesserHealPotion ), 15, 9, 0xF0C, 0 ) );//1023852 Yellow Potion
                Add( new GenericBuyInfo( "1023849", typeof( StrengthPotion ), 15, 9, 0xF09, 0 ) );//1023849 White Potion
                Add( new GenericBuyInfo( "1023850", typeof( LesserPoisonPotion ), 15, 9, 0xF0A, 0 ) );//1023850 Green Potion
                 Add( new GenericBuyInfo( "1023847", typeof( LesserCurePotion ), 15, 9, 0xF07, 0 ) );//1023847 Orange Potion
                Add( new GenericBuyInfo( "1023853", typeof( LesserExplosionPotion ), 21, 9, 0xF0D, 0 ) );//1023853 Purple Potion
                Add( new GenericBuyInfo( typeof( MortarPestle ), 8, 9, 0xE9B, 0 ) );

                Add( new GenericBuyInfo( typeof( BlackPearl ), 5, 144, 0xF7A, 0 ) );
                Add( new GenericBuyInfo( typeof( Bloodmoss ), 5, 144, 0xF7B, 0 ) );
                Add( new GenericBuyInfo( typeof( Garlic ), 3, 144, 0xF84, 0 ) );
                Add( new GenericBuyInfo( typeof( Ginseng ), 3, 144, 0xF85, 0 ) );
                Add( new GenericBuyInfo( typeof( MandrakeRoot ), 3, 144, 0xF86, 0 ) );
                Add( new GenericBuyInfo( typeof( Nightshade ), 3, 144, 0xF88, 0 ) );
                Add( new GenericBuyInfo( typeof( SpidersSilk ), 3, 144, 0xF8D, 0 ) );
                Add( new GenericBuyInfo( typeof( SulfurousAsh ), 3, 144, 0xF8C, 0 ) );

                Add( new GenericBuyInfo( typeof( Bottle ), 5, 9, 0xF0E, 0 ) );

                Add(new GenericBuyInfo("1041060", typeof(HairDye), 37, 9, 0xEFF, HairDye.GetHue()));


            }
        }

        public class InternalSellInfo : GenericSellInfo
        {
            public InternalSellInfo()
            {
                Add( typeof( BlackPearl ), 3 );
                Add( typeof( Bloodmoss ), 3 );
                Add( typeof( MandrakeRoot ), 2 );
                Add( typeof( Garlic ), 2 );
                Add( typeof( Ginseng ), 2 );
                Add( typeof( Nightshade ), 2 );
                Add( typeof( SpidersSilk ), 2 );
                Add( typeof( SulfurousAsh ), 2 );
                Add( typeof( Bottle ), 3 );
                Add( typeof( MortarPestle ), 4 );
                Add( typeof( HairDye ), 19 );

                Add( typeof( NightSightPotion ), 7 );
                Add( typeof( AgilityPotion ), 7 );
                Add( typeof( StrengthPotion ), 7 );
                Add( typeof( RefreshPotion ), 7 );
                Add( typeof( LesserCurePotion ), 7 );
                Add( typeof( LesserHealPotion ), 7 );
                Add( typeof( LesserPoisonPotion ), 7 );
                Add( typeof( LesserExplosionPotion ), 10 );
            }
        }
    }
}
 
Did you restock the vendor? So it does have the current items?
I did. I even deleted the saves and spawned all fresh vendors. I did get a work around though and maybe this is better. I changed the name in the potion script to that color potion. Not lesser or Greater just the standard potions. Then I made sure the SBinfo sell just those. Heres a screenshot. I posted one of the potions scripts below.

Untitled.png

C#:
using System;
using Server;
using Server.Network;

namespace Server.Items
{
    public class PoisonPotion : BasePoisonPotion
    {
        public override Poison Poison{ get{ return Poison.Regular; } }

        public override double MinPoisoningSkill{ get{ return 30.0; } }
        public override double MaxPoisoningSkill{ get{ return 70.0; } }

        [Constructable]
        public PoisonPotion() : base( PotionEffect.Poison )
        {
            Name = "a Green Potion";
        }

        public PoisonPotion( Serial serial ) : base( serial )
        {
        }

        public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a Green Potion"));
            }
        }

        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();
        }
    }
}
 
It's reading the clilocs add( new GenericBuyInfo( "1023851", typeof( RefreshPotion ), 15, 9, 0xF0B, 0 ) );//1023851 Red Potion the 1023851 is cliloc number for the refresh potion so no matter what you do it will always bring it up as a Refresh potion until you get rid of the cliloc number. You will need replace "1023851" with "Red Potion". As it is already in a string format
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back