RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC2]Jako Leveling System (Balanced Pet Leveling)

Jerbal

Sorceror
[RunUO 2.0 RC2]Jako Leveling System (Balanced Pet Leveling)

Hello Everyone,

I've yet to release anything on RunUO but I've been programming a new shard for the past several months. During this time, we implemented FS: Animal Taming Systems and it was very bulky, added a long time to our saves, and added some un-needed server stress because some unusual ways of solving some difficult programming problems. Most importantly, it was to hard to balance our shard. Having said that, I thank RoninGT for all of his work and excellent ideas on this concept. *bows*

Jerbal Animal Kombat-ology v1.0.1
Jako Leveling
Last Updated: August 8th, 2008

This package includes:
  • Pet Experience
  • Pet Levels
  • Pet Breeding

Allows players pets to gain experience and increase attributes with each level. Fully scalable and easily edited to preserve a shards balance and/or add new features that were not originally released

No new gumps have been introduced for pet leveling as it all is slipped into the Animal Lore Gump. See stats.png and characteristics.png.

By Default, players only know a pets max level and sex after taming them. The characteristics page in Animal Lore and the tamed on hover text does not display this information until after it has been tamed.

At each level, the pet gains 1 trait point (except at level 10 it receives two). With these trait points, the tamer can boost some of the pets stats.

The number of trait points consumed per stat increase and the number of points increased are both able to be easily changed or edited to help preserve the shard's already existing balance. Currently the configuration is:
Hits: +2 Max Hits/1 trait
Stam:+5 Max Stam/1 trait
Mana: +2 Max Mana/1 trait
Bonus To One Resist: +2 to one resistance/5 traits

Each stat scales, keeping the original intention of the creatures statistics. In this way, we can always be certain that a White Wyrm does not have as much Fire Resistance as Cold Resistance and we will know what they are still weakest to. To insure that a creature's stats do not go to high, caps are in place.

Bonuses added from this taming system can be capped at a specific value to help already existing high values not become too high. As in the image below, Cold Resistance is at 84% which is above the default 65% cap. It displays 84% is the maximum and places a lock on the stat increase. Players are not able to increase this stat any further else they may reach 100% resistance in one school, etc.

On Death, the pet loses a percentage of it's current experience to level. This can cause a pet to lose a level, but still have all of it's traits and abilities.

Certain Functions can be overridden in creatures to limit the amount of experience they give when they die, how much experience they need to level (if tamed), how many traits they get per level, and just about everything else.

After a specified level, by default 10, a pet is able to breed with another pet of the same type and opposite sex. This breeding will allow their offspring to have a max level equal to the average of the parent's levels + 1. This process takes time and money and is done though a new NPC called a breeder who can also serve the function as an animal tamer. (see breedContract.png)


Update Instructions and changes are included in the .rar file below.
All versions of Jako Taming can be found at: Jerbal.com/RunUo/Jako/

Install
Extract to Customs Folder.
Merge BaseCreature.cs and AnimalLore.cs with your current versions.

Excuse the multiple posts. I wasn't able to change the title of the thread, which indicated that the script wasn't finished when it was.

Thank you!
-Jerbal
 

Attachments

  • nottamed.png
    nottamed.png
    64.5 KB · Views: 996
  • tamed.png
    tamed.png
    75.7 KB · Views: 906
  • stats.png
    stats.png
    43.9 KB · Views: 1,020
  • characteristics.png
    characteristics.png
    39.9 KB · Views: 990
  • breedContract.png
    breedContract.png
    166.3 KB · Views: 1,056
  • Jakov1.0.1.rar
    37.6 KB · Views: 1,113

Jerbal

Sorceror
/*************************************************************************
* Jerbal Animal Kombat-ology
* Jako v1.0.1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*************************************************************************/

- Known Issues -
Potential Shard Crashes when a pet is killed while breeding hasn't been completed.
Potential Exploit by breeding and using the confirm gump as a pet-life-safer/recall/etc.

- Future Changes -
Code optimization to better performance.
Code optimization to reduce this package's server compile time.
Code removal from BaseCreature.cs to make updates as easy as replacing a file.



//******************************
Version 1.0.1
Date: August 8th, 2008

- Update Instructions from v1.0.0 to v1.0.1 -
1) Update Line 259 and 260 of JakoBreeder.cs from:
from.SendMessage("But this is testing, so I'm moving on anyway.");
//return false;
to:
//from.SendMessage("But this is testing, so I'm moving on anyway.");
return false;

- File List -
JakoBreeder.cs :
Removed a debug line so that players must wait the full breeding time to retrieve their pets.

//******************************
Version 1.0.0
Date: August 7th, 2008

- Update Instructions from Alpha to v1.0.0 -
1) Replace the folder Custom/Jerbal/Jako with /Custom/Jerbal/Jako found in this .rar.
2) Update Line 4161 of BaseCreature from:
list.Add("Level {0} {1}", m_level, SexString);
to:
list.Add("Level {0} {1}", m_realLevel, SexString);


- File List -
BaseCreature.cs :
Changed the Level Display to display Real Level and not current level to remove a potential exploit while having a pet look level 1 but be a much higher level by purposefully killing it for EXP loss.

AnimalLore.cs :
No Changes

Custom/Jerbal/Jako/Attributes/ :
No changes to Attributes or related files other than organization.


Added Custom/Jerbal/Jako/Breeding/
BreedingGumps.cs
BreedingParentTicket.cs
JakoBreeder.cs
//******************************
 

Jerbal

Sorceror
Yes, the BaseCreature.cs and AnimalLore.cs files in the rar will need to be merged with your current.
 

mikeymaze

Wanderer
It works after playing around with it for a few hrs thanks alot for this post ....do you use the BOD
with the shard you are playing on ? that is all i am missing now :)
 

madphatboy2

Wanderer
Error upon install and merge

I'm getting this error when I install and merge this script.
RunUO - [www.runuo.com] Version 2.0, Build 3159.40172
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 1 64-bit processor
Scripts: Compiling C# scripts...failed (1 errors, 12 warnings)
*edited out warnings*
Errors:
+ Skills/AnimalLore.cs:
CS0103: Line 365: The name 'FormatString' does not exist in the current cont
ext
CS0103: Line 413: The name 'm' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Here is the file...
Code:
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Targeting;
using Custom.Jerbal.Jako;

namespace Server.SkillHandlers
{
    public class AnimalLore
    {
        public static void Initialize()
        {
            SkillInfo.Table[(int)SkillName.AnimalLore].Callback = new SkillUseCallback( OnUse );
        }

        public static TimeSpan OnUse(Mobile m)
        {
            m.Target = new InternalTarget();

            m.SendLocalizedMessage( 500328 ); // What animal should I look at?

            return TimeSpan.FromSeconds( 1.0 );
        }

        private class InternalTarget : Target
        {
            public InternalTarget() : base( 8, false, TargetFlags.None )
            {
            }

            protected override void OnTarget( Mobile from, object targeted )
            {            
                if ( !from.Alive )
                {
                    from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                }
                else if ( targeted is BaseCreature )
                {
                    BaseCreature c = (BaseCreature)targeted;

                    if ( !c.IsDeadPet )
                    {
                        if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
                        {
                            if ( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 100.0 )
                            {
                                from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures.
                            }
                            else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 )
                            {
                                from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 120.0 ) )
                            {
                                from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump( typeof( AnimalLoreGump ) );
                                from.SendGump( new AnimalLoreGump( c ) );
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 500329 ); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500329 ); // That's not an animal!
                }
            }
        }
    }

    public class AnimalLoreGump : Gump
    {
        private BaseCreature m_bc;
        private static string FormatSkill( BaseCreature c, SkillName name )
        {
            Skill skill = c.Skills[name];

            if ( skill.Base < 10.0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0:F1}</div>", skill.Base );
        }

        #region Jako Taming
        private static string FormatAttributes(int cur, uint max)
        {
            return FormatAttributes(cur, (int)max);
        }
        #endregion

        private static string FormatAttributes( int cur, int max )
        {
            if ( max == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}/{1}</div>", cur, max );
        }

        private static string FormatStat( int val )
        {
            if ( val == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}</div>", val );
        }

        private static string FormatDouble( double val )
        {
            if ( val == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0:F1}</div>", val );
        }

        private static string FormatElement( int val )
        {
            if ( val <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}%</div>", val );
        }

        #region Mondain's Legacy
        private static string FormatDamage( int min, int max )
        {
            if ( min <= 0 || max <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}-{1}</div>", min, max );
        }
        #endregion
        private const int LabelColor = 0x24E5;

        public AnimalLoreGump( BaseCreature c ) : base( 250, 50 )
        {
            #region Jako Taming Added
            m_bc = c;
            #endregion
            AddPage( 0 );

            AddImage( 100, 100, 2080 );
            AddImage( 118, 137, 2081 );
            AddImage( 118, 207, 2081 );
            AddImage( 118, 277, 2081 );
            AddImage( 118, 347, 2083 );

            AddHtml( 147, 108, 210, 18, String.Format( "<center><i>{0}</i></center>", c.Name ), false, false );

            AddButton( 240, 77, 2093, 2093, 2, GumpButtonType.Reply, 0 );

            AddImage( 140, 138, 2091 );
            AddImage( 140, 335, 2091 );

            #region Jako Taming Edited
            int pages = ( Core.AOS ? 5 : 3 ) + ( c.JakoIsEnabled ? 1 : 0 ) + (c.Controlled && c.ControlMaster != null ? 1 : 0);
            #endregion

            int page = 0;


            #region Attributes
            AddPage( ++page );

            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 1049593, 200, false, false ); // Attributes

            AddHtmlLocalized( 153, 168, 160, 18, 1049578, LabelColor, false, false ); // Hits
            AddHtml( 280, 168, 75, 18, FormatAttributes( c.Hits, c.HitsMax ), false, false );

            AddHtmlLocalized( 153, 186, 160, 18, 1049579, LabelColor, false, false ); // Stamina
            AddHtml( 280, 186, 75, 18, FormatAttributes( c.Stam, c.StamMax ), false, false );

            AddHtmlLocalized( 153, 204, 160, 18, 1049580, LabelColor, false, false ); // Mana
            AddHtml( 280, 204, 75, 18, FormatAttributes( c.Mana, c.ManaMax ), false, false );

            AddHtmlLocalized( 153, 222, 160, 18, 1028335, LabelColor, false, false ); // Strength
            AddHtml( 320, 222, 35, 18, FormatStat( c.Str ), false, false );

            AddHtmlLocalized( 153, 240, 160, 18, 3000113, LabelColor, false, false ); // Dexterity
            AddHtml( 320, 240, 35, 18, FormatStat( c.Dex ), false, false );

            AddHtmlLocalized( 153, 258, 160, 18, 3000112, LabelColor, false, false ); // Intelligence
            AddHtml( 320, 258, 35, 18, FormatStat( c.Int ), false, false );

            if ( Core.AOS )
            {
                int y = 276;

                if ( Core.SE )
                {
                    double bd = Items.BaseInstrument.GetBaseDifficulty( c );
                    if ( c.Uncalmable )
                        bd = 0;

                    AddHtmlLocalized( 153, 276, 160, 18, 1070793, LabelColor, false, false ); // Barding Difficulty
                    AddHtml( 320, y, 35, 18, FormatDouble( bd ), false, false );

                    y += 18;
                }

                AddImage( 128, y + 2, 2086 );
                AddHtmlLocalized( 147, y, 160, 18, 1049594, 200, false, false ); // Loyalty Rating
                y += 18;

                AddHtmlLocalized( 153, y, 160, 18, (!c.Controlled || c.Loyalty == 0) ? 1061643 : 1049595 + (c.Loyalty / 10), LabelColor, false, false );
            }
            else
            {
                AddImage( 128, 278, 2086 );
                AddHtmlLocalized( 147, 276, 160, 18, 3001016, 200, false, false ); // Miscellaneous

                AddHtmlLocalized( 153, 294, 160, 18, 1049581, LabelColor, false, false ); // Armor Rating
                AddHtml( 320, 294, 35, 18, FormatStat( c.VirtualArmor ), false, false );
            }

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, pages );
            #endregion

            #region Resistances
            if ( Core.AOS )
            {
                AddPage( ++page );

                AddImage( 128, 152, 2086 );
                AddHtmlLocalized( 147, 150, 160, 18, 1061645, 200, false, false ); // Resistances

                AddHtmlLocalized( 153, 168, 160, 18, 1061646, LabelColor, false, false ); // Physical
                AddHtml( 320, 168, 35, 18, FormatElement( c.PhysicalResistance ), false, false );

                AddHtmlLocalized( 153, 186, 160, 18, 1061647, LabelColor, false, false ); // Fire
                AddHtml( 320, 186, 35, 18, FormatElement( c.FireResistance ), false, false );

                AddHtmlLocalized( 153, 204, 160, 18, 1061648, LabelColor, false, false ); // Cold
                AddHtml( 320, 204, 35, 18, FormatElement( c.ColdResistance ), false, false );

                AddHtmlLocalized( 153, 222, 160, 18, 1061649, LabelColor, false, false ); // Poison
                AddHtml( 320, 222, 35, 18, FormatElement( c.PoisonResistance ), false, false );

                AddHtmlLocalized( 153, 240, 160, 18, 1061650, LabelColor, false, false ); // Energy
                AddHtml( 320, 240, 35, 18, FormatElement( c.EnergyResistance ), false, false );

                AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
                AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            }
            #endregion

            #region Damage
            if ( Core.AOS )
            {
                AddPage( ++page );

                AddImage( 128, 152, 2086 );
                AddHtmlLocalized( 147, 150, 160, 18, 1017319, 200, false, false ); // Damage

                AddHtmlLocalized( 153, 168, 160, 18, 1061646, LabelColor, false, false ); // Physical
                AddHtml( 320, 168, 35, 18, FormatElement( c.PhysicalDamage ), false, false );

                AddHtmlLocalized( 153, 186, 160, 18, 1061647, LabelColor, false, false ); // Fire
                AddHtml( 320, 186, 35, 18, FormatElement( c.FireDamage ), false, false );

                AddHtmlLocalized( 153, 204, 160, 18, 1061648, LabelColor, false, false ); // Cold
                AddHtml( 320, 204, 35, 18, FormatElement( c.ColdDamage ), false, false );

                AddHtmlLocalized( 153, 222, 160, 18, 1061649, LabelColor, false, false ); // Poison
                AddHtml( 320, 222, 35, 18, FormatElement( c.PoisonDamage ), false, false );

                AddHtmlLocalized( 153, 240, 160, 18, 1061650, LabelColor, false, false ); // Energy
                AddHtml( 320, 240, 35, 18, FormatElement( c.EnergyDamage ), false, false );

                #region Mondain's Legacy
                if ( Core.ML )
                {
                    AddHtmlLocalized( 153, 258, 160, 18, 1076750, LabelColor, false, false ); // Base Damage
                    AddHtml( 320, 258, 35, 18, FormatDamage( c.DamageMin, c.DamageMax ), false, false );
                }
                #endregion

                AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
                AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            }
            #endregion

            #region Skills
            AddPage( ++page );

            
            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 3001030, 200, false, false ); // Combat Ratings

            AddHtmlLocalized( 153, 168, 160, 18, 1044103, LabelColor, false, false ); // Wrestling
            AddHtml( 320, 168, 35, 18, FormatSkill( c, SkillName.Wrestling ), false, false );

            AddHtmlLocalized( 153, 186, 160, 18, 1044087, LabelColor, false, false ); // Tactics
            AddHtml( 320, 186, 35, 18, FormatSkill( c, SkillName.Tactics ), false, false );

            AddHtmlLocalized( 153, 204, 160, 18, 1044086, LabelColor, false, false ); // Magic Resistance
            AddHtml( 320, 204, 35, 18, FormatSkill( c, SkillName.MagicResist ), false, false );

            AddHtmlLocalized( 153, 222, 160, 18, 1044061, LabelColor, false, false ); // Anatomy
            AddHtml( 320, 222, 35, 18, FormatSkill( c, SkillName.Anatomy ), false, false );
            
            #region Mondain's Legacy
            if ( c is CuSidhe )
            {
                AddHtmlLocalized( 153, 240, 160, 18, 1044077, LabelColor, false, false ); // Healing
                AddHtml( 320, 240, 35, 18, FormatSkill( c, SkillName.Healing ), false, false );
            }
            else
            {
                AddHtmlLocalized( 153, 240, 160, 18, 1044090, LabelColor, false, false ); // Poisoning
                AddHtml( 320, 240, 35, 18, FormatSkill( c, SkillName.Poisoning ), false, false );
            }
            #endregion
            
            AddImage( 128, 260, 2086 );
            AddHtmlLocalized( 147, 258, 160, 18, 3001032, 200, false, false ); // Lore & Knowledge

            AddHtmlLocalized( 153, 276, 160, 18, 1044085, LabelColor, false, false ); // Magery
            AddHtml( 320, 276, 35, 18, FormatSkill( c, SkillName.Magery ), false, false );

            AddHtmlLocalized( 153, 294, 160, 18, 1044076, LabelColor, false, false ); // Evaluating Intelligence
            AddHtml( 320, 294, 35, 18,FormatSkill( c, SkillName.EvalInt ), false, false );

            AddHtmlLocalized( 153, 312, 160, 18, 1044106, LabelColor, false, false ); // Meditation
            AddHtml( 320, 312, 35, 18, FormatSkill( c, SkillName.Meditation ), false, false );

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            #endregion

            #region Jako Taming | Skills
            if (c.Tamable)
            {
                #region Jako Taming When Tamed
                if (c.Controlled && c.ControlMaster != null)
                {
                    AddPage(++page);

                    AddImage(128, 152, 2086);
                    AddHtml(147, 150, 160, 18, "<basefont color=#003142>Characteristics</basefont>", false, false);

                    AddHtml(153, 168, 160, 18, "<basefont color=#4A3929>Level</basefont>", false, false);
                    AddHtml(280, 168, 75, 18, FormatAttributes((int)c.Level, (int)c.MaxLevel), false, false);

                    AddHtml(153, 186, 160, 18, "<basefont color=#4A3929>Traits Remaining</basefont>", false, false);
                    AddHtml(280, 186, 75, 18, FormatStat((int)c.Traits), false, false);

                    AddHtml(153, 204, 160, 18, "<basefont color=#4A3929>Mating Level</basefont>", false, false);
                    AddHtml(280, 204, 75, 18, FormatStat((int)c.MatingLevel), false, false);

                    AddHtml(153, 222, 160, 18, "<basefont color=#4A3929>Sex</basefont>", false, false);
                    AddHtml(320, 222, 35, 18, FormatString(c.SexString), false, false);

                    AddHtml(153, 240, 160, 18, "<basefont color=#4A3929>Experience Earned</basefont>", false, false);
                    AddHtml(320, 240, 35, 18, FormatStat((int)c.Experience), false, false);

                    AddHtml(153, 258, 160, 18, "<basefont color=#4A3929>Experience Needed</basefont>", false, false);
                    AddHtml(320, 258, 35, 18, FormatStat((int)c.ExpToNextLevel), false, false);

                    AddButton(340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1);
                    AddButton(317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1);
                }
                #endregion


                #region Jako Taming Max Stats/Attributes
                AddPage(++page);
                
                AddImage(128, 152, 2086);
                AddHtml(147, 150, 160, 18, "<basefont color=#003142>Max Resistances</basefont>", false, false); // Resistances

                AddHtmlLocalized(153, 168, 160, 18, 1061646, LabelColor, false, false); // Physical
                AddHtml(280, 168, 75, 18, FormatAttributes(c.PhysicalResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 186, 160, 18, 1061647, LabelColor, false, false); // Fire
                AddHtml(280, 186, 75, 18, FormatAttributes(c.FireResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 204, 160, 18, 1061648, LabelColor, false, false); // Cold
                AddHtml(280, 204, 75, 18, FormatAttributes(c.ColdResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 222, 160, 18, 1061649, LabelColor, false, false); // Poison
                AddHtml(280, 222, 75, 18, FormatAttributes(c.PoisonResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 240, 160, 18, 1061650, LabelColor, false, false); // Energy
                AddHtml(280, 240, 75, 18, FormatAttributes(c.EnergyResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).MaxBonus(c)), false, false);

                AddImage(128, 260, 2086);
                AddHtml(147, 258, 160, 18, "<basefont color=#003142>Max Attributes</basefont>", false, false); // Lore & Knowledge


                AddHtmlLocalized(153, 276, 160, 18, 1049578, LabelColor, false, false); // Hits
                AddHtml(280, 276, 75, 18, FormatAttributes(c.HitsMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 294, 160, 18, 1049579, LabelColor, false, false); // Stamina
                AddHtml(280, 294, 75, 18, FormatAttributes(c.StamMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 312, 160, 18, 1049580, LabelColor, false, false); // Mana
                AddHtml(280, 312, 75, 18, FormatAttributes(c.ManaMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).MaxBonus(c)), false, false);

                if (c.ControlMaster == m)
                {
                    Int32 locked = 0x82C;
                    Int32 up = 0x983;
                    Int32 b1004 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).MaxBonus(c) <= c.PhysicalResistance ? locked : up);
                    Int32 b1005 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).MaxBonus(c) <= c.FireResistance ? locked : up);
                    Int32 b1006 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).MaxBonus(c) <= c.ColdResistance ? locked : up);
                    Int32 b1007 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).MaxBonus(c) <= c.PoisonResistance ? locked : up);
                    Int32 b1008 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).MaxBonus(c) <= c.EnergyResistance ? locked : up);
                    Int32 b1001 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).MaxBonus(c) <= c.HitsMax ? locked : up);
                    Int32 b1002 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).MaxBonus(c) <= c.StamMax ? locked : up);
                    Int32 b1003 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).MaxBonus(c) <= c.ManaMax ? locked : up);

                    AddButton(130, 168, b1004, b1004, 1004, GumpButtonType.Reply, 0);
                    AddButton(130, 186, b1005, b1005, 1005, GumpButtonType.Reply, 0);
                    AddButton(130, 204, b1006, b1006, 1006, GumpButtonType.Reply, 0);
                    AddButton(130, 222, b1007, b1007, 1007, GumpButtonType.Reply, 0);
                    AddButton(130, 240, b1008, b1008, 1008, GumpButtonType.Reply, 0);
                    AddButton(130, 276, b1001, b1001, 1001, GumpButtonType.Reply, 0);
                    AddButton(130, 294, b1002, b1002, 1002, GumpButtonType.Reply, 0);
                    AddButton(130, 312, b1003, b1003, 1003, GumpButtonType.Reply, 0);

                }


                AddButton(340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1);
                AddButton(317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1);
                #endregion
            }
            #endregion

            #region Misc
            AddPage( ++page );

            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 1049563, 200, false, false ); // Preferred Foods

            int foodPref = 3000340;

            if ( (c.FavoriteFood & FoodType.FruitsAndVegies) != 0 )
                foodPref = 1049565; // Fruits and Vegetables
            else if ( (c.FavoriteFood & FoodType.GrainsAndHay) != 0 )
                foodPref = 1049566; // Grains and Hay
            else if ( (c.FavoriteFood & FoodType.Fish) != 0 )
                foodPref = 1049568; // Fish
            else if ( (c.FavoriteFood & FoodType.Meat) != 0 )
                foodPref = 1049564; // Meat

            AddHtmlLocalized( 153, 168, 160, 18, foodPref, LabelColor, false, false );

            AddImage( 128, 188, 2086 );
            AddHtmlLocalized( 147, 186, 160, 18, 1049569, 200, false, false ); // Pack Instincts

            int packInstinct = 3000340;

            if ( (c.PackInstinct & PackInstinct.Canine) != 0 )
                packInstinct = 1049570; // Canine
            else if ( (c.PackInstinct & PackInstinct.Ostard) != 0 )
                packInstinct = 1049571; // Ostard
            else if ( (c.PackInstinct & PackInstinct.Feline) != 0 )
                packInstinct = 1049572; // Feline
            else if ( (c.PackInstinct & PackInstinct.Arachnid) != 0 )
                packInstinct = 1049573; // Arachnid
            else if ( (c.PackInstinct & PackInstinct.Daemon) != 0 )
                packInstinct = 1049574; // Daemon
            else if ( (c.PackInstinct & PackInstinct.Bear) != 0 )
                packInstinct = 1049575; // Bear
            else if ( (c.PackInstinct & PackInstinct.Equine) != 0 )
                packInstinct = 1049576; // Equine
            else if ( (c.PackInstinct & PackInstinct.Bull) != 0 )
                packInstinct = 1049577; // Bull

            AddHtmlLocalized( 153, 204, 160, 18, packInstinct, LabelColor, false, false );

            if ( !Core.AOS )
            {
                AddImage( 128, 224, 2086 );
                AddHtmlLocalized( 147, 222, 160, 18, 1049594, 200, false, false ); // Loyalty Rating

                AddHtmlLocalized( 153, 240, 160, 18, (!c.Controlled || c.Loyalty == 0) ? 1061643 : 1049595 + (c.Loyalty / 10), LabelColor, false, false );
            }

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            #endregion
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
            String reply = "" ;
            switch (info.ButtonID)
            {
                case 1001: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).DoOnClick(m_bc); break;
                case 1002: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).DoOnClick(m_bc); break;
                case 1003: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).DoOnClick(m_bc); break;
                case 1004: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).DoOnClick(m_bc); break;
                case 1005: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).DoOnClick(m_bc); break;
                case 1006: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).DoOnClick(m_bc); break;
                case 1007: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).DoOnClick(m_bc); break;
                case 1008: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).DoOnClick(m_bc); break;

            }

            if (reply != null)
                from.SendMessage(reply);

            base.OnResponse(sender, info);
        }
    }



}
I'm still learning all this, so help would certainly be appreciated.
 

Jerbal

Sorceror
You didn't merge AnimalLore.cs correctly.

Line 16 should be:
Code:
from.SendGump( new AnimalLoreGump( c, from ) );

Line 145 should be:
Code:
public AnimalLoreGump( BaseCreature c, Mobile m ) : base( 250, 50 )

and:

Under:
Code:
        private static string FormatElement( int val )
        {
            if ( val <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}%</div>", val );
        }
add:
Code:
       private static string FormatString(string str)
        {
            if (str.Length == 0)
                return "<div align=right>---</div>";

            return String.Format("<div align=right>{0}</div>",str);

        }

There may be other errors when you get done, just double check your merging.
 

Jerbal

Sorceror
mikeymaze;773642 said:
It works after playing around with it for a few hrs thanks alot for this post ....do you use the BOD
with the shard you are playing on ? that is all i am missing now :)

Yes, we use the taming bod system that RoninGT developed. You shouldn't have to do anything to your creatures (and I think only one or two playermobile serializables if any) and off you go. I would have to double check, but I think that's what we're doing/how it's done.
 

greywolf79

Sorceror
Looks cool. Now I got a question for you... Is there a set of instructions for this to be installed if you are using the pet breeding pack from Ronin? I like the breeding setup and am happy enough with the level side of things, but I think it would be cooler to have this set work with breeding too (or is breeding included also?) - and the idea about the hiding the max level and sex until tamed is a great idea (I plan on eventually modding the FSATS to do that too if this will not work with the other set).

GreyWolf.
 

Jerbal

Sorceror
This is designed to be a replacement for the breeding and pet leveling system that RoninGT developed. This package just includes pet leveling and breeding, just as FS: Taming has, but done in a more controlled and with less serializing. In that sense, this is a replacement for FS:Taming JUST for the breeding and leveling aspect. This does not includes bods or shrink, etc, but there is a shrink system that should globally work regardless of basecreature edits and you can use the bod system with out having the taming from RoninGT.

If I understand your question right, you could convert from FS:Taming to Jako with some moderate work in serialize/deserialze, where users would not lose their current creature level, but they WOULD lose the pet abilities that they have invested in and such. Those users could be given the talent points for the new system to make up for what they had lost during the serialize/deserialize conversion.

Let me know if this answers your questions!

-Jerbal
 

greywolf79

Sorceror
It does actually clear some stuff up for me. Would it be possible to speak with you later (might not be able to until the weekend or else late at night - like 9 or 10 pm mountain time which is 11-12 eastern time)? I would like to try to convert to this, it sounds cool and looks very nice. And I do not really have any worries about losses since right now my player base is 1 (me).

GreyWolf.
 

Jerbal

Sorceror
If you're not worried about losing content, then the switch is easy:

Comment out all of the FS Taming Serialize edits. On my shard it starts with:
Code:
// Version 17 FS:ATS EDITS
writer.Write( (bool) m_IsMating );
And ends with:
Code:
writer.Write( (int) m_FireBreathAttack );

Then on my deserialize I changed it so that the FS Taming will only deserialize creatures that could have been serialized in this version. In my case, only version 17 creatures had FS stats:
Code:
if ( version == 17 )//FS:ATS
{
                reader.ReadBool(); //m_IsMating = 
                reader.ReadInt(); //m_ABPoints = 
                reader.ReadInt(); //m_Exp = 
                reader.ReadInt(); //m_NextLevel = 
                reader.ReadInt(); //m_Level = 
                reader.ReadInt(); //m_MaxLevel = 
...
                reader.ReadInt(); //m_FireBreathAttack = 
}

In this case, we want to read the values, but not put them anywhere. This should allow us to also delete the extra code left over from FS Taming (though I would recommend commenting it out first), including all of the variables, functions, etc. This should remove it's footprint for good.

If you were worried about the creatures level, although they wouldn't mean the same thing, you could easily do something like this in your deserialize:
Code:
if ( version == 17 )//FS:ATS
{
                reader.ReadBool(); //m_IsMating = 
                reader.ReadInt(); //m_ABPoints = 
                reader.ReadInt(); //m_Exp = 
                reader.ReadInt(); //m_NextLevel = 
                setLevel((uint)reader.ReadInt(),false); //m_Level = 
                reader.ReadInt(); //m_MaxLevel = 
...
                reader.ReadInt(); //m_FireBreathAttack = 
}

If you have any questions, I would be glad to answer them later this evening. Please PM me and I'll post what ever we come up with when we're done.

-Jerbal
 

madphatboy2

Wanderer
I broke it again. Hopefully it's an easy oversight like the last time. I've gone over it a couple of times and just don't understand.
RunUO - [www.runuo.com] Version 2.0, Build 3163.15524
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 1 64-bit processor
Scripts: Compiling C# scripts...failed (1 errors)
Errors:
+ Skills/AnimalLore.cs:
CS0103: Line 363: The name 'FormatString' does not exist in the current cont
ext
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
I've highlighted in red the problem area...
Code:
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Targeting;
using Custom.Jerbal.Jako;

namespace Server.SkillHandlers
{
    public class AnimalLore
    {
        public static void Initialize()
        {
            SkillInfo.Table[(int)SkillName.AnimalLore].Callback = new SkillUseCallback( OnUse );
        }

        public static TimeSpan OnUse(Mobile m)
        {
            m.Target = new InternalTarget();

            m.SendLocalizedMessage( 500328 ); // What animal should I look at?

            return TimeSpan.FromSeconds( 1.0 );
        }

        private class InternalTarget : Target
        {
            public InternalTarget() : base( 8, false, TargetFlags.None )
            {
            }

            protected override void OnTarget( Mobile from, object targeted )
            {            
                if ( !from.Alive )
                {
                    from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                }
                else if ( targeted is BaseCreature )
                {
                    BaseCreature c = (BaseCreature)targeted;

                    if ( !c.IsDeadPet )
                    {
                        if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
                        {
                            if ( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 100.0 )
                            {
                                from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures.
                            }
                            else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 )
                            {
                                from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 120.0 ) )
                            {
                                from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump( typeof( AnimalLoreGump ) );
                                from.SendGump( new AnimalLoreGump( c, from ) );
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 500329 ); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500329 ); // That's not an animal!
                }
            }
        }
    }

    public class AnimalLoreGump : Gump
    {
        private BaseCreature m_bc;
        private static string FormatSkill( BaseCreature c, SkillName name )
        {
            Skill skill = c.Skills[name];

            if ( skill.Base < 10.0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0:F1}</div>", skill.Base );
        }

        #region Jako Taming
        private static string FormatAttributes(int cur, uint max)
        {
            return FormatAttributes(cur, (int)max);
        }
        #endregion

        private static string FormatAttributes( int cur, int max )
        {
            if ( max == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}/{1}</div>", cur, max );
        }

        private static string FormatStat( int val )
        {
            if ( val == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}</div>", val );
        }

        private static string FormatDouble( double val )
        {
            if ( val == 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0:F1}</div>", val );
        }

        private static string FormatElement( int val )
        {
            if ( val <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}%</div>", val );
        }

        #region Mondain's Legacy
        private static string FormatDamage( int min, int max )
        {
            if ( min <= 0 || max <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}-{1}</div>", min, max );
        }
        #endregion
        private const int LabelColor = 0x24E5;

        public AnimalLoreGump( BaseCreature c, Mobile m ) : base( 250, 50 )
        {
            #region Jako Taming Added
            m_bc = c;
            #endregion
            AddPage( 0 );

            AddImage( 100, 100, 2080 );
            AddImage( 118, 137, 2081 );
            AddImage( 118, 207, 2081 );
            AddImage( 118, 277, 2081 );
            AddImage( 118, 347, 2083 );

            AddHtml( 147, 108, 210, 18, String.Format( "<center><i>{0}</i></center>", c.Name ), false, false );

            AddButton( 240, 77, 2093, 2093, 2, GumpButtonType.Reply, 0 );

            AddImage( 140, 138, 2091 );
            AddImage( 140, 335, 2091 );

            #region Jako Taming Edited
            int pages = ( Core.AOS ? 5 : 3 ) + ( c.JakoIsEnabled ? 1 : 0 ) + (c.Controlled && c.ControlMaster != null ? 1 : 0);
            #endregion

            int page = 0;


            #region Attributes
            AddPage( ++page );

            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 1049593, 200, false, false ); // Attributes

            AddHtmlLocalized( 153, 168, 160, 18, 1049578, LabelColor, false, false ); // Hits
            AddHtml( 280, 168, 75, 18, FormatAttributes( c.Hits, c.HitsMax ), false, false );

            AddHtmlLocalized( 153, 186, 160, 18, 1049579, LabelColor, false, false ); // Stamina
            AddHtml( 280, 186, 75, 18, FormatAttributes( c.Stam, c.StamMax ), false, false );

            AddHtmlLocalized( 153, 204, 160, 18, 1049580, LabelColor, false, false ); // Mana
            AddHtml( 280, 204, 75, 18, FormatAttributes( c.Mana, c.ManaMax ), false, false );

            AddHtmlLocalized( 153, 222, 160, 18, 1028335, LabelColor, false, false ); // Strength
            AddHtml( 320, 222, 35, 18, FormatStat( c.Str ), false, false );

            AddHtmlLocalized( 153, 240, 160, 18, 3000113, LabelColor, false, false ); // Dexterity
            AddHtml( 320, 240, 35, 18, FormatStat( c.Dex ), false, false );

            AddHtmlLocalized( 153, 258, 160, 18, 3000112, LabelColor, false, false ); // Intelligence
            AddHtml( 320, 258, 35, 18, FormatStat( c.Int ), false, false );

            if ( Core.AOS )
            {
                int y = 276;

                if ( Core.SE )
                {
                    double bd = Items.BaseInstrument.GetBaseDifficulty( c );
                    if ( c.Uncalmable )
                        bd = 0;

                    AddHtmlLocalized( 153, 276, 160, 18, 1070793, LabelColor, false, false ); // Barding Difficulty
                    AddHtml( 320, y, 35, 18, FormatDouble( bd ), false, false );

                    y += 18;
                }

                AddImage( 128, y + 2, 2086 );
                AddHtmlLocalized( 147, y, 160, 18, 1049594, 200, false, false ); // Loyalty Rating
                y += 18;

                AddHtmlLocalized( 153, y, 160, 18, (!c.Controlled || c.Loyalty == 0) ? 1061643 : 1049595 + (c.Loyalty / 10), LabelColor, false, false );
            }
            else
            {
                AddImage( 128, 278, 2086 );
                AddHtmlLocalized( 147, 276, 160, 18, 3001016, 200, false, false ); // Miscellaneous

                AddHtmlLocalized( 153, 294, 160, 18, 1049581, LabelColor, false, false ); // Armor Rating
                AddHtml( 320, 294, 35, 18, FormatStat( c.VirtualArmor ), false, false );
            }

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, pages );
            #endregion

            #region Resistances
            if ( Core.AOS )
            {
                AddPage( ++page );

                AddImage( 128, 152, 2086 );
                AddHtmlLocalized( 147, 150, 160, 18, 1061645, 200, false, false ); // Resistances

                AddHtmlLocalized( 153, 168, 160, 18, 1061646, LabelColor, false, false ); // Physical
                AddHtml( 320, 168, 35, 18, FormatElement( c.PhysicalResistance ), false, false );

                AddHtmlLocalized( 153, 186, 160, 18, 1061647, LabelColor, false, false ); // Fire
                AddHtml( 320, 186, 35, 18, FormatElement( c.FireResistance ), false, false );

                AddHtmlLocalized( 153, 204, 160, 18, 1061648, LabelColor, false, false ); // Cold
                AddHtml( 320, 204, 35, 18, FormatElement( c.ColdResistance ), false, false );

                AddHtmlLocalized( 153, 222, 160, 18, 1061649, LabelColor, false, false ); // Poison
                AddHtml( 320, 222, 35, 18, FormatElement( c.PoisonResistance ), false, false );

                AddHtmlLocalized( 153, 240, 160, 18, 1061650, LabelColor, false, false ); // Energy
                AddHtml( 320, 240, 35, 18, FormatElement( c.EnergyResistance ), false, false );

                AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
                AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            }
            #endregion

            #region Damage
            if ( Core.AOS )
            {
                AddPage( ++page );

                AddImage( 128, 152, 2086 );
                AddHtmlLocalized( 147, 150, 160, 18, 1017319, 200, false, false ); // Damage

                AddHtmlLocalized( 153, 168, 160, 18, 1061646, LabelColor, false, false ); // Physical
                AddHtml( 320, 168, 35, 18, FormatElement( c.PhysicalDamage ), false, false );

                AddHtmlLocalized( 153, 186, 160, 18, 1061647, LabelColor, false, false ); // Fire
                AddHtml( 320, 186, 35, 18, FormatElement( c.FireDamage ), false, false );

                AddHtmlLocalized( 153, 204, 160, 18, 1061648, LabelColor, false, false ); // Cold
                AddHtml( 320, 204, 35, 18, FormatElement( c.ColdDamage ), false, false );

                AddHtmlLocalized( 153, 222, 160, 18, 1061649, LabelColor, false, false ); // Poison
                AddHtml( 320, 222, 35, 18, FormatElement( c.PoisonDamage ), false, false );

                AddHtmlLocalized( 153, 240, 160, 18, 1061650, LabelColor, false, false ); // Energy
                AddHtml( 320, 240, 35, 18, FormatElement( c.EnergyDamage ), false, false );

                #region Mondain's Legacy
                if ( Core.ML )
                {
                    AddHtmlLocalized( 153, 258, 160, 18, 1076750, LabelColor, false, false ); // Base Damage
                    AddHtml( 320, 258, 35, 18, FormatDamage( c.DamageMin, c.DamageMax ), false, false );
                }
                #endregion

                AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
                AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            }
            #endregion

            #region Skills
            AddPage( ++page );

            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 3001030, 200, false, false ); // Combat Ratings

            AddHtmlLocalized( 153, 168, 160, 18, 1044103, LabelColor, false, false ); // Wrestling
            AddHtml( 320, 168, 35, 18, FormatSkill( c, SkillName.Wrestling ), false, false );

            AddHtmlLocalized( 153, 186, 160, 18, 1044087, LabelColor, false, false ); // Tactics
            AddHtml( 320, 186, 35, 18, FormatSkill( c, SkillName.Tactics ), false, false );

            AddHtmlLocalized( 153, 204, 160, 18, 1044086, LabelColor, false, false ); // Magic Resistance
            AddHtml( 320, 204, 35, 18, FormatSkill( c, SkillName.MagicResist ), false, false );

            AddHtmlLocalized( 153, 222, 160, 18, 1044061, LabelColor, false, false ); // Anatomy
            AddHtml( 320, 222, 35, 18, FormatSkill( c, SkillName.Anatomy ), false, false );
            
            #region Mondain's Legacy
            if ( c is CuSidhe )
            {
                AddHtmlLocalized( 153, 240, 160, 18, 1044077, LabelColor, false, false ); // Healing
                AddHtml( 320, 240, 35, 18, FormatSkill( c, SkillName.Healing ), false, false );
            }
            else
            {
                AddHtmlLocalized( 153, 240, 160, 18, 1044090, LabelColor, false, false ); // Poisoning
                AddHtml( 320, 240, 35, 18, FormatSkill( c, SkillName.Poisoning ), false, false );
            }
            #endregion
            
            AddImage( 128, 260, 2086 );
            AddHtmlLocalized( 147, 258, 160, 18, 3001032, 200, false, false ); // Lore & Knowledge

            AddHtmlLocalized( 153, 276, 160, 18, 1044085, LabelColor, false, false ); // Magery
            AddHtml( 320, 276, 35, 18, FormatSkill( c, SkillName.Magery ), false, false );

            AddHtmlLocalized( 153, 294, 160, 18, 1044076, LabelColor, false, false ); // Evaluating Intelligence
            AddHtml( 320, 294, 35, 18,FormatSkill( c, SkillName.EvalInt ), false, false );

            AddHtmlLocalized( 153, 312, 160, 18, 1044106, LabelColor, false, false ); // Meditation
            AddHtml( 320, 312, 35, 18, FormatSkill( c, SkillName.Meditation ), false, false );

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            #endregion

#region Jako Taming | Skills
            if (c.Tamable)
            {
                #region Jako Taming When Tamed
                if (c.Controlled && c.ControlMaster != null)
                {
                    AddPage(++page);

                    AddImage(128, 152, 2086);
                    AddHtml(147, 150, 160, 18, "<basefont color=#003142>Characteristics</basefont>", false, false);

                    AddHtml(153, 168, 160, 18, "<basefont color=#4A3929>Level</basefont>", false, false);
                    AddHtml(280, 168, 75, 18, FormatAttributes((int)c.Level, (int)c.MaxLevel), false, false);

                    AddHtml(153, 186, 160, 18, "<basefont color=#4A3929>Traits Remaining</basefont>", false, false);
                    AddHtml(280, 186, 75, 18, FormatStat((int)c.Traits), false, false);

                    AddHtml(153, 204, 160, 18, "<basefont color=#4A3929>Mating Level</basefont>", false, false);
                    AddHtml(280, 204, 75, 18, FormatStat((int)c.MatingLevel), false, false);

                    AddHtml(153, 222, 160, 18, "<basefont color=#4A3929>Sex</basefont>", false, false);
                   [COLOR=Red] AddHtml(320, 222, 35, 18, FormatString(c.SexString), false, false);[/COLOR]

                    AddHtml(153, 240, 160, 18, "<basefont color=#4A3929>Experience Earned</basefont>", false, false);
                    AddHtml(320, 240, 35, 18, FormatStat((int)c.Experience), false, false);

                    AddHtml(153, 258, 160, 18, "<basefont color=#4A3929>Experience Needed</basefont>", false, false);
                    AddHtml(320, 258, 35, 18, FormatStat((int)c.ExpToNextLevel), false, false);

                    AddButton(340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1);
                    AddButton(317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1);
                }
                #endregion


                #region Jako Taming Max Stats/Attributes
                AddPage(++page);
                
                AddImage(128, 152, 2086);
                AddHtml(147, 150, 160, 18, "<basefont color=#003142>Max Resistances</basefont>", false, false); // Resistances

                AddHtmlLocalized(153, 168, 160, 18, 1061646, LabelColor, false, false); // Physical
                AddHtml(280, 168, 75, 18, FormatAttributes(c.PhysicalResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 186, 160, 18, 1061647, LabelColor, false, false); // Fire
                AddHtml(280, 186, 75, 18, FormatAttributes(c.FireResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 204, 160, 18, 1061648, LabelColor, false, false); // Cold
                AddHtml(280, 204, 75, 18, FormatAttributes(c.ColdResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 222, 160, 18, 1061649, LabelColor, false, false); // Poison
                AddHtml(280, 222, 75, 18, FormatAttributes(c.PoisonResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 240, 160, 18, 1061650, LabelColor, false, false); // Energy
                AddHtml(280, 240, 75, 18, FormatAttributes(c.EnergyResistance, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).MaxBonus(c)), false, false);

                AddImage(128, 260, 2086);
                AddHtml(147, 258, 160, 18, "<basefont color=#003142>Max Attributes</basefont>", false, false); // Lore & Knowledge


                AddHtmlLocalized(153, 276, 160, 18, 1049578, LabelColor, false, false); // Hits
                AddHtml(280, 276, 75, 18, FormatAttributes(c.HitsMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 294, 160, 18, 1049579, LabelColor, false, false); // Stamina
                AddHtml(280, 294, 75, 18, FormatAttributes(c.StamMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).MaxBonus(c)), false, false);

                AddHtmlLocalized(153, 312, 160, 18, 1049580, LabelColor, false, false); // Mana
                AddHtml(280, 312, 75, 18, FormatAttributes(c.ManaMax, c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).MaxBonus(c)), false, false);

                if (c.ControlMaster == m)
                {
                    Int32 locked = 0x82C;
                    Int32 up = 0x983;
                    Int32 b1004 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).MaxBonus(c) <= c.PhysicalResistance ? locked : up);
                    Int32 b1005 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).MaxBonus(c) <= c.FireResistance ? locked : up);
                    Int32 b1006 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).MaxBonus(c) <= c.ColdResistance ? locked : up);
                    Int32 b1007 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).MaxBonus(c) <= c.PoisonResistance ? locked : up);
                    Int32 b1008 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).MaxBonus(c) <= c.EnergyResistance ? locked : up);
                    Int32 b1001 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).MaxBonus(c) <= c.HitsMax ? locked : up);
                    Int32 b1002 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).MaxBonus(c) <= c.StamMax ? locked : up);
                    Int32 b1003 = (c.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).MaxBonus(c) <= c.ManaMax ? locked : up);

                    AddButton(130, 168, b1004, b1004, 1004, GumpButtonType.Reply, 0);
                    AddButton(130, 186, b1005, b1005, 1005, GumpButtonType.Reply, 0);
                    AddButton(130, 204, b1006, b1006, 1006, GumpButtonType.Reply, 0);
                    AddButton(130, 222, b1007, b1007, 1007, GumpButtonType.Reply, 0);
                    AddButton(130, 240, b1008, b1008, 1008, GumpButtonType.Reply, 0);
                    AddButton(130, 276, b1001, b1001, 1001, GumpButtonType.Reply, 0);
                    AddButton(130, 294, b1002, b1002, 1002, GumpButtonType.Reply, 0);
                    AddButton(130, 312, b1003, b1003, 1003, GumpButtonType.Reply, 0);

                }


                AddButton(340, 358, 5601, 5605, 0, GumpButtonType.Page, page + 1);
                AddButton(317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1);
                #endregion
            }
            #endregion

            #region Misc
            AddPage( ++page );

            AddImage( 128, 152, 2086 );
            AddHtmlLocalized( 147, 150, 160, 18, 1049563, 200, false, false ); // Preferred Foods

            int foodPref = 3000340;

            if ( (c.FavoriteFood & FoodType.FruitsAndVegies) != 0 )
                foodPref = 1049565; // Fruits and Vegetables
            else if ( (c.FavoriteFood & FoodType.GrainsAndHay) != 0 )
                foodPref = 1049566; // Grains and Hay
            else if ( (c.FavoriteFood & FoodType.Fish) != 0 )
                foodPref = 1049568; // Fish
            else if ( (c.FavoriteFood & FoodType.Meat) != 0 )
                foodPref = 1049564; // Meat

            AddHtmlLocalized( 153, 168, 160, 18, foodPref, LabelColor, false, false );

            AddImage( 128, 188, 2086 );
            AddHtmlLocalized( 147, 186, 160, 18, 1049569, 200, false, false ); // Pack Instincts

            int packInstinct = 3000340;

            if ( (c.PackInstinct & PackInstinct.Canine) != 0 )
                packInstinct = 1049570; // Canine
            else if ( (c.PackInstinct & PackInstinct.Ostard) != 0 )
                packInstinct = 1049571; // Ostard
            else if ( (c.PackInstinct & PackInstinct.Feline) != 0 )
                packInstinct = 1049572; // Feline
            else if ( (c.PackInstinct & PackInstinct.Arachnid) != 0 )
                packInstinct = 1049573; // Arachnid
            else if ( (c.PackInstinct & PackInstinct.Daemon) != 0 )
                packInstinct = 1049574; // Daemon
            else if ( (c.PackInstinct & PackInstinct.Bear) != 0 )
                packInstinct = 1049575; // Bear
            else if ( (c.PackInstinct & PackInstinct.Equine) != 0 )
                packInstinct = 1049576; // Equine
            else if ( (c.PackInstinct & PackInstinct.Bull) != 0 )
                packInstinct = 1049577; // Bull

            AddHtmlLocalized( 153, 204, 160, 18, packInstinct, LabelColor, false, false );

            if ( !Core.AOS )
            {
                AddImage( 128, 224, 2086 );
                AddHtmlLocalized( 147, 222, 160, 18, 1049594, 200, false, false ); // Loyalty Rating

                AddHtmlLocalized( 153, 240, 160, 18, (!c.Controlled || c.Loyalty == 0) ? 1061643 : 1049595 + (c.Loyalty / 10), LabelColor, false, false );
            }

            AddButton( 340, 358, 5601, 5605, 0, GumpButtonType.Page, 1 );
            AddButton( 317, 358, 5603, 5607, 0, GumpButtonType.Page, page - 1 );
            #endregion
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
            String reply = "" ;
            switch (info.ButtonID)
            {
                case 1001: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Hits).DoOnClick(m_bc); break;
                case 1002: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Stam).DoOnClick(m_bc); break;
                case 1003: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.Mana).DoOnClick(m_bc); break;
                case 1004: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPhysResist).DoOnClick(m_bc); break;
                case 1005: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusFireResist).DoOnClick(m_bc); break;
                case 1006: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusColdResist).DoOnClick(m_bc); break;
                case 1007: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusPoisResist).DoOnClick(m_bc); break;
                case 1008: reply = m_bc.m_jakoAttributes.GetAttribute(JakoAttributesEnum.BonusEnerResist).DoOnClick(m_bc); break;

            }

                from.SendMessage(reply);

            base.OnResponse(sender, info);
        }
    }

   
    }
I'm pretty sure this is a killer script if I would just stop screwing it up.
 

Jerbal

Sorceror
Line 363 has only one FormatString()
"FormatString(c.SexString)"

I don't understand how the shard could work once and then stop working. This is error is an implication that you a re missing the FormatString function.

This is a merging error that I mentioned iin the previous post...
Under:
Code:
        private static string FormatElement( int val )
        {
            if ( val <= 0 )
                return "<div align=right>---</div>";

            return String.Format( "<div align=right>{0}%</div>", val );
        }

Add:
Code:
       private static string FormatString(string str)
        {
            if (str.Length == 0)
                return "<div align=right>---</div>";

            return String.Format("<div align=right>{0}</div>",str);

        }
 

madphatboy2

Wanderer
Thank you for your patience. I probably should have mentioned that I started completely over because of some really weird errors related to something else that nobody could seem to figure out. This was indeed a simple error again. I appreciate you teaching me the value of being very careful when merging scripts. :)
 

madphatboy2

Wanderer
I don't know why I keep having issues. I want to use this script because I think it would add a nice element to the game. I have been battling this since I installed the script, but I wasn't sure it was this script until now. On server reboot, it wants to delete any spawned or tamed creatures. I've only noticed on beetles so far that it doesn't show the sex. But it seems that when something is spawned such as a bird usually, and then there is a save like on a restart, it wants to delete that mobile. Hopefully you have the answer.... :)
 

Jerbal

Sorceror
Your serialize and deserialize don't match in your BaseCreature.cs

Post your serialize and deserialize functions and I'll take a look. It's likely a bad merge again.
 
Top