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

Comparing deliantra/server/ext/item-slag-ex.ext (file contents):
Revision 1.1 by root, Thu Jul 19 18:08:13 2007 UTC vs.
Revision 1.2 by elmex, Tue Jul 24 11:45:25 2007 UTC

3# this module implements slag ex(tm): 3# this module implements slag ex(tm):
4# when it is applied by a player the cauldron below it will 4# when it is applied by a player the cauldron below it will
5# be cleaned (all items in it will be removed) 5# be cleaned (all items in it will be removed)
6 6
7cf::object->attach ( 7cf::object->attach (
8 type => cf::POTION, 8 type => cf::MISC_OBJECT,
9 subtype => 11, # just a random number 9 subtype => 1,
10 on_apply => sub { 10 on_apply => sub {
11 my ($self, $who) = @_; 11 my ($self, $who) = @_;
12 12
13 my ($caul) = 13 my ($caul) =
14 grep { $_->flag (cf::FLAG_IS_CAULDRON) } 14 grep { $_->flag (cf::FLAG_IS_CAULDRON) }
15 $who->map->at ($who->x, $who->y); 15 $who->map->at ($who->x, $who->y);
16 16
17 if ($caul) { 17 if ($caul) {
18 $_->destroy (1) for @$caul; 18 $_->destroy (1) for $caul->inv;
19 $self->handle_apply_yield; 19 $self->handle_apply_yield;
20 $self->decrease_ob_nr (1); 20 $self->decrease_ob_nr (1);
21 $who->message ("You cleaned the " . $caul->name, cf::NDI_UNIQUE); 21 $who->message ("You cleaned the " . $caul->name, cf::NDI_UNIQUE);
22 22
23 } else { 23 } else {
25 } 25 }
26 26
27 cf::override 1; 27 cf::override 1;
28 }, 28 },
29); 29);
30
311

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines