Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@
["", T("delay the next console commands for 1 second")],
[T("<seconds>"), T("delay the next console commands by a specified number of seconds")]
], undef],
['eden', "Use Eden Group Mark", \&cmdEden],
);

# Built-in aliases
Expand Down Expand Up @@ -3566,7 +3567,7 @@
my $player = Match::player($arg2);
if (!$player) {
error TF("Player %s does not exist.\n", $arg2);
} elsif (!$char->{name} eq $guild{master}) {

Check failure on line 3570 in src/Commands.pm

View workflow job for this annotation

GitHub Actions / test ubuntu-latest (perl latest) x64

Possible precedence problem between ! and string eq

Check failure on line 3570 in src/Commands.pm

View workflow job for this annotation

GitHub Actions / test ubuntu-latest (perl latest) x64

Possible precedence problem between ! and string eq
error T("You must be guildmaster to set an alliance\n");
return;
} else {
Expand Down Expand Up @@ -8680,4 +8681,18 @@
$messageSender->sendNPCCreateRequest($args);
}

sub cmdEden {
if (!$net || $net->getState() != Network::IN_GAME) {
error TF("You must be logged in the game to use this command '%s'\n", shift);
return;
}
my $item = Misc::getEdenGroupMark();
if ($item) {
$item->use;
}
else {
error "Error in function 'eden' (Use Eden Group Mark)\nInventory Item Eden Group Mark does not exist.\n";
}
}

1;
36 changes: 31 additions & 5 deletions src/Misc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3563,16 +3563,13 @@ sub canUseTeleport {
$item = $char->inventory->getByName($config{teleportAuto_item1});
$item = $char->inventory->getByNameID($config{teleportAuto_item1}) if (!($item) && $config{teleportAuto_item1} =~ /^\d{3,}$/);
}
$item = $char->inventory->getByNameID(23280) unless $item; # Beginner's Fly Wing
$item = $char->inventory->getByNameID(12323) unless $item; # Novice Fly Wing
$item = $char->inventory->getByNameID(601) unless $item; # Fly Wing
$item = getFlyWing() unless $item;
} else {
if ($config{teleportAuto_item2}) {
$item = $char->inventory->getByName($config{teleportAuto_item2});
$item = $char->inventory->getByNameID($config{teleportAuto_item2}) if (!($item) && $config{teleportAuto_item2} =~ /^\d{3,}$/);
}
$item = $char->inventory->getByNameID(12324) unless $item; # Novice Butterfly Wing
$item = $char->inventory->getByNameID(602) unless $item; # Butterfly Wing
$item = getButterflyWing() unless $item;
}

return 1 if $item;
Expand Down Expand Up @@ -5588,4 +5585,33 @@ sub autoNpcTalk {
});
}

sub getFlyWing {
# 12887 - Unlimited Fly Wing
# 23280 - Mosquito Wings (only if lv < 99)
# 23338 - [Event] Fly Wing
# 12323 - Novice Fly Wing
# 601 - Fly Wing
for my $id (12887, 23280, 23338, 12323, 601) {
next if $id == 23280 && $char->{lv} >= 99;
my $item = $char->inventory->getByNameID($id);
return $item if $item;
}
return undef;
}

sub getButterflyWing {
# 12324 - Novice Butterfly Wing
# 602 - Butterfly Wing
for my $id (12324, 602) {
my $item = $char->inventory->getByNameID($id);
return $item if $item;
}
return undef;
}

sub getEdenGroupMark {
# 22508 - Eden Group Mark
return $char->inventory->getByNameID(22508);
}

return 1;
4 changes: 1 addition & 3 deletions src/Task/Teleport/Random.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ sub getInventoryItem {
$item = $self->{actor}->inventory->getByName($config{teleportAuto_item1});
$item = $self->{actor}->inventory->getByNameID($config{teleportAuto_item1}) if (!($item) && $config{teleportAuto_item1} =~ /^\d{3,}$/);
}
$item = $self->{actor}->inventory->getByNameID(23280) unless $item; # Beginner's Fly Wing
$item = $self->{actor}->inventory->getByNameID(12323) unless $item; # Novice Fly Wing
$item = $self->{actor}->inventory->getByNameID(601) unless $item; # Fly Wing
$item = Misc::getFlyWing() unless $item;
return $item;
}

Expand Down
3 changes: 1 addition & 2 deletions src/Task/Teleport/Respawn.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ sub getInventoryItem {
$item = $self->{actor}->inventory->getByName($config{teleportAuto_item2});
$item = $self->{actor}->inventory->getByNameID($config{teleportAuto_item2}) if (!($item) && $config{teleportAuto_item2} =~ /^\d{3,}$/);
}
$item = $self->{actor}->inventory->getByNameID(12324) unless $item; # Novice Butterfly Wing
$item = $self->{actor}->inventory->getByNameID(602) unless $item; # Butterfly Wing
$item = Misc::getButterflyWing() unless $item;
return $item;
}

Expand Down
Loading