UOX3 Script Engine

API and Event handling

Multi Functions

FindMulti
ProtoType
multiID FindMulti( ourObj );
multiID FindMulti( x, y, z, worldNumber );
multiID FindMulti( x, y, z, worldNumber, instanceID );
PurposeFinds the multi that is in the area of the coordinates (x, y, z) in world worldNumber (0 == Britannia, 2 == ilshenar) in instanceID (optional), or in the area of the specified object
Example of Usage
var iMulti = FindMulti( pChar );
if( iMulti )
{
	pChar.TextMessage( "You know, I'm standing in the same spot as a multi!" );
}

var iMulti = FindMulti( myItem.x, myItem.y, myItem.z, myItem.worldnumber );
if( iMulti )
{
	myItem.TextMessage( "I am an item, in the same spot as a multi!" );
}

 

IsInMulti
ProtoType
bool IsInMulti( ourObj );
PurposeReturns true if the object is in the multi.
Example of Usage
var iMulti = FindMulti( ourObj.x, ourObj.y, ourObj.z, pChar.worldnumber );
if( iMulti )
{
	if( iMulti.IsInMulti( ourObj ) )
	{
		ourObj.TextMessage( "I am in a multi!" );
	}
{

 

IsMulti
ProtoType
bool IsMulti();
PurposeReturns true if the item iToCheck is actually a multi
Example of Usage
if( iToCheck.IsMulti() )
{
	pUser.TextMessage( "Yep, it's definitely a multi." );
}

 

IsBoat
ProtoType
bool IsBoat();
PurposeReturns true if the item iToCheck is actually a boat
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
if( iMulti.IsBoat() )
{
	pUser.TextMessage( "Yep, it's definitely a boat." );
}

 

IsOwner
ProtoType
bool IsOwner( pUser );
PurposeReturns true if specified character is the owner of the multi
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
if( iMulti.IsOwner( pUser ) )
{
	pUser.TextMessage( "Yep, I'm the owner of this multi!." );
}

 

IsOnBanList
ProtoType
bool IsOnBanList( pChar );
PurposeReturns true if the character pChar is on the multi's ban list
Example of Usage
var iMulti = FindMulti( ourObj.x, ourObj.y, ourObj.z, pChar.worldnumber );
if( iMulti.IsOnBanList( pChar ))
{
	pChar.TextMessage( "Oops, I appear to be on the banlist of this house!" );
}

 

IsOnOwnerList
ProtoType
bool IsOnOwnerList( pChar );
PurposeReturns true if the character pChar is an owner of the multi
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
if( iMulti.IsOnOwnerList( pChar ))
{
	pChar.TextMessage( "Ahh, I appear to be on the owner-list of this house!" );
}

 

IsOnFriendList
ProtoType
bool IsOnFriendList( pChar );
PurposeReturns true if the character pChar is on the friend list of the multi
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
if( iMulti.IsOnFriendList( pChar ))
{
	pChar.TextMessage( "Ahh, I appear to be on the friend-list of this house!" );
}

 

IsOnGuestList
ProtoType
bool IsOnGuestList( pChar );
PurposeReturns true if the character pChar is on the guest list of the multi
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
if( iMulti.IsOnGuestList( pChar ))
{
	pChar.TextMessage( "Ahh, I appear to be on the guest-list of this house!" );
}

 

AddToBanList
ProtoType
bool AddToBanList( pChar );
PurposeAdds the character pChar to the multi's ban list. Returns true if the parameters are valid.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "I'm getting banned from this house!" );
iMulti.AddToBanList( pChar );

 

AddToOwnerList
ProtoType
bool AddToOwnerList( pChar );
PurposeAdds the character pChar to the multi's owner list. Doesn't remove existing owners at all. Won't duplicate if already on the list.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Awww, I'm being added as an owner of this house!" );
iMulti.AddToOwnerList( pChar );

 

AddToFriendList
ProtoType
bool AddToFriendList( pChar );
PurposeAdds the character pChar to the multi's friend list. Won't duplicate if already on the list.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Awww, I'm being added as a friend of this house!" );
iMulti.AddToFriendList( pChar );

 

AddToGuestList
ProtoType
bool AddToGuestList( pChar );
PurposeAdds the character pChar to the multi's guest list. Won't duplicate if already on the list.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Awww, I'm being added as a guest of this house!" );
iMulti.AddToGuestList( pChar );

 

RemoveFromBanList
ProtoType
bool RemoveFromBanList( pChar );
PurposeRemoves pChar from the multi's ban list. Returns true on correct parameters.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Yay! I've been removed from the ban-list of this house!" );
iMulti.RemoveFromBanList( pChar );

 

RemoveFromOwnerList
ProtoType
bool RemoveFromOwnerList( pChar );
PurposeRemoves pChar from the multi's owner list. Returns true on correct parameters.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Oops! I am being removed as owner of this house!" );
iMulti.RemoveFromOwnerList( pChar );

 

RemoveFromFriendList
ProtoType
bool RemoveFromFriendList( pChar );
PurposeRemoves pChar from the multi's friend list. Returns true on correct parameters.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Oops! I am being removed as a friend of this house!" );
iMulti.RemoveFromFriendList( pChar );

 

RemoveFromGuestList
ProtoType
bool RemoveFromGuestList( pChar );
PurposeRemoves pChar from the multi's guest list. Returns true on correct parameters.
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
pChar.TextMessage( "Oops! I am being removed as a guest of this house!" );
iMulti.RemoveFromGuestList( pChar );

 

ClearOwnerList
ProtoType
bool ClearOwnerList( pChar );
PurposeClears all players from multi's co-owner list
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
iMulti.ClearOwnerList( pChar );

 

ClearFriendList
ProtoType
bool ClearFriendList( pChar );
PurposeClears all players from multi's friend list
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
iMulti.ClearFriendList( pChar );

 

ClearGuestList
ProtoType
bool ClearGuestList( pChar );
PurposeClears all players from multi's guest list
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
iMulti.ClearGuestList( pChar );

 

ClearBanList
ProtoType
bool ClearBanList( pChar );
PurposeClears all players from multi's banlist
Example of Usage
var iMulti = FindMulti( pChar.x, pChar.y, pChar.z, pChar.worldnumber );
iMulti.ClearBanList( pChar );

 

SecureContainer
ProtoType
bool SecureContainer( myTarget );
PurposeTurns specified container into a secure container
Example of Usage
var iMulti = FindMulti( myTarget.x, myTarget.y, myTarget.z, myTarget.worldnumber );
iMulti.SecureContainer( myTarget );

 

UnsecureContainer
ProtoType
bool UnsecureContainer( myTarget );
PurposeTurns specified container from a secure container to a regular container
Example of Usage
var iMulti = FindMulti( myTarget.x, myTarget.y, myTarget.z, myTarget.worldnumber );
iMulti.UnsecureContainer( myTarget );

 

IsSecureContainer
ProtoType
bool IsSecureContainer( myTarget );
PurposeChecks if specified item is a secure container in the multi
Example of Usage
var iMulti = FindMulti( myTarget.x, myTarget.y, myTarget.z, myTarget.worldnumber );
var isSecure = iMulti.IsSecureContainer( myTarget );
if( iSecure )
	pChar.TextMessage( "Container is secure!" );

 

LockDownItem
ProtoType
bool LockDownItem( myTarget );
PurposeLocks down targeted item in multi
Example of Usage
var iMulti = FindMulti( myTarget.x, myTarget.y, myTarget.z, myTarget.worldnumber );
iMulti.LockDownItem( myTarget );

 

ReleaseItem
ProtoType
bool ReleaseItem( myTarget );
PurposeReleases targeted item in multi from lockdown
Example of Usage
var iMulti = FindMulti( myTarget.x, myTarget.y, myTarget.z, myTarget.worldnumber );
iMulti.ReleaseItem( myTarget );

 

KillKeys
ProtoType
bool KillKeys();
bool KillKeys( characterSerial );
PurposeDeletes ALL keys associated with a multi, or all keys owned by a specific character
Example of Usage
var iMulti = FindMulti( pUser.x, pUser.y, pUser.z, pUser.worldnumber );
// Kill all keys that match house
iMulti.KillKeys();

// Kill all keys for this house owned by pUser
iMulti.KillKeys( pUser );

 

AddTrashCont
ProtoType
bool AddTrashCont( trashContObj );
PurposeAdd trash container to multi's list of trash containers
Example of Usage
var iMulti = FindMulti( trashContObj.x, trashContObj.y, trashContObj.z, trashContObj.worldnumber );
iMulti.AddTrashCont( trashContObj );

 

RemoveTrashCont
ProtoType
bool RemoveTrashCont( trashContObj );
PurposeRemove trash container from multi's list of trash containers
Example of Usage
var iMulti = FindMulti( trashContObj.x, trashContObj.y, trashContObj.z, trashContObj.worldnumber );
iMulti.RemoveTrashCont( trashContObj );

 

FirstChar
Prototype
void FirstChar();
PurposeReturns a handle to the first character in the multi. If it's null, then there are no characters inside. An optional parameter is supported by both FirstChar, NextChar and FinishedChar to specify the type of characters to look for... options are none (find all chars), "owner", "friend", "guest" or "banned".
Example of Usage
function onUseChecked( pUser, iUsed )
{
	var iMulti = pUser.multi;
	var mChar;
	for( mChar = iMulti.FirstChar(); !iMulti.FinishedChar(); mChar = iMulti.NextChar() )
	{
		if( mChar != null )
		{
			mChar.TextMessage( "I'm a character in this multi!" );
		}
	}
}

function onUseChecked( pUser, iUsed )
{
	var iMulti = pUser.multi;
	var mChar;
	for( mChar = iMulti.FirstChar( "owner" ); !iMulti.FinishedChar( "owner" ); mChar = iMulti.NextChar( "owner" ) )
	{
		if( mChar != null )
		{
			mChar.TextMessage( "I'm one of the owners of this multi!" );
		}
	}
}

 

NextChar
Prototype
void NextChar();
PurposeReturns the next item found in the container (or multi)
Example of Usage
SEE ABOVE FUNCTION

 

FinishedChar
Prototype
bool FinishedChar();
PurposeReturns true if there are no more items left to look through in the container (or multi)
Example of Usage
SEE ABOVE FUNCTION

 

GetMultiCorner
Prototype
bool GetMultiCorner( cornerID );
PurposeGets coordinates for specified corner of multi ( 0 = NW corner, 1 = NE corner, 2 = SW corner, 3 = SE corner)
Example of Usage
var multiCornerCoords = (iMulti.GetMultiCorner( 3 )).split( "," );
var cornerX = parseInt(multiCornerCoords[0]);
var cornerY = parseInt(multiCornerCoords[1]);

 

CalcMultiFromSer
Prototype
bool CalcMultiFromSer( serial );
PurposeCalculates a multi object from a serial
Example of Usage
var iMultiSerial = parseInt(pUser.GetTag( "iMultiSerial" ));
var iMultiSerial1 = ( iMultiSerial >> 24 );
var iMultiSerial2 = ( iMultiSerial >> 16 );
var iMultiSerial3 = ( iMultiSerial >> 8 );
var iMultiSerial4 = ( iMultiSerial % 256 );
var iMulti = CalcMultiFromSer( iMultiSerial1, iMultiSerial2, iMultiSerial3, iMultiSerial4 );
©Copyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall)