Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Other

Other Cant find a category above, use this one! Core mods not listed above go here!

Reply
 
Thread Tools Display Modes
Old 05-04-2006, 12:38 PM   #1 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default 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:
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.
tobyjug is offline   Reply With Quote
Old 05-04-2006, 01:24 PM   #2 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

Sounds nice. I've never used SolidHue, but it looks like a nice addition :-)
Irian is offline   Reply With Quote
Old 05-04-2006, 06:02 PM   #3 (permalink)
Account Terminated
 
Join Date: Jan 2006
Posts: 50
Default

lol no idea what this is give me an example
noob2 is offline   Reply With Quote
Old 05-04-2006, 06:13 PM   #4 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

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
tobyjug is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5