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.1 by root, Fri Feb 3 07:14:38 2006 UTC vs.
Revision 1.2 by pippijn, Fri Jun 2 02:01:12 2006 UTC

1/* 1/*
2 * static char *rcsid_skills_c = 2 * static char *rcsid_skills_c =
3 * "$Id: skills.c,v 1.1 2006/02/03 07:14:38 root Exp $"; 3 * "$Id: skills.c,v 1.2 2006/06/02 02:01:12 pippijn Exp $";
4 */ 4 */
5/* 5/*
6 CrossFire, A Multiplayer game for X-windows 6 CrossFire, A Multiplayer game for X-windows
7 7
8 Copyright (C) 2003 Mark Wedel & Crossfire Development Team 8 Copyright (C) 2003 Mark Wedel & Crossfire Development Team
117 } 117 }
118 if (op->type == PLAYER && QUERY_FLAG(op, FLAG_WIZ)) { 118 if (op->type == PLAYER && QUERY_FLAG(op, FLAG_WIZ)) {
119 new_draw_info(NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n"); 119 new_draw_info(NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n");
120 return 0; 120 return 0;
121 } 121 }
122#ifdef PROHIBIT_PLAYERKILL
123 if(op->type == PLAYER && who->type == PLAYER && (who->contr->peaceful || op->contr->peaceful)) {
124 new_draw_info(NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
125 return 0;
126 }
127#else
122 if(op->type == PLAYER && who->type == PLAYER && settings.no_player_stealing) { 128 if(op->type == PLAYER && who->type == PLAYER && settings.no_player_stealing) {
123 new_draw_info(NDI_UNIQUE, 0, who, "You can't steal from other players!\n"); 129 new_draw_info(NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
124 return 0; 130 return 0;
125 } 131 }
132#endif
126 133
127 134
128 /* Ok then, go thru their inventory, stealing */ 135 /* Ok then, go thru their inventory, stealing */
129 for(tmp = op->inv; tmp != NULL; tmp = next) { 136 for(tmp = op->inv; tmp != NULL; tmp = next) {
130 next = tmp->below; 137 next = tmp->below;
1259 newscroll->value = newscroll->arch->clone.value * newscroll->inv->value * 1266 newscroll->value = newscroll->arch->clone.value * newscroll->inv->value *
1260 (newscroll->level +50) / (newscroll->inv->level + 50); 1267 (newscroll->level +50) / (newscroll->inv->level + 50);
1261 newscroll->stats.exp = newscroll->value/5; 1268 newscroll->stats.exp = newscroll->value/5;
1262 1269
1263 /* wait until finished manipulating the scroll before inserting it */ 1270 /* wait until finished manipulating the scroll before inserting it */
1264 if (newscroll != scroll) 1271 if (newscroll == scroll)
1272 {
1273 /* Remove to correctly merge with other items which may exist in inventory */
1274 remove_ob(newscroll);
1275 esrv_del_item(pl->contr,newscroll->count);
1276 }
1265 newscroll=insert_ob_in_ob(newscroll,pl); 1277 newscroll=insert_ob_in_ob(newscroll,pl);
1266 esrv_send_item(pl, newscroll); 1278 esrv_send_item(pl, newscroll);
1267 success = calc_skill_exp(pl,newscroll, skill); 1279 success = calc_skill_exp(pl,newscroll, skill);
1268 if(!confused) success *= 2; 1280 if(!confused) success *= 2;
1269 success = success * skill->level; 1281 success = success * skill->level;
1270 return success; 1282 return success;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines