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

Comparing deliantra/server/server/shop.C (file contents):
Revision 1.50 by elmex, Thu Apr 24 11:26:41 2008 UTC vs.
Revision 1.51 by root, Fri Apr 25 11:40:34 2008 UTC

206 * AND Cha = 30 will get optimal price. 206 * AND Cha = 30 will get optimal price.
207 * Thus charisma will never get useless. 207 * Thus charisma will never get useless.
208 * -b.e. edler@heydernet.de 208 * -b.e. edler@heydernet.de
209 */ 209 */
210 210
211 if (who != NULL && who->type == PLAYER) 211 if (who && who->type == PLAYER)
212 { 212 {
213 int lev_bargain = 0; 213 int lev_bargain = 0;
214 int lev_identify = 0; 214 int lev_identify = 0;
215 int idskill1 = 0;
216 int idskill2 = 0;
217 const typedata *tmptype;
218
219 tmptype = get_typedata (tmp->type);
220 215
221 if (find_skill_by_number (who, SK_BARGAINING)) 216 if (find_skill_by_number (who, SK_BARGAINING))
222 lev_bargain = find_skill_by_number (who, SK_BARGAINING)->level; 217 lev_bargain = find_skill_by_number (who, SK_BARGAINING)->level;
223 218
224 if (tmptype) 219 if (const typedata *tmptype = get_typedata (tmp->type))
225 { 220 {
226 idskill1 = tmptype->identifyskill; 221 if (int idskill1 = tmptype->identifyskill)
227
228 if (idskill1)
229 { 222 {
230 idskill2 = tmptype->identifyskill2; 223 int idskill2 = tmptype->identifyskill2;
231 224
232 if (find_skill_by_number (who, idskill1)) 225 if (find_skill_by_number (who, idskill1))
233 lev_identify = find_skill_by_number (who, idskill1)->level; 226 lev_identify = find_skill_by_number (who, idskill1)->level;
234 227
235 if (idskill2 && find_skill_by_number (who, idskill2)) 228 if (idskill2 && find_skill_by_number (who, idskill2))
236 lev_identify += find_skill_by_number (who, idskill2)->level; 229 lev_identify += find_skill_by_number (who, idskill2)->level;
237 } 230 }
238 } 231 }
239 else
240 LOG (llevError, "Query_cost: item %s hasn't got a valid type\n", tmp->debug_desc ());
241 232
242 /* ratio determines how much of the price modification 233 /* ratio determines how much of the price modification
243 * will come from the basic stat charisma 234 * will come from the basic stat charisma
244 * the rest will come from the level in bargaining skill 235 * the rest will come from the level in bargaining skill
245 */ 236 */
418 409
419 if (coin == NULL) 410 if (coin == NULL)
420 return "nothing"; 411 return "nothing";
421 412
422 num = real_value / coin->value; 413 num = real_value / coin->value;
414
423 if (num == 1) 415 if (num == 1)
424 sprintf (buf, "about one %s", &coin->object::name); 416 sprintf (buf, "about one %s", &coin->object::name);
425 else if (num < 5) 417 else if (num < 5)
426 sprintf (buf, "a few %s", &coin->object::name_pl); 418 sprintf (buf, "a few %s", &coin->object::name_pl);
427 else if (num < 10) 419 else if (num < 10)
432 sprintf (buf, "lots of %s", &coin->object::name_pl); 424 sprintf (buf, "lots of %s", &coin->object::name_pl);
433 else if (num < 1000) 425 else if (num < 1000)
434 sprintf (buf, "a great many %s", &coin->object::name_pl); 426 sprintf (buf, "a great many %s", &coin->object::name_pl);
435 else 427 else
436 sprintf (buf, "a vast quantity of %s", &coin->object::name_pl); 428 sprintf (buf, "a vast quantity of %s", &coin->object::name_pl);
429
437 return buf; 430 return buf;
438 } 431 }
439 } 432 }
440 } 433 }
441 434

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines