SolidHueOverride Immunity for Items
This Core Mod has been created so that Items can have a SolidHueImmunity bool attached to their properties that can be set in game or via the individual Item scripts.
If the SolidHueImmunity bool is set to True then if the Item is equipped and the Mobile it is equipped on has a SolidHueOverride then this Item will retain its hue and won't take the hue of the SolidHueOverride. If the SolidHueImmunity is set to false (default) then the Item will take the hue of the SolidHueOverride as normal.
This mod requires edits to Item.cs and Packets.cs.
Open Item.cs
Find the code below, around Line 542:
Insert the code below so that the code now looks like this:
Find the code below, around line 1667:
Insert the code below so that the code now looks like this:
Find the code below, around line 1946:
Insert the code below so that the code now looks like this:
Save and Close Item.cs
Open Packets.cs
Find the code below, around line 946:
Change the code to the code below so that it now looks like this:
Find the code below, around line 2618
Change the code to the code below so that it now looks like this:
Save and Close Packets.cs
Recompile your new core.
You are now finished.
This Core Mod has been created so that Items can have a SolidHueImmunity bool attached to their properties that can be set in game or via the individual Item scripts.
If the SolidHueImmunity bool is set to True then if the Item is equipped and the Mobile it is equipped on has a SolidHueOverride then this Item will retain its hue and won't take the hue of the SolidHueOverride. If the SolidHueImmunity is set to false (default) then the Item will take the hue of the SolidHueOverride as normal.
This mod requires edits to Item.cs and Packets.cs.
Open Item.cs
Find the code below, around Line 542:
Code:
public class Item : IPoint3D, IEntity, IHued
{
public static readonly EmptyArrayList EmptyItems = new EmptyArrayList();
Insert the code below so that the code now looks like this:
Code:
public class Item : IPoint3D, IEntity, IHued
{
// SOLIDHUEIMMUNE EDIT
private bool m_SolidHueImmune;
[CommandProperty(AccessLevel.GameMaster)]
public bool SolidHueImmune
{
get { return m_SolidHueImmune; }
set
{
if (m_SolidHueImmune != value)
{
m_SolidHueImmune = value;
m_WorldPacket = null;
Delta(ItemDelta.Update);
}
}
}
//END SOLIDHUEIMMUNE EDIT
public static readonly EmptyArrayList EmptyItems = new EmptyArrayList();
Find the code below, around line 1667:
Code:
public virtual void Serialize( GenericWriter writer )
{
SaveFlag flags = SaveFlag.None;
Insert the code below so that the code now looks like this:
Code:
public virtual void Serialize( GenericWriter writer )
{
// SOLIDHUEIMMUNE EDIT
//writer.Write( 7 ); // version
writer.Write( 8 ); // version
writer.Write((bool)m_SolidHueImmune);
// END SOLIDHUEIMMUNE EDIT
SaveFlag flags = SaveFlag.None;
Find the code below, around line 1946:
Code:
public virtual void Deserialize( GenericReader reader )
{
int version = reader.ReadInt();
SetLastMoved();
switch ( version )
{
case 7:
Insert the code below so that the code now looks like this:
Code:
public virtual void Deserialize( GenericReader reader )
{
int version = reader.ReadInt();
SetLastMoved();
switch ( version )
{
// SOLIDHUEIMMUNE EDIT
case 8:
{
m_SolidHueImmune = reader.ReadBool();
goto case 7;
}
// END SOLIDHUEIMMUNE EDIT
case 7:
Save and Close Item.cs
Open Packets.cs
Find the code below, around line 946:
Code:
if ( item.Parent is Mobile )
{
Mobile mob = (Mobile)item.Parent;
if ( mob.SoludHueOverride > = 0 )
hue = mob.SolidHueOverride;
}
Change the code to the code below so that it now looks like this:
Code:
if ( item.Parent is Mobile )
{
Mobile mob = (Mobile)item.Parent;
// SOLIDHUEIMMUNE EDIT
// if ( mob.SoludHueOverride > = 0 )
if ( mob.SolidHueOverride >= 0 && !item.SolidHueImmune)
hue = mob.SolidHueOverride;
// END SOLIDHUEIMMUNE EDIT
}
Find the code below, around line 2618
Code:
if ( beheld.SolidHueOverride >= 0 )
hue = beheld.SolidHueOverride;
Change the code to the code below so that it now looks like this:
Code:
// SOLIDHUEIMMUNE EDIT
// if ( beheld.SolidHueOverride >=0 )
if ( beheld.SolidHueOverride >= 0 && !item.SolidHueImmune)
hue = beheld.SolidHueOverride;
// END SOLIDHUEIMMUNE EDIT
Save and Close Packets.cs
Recompile your new core.
You are now finished.