diff --git a/USAGE.md b/USAGE.md index 9f00c24..095912a 100644 --- a/USAGE.md +++ b/USAGE.md @@ -108,7 +108,7 @@ These special debug commands start with `!` and are custom to Kawari. * `!spawnmonster`: Spawn a monster for debugging * `!spawnclone`: Spawn a clone of yourself * `!classjob `: Changes to another class/job -* `!unlockaction `: Unlock an action, for example: `1` for Return and `4` for Teleport. +* `!unlock `: Unlock an action, emote, etc. for example: `1` for Return and `4` for Teleport. * `!equip `: Forcefully equip an item, useful for bypassing class/job and other client restrictions. This will *overwrite* any item in that slot! * `!nudge `: Teleport forward, back, up or down `distance` yalms. Specifying up or down will move the player up or down instead of forward or back. Examples: `!nudge 5 up` to move up 5 yalms, `!nudge 5` to move forward 5 yalms, `!nudge -5` to move backward 5 yalms. * `!festival `: Sets the festival in the current zone. Multiple festivals can be set together to create interesting effects. diff --git a/resources/scripts/Global.lua b/resources/scripts/Global.lua index e27de3f..50bf956 100644 --- a/resources/scripts/Global.lua +++ b/resources/scripts/Global.lua @@ -213,7 +213,7 @@ registerCommand("setspeed", "commands/debug/SetSpeed.lua") registerCommand("nudge", "commands/debug/Nudge.lua") registerCommand("festival", "commands/debug/Festival.lua") registerCommand("permtest", "commands/debug/PermissionTest.lua") -registerCommand("unlockaction", "commands/debug/UnlockAction.lua") +registerCommand("unlock", "commands/debug/Unlock.lua") registerCommand("wireframe", "commands/debug/ToggleWireframe.lua") registerCommand("invis", "commands/debug/ToggleInvisibility.lua") registerCommand("unlockaetheryte", "commands/debug/UnlockAetheryte.lua") diff --git a/resources/scripts/commands/debug/Unlock.lua b/resources/scripts/commands/debug/Unlock.lua new file mode 100644 index 0000000..1768730 --- /dev/null +++ b/resources/scripts/commands/debug/Unlock.lua @@ -0,0 +1,30 @@ +required_rank = GM_RANK_DEBUG + +function onCommand(args, player) + local parts = split(args) + local argc = table.getn(parts) + local sender = "[unlockaction] " + local usage = "\nThis command teaches the user an action, emote, etc.\nUsage: !useaction " + + if argc < 1 then + player:send_message(sender.."This command requires 1 parameter."..usage) + return + end + + if parts[1] == "all" then + for i = 0, 1000, 1 do + player:unlock_action(i) + end + player:send_message(string.format("%s Everything is unlocked!", sender, id)) + else + local id = tonumber(parts[1]) + + if not id then + player:send_message(sender.."Error parsing action id! Make sure the id is an integer."..usage) + return + end + + player:unlock_action(id) + player:send_message(string.format("%s Action %s unlocked!", sender, id)) + end +end diff --git a/resources/scripts/commands/debug/UnlockAction.lua b/resources/scripts/commands/debug/UnlockAction.lua deleted file mode 100644 index a8a7ccf..0000000 --- a/resources/scripts/commands/debug/UnlockAction.lua +++ /dev/null @@ -1,23 +0,0 @@ -required_rank = GM_RANK_DEBUG - -function onCommand(args, player) - local parts = split(args) - local argc = table.getn(parts) - local sender = "[unlockaction] " - local usage = "\nThis command teaches the user an action.\nUsage: !useaction " - - if argc < 1 then - player:send_message(sender.."This command requires 1 parameter."..usage) - return - end - - local id = tonumber(parts[1]) - - if not id then - player:send_message(sender.."Error parsing action id! Make sure the id is an integer."..usage) - return - end - - player:unlock_action(id) - player:send_message(string.format("%s Action %s unlocked!", sender, id)) -end diff --git a/src/ipc/zone/actor_control.rs b/src/ipc/zone/actor_control.rs index 942f1f0..41c51cb 100644 --- a/src/ipc/zone/actor_control.rs +++ b/src/ipc/zone/actor_control.rs @@ -63,7 +63,9 @@ pub enum ActorControlCategory { unlocked: bool, }, #[brw(magic = 0x29u16)] - ToggleActionUnlock { + ToggleUnlock { + /// Corresponds to an UnlockLink. Could be a spell, action, emote, etc. + // See https://github.com/Haselnussbomber/HaselDebug/blob/main/HaselDebug/Tabs/UnlocksTabs/UnlockLinks/UnlockLinksTable.cs #[brw(pad_before = 2)] //padding id: u32, #[br(map = read_bool_from::)]