ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/dmcommands.ext
(Generate patch)

Comparing deliantra/server/ext/dmcommands.ext (file contents):
Revision 1.12 by root, Sat Jan 13 23:06:13 2007 UTC vs.
Revision 1.13 by root, Sun Jan 14 02:10:41 2007 UTC

5cf::register_command goto => sub { 5cf::register_command goto => sub {
6 my ($ob, $arg) = @_; 6 my ($ob, $arg) = @_;
7 7
8 return unless $ob->may ("command_goto"); 8 return unless $ob->may ("command_goto");
9 9
10 my $portal = cf::object::new "exit"; 10 my ($path, $x, $y) = split /\s+/, $arg, 3;
11 11
12 $portal->slaying ($arg); 12 $ob->goto ($path, $x, $y);
13 $portal->stats->hp (0);
14 $portal->stats->sp (0);
15 13
16 $portal->apply ($ob); 14 1
15};
17 16
18 $portal->destroy; 17cf::register_command teleport => sub {
18 my ($ob, $arg) = @_;
19
20 return unless $ob->may ("command_teleport");
21
22 cf::async {
23 my $other = cf::player::find $arg
24 or return $ob->reply ("$arg: no such player.");
25
26 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y);
27 };
19 28
20 1 29 1
21}; 30};
22 31
23cf::register_command wizpass => sub { 32cf::register_command wizpass => sub {
87 }; 96 };
88 97
89 1 98 1
90}; 99};
91 100
92for my $command (qw(teleport summon arrest kick banish)) { 101for my $command (qw(summon arrest kick banish)) {
93 my $method = "command_$command"; 102 my $method = "command_$command";
94 103
95 cf::register_command $command => sub { 104 cf::register_command $command => sub {
96 my ($ob, $arg) = @_; 105 my ($ob, $arg) = @_;
97 106

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines