ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/nimbus.ext
(Generate patch)

Comparing deliantra/maps/perl/nimbus.ext (file contents):
Revision 1.3 by root, Sat Mar 18 01:33:16 2006 UTC vs.
Revision 1.4 by root, Mon Mar 20 22:49:26 2006 UTC

3# handle the nimbus map and other stuff 3# handle the nimbus map and other stuff
4 4
5my @STATS = qw( 5my @STATS = qw(
6 Str Dex Con Wis Cha Int Pow 6 Str Dex Con Wis Cha Int Pow
7 wc ac hp maxhp sp maxsp grace maxgrace 7 wc ac hp maxhp sp maxsp grace maxgrace
8 exp food dam luck 8 food dam luck
9); 9);
10 10
11sub stats_get($) { 11sub stats_get($) {
12 my ($stats, $save) = @_; 12 my ($stats, $save) = @_;
13 13
32 32
33sub skills_get($) { 33sub skills_get($) {
34 my ($ob) = @_; 34 my ($ob) = @_;
35 35
36 +{ 36 +{
37 "" => $ob->stats->exp,
38
37 map +($_->skill => $_->stats->exp), 39 map +($_->skill => $_->stats->exp),
38 grep $_->type == cf::SKILL, 40 grep $_->type == cf::SKILL,
39 $ob->inv 41 $ob->inv
40 } 42 }
41} 43}
64 orig_stats => stats_get $pl->orig_stats, 66 orig_stats => stats_get $pl->orig_stats,
65 savebed => [$pl->get_savebed], 67 savebed => [$pl->get_savebed],
66 skill_exp => skills_get $ob, 68 skill_exp => skills_get $ob,
67 }; 69 };
68 70
69 $ob->{nimbus_save} = $save; 71 $ob->{nimbus_save} ||= $save;
70 72
71 my $path = sprintf "%s/%s/%s/%s", 73 my $path = sprintf "%s/%s/%s/%s",
72 cf::localdir, cf::playerdir, $ob->name, "nimbus"; 74 cf::localdir, cf::playerdir, $ob->name, "nimbus";
73 75
74 my $nimbus = cf::map::get_map "/schmorp/nimbus"; 76 my $nimbus = cf::map::get_map "/schmorp/nimbus";
75 $nimbus->set_path ($path); 77 $nimbus->set_path ($path);
76 $nimbus->set_unique (1); 78 $nimbus->set_unique (1);
77 79
78 $pl->set_savebed ($path, 24, 12); 80 $pl->set_savebed ($path, 24, 12);
81
82 0
79} 83}
80 84
81sub on_trigger { 85sub on_trigger {
82 my ($event) = @_; 86 my ($event) = @_;
83 my $options = $event->{options}; 87 my $options = $event->{options};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines