Scripting Guide


Scripts allow you to modify your shard.
Most tokens and arguments are self-explanatory;
however, some of the operators appear boolean,
which means 0 equals off or true, 1 as false
or on.  Some others use 2, so I am not sure
what that comes from, but it works fine.


I am describing only one detailed script and
a few snippets of other scripts.  With information
provided in these documents, you should have a
good handle on what most items and operators mean.



Some of my observations of time durations may
be wrong, so experiment.  I am not sure if some
of the ranges are in UO Minutes/Seconds or even
actual REALLIFE Seconds or Minutes.
One of the handier commands is
'SECONDSPERUOMINUTE
where seconds refers to Real Life seconds.


Here is a worked out description of what I have
found in SERVER.SCP.  Note that these may be wrong,
so make your own observations and question the
developers of the scripts (Ripper knows all!)



SERVER.SCP 	Some things to note: 0 is true for conditions, 1 for false.
DECAYTIMER  	sets the rate in UO seconds for decay
INVISTIMER  	sets the rate in real life seconds for duration of invisiblity
HUNGERRATE  	the duration for each level of hunger
SKILLDELAY  	how much time must elapse until using another skill
OBJECTDELAY 	how much time must elapse to use an object
HITPOINTS_REGENERATE & MANA_REGENERATE rate of health/mana regeneration
GATETIMER   	duration of gate spell
MINECHECK   	0 is mining anywhere, 1 for caves, 2 for specified regions only
SHOWDEATHANIM 	shows player death animation
COMBAT_HIT_MESSAGE displays on 0 the area on player that is struck when in combat
MONSTERS_VS_ANIMALS allows monsters and animals to attack each other based on their notoriety or their AI.
ANIMALS_ATTACK_CHANCE allows animals to attack players
ANIMALS_GUARDED guards will respond when attacking animals (?)
NPC_BASE_FLEEAT allows npcs to break from combat to heal
NPC_BASE_REATTACTAT allows npcs to reenter combat when sufficiently recovered
GUARDSACTIVE 	1 off in guarded zones, 0 on
BG_SOUNDS 	background sounds 0 is off (?) 1 is all 2 is (?)
ARCHIVEPATH 	use this to designate the archive that sends timed backups to a new folder.  Great for reverting to a previous world file or finding bugs. Use a full directory path.
UOXBOT 		an old irc logging bot for shard admins, inactive now
HUNGER_DAMAGE 	allows players or npcs (?) to take damage from hunger and starvation
HUNGER_DAMAGE_RATE rate in real minutes of damage from starvation
ARMOR_AFFECT_MANA_REGEN token for types of armor slowing the regeneration of mana
JOINMSG 	allows all on shard to see who logs on
PARTMSG 	allows all on shard to see who logs off
LOG 		logs PvP combat in PvP.log
ROGUE 		who knows. . .maybe logs thefts
ANNOUNCE_WORLDSAVES 0 does not show all when worldsaves occur

	SPEED SECTION
LAG_FIX 1 	allows speed modifications to occur
CHECK_ITEMS 	rate of loop checks, for lag control in spawning new items
CHECK_NPCS 	rate of loop check, for lag control in spawning new npcs
CHECK_SPAWNREGIONS rate of loop check for regions

	RESOURCE SECTION
ORE_PER_AREA 	in an area defined by (ORE_RESPAWN_AREA) square coordinate (not tiles!) area, the number of ore that is available.
ORE_RESPAWN_TIME duration in uo seconds for area to respawn one ore
ORE_RESPAWN_AREA coordinate area that checks for amount of material. The same goes for logs.

	REPSYS SECTION
MURDER_DECAY 	duration of murder on players record or is it time until murderer's corpse or murdered corpse decays?
MAXKILLS 	kill limit before player becomes Murderer
CRIMINAL_TIME 	duration player is flagged a criminal in real time seconds

	BEGGING/FISHING/SPIRITSPEAK
BEGGING_RANGE 	tile range where a beggar will beg
BASE_FISHING_TIME duration of each fishing action
SPIRITSPEAKTIMER real life seconds for speaking with the dead

	TIME_LIGHT SECTION
DAY 		not sure how many days are in an UO year
HOUR/MINUTE 	time of day Use 'SETTIME dd dd (09 00 for 9 am, 22 00 for 10 pm) based on 24 hour clock
DUNGEONLIGHT 	darkness level based in decimal
WORLDFIXEDLEVEL unsure
WORLDCURLEVEL 	if using /LIGHT -1, the current hour based light level
WORLDBRIGHTLEVEL/WORLDDARKLEVEL ultimate brightness or darkness of day/night


As stated before, experiment with the values and operators, and please submit any
corrections, modifications and further details to 
Leper Khan <mailto:bricktosser@netzero.net>.  Here are some snippet details for other scripts.



TRIGGER.SCP
SECTION TRG 1
{   Section open bracket
EMT Player emotes message
MSG Displays message for player
SND Plays hex sound reference
HEA Does math on players health
ACT Player displays action referred by ACTIONS.SCP
}   Section close bracket


NEWBIE.SCP
SECTION BESTSKILL 0   Refers to skills in SKILLS.SCP
{ // ALCHEMY   
PACKITEM  Refers to ITEMS.SCP
}


SECTION DEFAULT
{  // THIS GOES TO ALL NEWBIES DESPITE SKILL
PACKITEM Refers to ITEMS.SCP.
}

Be aware that item 328 is a bag; as this has 'newbie' privilege, it will protect all items in it from loss due to death.  Comment it out // if this is not a feature on your shard.
NPC.SCP
SECTION NPC 554
{
NAME a ratman mage
ID 002a			Not an item!
SKIN 03ea			Color of skin.  Use 'TWEAK to modify in game.
DIRECTION N		Direction of initial facing.
BACKPACK			Has a pack of loot when dead.
PACKITEM 469		Specific loot on corpse.
MAGERY 500 700		Range of magery skill is 50 to 70.
SPATTACK 255		Spell attack value
SPADELAY 10		Delay in Real Life seconds per cast.
LOOT 6			Random item from lootlist 6
LOOT 10
LOOT 20
GOLD 0 96			Range of gold found on corpse.
STR 96			Strength--note this does not have a tenth placeholder as does skills.
DEX 0 0
INT 36
KARMA -1500		Karma level of creature, not the karma you get if you kill it.
FAME 1500			Fame level
PARRYING 500		skill and the level, so Parrying of 50.0
MAGICRESISTANCE 350
TACTICS 500
FENCING 500
// Damage per Weapon
DAMAGE 3 15		Range of damage
DEF 14			AR Armor rating
NPCWANDER 4		Type of wander mode.  Refer to GM Commands <commands.html>
FX1 -1			Refers to where the npc spawns.  More info in NPC <npc.html>
FY1 -1
FZ1 -1
FX2 20
NPCAI 2			Refers to the mentality, the Artificial Intelligence.  Setting NPC AI <setnpcai.html>
TOTAME 1100		Base chance to tame--you would need 110.0 Taming.
}

ENVOKE.SCP	For use by wtrigrs (world triggers) format is xhhhh.  Correct any missing zeroes that should be included if only 3 numbers.  The 'x' is the hex place holder.
WTRIGRS.SCP	Same format as ENVOKE.SCP

SECTION x0c96
{ Pick dates
REQ x09a6 x09a5			Note the 'x'precedes a four digit hex number.  Anytime you see 3 digits, chances are it's wrong, and needs a zero after the 'x'.
MSG You pick some dates		This is the message displayed as the trigger is fired.
SND 00 4f				This is the sound played as the trigger is fired.
ACT 13				This is the player action.
IDADD 17 27 1			IDADD refers to the hex value of an item, not the listing in ITEMS.SCP.  The third number is the amount.
NEWTYPE 14			This operator makes the item edible--see Setting Types <settype.html>.
}

NTRIGRS.SCP	Make sure any npc triggers are listed here, not in TRIGGERS.SCP.
CREATE.SCP	Makemenus for professions.  Skill=required skill of user, resource is how much material is needed to make item additem from ITEMS.SCP.
SKILLS.SCP	This is the listing of the skills currently in use.  Recall that skills use a tenth place holder, ie: Alchemy 700 is actually 70.0.  Now, you see SKILLPOINT 0 70 50.  What that means is this:  From the range zero to 7.0 skill, you will get 5.0 skill points when this skill is used.  I am not sure if this means successful use or both unsuccesful and success, but my money is on success. Also note the stats:  This looks like minimum requirements.  Zippy says different: 0 70 50 means at skill zero, you gain 70% of the time on success, 50% of the time on failure.
SPELLS.SCP	This one has good descriptions of the operators in the script.
SPEECH.SCP	DEFAULT is for anything the npc can't understand. ON is what PC's say. Great for setting up clues to quests.
ADVANCE.SCP 	For advancement gates.  Refer to Just Michael's FAQ for a good explanation.
GRAVE.SCP		Lootlist in NECRO.SCP. Use a shovel on a grave--but be careful of the undead!
HOUSE.SCP		SPACEY & SPACEX are the required area operators of clear land.  You can comment	them out to place buildings where you wish. CHARXYZ is where the player is put in relation to the placement of building.
ITEMS.SCP		ITEMMENU refers to the menu gump when using the 'ADD command.
// Smithy Hammer
SECTION ITEM 98
{
ID 13E4		The hex value of the item.
LAYER 1		Where the item goes on the paperdoll when equipped.
LODAMAGE 3	Low range of damage.
HIDAMAGE 15	High range of damage.
HP 60		Durability of the item.
DECAY		Sets item to decaying if left out of a container.
VALUE 25		The resell/sell value in npc shops.
RESTOCK 1		The amount in shopkeepers restock layer.
STR 30		Strength required to use.
SPD 50		Speed of weapon.
WEIGHT 800	Weight.  Not sure the fractional amount; might be 8 stones.
}
MENUS.SCP		Here you can edit the Game Master or Counselor Call menus.
LOCATION.SCP	Use 'GOPLACE ## in ref to these numbers.
MISC.SCP		Edit books/update gump.
NECRO.SCP		Loot and creature lists for grave digging.
COLORS.SCP	Lists colors.
SPAWN.SCP		A region spawning setup.  Use x1 y1 as northwest box corner
			x2 y2 as southeast box corner.

REGIONS.SCP	This snippet on how to make guarded regions provided by Lord Astynax.

Altering/Setting Guard Zones

This is an example on how to alter/set your own guard zones.  It's pretty easy, but it can be somewhat time-consuming if you are 
setting a zone to a large area...All this information is edited in your "regions.scp"

SECTION REGION 3
{
NAME the town of Britain <-this is the name message you get upon entering the guarded zone.  You can rename the town to anything you wish.  Example: "NAME the town of Timbuktu" Would give you: "You are now entering the town of Timbuktu"
MIDILIST 1 <-this is the midilist of midis that are played within your guarded area.
GUARDED 1 <-this is the command for whether or not you wish this zone to be guarded "1" is guarded "0" is not.
GUARDNUM 1000 <-these are the guard npc's that will be found within your guarded zone
GUARDNUM 1000
GUARDNUM 1000
GUARDNUM 1000
GUARDNUM 1000
GUARDNUM 1001
GUARDNUM 1001
GUARDNUM 1001
GUARDNUM 1001
GUARDNUM 1001
GUARDOWNER Lord British's <-this is the name displayed upon entry of the zone.  IT may be changed to whatever Exp. "You are now entering protection of the Lord Astynax' guards."
MAGICDAMAGE 0 <-this is the command that determines whether magic does damage within your city limits or not "1" is yes, "0" is no.
MARK 1 <-this command determines whether marking is allowed within the zone.  Once again, "1" is yes, "0" is no.
GATE 1 <-this command is for gating in the limited "1" is allowed, "0" is not.  Wind is an example of not.
RECALL 1 <-this command is exactly like the gate and mark command
SNOWCHANCE 10  }_ These two commands are for the percentage change that the respective climate will occur within your zone.  Any percentage may be entered.
RAINCHANCE 25  }
X1 1330 <-These are the coordinates you must set to define the zoned   
Y1 1695   area.  X1/Y1 is point "a" X2/Y2 is point "b"  Basically,
X2 1407   you must "point A, point B" your way around the zone
Y2 1845   you want to establish.  Get the where coordinates for
X1 1407   each point, and alternate between a point "a" and point
Y1 1490   "b" until you make the zone you want.
X2 1680   Simple  =)
Y2 1695
X1 1407
Y1 1695
X2 1680
Y2 1795
X1 1680
Y1 1525
X2 1730
Y2 1695
X1 1407
Y1 1795
X2 1455
Y2 1845
}
That's it.  Easy as hell.  You can add as many guard zones as you want,
though I'm not sure what happens if two guard zones overlap.  hehe  I 
wouldn't recommend trying.  For a zone border like Britain common, and 
Britain farms, you use the same coordinates for the border in both 
zones.  Good luck, and have fun!  If anyone has a question, feel free 
to email me:  Astynax <mailto:Richard@bootheel.net>

SECTION REGION 1  // This is intended for out of town mining areas.
{
GUARDED 0	Guards off
MAGICDAMAGE 1	Magic works
MARK 1		Mark works
GATE 1		Gate works
RECALL 1	Recall works
}

