From 6050291630d8d261cbdcffe02e1c60a8b51651b2 Mon Sep 17 00:00:00 2001 From: hexhexD Date: Sun, 4 Feb 2024 17:35:45 -0500 Subject: [PATCH] feat: add "all" option to "uneq" command (#3848) "uneq all" unequips all equipped equipment --- src/Commands.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Commands.pm b/src/Commands.pm index d754f02fd0..a66dde546d 100644 --- a/src/Commands.pm +++ b/src/Commands.pm @@ -6050,6 +6050,33 @@ sub cmdUnequip { return; } + if ($arg1 eq "all") { + my @equipment; + # Find all equipped items + for my $item (@{$char->inventory}) { + if ($item->equippable && $item->{type_equip} != 0) { + my %eqp; + $eqp{index} = $item->{ID}; + $eqp{binID} = $item->{binID}; + $eqp{name} = $item->{name}; + $eqp{amount} = $item->{amount}; + $eqp{equipped} = ($item->{type} == 10 || $item->{type} == 16 || $item->{type} == 17 || $item->{type} == 19) ? $item->{amount} . " left" : $equipTypes_lut{$item->{equipped}}; + $eqp{type} = $itemTypes_lut{$item->{type}}; + $eqp{equipped} .= " ($item->{equipped})"; + # Translation Comment: Mark to tell item not identified + $eqp{identified} = " -- " . T("Not Identified") if !$item->{identified}; + if ($item->{equipped}) { + push @equipment, \%eqp; + } + } + } + for my $e (@equipment) { + my $item = Actor::Item::get($e->{name}, undef, 0); + $item->unequip(); + } + return; + } + if ($equipSlot_rlut{$arg1}) { $slot = $arg1; } else {