I will take a look at this, I do not suspect this should be too hard, have you tried following the original instructions from the thread? as this system isn't that involved. Also to note, the resources section is for confirmed built resources or projects. Port over request or issues with scripts really should go in script support.
[doublepost=1503502850][/doublepost]I combined all the classes into one file (still a bit messy but i dislike multiple files for one system).

The only code that needed to be updated to servuo current standard was the way commands were handled.

It compiles fine, however the beverages.cs is a distro file, which means you need to merge the beverages.cs provides with your own. It's not an exact merge due to how old the beverage file is, so use something like winmerge or meld and careful move things over. The instructions provided in hunger.cs seems to indicate what to change however I would still compare the two side by side just in case. I will see if i can produce a modified beverage file for you.

Distro Edit notes in Hunger.cs

Code:
//////////////////////////////////////////////////////////////////////////////////////////
// Script written by GM Jubal for Ebonspire a player run Shard http://ebonspire.com
// An easy way for players to monitor their hunger without the need for using a gump
// simply displays a message relative to your hunger level using the command [myhunger
//////////////////////////////////////////////////////////////////////////////////////////
// To give hunger and thirst a real meaning modify the following files as outlined below
//
// Modify FoodDecay.cs line 14 TimeSpan.FromMinutes( 5 ) in both places to the time span
// you want to use.  A time span of 5 loses 1 point of hunger and thirst per 5 minutes. I
// used a time span of 10 minutes on my shard which means that players don't starve to
// to death if they are at 20 hunger for 3 hours and 20 minutes or 300 minutes. This part
// was not written to cause any real damage to the players, just enough to add some
// realism to the need to eat and drink.
// Added to FoodDecay.cs
// in FoodDecay() add if ( state.Mobile != null && state.Mobile.AccessLevel == AcessLevel.Player ) // Check if player
// In HungerDecay( Mobile m ) add:
//            {
//                if ( m.Hunger >= 1 )
//                {
//                    m.Hunger -= 1;
//                    // added to give hunger value a real meaning.
//                    if ( m.Hunger < 5 )
//                        m.SendMessage( "You are extremely hungry." );
//                    else if ( m.Hunger < 10 )
//                        m.SendMessage( "You are getting very hungry." );
//                }  
//                else
//                {
//                    if ( m.Hits > 5 )
//                        m.Hits -= 5;
//                    m.SendMessage( "You are starving to death!" );
//                }
//            }
//
// In ThirstDecay( Mobile m ) add:
//            {
//                if ( m.Thirst >= 1 )
//                {
//                    m.Thirst -= 1;
//                // added to give thirst value a real meaning.
//                    if ( m.Thirst < 5 )
//                        m.SendMessage( "You are extremely thirsty." );
//                    else if ( m.Thirst < 10 )
//                        m.SendMessage( "You are getting thirsty." );
//                }
//                else
//                {
//                    if ( m.Stam > 5 )
//                        m.Stam -= 5;
//                    m.SendMessage( "You are exhausted from thirst" );
//                }
//            }
//        }
//
// Added and modified in Beverage.cs
// in Pour_OnTarget( Mobile from, object targ ) add:
//                // increase characters thirst value based on type of drink
//                if ( from.Thirst < 20 )
//                {
//                    switch ( this.Content )
//                    {
//                        case BeverageType.Water: from.Thirst += 5; break;
//                        case BeverageType.Milk: from.Thirst += 4; break;
//                        case BeverageType.Ale: from.Thirst += 3; break;
//                        case BeverageType.Wine: from.Thirst += 2; break;
//                        case BeverageType.Cider: from.Thirst += 3; break;
//                        case BeverageType.Liquor: from.Thirst += 1; break;
//                    }
//                    // Send message to character about their current thirst value
//                    int iThirst = from.Thirst;
//                    if ( iThirst < 5 )
//                        from.SendMessage( "You take a drink but are still extremely thirsty" );
//                    else if ( iThirst < 10 )
//                        from.SendMessage( "You take a drink and feel less thirsty" );
//                    else if ( iThirst < 15 )
//                        from.SendMessage( "You take a drink and feel much less thirsty" );
//                    else
//                        from.SendMessage( "You take a drink and are no longer thirsty" );
//                }
//                else
//                    from.Thirst = 20;
//
// Now if you really want to add something to make hunger and thirst really mean something
// also add the following two files HitsDecay.cs and StamDecay.cs  These files are commented
// in themselves to show what they do.
////////////////////////////////////////////////////////////////////////////////////////////
 

Attachments

  • HungerSystem.cs
    6 KB · Views: 85
Last edited:
That was fast, thank you! I used RunUO like 6 years ago briefly. I just got into ServUO a week ago and have been learning pretty quick, I have not merged anything, no idea how to convert a file from RunUO to ServUO, but if there is a walk through I could maybe wing it. I work in the game industry, and would be more interested in tutorials tools and tips associated with updating graphics to EC so I never have to look at low res anything ever again.
[doublepost=1503589800][/doublepost]Is any scripting required when creating EC graphic counterparts for items that do not already?
 
Very interesting topic.
Would it be possible to disable stat and skill gains when Hunger = 0/Thirst = 0?
 
Sorry to necro, where do i put this script or how do i implement it thanks?

You can put it any where inside your "scripts" folder. I always recommend to create a "customs" folder inside your scripts folder (if you haven't already), to add custom scripts to so they are easy to find if you ever need to look at them.
 
You can put it any where inside your "scripts" folder. I always recommend to create a "customs" folder inside your scripts folder (if you haven't already), to add custom scripts to so they are easy to find if you ever need to look at them.
THank you i already figured out forgot to edit but thanks :D and custom folder sounds like a plan!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back