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

Comparing deliantra/server/ext/jeweler.ext (file contents):
Revision 1.18 by elmex, Thu Nov 12 06:37:57 2009 UTC vs.
Revision 1.26 by elmex, Sun May 30 19:49:40 2010 UTC

80 $ingred->remove ('ammys'); 80 $ingred->remove ('ammys');
81 } 81 }
82 82
83 my $ch = $ring->get_chance_perc ($sk); 83 my $ch = $ring->get_chance_perc ($sk);
84 my $succ = 0; 84 my $succ = 0;
85 my $r = cf::random_roll (0, 100, $pl, cf::PREFER_HIGH); 85 my $r = cf::random_roll (0, 100, $pl, cf::PREFER_LOW);
86 86
87 my $make_status; 87 my $make_status;
88 my $exp; 88 my $exp;
89 89
90 if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) { 90 if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) {
93 $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); 93 $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY);
94 $pl->message ( 94 $pl->message (
95 "You succeed and get " . int ($exp) . " experience points."); 95 "You succeed and get " . int ($exp) . " experience points.");
96 $make_status = "succeeded"; 96 $make_status = "succeeded";
97 97
98 $ring->set_value ($value * 0.8); # 20% of the input values will vanish 98 $ring->set_value ($value);
99 99
100 } else { 100 } else {
101 $pl->message ("You fail!"); 101 $pl->message ("You fail!");
102 $ring->negate; 102 $ring->negate;
103 $make_status = "fail"; 103 $make_status = "fail";
104 $exp = 0; 104 $exp = 0;
105 } 105 }
106 106
107 my $ring_ob = $ring->to_object; 107 my $ring_ob = $ring->to_object;
108 108
109 $ring_ob->kv_set (ext_jeweler_maker => $pl->name);
110
109 { # some audit info calculation 111 { # some audit info calculation
110 my $sklvl = cf::exp_to_level ($sk->stats->exp); 112 my $sklvl = cf::exp_to_level ($sk->stats->exp);
111 113
112 my $make_info = sprintf 114 my $make_info = sprintf
113 "JEWELER AUDIT: '%s' made '%s' (%s) (sk lvl %d, ring lvl %d, got %d exp): %s", 115 "JEWELER AUDIT: '%s' made '%s' (%s) (sk lvl %d, ring lvl %d, got %d exp): %s",
114 $pl->name, $ring->to_string, $ring_ob->uuid, $sklvl, 116 $pl->name, $ring->to_string, $ring_ob->uuid, $sklvl,
115 $ring->power_to_level, $exp, $make_status; 117 $ring->power_to_level, $exp, $make_status;
116 118
119 cf::debug "$make_info\n"
117 warn "$make_info\n" if $make_status eq 'succeeded'; 120 if $make_status eq 'succeeded';
118 } 121 }
119 122
120 $chdl->put ($ring_ob); 123 $chdl->put ($ring_ob);
121} 124}
122 125
128 return 131 return
129 } elsif ($@ =~ /unidentified/) { 132 } elsif ($@ =~ /unidentified/) {
130 $pl->message ("There are unidentified items in the workbench, identify them before you do anything."). 133 $pl->message ("There are unidentified items in the workbench, identify them before you do anything.").
131 return 134 return
132 } elsif ($@) { 135 } elsif ($@) {
133 warn "error in jeweler ingredient extraction: $@"; 136 cf::error "error in jeweler ingredient extraction: $@";
134 return; 137 return;
135 } 138 }
136 $ingred; 139 $ingred;
137} 140}
138 141
195 unless ($Jeweler::CFG->{conversions}->{lc $1}) { 198 unless ($Jeweler::CFG->{conversions}->{lc $1}) {
196 $pl->message ("You don't know how to make '$1', is does such a thing even exist?"); 199 $pl->message ("You don't know how to make '$1', is does such a thing even exist?");
197 return 200 return
198 } 201 }
199 202
200 Jeweler::simple_converter ($player, $ingred, $chdl, $1); 203 Jeweler::simple_converter (
204 $player, $ingred, $chdl, $1,
205 cf::exp_to_level ($sk->stats->exp));
201 206
202 } elsif ($msg =~ m/^\s*merge\s*analy[sz]e\s*$/i) { 207 } elsif ($msg =~ m/^\s*merge\s*analy[sz]e\s*$/i) {
203 merge ($chdl, $sk, $pl, 1); 208 merge ($chdl, $sk, $pl, 1);
204 209
205 } elsif ($msg =~ m/^\s*merge\s*$/i) { 210 } elsif ($msg =~ m/^\s*merge\s*$/i) {
267 } else { 272 } else {
268 $pl->message ("You've got no idea what you are planning to do!"); 273 $pl->message ("You've got no idea what you are planning to do!");
269 } 274 }
270 } 275 }
271 }; 276 };
272 $@ and warn "ERROR: $@\n"; 277 $@ and cf::error "$@\n";
273 } 278 }
274); 279);
275 280
276Jeweler::read_config "res/jeweler.yaml"; 281Jeweler::load_config;
277 282

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines