Tukaram

Member
I was playing with a mana potion script, trying to get potion kegs to work. I am able to get it into and out of the potion keg, working and the bottles labeled right. The problem is the potion keg itself does not get a label. I looked at the potionkeg.cs and found where some other newer potions get labeled (invisibility, confusionblast etc). It looks like cliloc labels were added manually. I never did see how the original potion kegs got labeled (cure, refresh etc)

I used fiddler to add labels, on blank lines in the cliloc file. I copied it into the game files (renamed old clicloc.enu to .bak). I did a full recompile and still no labels on the keg. How does one use fiddler to add labels? Is it more than just the one cliloc file?

First code is how I got the potion keg to work with filling from bottles and refilling bottles (default was night sight). This part works:
keg filling & refilling bottle:
        public BasePotion FillBottle()
        {
            switch (m_Type)
            {
                default:
                case PotionEffect.Nightsight:
                    return new NightSightPotion();

                case PotionEffect.CureLesser:
                    return new LesserCurePotion();
                case PotionEffect.Cure:
                    return new CurePotion();
                case PotionEffect.CureGreater:
                    return new GreaterCurePotion();

                case PotionEffect.Agility:
                    return new AgilityPotion();
                case PotionEffect.AgilityGreater:
                    return new GreaterAgilityPotion();

                case PotionEffect.Strength:
                    return new StrengthPotion();
                case PotionEffect.StrengthGreater:
                    return new GreaterStrengthPotion();

                case PotionEffect.PoisonLesser:
                    return new LesserPoisonPotion();
                case PotionEffect.Poison:
                    return new PoisonPotion();
                case PotionEffect.PoisonGreater:
                    return new GreaterPoisonPotion();
                case PotionEffect.PoisonDeadly:
                    return new DeadlyPoisonPotion();

                case PotionEffect.Refresh:
                    return new RefreshPotion();
                case PotionEffect.RefreshTotal:
                    return new TotalRefreshPotion();

                case PotionEffect.HealLesser:
                    return new LesserHealPotion();
                case PotionEffect.Heal:
                    return new HealPotion();
                case PotionEffect.HealGreater:
                    return new GreaterHealPotion();

                case PotionEffect.ExplosionLesser:
                    return new LesserExplosionPotion();
                case PotionEffect.Explosion:
                    return new ExplosionPotion();
                case PotionEffect.ExplosionGreater:
                    return new GreaterExplosionPotion();

                case PotionEffect.Conflagration:
                    return new ConflagrationPotion();
                case PotionEffect.ConflagrationGreater:
                    return new GreaterConflagrationPotion();

                case PotionEffect.ConfusionBlast:
                    return new ConfusionBlastPotion();
                case PotionEffect.ConfusionBlastGreater:
                    return new GreaterConfusionBlastPotion();

                case PotionEffect.Invisibility:
                    return new InvisibilityPotion();

                #region Mana Potions
                case PotionEffect.Mana:
                    return new ManaPotion();

                case PotionEffect.TotalMana:
                    return new TotalManaPotion();
                    #endregion

This label section is giving me issues...

keg labels:
        public override int LabelNumber
        {
            get
            {
                if (m_Held > 0 && (int)m_Type >= (int)PotionEffect.Conflagration)
                {
                    switch (m_Type)
                    {
                        case PotionEffect.Parasitic: return 1080069;
                        case PotionEffect.Darkglow: return 1080070;
                        case PotionEffect.Invisibility: return 1080071;
                        case PotionEffect.Conflagration: return 1072658;
                        case PotionEffect.ConflagrationGreater: return 1072659;
                        case PotionEffect.ConfusionBlast: return 1072662;
                        case PotionEffect.ConfusionBlastGreater: return 1072663;
//Mana Potions
                        case PotionEffect.Mana: return 1116792;
                        case PotionEffect.TotalMana: return 1116793;
                    }
                }

                return (m_Held > 0 ? 1041620 + (int)m_Type : 1041641);
            }
        }

1 copy.jpg
 

Attachments

  • Cliloc.zip
    1 MB · Views: 2
Last edited:
This might be a stupid question. Did you create a new keg after the recompile, or were you looking at one that was created before the recompile?
 
Ok... I installed UOSteam and looked at the classic client. It works. So... the real question is how to change labels in Enhanced?
 
Your label issue is probably due to the if statement involving conflagration potions. If you moved your check below that section it should work fine.

Code:
        public override int LabelNumber
        {
            get
            {
                if (m_Held > 0 && (int)m_Type >= (int)PotionEffect.Conflagration)
                {
                    switch (m_Type)
                    {
                        case PotionEffect.Parasitic: return 1080069;
                        case PotionEffect.Darkglow: return 1080070;
                        case PotionEffect.Invisibility: return 1080071;
                        case PotionEffect.Conflagration: return 1072658;
                        case PotionEffect.ConflagrationGreater: return 1072659;
                        case PotionEffect.ConfusionBlast: return 1072662;
                        case PotionEffect.ConfusionBlastGreater: return 1072663;
                    }
                }

        //Mana Potions
        else if PotionEffect.Mana
            return 1116792;

        else if PotionEffect.TotalMana
            return 1116793;

                else return (m_Held > 0 ? 1041620 + (int)m_Type : 1041641);
            }
        }

I didn't flesh out the code for the label assignments but you get the idea what should happen there.

There's not a way to edit the cliloc for the enhanced client yet. It's a shame too -- the shard I'm working on relies heavily on cliloc edits to make things work because of all the systems that are set up for only label numbers.
 
Hmm... it is working fine in classic, after I thought to check it... and figure out where to get UOSteam and set it up. This computer has never run the classic client...

Oh well, I do not run a shard, I just like to program for fun, but I would like to get an edit that works of both clients. (I do not really play UO, I play ServUO ha ha)
 
Ooooooh! You are using EC? Lol. Thanks for trying it in Classic, cause I was really confused. Perhaps one of the EC gurus can help demystify this, since there are definitely some quirks to using it. Try placing the name somewhere else, like DefaultName or in the Constructor and Deserialize methods.

Something like:

C#:
        public override int DefaultName
        {
            get
            {
                string name = "";
                if (m_Held > 0 && (int)m_Type >= (int)PotionEffect.Conflagration)
                {
                    switch (m_Type)
                    {
                        case PotionEffect.Parasitic: name = "Parasitic";
                        case PotionEffect.Darkglow: name = "Darkglow";
                        case PotionEffect.Invisibility: name = "Invisibility";
                        case PotionEffect.Conflagration: name = "Conflagration";
                        case PotionEffect.ConflagrationGreater: name = "ConflagrationGreater";
                        case PotionEffect.ConfusionBlast: name = "ConfusionBlast";
                        case PotionEffect.ConfusionBlastGreater: name = "ConfusionBlastGreater";
//Mana Potions
                        case PotionEffect.Mana: name = "Mana";
                        case PotionEffect.TotalMana: name = "TotalMana";
                    }
                }

                return name;
            }
        }
 
case PotionEffect.Mana: name = "Mana";
case PotionEffect.TotalMana: name = "TotalMana";

I tried that earlier, and the file would not compile ha ha. I was impressed that I got the potion keg to work for it, and thought the label should have worked. It does... sort of... Yeah, the EC is different. But the hotbars and macro system alone make it worthwhile to me.

Errors:

+ Items/Resource/PotionKeg.cs:

CS1715: Line 75: 'PotionKeg.DefaultName': type must be 'string' to match overridden member 'Item.DefaultName'

Scripts: One or more scripts failed to compile or no script files were found.

- Press return to exit, or R to try again.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back