From 18efdc5573069e7f271384d3f3a904515181a2f6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:11:58 -0500 Subject: [PATCH 01/19] puzzle chest This was osi Puzzle chest for kahldun. --- data/dfndata/items/containers/metal.dfn | 9 + data/js/item/puzzlechest.js | 444 ++++++++++++++++++++++++ data/js/jse_fileassociations.scp | 1 + 3 files changed, 454 insertions(+) create mode 100644 data/js/item/puzzlechest.js diff --git a/data/dfndata/items/containers/metal.dfn b/data/dfndata/items/containers/metal.dfn index d891d69a2..5b6875213 100644 --- a/data/dfndata/items/containers/metal.dfn +++ b/data/dfndata/items/containers/metal.dfn @@ -134,3 +134,12 @@ maxitems=125 { get=0x0e40 0x0e41 } + +[puzzlechest] +{ +get=base_item +name=metal chest +id=0x0e41 +movable=2 +script=5061 +} diff --git a/data/js/item/puzzlechest.js b/data/js/item/puzzlechest.js new file mode 100644 index 000000000..16ab40d89 --- /dev/null +++ b/data/js/item/puzzlechest.js @@ -0,0 +1,444 @@ +const PuzzleChestCylinder = { + None: 0xE73, + LightBlue: 0x186F, + Blue: 0x186A, + Green: 0x186B, + Orange: 0x186C, + Purple: 0x186D, + Red: 0x186E, + DarkBlue: 0x1869, + Yellow: 0x1870 +}; + +function PuzzleChestSolution( cylinders ) +{ + this.cylinders = cylinders || [ + RandomCylinder(), + RandomCylinder(), + RandomCylinder(), + RandomCylinder(), + RandomCylinder() + ]; +} + +function RandomCylinder() +{ + var randomValue = RandomNumber( 0, 8 ); + switch ( randomValue ) + { + case 0: return PuzzleChestCylinder.LightBlue; + case 1: return PuzzleChestCylinder.Blue; + case 2: return PuzzleChestCylinder.Green; + case 3: return PuzzleChestCylinder.Orange; + case 4: return PuzzleChestCylinder.Purple; + case 5: return PuzzleChestCylinder.Red; + case 6: return PuzzleChestCylinder.DarkBlue; + default: return PuzzleChestCylinder.Yellow; + } +} + +function CompareSolutions( solutionCylinders, guessCylinders ) +{ + var correctCylinders = 0; + var correctColors = 0; + var matchesSrc = [false, false, false, false, false]; + var matchesDst = [false, false, false, false, false]; + + // Check for exact matches ( correct position and color ) + for ( var i = 0; i < solutionCylinders.length; i++ ) + { + if( solutionCylinders[i] == guessCylinders[i] ) + { + correctCylinders++; + matchesSrc[i] = true; + matchesDst[i] = true; + } + } + + // Check for color matches ( wrong position ) + for ( var i = 0; i < solutionCylinders.length; i++ ) + { + if( !matchesSrc[i] ) + { + for ( var j = 0; j < guessCylinders.length; j++ ) + { + if( solutionCylinders[i] == guessCylinders[j] && !matchesDst[j] ) + { + correctColors++; + matchesDst[j] = true; + break; + } + } + } + } + + return { + correctCylinders: correctCylinders, + correctColors: correctColors + }; +} + +function onCreateDFN( objMade, objType ) +{ + if( objType == 0 ) + { + objMade.SetTag( "locked", "true" ); // Lock the chest by default + var solution = new PuzzleChestSolution(); + objMade.SetTag( "solution", SerializeSolution( solution )); // Store the solution as a serialized string + } +} + +function onUseChecked( pUser, pItem ) +{ + var socket = pUser.socket; + socket.tempObj = pItem; + + if( pItem.GetTag( "locked" ) == "true" ) + { + var serializedSolution = pItem.GetTag( "solution" ); + var solution = DeserializeSolution( serializedSolution ); + var lastGuess = pUser.GetTag( "lastGuess" ); + + // Initialize lastGuess if it doesn't exist + if( !lastGuess ) + { + lastGuess = new PuzzleChestSolution(); + pUser.SetTag( "lastGuess", SerializeSolution( lastGuess )); + } + else + { + lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + } + + // Calculate the number of correct cylinders and colors + var result = CompareSolutions( solution.cylinders, lastGuess.cylinders ); + + // Generate hints based on player's lockpicking skill + var hints = GenerateHints( pUser, result.correctCylinders, result.correctColors ); + + // Show the puzzle gump to the player + ShowPuzzleGump( pUser, pItem, solution, 0 ); // Pass the solution and default check = 0 + } +} + +function onGumpPress( pSock, pButton, gumpData ) +{ + var pUser = pSock.currentChar; + var pItem = pSock.tempObj; // Access the temporary object from the socket + + // Deserialize the puzzle solution and the last guess from the player's tags + var solution = DeserializeSolution( pItem.GetTag( "solution" )); + var lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + + if( pButton == 1 ) + { + // Submit button ( ID 1 ) + var result = CompareSolutions( solution.cylinders, lastGuess.cylinders ); + if( result.correctCylinders == 5 ) + { + // Unlock the chest ifthe guess is correct + pItem.SetTag( "locked", "false" ); + pUser.SysMessage( "The chest unlocks!" ); + pUser.SoundEffect( 0x241, true ); // Play unlock sound effect + + // Reward the player and clear the puzzle + RewardPlayer( pUser, pItem ); + pUser.SetTag( "lastGuess", null ); + pItem.Delete( ); // Delete the chest after it's unlocked + } + else + { + // Generate hints for incorrect guesses + var hints = GenerateHints( pUser, result.correctCylinders, result.correctColors ); + + // Show a status gump with hints and apply damage for incorrect guess + ShowStatusGump( pUser, result.correctCylinders, result.correctColors, hints.hint1, hints.hint2 ); + DamagePlayer( pUser ); // Apply damage to the player for incorrect guesses + } + } + else if( pButton >= 10 && pButton <= 17 ) + { + // Handle left and right buttons to change cylinder color + var selectedCylinderIndex = gumpData.getButton( 0 ); // Determine which cylinder was selected via radio buttons + + if( selectedCylinderIndex >= 0 && selectedCylinderIndex <= 4 ) + { + // Handle the color change based on which button was pressed ( cylinder color buttons 10-17 ) + switch ( pButton ) + { + case 10: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.LightBlue; + break; + case 11: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Blue; + break; + case 12: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Green; + break; + case 13: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Orange; + break; + case 14: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Purple; + break; + case 15: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Red; + break; + case 16: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.DarkBlue; + break; + case 17: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Yellow; + break; + } + } + + // Update the player's last guess + pUser.SetTag( "lastGuess", SerializeSolution( lastGuess )); + + // Redraw the puzzle gump to reflect the updated guess + ShowPuzzleGump( pUser, pItem, lastGuess, selectedCylinderIndex ); + } + else if( pButton == 100 ) + { + // OK button in status gump ( ID 100 ) + // Reshow the puzzle gump after closing the status gump + ShowPuzzleGump( pUser, pItem, lastGuess, 0 ); // Reshow the puzzle with the correct solution + } +} + +function ShowPuzzleGump( pUser, pItem, lastGuess, check ) +{ + var myGump = new Gump; + + // Add the main background and title + myGump.AddBackground( 25, 0, 500, 410, 0x53 ); + myGump.AddGump( 62, 20, 0x67, 0 ); // Title image + myGump.AddHTMLGump( 80, 36, 110, 70, false, false, "A Puzzle Lock" ); + + // Instructions + myGump.AddHTMLGump( 214, 26, 270, 90, false, false, + "Correctly choose the sequence of cylinders needed to open the latch. Each cylinder may potentially be used more than once. Beware! A false attempt could be deadly!" ); + + // Left cylinder buttons + AddLeftCylinderButton( myGump, 62, 130, PuzzleChestCylinder.LightBlue, 10 ); + AddLeftCylinderButton( myGump, 62, 180, PuzzleChestCylinder.Blue, 11 ); + AddLeftCylinderButton( myGump, 62, 230, PuzzleChestCylinder.Green, 12 ); + AddLeftCylinderButton( myGump, 62, 280, PuzzleChestCylinder.Orange, 13 ); + + // Right cylinder buttons + AddRightCylinderButton( myGump, 451, 130, PuzzleChestCylinder.Purple, 14 ); + AddRightCylinderButton( myGump, 451, 180, PuzzleChestCylinder.Red, 15 ); + AddRightCylinderButton( myGump, 451, 230, PuzzleChestCylinder.DarkBlue, 16 ); + AddRightCylinderButton( myGump, 451, 280, PuzzleChestCylinder.Yellow, 17 ); + + var solution = DeserializeSolution( pItem.GetTag( "solution" )); + // Call AddLockpickingHints with the solution from the chest + AddLockpickingHints( myGump, pUser, solution ); + + // Previous guess + var lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + if( lastGuess ) + { + myGump.AddHTMLGump( 127, 249, 170, 20, false, false, "Thy previous guess:" ); + myGump.AddBackground( 290, 247, 115, 25, 0x13EC ); + + // Add each cylinder of the previous guess + for ( var i = 0; i < lastGuess.cylinders.length; i++ ) + { + AddCylinder( myGump, 281 + ( i * 22 ), 254, lastGuess.cylinders[i] ); + } + } + + // Pedestals for current guess + AddPedestal( myGump, 140, 270, lastGuess.cylinders[0], 0, check == 0 ); + AddPedestal( myGump, 195, 270, lastGuess.cylinders[1], 1, check == 1 ); + AddPedestal( myGump, 250, 270, lastGuess.cylinders[2], 2, check == 2 ); + AddPedestal( myGump, 305, 270, lastGuess.cylinders[3], 3, check == 3 ); + AddPedestal( myGump, 360, 270, lastGuess.cylinders[4], 4, check == 4 ); + + // Submit button + myGump.AddButton( 258, 370, 0xFA5, 0xFA7, 1, 0, 1 ); + + // Send the gump to the player + myGump.Send( pUser ); + myGump.Free( ); // Clear this gump from UOX memory +} + +function AddLockpickingHints( myGump, pUser, pChestSolution ) +{ + var lockpickingSkill = pUser.baseskills.lockpicking; // Lockpicking skill in UOX3 + + if( lockpickingSkill >= 600 ) + { + myGump.AddHTMLGump( 160, 125, 230, 24, false, false, "Lockpicking hint:" ); // Display the hint header + myGump.AddBackground( 159, 150, 230, 95, 0x13EC ); // Hint background + + // Add hints based on lockpicking skill thresholds + if( lockpickingSkill >= 800 ) + { + // Show the first correct cylinder from the chest solution + myGump.AddHTMLGump( 165, 157, 200, 40, false, false, "In the first slot:" ); + AddCylinder( myGump, 350, 165, pChestSolution.cylinders[0] ); // Show the first cylinder + + // Indicate that a cylinder is used in an unknown slot + myGump.AddHTMLGump( 165, 197, 200, 40, false, false, "Used in an unknown slot:" ); + AddCylinder( myGump, 350, 200, pChestSolution.cylinders[1] ); // Show the second cylinder as a hint + + if( lockpickingSkill >= 900 ) + { + // Add a hint for the third correct cylinder + AddCylinder( myGump, 350, 212, pChestSolution.cylinders[2] ); // Add third hint + } + if( lockpickingSkill >= 1000 ) + { + // Add a hint for the fourth correct cylinder + AddCylinder( myGump, 350, 224, pChestSolution.cylinders[3] ); // Add fourth hint + } + } + else + { + // Provide a basic hint ifthe player's skill is between 600-799 + myGump.AddHTMLGump( 165, 157, 200, 40, false, false, "Used in an unknown slot:" ); + AddCylinder( myGump, 350, 160, pChestSolution.cylinders[0] ); // Show the first cylinder as a basic hint + + if( lockpickingSkill >= 700 ) + { + // Add a second hint ifthe player's skill is 700-799 + AddCylinder( myGump, 350, 172, pChestSolution.cylinders[1] ); // Add second hint for 700+ skill + } + } + } +} + +function AddLeftCylinderButton( myGump, x, y, cylinder, buttonID ) +{ + myGump.AddBackground( x, y, 30, 30, 0x13EC ); + AddCylinder( myGump, x - 7, y + 10, cylinder ); + myGump.AddButton( x + 38, y + 9, 0x13A8, 0x13A9, 1, 0, buttonID ); +} + +function AddRightCylinderButton( myGump, x, y, cylinder, buttonID ) +{ + myGump.AddBackground( x, y, 30, 30, 0x13EC ); + AddCylinder( myGump, x - 7, y + 10, cylinder ); + myGump.AddButton( x - 26, y + 9, 0x13A8, 0x13A9, 1, 0, buttonID ); +} + +function AddCylinder( myGump, x, y, cylinder ) +{ + if( cylinder != PuzzleChestCylinder.None ) + { + myGump.AddPicture( x, y, cylinder ); + } + else + { + myGump.AddPicture( x + 9, y, cylinder ); + } +} + +function AddPedestal( myGump, x, y, cylinder, switchID, initialState ) +{ + myGump.AddPicture( x, y, 0xB10 ); + myGump.AddPicture( x - 23, y + 12, 0xB12 ); + myGump.AddPicture( x + 23, y + 12, 0xB13 ); + myGump.AddPicture( x, y + 23, 0xB11 ); + + if( cylinder != PuzzleChestCylinder.None ) + { + myGump.AddPicture( x, y + 2, 0x51A ); + AddCylinder( myGump, x - 1, y + 19, cylinder ); + } else { + myGump.AddPicture( x, y + 2, 0x521 ); + } + + // Use AddRadio to allow selection of one cylinder at a time + myGump.AddRadio( x + 7, y + 65, 0x867, initialState ? 1 : 0, switchID ); +} + +function ShowStatusGump( pUser, correctCylinders, correctColors ) +{ + var myGump = new Gump; + + myGump.AddBackground( 50, 50, 300, 200, 0x13BE ); // Add background + myGump.AddHTMLGump( 60, 60, 250, 25, false, false, "
Prototype
-int BASEITEMSERIAL();
-int INVALIDSERIAL();
-int INVALIDID();
-int INVALIDCOLOUR();
-Purpose
-BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
- INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
- INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
- INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!
Example of usage
-var baseItemSerial = BASEITEMSERIAL();
+
+
+
+
+
+ Prototype
+ int BASEITEMSERIAL();
+ int INVALIDSERIAL();
+ int INVALIDID();
+ int INVALIDCOLOUR();
+
+
+ Purpose
+
+ BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
+ INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
+ INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
+ INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!
+
+
+
+ Example of usage
+ var baseItemSerial = BASEITEMSERIAL();
var invalidSerial = INVALIDSERIAL();
var invalidID = INVALIDID();
var invalidColour = INVALIDCOLOUR();
-
-
-
+
Prototype
-PARTY CreateParty( partyleader );
-Purpose
-Create a new party/group with the specified character as leader
-Example of usage
-// Create a new party (myParty) with pUser as the leader
+
+
+
+
+
+ Prototype
+ PARTY CreateParty( partyleader );
+
+
+ Purpose
+ Create a new party/group with the specified character as leader
+
+
+ Example of usage
+ // Create a new party (myParty) with pUser as the leader
var myParty = CreateParty( pUser );
-
-
-
+
Prototype
-int DistanceBetween( x1, y1, x2, y2 );
-int DistanceBetween( x1, y1, z1, x2, y2, z2 );
-int DistanceBetween( objA, objB );
-int DistanceBetween( objA, objB, checkZ );
-Purpose
-Get the distance between two sets of coordinates or objects on either 2D or 3D plane
-Notes
-Parameters: x1, y1, z1, x2, y2, z2 = coordinates
- checkZ = true if distance between two objects should take into account Z axis
Example of usage
-// Get distance between two sets of x, y coordinates
+
+
+
+
+
+ Prototype
+ JSBool CheckInstaLog( x, y, world, instanceID );
+
+
+ Purpose
+ Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.
+
+
+ Example of usage
+ // Check if the player is in an instant logout zone
+var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
+
+if( isInstaLog )
+{
+ // Handle instant logout
+}
+else
+{
+ // Handle other logout scenarios
+}
+
+
+
+
+
+
+
+
+
+ Prototype
+ int DistanceBetween( x1, y1, x2, y2 );
+ int DistanceBetween( x1, y1, z1, x2, y2, z2 );
+ int DistanceBetween( objA, objB );
+ int DistanceBetween( objA, objB, checkZ );
+
+
+ Purpose
+ Get the distance between two sets of coordinates or objects on either 2D or 3D plane
+
+
+ Notes
+
+ Parameters: x1, y1, z1, x2, y2, z2 = coordinates
+ checkZ = true if distance between two objects should take into account Z axis
+
+
+
+ Example of usage
+ // Get distance between two sets of x, y coordinates
var distance1 = DistanceBetween( pUser.x, pUser.y, iUsed.x, iUsed.y );
// Get distance between two sets of x, y, z coordinates
@@ -6423,157 +6456,159 @@ January 9th, 2022
// Get distance between pUser and iUsed using 3D coordinates
var distance2 = DistanceBetween( pUser, iUsed, true );
-
-
-
+
Prototype
-bool DoesEventExist( scriptID, eventToCheck );
-Purpose
-Check for existence of a named JS event/function in another script
-Notes
-Parameters: scriptID = ID of the script to check
- eventToCheck = name of event/function to look for
Example of usage
-// Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
+
+
+
+
+
+ Prototype
+ bool DoesEventExist( scriptID, eventToCheck );
+
+
+ Purpose
+ Check for existence of a named JS event/function in another script
+
+
+ Notes
+
+ Parameters: scriptID = ID of the script to check
+ eventToCheck = name of event/function to look for
+
+
+
+ Example of usage
+ // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
if( DoesEventExist( 0, "MyCustomFunction" ))
{
TriggerEvent( 0, "MyCustomFunction", [additional parameters] );
}
-
-
-
+
Prototype
-int GetAccountCount();
-Purpose
-Gets the total amount of accounts on the server
-Example of usage
-var totalAccounts = GetAccountCount();
- Prototype
+int GetAccountCount();
+Purpose
+Gets the total amount of accounts on the server
+Example of usage
+var totalAccounts = GetAccountCount();
+ Prototype
-bool GetClientFeature( ClientFeaturesBitNum );
-Purpose
-Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
-Example of usage
-// AoS bit from list of client features
+
+
+
+
+
+ Prototype
+ bool GetClientFeature( ClientFeaturesBitNum );
+
+
+ Purpose
+ Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
+
+
+ Example of usage
+ // AoS bit from list of client features
var aosFeaturesEnabled = GetClientFeature( 0x10 );
-
-
-
+
Prototype
-string GetDictionaryEntry( entryNum [, language ] );
-Purpose
-Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).
-Example of usage
-var textString = GetDictionaryEntry( 1, socket.language );
- Prototype
+string GetDictionaryEntry( entryNum [, language ] );
+Purpose
+Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).
+Example of usage
+var textString = GetDictionaryEntry( 1, socket.language );
+ Prototype
-int GetMurderThreshold();
-Purpose
-Returns the number of kills needed to be branded as a murderer and turn red.
-Notes
-See also: Character .murderCount and .murderer properties
-Example of usage
-if( GetMurderThreshold() > pTalking.murderCount )
+
+
+
+
+
+ Prototype
+ int GetMurderThreshold();
+
+
+ Purpose
+ Returns the number of kills needed to be branded as a murderer and turn red.
+
+
+ Notes
+ See also: Character .murderCount and .murderer properties
+
+
+ Example of usage
+ if( GetMurderThreshold() > pTalking.murderCount )
{
TextMessage( pTalkingTo, "Surely sir, you must be a murderer. I bid you adieu" );
EmoteMessage( pTalkingTo, "*scampers off*" );
}
-
-
-
+
Prototype
-int GetPlayerCount();
-Purpose
-Gets the total amount of players online on the server
-Example of usage
-var totalOnlinePlayers = GetPlayerCount();
- Prototype
+int GetPlayerCount();
+Purpose
+Gets the total amount of players online on the server
+Example of usage
+var totalOnlinePlayers = GetPlayerCount();
+ Prototype
-SOSObject GetRandomSOSArea( worldNum, instanceID );
-Purpose
-Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn
-Example of usage
-// Fetch reference to a random SOS area
+
+
+
+
+
+ Prototype
+ SOSObject GetRandomSOSArea( worldNum, instanceID );
+
+
+ Purpose
+ Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn
+
+
+ Example of usage
+ // Fetch reference to a random SOS area
var sosArea = GetRandomSOSArea( pUser.worldNum, pUser.instanceID );
// Pick a random location within the selected sosArea
@@ -6587,112 +6622,112 @@ January 9th, 2022
sosMsg.more = sosMsg.instanceID;
// See UOX3/js/item/waterstainedsos.js for full example, including validation for whether the chosen location is suitable, and not blocked by dynamic items, static items or map tiles
-
-
-
+
Prototype
-bool GetServerFeature( ServerFeaturesBitNum );
-Purpose
-Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
-Example of usage
-// ContextMenus bit from list of server features
+
+
+
+
+
+ Prototype
+ bool GetServerFeature( ServerFeaturesBitNum );
+
+
+ Purpose
+ Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
+
+
+ Example of usage
+ // ContextMenus bit from list of server features
var contextMenusEnabled = GetServerFeature( 0x08 );
-
-
-
+
Prototype
-string GetServerSetting( serverSettingString );
-Purpose
-Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.
-Example of usage
-// Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
+
+
+
+
+
+ Prototype
+ string GetServerSetting( serverSettingString );
+
+
+ Purpose
+ Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.
+
+
+ Example of usage
+ // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
var guardsActive = GetServerSetting( "GUARDSACTIVE" );
-
-
-
+
Prototype
-SOCKET GetSocketFromIndex( socketIndex );
-Purpose
-Create a socket-object based on the specified socketIndex
-Example of usage
-// Fetch whichever socket is connected to the server as socket/connection 0
+
+
+
+
+
+ Prototype
+ SOCKET GetSocketFromIndex( socketIndex );
+
+
+ Purpose
+ Create a socket-object based on the specified socketIndex
+
+
+ Example of usage
+ // Fetch whichever socket is connected to the server as socket/connection 0
var socket = GetSocketFromIndex( 0 );
-
-
-
+
Prototype
-bool IsInBuilding( x, y, z, world, instance, checkHeight );
-Purpose
-Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.
-Notes
-If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.
-Example of usage
-var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
- Prototype
+bool IsInBuilding( x, y, z, world, instance, checkHeight );
+Purpose
+Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.
+Notes
+If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.
+Example of usage
+var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
+ Prototype
-int IterateOver( objectType );
-Purpose
-Iterates over all objects of specified type in the world.
-Notes
-For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"
-Example of usage
-var itemCount = IterateOver( "ITEM" );
+
+
+
+
+
+ Prototype
+ int IterateOver( objectType );
+
+
+ Purpose
+ Iterates over all objects of specified type in the world.
+
+
+ Notes
+ For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"
+
+
+ Example of usage
+ var itemCount = IterateOver( "ITEM" );
Console.log( itemCount + " items found!" );
...
function onIterate( myObject )
@@ -6701,111 +6736,113 @@ January 9th, 2022
// ... optionally do something here
return true;
}
-
-
-
+
Prototype
-int Moon( moonNum );
-void Moon( moonNum, newVal );
-Purpose
-Get and set the server moon values for the two moons Felucca (0) and Trammel (1)
-Example of usage
-var feluccaMoonphase = Moon( 0 );
+
+
+
+
+
+ Prototype
+ int Moon( moonNum );
+ void Moon( moonNum, newVal );
+
+
+ Purpose
+ Get and set the server moon values for the two moons Felucca (0) and Trammel (1)
+
+
+ Example of usage
+ var feluccaMoonphase = Moon( 0 );
var TrammelMoonphase = Moon( 1 );
Moon( 0, 7 ); //Set the moon Felucca to moonphase 7
Moon( 1, 3 ); //Set the moon Trammel to moonphase 3
-
-
-
+
Prototype
-int RandomNumber( loNum, hiNum );
-Purpose
-Returns a random number between loNum (inclusive) and hiNum (inclusive)
-Example of usage
-var iNum = RandomNumber( 0, 10 );
- Prototype
+int RandomNumber( loNum, hiNum );
+Purpose
+Returns a random number between loNum (inclusive) and hiNum (inclusive)
+Example of usage
+var iNum = RandomNumber( 0, 10 );
+ Prototype
-void Reload( subSystemID );
-Purpose
-Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3
-Notes
-Supported subSystemIDs: -
Example of usage
-// Reload all DFNs (and Skill system)
+
+
+
+
+
+ Prototype
+ void Reload( subSystemID );
+
+
+ Purpose
+ Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3
+
+
+ Notes
+
+ Supported subSystemIDs:
+
+ - 0 - Regions/TeleportLocations
+ - 1 - Spawn Regions
+ - 2 - Spells
+ - 3 - Commands
+ - 4 - DFNs/Skills
+ - 5 - JScripts
+ - 6 - HTML Templates
+ - 7 - INI
+ - 8 - Everything
+ - 9 - Accounts
+ - 10 - Dictionaries
+
+
+
+
+ Example of usage
+ // Reload all DFNs (and Skill system)
Reload( 4 );
// Reload INI file
Reload( 7 );
-
-
-
+
Prototype
-void ReloadJSFile( scriptID );
-Purpose
-Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3
-Notes
-Cannot be used to validate sockets
-Example of usage
-// Example of how this is used by 'reloadjsfile command
+
+
+
+
+
+ Prototype
+ void ReloadJSFile( scriptID );
+
+
+ Purpose
+ Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3
+
+
+ Notes
+ Cannot be used to validate sockets
+
+
+ Example of usage
+ // Example of how this is used by 'reloadjsfile command
function CommandRegistration()
{
RegisterCommand( "reloadjsfile", 3, true ); //Reload JavaScript file
@@ -6818,70 +6855,70 @@ January 9th, 2022
ReloadJSFile( scriptID );
}
-
-
-
+
Prototype
-int RollDice( numDie, faces, addition );
-Purpose
-Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1
-Example of usage
-// Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
+
+
+
+
+
+ Prototype
+ int RollDice( numDie, faces, addition );
+
+
+ Purpose
+ Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1
+
+
+ Example of usage
+ // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
var mDie = RollDice( 2, 3, 1 );
-
-
-
+
Prototype
-bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );
-Purpose
-Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object
-Example of usage
-// Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
+
+
+
+
+
+ Prototype
+ bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );
+
+
+ Purpose
+ Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object
+
+
+ Example of usage
+ // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
var returnVal = TriggerEvent( 8000, "onUseChecked", pUser, iUsed );
-
-
-
+
Prototype
-TriggerTrap( pChar/pSock, iTrap );
-Purpose
-pChar/pSock triggers trap on iTrap object (if any trap is present on object)
-Notes
-Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.
-Example of usage
-// Setup trap on iTrap object
+
+
+
+
+
+ Prototype
+ TriggerTrap( pChar/pSock, iTrap );
+
+
+ Purpose
+ pChar/pSock triggers trap on iTrap object (if any trap is present on object)
+
+
+ Notes
+ Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.
+
+
+ Example of usage
+ // Setup trap on iTrap object
// First part of value (01) indicates object is trapped
// Second part of value (32) defines damage dealt (32 = 0x32 = 50 damage)
// Third (00) and Fourth (00) parts, unused here, normally indicate the min/max skill required to disarm trap
@@ -6890,148 +6927,148 @@ January 9th, 2022
// Trigger the trap
TriggerTrap( pChar, iTrap );
-
-
-
+
Prototype
-void UseItem( pSock/mChar, iToUse );
-Purpose
-To allow characters (and NPCs in particular) to trigger item-use functionality of items
-Notes
-Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.
-Example of usage
-// If an item has type 12, make NPC use the door to open it
+
+
+
+
+
+ Prototype
+ void UseItem( pSock/mChar, iToUse );
+
+
+ Purpose
+ To allow characters (and NPCs in particular) to trigger item-use functionality of items
+
+
+ Notes
+ Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.
+
+
+ Example of usage
+ // If an item has type 12, make NPC use the door to open it
if( myItem.type == 12 )
{
mChar.TextMessage( "A door! What's on the other side?" );
UseItem( mChar, iToUse );
}
-
-
-
+
Prototype
-bool ValidateObject( object );
-Purpose
-Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)
-Notes
-Cannot be used to validate sockets
-Example of usage
-if( !ValidateObject( iUsed ))
+
+
+
+
+
+ Prototype
+ bool ValidateObject( object );
+
+
+ Purpose
+ Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)
+
+
+ Notes
+ Cannot be used to validate sockets
+
+
+ Example of usage
+ if( !ValidateObject( iUsed ))
return;
-
-
-
+
Prototype
-[int] WorldBrightLevel( [lightlevel] );
-Purpose
-Get/Set the "maximum brightness" light-level for daytime across the entire world
-Notes
-If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.
-Example of usage
-// Set maximum world brightness level to 1
+
+
+
+
+
+ Prototype
+ [int] WorldBrightLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the "maximum brightness" light-level for daytime across the entire world
+
+
+ Notes
+ If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.
+
+
+ Example of usage
+ // Set maximum world brightness level to 1
WorldBrightLevel( 1 );
// Get current maximum world brightness level
var lightLevel = WorldBrightLevel();
-
-
-
+
Prototype
-[int] WorldDarkLevel( [lightlevel] );
-Purpose
-Get/Set the "minimum brightness" light-level for night-time across the entire world
-Notes
-If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.
-Example of usage
-// Set minimum world brightness level to 15
+
+
+
+
+
+ Prototype
+ [int] WorldDarkLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the "minimum brightness" light-level for night-time across the entire world
+
+
+ Notes
+ If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.
+
+
+ Example of usage
+ // Set minimum world brightness level to 15
WorldDarkLevel( 15 );
// Get current maximum world brightness level
var lightLevel = WorldDarkLevel();
-
-
-
+
Prototype
-[int] WorldDungeonLevel( [lightlevel] );
-Purpose
-Get/Set the fixed light-level for any regions marked as dungeons
-Notes
-If no parameter is provided, function will return current fixed light-level for dungeons instead.
-Example of usage
-// Set fixed dungeon light level to 12
+
+
+
+
+
+ Prototype
+ [int] WorldDungeonLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the fixed light-level for any regions marked as dungeons
+
+
+ Notes
+ If no parameter is provided, function will return current fixed light-level for dungeons instead.
+
+
+ Example of usage
+ // Set fixed dungeon light level to 12
WorldDungeonLevel( 12 );
// Get current fixed light level of dungeons
var lightLevel = WorldDungeonLevel();
-
-
-
+
Prototype
-PARTY CreateParty( partyleader );
-Purpose
-Create a new party/group with the specified character as leader
-Example of usage
-// Create a new party (myParty) with pUser as the leader
+
+
+
+
+
+ Prototype
+ PARTY CreateParty( partyleader );
+
+
+ Purpose
+ Create a new party/group with the specified character as leader
+
+
+ Example of usage
+ // Create a new party (myParty) with pUser as the leader
var myParty = CreateParty( pUser );
-
-
-
+
Prototype
-JSBool CheckInstaLog( x, y, world, instanceID );
-Purpose
-Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.
-Example of usage
-// Check if the player is in an instant logout zone
+
+
+
+
+
+ Prototype
+ JSBool CheckInstaLog( x, y, world, instanceID );
+
+
+ Purpose
+ Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.
+
+
+ Example of usage
+ // Check if the player is in an instant logout zone
var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
if( isInstaLog )
{
- // Handle instant logout
+ // Handle instant logout
}
else
{
- // Handle other logout scenarios
+ // Handle other logout scenarios
}
From 6c33200e9c8359db05a3e7a2ed42e31c5c328b27 Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Sat, 25 Jan 2025 22:25:17 -0600
Subject: [PATCH 12/19] Update Changelog.txt
---
source/Changelog.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source/Changelog.txt b/source/Changelog.txt
index 02b53eb87..79ec4f3b6 100644
--- a/source/Changelog.txt
+++ b/source/Changelog.txt
@@ -1,3 +1,7 @@
+10/09/2024 - Dragon Slayer
+ Added Puzzle Chest These are the same as the type of traps purchased from the Oddities Trader at the Lycaeum. The more lockpicking skill that you have the better 'hints' you receive. Opening the puzzle lock will unhide you. Answering incorrectly will damage you. These chests can only be unlocked by solving a puzzle.
+
+
12/08/2024 - Dragon Slayer
Fixed an issue where Imbuing and Mysticism skills were listed in wrong order in skills.dfn and enums.h
From ce6ed1d0e57710695221cf25eb34b84bfbbd2e67 Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Sun, 26 Jan 2025 17:41:35 -0600
Subject: [PATCH 13/19] Added puzzle chest to addmenu
---
data/dfndata/items/ItemMenu.bulk.dfn | 2 ++
1 file changed, 2 insertions(+)
diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn
index 0da06b87d..440a8d197 100644
--- a/data/dfndata/items/ItemMenu.bulk.dfn
+++ b/data/dfndata/items/ItemMenu.bulk.dfn
@@ -9097,6 +9097,8 @@ ADDITEM=0x0e7c
ADDITEM=0x0e40
0x0e41=metal chest
ADDITEM=0x0e41
+0x0e41=Puzzle Chest
+ADDITEM=puzzlechest
<=Previous Menu
ITEMMENU=3
}
From 19ba341b89fe4cc495d76fdcaa7123a729228a0b Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Sun, 26 Jan 2025 20:06:11 -0600
Subject: [PATCH 14/19] update
added to addmneu
added origin tag
---
.../{house_ml.dfn => house_addons_ml.dfn} | 0
data/dfndata/items/ItemMenu.bulk.dfn | 55 +++++++++++++++++++
data/dfndata/items/ItemMenu.dfn | 2 +
.../items/deeds/houseaddon_deeds_ml.dfn | 24 ++++++++
4 files changed, 81 insertions(+)
rename data/dfndata/house/{house_ml.dfn => house_addons_ml.dfn} (100%)
diff --git a/data/dfndata/house/house_ml.dfn b/data/dfndata/house/house_addons_ml.dfn
similarity index 100%
rename from data/dfndata/house/house_ml.dfn
rename to data/dfndata/house/house_addons_ml.dfn
diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn
index 0da06b87d..9f314dd23 100644
--- a/data/dfndata/items/ItemMenu.bulk.dfn
+++ b/data/dfndata/items/ItemMenu.bulk.dfn
@@ -14253,3 +14253,58 @@ ADDITEM=mapmakerspen
<=Previous Menu
ITEMMENU=127
}
+
+[ITEMMENU 260]
+{
+Houseaddon_ML_Deeds.dfn
+0x14F0=Elven Bed (East)
+ADDITEM=elvenbedeastdeed
+0x14F0=Elven Bed (South)
+ADDITEM=elvenbedsouthdeed
+0x14F0=Alchemist Table (East)
+ADDITEM=alchemisttabledeedeast
+0x14F0=Alchemist Table (South)
+ADDITEM=alchemisttablesouthdeed
+0x14F0=Elven Loveseat (East)
+ADDITEM=elvenloveseateastdeed
+0x14F0=Elven Loveseat (South)
+ADDITEM=elvenloveseatsouthdeed
+0x14F0=Elven Wash Basin (East)
+ADDITEM=elvenwashbasineastdeed
+0x14F0=Elven Wash Basin (South)
+ADDITEM=elvenwashbasinsouthdeed
+0x14F0=Fancy Couch (East)
+ADDITEM=fancycoucheastdeed
+0x14F0=Fancy Couch (North)
+ADDITEM=fancycouchnorthdeed
+0x14F0=Fancy Couch (South)
+ADDITEM=fancycouchsouthdeed
+0x14F0=Fancy Couch (West)
+ADDITEM=fancycouchwestdeed
+0x14F0=Hardwood Table (East)
+ADDITEM=hardwoodtableeastdeed
+0x14F0=Hardwood Table (South)
+ADDITEM=hardwoodtablesouthdeed
+0x14F0=Fancy Loveseat (East)
+ADDITEM=fancyloveseateastdeed
+0x14F0=Fancy Loveseat (North)
+ADDITEM=fancyloveseatnorthdeed
+0x14F0=Fancy Loveseat (South)
+ADDITEM=fancyloveseatsouthdeed
+0x14F0=Fancy Loveseat (West)
+ADDITEM=fancyloveseatwestdeed
+0x14F0=Ornate Table (East)
+ADDITEM=ornatetableeastdeed
+0x14F0=Ornate Table (South)
+ADDITEM=ornatetablesouthdeed
+0x14F0=Plush Loveseat (East)
+ADDITEM=plushloveseateastdeed
+0x14F0=Plush Loveseat (South)
+ADDITEM=plushloveseatsouthdeed
+0x14F0=Tall Elven Bed (East)
+ADDITEM=tallelvenbedeastdeed
+0x14F0=Tall Elven Bed (South)
+ADDITEM=tallelvenbedsouthdeed
+<=Previous Menu
+ITEMMENU=4
+}
diff --git a/data/dfndata/items/ItemMenu.dfn b/data/dfndata/items/ItemMenu.dfn
index 7815ab7f7..4709bd0a3 100644
--- a/data/dfndata/items/ItemMenu.dfn
+++ b/data/dfndata/items/ItemMenu.dfn
@@ -303,6 +303,8 @@ ITEMMENU=68
ITEMMENU=69
<=Houseaddon Deeds
ITEMMENU=71
+<=Houseaddon ML Deeds
+ITEMMENU=260
<=Misc Deeds
ITEMMENU=70
<=Previous Menu
diff --git a/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn
index c366542f4..59ffb2c8e 100644
--- a/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn
+++ b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn
@@ -4,6 +4,7 @@
name=Elven Bed (East)
id=0x14F0
morex=300
+origin=ml
}
// Elven Bed (South) Deed
@@ -12,6 +13,7 @@ morex=300
name=Elven Bed (South)
id=0x14F0
morex=301
+origin=ml
}
// Alchemist Table (East) Deed
@@ -20,6 +22,7 @@ morex=301
name=Alchemist Table (East)
id=0x14F0
morex=300
+origin=ml
}
// Alchemist Table (South) Deed
@@ -28,6 +31,7 @@ morex=300
name=Alchemist Table (South)
id=0x14F0
morex=301
+origin=ml
}
// Elven Loveseat (East) Deed
@@ -36,6 +40,7 @@ morex=301
name=Elven Loveseat (East)
id=0x14F0
morex=304
+origin=ml
}
// Elven Loveseat (South) Deed
@@ -44,6 +49,7 @@ morex=304
name=Elven Loveseat (South)
id=0x14F0
morex=305
+origin=ml
}
// Elven Wash Basin (East) Deed
@@ -52,6 +58,7 @@ morex=305
name=Elven Wash Basin (East)
id=0x14F0
morex=306
+origin=ml
}
// Elven Wash Basin (South) Deed
@@ -60,6 +67,7 @@ morex=306
name=Elven Wash Basin (South)
id=0x14F0
morex=307
+origin=ml
}
// Fancy Couch (East) Deed
@@ -68,6 +76,7 @@ morex=307
name=Fancy Couch (East)
id=0x14F0
morex=308
+origin=ml
}
// Fancy Couch (North) Deed
@@ -76,6 +85,7 @@ morex=308
name=Fancy Couch (North)
id=0x14F0
morex=309
+origin=ml
}
// Fancy Couch (South) Deed
@@ -84,6 +94,7 @@ morex=309
name=Fancy Couch (South)
id=0x14F0
morex=310
+origin=ml
}
// Fancy Couch (West) Deed
@@ -92,6 +103,7 @@ morex=310
name=Fancy Couch (West)
id=0x14F0
morex=311
+origin=ml
}
// Hardwood Table (East) Deed
@@ -100,6 +112,7 @@ morex=311
name=Hardwood Table (East)
id=0x14F0
morex=312
+origin=ml
}
// Hardwood Table (South) Deed
@@ -108,6 +121,7 @@ morex=312
name=Hardwood Table (South)
id=0x14F0
morex=313
+origin=ml
}
// Fancy Loveseat (East) Deed
@@ -116,6 +130,7 @@ morex=313
name=Fancy Loveseat (East)
id=0x14F0
morex=314
+origin=ml
}
// Fancy Loveseat (North) Deed
@@ -124,6 +139,7 @@ morex=314
name=Fancy Loveseat (North)
id=0x14F0
morex=315
+origin=ml
}
// Fancy Loveseat (South) Deed
@@ -132,6 +148,7 @@ morex=315
name=Fancy Loveseat (South)
id=0x14F0
morex=316
+origin=ml
}
// Fancy Loveseat (West) Deed
@@ -140,6 +157,7 @@ morex=316
name=Fancy Loveseat (West)
id=0x14F0
morex=317
+origin=ml
}
// Ornate Table (East) Deed
@@ -148,6 +166,7 @@ morex=317
name=Ornate Table (East)
id=0x14F0
morex=318
+origin=ml
}
// Ornate Table (South) Deed
@@ -156,6 +175,7 @@ morex=318
name=Ornate Table (South)
id=0x14F0
morex=319
+origin=ml
}
// Plush Loveseat (East) Deed
@@ -164,6 +184,7 @@ morex=319
name=Plush Loveseat (East)
id=0x14F0
morex=320
+origin=ml
}
// Plush Loveseat (South) Deed
@@ -172,6 +193,7 @@ morex=320
name=Plush Loveseat (South)
id=0x14F0
morex=321
+origin=ml
}
// Tall Elven Bed (East) Deed
@@ -180,6 +202,7 @@ morex=321
name=Tall Elven Bed (East)
id=0x14F0
morex=322
+origin=ml
}
// Tall Elven Bed (South) Deed
@@ -188,4 +211,5 @@ morex=322
name=Tall Elven Bed (South)
id=0x14F0
morex=323
+origin=ml
}
\ No newline at end of file
From 5ef75a2564906f769208aa34a5e0c3770a95af25 Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Mon, 27 Jan 2025 14:00:15 -0600
Subject: [PATCH 15/19] update
added to addmenu
added origin tag to the deeds.
---
data/dfndata/items/ItemMenu.bulk.dfn | 27 +++++++++++++++++++
data/dfndata/items/ItemMenu.dfn | 2 ++
.../items/deeds/minihouseaddon_deeds.dfn | 10 +++++++
3 files changed, 39 insertions(+)
diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn
index 0da06b87d..5dd66821c 100644
--- a/data/dfndata/items/ItemMenu.bulk.dfn
+++ b/data/dfndata/items/ItemMenu.bulk.dfn
@@ -14253,3 +14253,30 @@ ADDITEM=mapmakerspen
<=Previous Menu
ITEMMENU=127
}
+
+[ITEMMENU 261]
+{
+minihouseaddon_deeds.dfn
+0x14F0=Mini House: Stone and Plaster
+ADDITEM=stoneandplastermini
+0x14F0=Mini House: Field Stone
+ADDITEM=fieldstonemini
+0x14F0=Mini House: Small Brick
+ADDITEM=smallbrickmini
+0x14F0=Mini House: Wooden
+ADDITEM=woodenmini
+0x14F0=Mini House: Wood and Plaster
+ADDITEM=woodandplastermini
+0x14F0=Mini House: Thatched-Roof Cottage
+ADDITEM=thatchedroofcottage
+0x14F0=Mini House: Brick
+ADDITEM=brickmini
+0x14F0=Mini House: Two-Story Wood and Plaster
+ADDITEM=twostorywoodandplastermini
+0x14F0=Mini House: Malas Mountain Pass
+ADDITEM=malasmountainpassmini
+0x14F0=Mini House: Church at Night
+ADDITEM=churchatnightmini
+<=Previous Menu
+ITEMMENU=4
+}
diff --git a/data/dfndata/items/ItemMenu.dfn b/data/dfndata/items/ItemMenu.dfn
index 7815ab7f7..3c5863682 100644
--- a/data/dfndata/items/ItemMenu.dfn
+++ b/data/dfndata/items/ItemMenu.dfn
@@ -303,6 +303,8 @@ ITEMMENU=68
ITEMMENU=69
<=Houseaddon Deeds
ITEMMENU=71
+<=Mini Houseaddon Deeds
+ITEMMENU=261
<=Misc Deeds
ITEMMENU=70
<=Previous Menu
diff --git a/data/dfndata/items/deeds/minihouseaddon_deeds.dfn b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn
index 0e516c52f..e9fa79f11 100644
--- a/data/dfndata/items/deeds/minihouseaddon_deeds.dfn
+++ b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn
@@ -4,6 +4,7 @@
name=Mini House: Stone and Plaster
id=0x14F0
morex=500
+origin=aos
}
// Deed for Field Stone Mini House
@@ -12,6 +13,7 @@ morex=500
name=Mini House: Field Stone
id=0x14F0
morex=501
+origin=aos
}
// Deed for Small Brick Mini House
@@ -20,6 +22,7 @@ morex=501
name=Mini House: Small Brick
id=0x14F0
morex=502
+origin=aos
}
// Deed for Wooden Mini House
@@ -28,6 +31,7 @@ morex=502
name=Mini House: Wooden
id=0x14F0
morex=503
+origin=aos
}
// Deed for Wood and Plaster Mini House
@@ -36,6 +40,7 @@ morex=503
name=Mini House: Wood and Plaster
id=0x14F0
morex=504
+origin=aos
}
// Deed for Thatched-Roof Cottage Mini House
@@ -44,6 +49,7 @@ morex=504
name=Mini House: Thatched-Roof Cottage
id=0x14F0
morex=505
+origin=aos
}
// Deed for Brick Mini House
@@ -52,6 +58,7 @@ morex=505
name=Mini House: Brick
id=0x14F0
morex=506
+origin=aos
}
// Deed for Two-Story Wood and Plaster Mini House
@@ -60,6 +67,7 @@ morex=506
name=Mini House: Two-Story Wood and Plaster
id=0x14F0
morex=507
+origin=aos
}
// Deed for Malas Mountain Pass Mini House
@@ -68,6 +76,7 @@ morex=507
name=Mini House: Malas Mountain Pass
id=0x14F0
morex=508
+origin=aos
}
// Deed for Church at Night Mini House
@@ -76,4 +85,5 @@ morex=508
name=Mini House: Church at Night
id=0x14F0
morex=509
+origin=aos
}
\ No newline at end of file
From 3211f67bbf77fdb8d2914b47d7126ed590051492 Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Mon, 27 Jan 2025 21:28:05 -0600
Subject: [PATCH 16/19] Update jsdocs.html
---
docs/jsdocs.html | 1113 ++++++++++++++++++++++------------------------
1 file changed, 538 insertions(+), 575 deletions(-)
diff --git a/docs/jsdocs.html b/docs/jsdocs.html
index b3b18a7e1..17aff972f 100644
--- a/docs/jsdocs.html
+++ b/docs/jsdocs.html
@@ -6351,41 +6351,39 @@ January 9th, 2022
Miscellaneous Functions
-
+
-
-
-
-
-
- Prototype
- int BASEITEMSERIAL();
- int INVALIDSERIAL();
- int INVALIDID();
- int INVALIDCOLOUR();
-
-
- Purpose
-
- BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
- INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
- INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
- INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!
-
-
-
- Example of usage
- var baseItemSerial = BASEITEMSERIAL();
+
+
+
+
+
+ Prototype
+ int BASEITEMSERIAL();
+ int INVALIDSERIAL();
+ int INVALIDID();
+ int INVALIDCOLOUR();
+
+
+ Purpose
+ BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
+ INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
+ INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
+ INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!
+
+
+ Example of usage
+ var baseItemSerial = BASEITEMSERIAL();
var invalidSerial = INVALIDSERIAL();
var invalidID = INVALIDID();
var invalidColour = INVALIDCOLOUR();
-
-
-
+
+
+
-
+
@@ -6405,59 +6403,28 @@ January 9th, 2022
-
-
+
+
Prototype
- JSBool CheckInstaLog( x, y, world, instanceID );
+ int DistanceBetween( x1, y1, x2, y2 );
+ int DistanceBetween( x1, y1, z1, x2, y2, z2 );
+ int DistanceBetween( objA, objB );
+ int DistanceBetween( objA, objB, checkZ );
Purpose
- Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.
+ Get the distance between two sets of coordinates or objects on either 2D or 3D plane
+
+
+ Notes
+ Parameters: x1, y1, z1, x2, y2, z2 = coordinates
+ checkZ = true if distance between two objects should take into account Z axis
Example of usage
- // Check if the player is in an instant logout zone
-var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
-
-if( isInstaLog )
-{
- // Handle instant logout
-}
-else
-{
- // Handle other logout scenarios
-}
-
-
-
-
-
-
-
-
-
- Prototype
- int DistanceBetween( x1, y1, x2, y2 );
- int DistanceBetween( x1, y1, z1, x2, y2, z2 );
- int DistanceBetween( objA, objB );
- int DistanceBetween( objA, objB, checkZ );
-
-
- Purpose
- Get the distance between two sets of coordinates or objects on either 2D or 3D plane
-
-
- Notes
-
- Parameters: x1, y1, z1, x2, y2, z2 = coordinates
- checkZ = true if distance between two objects should take into account Z axis
-
-
-
- Example of usage
- // Get distance between two sets of x, y coordinates
+ // Get distance between two sets of x, y coordinates
var distance1 = DistanceBetween( pUser.x, pUser.y, iUsed.x, iUsed.y );
// Get distance between two sets of x, y, z coordinates
@@ -6468,159 +6435,157 @@ January 9th, 2022
// Get distance between pUser and iUsed using 3D coordinates
var distance2 = DistanceBetween( pUser, iUsed, true );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- bool DoesEventExist( scriptID, eventToCheck );
-
-
- Purpose
- Check for existence of a named JS event/function in another script
-
-
- Notes
-
- Parameters: scriptID = ID of the script to check
- eventToCheck = name of event/function to look for
-
-
-
- Example of usage
- // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
+
+
+
+
+
+ Prototype
+ bool DoesEventExist( scriptID, eventToCheck );
+
+
+ Purpose
+ Check for existence of a named JS event/function in another script
+
+
+ Notes
+ Parameters: scriptID = ID of the script to check
+ eventToCheck = name of event/function to look for
+
+
+ Example of usage
+ // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
if( DoesEventExist( 0, "MyCustomFunction" ))
{
TriggerEvent( 0, "MyCustomFunction", [additional parameters] );
}
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- int GetAccountCount();
-
-
- Purpose
- Gets the total amount of accounts on the server
-
-
- Example of usage
- var totalAccounts = GetAccountCount();
-
-
-
+
+
+
+
+
+ Prototype
+ int GetAccountCount();
+
+
+ Purpose
+ Gets the total amount of accounts on the server
+
+
+ Example of usage
+ var totalAccounts = GetAccountCount();
+
+
+
-
-
-
-
-
- Prototype
- bool GetClientFeature( ClientFeaturesBitNum );
-
-
- Purpose
- Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
-
-
- Example of usage
- // AoS bit from list of client features
+
+
+
+
+
+ Prototype
+ bool GetClientFeature( ClientFeaturesBitNum );
+
+
+ Purpose
+ Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
+
+
+ Example of usage
+ // AoS bit from list of client features
var aosFeaturesEnabled = GetClientFeature( 0x10 );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- string GetDictionaryEntry( entryNum [, language ] );
-
-
- Purpose
- Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).
-
-
- Example of usage
- var textString = GetDictionaryEntry( 1, socket.language );
-
-
-
+
+
+
+
+
+ Prototype
+ string GetDictionaryEntry( entryNum [, language ] );
+
+
+ Purpose
+ Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).
+
+
+ Example of usage
+ var textString = GetDictionaryEntry( 1, socket.language );
+
+
+
-
-
-
-
-
- Prototype
- int GetMurderThreshold();
-
-
- Purpose
- Returns the number of kills needed to be branded as a murderer and turn red.
-
-
- Notes
- See also: Character .murderCount and .murderer properties
-
-
- Example of usage
- if( GetMurderThreshold() > pTalking.murderCount )
+
+
+
+
+
+ Prototype
+ int GetMurderThreshold();
+
+
+ Purpose
+ Returns the number of kills needed to be branded as a murderer and turn red.
+
+
+ Notes
+ See also: Character .murderCount and .murderer properties
+
+
+ Example of usage
+ if( GetMurderThreshold() > pTalking.murderCount )
{
TextMessage( pTalkingTo, "Surely sir, you must be a murderer. I bid you adieu" );
EmoteMessage( pTalkingTo, "*scampers off*" );
}
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- int GetPlayerCount();
-
-
- Purpose
- Gets the total amount of players online on the server
-
-
- Example of usage
- var totalOnlinePlayers = GetPlayerCount();
-
-
-
+
+
+
+
+
+ Prototype
+ int GetPlayerCount();
+
+
+ Purpose
+ Gets the total amount of players online on the server
+
+
+ Example of usage
+ var totalOnlinePlayers = GetPlayerCount();
+
+
+
-
-
-
-
-
- Prototype
- SOSObject GetRandomSOSArea( worldNum, instanceID );
-
-
- Purpose
- Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn
-
-
- Example of usage
- // Fetch reference to a random SOS area
+
+
+
+
+
+ Prototype
+ SOSObject GetRandomSOSArea( worldNum, instanceID );
+
+
+ Purpose
+ Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn
+
+
+ Example of usage
+ // Fetch reference to a random SOS area
var sosArea = GetRandomSOSArea( pUser.worldNum, pUser.instanceID );
// Pick a random location within the selected sosArea
@@ -6634,112 +6599,112 @@ January 9th, 2022
sosMsg.more = sosMsg.instanceID;
// See UOX3/js/item/waterstainedsos.js for full example, including validation for whether the chosen location is suitable, and not blocked by dynamic items, static items or map tiles
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- bool GetServerFeature( ServerFeaturesBitNum );
-
-
- Purpose
- Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
-
-
- Example of usage
- // ContextMenus bit from list of server features
+
+
+
+
+
+ Prototype
+ bool GetServerFeature( ServerFeaturesBitNum );
+
+
+ Purpose
+ Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.
+
+
+ Example of usage
+ // ContextMenus bit from list of server features
var contextMenusEnabled = GetServerFeature( 0x08 );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- string GetServerSetting( serverSettingString );
-
-
- Purpose
- Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.
-
-
- Example of usage
- // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
+
+
+
+
+
+ Prototype
+ string GetServerSetting( serverSettingString );
+
+
+ Purpose
+ Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.
+
+
+ Example of usage
+ // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
var guardsActive = GetServerSetting( "GUARDSACTIVE" );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- SOCKET GetSocketFromIndex( socketIndex );
-
-
- Purpose
- Create a socket-object based on the specified socketIndex
-
-
- Example of usage
- // Fetch whichever socket is connected to the server as socket/connection 0
+
+
+
+
+
+ Prototype
+ SOCKET GetSocketFromIndex( socketIndex );
+
+
+ Purpose
+ Create a socket-object based on the specified socketIndex
+
+
+ Example of usage
+ // Fetch whichever socket is connected to the server as socket/connection 0
var socket = GetSocketFromIndex( 0 );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- bool IsInBuilding( x, y, z, world, instance, checkHeight );
-
-
- Purpose
- Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.
-
-
- Notes
- If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.
-
-
- Example of usage
- var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
-
-
-
+
+
+
+
+
+ Prototype
+ bool IsInBuilding( x, y, z, world, instance, checkHeight );
+
+
+ Purpose
+ Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.
+
+
+ Notes
+ If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.
+
+
+ Example of usage
+ var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
+
+
+
-
-
-
-
-
- Prototype
- int IterateOver( objectType );
-
-
- Purpose
- Iterates over all objects of specified type in the world.
-
-
- Notes
- For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"
-
-
- Example of usage
- var itemCount = IterateOver( "ITEM" );
+
+
+
+
+
+ Prototype
+ int IterateOver( objectType );
+
+
+ Purpose
+ Iterates over all objects of specified type in the world.
+
+
+ Notes
+ For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"
+
+
+ Example of usage
+ var itemCount = IterateOver( "ITEM" );
Console.log( itemCount + " items found!" );
...
function onIterate( myObject )
@@ -6748,113 +6713,111 @@ January 9th, 2022
// ... optionally do something here
return true;
}
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- int Moon( moonNum );
- void Moon( moonNum, newVal );
-
-
- Purpose
- Get and set the server moon values for the two moons Felucca (0) and Trammel (1)
-
-
- Example of usage
- var feluccaMoonphase = Moon( 0 );
+
+
+
+
+
+ Prototype
+ int Moon( moonNum );
+ void Moon( moonNum, newVal );
+
+
+ Purpose
+ Get and set the server moon values for the two moons Felucca (0) and Trammel (1)
+
+
+ Example of usage
+ var feluccaMoonphase = Moon( 0 );
var TrammelMoonphase = Moon( 1 );
Moon( 0, 7 ); //Set the moon Felucca to moonphase 7
Moon( 1, 3 ); //Set the moon Trammel to moonphase 3
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- int RandomNumber( loNum, hiNum );
-
-
- Purpose
- Returns a random number between loNum (inclusive) and hiNum (inclusive)
-
-
- Example of usage
- var iNum = RandomNumber( 0, 10 );
-
-
-
+
+
+
+
+
+ Prototype
+ int RandomNumber( loNum, hiNum );
+
+
+ Purpose
+ Returns a random number between loNum (inclusive) and hiNum (inclusive)
+
+
+ Example of usage
+ var iNum = RandomNumber( 0, 10 );
+
+
+
-
-
-
-
-
- Prototype
- void Reload( subSystemID );
-
-
- Purpose
- Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3
-
-
- Notes
-
- Supported subSystemIDs:
-
- - 0 - Regions/TeleportLocations
- - 1 - Spawn Regions
- - 2 - Spells
- - 3 - Commands
- - 4 - DFNs/Skills
- - 5 - JScripts
- - 6 - HTML Templates
- - 7 - INI
- - 8 - Everything
- - 9 - Accounts
- - 10 - Dictionaries
-
-
-
-
- Example of usage
- // Reload all DFNs (and Skill system)
+
+
+
+
+
+ Prototype
+ void Reload( subSystemID );
+
+
+ Purpose
+ Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3
+
+
+ Notes
+ Supported subSystemIDs:
+
+ - 0 - Regions/TeleportLocations
+ - 1 - Spawn Regions
+ - 2 - Spells
+ - 3 - Commands
+ - 4 - DFNs/Skills
+ - 5 - JScripts
+ - 6 - HTML Templates
+ - 7 - INI
+ - 8 - Everything
+ - 9 - Accounts
+ - 10 - Dictionaries
+
+
+
+ Example of usage
+ // Reload all DFNs (and Skill system)
Reload( 4 );
// Reload INI file
Reload( 7 );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- void ReloadJSFile( scriptID );
-
-
- Purpose
- Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3
-
-
- Notes
- Cannot be used to validate sockets
-
-
- Example of usage
- // Example of how this is used by 'reloadjsfile command
+
+
+
+
+
+ Prototype
+ void ReloadJSFile( scriptID );
+
+
+ Purpose
+ Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3
+
+
+ Notes
+ Cannot be used to validate sockets
+
+
+ Example of usage
+ // Example of how this is used by 'reloadjsfile command
function CommandRegistration()
{
RegisterCommand( "reloadjsfile", 3, true ); //Reload JavaScript file
@@ -6867,70 +6830,70 @@ January 9th, 2022
ReloadJSFile( scriptID );
}
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- int RollDice( numDie, faces, addition );
-
-
- Purpose
- Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1
-
-
- Example of usage
- // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
+
+
+
+
+
+ Prototype
+ int RollDice( numDie, faces, addition );
+
+
+ Purpose
+ Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1
+
+
+ Example of usage
+ // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
var mDie = RollDice( 2, 3, 1 );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );
-
-
- Purpose
- Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object
-
-
- Example of usage
- // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
+
+
+
+
+
+ Prototype
+ bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );
+
+
+ Purpose
+ Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object
+
+
+ Example of usage
+ // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
var returnVal = TriggerEvent( 8000, "onUseChecked", pUser, iUsed );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- TriggerTrap( pChar/pSock, iTrap );
-
-
- Purpose
- pChar/pSock triggers trap on iTrap object (if any trap is present on object)
-
-
- Notes
- Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.
-
-
- Example of usage
- // Setup trap on iTrap object
+
+
+
+
+
+ Prototype
+ TriggerTrap( pChar/pSock, iTrap );
+
+
+ Purpose
+ pChar/pSock triggers trap on iTrap object (if any trap is present on object)
+
+
+ Notes
+ Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.
+
+
+ Example of usage
+ // Setup trap on iTrap object
// First part of value (01) indicates object is trapped
// Second part of value (32) defines damage dealt (32 = 0x32 = 50 damage)
// Third (00) and Fourth (00) parts, unused here, normally indicate the min/max skill required to disarm trap
@@ -6939,148 +6902,148 @@ January 9th, 2022
// Trigger the trap
TriggerTrap( pChar, iTrap );
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- void UseItem( pSock/mChar, iToUse );
-
-
- Purpose
- To allow characters (and NPCs in particular) to trigger item-use functionality of items
-
-
- Notes
- Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.
-
-
- Example of usage
- // If an item has type 12, make NPC use the door to open it
+
+
+
+
+
+ Prototype
+ void UseItem( pSock/mChar, iToUse );
+
+
+ Purpose
+ To allow characters (and NPCs in particular) to trigger item-use functionality of items
+
+
+ Notes
+ Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.
+
+
+ Example of usage
+ // If an item has type 12, make NPC use the door to open it
if( myItem.type == 12 )
{
mChar.TextMessage( "A door! What's on the other side?" );
UseItem( mChar, iToUse );
}
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- bool ValidateObject( object );
-
-
- Purpose
- Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)
-
-
- Notes
- Cannot be used to validate sockets
-
-
- Example of usage
- if( !ValidateObject( iUsed ))
+
+
+
+
+
+ Prototype
+ bool ValidateObject( object );
+
+
+ Purpose
+ Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)
+
+
+ Notes
+ Cannot be used to validate sockets
+
+
+ Example of usage
+ if( !ValidateObject( iUsed ))
return;
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- [int] WorldBrightLevel( [lightlevel] );
-
-
- Purpose
- Get/Set the "maximum brightness" light-level for daytime across the entire world
-
-
- Notes
- If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.
-
-
- Example of usage
- // Set maximum world brightness level to 1
+
+
+
+
+
+ Prototype
+ [int] WorldBrightLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the "maximum brightness" light-level for daytime across the entire world
+
+
+ Notes
+ If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.
+
+
+ Example of usage
+ // Set maximum world brightness level to 1
WorldBrightLevel( 1 );
// Get current maximum world brightness level
var lightLevel = WorldBrightLevel();
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- [int] WorldDarkLevel( [lightlevel] );
-
-
- Purpose
- Get/Set the "minimum brightness" light-level for night-time across the entire world
-
-
- Notes
- If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.
-
-
- Example of usage
- // Set minimum world brightness level to 15
+
+
+
+
+
+ Prototype
+ [int] WorldDarkLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the "minimum brightness" light-level for night-time across the entire world
+
+
+ Notes
+ If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.
+
+
+ Example of usage
+ // Set minimum world brightness level to 15
WorldDarkLevel( 15 );
// Get current maximum world brightness level
var lightLevel = WorldDarkLevel();
-
-
-
+
+
+
-
-
-
-
-
- Prototype
- [int] WorldDungeonLevel( [lightlevel] );
-
-
- Purpose
- Get/Set the fixed light-level for any regions marked as dungeons
-
-
- Notes
- If no parameter is provided, function will return current fixed light-level for dungeons instead.
-
-
- Example of usage
- // Set fixed dungeon light level to 12
+
+
+
+
+
+ Prototype
+ [int] WorldDungeonLevel( [lightlevel] );
+
+
+ Purpose
+ Get/Set the fixed light-level for any regions marked as dungeons
+
+
+ Notes
+ If no parameter is provided, function will return current fixed light-level for dungeons instead.
+
+
+ Example of usage
+ // Set fixed dungeon light level to 12
WorldDungeonLevel( 12 );
// Get current fixed light level of dungeons
var lightLevel = WorldDungeonLevel();
-
-
-
+
+
+
-
+
From 3058c01a30242c7037714dbece1baf094ab1d6c6 Mon Sep 17 00:00:00 2001
From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
Date: Mon, 27 Jan 2025 21:29:31 -0600
Subject: [PATCH 17/19] Update jsdocs.html
---
docs/jsdocs.html | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/docs/jsdocs.html b/docs/jsdocs.html
index 17aff972f..5cb3e2c3b 100644
--- a/docs/jsdocs.html
+++ b/docs/jsdocs.html
@@ -5564,6 +5564,35 @@ January 9th, 2022
Prototype
+JSBool CheckInstaLog( x, y, world, instanceID );
+Purpose
+Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.
+Example of usage
+// Check if the player is in an instant logout zone
+var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
+
+if( isInstaLog )
+{
+ // Handle instant logout
+}
+else
+{
+ // Handle other logout scenarios
+}
+