UOX3 Script Engine

API and Event handling

Character Related Functions

GetTarget
Prototype
int GetTarget( int srcChar );
PurposeReturns the target of the current character. No target if it is -1
Example of Usage
trgChar = GetTarget( srcChar );

 

GetDexterity
Prototype
short GetDexterity( int trgChar );
PurposeReturns the dexterity of the character trgChar
Example of Usage
dexVal = GetDexterity( srcChar );

 

GetIntelligence
Prototype
short GetIntelligence( int trgChar );
PurposeReturns the intelligence of the character trgChar
Example of Usage
intVal = GetIntelligence( srcChar );

 

GetStrength
Prototype
short GetStrength( int trgChar );
PurposeReturns the strength associated with the character trgChar
Example of Usage
strVal = GetStrength( srcChar );

 

GetSkill
Prototype
short GetSkill( int trgChar, UCHAR skillNum );
PurposeReturns the trgChar's skill value for skill skillNum
Example of Usage
skillVal = GetSkill( srcChar, 0 );

 

GetBaseSkill
Prototype
short GetBaseSkill( int trgChar, UCHAR skillNum );
PurposeReturns the trgChar's BASE skill value for skill skillNum (ie no adjustments due to race and what not)
Example of Usage
skillVal = GetBaseSkill( srcChar, 0 );

 

GetMana
Prototype
short GetMana( int trgChar );
PurposeReturns the mana of trgChar
Example of Usage
mana = GetMana( srcChar );

 

GetStamina
Prototype
short GetStamina( int trgChar );
PurposeReturns the stamina of trgChar
Example of Usage
stm = GetStamina( srcChar );

 

RunTo
Prototype
RunTo( int trgChar, short targX, short targY, UCHAR maxSteps );
PurposeGets trgChar to attempt to pathfind to locaton (targX, targY) by running
Example of Usage
RunTo( srcChar, 1000, 1000, 5 );

 

WalkTo
Prototype
WalkTo( int trgChar, short targX, short targY, UCHAR maxSteps );
PurposeGets trgChar to attempt to pathfind to locaton (targX, targY) by running
Example of Usage
WalkTo( srcChar, 1000, 1000, 5 );

 

SetTarget
Prototype
SetTarget( trgChar, target );
PurposeSets trgChar's target to target
Example of Usage
SetTarget( srcChar, trgChar );

 

SetDexterity
Prototype
SetDexterity( trgChar, trgValue );
PurposeSets trgChar's dexterity to trgValue
Example of Usage
SetDexterity( srcChar, 10 );

 

SetIntelligence
Prototype
SetIntelligence( trgChar, trgValue );
PurposeSets trgChar's intelligence to trgValue
Example of Usage
SetIntelligence( srcChar, 50 );

 

SetStrength
Prototype
SetStrength( trgChar, trgValue );
PurposeSets trgChar's strength to trgValue
Example of Usage
SetStrength( srcChar, 100 );

 

SetSkill
Prototype
SetSkill( trgChar, skillNum, skillValue );
PurposeSets trgChar's skillNum skill to skillValue
Example of Usage
SetSkill( srcChar, 0, 1000 );

 

SetMana
Prototype
SetMana( trgChar, manaValue );
PurposeSets trgChar's mana to manaValue
Example of Usage
SetMana( trgChar, 10 );

 

SetStamina
Prototype
SetStamina( trgChar, stamValue );
PurposeSets trgChar's stamina to stamValue
Example of Usage
SetStamina( trgChar, 100 );

 

GetCharPack
Prototype
int GetCharPack( trgChar );
PurposeReturns the index of the character's pack
Example of Usage
iPack = GetCharPack( srcChar );

 

GetFame
Prototype
int GetFame( trgChar );
PurposeReturns the fame of the character
Example of Usage
cFame = GetFame( srcChar );

 

GetKarma
Prototype
int GetKarma( trgChar );
PurposeReturns the karma of the character
Example of Usage
cKarma = GetKarma( srcChar );

 

SetFame
Prototype
SetFame( trgChar, fameValue );
PurposeSets trgChar's fame to fameValue
Example of Usage
SetFame( srcChar, 10000 );

 

SetKarma
Prototype
SetKarma( trgChar, karmaValue );
PurposeSets trgChar's karma to karmaValue
Example of Usage
SetKarma( srcChar, -5000 );

 

CalcDefense
Prototype
int CalcDefense( trgChar );
PurposeReturns the calculated defense value of trgChar
Example of Usage
var iDefense = CalcDefense( srcChar );

 

CalcAttack
Prototype
int CalcAttack( trgChar );
PurposeReturns the calculated attack value of trgChar
Example of Usage
var iAttack = CalcAttack( srcChar );

 

GetHunger
Prototype
int GetHunger( trgChar );
PurposeReturns the hunger of trgChar
Example of Usage
var iHunger = GetHunger( srcChar );

 

SetHunger
Prototype
SetHunger( trgChar, hungerVal );
PurposeSets trgChar's hunger to hungerVal;
Example of Usage
SetHunger( trgChar, 6 );

 

DoAction
Prototype
DoAction( trgChar, trgAction );
PurposeMakes trgChar do action trgAction
Example of Usage
DoAction( srcChar, 0x0B );

 

OpenBank
Prototype
OpenBank( trgChar, trgSock );
PurposeOpen's trgChar's bank, sending it to trgSock
Example of Usage
OpenBank( srcChar, srcSock );

 

GetCommandLevel
Prototype
int GetCommandLevel( player );
PurposeReturns the command level associated with a character
Example of Usage
var iLevel = GetCommandLevel( pTalking );

 

SetCommandLevel
Prototype
SetCommandLevel( player, level );
PurposeSets the command level of the player to level
Example of Usage
SetCommandLevel( pTalkingTo, 5 );

 

GetRace
Prototype
int GetRace( pCheck );
PurposeReturns the race associated with a character pCheck
Example of Usage
var iRace = GetRace( pTalking );

 

SetRace
Prototype
SetRace( pChange, iValue );
PurposeSets the race of the player to iValue. Note that it does a transform, much like going through a gate. Not guarenteed to succeed, as the player may not fit the requirements for that race.
Example of Usage
SetRace( pTalkingTo, 0 );

 

GetMurderCount
Prototype
int GetMurderCount( pCheck );
PurposeReturns the number of kills that pCheck has made.
Example of Usage
var iKills = GetMurderCount( pTalking );

 

IsDead
Prototype
bool IsDead( pCheck );
PurposeReturns true if the character pCheck is dead.
Example of Usage
if( IsDead( pTalking ) )

{
TextMessage( pTalkingTo, "Nya nya nya nya nya! You're dead!" );
}

 

IsNPC
Prototype
bool IsNPC( pCheck );
PurposeReturns true if the character pCheck is an NPC.
Example of Usage
if( IsNPC( pTalking ) )

{
TextMessage( pTalkingTo, "Wow, what an NPC you are!" );
}

 

IsOnline
Prototype
bool IsOnline( pCheck );
PurposeReturns true if the character pCheck is online.
Example of Usage
if( IsOnline( pTalking ) )

{
TextMessage( pTalkingTo, "Cool, you really are here" );
}

 

GetDir
Prototype
unsigned char GetDir( pCheck, pType );
PurposeReturns the direction that pCheck is facing. If pType == 0, pCheck is a character. If pType == 1, pCheck is an item
Example of Usage
if( GetDir( pTalking, 0 ) >= 0x80 )

{
TextMessage( pTalkingTo, "Jinkies, you're running!" );
}

 

SetDir
Prototype
SetDir( newDir, pCheck, pType );
PurposeSets the direction of pCheck to newDir. If pType == 0, pCheck is a character. If pType == 1, pCheck is an item.
Example of Usage
SetDir( GetDir( pTalking, 0 ) + 1, pTalking, 0 );

 

GetTown
Prototype
unsigned char GetTown( pCharacter );
PurposeReturns the town that pCharacter belongs to
Example of Usage
if( GetTown( pTalking ) == 255 )

{
TextMessage( pTalkingTo, "You live in the wilderness!" );
}

 

SetTown
Prototype
SetTown( pCharacter, iTown );
PurposeSets pCharacter's town to iTown
Example of Usage
SetTown( pTalking, 255 );

TextMessage( pTalkingTo, "Welcome to the wilderness!" );

 

GetRegion
Prototype
unsigned char GetRegion( pCharacter );
PurposeReturns the region that the character is currently in
Example of Usage
if( GetTown( pTalking ) == GetRegion( pTalking ) )

{
TextMessage( pTalkingTo, "Welcome home, my friend" );
}

 

SetRegion
Prototype
SetRegion( pCharacter, iRegion );
PurposeSets pCharacter's region to iRegion.
Example of Usage
SetRegion( pTalking, 255 );

TextMessage( pTalkingTo, "Welcome to the wilderness!" );

 

UseDoor
Prototype
UseDoor( iSock, iToUse );
PurposeUses the door iToUse. iSock is used for message display. If unknown, use -1.
Example of Usage
if( GetType( iUsed ) == 12 )

{
TextMessage( pUser, "I just LURV using doors" );
UseDoor( -1, iUsed );
}

 

GetGuild
Prototype
int GetGuild( pCharacter );
PurposeReturns the guild that pCharacter belongs to (if any). If the return value is -1, they're not in a guild
Example of Usage
if( GetGuild( pTalking ) != -1 )

{
TextMessage( pUser, "I know you're in a guild, don't try and trick me!" );
}

 

VendorSell
Prototype
VendorSell( tSock, targNPC );
PurposeBrings up the shopkeeper gump for selling to a vendor targNPC by tSock.
Example of Usage
VendorSell( CalcSockFromChar( pTalking ), pTalkingTo );

 

VendorBuy
Prototype
VendorBuy( tSock, targNPC );
PurposeBrings up the shopkeeper gump or PV backpack for buying for vendor targNPC.
Example of Usage
VendorBuy( CalcSockFromChar( pTalking ), pTalkingTo );

 

©Copyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall)