Characters
A character can be either a player or an NPC.
Contents
References
References return pointers to other objects (e.g. the REGION reference allows you to access the REGION that an object is in). These can either be accessed by using <REFNAME> to return the UID (1 for object types that don't have UIDs) of the object or 0 if it doesn't exist, or by using <REFNAME.KEY> where KEY is a valid property/function/reference for the REFNAME object. Click on the name for more detailed information such as usage and examples.
Name | Read/Write | Description |
ACCOUNT | RW | Gets or sets the account that the character belongs to. |
ACT | RW | Gets or sets the object that is related to the action the character is performing. |
FINDLAYER.layer | R | Gets the object that the character has equipped in a specified layer. |
MEMORYFINDTYPE..memory_flags | R | Gets a memory item with the specified flags. |
MEMORYFIND.object_uid | R | Gets a memory item that is linked to the given object. |
OWNER | R | Gets the character that owns this character. |
SPAWNITEM | R | Gets the spawn item (t_spawn_char) that this character originated from. |
WEAPON | R | Gets the weapon that the character currently has equipped. |
P | RW | Gets or sets the position that the character is at. |
REGION | R | Gets the region that the character is currently located in. |
ROOM | R | Gets the room that the character is in. |
SECTOR | R | Gets the sector that the character is in. |
TOPOBJ | R | Gets the top-most object in the world that contains the character. |
TYPEDEF | R | Gets the ITEMDEF that defines the character. |
Properties and Functions
Here is a list of all character properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples. If an attempt is made to access a property that does not exist on the character, the property from the CHARDEF will be accessed instead.
Name | Read/Write | Description |
AC | R | Returns the character's total defense. |
ACTARG1 | RW | Gets or sets the character's ACTARG1 value. |
ACTARG2 | RW | Gets or sets the character's ACTARG2 value. |
ACTARG3 | RW | Gets or sets the character's ACTARG3 value. |
ACTDIFF | RW | Gets or sets the difficulty of the character's current action. |
ACTION | RW | Gets or sets the skill that the character is currently using. |
ACTP | RW | Gets or sets the character's ACTP value. |
ACTPRV | RW | Gets or sets the character's ACTPRV value. |
AGE | R | Returns the age of the character since its creation, in seconds. |
ATTACKER | R | Gets the number of opponents who have damaged the character. |
ATTACKER.LAST | R | Gets the UID of the opponent who most recently damaged the character. |
ATTACKER.MAX | R | Gets the UID of the opponent who has dealt the most damage to the character. |
ATTACKERn.DAM | R | Gets the amount of damage that the nth opponent has dealt to the character. (zero-based) |
ATTACKERn.ELAPSED | R | Gets the length of time since the nth opponent has damaged the characer, in seconds. (zero-based) |
ATTACKERn.UID | R | Gets the UID of the nth opponent who has damaged the characer. (zero-based) |
BANKBALANCE | R | Returns the total amount of gold in the character's bankbox. |
BODY | RW | Gets or sets the character's body. |
CANCAST spell_id, check_antimagic | R | Returns 1 if the character can cast a given spell, bypassing anti-magic field tests if check_antimagic set to 0. |
CANMAKE item_id | R | Returns 1 if the character has the skills and resources to craft a certain item. |
CANMAKESKILL item_id | R | Returns 1 if the character has the skills to craft a certain item. |
CANMOVE direction | R | Returns 1 if the character can move in the given direction. |
CANSEE | R | Returns 1 if SRC can see the character. |
CANSEELOS | R | Returns 1 if SRC has line of sight to the character. |
CANSEELOSFLAG flags | R | Returns 1 if SRC has line of sight to the character, with flags to modify what tests take place. |
COLOR | RW | Gets or sets the character's hue. |
CREATE | RW | Gets or sets the character's age since creation, in seconds. |
DEX | RW | Gets or sets the character's total dexterity. |
DIR | RW | Gets or setes the direction that the character is facing. |
DISMOUNT | W | Dismounts the character from their ride. |
DISPIDDEC | R | Gets the ID of the character as a decimal number. |
DISTANCE point_or_uid | R | Gets the distance between this object and either SRC, a map location or another object. |
EMOTEACT | RW | Gets, sets or toggles whether or not the character will emote all of its actions. |
EVENTS event_defname | RW | Gets a list of events attached to the object, or adds or removes an event to or from the object. |
EXP | RW | Gets or sets the character's experience points. |
FAME | RW | Gets or sets the character's fame. |
FAME.fame_group | R | Returns 1 if the character's fame falls within the specified fame group. |
FLAGS | RW | Gets or sets the character's flags. |
FONT | RW | Gets or sets the character's speech font. |
FOOD | RW | Gets or sets the character's food level. |
HEIGHT | R | Gets the character's height. |
HITS | RW | Gets or sets the character's hitpoints. |
ISARMOR object_uid | R | Returns 1 if the object is armour. |
ISCHAR | R | Returns 1 if the object is a character. |
ISCONT | R | Returns 1 if the object is a container. |
ISEVENT.event_defname | R | Returns 1 if the object has an event attached to it. |
ISITEM | R | Returns 1 if the object is an item. |
ISNEARTYPE type, distance, flags | R | Returns 1 if a nearby item has the given TYPE. |
ISNEARTYPETOP type, distance, flags | R | Returns a nearby world location of a nearby item which has the given TYPE. |
ISPLAYER | R | Returns 1 if the object is a player. |
ISTEVENT.event_defname | R | Returns 1 if the object has an event attached to its CHARDEF. |
ISWEAPON object_uid | R | Returns 1 if the object is a weapon. |
GOLD | RW | Gets or sets the amount of gold the character has. |
GUILDABBREV | R | Returns the character's guild abbreviation. |
HOME | RW | Gets or sets the character's home location. |
ID | R | Gets the character's ID. |
INT | RW | Gets or sets the character's total intelligence. |
ISGM | R | Returns 1 if the character is in GM mode. |
ISINPARTY | R | Returns 1 if the character is in a party. |
ISMYPET | R | Returns 1 if the character belongs to SRC. |
ISONLINE | R | Returns 1 if the character is considered to be online. |
ISSTUCK | R | Returns 1 if the character cannot walk in any direction. |
ISVENDOR | R | Returns 1 if the character is a vendor. |
ISVERTICALSPACE location | R | Returns 1 if the ceiling at the given location is high enough for the character to fit under. |
KARMA | RW | Gets or sets the character's karma. |
KARMA.karma_group | R | Returns 1 if the character's karma falls within the specified karma group. |
LEVEL | RW | Gets or sets the character's experience level. |
LIGHT | RW | Gets or sets the character's personal light level. |
MANA | RW | Gets or sets the character's mana. |
MAP | RW | Gets or sets the map that this object is located. |
MAXHITS | RW | Gets or sets the character's maximum hitpoints. |
MAXMANA | RW | Gets or sets the character's maximum mana. |
MAXSTAM | RW | Gets or sets the character's maximum stamina. |
MAXWEIGHT | R | Returns the maximum weight that the character can carry. |
MEMORY.object_uid | RW | Gets or sets the memory flags the character has for the given object. |
MODAR | RW | Gets or sets a modifier for the character's armour rating. |
MODDEX | RW | Gets or sets the character's dexterity modifier. |
MODINT | RW | Gets or sets the character's intelligence modifier. |
MODMAXWEIGHT | RW | Gets or sets the character's maximum weight modifier. |
MODSTR | RW | Gets or sets the character's strength modifier. |
MOUNT | R | Gets the UID of the character's mount. |
MOVE direction | R | Returns the movement flags for the tile in the given direction (see can_flags in sphere_defs.scp). |
NAME | RW | Gets or sets the character's name. |
NIGHTSIGHT | RW | Gets or sets whether or not the character has nightsight enabled. |
NOTOGETFLAG viewer_uid, allow_incognito | RW | Gets the character's notoriety flags as seen by the specified viewer. |
NPC | RW | Gets or sets the character's AI type. |
OBODY | RW | Gets or sets the character's original body. |
OSKIN | RW | Gets or sets the character's original colour. |
ODEX | RW | Gets or sets the character's base dexterity (without modifiers). |
OINT | RW | Gets or sets the character's base intelligence (without modifiers). |
OSTR | RW | Gets or sets the character's base strength (without modifiers). |
RANGE | R | Gets the combat range of the character. |
RESCOLD | RW | Gets or sets the character's resistance to cold. |
RESENERGY | RW | Gets or sets the character's resistance to energy. |
RESFIRE | RW | Gets or sets the character's resistance to fire. |
RESPOISON | RW | Gets or sets the character's resistance to poison. |
SERIAL | R | Gets the item's unique ID in the world. |
SEX value_male:value_female | R | Returns value_male or value_female depending on the character's gender. |
SEXTANTP location | R | Converts the character's location or a specified location into sextant coordinates. |
skill_name | RW | Gets or sets the character's skill level in skill_name. |
SKILLCHECK skill_id, skill_amount | R | Returns 1 if the character has the specified amount of skill. |
SKILLBEST.n | R | Returns the ID of the character's nth highest skill (0 = Highest) |
SKILLTEST skill_list | R | Returns 1 if t he character possess all of the skills in the list. |
SKILLTOTAL | R | Returns the total value of all the character's skills. |
SKILLTOTAL skill_group | R | Returns the total value of all the character's skills within the specified group. |
SKILLTOTAL -amount | R | Returns the total value of all the character's skills that are under amount. |
SKILLTOTAL +amount | R | Returns the total value of all the character's skills that are over amount. |
SKILLUSEQUICK skill_id, difficulty | R | Quickly uses a skill, returning 1 if the attempt was successful. |
STAM | RW | Gets or sets the character's stamina. |
STONE | RW | Gets or sets whether or not the character is trapped in stone. |
STR | RW | Gets or sets the character's total strength. |
TAG.name | RW | Gets or sets the value of a TAG. |
TAGAT.index | R | Gets a TAG at the given zero-based index. |
TAGAT.index.KEY | R | Gets the name of the TAG at the given zero-based index. |
TAGAT.index.VAL | R | Gets the value of the TAG at the given zero-based index. |
TAGCOUNT | R | Gets the number of TAGs stored on the item. |
TAGLIST | W | Outputs a list of the object's TAGs. |
TIMER | RW | Gets or sets the length of time before the item's timer expires, in seconds. |
TIMERD | RW | Gets or sets the length of time before the item's timer expires, in tenths of a second. |
TIMERF time, function | W | Scheduled a function to be executed on this object in time seconds. |
TIMERF CLEAR | W | Clears all scheduled functions from the object. |
TITLE | RW | Gets or sets the character's title. |
TOWNABBREV | R | Returns the character's town abbreviation. |
TRIGGER trig_name, trig_type | R | Fires a custom trigger and returns the RETURN value. |
UID | R | Gets the item's unique ID in the world. |
VISUALRANGE | RW | Gets or sets the character's sight range. |
WEIGHT | R | Gets the weight of the character. |
Z | R | Gets the Z position of the character. |
Triggers
Here is a list of all item triggers. Click on the trigger name for more detailed information such as arguments and examples.
Name | Description |
@AfterClick | Fires when the object has been single-clicked, just before the overhead name is shown. |
@Attack | Fires when the character begins attacking another. |
@CallGuards | Fires when the character calls for guards. |
@CharAttack | Fires when the character is attacked by another character. |
@CharClick | Fires when the character is clicked by another character. |
@CharClientTooltip | Fires when the tooltips are about to be sent to the character. |
@CharDClick | Fires when the character double clicks another character. |
@CharTradeAccepted | Fires when another character accepts trade with the character. |
@Click | Fires when the object has been single-clicked. |
@ClientTooltip | Fires when tooltips for this character are about to be sent to a client. |
@ContextMenuRequest | Fires when a client requests the context menu options for the object. |
@ContextMenuSelect | Fires when a client selects a context menu option for the object. |
@Create | Fires when the object is initially created, before it is placed in the world. |
@Criminal | Fires when the character becomes a criminal. |
@DClick | Fires when the object is double-clicked. |
@Death | Fires when the character's hitpoints reaches zero. |
@DeathCorpse | Fires when a corpse is created for the character. |
@Destroy | Fires when the object is being deleted. |
@Dismount | Fires when the character dismounts their ride. |
@EnvironChange | Fires when the environment changes for the character. |
@ExpChange | Fires when the character's experience points change. |
@ExpLevelChange | Fires when the character's experience level changes. |
@FameChange | Fires when the character's fame changes. |
@GetHit | Fires when the character receives damage. |
@Hit | Fires when the character hits another in combat. |
@HitMiss | Fires when the character fails to hit another in combat. |
@HouseDesignCommit | Fires when the character commits a new house design. |
@HouseDesignExit | Fires when the character exits house design mode. |
@Hunger | Fires when the character's food level decreases. |
@ItemAfterClick | Fires when the character single-clicks an item, just before the overhead name is shown. |
@ItemBuy | Fires when the character buys an item from a vendor. |
@ItemClick | Fires when the character single-clicks an item. |
@ItemClientTooltip | Fires when the tooltips are about to be sent to the client for an item. |
@ItemContextMenuRequest | Fires when the character requests the context menu options for an item. |
@ItemContextMenuSelect | Fires when the character selects a context menu option for an item. |
@ItemCreate | Fires when an item is initially created, before it is placed in the world, and the character is in some way responsible for it. |
@ItemDamage | Fires when the character damages an item. |
@ItemDClick | Fires when the character double-clicks an item. |
@ItemDestroy | Fires when the character destroys an item. |
@ItemDropOn_Char | Fires when the character drops an item on to a character. |
@ItemDropOn_Ground | Fires when the character drops an item on to the ground. |
@ItemDropOn_Item | Fires when the character drops an item on to another item. |
@ItemDropOn_Self | Fires when the character drops an item inside another item. |
@ItemEquip | Fires when the character equips an item. |
@ItemEquipTest | Fires when the characer is about to equip an item. |
@ItemPickUp_Ground | Fires when the character picks an item up from the ground. |
@ItemPickUp_Pack | Fires when the character picks an item up from inside a container. |
@ItemPickUp_Self | Fires when the character picks an item up from inside another item. |
@ItemPickUp_Stack | Fires when the character picks up an item from a stack. |
@ItemSell | Fires when the character sells an item to a vendor. |
@ItemSpellEffect | Fires when the character hits an item with a spell. |
@ItemStep | Fires when the character steps on an item. |
@ItemTargOn_Cancel | Fires when the character cancels an item's target cursor. |
@ItemTargOn_Char | Fires when the character targets a character with an item's target cursor. |
@ItemTargOn_Ground | Fires when the character targets the ground with an item's target cursor. |
@ItemTargOn_Item | Fires when the character targets an item with an item's target cursor. |
@ItemToolTip | Fires when the character requests old-style tooltips for an item. |
@ItemUnEquip | Fires when the character unequips an item. |
@Jailed | Fires when the character is sent to jail. |
@KarmaChange | Fires when the character's karma changes. |
@Kill | Fires when the character kills another character. |
@Login | Fires when the character logs in. |
@Logout | Fires when the character logs out. |
@Mount | Fires when the character mounts a ride. |
@MurderDecay | Fires when one of the character's kills is about to decay. |
@MurderMark | Fires when the character is about to gain a kill. |
@NPCAcceptItem | Fires when the NPC receives an item. |
@NPCActFight | Fires when the NPC makes a combat decision. |
@NPCActFollow | Fires when the NPC follows another character. |
@NPCAction | Fires when the NPC is about to perform an AI action. |
@NPCHearGreeting | Fires when the NPC hears a character for the first time. |
@NPCHearUnknown | Fires when the NPC hears something they don't understand. |
@NPCLookAtChar | Fires then the NPC looks at a character. |
@NPCLookAtItem | Fires when the NPC looks at an item. |
@NPCLostTeleport | Fires when the NPC is lost and is about to be teleported back to their HOME. |
@NPCRefuseItem | Fires when the NPC refuses an item being given to them. |
@NPCRestock | Fires when the NPC is having their items restocked. |
@NPCSeeNewPlayer | Fires when the NPC first sees a player. |
@NPCSeeWantItem | Fires when the NPC sees an item they want. |
@NPCSpecialAction | Fires when the NPC is about to perform a special action (throwing rock, breathing fire, etc). |
@PersonalSpace | Fires when the character is stepped on. |
@PetDesert | Fires when the character deserts its owner. |
@Profile | Fires when a player attempts to read the character's profile from the paperdoll. |
@ReceiveItem | Fires when the character receives an item from another character. |
@RegionEnter | Fires when the character enters a region. |
@RegionLeave | Fires when the character leaves a region. |
@Rename | Fires when the character renames another. |
@SeeCrime | Fires when the character sees a crime take place. |
@SkillAbort | Fires when the character aborts a skill. |
@SkillChange | Fires when the character's skill level changes. |
@SkillFail | Fires when the character fails a skill. |
@SkillGain | Fires when the character has a chance to gain in a skill. |
@SkillMakeItem | Fires when the character crafts an item. |
@SkillPreStart | Fires when the character starts a skill, before any hardcoded action takes place. |
@SkillSelect | Fires when the character selects a skill on their skill menu. |
@SkillStart | Fires when the character starts a skill. |
@SkillSuccess | Fires when the character succeeds at a skill. |
@SkillUseQuick | Fires when the character quickly uses a skill. |
@SpellBook | Fires when the character opens their spellbook. |
@SpellCast | Fires when the character casts a spell. |
@SpellEffect | Fires when the character is hit by the effects of a spell. |
@SpellFail | Fires when the character fails to cast a spell. |
@SpellSelect | Fires when the character selects a spell to cast. |
@SpellSuccess | Fires when the character successfully casts a spell. |
@StatChange | Fires when the character's STR, DEX or INT is changed through skill gain. |
@StepStealth | Fires when the character takes a step whilst hidden. |
@ToolTip | Fires when a player requests old-style tooltips for this character. |
@TradeAccepted | Fires when the character accepts a trade with another player. |
@UserBugReport | Fires when the player submits a bug report. |
@UserChatButton | Fires when the player presses the Chat button on the paperdoll. |
@UserExtCmd | Fires when the player sends an extended command packet. (used by some macros) |
@UserExWalkLimit | Fires when the player's movement is restricted by the movement speed settings in Sphere.ini |
@UserGuildButton | Fires when the player presses the Guild button on the paperdoll. |
@UserKRToolbar | Unknown. |
@UserMailBag | Fires when the player drags the mail bag on to another character. |
@UserQuestArrowClick | Fires when the player clicks the quest arrow. |
@UserQuestButton | Fires when the player presses the Quest button on the paperdoll. |
@UserSkills | Fires when the player opens their skill menu, or a skill update is sent to the player. |
@UserSpecialMove | Fires when the player uses a special move. |
@UserStats | Fires when the player opens the status window. |
@UserVirtue | Fires when the player presses on the Virtue button. |
@UserVirtueInvoke | Fires when the player invokes a virtue through macros. |
@UserWarmode | Fires when the player switches between war and peace mode. |
Players
Characters that are attached to an account become Player Characters. In addition to the basic character references, properties and functions they also receive the following:
References
References return pointers to other objects (e.g. the REGION reference allows you to access the REGION that an object is in). These can either be accessed by using <REFNAME> to return the UID (1 for object types that don't have UIDs) of the object or 0 if it doesn't exist, or by using <REFNAME.KEY> where KEY is a valid property/function/reference for the REFNAME object. Click on the name for more detailed information such as usage and examples.
Name | Read/Write | Description |
GUILD | R | Gets the guild stone that the player belongs to. |
SKILLCLASS | RW | Gets or sets the player's skillclass. |
TOWN | R | Gets the town stone that the player belongs to. |
Properties and Functions
Here is a list of all player properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples.
Name | Read/Write | Description |
CURFOLLOWER | RW | Gets or sets the number of current followers the player has, |
DEATHS | RW | Gets or sets the number of times the player has died. |
DSPEECH +/-speech_id | RW | Gets a list of attached speech handlers, or adds or removes a speech handler to or from the player. |
GMPAGE.n.DELETE | W | Deletes the nth GM page. (zero-based) |
GMPAGE.n.HANDLE | W | Sets the player as the handler for the nth GM page. (zero-based) |
GMPAGE.n.key | W | Executes the .page command with key as the arguments. |
ISDSPEECH.speech_id | R | Returns 1 if the player has the given speech handler attached. |
KICK | W | Disconnects and blocks the player's account. |
KILLS | RW | Gets the number of murders the player has committed. |
KRTOOLBARSTATUS | RW | Gets or sets whether or not the KR toolbar is enabled for this player. |
LASTUSED | RW | Gets the length of time since the player was last attached to a client, in seconds. |
LUCK | RW | Gets or sets the luck value for the player. |
MAXFOLLOWER | RW | Gets or sets the maximum number of followers the player can have. |
PASSWORD | W | Sets or clears the player's password. |
PFLAG | RW | Gets or sets the player's PFLAG value. |
PROFILE | RW | Gets or sets the text to display on the player's profile. |
SKILLLOCK.skill_id | RW | Gets or sets the lock state of the player's skill. |
SPEEDMODE | RW | Gets or sets the speed that the player moves at. (0=Normal, 1=Double Speed on Foot, 2=Always walk, 3=Always Run on Foot/Always Walk on Mount) |
STATLOCK.stat_id | RW | Gets or sets the lock state of the player's STR, DEX or INT. |
TITHING | RW | Gets or sets the number of tithing points the player has. |
NPCs
Characters that are not attached to an account are NPCs and are controlled by Sphere's AI. In addition to the basic character references, properties and functions they also receive the following:
Properties and Functions
Here is a list of all NPC properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples.
Name | Read/Write | Description |
ACTPRI | RW | Gets or sets the NPC's motivation towards their current action. |
NPC | RW | Gets or sets the NPC's AI type. |
HOMEDIST | RW | Gets or sets the distance that the NPC can wander from its HOME position. |
SPEECH +/-speech_id | RW | Gets the list of speech handlers attached to the NPC, or adds or removes a speech handler to or from the NPC. |
SPEECHCOLOR | RW | Gets or sets the colour of the NPC's speech. |
VENDCAP | RW | Gets or sets the amount of gold a vendor will restock to. |
VENDGOLD | RW | Gets or sets the amount of gold a vendor has. |