ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/item-slag-ex.ext
Revision: 1.4
Committed: Fri Oct 17 10:48:57 2008 UTC (15 years, 7 months ago) by elmex
Branch: MAIN
CVS Tags: rel-2_82, rel-2_81, rel-2_80, rel-2_72, rel-2_73, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_79, rel-2_90, rel-2_92, rel-2_93, rel-2_78
Changes since 1.3: +2 -2 lines
Log Message:
fixed destroy(1) => destroy() in item-slag-ex.ext.

File Contents

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