UOX3 Script Engine

Functions, Methods, Properties and Event handling

Item Related Methods

 

CreateDFNItem
Prototype
ITEM CreateDFNItem( socket, character, sectionToMake, randomValue, [int Amount, [bool inPack, [bool autoStack]]]);
PurposeSpawns an item from a DFN section number/id.
NotesParameters:
socket - socket to refresh to (and ensure weight is added)
character - required to know the pack/character to spawn it to
sectionToMake - section # to spawn from
randomValue - if true, the item's value and HP is randomized
int Amount - Amount of items to spawn (Optional)
bool inPack - True/false whether to spawn in pack or not (Optional - default is FALSE)
bool autoStack - True/False whether to auto-stack item or not (Optional - but must include two previous params if this is set to True).
Example of Usage
function onUse( pUser, iUsed )
{
	var myItem = CreateDFNItem( pUser.socket, pUser, "0x09d0", false, 10, true );
	pUser.SysMessage( "Oh my, 10 apples just appeared in my backpack! Magic!" );
}

 

CreateBlankItem
Prototype
ITEM CreateBlankItem( socket, character, amount, itemName, autoStack, itemID, colour, inPack, bSend );
PurposeSpawns a "blank" item with values from the UO client's tiledata file.
NotesParameters:
socket - socket to refresh to (and ensure weight is added)
character - required to know the pack/character to spawn it to
amount - The amount of items to spawn
itemName - the name to give to the newly spawned item
autoStack - true/false whether to autostack items or not
itemID - itemID(hex) to spawn item from
colour - colour of the spawned item
inPack - True/false whether to spawn in pack or not
bSend - Whether or not to send update to all players
Example of Usage
function onUse( pUser, iUsed )
{
	var myItem = CreateBlankItem( pUser.socket, pUser, 10, "apple", true, 0x09d0, 0x0, true, true );
	pUser.SysMessage( "Oh my, 10 apples just appeared in my backpack! Magic!" );
}

 

Delete
Prototype
void Delete( );
PurposeDelete's the Char
Example of Usage
myItem.Delete( );

 

GetSerial
Prototype
int GetSerial( part );
PurposePart have to be between 1 and 4.
Example of Usage
iSerial = myItem.GetSerial( 1 );

 

GetTag
Prototype
void GetTag( tagname );
PurposeRetrieve a Tag from an item.
Example of Usage
¨
var Test = myItem.GetTag( "TestValue" );

 

HasSpell
Prototype
bool HasSpell( spellNum );
PurposeScans through player's contents to see if they have spellNum in the first spellbook encountered
Example of Usage
if(myPlayer.HasSpell( 0 )==1);

 

InRange
Prototype
int InRange( trgObj, srcType, trgType, distance );
PurposesrcType and trgType are like objType for other funcs. 0 indicates a char, 1 indicates an item.
Returns true if the distance from srcObj to trgObj is less than distance
Example of Usage
if(myItem.InRange( trgItem, 0, 1, 18 );

 

KillTimers
Prototype
void Killtimers( );
PurposeKills all timers of the Char.
Example of Usage
myItem.KillTimers;

 

OpenPlank
Prototype
-
Purpose-
Example of Usage
-

 

RemoveSpell
Prototype
void RemoveSpell( spellNum );
PurposeRemoves spellNum from player's spellbook
Example of Usage
myItem.RemoveSpell( 0 );

 

SetCon
Prototype
-
Purpose-
Example of Usage
-

 

SetPoison
Prototype
void SetPoison ( poisonLevel );
PurposeSets a specified level of posion for an item/weapon.
Example of Usage
myItem.SetPoison( 2 );
//Applies level 2 poison to item

 

SetTag
Prototype
void SetTag( tagname, value );
PurposeSet a Tag on an item.
Example of Usage
myItem.SetTag( "TestValue", 10 );

 

SoundEffect
Prototype
void SoundEffect( soundID, bAllHear );
PurposePlays a sound from Character. SoundID is the full ID of the sound to play. If bAllHear is TRUE, then everyone nearby hears it. If it's false, then only the Character hears it. NOTE: Soundlist
Example of Usage
myItem.SoundEffect( 568, TRUE );

 

StartTimer
Prototype
void StartTimer( numMiliSec, timerID );
PurposeStarts a timer that will elapse after numHundredthsOfSec seconds pass, for a character tChar. timerID must be between 0 and 100. Resulting onTimer event will be triggered.
Example of Usage
myItem.StartTimer( 600, 0 );

 

StaticEffect!!!
Prototype
void StaticEffect( short Effect, UCHAR speed, UCHAR loop );
PurposeDoes a static effect for a char. NOTE: Anyone got a list of the effects?
Example of Usage
myItem.StaticEffect( 0x376A, 9, 6 );

 

TextMessage
Prototype
void TextMessage( string message );
PurposeCauses the object to say message.
Example of Usage
myItem.TextMessage( "The world is great!" );

 

Teleport
Prototype
This method could eiter take 1,2,3 or 4 parameter:
void Teleport( togoto );
void Teleport( x, y );
void Teleport( x, y, z );
void Teleport( x, y, z, world );
PurposeIn the first Method you need a string, including x, y, z and Worldnumber. NOTE: Anyone exact informations about the string?
If you don't give the z-coordinate/worldnumber the actual z-coordinate/worldnumber will be taken.
Worldnumber 0=Trammel, Worldnumber 1= Felucca.
Example of Usage
myItem.Teleport( 4467,1284,5, ); //the Char will be sent to moonglow

 

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