--- deliantra/server/ext/jeweler.ext 2007/05/19 00:11:11 1.11 +++ deliantra/server/ext/jeweler.ext 2007/07/31 09:40:15 1.12 @@ -52,7 +52,7 @@ @rings >= 2 or return $pl->reply (undef, "You slap yourself, you forgot to put at least 2 jewels in!"); - my $input_level; + my $input_level = 0; my $value; for (@rings) { $input_level = max ($_->power_to_level, $input_level); @@ -63,7 +63,7 @@ $ring->improve_by_ring (@rings); if ($do_analyze) { - $pl->reply (undef, "You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl)); + $pl->reply (undef, "You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl, $input_level)); $ring->wiz_analyze ($pl) if $pl->flag (cf::FLAG_WIZ); return; @@ -88,30 +88,7 @@ my $exp; if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) { - my $lvl = max ($ring->power_to_level, 1); - $exp = - (cf::level_to_min_exp ($lvl) - cf::level_to_min_exp ($lvl - 1)) - / (10 + max ($lvl - 1, 0)); # 10 + level times making such a ring - # should get you to the rings level at least. - - if (defined $input_level) { - my $subexp = - (cf::level_to_min_exp ($input_level) - - cf::level_to_min_exp ($input_level - 1)) - / (10 + max ($input_level - 1, 0)); # see above for comment - - $exp -= $subexp; - $exp = max ($exp, 0); - - } else { - # the experience bonus here is to make level 1 rings give you at least - # 100 exp points when making them. This also makes leveling in the - # first few levels a bit easier. (probably until around level 5-6). - my $expbonus = cf::level_to_min_exp (2) / 10; - # this bonus should also only be given for _new_ rings and not for merged - # ones - to prevent infinite exp making. - $exp += $expbonus; - } + $exp = $ring->projected_exp ($input_level); $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); $pl->message ("You succeed and get $exp experience points."); @@ -254,6 +231,12 @@ my $c2 = $iring->calc_costs; my $value = $iring->calc_value_from_cost ($c2); + if ((not defined $c1) || (not defined $c2)) { + $pl->message ("The jewel has or will become a resistancy above 99%,\n" + ."that is completly impossible to make!"); + return; + } + my %keys; my %cdiff; for (keys %$c1, keys %$c2) { $keys{$_} = 1 }