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

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.49 by root, Tue Apr 22 02:46:18 2008 UTC vs.
Revision 1.50 by root, Tue Apr 22 07:01:47 2008 UTC

177 if (tmp->destroyed () || tmp->env != op) 177 if (tmp->destroyed () || tmp->env != op)
178 { 178 {
179 /* for players, play_sound: steals item */ 179 /* for players, play_sound: steals item */
180 success = tmp; 180 success = tmp;
181 CLEAR_FLAG (tmp, FLAG_INV_LOCKED); 181 CLEAR_FLAG (tmp, FLAG_INV_LOCKED);
182
183 /* Don't delete it from target player until we know
184 * the thief has picked it up. can't just look at tmp->count,
185 * as it's possible that it got merged when picked up.
186 */
187 if (op->type == PLAYER)
188 esrv_del_item (op->contr, tmp->count);
189 } 182 }
183
190 break; 184 break;
191 } 185 }
192 } /* for loop looking for an item */ 186 } /* for loop looking for an item */
193 187
194 if (!tmp) 188 if (!tmp)
697 if (tmp->msg) 691 if (tmp->msg)
698 { 692 {
699 new_draw_info (NDI_UNIQUE, 0, pl, "The item has a story:"); 693 new_draw_info (NDI_UNIQUE, 0, pl, "The item has a story:");
700 new_draw_info (NDI_UNIQUE, 0, pl, tmp->msg); 694 new_draw_info (NDI_UNIQUE, 0, pl, tmp->msg);
701 } 695 }
702
703 /* identify will take care of updating the item if it is in the players inventory. IF on map, do it here */
704 if (tmp->map)
705 esrv_send_item (pl, tmp);
706 } 696 }
697
707 success += calc_skill_exp (pl, tmp, skill); 698 success += calc_skill_exp (pl, tmp, skill);
708 } 699 }
709 else 700 else
710 SET_FLAG (tmp, FLAG_NO_SKILL_IDENT); 701 SET_FLAG (tmp, FLAG_NO_SKILL_IDENT);
711 } 702 }
1258 { 1249 {
1259 snprintf (buf, sizeof (buf), "%s\n", msg); 1250 snprintf (buf, sizeof (buf), "%s\n", msg);
1260 1251
1261 object *newbook = arch_to_object (item->other_arch); 1252 object *newbook = arch_to_object (item->other_arch);
1262 item->decrease (); 1253 item->decrease ();
1263 esrv_send_item (pl, item);
1264 newbook->nrof = 1; 1254 newbook->nrof = 1;
1265 newbook->msg = buf; 1255 newbook->msg = buf;
1266 newbook->flag [FLAG_IDENTIFIED] = true; 1256 newbook->flag [FLAG_IDENTIFIED] = true;
1267 1257
1268 if (item->subtype == 1) // mailscrolls 1258 if (item->subtype == 1) // mailscrolls
1269 { 1259 {
1270 newbook->name = item->name; 1260 newbook->name = item->name;
1271 newbook->name_pl = item->name_pl; 1261 newbook->name_pl = item->name_pl;
1272 } 1262 }
1273 1263
1274 newbook = insert_ob_in_ob (newbook, pl); 1264 pl->insert (newbook);
1275 esrv_send_item (pl, newbook);
1276 1265
1277 pl->contr->play_sound (sound_find ("inscribe_success")); 1266 pl->contr->play_sound (sound_find ("inscribe_success"));
1278 new_draw_info_format (NDI_UNIQUE, 0, pl, "You write in the %s.", &item->name); 1267 new_draw_info_format (NDI_UNIQUE, 0, pl, "You write in the %s.", &item->name);
1279 return strlen (msg); 1268 return strlen (msg);
1280 } 1269 }
1354 * if players want to sell them, so be it. 1343 * if players want to sell them, so be it.
1355 */ 1344 */
1356 newscroll->value = newscroll->arch->value * newscroll->inv->value * (newscroll->level + 50) / (newscroll->inv->level + 50); 1345 newscroll->value = newscroll->arch->value * newscroll->inv->value * (newscroll->level + 50) / (newscroll->inv->level + 50);
1357 newscroll->stats.exp = newscroll->value / 5; 1346 newscroll->stats.exp = newscroll->value / 5;
1358 1347
1359 newscroll = insert_ob_in_ob (newscroll, pl); 1348 pl->insert (newscroll);
1360 esrv_send_item (pl, newscroll);
1361 1349
1362 success = calc_skill_exp (pl, newscroll, skill); 1350 success = calc_skill_exp (pl, newscroll, skill);
1363 if (!confused) 1351 if (!confused)
1364 success *= 2; 1352 success *= 2;
1365 1353

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines