--- deliantra/server/ext/dmcommands.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/dmcommands.ext 2007/03/01 20:17:01 1.15 @@ -7,15 +7,24 @@ return unless $ob->may ("command_goto"); - my $portal = cf::object::new "exit"; + my ($path, $x, $y) = split /\s+/, $arg, 3; - $portal->slaying ($arg); - $portal->stats->hp (0); - $portal->stats->sp (0); + $ob->goto ($path, $x, $y); - $portal->apply ($ob); + 1 +}; + +cf::register_command teleport => sub { + my ($ob, $arg) = @_; - $portal->destroy; + return unless $ob->may ("command_teleport"); + + cf::async { + my $other = cf::player::find_active $arg + or return $ob->reply (undef, "$arg: no such player."); + + $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); + }; 1 }; @@ -68,7 +77,28 @@ 1 }; -for my $command (qw(reset teleport summon arrest kick banish)) { +cf::register_command reset => sub { + my ($ob, $arg) = @_; + + return unless $ob->may ("command_reset"); + + my $map = $ob->map; + + my @pl = $map->players; + $_->enter_link for @pl; + cf::async { + my $name = $map->visible_name; + + $map->reset; + $_->leave_link for @pl; + + $ob->reply (undef, "$name was reset."); + }; + + 1 +}; + +for my $command (qw(summon arrest kick banish)) { my $method = "command_$command"; cf::register_command $command => sub {