ServUO Version
Publish 57
Ultima Expansion
None
Buff Icons are those little green and red icons that appear in the buff icon tray. They show the player when they're poisoned, weakened, have protection cast on them, etc. These are somewhat cumbersome to use in custom coding, so I'm writing this down in case anyone else is struggling...


In BuffIcons.cs you should find an enumerated list of BuffIcons, starting near line 245. While this list will sometimes have references to numbers, those numbers are not useful in linking number -> images. This is because the BuffIcon number is translated by your client into a gump image. Again, the reference is *in the client*, not in the server.


For ClassicUO, this gets compiled from BuffTable.cs, which can be found here: ClassicUO/BuffTable.cs at master · ClassicUO/ClassicUO
In this file, you can find a list of buff icon types, which should match the enumerated list in BuffIcons.cs on the server. Further down, you'll see private static ushort[] _defaultTable = ... , this is the actual reference table. This is also an enumerated list, meaning the first item on the list should match the first item on the other list!


And all this together means...


From the game server, BuffIcons.cs:

Code:
    public enum BuffIcon : short

    {

        DismountPrevention = 0x3E9,

        NoRearm = 0x3EA,

        //Currently, no 0x3EB or 0x3EC

        NightSight = 0x3ED,    //*


From the client, BuffTable.cs:

Code:
        private static ushort[] _defaultTable =

        {

            0x754C,

            0x754A,

            0x0000,

            0x0000,

            0x755E,


We can find out that DismountPrevention is assigned number 0x3E9 in the enumerated list, and then translated to 0x754C, which can be found in your gump.mul file (number 30028).

Note that these lists are NOT set up logically or sequentially. It goes from #C to #A to #E in the above example.
Now... let's get some neato custom buff icons going!
 
Back