mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-23 21:17:45 +00:00
Fix GM commands aetheryte and item (#128)
* Fix //gm item and //gm aetheryte -Aetheryte's command opcode changed some time in the last few weeks apparently -Item wasn't working, now it does, and additionally supports a quantity value now -Aetheryte's on value is properly inverted from the Lua side
This commit is contained in:
parent
fbb144f84b
commit
9d106c7050
5 changed files with 14 additions and 8 deletions
|
@ -7,7 +7,7 @@ GM_SET_LEVEL = 1
|
|||
GM_CHANGE_WEATHER = 6
|
||||
GM_SPEED = 9
|
||||
GM_INVISIBILITY = 13
|
||||
GM_AETHERYTE = 94
|
||||
GM_AETHERYTE = 350
|
||||
GM_EXP = 104
|
||||
GM_ORCHESTRION = 116
|
||||
GM_GIVE_ITEM = 200
|
||||
|
|
|
@ -2,8 +2,14 @@ required_rank = GM_RANK_DEBUG
|
|||
command_sender = "[item] "
|
||||
|
||||
function onCommand(args, player)
|
||||
local id = args[1]
|
||||
local id <const> = args[1]
|
||||
local quantity = args[2]
|
||||
if quantity == 0 then
|
||||
quantity = 1
|
||||
elseif quantity > 999 then -- TODO: get the actual stack size once Lua can query item info
|
||||
quantity = 999
|
||||
end
|
||||
|
||||
player:add_item(id)
|
||||
printf(player, "Added %s to your inventory.", id)
|
||||
player:add_item(id, quantity)
|
||||
printf(player, "Added %s of item id %s to your inventory.", quantity, id)
|
||||
end
|
||||
|
|
|
@ -2,8 +2,8 @@ required_rank = GM_RANK_DEBUG
|
|||
command_sender = "[unlockaetheryte] "
|
||||
|
||||
function onCommand(args, player)
|
||||
local on = args[1] -- TODO: reverse
|
||||
local id = args[2]
|
||||
local on <const> = ~args[1] & 1 -- The client sends 1 for off and 0 for on, so we need to invert this for the rust side to work properly.
|
||||
local id <const> = args[2]
|
||||
|
||||
player:unlock_aetheryte(on, id)
|
||||
printf(player, "Aetheryte(s) %s had their unlocked status changed!", id)
|
||||
|
|
|
@ -726,6 +726,8 @@ async fn client_loop(
|
|||
if let Err(err) = run_script() {
|
||||
tracing::warn!("Lua error in {file_name}: {:?}", err);
|
||||
}
|
||||
} else {
|
||||
tracing::warn!("Received unknown GM command {command} with args: arg0: {arg0} arg1: {arg1} arg2: {arg2} arg3: {arg3}!");
|
||||
}
|
||||
}
|
||||
ClientZoneIpcData::ZoneJump {
|
||||
|
|
|
@ -894,8 +894,6 @@ impl ZoneConnection {
|
|||
self.player_data.unlocks.aetherytes[index as usize] ^= value;
|
||||
}
|
||||
|
||||
/* Unknown if this will make the server panic from a flood of packets.
|
||||
* Needs testing once toggling aetherytes actually works. */
|
||||
self.actor_control_self(ActorControlSelf {
|
||||
category: ActorControlCategory::LearnTeleport {
|
||||
id: i,
|
||||
|
|
Loading…
Add table
Reference in a new issue