CreateDFNItem | ||
---|---|---|
Prototype | ITEM CreateDFNItem( socket, character, sectionToMake, randomValue, [int Amount, [bool inPack, [bool autoStack]]]); | |
Purpose | Spawns an item from a DFN section number/id. | |
Notes | Parameters: 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 ); | |
Purpose | Spawns a "blank" item with values from the UO client's tiledata file. | |
Notes | Parameters: 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( ); | |
Purpose | Delete's the Char | |
Example of Usage | myItem.Delete( ); |
GetSerial | ||
---|---|---|
Prototype | int GetSerial( part ); | |
Purpose | Part have to be between 1 and 4. | |
Example of Usage | iSerial = myItem.GetSerial( 1 ); |
GetTag | ||
---|---|---|
Prototype | void GetTag( tagname ); | |
Purpose | Retrieve a Tag from an item. | |
Example of Usage | ¨ var Test = myItem.GetTag( "TestValue" ); |
HasSpell | ||
---|---|---|
Prototype | bool HasSpell( spellNum ); | |
Purpose | Scans 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 ); | |
Purpose | srcType 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( ); | |
Purpose | Kills all timers of the Char. | |
Example of Usage | myItem.KillTimers; |
OpenPlank | ||
---|---|---|
Prototype | - | |
Purpose | - | |
Example of Usage | - |
RemoveSpell | ||
---|---|---|
Prototype | void RemoveSpell( spellNum ); | |
Purpose | Removes spellNum from player's spellbook | |
Example of Usage | myItem.RemoveSpell( 0 ); |
SetCon | ||
---|---|---|
Prototype | - | |
Purpose | - | |
Example of Usage | - |
SetPoison | ||
---|---|---|
Prototype | void SetPoison ( poisonLevel ); | |
Purpose | Sets 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 ); | |
Purpose | Set a Tag on an item. | |
Example of Usage | myItem.SetTag( "TestValue", 10 ); |
SoundEffect | ||
---|---|---|
Prototype | void SoundEffect( soundID, bAllHear ); | |
Purpose | Plays 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 ); | |
Purpose | Starts 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 ); | |
Purpose | Does 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 ); | |
Purpose | Causes 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 ); | |
Purpose | In 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 |