1 | #! perl |
1 | #! perl |
2 | |
2 | |
3 | # adjust levels of players at login time in case the experience table changed |
3 | # adjust levels of players at login time in case the experience table changed |
4 | |
4 | |
5 | sub on_player_load { |
5 | cf::attach_to_players |
6 | my ($ob, $path) = @_; |
6 | on_player_load => sub { |
|
|
7 | my ($pl) = @_; |
|
|
8 | my $ob = $pl->ob; |
7 | |
9 | |
8 | $ob->message ("\nAdjusting levels to experience table.\n"); |
10 | $ob->message ("\nAdjusting levels to experience table.\n"); |
9 | |
11 | |
10 | $ob->player_lvl_adj; |
12 | $ob->player_lvl_adj; |
11 | $ob->player_lvl_adj ($_) for grep $_->type == cf::SKILL, $ob->inv; |
13 | $ob->player_lvl_adj ($_) for grep $_->type == cf::SKILL, $ob->inv; |
12 | |
14 | |
13 | $ob->message ("\nDone adjusting levels to experience table.\nIf you got a lot of level changes, then this is because the server changed its experience table.\nDo NOT panic!\n"); |
15 | $ob->message ("\nDone adjusting levels to experience table.\nIf you got a lot of level changes, then this is because the server changed its experience table.\nDo NOT panic!\n"); |
14 | } |
16 | }, |
|
|
17 | ; |
15 | |
18 | |