ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/slag_ex.ext
Revision: 1.5
Committed: Thu Jul 19 18:08:14 2007 UTC (16 years, 10 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +0 -0 lines
State: FILE REMOVED
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 elmex 1.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 root 1.4 type => cf::POTION,
9 elmex 1.2 subtype => 11, # just a random number
10 elmex 1.1 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 root 1.4 $_->destroy (1) for @$caul;
19 elmex 1.1 $self->handle_apply_yield;
20     $self->decrease_ob_nr (1);
21     $who->message ("You cleaned the " . $caul->name, cf::NDI_UNIQUE);
22    
23     } else {
24 root 1.4 $who->message ("Couldn't find cauldron to clean on the ground.", cf::NDI_UNIQUE);
25 elmex 1.1 }
26    
27     cf::override 1;
28     },
29     );