ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/gravedigger.ext
(Generate patch)

Comparing deliantra/server/ext/gravedigger.ext (file contents):
Revision 1.4 by root, Sat Mar 20 20:16:16 2010 UTC vs.
Revision 1.5 by elmex, Wed Apr 21 08:13:11 2010 UTC

1#!perl # mandatory 1#!perl # mandatory
2 2
3our $WAIT_TIME = 5 * 60; # 5 minutes 3our $WAIT_TIME = 5 * 60; # 5 minutes
4# the max price is base_price * 1.5 4# the max price is base_price * 1.5
5our $MAX_BASE_PRICE = 100 * 100 * 25; # 50 platinum (for lvl 115 players) 5our $MAX_BASE_PRICE = 100 * 100 * 25; # 25 platinum (for lvl 115 players)
6our $MIN_BASE_PRICE = 100 * 10; # 10 gold 6our $MIN_BASE_PRICE = 100 * 10; # 10 gold
7 7
8sub calc_player_price { 8sub calc_player_price {
9 my ($name) = @_; 9 my ($name) = @_;
10 10
17 } 17 }
18} 18}
19 19
20sub calc_text_price_ratio { 20sub calc_text_price_ratio {
21 my ($txt) = @_; 21 my ($txt) = @_;
22
23 if ($txt =~ /killed\s+by\s+foolery/) {
24 return 0.001; # greatly punish foolery, the gravedigger doesn't like this!
25 }
22 26
23 my $some_constant = 111; 27 my $some_constant = 111;
24 28
25 my $cnt = 0; 29 my $cnt = 0;
26 for (map ord $_, split //, $txt) { 30 for (map ord $_, split //, $txt) {
82 86
83 $who->pay_player ($price); 87 $who->pay_player ($price);
84 88
85 my $price_txt = cf::cost_string_from_value $price; 89 my $price_txt = cf::cost_string_from_value $price;
86 $who->reply ($npc, 90 $who->reply ($npc,
87 "I gave you $price_txt for the gravestone of " 91 "I gave you $price_txt for the gravestone of " . $player . ". "
88 . $player 92 . ($reason =~ /^\s*foolery/
93 ? "Stupid fellow. Being foolish and making my job"
94 . " harder than it already is kind of upsets me..."
89 . ". Poor fellow, $reason can be tricky..."); 95 : "Poor fellow, $reason can be tricky..."));
90 96
91 $who->{gravedigger_last_time} = time; 97 $who->{gravedigger_last_time} = time;
92 }; 98 };
93 99
94 $who->reply ($npc, "Let me have a look..."); 100 $who->reply ($npc, "Let me have a look...");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines