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

Comparing deliantra/maps/perl/ipo.ext (file contents):
Revision 1.6 by root, Fri Aug 25 13:24:05 2006 UTC vs.
Revision 1.7 by root, Fri Aug 25 15:07:43 2006 UTC

1#! perl 1#! perl
2#CONVERSION: PARTIAL
2 3
3my $price_fact = 50; 4my $price_fact = 50;
4 5
5sub set_package { 6sub set_package {
6 my ($pkg, $from, $to, $bagname, $weight) = @_; 7 my ($pkg, $from, $to, $bagname, $weight) = @_;
72 $map->insert_object ($o, $x, $y); 73 $map->insert_object ($o, $x, $y);
73 $r 74 $r
74} 75}
75 76
76# this handler handles to notice the player that he has got mail 77# this handler handles to notice the player that he has got mail
77sub on_login { 78cf::attach_to_players
79 on_login => sub {
78 my ($pl) = @_; 80 my ($pl) = @_;
79 81
80 my $mails = CFMail::get_mail ($pl->ob->name); 82 my $mails = CFMail::get_mail ($pl->ob->name);
81 83
82 my $cnt = @{$mails || []}; 84 my $cnt = @{$mails || []};
83 85
84 if ($cnt == 1) { 86 if ($cnt == 1) {
85 $pl->ob->message ("You got one mail."); 87 $pl->ob->message ("You got one mail.");
86 } elsif ($cnt > 1) { 88 } elsif ($cnt > 1) {
87 $pl->ob->message ("You got $cnt mails."); 89 $pl->ob->message ("You got $cnt mails.");
88 } else { 90 } else {
89 $pl->ob->message ("You haven't got any mail."); 91 $pl->ob->message ("You haven't got any mail.");
92 }
90 } 93 },
91 94;
92 0
93}
94 95
95# this event handler handles receiving of mails 96# this event handler handles receiving of mails
96sub on_apply { 97sub on_apply {
97 my ($ev, $box, $pl) = @_; 98 my ($ev, $box, $pl) = @_;
98 99

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines