--- deliantra/server/ext/Jeweler.pm 2007/02/04 11:57:22 1.11 +++ deliantra/server/ext/Jeweler.pm 2007/06/04 12:19:08 1.16 @@ -221,7 +221,7 @@ my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); $ingred->remove ($ingr_grp, $srcarchname); - my $outarchval = cf::arch::find ($outarch)->clone->value; + my $outarchval = cf::arch::find ($outarch)->value; my $nrof = int ($archvalsum / (($outarchval || 1000) * $outarchvalfact)); if ($nrof) { @@ -240,7 +240,7 @@ $pl->ob->change_exp ($xp_sum, "jeweler", cf::SK_EXP_SKILL_ONLY); } } else { - $pl->ob->message ("You fail to make something, propably you used not enough source material?"); + $pl->ob->message ("You fail to make something, probably you used not enough source material?"); } } @@ -578,7 +578,8 @@ for my $key (keys %$costs) { my @grepar; if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items - @grepar = @{Jeweler::getcfg (plans => $key) || []}; + eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} }; + next if $@; } else { # check the gems @grepar = ('gems', undef, undef, $key); } @@ -665,11 +666,11 @@ my $pearch = cf::arch::find 'pearl'; my $ruarch = cf::arch::find 'ruby'; my $diarch = cf::arch::find 'gem'; - my $value = $emarch->clone->value * $costs->{emerald} - + $saarch->clone->value * $costs->{sapphire} - + $pearch->clone->value * $costs->{pearl} - + $ruarch->clone->value * $costs->{ruby} - + $diarch->clone->value * $costs->{gem}; + my $value = $emarch->value * $costs->{emerald} + + $saarch->value * $costs->{sapphire} + + $pearch->value * $costs->{pearl} + + $ruarch->value * $costs->{ruby} + + $diarch->value * $costs->{gem}; $value } @@ -797,7 +798,7 @@ my $obj = cf::object::new $self->{hash}->{arch}; - $obj->item_power ($self->power_to_level); # there have to be strings attached! + $obj->item_power (floor ($self->power_to_level / 3)); # there have to be strings attached! $obj->face ($self->{hash}{face}); @@ -1031,13 +1032,13 @@ my $ruarch = cf::arch::find 'ruby'; my $diarch = cf::arch::find 'gem'; - my $sumvalue = $diarch->clone->value * $diamonds; + my $sumvalue = $diarch->value * $diamonds; - $cost->{emerald} += ceil $sumvalue * $stat_split->[0] / max 1, $emarch->clone->value; - $cost->{sapphire} += ceil $sumvalue * $stat_split->[1] / max 1, $saarch->clone->value; - $cost->{pearl} += ceil $sumvalue * $stat_split->[2] / max 1, $pearch->clone->value; - $cost->{ruby} += ceil $sumvalue * $stat_split->[3] / max 1, $ruarch->clone->value; - $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->clone->value; + $cost->{emerald} += ceil $sumvalue * $stat_split->[0] / max 1, $emarch->value; + $cost->{sapphire} += ceil $sumvalue * $stat_split->[1] / max 1, $saarch->value; + $cost->{pearl} += ceil $sumvalue * $stat_split->[2] / max 1, $pearch->value; + $cost->{ruby} += ceil $sumvalue * $stat_split->[3] / max 1, $ruarch->value; + $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->value; } package Jeweler::Util; @@ -1086,6 +1087,7 @@ my $check_true = 0; for my $match (@matchar) { if ($i % 3 == 0) { + return 1 if $check_true && $check_cnts == $check_true; $check_cnts = 0; $check_true = 0; } @@ -1109,9 +1111,7 @@ $i++; } #d# warn "CHECK $check_true | $check_cnts | [".(join ',', @matchar).":".join (",", ($thing->name, $thing->title, $thing->arch->name))."\n"; - if ($check_true && $check_cnts == $check_true) { - return 1; - } + return 1 if $check_true && $check_cnts == $check_true; return 0; }