Rex

Grandmaster
Is there any way to find out the hue of a StaticTarget?

A StaticTarget is an item placed in the map by using Centred.
For example ItemID 2881 (0x0b41) is a "water trough".

What i want to do is have a check run to see if the hue of that StaticTarget is 0 or some other number, then do something with that info. However i can't seem to see anywhere that StaticTarget has hue as a variable to check.

Here's some quasi code that doesn't actually work because there's no StaticTarget.Hue

Code:
if (targ is StaticTarget)
            {
                StaticTarget src = (StaticTarget)targ;
                if (src == null)
                    return;

                if (src.ItemID >= 2881 && src.ItemID <= 2884 ) //water trough
                {
                   if (src.Hue != 0)
               	 {
                    //do some stuff
                    
               	 }
                }
            }

Would I have to edit the StaticTarget class and add in Hue getters and setters? Is getting the hue of a static item on the map possible?
 
Most static items don't have a hue. They use only the colors that are built into the graphic as you see them in Fiddler. I have been trying to figure out this issue for a long time, because it's been the one hang up with Lokei's House Painting system.
 
StaticTarget is a wrapper class that fetches information from TileData.ItemTable for the given static ID.
TileData.ItemTable is a collection of ItemData objects that describes the raw data for the given static ID as loaded from the clients' statics files.
These unfortunately do not convey hue information.

Hope is not lost though, you can still use the StaticTarget's location to do a map-bound lookup for StaticTiles, including those from BaseMultis.
StaticTile in ServUO has a Hue property, though I'm not sure if it is ever anything but 0.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back