--- deliantra/server/ext/dmcommands.ext 2007/01/01 16:00:10 1.3 +++ deliantra/server/ext/dmcommands.ext 2007/03/01 20:20:05 1.16 @@ -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) = @_; + + return unless $ob->may ("command_teleport"); - $portal->destroy; + cf::async { + my $other = cf::player::find $arg + or return $ob->reply (undef, "$arg: no such player."); + + $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); + }; 1 }; @@ -73,12 +82,23 @@ return unless $ob->may ("command_reset"); - die;#d# + 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(teleport summon arrest kick banish)) { +for my $command (qw(summon arrest kick banish)) { my $method = "command_$command"; cf::register_command $command => sub {