Skip to content

Commit

Permalink
feat: add "all" option to "uneq" command (#3848)
Browse files Browse the repository at this point in the history
"uneq all" unequips all equipped equipment
  • Loading branch information
hexhexD committed Feb 4, 2024
1 parent 8fc7e8d commit 6050291
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6050291

Please sign in to comment.