TextMessage | ||
---|---|---|
Prototype | void TextMessage( message ); | |
Purpose | Causes the char to say message. | |
Example of Usage | myChar.TextMessage( "The world is great!" ); |
EmoteMessage | ||
---|---|---|
Prototype | void EmoteMessage( message ); | |
Purpose | Causes the Char to emote message. You have to put the start and end * manually in! | |
Example of Usage | myChar.EmoteMessage( "*looks around*" ); |
Delete | ||
---|---|---|
Prototype | void Delete( ); | |
Purpose | Delete's the Char. | |
Example of Usage | myChar.Delete( ); |
DoAction | ||
---|---|---|
Prototype | void DoAction( trgAction ); | |
Purpose | Makes Char do action trgAction. NOTE: Anyone got a list of the possible actions? | |
Example of Usage | myChar.DoAction( 0x0B ); |
StaticEffect | ||
---|---|---|
Prototype | void StaticEffect( Effect, speed, loop ); | |
Purpose | Does a static effect for a char. NOTE: Anyone got a list of the possible effects? | |
Example of Usage | MyChar.StaticEffect( 0x376A, 9, 6 ); |
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 | myChar.Teleport( 4467,1284,5, ); //the Char will be sent to moonglow |
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. | |
Example of Usage | myChar.SoundEffect( 568, TRUE ); |
SellTo | ||
---|---|---|
Prototype | void SellTo( targNPC );NOTE: Not Correct | |
Purpose | Brings up the shopkeeper gump for selling to a vendor targNPC by tSock. | |
Example of Usage | myChar.ToSell( myNpc ); |
BuyFrom | ||
---|---|---|
Prototype | VendorBuy( tSock, targNPC );NOTE: Not Correct | |
Purpose | Brings up the shopkeeper gump or PV backpack for buying for vendor targNPC. | |
Example of Usage | VendorBuy( CalcSockFromChar( pTalking ), pTalkingTo ); |
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); |
RemoveSpell | ||
---|---|---|
Prototype | void RemoveSpell( spellNum ); | |
Purpose | Removes spellNum from player's spellbook | |
Example of Usage | myChar.RemoveSpell( 0 ); |
GetTag | ||
---|---|---|
Prototype | tagdata GetTag( TagToGet); | |
Purpose | Returns the value of the TagToGet Tag. | |
Example of Usage | if( myChar.GetTag(quest1)==1) { myChar.TextMessage("You have already performed this quest."); } |
SetTag | ||
---|---|---|
Prototype | void SetTag( TagName, TagValue ); | |
Purpose | Set the value of the Tag TagName to TagValue. | |
Example of Usage | myChar.SetTag( "quest1", 1 ); |
OpenBank | ||
---|---|---|
Prototype | void OpenBank( trgSock ); | |
Purpose | Open's Char's bank, sending it to trgSock | |
Example of Usage | myPlayer.OpenBank(trgSock); |
DirectionTo | ||
---|---|---|
Prototype | unsigned char DirectionTo( pCheck, pType ); | |
Purpose | Returns 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 ) |
TurnToward | ||
---|---|---|
Prototype | void TurnToward( trgChar ); | |
Purpose | Char turns to trgChar. | |
Example of Usage | myNPC.TurnToward( myPlayer ); |
ResourceCount | ||
---|---|---|
Prototype | int ResourceCount( realitemid, colour ); | |
Purpose | Returns the amount of the items with the realitemid and the according colour. | |
Example of Usage | if(myChar.ResourceCount( 0x1BF2, 0 )); |
UseResource | ||
---|---|---|
Prototype | void UseResource( amount, realitemid ); void UseResource( amount, realitemid, colour ); | |
Purpose | Removes amout Items with of the ID realitemid. | |
Example of Usage | myChar.UseResource( 5, 0x1BF2, 0 ); |
CustomTarget | ||
---|---|---|
Prototype | void CustomTarget( tNum, toSay ); | |
Purpose | Very similar to PopUpTarget. It's a callback situation instead. tNum must be between 0 and 255. Says toSay, and shows a cursor. Reenters the script associated with the socket's player (ie player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is: function onCallback0( tSock, targSerial ) | |
Example of Usage | myChar.CustomTarget( 0, "Select your custom target:" ); |
PopUpTarget | ||
---|---|---|
Prototype | void PopUpTarget( tNum, toSay ); | |
Purpose | Provides a call to an inbuilt popup target. tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that this allows access potentially to GM functions. | |
Example of Usage | myChar.PopUpTarget( 2, "Where do you wish to teleport to?" ); |
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(myChar.InRange( trgItem, 0, 1, 18 )); |
FindItemLayer | ||
---|---|---|
Prototype | *Item FindItemLayer( layer ); | |
Purpose | A return value of -1 indicates there was no item at that particular layer. A common list of layers follow 0x01 - Single-Hand item/weapon 0x02 - Two-Hand item/weapon (including Shield) 0x03 - Foot Covering/Armor 0x04 - Leg Covering (including Pants, Shorts, Bone/Chain/Ring legs) 0x05 - Chest Clothing/Female Chest Armor 0x06 - Head Covering/Armor 0x07 - Hand Covering/Armor 0x08 - Ring 0x09 - N/A (not used) 0x0A - Neck Covering/Armor 0x0B - Hair 0x0C - Waist (Half-Apron) 0x0D - Torso (inner)(Chest Armor) 0x0E - Bracelet 0x0F - N/A (no info) 0x10 - Facial Hair 0x11 - Torso (Middle)(Surcoat, Tunic, Full Apron, Sash) 0x12 - Earrings 0x13 - Arm Covering/Armor 0x14 - Back (Cloak) 0x15 - BackPack 0x16 - Torso (outer)(Robe) 0x17 - Legs (outer)(Skirt/Kilt) 0x18 - Legs (inner)(Leg Armor) 0x19 - Mount (Horse, Ostard, etc.) 0x1A - NPC Buy Restock Container 0x1B - NPC Buy No Restock Container 0x1C - NPC Sell Container 0x1D - Bank Box | |
Example of Usage | lefthand=myChar.FindItemLayer(1); |
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 | myChar.StartTimer( 600, 0 ); |
KillTimers | ||
---|---|---|
Prototype | void Killtimers( ); | |
Purpose | Kills all timers of the Char. | |
Example of Usage | myChar.KillTimers; |
CheckSkill | ||
---|---|---|
Prototype | bool CheckSkill( skillnum, minskill, maxskill ); | |
Purpose | Returns true if the skill skillnum is between min and may skill. | |
Example of Usage | if( myChar.CheckSkill( 1, 200, 1000)) |
SpeechInput | ||
---|---|---|
Prototype | void SpeechInput( speechID ); | |
Purpose | Calls up the onSpeechInput event with the text the user types. | |
Example of Usage | myChar.SpeechInput( 1 ); |
Freeze | ||
---|---|---|
Prototype | void Freeze( ); | |
Purpose | Freezes Char, stopping them from moving | |
Example of Usage | myChar.Freeze( ); |
Unfreeze | ||
---|---|---|
Prototype | void Unfreeze( ); | |
Purpose | Unfreezes Char, allowing them to move again | |
Example of Usage | myChar.Unfreeze( ); |
CastSpell | ||
---|---|---|
Prototype | void CastSpell( spellNum ); | |
Purpose | Causes character to cast spellNum. Character can be an NPC or PC. spellNum can be any valid spellNum (0=>63). | |
Example of Usage | myChar.CastSpell( 32 ); |
SysMessage | ||
---|---|---|
Prototype | void SysMessage( string message ); | |
Purpose | Sends a string as a sysmessage. | |
Example of Usage | myChar.SysMessage( "Isn't the world great?" ); |
MagicEffect | ||
---|---|---|
Prototype | void MagicEffect( spellID ); | |
Purpose | Causes the visual effects of the specified spell to be applied to the character. | |
Example of Usage | myChar.MagicEffect( 43 ); |
GetSerial | ||
---|---|---|
Prototype | int GetSerial( part ); | |
Purpose | Part have to be between 1 and 4. | |
Example of Usage | iSerial = myChar.GetSerial( 1 ); |
MakeMenu | ||
---|---|---|
Prototype | void MakeMenu( mnu ); | |
Purpose | Opens up make menu mnu and sends it to sock | |
Example of Usage | myChar.MakeMenu( 1 ); |
WanderBox | ||
---|---|---|
Prototype | void WanderBox( x1, y1, x2, y2 ); | |
Purpose | Forces the npc to wander in the box of coordinates specified. | |
Example of Usage | myNPC.WanderBox( 5593, 1203, 5608, 1206 ); |
Follow | ||
---|---|---|
Prototype | void Follow( newmaster ); | |
Purpose | Forces the char to follow the new master. | |
Example of Usage | myNPC.Follow( myChar ); |
Dismount | ||
---|---|---|
Prototype | void Dismount(); | |
Purpose | Dismounts a char. | |
Example of Usage | myChar.Dismount(); |
SetPoisoned | ||
---|---|---|
Prototype | void SetPoisoned( poisonLevel, Length ) | |
Purpose | Applies a specified level of poison to a character for a specified amount of time (in milliseconds). | |
Example of Usage | myChar.SetPoisoned( 2, 10000 ); //Gives myChar a 2nd level poison for 10 seconds. |
ExplodeItem | ||
---|---|---|
Prototype | void ExplodeItem( myItem ); | |
Purpose | Deletes specified item with an explode sound. | |
Example of Usage | myChar.ExplodeItem( myItem ); |
SetInvisible | ||
---|---|---|
Prototype | void SetInvisible( visibility, timeLength ) | |
Purpose | Sets character to the specified visibility level for the specified amount of time (in milliseconds). NOTE: Timer seems to be broken, as character stays hidden forever. | |
Example of Usage | myChar.SetInvisible( 1, 1000 ); |
SpawnNPC | ||
---|---|---|
Prototype | var CHARACTER = SpawnNPC( bpSocket, sectionID, x, y, z, worldnumber ) | |
Purpose | Spawns a character from a DFN entry (sectionID) | |
Parameters | bpSocket - The socket of the character to add with (although this can be null) sectionID - The entry # in npc-DFNs to spawn from. x, y and z - The target location to spawn at worldNumber - The world that it will spawn in (0 == britannia, 2 == ilshenar) | |
Example of Usage | function onUse( pUser, iUsed ) { var nSpawned = SpawnNPC( null, "brownhorse", pUser.x, pUser.y, pUser.z, pUser.worldnumber ); pUser.SysMessage( "Wheee - a brown horse just spawned at my location!" ); } |