zerodowned

Moderator
To start this off, I'm going to post some info that Peoharen posted on http://www.runuo.com/community/threads/peos-tweaks.97665/

** Note: I haven't double checked any of these yet. Peo's post is from back in 2009 and chances are that some of it is outdated and/or isn't formatted correctly for ServUO

Peo's Tweaks

These are some small tweaks that you may find useful. All of them are minor one liners or so but can have huge impacts on how things work but are generally generic enough any shard can find a use for them. I'll occasionally add new things to it so check back every once in awhile.


***

New players are not penalized for insuring their items.
New players keep their items for free. The problem is insurance is checked before young status. so if a Young person has an insured item they are charged 600 gold for what should be a free service they already have due to being young. This tweak fixes that problem.

PlayerMobile, GetParentMoveResultFor method.
Find

C#:
            if ( CheckInsuranceOnDeath( item ) )
                return DeathMoveResult.RemainEquiped;
Change to

C#:
            // Fix the bug of young people would be charged if they insured their items despite the fact young players keep items for free
            if ( !Young )
                if ( CheckInsuranceOnDeath( item ) )
                    return DeathMoveResult.RemainEquiped;
This thread was talking about moving items on death which reminded me of fixing noobs death looting.

***

Keep blessed/insured items equipped.
Just an edit to keep items that don't leave you from death on your body rather than being dumped into your backpack. I suppose there is two sides with this, one your getting rid of an annoyance. Two you're not giving people a reason to setup arm/disarm macros in Razor since your shard does it for them.

PlayerMobile, GetParentMoveResultFor method.

C#:
            // Items remain equipped if possible
            if ( (res != DeathMoveResult.MoveToCorpse && item.Movable) || this.Young )
                res = DeathMoveResult.RemainEquiped;
            else if ( this.AccessLevel >= AccessLevel.GameMaster )
                res = DeathMoveResult.RemainEquiped;
Instead of MovetoBackpack RemainEquipped it used. Items that cannot be equipped are not even handled here so no worries on trying to equip your firehorn or w/e. Also included is a line so all staff keep their stuff equipped. You'll probably see a lot of staff only tweaks, I'm lazy enough to make them so I don't have to do anything in game but annoy people.

***

[Staff] Resurrects with full stats, and on one has those stupid damn death robes.
Speaking of Player death, staff tend to res in a state that gets them killed again. also, those stupid death robes are annoying. Any they also get created then deleted due to insured/blessed robes from the keep items equipped edit. Might as well stop their creation to begin with.

PlayerMobile, Resurrect method.

C#:
            /*if ( this.Alive && !wasAlive )
            {
                Item deathRobe = new DeathRobe();

                if ( !EquipItem( deathRobe ) )
                    deathRobe.Delete();
            }*/

            // Staff now res to full health
            if ( this.AccessLevel > AccessLevel.Player )
            {
                BodyValue = 987; // Lets them walk though doors instead of having to open them.
                Hits = HitsMax;
                Mana = ManaMax;
                Stam = StamMax;
                Fame = 0;
                Karma = 0;
            }
***

Staff cast spells without regents.
Title says all, almost the same edit can be used for regless casting so if you're making one of those retardedly lame all skills no regs uber arties to start pvp shards I'm sure you'll want something like this too.

MagerySpell, ConsumeReagents method.

C#:
            if ( Caster.AccessLevel != AccessLevel.Player )
                return true;
Srsly, it's that easy. For necro, see below, and for Chiv add an access level check to CheckCast.

C#:
else if ( [I]Caster.AccessLevel == AccessLevel.Player &&[/I] Caster.TithingPoints < RequiredTithing )

***

Hunger/thirst effects gain.
Ever seen those stupid must eat or take HP damage things posted? I suppose the idea sounds pretty fair, but again I'm lazy. Screw carrying around food to feed my player, I have enough problems feeding my self during a peerless run. Anyway, like OSI this tweak will mean you have to eat and drink for skill gains.

SkillCheck, CheckSkill method, below gc *= skill.Info.GainFactor;

C#:
            // Hunger & Thirst check
            if ( from is PlayerMobile )
            {
                if ( from.Hunger <= 5 )
                    gc *= 0.25;
                else if ( from.Hunger <= 10 )
                    gc *= 0.50;
                else if ( from.Hunger <= 15 )
                    gc *= 0.75;

                if ( from.Thirst <= 5 )
                    gc *= 0.25;
                else if ( from.Thirst <= 10 )
                    gc *= 0.50;
                else if ( from.Thirst <= 15 )
                    gc *= 0.75;
            }
For every 5 points they are from being 'full' their gain chance drops by 25%.

On a side note, generally increasing gc is how you speed up gains and also in this script allows you to edit the stat gain delay. If you're wanting a super fast shard that players can gain like +2.0 in a skill during the 0~50 range you should spend the 8 seconds allowing them to gain a stat point more than once every 15 minutes. You have no idea how much it pisses me off to find a shard where the skill gain and training areas proves the intent of getting you to GM within an hour or two or so but you only get like 4 points in str while doing it. It's like bitch smacking people, "I see you GMed all your skills overnight like I wanted, but alas I'm too stupid to know you cannot do the same with your stats so toggle a skill to decrease and train something else back and forth over the next week instead." On a good note, it does let you know what shards to avoid like a plague infested flies on a rat.

****

Creatures can use AOS items.
By default creatures cannot gain hits/stam/mana boosts from items. If you're like me, when you place an arty on your in game monster bash, you equip the monster with it rather than just tossing it into it's pack. For pokemon shards or those trainable mercenaries or whatever, this edit is required.

BaseCreature, ___Max methods.

C#:
        [CommandProperty( AccessLevel.GameMaster )]
        public override int StamMax
        {
            get
            {
                int stam = (m_StamMax > 0) ? m_StamMax : Dex;

                if ( Core.AOS )
                    stam += AosAttributes.GetValue( this, AosAttribute.BonusStam );

                return stam;
            }
        }
Do pretty much the same with the rest.

***

The damn weather.
It rains all the damn time in UO. The addition of rain is supposed to add an in game element towards the goal of providing a simulated world. Bullshit. If it rained even a 3rd of much in real life as it does in UO we'ed all be living in Waterworld. Where in the hell does all the rain come from? It rains like twice a UO day all year though out the entire world.

Weather, Initialize method.

C#:
            for ( int i = 0; i < 15; ++i )
	AddDynamicWeather( +15, 25, 5, 8, 400, 400, new Rectangle2D( 0, 0, 5120, 4096 ) );
Pretty much do the same for anything else. 25% chance seems to be better though I'm not a weather man to know for sure.

***


Increased vet cap.
I do a +100 increase in cap for veteran players instead of the mere +20.

RewardSystem, EventSink_Login

C#:
            if ( e.Mobile.SkillsCap >= 7000 && e.Mobile.SkillsCap < 7950 )
            {
                if ( level > 20 )
                    level = 20;
                else if ( level < 0 )
                    level = 0;

                if ( SkillCapRewards )
                    e.Mobile.SkillsCap = 7000 + (level * 50);
                else
                    e.Mobile.SkillsCap = 7000;
            }
Once they hit the 800.0 mark the script no longer cares about them, same for those counselors you capped at 0. If you run higher caps be sure to alter the numbers.


***

Rikktor is a Champion.
Of power, whom uses melee attacks only. Yet he cannot hit a damn thing. Behold the might champion of power miss a noob Samurai, becuase his combat skills are better than Rikktors!

Add SetSkill( SkillName.Wrestling, 100.0 ); to his file.

***

Leech life scales based on speed.
Yeah, at this point I wish I knew enough about the SVN to just upload some of this stuff, but what do I care right? Some of these things have been reported for years and I'm not about to learn why SVN is sooo useful. I'm dead set in my old ways.

BaseWeapon, just do a code search.

C#:
                if ( lifeLeech != 0 )
                    //attacker.Hits += AOS.Scale( damageGiven, lifeLeech );

//Should be something more akin to
	

	
                if ( lifeLeech != 0 )
                    attacker.Hits += AOS.Scale( damageGiven, (lifeLeech + 30) - (Speed / 2) );
I totally guessed on the formula though.

***

Breath is no longer auto kill.
Since breath damage is uncapped, a Leviathan deals like 1,000 fire damage to people. Ouch right? Same for anything else you pump up the HP on.

BaseCreature, BreathComputeDamage method.

C#:
            if ( damage > 375 )
                damage = 375;
375 - 70% = 112 right? So now it's possible to live though it. Provided you have 113 HP and at max fire res. :D

***

Magery summons are, well, summoned
Thought of this while I was looking over my post today (see edit date).

BaseCreature, Summon, below creature.m_SummonEnd = DateTime.Now + duration;


C#:
            if ( creature is AirElemental || creature is EarthElemental || creature is FireElemental || creature is WaterElemental || creature is EnergyVortex )
            {
                creature.Freeze( TimeSpan.FromSeconds( 1.1 ) );
                creature.MoveToWorld( p, caster.Map );
                creature.Animate( 12, 5, 1, true, false, 0 );
            }
            else
                creature.MoveToWorld( p, caster.Map );
I think thats it.

***

Councilors cannot pick items up
Per OSI, councilors cannot pick items up. Combine with blocking their skill gains to prevent skill use and a blessed state and the only unlogged thing they can do is spy on opposing guilds/factions. The much less abusable staff condition will allow you to hire new staffmen with less risk to your shard.

C#:
namespace Server.Network
{
    public class LiftHandler
    {
        public static void Configure()
        {
            PacketHandlers.Register( 0x07, 7, true, new OnPacketReceive( NewLiftReq ) );
        }

        public static void NewLiftReq( NetState state, PacketReader pvSrc )
        {
            if ( state.Mobile.AccessLevel == AccessLevel.Counselor )
                state.Send( new LiftRej( LRReason.CannotLift ) );
            else
                PacketHandlers.LiftReq( state, pvSrc );
        }
    }
}
***
More later.
 
Wondering how to make a new player's backpack look more organized, like this
ai.imgur.com_IxfPe1V.jpg

Credits to Lord_Greywolf, he helped me with this after I saw he had something like it on his shard


just add this routineinto the script where you are adding the items


C#:
        private static void PlaceItemIn( int x, int y, Item item, Mobile from )
        {
            from.AddToBackpack(item);
            item.Location = new Point3D( x, y, 0 );
        }
then when you want to add an item in a certain spot, just do it like so:
(this one shows how to place many at once in a column)

C#:
                    for ( int l = 0; l < 10; ++l )
                    {
                        PlaceItemIn( 44, (70 + (l * 5)), new NewbieStatBall(10), m );
                        PlaceItemIn( 56, (70 + (l * 5)), new NewbieSkillBall(10), m );
                        PlaceItemIn( 68, (70 + (l * 5)), new NewbieSuperSkillBall(2), m );
                    }
but to place one would be:

PlaceItemIn( x,y, new YOURITEM(variable if needed), whoitgoesto );

here is an other one for placing in a container - like if you wanted a bunch of ingots organized in a bag, etc, or a reward chest, what ever


C#:
        private static void PlaceItemIn( Container parent, int x, int y, Item item )
        {
            parent.AddItem( item );
            item.Location = new Point3D( x, y, 0 );
        }

in your bag of ingots lets say, would look something like this:


C#:
using System;
using Server;
 
namespace Server.Items
{
    public class CraftBag : Bag
    {
        [Constructable]
        public CraftBag() : base()
        {
            Weight = 0.0;
            Hue = 2364;
            Name = "Craft bag";
            PlaceItemIn(this, 30, 30, new SewingKit() );
            //etc etc
        }
 
        private static void PlaceItemIn( Container parent, int x, int y, Item item )
        {
            parent.AddItem( item );
            item.Location = new Point3D( x, y, 0 );
        }
 
        public CraftBag(Serial serial) : base(serial){}
        public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); }
        public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); }
    }
}

just to let you know - the 0,0 for x & y is in the top left of the container
but the 1st usable x & y can be a lot more than 0, depending on the container, have to play with the numbers to get them right :)
 
more from Peoharen

How do I adjust Skillgain?
Misc\SkillCheck.CheckSkill
Adjust the variable gc to adjust overall skill gain. Example gc *= 2; doubles gain rate.
Be sure to read the comments at the top, you can adjust antimacro as well an decrease stat gain delays (pet delays are found farther below).

***

[BWhere do I change the starting location & items?[/B]
Misc\CharacterCreation.EventSink_CharacterCreated

You can adjust everything for new characters in this method. After the AddBackpack( newChar ); line you can do something like

Code (text):

Container c = newChar.Backpack;
c.DropItem( new Gold( 5000 ) );
c.DropItem( new EpicNoobDeed() );
or whatever.

newChar.MoveToWorld( city.Location, city.Map ); Can be adjusted to start a player where ever you want, for instance newChar.MoveToWorld( new Point3D( 89, 520, -50 ), Map.Malas ); would make them appear in Luna.

Finally you can directly set newChar's SkillCap & StatCap here.

***

How do I change the maximum cap for stats?
The maximum a player can have is 150 using items and 125 without.

To adjust the direct cap of 150 open PlayerMobile.cs and find the public fields for str/dex/int and adjust the value. Example

Code (text):

[CommandProperty(AccessLevel.GameMaster)]
public override int Int
{
get
{
if (Core.ML && this.AccessLevel == AccessLevel.Player)
return Math.Min(base.Int, 150);

return base.Int;
}
set
{
base.Int = value;
}
}
The cap on gaining no more than 125 in a stat is exactly where you think it is.
Misc\SkillCheck.CanGain.

***

Rapid fire questions

Q: How do I change the save delay?
A: Misc\AutoSave

Q: How do I change the welcome message?
A: Misc\WelcomeTimer

Q: How do I set my shard to SE/AOS/Pre-AOS?
A: Misc\CurrentExpansion


Q: This isn't in the misc folder, how do I allow regless casting?
A: You know, everything in this post and that question are covered in the sticky at the top of script support. You should try reading things before asking.
See the sticky
 
ok i have tried to change my stat and skills cap in just about every script i can find it in and it still did not change unless i use [props on the character
 
Great thread but runuo sticky is no longer accessible. I have a question is there a setting i can change somewhere to let jewelry with +to skills go over a players cap? ex. player with 120 parry wears a ring of +10 parry and gets 130? As i see it now i think it just stays 120 with or without the ring
 
if you want it to apply to ALL items open scripts/misc/AOS.cs

find the method:
public void AddTo(Mobile m)

and in it change: sk.ObeyCap = true; to false
 
reags: Spell.cs line ~335
replace the content of ConsumeReagents() to just return true;

movement: Spell.cs line ~645
set
Code:
public virtual bool BlocksMovement { get { return true; } }
to
Code:
public virtual bool BlocksMovement { get { return false; } }
 
reags: Spell.cs line ~335
replace the content of ConsumeReagents() to just return true;

movement: Spell.cs line ~645
set
Code:
public virtual bool BlocksMovement { get { return true; } }
to
Code:
public virtual bool BlocksMovement { get { return false; } }
There are any way to make mages walk instead of run or stay freeze ?
 
FYI for anyone else looking to change stat caps. They are now in Mobile.cs. You can set StrCap and StrMaxCap there.
 
trying to hard set a hits cap in the hitsmax for player mobile if anyone has a lead ive searched high and low found this
HitsMax { get { return 10000); } }

says i need a set or get tried to do both in various ways and some other things got it to compile but didnt actually work...
 
Is it possible to keep newbie items position in pack the same as before death, when you res?
(they get thrown in backpack, and every death/res, have to re-position them all).

to just keep them equipped sounds like it would work-but, remain equipped only handles keeping equipped things, leaving the rest to scatter in pack.
maybe i need to record the item position.. to make it put them back there after checking that they are newbie/blessed.

Any help would be appreciated, thanks.
 
Last edited:
Wondering how to make a new player's backpack look more organized, like this
ai.imgur.com_IxfPe1V.jpg


Credits to Lord_Greywolf, he helped me with this after I saw he had something like it on his shard


just add this routineinto the script where you are adding the items


C#:
private static void PlaceItemIn( int x, int y, Item item, Mobile from )
{
from.AddToBackpack(item);
item.Location = new Point3D( x, y, 0 );
}
then when you want to add an item in a certain spot, just do it like so:
(this one shows how to place many at once in a column)

C#:
for ( int l = 0; l < 10; ++l )
{
PlaceItemIn( 44, (70 + (l * 5)), new NewbieStatBall(10), m );
PlaceItemIn( 56, (70 + (l * 5)), new NewbieSkillBall(10), m );
PlaceItemIn( 68, (70 + (l * 5)), new NewbieSuperSkillBall(2), m );
}
but to place one would be:
How would one add this into the new player backpack?
 
How would one add this into the new player backpack?
It's something GreyWolf, i believe, showed me years ago

C#:
        private static void PlaceItemIn(Container parent, int x, int y, Item item)
        {
            parent.AddItem(item);
            item.Location = new Point3D(x, y, 0);
        }

then in usual AddPack method of CharacterCreation

C#:
PlaceItemIn( pack, 44, 70, new MasterStorage ());
 
An easy way to find the correct location is to place the items in your pack in game then use UoSteam's Object Inspector (under the Macros tab) and find the coordinates or position of the the item in the container gump

1634709993991.png
 
very useful thank you
how to let the character counterattcak when is attacked?
I've read somewhere but I can't find with the research
Thanks
 
Last edited:
Is there away to pull off this cool organizing trick with xmlspawners?

For example I have a bag that i gift to players but the items in it are all sloshed around on each spawn.

bagofgems/name/Maze Runner Survivor - Hard Mode/Movable/True/Liftoverride/True/Hue/32/X/6015/Y/2013/Z/6/ADD,1/<HeritageSovereign/amount/500>/ADD,1/<HeritageToken>/ADD,1/<PowerScroll105>/ADD,1/<PetBondingPotion/ItemID/3838/Hue/1174>/ADD,1/<Eventtoken/amount/5>
 
Last edited:
Is there away to pull off this cool organizing trick with xmlspawners?

For example I have a bag that i gift to players but the items in it are all sloshed around on each spawn.

bagofgems/name/Maze Runner Survivor - Hard Mode/Movable/True/Liftoverride/True/Hue/32/X/6015/Y/2013/Z/6/ADD,1/<HeritageSovereign/amount/500>/ADD,1/<HeritageToken>/ADD,1/<PowerScroll105>/ADD,1/<PetBondingPotion/ItemID/3838/Hue/1174>/ADD,1/<Eventtoken/amount/5>
Not that I'm aware of
 
You can probably set the x and y coordinates. But I never used the xml spawners.

So you can try to set it like X/100
 
PyrO good sir, you are a genius. I'm over here doing a facepalm for not trying that approach sooner. It worked like a charm.

I learn something new everyday. Thank you guys for your help
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back