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

Comparing deliantra/server/ext/Jeweler.pm (file contents):
Revision 1.21 by root, Fri Oct 12 19:13:26 2007 UTC vs.
Revision 1.22 by root, Sun Oct 14 20:23:48 2007 UTC

177 $pl->message ($r->to_string . ": " . $msg); 177 $pl->message ($r->to_string . ": " . $msg);
178 if ($pl->flag (cf::FLAG_WIZ)) { 178 if ($pl->flag (cf::FLAG_WIZ)) {
179 $r->wiz_analyze ($pl); 179 $r->wiz_analyze ($pl);
180 } 180 }
181 } 181 }
182 if ($hadunid) {
183 $pl->message ("You couldn't identify the other rings and not analyze them!"); 182 $pl->message ("You couldn't identify the other rings and not analyze them!")
184 } 183 if $hadunid;
185} 184}
186 185
187# this function converts metals/minerals into a raw ring (of adornment) 186# this function converts metals/minerals into a raw ring (of adornment)
188sub simple_converter { 187sub simple_converter {
189 my ($pl, $ingred, $chdl, $conv) = @_; 188 my ($pl, $ingred, $chdl, $conv) = @_;
203 warn "ERROR: Conversion for '$outarch' has only " . (@conv_cfg) . " arguments!"; 202 warn "ERROR: Conversion for '$outarch' has only " . (@conv_cfg) . " arguments!";
204 return; 203 return;
205 } 204 }
206 205
207 unless ($xp_gain > 0) { 206 unless ($xp_gain > 0) {
208 warn "WARNING: xp gain isn't > 0 in convesion '$outarch'\n"; 207 warn "WARNING: xp gain isn't > 0 in conversion '$outarch'\n";
209 return; 208 return;
210 } 209 }
211 210
212 unless ($outarchvalfact) { 211 unless ($outarchvalfact) {
213 warn "ERROR: source-arch-value-multiplier == 0 in conversion '$outarch'\n"; 212 warn "ERROR: source-arch-value-multiplier == 0 in conversion '$outarch'\n";
221 my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); 220 my $archvalsum = $ingred->value ($ingr_grp, $srcarchname);
222 $ingred->remove ($ingr_grp, $srcarchname); 221 $ingred->remove ($ingr_grp, $srcarchname);
223 222
224 my $outarchval = cf::arch::find ($outarch)->value; 223 my $outarchval = cf::arch::find ($outarch)->value;
225 224
226 my $nrof = int ($archvalsum / (($outarchval || 1000) * $outarchvalfact)); 225 my $nrof = int $archvalsum / (($outarchval || 1000) * $outarchvalfact);
227 if ($nrof) { 226 if ($nrof) {
228 # XXX: yes, i know what i'm doing here, i don't set nrof, but it didn't work somehow (pls. chek sometimes) 227 # XXX: yes, I know what I'm doing here, I don't set nrof, but it didn't work somehow (pls. check sometimes)
229 for (1..$nrof) { 228 for (1 .. $nrof) {
230 $chdl->put (my $ob = cf::object::new $outarch); 229 $chdl->put (my $ob = cf::object::new $outarch);
231 $ob->set_animation (cf::rndm $ob->num_animations) 230 $ob->set_animation (cf::rndm $ob->num_animations)
232 if ($ob->type == cf::RING); 231 if ($ob->type == cf::RING);
233 $ob->flag (cf::FLAG_IDENTIFIED, 1); 232 $ob->flag (cf::FLAG_IDENTIFIED, 1);
234 } 233 }
235 234
236 my $xp_sum = ($xp_gain * $nrof); 235 my $xp_sum = $xp_gain * $nrof;
237 236
238 if ($xp_sum) { 237 if ($xp_sum) {
239 $pl->ob->message ("You got $xp_sum xp by making $nrof ${outarch}s"); 238 $pl->ob->message ("You got $xp_sum xp by making $nrof ${outarch}s");
240 $pl->ob->change_exp ($xp_sum, "jeweler", cf::SK_EXP_SKILL_ONLY); 239 $pl->ob->change_exp ($xp_sum, "jeweler", cf::SK_EXP_SKILL_ONLY);
241 } 240 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines