1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
5/5, 1 rating

Personal Notes and Shortcuts

Summary of the tutorial

Over the years I have gathered notes and shortcuts for various functions on a shard. Most of these are fairly common, and I can't guarantee they do or will continue to work with ServUO repos, but they can help point you in the right direction.

1 In-Game Commands

A few of these were shown to me by Peoharen years ago, and others I have figured out. These are just meant to show examples of what can be done.

Here is an example of creating a new creature "on the fly" without using spawners (or Xmlspawners more specifically):
Code (C#):
  1. [add demonknight set name "<BASEFONT COLOR='#FFA3B1'>a pink bunny" hue 1166 bodyvalue 205
This will spawn "a pink bunny" with a hue of 1166, and a bodyvalue of 205, but have DemonKnight stats. Notice the BASEFONT COLOR, this will set the hue for the name of the mob.

Similar to the new creature code, this handles static items:
Code (C#):
  1. [add static 12216 set name "<BASEFONT COLOR='#880000'>Glaring Eyes" hue 1194 movable true
Adding items globally to player's backpacks:

This code will add ItemName to ALL mobiles backpacks that are players only:
Code (C#):
  1. [global addtopack ItemName where playermobile
Similar to the above, but handles Online players only:
Code (C#):
  1. [global addtopack "item name" where playermobile map != null (to get just the online players)
Using filters and altering more properties:
Structure - [global addtopack [class name of item to add] set [property name] [value] [property name] [value] ... where [class name to use as filter] [property name] [comparison expression] [value]
Example -
[global addtopack apple set itemid 123 hue 456 name "Chocolate bunny" where playermobile skills.wrestling < 100[/code]

Alternative code that also adds a normal item to all player's backpacks that are online only, but with a different itemID.
Code (C#):
  1. [online addtopack apple set itemid 123 hue 456 name "Chocolate bunny" where playermobile
If you have a script item which you would like to use.
Code (C#):
  1. [online addtopack superdragonarmor name "Surprise" where playermobile
Code (C#):
  1. [online addtopack cake hue 302 name "Special Cake" where playermobile
Changing the hue of multis, like houses, boats, etc.
Code (C#):
  1. [area interface where basemulti
I have seen this question asked many times before, "How do I move a decorated house with all the stuff inside?"
The quickest way, and there may be better options:

Note: The location for a house is dead center of the floor plot, so when you select the destination take that into account.

1.[props - target house sign.

2. Click arrow next to "Owner"

3. Then "View Properties" on the owner menu

4. Go to second page of properties menu and look for "Location" and "Map"

5. Write down the current location, then enter the destination co-ordinates.

*** Venders, teleporters and some add-on items MAY not move with the plot. IF you have this happen, use the original location and destination location to calculate an offset formula.
(IE Original X3000, Y2000 - Destination X5000, Y1500 = Offset X2000, Y -500)

With that in hand, you can now move BillyBob the the cheese seller.
1. [props on vender, location x3009, y2012
2. Add in formula to get new location = X5009,Y1512
POOF vender is now in the exact relationship to the house, but in the new destination.
or
Code (C#):
  1. [inc x 2000 y -500 <enter> target NPC

1.1 Script code

Item activation by players:
If your item does not fit one of these categories, then you need to add it to the BaseHouse code here somewhere:

Code (C#):
  1.  else if ( from.AccessLevel >= AccessLevel.GameMaster ) <--**This has changed in ServUO**
  2.                 return true;
  3.             else if ( item is Runebook )
  4.                 return true;
  5.             else if ( item is ISecurable )
  6.                 return HasSecureAccess( from, ((ISecurable)item).Level );
  7.             else if ( item is Container )
  8.                 return IsCoOwner( from );
  9.             else if ( item.Stackable )
  10.                 return true;
  11.             else if ( item is BaseLight )
  12.                 return IsFriend( from );
  13.             else if ( item is PotionKeg )
  14.                 return IsFriend( from );
  15.             else if ( item is BaseBoard )
  16.                 return true;
  17.             else if ( item is Dices )
  18.                 return true;
  19.             else if ( item is RecallRune )
  20.                 return true;
  21.             else if ( item is TreasureMap )
  22.                 return true;
  23.             else if ( item is Clock )
  24.                 return true;
  25.             else if ( item is BaseInstrument )
  26.                 return true;
  27.             else if ( item is Dyes || item is DyeTub )
  28.                 return true;
  29.             else if ( item is VendorRentalContract )
  30.                 return true;
  31.             else if ( item is RewardBrazier )
  32.                 return true;