### Implement Interactive Game Guides Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Provides functionality to create and manage in-game tutorials and guidance for players. Supports creating custom UI guides with specified elements, directions, and callbacks, as well as initiating guides for native game interfaces like the inventory. It also allows for closing active guides. This is key for player onboarding and feature discovery. ```lua -- Create custom UI guide local function guideComplete() SL:Print("Guide step completed") -- Proceed to next guide step end local guideData = { dir = 8, -- Direction (1-8, clockwise from left) guideWidget = closeButton, -- Target UI element guideParent = parentWindow, -- Parent window guideDesc = "Click here to close the window", clickCB = guideComplete, -- Completion callback autoExcute = 3, -- Auto-execute after 3 seconds isForce = true -- Force guide (blocks other interaction) } SL:StartGuide(guideData) -- Guide native game interface (e.g., inventory) SL:StartGuide({ id = 1, -- Guide window ID (1=bag guide) param = 2682001, -- Item unique ID to highlight guideDesc = "Use this item to restore health" }) -- Close active guide SL:CloseGuide() ``` -------------------------------- ### Manage Color and Style Properties Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Offers utilities for color conversion and retrieving style configurations based on an ID. It can convert style IDs to RGB or hex color values and also get font sizes. Additionally, it supports converting RGB color structures to hex strings. This is useful for UI customization and dynamic styling within the game. ```lua -- Get RGB color from style ID local colorRGB = SL:GetColorByStyleId(10) SL:dump(colorRGB) -- {r = 255, g = 255, b = 255} -- Get hex color from style ID local hexColor = SL:GetHexColorByStyleId(10) SL:Print(hexColor) -- "#FFFFFF" -- Get font size from style ID local fontSize = SL:GetSizeByStyleId(10) SL:Print("Font size:", fontSize) -- Convert RGB to hex local color3B = {r = 255, g = 128, b = 64} local hexValue = SL:GetColorHexFromRGB(color3B) SL:Print("Hex color:", hexValue) -- "#FF8040" ``` -------------------------------- ### Query Game Actor Information Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Provides methods to retrieve and identify different types of game entities (actors). This includes getting the main player's ID and checking if a target actor is a player, monster, NPC, hero, or a humanoid. It helps in differentiating between various entities for game logic and interaction. The functions return boolean values to indicate the actor type. ```lua -- Get main player actor ID local myActorId = SL:Get_USER_ID() SL:Print("My actor ID:", myActorId) -- Check entity type local actorId = targetActorId if SL:Get_ACTOR_IS_PLAYER(actorId) then SL:Print("Target is a player") elseif SL:Get_ACTOR_IS_MONSTER(actorId) then SL:Print("Target is a monster") elseif SL:Get_ACTOR_IS_NPC(actorId) then SL:Print("Target is an NPC") elseif SL:Get_ACTOR_IS_HERO(actorId) then SL:Print("Target is a hero") elseif SL:Get_ACTOR_IS_HUMAN(actorId) then SL:Print("Target is a humanoid monster") end -- Check if network player (other player) local isNetPlayer = SL:Get_ACTOR_IS_NETPLAYER(actorId) if isNetPlayer then SL:Print("This is another player online") end ``` -------------------------------- ### Manage Teams: Create, Invite, Accept, Refuse, Apply, Leave, Kick, Transfer, Permissions Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt This section details Lua functions for team management, including creating teams, inviting players, accepting or refusing invitations, applying to join, leaving, kicking members, transferring leadership, and setting join permissions. These operations utilize the `SL` object. ```lua -- Create a new team SL:RequestCreateTeam() -- Invite player to team local targetUid = 12345 local targetName = "PlayerName" SL:RequestInviteJoinTeam(targetUid, targetName) -- Accept team invitation SL:RequestAgreeTeamInvite(inviterUid) -- Refuse team invitation SL:RequestRefuseTeamInvite(inviterUid) -- Request nearby teams SL:RequestNearTeam() -- Apply to join a team local captainUid = 54321 SL:RequestApplyJoinTeam(captainUid) -- View join applications (captain only) SL:RequestApplyData() -- Approve join application (captain only) SL:RequestApplyAgree(applicantUid) -- Leave current team SL:RequestLeaveTeam() -- Kick member from team (captain only) SL:RequestSubTeamMember(memberUid) -- Transfer team leadership SL:RequestTransferTeamLeader(newCaptainUid) -- Set team join permissions (captain only) SL:Set_TEAM_STATUS_PERMIT(1) -- 1=allow, 0=disallow ``` -------------------------------- ### Download and Manage Game Resources Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Enables downloading of various game resources like images and minimap data from specified URLs. Includes functionality to save resources to a local path and remove cached files. Callbacks are provided to handle download success or failure, allowing for asynchronous operations. This is essential for dynamic content loading and updates. ```lua -- Download external resource local savePath = "res/customImage.png" local resourceUrl = "https://example.com/image.png" local function downloadCallback(success, path) if success then SL:Print("Downloaded to:", path) else SL:Print("Download failed") end end SL:DownLoadRes(savePath, resourceUrl, downloadCallback) -- Download minimap resource local mapId = 100 local function minimapCallback(isOk, path) if isOk then SL:Print("Minimap downloaded successfully") SL:Print("Minimap path:", path) -- Use minimap image else SL:Print("Minimap download failed") end end SL:DownloadMiniMapRes(mapId, minimapCallback) -- Remove cached GM resource SL:RemoveGMResFile("cache/temp_resource.png") ``` -------------------------------- ### Manage Guilds: Create, Invite, Remove, Appoint, Alliance Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt This snippet demonstrates Lua functions for managing guilds, including creating, inviting members, removing members, appointing ranks, and handling alliance applications and rejections. It relies on the `SL` object for API calls. ```lua -- Request guild member list SL:RequestGuildMemberList() -- Request world guild list (paginated) local pageNumber = 1 SL:RequestWorldGuildList(pageNumber) -- Invite player to guild local playerUid = 12345 SL:RequestGuildInviteMember(playerUid) -- Remove member from guild SL:RequestSubGuildMember(playerUid) -- Appoint member to guild position -- Ranks: 1=Leader, 2=Vice Leader, 3=Elite, 4=Member, 5=Recruit SL:RequestGuildAppointRank(playerUid, 3) -- Request guild alliance applications SL:RequestGuildAllyApplyList() -- Reject alliance application local guildID = 2001 SL:RequestGuildRejectAllyApply(guildID) ``` -------------------------------- ### Manage Purchase System (Buy Orders) in Lua Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Handles the creation, management, and fulfillment of buy orders within the game's purchase system. It allows requesting purchase listings, placing new buy orders, selling items to existing orders, and cancelling or claiming orders. ```lua -- Request purchase listings local requestData = { type = 0, -- 0=world purchases, 1=my purchases, 2=my received pageIndex = 1, stdmode = "1#2#3", -- Filter by item type currency = "1,2", -- Filter by currency sort = 2, -- 0=none, 1=price asc, 2=price desc, 3=total asc, 4=total desc itemids = "1001,1002" -- Filter by item IDs } SL:RequestPurchaseItemList(requestData) -- Create buy order local purchaseData = { qty = 100, -- Quantity wanted minqty = 10, -- Minimum quantity per sale price = 5000, -- Price per item itemid = 1001, -- Item index currency = 1 -- Currency ID } SL:RequestPurchasePutIn(purchaseData) -- Sell items to buy order local sellData = { guid = 123456, -- Purchase order ID qty = 50 -- Quantity to sell } SL:RequestPurchaseSell(sellData) -- Cancel buy order local orderGuid = 123456 SL:RequestPurchasePutOut(orderGuid) -- Cancel specific order SL:RequestPurchasePutOut() -- Cancel all orders -- Claim purchased items SL:RequestPurchaseTakeOut(orderGuid) -- Claim specific order SL:RequestPurchaseTakeOut() -- Claim all ``` -------------------------------- ### Display Common Dialogs with UIOperator in Lua Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Manages the display of common in-game dialogs, including confirmation messages, input prompts, item tooltips, and detailed description pop-ups. These dialogs can have custom messages, button configurations, callbacks for user interaction, and formatting options. ```lua -- Show common confirmation dialog local dialogData = { str = "Are you sure you want to delete this item?", btnType = 2, -- 1=OK only, 2=OK+Cancel callback = function(buttonId, params) if buttonId == 1 then SL:Print("User confirmed") -- Perform delete action else SL:Print("User cancelled") end end } UIOperator:OpenCommonTipsUI(dialogData) SL:CloseCommonTipsUI() -- Show input dialog local inputDialog = { str = "Enter player name to invite:", btnType = 2, showEdit = true, editParams = { inputMode = 0, -- Keyboard type maxLength = 20, -- Max input length str = "" -- Default text }, callback = function(buttonId, params) if buttonId == 1 and params and params.editStr then local playerName = params.editStr if string.len(playerName) > 0 then SL:RequestInviteJoinTeam(nil, playerName) end end end } UIOperator:OpenCommonTipsUI(inputDialog) -- Show item tooltip local tooltipData = { itemData = itemData, -- Item data table pos = {x = 500, y = 300}, from = "bag" -- Source location } UIOperator:OpenItemTips(tooltipData) UIOperator:CloseItemTips() -- Show description tooltip local descData = { width = 1136, str = "This is a detailed description with colored text", worldPos = {x = 568, y = 320}, anchorPoint = {x = 0.5, y = 0.5}, formatWay = 1 -- 1=parse rich text, 0=legacy format } UIOperator:OpenCommonDescTipsUI(descData) UIOperator:CloseCommonDescTipsUI() ``` -------------------------------- ### Manage UI Windows with UIOperator in Lua Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Provides functions to open and close various game interface windows, including inventory bags, player character panels, hero interfaces, guild, social, auction, trading bank, ranking, settings, and store. Allows for specific configurations when opening certain UIs. ```lua -- Open player bag with specific configuration local bagConfig = { pos = {x = 200, y = 100}, bag_page = 2 -- Open to page 2 } UIOperator:OpenBagUI(bagConfig) UIOperator:CloseBagUI() -- Open player character interface local playerConfig = { type = 1, -- 1=basic info, 2=internal skills page = 104 -- 101=equipment, 102=status, 103=attributes, 104=skills, 105=titles, 106=fashion } UIOperator:OpenMyPlayerUI(playerConfig) UIOperator:CloseMyPlayerUI() -- Open hero character interface local heroConfig = {type = 1, page = 101} UIOperator:OpenMyHeroUI(heroConfig) UIOperator:CloseMyHeroUI() -- Open guild interface UIOperator:OpenGuildMainUI(1) -- 1=home, 2=members, 3=list UIOperator:CloseGuildMainUI() -- Open social interface UIOperator:OpenSocialUI(3) -- 1=nearby, 2=team, 3=friends, 4=mail UIOperator:CloseSocialUI() -- Open auction house UIOperator:OpenAuctionUI() UIOperator:CloseAuctionUI() -- Open trading bank UIOperator:OpenTradingBankUI() UIOperator:CloseTradingBankUI() -- Open ranking list UIOperator:OpenRankUI(1) UIOperator:CloseRankUI() -- Open settings UIOperator:OpenSettingUI(1) -- 1=basic, 2=view distance, 3=combat, 4=protection, 5=auto-fight, 6=help UIOperator:CloseSettingUI() -- Open store/shop UIOperator:OpenStoreFrameUI(1) -- Page number UIOperator:CloseStoreFrameUI() ``` -------------------------------- ### Manage Friends: List, Add, Remove, Accept, Clear, Blacklist Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt This Lua snippet covers friend system operations, including requesting the friend list, adding friends by name, removing friends, accepting friend requests, clearing all requests, and managing the blacklist by adding or removing players. The `SL` object is used for these functions. ```lua -- Request friend list SL:RequestFriendList() -- Add friend by name local friendName = "PlayerName" SL:RequestAddFriend(friendName) -- Remove friend local friendUid = 12345 SL:RequestDelFriend(friendUid) -- Accept friend request SL:RequestAgreeFriendApply(friendName) -- Clear all friend requests SL:RequestClearFriendApplyList() -- Add player to blacklist SL:RequestAddBlacklistByName("SpammerName") -- Remove from blacklist SL:RequestOutBlacklist(playerUid) ``` -------------------------------- ### Manage Auction House: List, Bid, Buy, Remove, Re-list, Claim Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt This Lua snippet covers auction house operations, including requesting listings, putting items up for auction with bid and buy-now prices, placing bids, removing listings, re-listing expired items, and claiming won auction items. Note that buying at the buy-now price is handled through the UI. The `SL` object is used for these functions. ```lua -- Request auction listings -- ListType: 1=my listings, 2=participated auctions SL:RequestAuctionPutList(1) -- List item on auction house local makeindex = 2682001 local quantity = 1 local bidPrice = 10000 local buyNowPrice = 50000 local currencyID = 1 -- 1=gold, 2=diamonds local discount = 0 SL:RequestAuctionPutin(makeindex, quantity, bidPrice, buyNowPrice, currencyID, discount) -- Place bid on item SL:RequestAuctionBid(makeindex, 15000) -- Buy item at buy-now price (handled through UI) -- UIOperator:OpenAuctionBuyUI(item) -- Remove listing SL:RequestAuctionPutout(makeindex) -- Re-list expired item SL:RequestAuctionRePutin(makeindex, quantity, bidPrice, buyNowPrice, currencyID, discount) -- Claim won auction item SL:RequestAcquireBidItem(makeindex) ``` -------------------------------- ### Play and Manage Game Audio Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Handles playback of sound effects, background music, and special event audio. Supports playing, stopping, and looping sounds with specified IDs. This functionality is crucial for enhancing player immersion and providing audio feedback for game events. It does not appear to have direct dependencies on external libraries beyond the game's core engine. ```lua -- Play button click sound SL:PlayBtnClickAudio() -- Play custom sound effect local soundId = 50004 SL:PlaySound(soundId, false) -- false = no loop -- Play looping background sound SL:PlaySound(50010, true) -- true = loop -- Stop specific sound SL:StopSound(soundId) -- Stop all audio SL:StopAllAudio() -- Play special event sounds SL:PlaySelectRoleAudio() -- Character selection SL:PlayFlashBoxAudio() -- Treasure box selection SL:PlayOpenBoxAudio() -- Treasure box opening ``` -------------------------------- ### Send Chat Messages and Notifications (Lua) Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Handles sending various types of chat messages, system notifications, and custom drop alerts. Supports sending to specific channels, private messages, and modifying chat input. Includes functions for equipment links and custom drop displays. ```lua -- Send normal chat message (uses current channel by default) SL:RequestSendChatNormalMsg("Hello everyone!") -- Send to specific channel -- Channels: 1=World, 2=Guild, 3=Team, 4=Private, 5=System SL:RequestSendChatNormalMsg("Guild meeting at 8PM", 2) -- Show system notification in chat SL:ShowSystemChat("Quest completed! Received 1000 gold", 154, 255) -- Send equipment link to chat SL:RequestSendChatEquipMsg(1) -- Send to world channel -- Replace chat input box content SL:onLUAEvent("LUA_EVENT_CHAT_REPLACE_INPUT", "Pre-filled message") -- Set private chat target local targetInfo = { name = "PlayerName", uid = 12345 } SL:onLUAEvent("LUA_EVENT_CHAT_PRIVATE_TARGET", targetInfo) -- Add custom drop notification to chat SL:AddDropChatMsgShow({ FColor = 253, BColor = 255, Msg = "Legendary Sword dropped from Dragon Boss at coordinates (222,333)", dropType = 1 -- Drop category 1-10 }) ``` -------------------------------- ### Manage Player Attributes and Progression (Lua) Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Facilitates player operations such as managing titles, submitting quests, adding attribute points, item synthesis, and checking for sensitive words before sending chat messages. It also includes inviting players to mounts. ```lua -- Request player title list SL:RequestTitleList() -- Activate a title local titleId = 101 SL:RequestActivateTitle(titleId) -- Remove current title SL:RequestDisboardTitle() -- Submit a quest/mission local missionID = 5001 SL:RequestSubmitMission(missionID) -- Add attribute points (new version) local attributeData = { Bonus = { {id = 1, value = 5}, -- Strength +5 {id = 2, value = 3}, -- Agility +3 {id = 3, value = 2} -- Intelligence +2 } } local remainingPoints = 10 SL:RequestAddReinAttrNew(attributeData, remainingPoints) -- Request item synthesis/compound local compoundID = 3001 SL:ResquestCompoundItem(compoundID) -- Check sensitive words before sending local function sendChatSafely(message) SL:RequestCheckSensitiveWord(message, 2, function(passed, filteredText) if passed then SL:RequestSendChatNormalMsg(filteredText) else SL:ShowSystemChat("Message contains prohibited words", 154, 255) end end) end -- Invite player to mount SL:RequestInvitePlayerInHorse(playerUid) ``` -------------------------------- ### Manage Player Inventory (Lua) Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Enables management of player inventory, including using items by index, refreshing the inventory display, discarding items, and selecting multiple items for batch operations. Also retrieves custom server variables associated with items. ```lua -- Use an item by its unique index local itemIndex = 2682001 SL:RequestUseItemByIndex(itemIndex) -- Refresh bag display SL:RequestRefreshBagPos() -- Discard an item local itemData = { MakeIndex = 2682001, ItemIdx = 1001, ItemName = "Health Potion", Count = 5 } SL:RequestIntoDropBagItem(itemData) -- Batch select multiple items local selectedItems = {2682001, 2682002, 2682003} SL:RequestSetBagItemChoose(selectedItems) -- Get item custom variables pushed from server local customVars = SL:GetSerCustomVar(itemData.MakeIndex) SL:dump(customVars, "Item custom data") ``` -------------------------------- ### Manage Heroes: Mode, Titles, Fashion, Target Lock Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt This Lua code demonstrates how to manage hero characters, including changing combat modes, requesting and activating/deactivating titles, toggling fashion display, and locking/canceling locks on targets. It utilizes the `SL` object for all hero-related API calls. ```lua -- Change hero combat mode -- Modes: 1=Attack, 2=Follow, 3=Rest, etc. local heroMode = 1 SL:RequestChangeHeroMode(heroMode) -- Request hero titles SL:RequestTitleList_Hero() -- Activate hero title SL:RequestActivateTitle_Hero(titleId) -- Remove hero title SL:RequestDisboardTitle_Hero() -- Toggle hero fashion display -- Type: 1=fashion display, 2=deity display SL:SendSuperEquipSetting_Hero(1) -- Hero lock target local targetActorID = 99999 local isPlayerTarget = true SL:RequestLockTargetByHero(targetActorID, isPlayerTarget) -- Hero cancel lock SL:RequestCancelLockByHero() ``` -------------------------------- ### Manage In-Game Mail (Lua) Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Provides functions to interact with the in-game mail system, including requesting mail lists, reading individual mails, extracting attachments, deleting mails, and performing batch operations. ```lua -- Request mail list (10 items per request) SL:RequestMailList() -- Read specific mail by ID local mailId = 1001 SL:RequestReadMail(mailId) -- Extract items from specific mail SL:RequestGetMailItems(mailId) -- Extract items from all mails SL:RequestGetAllMailItems() -- Delete specific mail SL:RequestDelMail(mailId) -- Delete all read mails SL:RequestDelReadMail() -- Complete mail workflow example local function processAllMail() SL:RequestMailList() -- Gets first 10 mails -- After receiving mail list data, process each mail: -- 1. Read mail: SL:RequestReadMail(mailId) -- 2. Extract items: SL:RequestGetMailItems(mailId) -- 3. Delete mail: SL:RequestDelMail(mailId) -- Or batch operations: SL:RequestGetAllMailItems() -- Extract all items first SL:RequestDelReadMail() -- Then delete all read mails end ``` -------------------------------- ### Inventory Management API Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Manage the player's inventory, including using items, discarding, and performing batch operations. ```APIDOC ## POST /inventory ### Description Provides functions for managing player inventory, such as using items, discarding items, refreshing the bag display, and selecting multiple items for batch operations. ### Method POST ### Endpoint /inventory ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **action** (string) - Required - The inventory action to perform. Options: `useItem`, `refresh`, `discardItem`, `selectItems`. - **itemIndex** (integer) - Optional - The unique index of the item to use (for `useItem`). - **itemData** (object) - Optional - Data for the item to discard. `{"MakeIndex": 2682001, "ItemIdx": 1001, "ItemName": "Health Potion", "Count": 5}` (for `discardItem`). - **selectedItems** (array) - Optional - An array of item indices to select for batch operations. `[2682001, 2682002, 2682003]` (for `selectItems`). ### Request Example ```json { "action": "useItem", "itemIndex": 2682001 } ``` ```json { "action": "discardItem", "itemData": { "MakeIndex": 2682001, "ItemIdx": 1001, "ItemName": "Health Potion", "Count": 5 } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the inventory operation. #### Response Example ```json { "status": "success" } ``` ### Additional Functions - `SL:RequestRefreshBagPos()`: Refreshes the player's bag display. - `SL:GetSerCustomVar(makeIndex)`: Retrieves custom variables associated with an item. ``` -------------------------------- ### Mail System API Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Manage in-game mail, including requesting lists, reading, extracting items, and deleting mails. ```APIDOC ## GET /mail ### Description Provides functions to interact with the in-game mail system, allowing players to view, read, manage, and extract items from mail. ### Method GET ### Endpoint /mail ### Parameters #### Path Parameters None #### Query Parameters - **action** (string) - Required - The mail action to perform. Options: `list`, `read`, `getItems`, `getAllItems`, `delete`, `deleteRead`. - **mailId** (integer) - Optional - The ID of the mail to operate on (required for `read`, `getItems`, `delete`). ### Request Example ```http GET /mail?action=list ``` ```http GET /mail?action=read&mailId=1001 ``` ```http GET /mail?action=getItems&mailId=1001 ``` ### Response #### Success Response (200) - **mailList** (array) - A list of mail items (for `list` action). - **mailContent** (object) - The content of a specific mail (for `read` action). - **itemsExtracted** (array) - A list of items extracted from mail (for `getItems` or `getAllItems` actions). - **status** (string) - Status of the operation (e.g., 'success', 'deleted'). #### Response Example ```json { "mailList": [ { "mailId": 1001, "sender": "System", "subject": "Welcome!", "timestamp": 1678886400 } ] } ``` ```json { "mailContent": { "mailId": 1001, "sender": "System", "subject": "Welcome!", "body": "Thank you for playing!", "hasAttachment": true } } ``` ### Notes - `RequestMailList()` fetches the first 10 mails. - `RequestGetAllMailItems()` extracts items from all available mails. - `RequestDelReadMail()` deletes all mails that have been read. ``` -------------------------------- ### Submit Form Data to Server (Lua) Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Submits form data to server-side scripts for processing. Supports simple parameter submission and complex JSON data. Server-side configuration (SetFormAllowFunc) and keyword restrictions apply. Max parameter length is 4000 characters. ```lua -- Submit simple form with parameters -- Parameters separated by # for multiple values SL:SubmitForm("新手引导", "completeTask", "1" .. "#" .. "2" .. "#" .. "completed") -- Submit complex data as JSON table local questData = { questId = 1001, objectives = {kill = 10, collect = 5}, completed = true, reward = "gold" } local jsonData = SL:JsonEncode(questData) SL:SubmitForm("任务系统", "submitQuest", jsonData) -- IMPORTANT: Server file must use SetFormAllowFunc to enable form submission -- Avoid these prohibited keywords: lib, function, then, end, _G, return, index, set, load, _ -- Max parameter length: 4000 characters -- Server script location: MirServer\Mir200\Envir\Script ``` -------------------------------- ### Chat and Messaging API Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Send various types of messages to chat channels, display system notifications, and customize chat behavior. ```APIDOC ## POST /chat/send ### Description Sends messages to different chat channels or displays system notifications. Allows for customization of message type and target. ### Method POST ### Endpoint /chat/send ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **message** (string) - Required - The content of the message. - **channel** (integer) - Optional - The target channel for the message. Defaults to the current channel. Channels: 1=World, 2=Guild, 3=Team, 4=Private, 5=System. - **type** (string) - Optional - The type of chat message (e.g., 'normal', 'system', 'equipment'). - **color** (object) - Optional - Color information for system notifications. `{"FColor": 154, "BColor": 255}` - **target** (object) - Optional - Information for private chat target. `{"name": "PlayerName", "uid": 12345}` - **dropInfo** (object) - Optional - Information for custom drop notifications. `{"FColor": 253, "BColor": 255, "Msg": "...", "dropType": 1}` ### Request Example ```json { "message": "Hello everyone!", "channel": 1 } ``` ```json { "message": "Quest completed!", "type": "system", "color": {"FColor": 154, "BColor": 255} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of sending the message. #### Response Example ```json { "status": "success" } ``` ### Additional Functions - `SL:onLUAEvent("LUA_EVENT_CHAT_REPLACE_INPUT", "Pre-filled message")`: Replaces the content of the chat input box. - `SL:RequestSendChatEquipMsg(itemId)`: Sends an equipment link to the world channel. ``` -------------------------------- ### Server Form Submission API Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Submit form data to server-side scripts for processing. Supports simple parameters and complex JSON data. Server-side configuration is required. ```APIDOC ## POST /submitForm ### Description Submits form data to server-side scripts for processing. This can include simple parameters separated by a delimiter or complex JSON data. ### Method POST ### Endpoint /submitForm ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **formName** (string) - Required - The name of the form to submit. - **action** (string) - Required - The action to perform on the server. - **data** (string) - Required - The data to submit, which can be delimited parameters or a JSON string. ### Request Example ```json { "formName": "任务系统", "action": "submitQuest", "data": "{\"questId\": 1001, \"objectives\": {\"kill\": 10, \"collect\": 5}, \"completed\": true, \"reward\": \"gold\"}" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the submission. - **message** (string) - A message detailing the result of the operation. #### Response Example ```json { "status": "success", "message": "Quest submitted successfully." } ``` ### Notes - Server file must use `SetFormAllowFunc` to enable form submission. - Avoid prohibited keywords in server scripts: `lib`, `function`, `then`, `end`, `_G`, `return`, `index`, `set`, `load`, `_`. - Maximum parameter length is 4000 characters. - Server script location: MirServer\Mir200\Envir\Script ``` -------------------------------- ### Player Operations API Source: https://context7.com/shengfeiyue-qq2/996m2_client_api/llms.txt Manage player attributes, titles, missions, and character progression, including adding attribute points and item synthesis. ```APIDOC ## POST /player ### Description Manages various player-related operations such as titles, missions, attribute points, item synthesis, and sensitive word checks. ### Method POST ### Endpoint /player ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **action** (string) - Required - The player operation to perform. Options: `titleList`, `activateTitle`, `disboardTitle`, `submitMission`, `addAttributes`, `compoundItem`, `checkSensitiveWord`, `inviteMount`. - **titleId** (integer) - Optional - The ID of the title to activate or manage. - **missionID** (integer) - Optional - The ID of the mission to submit. - **attributeData** (object) - Optional - Data for adding attribute points. `{"Bonus": [{"id": 1, "value": 5}]}`. - **remainingPoints** (integer) - Optional - The number of attribute points remaining. - **compoundID** (integer) - Optional - The ID for item synthesis. - **message** (string) - Optional - The message to check for sensitive words. - **callback** (function) - Optional - A callback function for sensitive word check results. - **playerUid** (integer) - Optional - The unique ID of the player to invite to mount. ### Request Example ```json { "action": "activateTitle", "titleId": 101 } ``` ```json { "action": "addAttributes", "attributeData": { "Bonus": [ {"id": 1, "value": 5}, {"id": 2, "value": 3} ] }, "remainingPoints": 10 } ``` ```json { "action": "checkSensitiveWord", "message": "Hello!" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the player operation. - **titleList** (array) - List of player titles (for `titleList`). - **missionResult** (string) - Result of mission submission. - **attributeResult** (object) - Result of attribute addition. - **compoundResult** (string) - Result of item compounding. - **sensitiveWordResult** (object) - Result of sensitive word check. #### Response Example ```json { "status": "success", "titleList": [{"titleId": 101, "name": "Hero"}] } ``` ```json { "status": "success", "attributeResult": { "currentStrength": 100, "currentAgility": 80 } } ``` ### Notes - The `checkSensitiveWord` action can be used to pre-validate messages before sending them via chat. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.