### Multiple Package Updates Example Source: https://github.com/drake53/war3net/blob/master/VERSION_UPDATE_GUIDE.md Example of updating multiple packages, 'War3Net.Common' with 'feature' and 'War3Net.IO.Mpq' with 'fix'. ```bash ./tools/update-versions.sh "War3Net.Common:feature,War3Net.IO.Mpq:fix" ``` -------------------------------- ### CameraSetupApplyForPlayer Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Applies a camera setup object for a specific player over a specified duration. ```APIDOC ## CameraSetupApplyForPlayer ### Description Applies a camera setup object for a specific player over a specified duration. ### Method (Not specified, likely a function call in a scripting language) ### Parameters - **cameraapplyoption** (CameraApply or CameraClear) - The apply method. - **camerasetup** (CameraSetup) - The camera setup object to apply. - **player** (Player) - The player for whom to apply the camera setup. - **real** (real) - The time in seconds over which to apply the camera setup. ### Request Example (Not applicable for scripting functions) ### Response (Not specified, likely void or a boolean indicating success) ``` -------------------------------- ### Single Package Update Example Source: https://github.com/drake53/war3net/blob/master/VERSION_UPDATE_GUIDE.md Example of updating a single package, 'War3Net.Common', with a 'feature' change type. ```bash ./tools/update-versions.sh "War3Net.Common:feature" ``` -------------------------------- ### Breaking Change Example Source: https://github.com/drake53/war3net/blob/master/VERSION_UPDATE_GUIDE.md Example of performing a 'breaking' change on the 'War3Net.Build.Core' package, resulting in a major version bump. ```bash ./tools/update-versions.sh "War3Net.Build.Core:breaking" ``` -------------------------------- ### GetCurrentCameraSetup Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves the current camera setup configuration. This can be used to get the current view parameters of the game. ```APIDOC ## GetCurrentCameraSetup ### Description Retrieves the current camera setup configuration. ### Method N/A (Function Call) ### Parameters None ### Returns camerasetup - The current camera setup. ``` -------------------------------- ### CameraSetupApplyForPlayerSmooth Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Applies a camera setup object for a specific player with smooth transitions over a specified duration. ```APIDOC ## CameraSetupApplyForPlayerSmooth ### Description Applies a camera setup object for a specific player with smooth transitions over a specified duration, including ease-in, ease-out times, and a smooth factor. ### Method (Not specified, likely a function call in a scripting language) ### Parameters - **cameraapplyoption** (CameraApply or CameraClear) - The apply method. - **camerasetup** (CameraSetup) - The camera setup object to apply. - **player** (Player) - The player for whom to apply the camera setup. - **real** (real) - The time in seconds over which to apply the camera setup. - **real** (real) - The ease-in time in seconds. - **real** (real) - The ease-out time in seconds. - **real** (real) - The smooth factor. ### Request Example (Not applicable for scripting functions) ### Response (Not specified, likely void or a boolean indicating success) ``` -------------------------------- ### BlzCameraSetupGetLabel Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Retrieves the string label associated with a camera setup object. ```APIDOC ## BlzCameraSetupGetLabel ### Description Retrieves the label assigned to a camera setup object. ### Method N/A (Script Function) ### Parameters - **Camera Object** (camerasetup) - Required - The camera setup object from which to get the label. ### Request Example ``` local label = BlzCameraSetupGetLabel(bj_CAMைகளைக்_DEFAULT) ``` ### Response - **Return Value** (string) - The label of the camera setup object. ### Response Example ``` "Default Camera" ``` ``` -------------------------------- ### BlzCameraSetupSetLabel Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Assigns a string label to a camera setup object. ```APIDOC ## BlzCameraSetupSetLabel ### Description Assigns a descriptive label to a camera setup object. ### Method N/A (Script Function) ### Parameters - **Camera Object** (camerasetup) - Required - The camera setup object to label. - **Value** (string) - Required - The label to assign to the camera setup. ### Request Example ``` BlzCameraSetupSetLabel(bj_CAMைகளைக்_DEFAULT, "Default Camera") ``` ### Response N/A (void function) ``` -------------------------------- ### CameraSetupGetDestPositionLoc Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves the destination location of a camera setup object. This is useful for determining where a camera is aimed. ```APIDOC ## CameraSetupGetDestPositionLoc ### Description Retrieves the destination location of a camera setup object. This is useful for determining where a camera is aimed. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **location**: The destination location of the camera setup. #### Response Example N/A ``` -------------------------------- ### Decompile Preplaced Units and Items Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis.Decompilers/README.md Decompiles preplaced units from a Warcraft III map. This example focuses on extracting unit data, including their positions. ```csharp using War3Net.Build; using War3Net.Build.Widget; using War3Net.CodeAnalysis.Decompilers; var map = Map.Open("path/to/map.w3x"); var decompiler = new JassScriptDecompiler(map); if (decompiler.TryDecompileMapUnits( MapWidgetsFormatVersion.V8, MapWidgetsSubVersion.V11, useNewFormat: false, out var units)) { foreach (var unit in units.Units) { Console.WriteLine($"Unit at ({unit.Position.X}, {unit.Position.Y})"); } } ``` -------------------------------- ### BlzStartUnitAbilityCooldown Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Starts or sets the cooldown duration for a specific ability on a unit. ```APIDOC ## BlzStartUnitAbilityCooldown ### Description Starts or sets the cooldown duration for a specific ability on a unit. ### Method Native (Blz) ### Parameters - **unit** (unit) - The unit that has the ability. - **abilcode** (abilcode) - The ability code of the ability. - **real** (real) - The duration in seconds for the cooldown. ### Defaults - **unit**: _ (not specified) - **abilcode**: _ (not specified) ### Category TC_UNIT ``` -------------------------------- ### CameraSetupGetFieldSwap Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves a specific camera field value from a camera setup object. ```APIDOC ## CameraSetupGetFieldSwap ### Description Retrieves a specific camera field value from a camera setup object. ### Method N/A (Function Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Camera Field** (camerafield) - The camera field to retrieve. - **Camera Object** (camerasetup) - The camera setup object. ### Response #### Success Response - **real** - The value of the specified camera field. ``` -------------------------------- ### Create New MPQ Archive in C# Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Mpq/README.md Shows how to create a new MPQ archive with specified files and custom creation options, including block size and hash table size. ```csharp using War3Net.IO.Mpq; // Create files to add to the archive var file1 = MpqFile.New(File.OpenRead("script.j"), "war3map.j"); var file2 = MpqFile.New(new MemoryStream(data), "war3map.w3i"); // Configure archive options var options = new MpqArchiveCreateOptions { BlockSize = 3, HashTableSize = 16, ListFileCreateMode = MpqFileCreateMode.Overwrite, AttributesCreateMode = MpqFileCreateMode.Overwrite, }; // Create the archive using var archive = MpqArchive.Create( "output.mpq", new[] { file1, file2 }, options); ``` -------------------------------- ### Set File Compression and Encryption in C# Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Mpq/README.md Shows how to configure a file within an MPQ archive to use specific compression types and set flags for compression and encryption. ```csharp using War3Net.IO.Mpq; var file = MpqFile.New(stream, "encrypted.dat"); // Set compression type file.CompressionType = MpqCompressionType.ZLib; // Set target flags for compression and encryption file.TargetFlags = MpqFileFlags.Exists | MpqFileFlags.CompressedMulti | MpqFileFlags.Encrypted; ``` -------------------------------- ### Create and serialize an SLK table Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Slk/README.md Illustrates how to create a new SylkTable in memory, populate it with data including headers, and then serialize it to an SLK file stream. ```csharp using War3Net.IO.Slk; // Create a new table with dimensions var table = new SylkTable(3, 4); // 3 columns, 4 rows // Set header row table[0, 0] = "ID"; table[1, 0] = "Name"; table[2, 0] = "Value"; // Set data rows table[0, 1] = "A001"; table[1, 1] = "First Item"; table[2, 1] = 100; // Serialize to a stream using var output = File.Create("output.slk"); new SylkSerializer(table).SerializeTo(output, leaveOpen: false); ``` -------------------------------- ### Read Files from MPQ Archive in C# Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Mpq/README.md Demonstrates how to open an existing MPQ archive, check for file existence, and read a specific file's content using a stream. ```csharp using War3Net.IO.Mpq; // Open an existing archive using var archive = MpqArchive.Open("path/to/archive.mpq", loadListFile: true); // Check if a file exists if (archive.FileExists("war3map.w3i")) { // Open and read a file using var stream = archive.OpenFile("war3map.w3i"); // Process the stream... } ``` -------------------------------- ### Basic Script Usage Source: https://github.com/drake53/war3net/blob/master/VERSION_UPDATE_GUIDE.md The script automates version updates for packages in `Directory.Packages.props`. Specify packages and their change types (breaking, feature, fix) as arguments. ```bash ./tools/update-versions.sh "package1:change_type,package2:change_type,..." [--skip-nuget-check] ``` -------------------------------- ### Build a Separated Syntax List Manually Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis/README.md Demonstrates how to incrementally build an immutable SeparatedSyntaxList using its builder. Add items and their preceding separators. ```csharp using War3Net.CodeAnalysis; // Create a builder with the first item var builder = SeparatedSyntaxList.CreateBuilder("first"); // Add more items with separators builder.Add(',', "second"); builder.Add(',', "third"); // Build the immutable list SeparatedSyntaxList list = builder.ToSeparatedSyntaxList(); ``` -------------------------------- ### GetUnitName Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves the name of a unit. This function can be used to get the display name of any unit in the game. ```APIDOC ## GetUnitName ### Description Retrieves the name of a unit. This function can be used to get the display name of any unit in the game. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **string**: The name of the unit. #### Response Example N/A ``` -------------------------------- ### MultiboardGetTitleText Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves the title text of a multiboard. This function is used to get the current title displayed on a multiboard widget. ```APIDOC ## MultiboardGetTitleText ### Description Retrieves the title text of a multiboard. This function is used to get the current title displayed on a multiboard widget. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **string**: The title text of the multiboard. #### Response Example N/A ``` -------------------------------- ### Open and Read a Warcraft III Map Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/README.md Opens a Warcraft III map file and accesses its metadata and unit information. Ensure the War3Net.Build namespace is included. ```csharp using War3Net.Build; // Open a map file var map = Map.Open("path/to/map.w3x"); // Access map metadata string mapName = map.Info?.MapName; int playerCount = map.Info?.Players.Count ?? 0; // Access placed units var units = map.Units?.Units; foreach (var unit in units ?? []) { Console.WriteLine($"Unit {unit.TypeId} at ({unit.Position.X}, {unit.Position.Y})"); } ``` -------------------------------- ### Combine two SLK tables Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Slk/README.md Demonstrates how to combine two SLK tables based on matching values in specified columns. Requires streams for both tables to be parsed first. ```csharp using War3Net.IO.Slk; var unitsTable = new SylkParser().Parse(unitsStream); var abilitiesTable = new SylkParser().Parse(abilitiesStream); // Join tables on matching column values var combined = unitsTable.Combine( abilitiesTable, thisColumn: "unitId", otherColumn: "abilityUnit"); ``` -------------------------------- ### Open and Read a Warcraft III Campaign Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/README.md Opens a Warcraft III campaign file and accesses its metadata. Uses Campaign.Open with CampaignFiles flags for component loading. ```csharp using War3Net.Build; // Open a campaign file var campaign = Campaign.Open("path/to/campaign.w3n", CampaignFiles.All); // Access campaign metadata string campaignName = campaign.Info?.CampaignName; var maps = campaign.Info?.MapButtons; ``` -------------------------------- ### Read Individual Map Files with Extension Methods Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/README.md Reads a specific map file (e.g., war3map.w3e) directly using extension methods provided by War3Net.Build.Extensions. Requires System.IO. ```csharp using System.IO; using War3Net.Build.Extensions; // Read a specific map file directly using var stream = File.OpenRead("war3map.w3e"); using var reader = new BinaryReader(stream); var environment = reader.ReadMapEnvironment(); Console.WriteLine($"Map size: {environment.Width}x{environment.Height}"); ``` -------------------------------- ### Compress Data with ZLib Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Compression/README.md Compresses a stream of data using the ZLib (DEFLATE) algorithm. Ensure the input stream is readable and the output stream is writable. The 'leaveOpen' parameter controls whether the input stream remains open after compression. ```csharp using War3Net.IO.Compression; // Compress a stream using var inputStream = File.OpenRead("input.dat"); using var compressedStream = ZLibCompression.Compress(inputStream, (int)inputStream.Length, leaveOpen: false); // Write compressed data to file using var outputStream = File.Create("output.dat"); compressedStream.Position = 0; compressedStream.CopyTo(outputStream); ``` -------------------------------- ### Read Binary Data with Extension Methods Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Common/README.md Utilizes extension methods on BinaryReader to efficiently read Warcraft III-specific data types from a stream, including strings, booleans, colors, and enums. ```csharp using System.IO; using War3Net.Common.Extensions; using var reader = new BinaryReader(stream); // Read a null-terminated UTF-8 string string name = reader.ReadChars(); // Read a fixed-length string string fixedString = reader.ReadString(32); // Read a 32-bit boolean (0 or 1) bool enabled = reader.ReadBool(); // Read color values Color rgbaColor = reader.ReadColorRgba(); Color bgraColor = reader.ReadColorBgra(); // Read typed enum values MyEnum value = reader.ReadInt32(); ``` -------------------------------- ### Ability Tooltip Functions Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Functions to set the learn tooltip and extended learn tooltip for abilities. ```APIDOC ## BlzSetAbilityResearchTooltip ### Description Sets the learn tooltip for a specific ability level. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityResearchExtendedTooltip ### Description Sets the extended learn tooltip for a specific ability level. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Modify Existing MPQ Archive in C# Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Mpq/README.md Illustrates how to modify an existing MPQ archive by adding new files, removing existing ones, and saving the changes using MpqArchiveBuilder. ```csharp using War3Net.IO.Mpq; // Open the original archive using var archive = MpqArchive.Open("map.w3x", loadListFile: true); // Create a builder from the archive var builder = new MpqArchiveBuilder(archive); // Add a new file var newFile = MpqFile.New(new MemoryStream(newData), "newfile.txt"); builder.AddFile(newFile); // Remove an existing file builder.RemoveFile("oldfile.txt"); // Save the modified archive builder.SaveTo("modified.w3x"); ``` -------------------------------- ### LoadGameBJ Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Loads a saved game state from a file. ```APIDOC ## LoadGameBJ ### Description Loads a saved game state from a file. ### Method POST ### Endpoint /game/load ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **Filename** (AnyFile) - The name of the file to load the game from. - **Show/Skip Scores** (UseSkipOption) - Whether to show or skip scores upon loading. ### Request Example ```json { "Filename": "MySave.w3z", "Show/Skip Scores": "UseSkipOptionSkip" } ``` ### Response #### Success Response (200) - None (This is a command, not a query) #### Response Example ```json null ``` ``` -------------------------------- ### Load Specific Map Components Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/README.md Loads only the necessary components of a Warcraft III map file to improve performance. Uses the MapFiles enum for component selection. ```csharp using War3Net.Build; // Load only the components you need for better performance var map = Map.Open("path/to/map.w3x", MapFiles.Info | MapFiles.Units | MapFiles.Doodads); ``` -------------------------------- ### BlzSetAbilityTooltip Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Sets the standard tooltip text for a specific level of an ability. ```APIDOC ## BlzSetAbilityTooltip ### Description Sets the standard tooltip text for a specific level of an ability. ### Method Native (Blz) ### Parameters - **abilcode** (abilcode) - The ability code. - **string** (string) - The tooltip text. - **integer** (integer) - The level of the ability. ### Defaults - **abilcode**: _ (not specified) - **string**: _ (not specified) - **integer**: 0 ### Limits - **integer**: 0 and above ### Category TC_ABILITY ``` -------------------------------- ### Item Property Functions Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Functions to set the name, tooltip, description, and extended tooltip for items. ```APIDOC ## BlzSetItemName ### Description Sets the name of an item. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetItemTooltip ### Description Sets the tooltip for an item. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetItemDescription ### Description Sets the description for an item. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetItemExtendedTooltip ### Description Sets the extended tooltip for an item. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### CameraSetEQNoiseForPlayer Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Applies a shaking effect to the camera for a specific player. ```APIDOC ## CameraSetEQNoiseForPlayer ### Description Applies a shaking effect to the camera for a specified player. ### Method N/A (Script Function) ### Parameters - **Player** (player) - Required - The player whose camera will be affected. - **Magnitude** (real) - Required - The intensity of the shake. ### Request Example ``` CameraSetEQNoiseForPlayer(Player(2), 5.0) ``` ### Response N/A (void function) ``` -------------------------------- ### Parse an SLK file Source: https://github.com/drake53/war3net/blob/master/src/War3Net.IO.Slk/README.md Demonstrates how to parse an SLK file from a stream into a SylkTable object. Requires the War3Net.IO.Slk namespace. ```csharp using War3Net.IO.Slk; // Parse an SLK file from a stream using var stream = File.OpenRead("UnitUI.slk"); var table = new SylkParser().Parse(stream); // Access table dimensions Console.WriteLine($"Columns: {table.Columns}, Rows: {table.Rows}"); ``` -------------------------------- ### SetCameraQuickPositionLocForPlayer Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Sets a 'spacebar-point' for a specific player, which is often used for quick camera positioning. ```APIDOC ## SetCameraQuickPositionLocForPlayer ### Description Establishes a quick camera position point for a player, typically used for the spacebar functionality. ### Method N/A (Script Function) ### Parameters - **Player** (player) - Required - The player for whom the spacebar-point is set. - **Point** (location) - Required - The location to set as the spacebar-point. ### Request Example ``` SetCameraQuickPositionLocForPlayer(Player(2), GetUnitLoc(GetTriggerUnit())) ``` ### Response N/A (void function) ``` -------------------------------- ### BlzSetAbilityActivatedTooltip Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Sets the tooltip text for when an ability is auto-cast activated, for a specific level. ```APIDOC ## BlzSetAbilityActivatedTooltip ### Description Sets the tooltip text for when an ability is auto-cast activated, for a specific level. ### Method Native (Blz) ### Parameters - **abilcode** (abilcode) - The ability code. - **string** (string) - The tooltip text. - **integer** (integer) - The level of the ability. ### Defaults - **abilcode**: _ (not specified) - **string**: _ (not specified) - **integer**: 0 ### Limits - **integer**: 0 and above ### Category TC_ABILITY ``` -------------------------------- ### Read BLP File and Extract Pixel Data Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Drawing.Blp/README.md Opens a BLP file and extracts pixel data in BGRA format for the first mipmap level. Requires the file path. ```csharp using War3Net.Drawing.Blp; // Open and read the BLP file using var stream = File.OpenRead("texture.blp"); using var blpFile = new BlpFile(stream); // Get image dimensions int width = blpFile.Width; int height = blpFile.Height; // Extract pixel data (BGRA format by default) byte[] pixels = blpFile.GetPixels(mipMapLevel: 0, out int w, out int h); ``` -------------------------------- ### Ability Functions Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Functions for retrieving information about abilities, including effects, sounds, tooltips, and icons. ```APIDOC ## GetAbilityEffectBJ ### Description Retrieves the art path for a specific ability effect. ### Parameters - **abilcode** (abilcode) - The ability code. - **effecttype** (effecttype) - The type of effect. - **integer** (integer) - The index of the effect. ### Returns string - The art path of the ability effect. ``` ```APIDOC ## GetAbilitySoundBJ ### Description Retrieves the sound name for a specific ability sound effect. ### Parameters - **abilcode** (abilcode) - The ability code. - **soundtype** (soundtype) - The type of sound. ### Returns string - The name of the ability sound. ``` ```APIDOC ## BlzGetAbilityTooltip ### Description Retrieves the tooltip for a specific level of an ability. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityActivatedTooltip ### Description Retrieves the tooltip for the auto-casting activated state of an ability at a specific level. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The auto-casting activated tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityExtendedTooltip ### Description Retrieves the extended tooltip for a specific level of an ability. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The extended tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityActivatedExtendedTooltip ### Description Retrieves the extended tooltip for the auto-casting activated state of an ability at a specific level. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The extended auto-casting activated tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityResearchTooltip ### Description Retrieves the tooltip for learning a specific level of an ability. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The research tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityResearchExtendedTooltip ### Description Retrieves the extended tooltip for learning a specific level of an ability. ### Parameters - **abilcode** (abilcode) - The ability code. - **integer** (integer) - The level of the ability. ### Returns string - The extended research tooltip of the ability. ``` ```APIDOC ## BlzGetAbilityIcon ### Description Retrieves the icon file path for an ability. ### Parameters - **abilcode** (abilcode) - The ability code. ### Returns imagefile - The icon file path of the ability. ``` ```APIDOC ## BlzGetAbilityActivatedIcon ### Description Retrieves the icon file path for the auto-casting activated state of an ability. ### Parameters - **abilcode** (abilcode) - The ability code. ### Returns imagefile - The icon file path of the auto-casting activated ability. ``` -------------------------------- ### Ability Icon and Position Functions Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Functions to set the icon and position (X/Y) for abilities, including activated states. ```APIDOC ## BlzSetAbilityIcon ### Description Sets the icon for an ability. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityActivatedIcon ### Description Sets the icon for an ability when it is in an auto-casting activated state. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityPosX ### Description Sets the X-coordinate for an ability's position. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityActivatedPosX ### Description Sets the X-coordinate for an ability's position when it is in an auto-casting activated state. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityPosY ### Description Sets the Y-coordinate for an ability's position. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ## BlzSetAbilityActivatedPosY ### Description Sets the Y-coordinate for an ability's position when it is in an auto-casting activated state. ### Method Not applicable (Scripting Function) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Convert Rawcodes to Integers and Vice Versa Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Common/README.md Converts 4-character rawcode strings to their 32-bit integer representation and vice versa. Useful for identifying Warcraft III objects. ```csharp using War3Net.Common.Extensions; // Convert a rawcode string to integer int unitId = "hpea".FromRawcode(); // Human Peasant // Convert an integer back to rawcode string string rawcode = unitId.ToRawcode(); // "hpea" ``` -------------------------------- ### Transpile JASS to Lua with Configuration Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis.Transpilers/README.md Transpiles JASS source code to Lua, with options to ignore comments and empty declarations, and keep functions separated. It also demonstrates registering type information from JASS files before transpilation. ```csharp using CSharpLua; using War3Net.CodeAnalysis.Jass; using War3Net.CodeAnalysis.Transpilers; // Parse JASS source code string jassCode = File.ReadAllText("war3map.j"); var compilationUnit = JassSyntaxFactory.ParseCompilationUnit(jassCode); // Configure and use the transpiler var transpiler = new JassToLuaTranspiler { IgnoreComments = false, IgnoreEmptyDeclarations = true, KeepFunctionsSeparated = true, }; // Register type information from native/common.j files transpiler.RegisterJassFile(commonJCompilationUnit); transpiler.RegisterJassFile(blizzardJCompilationUnit); // Transpile to Lua var luaCompilationUnit = transpiler.Transpile(compilationUnit); // Render to file using var fileStream = File.Create("war3map.lua"); using var writer = new StreamWriter(fileStream); var rendererSettings = new LuaSyntaxGenerator.SettingInfo { Indent = 4 }; var renderer = new LuaRenderer(rendererSettings, writer); renderer.RenderCompilationUnit(luaCompilationUnit); ``` -------------------------------- ### Use UTF-8 Encoding Without BOM Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Common/README.md Provides pre-configured UTF-8 encoding instances, including a lenient version that does not throw errors on invalid bytes and a strict version that does. ```csharp using War3Net.Common.Providers; // Lenient encoding (does not throw on invalid bytes) Encoding utf8 = UTF8EncodingProvider.UTF8; // Strict encoding (throws on invalid bytes) Encoding strictUtf8 = UTF8EncodingProvider.StrictUTF8; ``` -------------------------------- ### SaveGame Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Saves the current game state to a file. ```APIDOC ## SaveGame ### Description Saves the current game state to a file. ### Method POST ### Endpoint /game/save ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **Filename** (AnyFile) - The name of the file to save the game to. ### Request Example ```json { "Filename": "MySave.w3z" } ``` ### Response #### Success Response (200) - None (This is a command, not a query) #### Response Example ```json null ``` ``` -------------------------------- ### SetNextLevelBJ Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Sets the path to the next level to be loaded. ```APIDOC ## SetNextLevelBJ ### Description Sets the path to the next level to be loaded. ### Method POST ### Endpoint /game/nextlevel ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **Level** (String) - The file path to the next level. ### Request Example ```json { "Level": "Maps\MyMap\MyLevel.w3m" } ``` ### Response #### Success Response (200) - None (This is a command, not a query) #### Response Example ```json null ``` ``` -------------------------------- ### Skipping NuGet Check Source: https://github.com/drake53/war3net/blob/master/VERSION_UPDATE_GUIDE.md Use the `--skip-nuget-check` flag to bypass queries to NuGet.org. This is useful for offline scenarios but risks assigning already-published versions. ```bash ./tools/update-versions.sh "package1:change_type" --skip-nuget-check ``` -------------------------------- ### GetResourceAmount Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Retrieves the amount of resources (e.g., gold) remaining in a neutral building. ```APIDOC ## GetResourceAmount ### Description Retrieves the amount of resources (e.g., gold) remaining in a neutral building. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **Return Value** (integer) - The amount of resources remaining. #### Response Example N/A ``` -------------------------------- ### Ability Functions Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Functions to retrieve mana cost and other integer fields for abilities. ```APIDOC ## BlzGetAbilityManaCost ### Description Retrieves the mana cost of an ability for a specific level. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **manaCost** (integer) - The mana cost of the ability at the specified level. #### Response Example N/A ## BlzGetAbilityIntegerField ### Description Retrieves a specific integer field value from an ability. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **fieldValue** (integer) - The value of the specified integer field for the ability. #### Response Example N/A ## BlzGetAbilityIntegerLevelField ### Description Retrieves a specific integer level field value from an ability for a given level. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **fieldValue** (integer) - The value of the specified integer level field for the ability at the given level. #### Response Example N/A ## BlzGetAbilityIntegerLevelArrayField ### Description Retrieves a specific integer level array field value from an ability for a given level and index. ### Method N/A (Scripting Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **fieldValue** (integer) - The value of the specified integer level array field for the ability at the given level and index. #### Response Example N/A ``` -------------------------------- ### SaveGameCheckPoint/SaveGameCheckPointBJ Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Creates a checkpoint save for the current game state. ```APIDOC ## SaveGameCheckPoint/SaveGameCheckPointBJ ### Description Creates a checkpoint save for the current game state. ### Method POST ### Endpoint - /game/checkpoint/create - /game/checkpoint/create/bj ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **Filename** (AnyFile) - The name of the checkpoint file. - **Show/Hide Message** (ShowHideOption/Boolean) - Whether to show or hide the checkpoint message. ### Request Example ```json { "Filename": "MyCheckpoint.w3z", "Show/Hide Message": "ShowHideShow" } ``` ### Response #### Success Response (200) - None (This is a command, not a query) #### Response Example ```json null ``` ``` -------------------------------- ### SetUnitPositionLocFacingBJ Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Moves a unit to a specified location and instantly faces a given direction. This is a convenient BJ (Blizzard JASS) function for unit positioning. ```APIDOC ## SetUnitPositionLocFacingBJ ### Description Moves a unit to a specified location and instantly faces a given direction. ### Method Native (BJ) ### Parameters - **unit** (unit) - The unit to move. - **location** (location) - The destination location. - **real** (real) - The direction in degrees the unit should face. ### Defaults - **unit**: GetTriggerUnit - **location**: GetRectCenter - **real**: RealUnitFacing ### Category TC_UNIT ``` -------------------------------- ### Unit and Hero Functions Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Functions for retrieving information about units and heroes. ```APIDOC ## GetHeroProperName ### Description Retrieves the proper name of a hero unit. ### Parameters - **unit** (unit) - The hero unit. ### Returns string - The proper name of the hero. ``` -------------------------------- ### Decompile Map Regions and Cameras Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis.Decompilers/README.md Extracts region and camera data from a Warcraft III map. This snippet demonstrates decompiling both regions and cameras sequentially. ```csharp using War3Net.Build; using War3Net.Build.Environment; using War3Net.CodeAnalysis.Decompilers; var map = Map.Open("path/to/map.w3x"); var decompiler = new JassScriptDecompiler(map); // Decompile regions if (decompiler.TryDecompileMapRegions(MapRegionsFormatVersion.V5, out var regions)) { foreach (var region in regions.Regions) { Console.WriteLine($"Region: {region.Name} at ({region.CenterX}, {region.CenterY})"); } } // Decompile cameras if (decompiler.TryDecompileMapCameras(MapCamerasFormatVersion.V0, useNewFormat: false, out var cameras)) { foreach (var camera in cameras.Cameras) { Console.WriteLine($"Camera: {camera.Name}, Distance: {camera.TargetDistance}"); } } ``` -------------------------------- ### Transpile JASS to C# Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis.Transpilers/README.md Parses JASS source code and transpiles it into C# syntax trees using Roslyn. This is useful for converting JASS scripts into a more modern C# format. ```csharp using Microsoft.CodeAnalysis.CSharp.Syntax; using War3Net.CodeAnalysis.Jass; using War3Net.CodeAnalysis.Transpilers; // Parse JASS source code string jassCode = File.ReadAllText("common.j"); var compilationUnit = JassSyntaxFactory.ParseCompilationUnit(jassCode); // Transpile to C# var transpiler = new JassToCSharpTranspiler(); IEnumerable members = transpiler.Transpile(compilationUnit); ``` -------------------------------- ### Decompile Map Sounds from a Map Source: https://github.com/drake53/war3net/blob/master/src/War3Net.CodeAnalysis.Decompilers/README.md Loads a map and decompiles its sound definitions using JassScriptDecompiler. Requires War3Net.Build and War3Net.CodeAnalysis.Decompilers. ```csharp using War3Net.Build; using War3Net.Build.Audio; using War3Net.CodeAnalysis.Decompilers; // Load a map with its script var map = Map.Open("path/to/map.w3x"); // Create the decompiler var decompiler = new JassScriptDecompiler(map); // Decompile sounds if (decompiler.TryDecompileMapSounds(MapSoundsFormatVersion.V3, out var sounds)) { foreach (var sound in sounds.Sounds) { Console.WriteLine($"Sound: {sound.Name}, File: {sound.FilePath}"); } } ``` -------------------------------- ### GetStoredIntegerBJ Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Loads an integer value from a game cache using a specified label and category. ```APIDOC ## GetStoredIntegerBJ ### Description Loads an integer value from a game cache using a specified label and category. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **Return Value** (integer) - The stored integer value. #### Response Example N/A ``` -------------------------------- ### Generate Lua Map Script for CSharpLua Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build/README.md Configure MapScriptBuilder with CSharpLua options, such as lobby music, to generate a Lua-compatible JASS script. ```csharp using War3Net.Build; var map = Map.Open("path/to/map.w3x"); var scriptBuilder = new MapScriptBuilder(); scriptBuilder.SetDefaultOptionsForCSharpLua(lobbyMusic: "Sound\Music\mp3Music\War3IntroX.mp3"); string jassScript = scriptBuilder.Build(map); ``` -------------------------------- ### BlzSetAbilityExtendedTooltip Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Sets the extended tooltip text for a specific level of an ability. ```APIDOC ## BlzSetAbilityExtendedTooltip ### Description Sets the extended tooltip text for a specific level of an ability. ### Method Native (Blz) ### Parameters - **abilcode** (abilcode) - The ability code. - **string** (string) - The extended tooltip text. - **integer** (integer) - The level of the ability. ### Defaults - **abilcode**: _ (not specified) - **string**: _ (not specified) - **integer**: 0 ### Limits - **integer**: 0 and above ### Category TC_ABILITY ``` -------------------------------- ### PingMinimapLocForForce Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Pings the minimap for a specified player group at a given location for a set duration. ```APIDOC ## PingMinimapLocForForce ### Description Pings the minimap for a specified player group at a given location for a set duration. ### Parameters - **force** (force) - Required - The player group to ping the minimap for. - **location** (location) - Required - The location to ping on the minimap. - **duration** (real) - Required - The duration of the ping in seconds. ``` -------------------------------- ### FogModifierStart Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/Resources/TriggerData.txt Enables a previously created visibility modifier, making its effects active. ```APIDOC ## FogModifierStart ### Description Enables a visibility modifier, activating its effects. ### Parameters - **fogmodifier** (fogmodifier) - Required - The visibility modifier to enable. ``` -------------------------------- ### Game Cache Functions Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Functions for interacting with game caches to store and retrieve string values. ```APIDOC ## GetStoredStringBJ ### Description Retrieves a stored string value from a game cache based on a label and category. ### Parameters - **string** (string) - The label for the string. - **string** (string) - The category for the string. - **gamecache** (gamecache) - The game cache to retrieve from. ### Returns string - The stored string value. ``` -------------------------------- ### PlayDialogueFromSpeakerEx Source: https://github.com/drake53/war3net/blob/master/tests/War3Net.TestTools.UnitTesting/TestData/Script/TriggerData/triggerdata_1_32_9.txt Plays dialogue from a specified speaker, with options for controlling playback and timing. ```APIDOC ## PlayDialogueFromSpeakerEx ### Description Plays dialogue for a group of players from a specific unit, with customizable playback options. ### Method N/A (Script Function) ### Parameters - **Player Group** (force) - Required - The group of players who will hear the dialogue. - **Unit** (unit) - Required - The unit that will speak the dialogue. - **Unit-Type** (unitcode) - Required - The unit type associated with the dialogue. - **Sound** (sound) - Required - The sound file to play. - **Method** (addsettooption) - Required - Method for modifying duration (e.g., AddSetToAdd). - **Time** (real) - Required - The duration in seconds to modify. - **Wait/Don't Wait** (waitdontoption) - Required - Whether to wait for the dialogue to finish (Wait) or continue immediately (DontWait). ### Request Example ``` PlayDialogueFromSpeakerEx(Player(0), GetTriggerUnit(), 'hfoo', "Sounds\Dialogue\Human\Human01.wav", AddSetToAdd, 5.0, WaitDontWait) ``` ### Response N/A (void function) ``` -------------------------------- ### Modify and Save a Warcraft III Map Source: https://github.com/drake53/war3net/blob/master/src/War3Net.Build.Core/README.md Opens an existing map, modifies its properties using the MapInfo class, and saves the changes using MapBuilder. Requires the War3Net.Build namespace. ```csharp using War3Net.Build; // Open an existing map var map = Map.Open("path/to/map.w3x"); // Modify map properties if (map.Info is not null) { map.Info.MapName = "My Modified Map"; map.Info.MapDescription = "A map modified with War3Net"; } // Save the modified map var builder = new MapBuilder(map); builder.Build("path/to/output.w3x"); ```