|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
|
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();
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();
Code:
public virtual void Serialize( GenericWriter writer )
{
SaveFlag flags = SaveFlag.None;
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;
Code:
public virtual void Deserialize( GenericReader reader )
{
int version = reader.ReadInt();
SetLastMoved();
switch ( version )
{
case 7:
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:
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;
}
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
}
Code:
if ( beheld.SolidHueOverride >= 0 )
hue = beheld.SolidHueOverride;
Code:
// SOLIDHUEIMMUNE EDIT
// if ( beheld.SolidHueOverride >=0 )
if ( beheld.SolidHueOverride >= 0 && !item.SolidHueImmune)
hue = beheld.SolidHueOverride;
// END SOLIDHUEIMMUNE EDIT
Recompile your new core. You are now finished. |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
|
Do [props on a Mobile and set the SolidHueOverride to any int value for a Hue. You will notice that this overrides their skin hue, and all their equipment hue so that they turn completely one colour.
What my mod does is to allow Items to be immune from having their colour turned by the SolidHueOverride. For example a project I'm working on is a CTF Game and so you can use the SolidHueOverride to set the players on the blue team to a blue colour, so that they look competely blue. Well the Red Flag will have its SolidHueImmune bool set to True so that when a Blue player captures the Red Flag and equips it the Red Flag won't turn blue, it will retain its Red Hue. Hope that helps you get an idea. If you've never used the SolidHueOverride before, then I suggest you take a look at it, its very cool ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|