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.51 by root, Tue Apr 22 23:53:12 2008 UTC vs.
Revision 1.52 by root, Wed Apr 23 21:20:29 2008 UTC

133 { 133 {
134 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n"); 134 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
135 return 0; 135 return 0;
136 } 136 }
137 137
138 /* Ok then, go thru their inventory, stealing */ 138 /* Ok then, go through their inventory, stealing */
139 for (tmp = op->inv; tmp; tmp = next) 139 for (tmp = op->inv; tmp; tmp = next)
140 { 140 {
141 next = tmp->below; 141 next = tmp->below;
142 142
143 /* you can't steal worn items, starting items, wiz stuff, 143 /* you can't steal worn items, starting items, wiz stuff,
197 */ 197 */
198 198
199 if ((roll >= skill->level) || !chance 199 if ((roll >= skill->level) || !chance
200 || (tmp && tmp->weight > (250 * (random_roll (0, stats_value + skill->level * 10 - 1, who, PREFER_LOW))))) 200 || (tmp && tmp->weight > (250 * (random_roll (0, stats_value + skill->level * 10 - 1, who, PREFER_LOW)))))
201 { 201 {
202
203 /* victim figures out where the thief is! */ 202 /* victim figures out where the thief is! */
204 if (who->hide) 203 if (who->hide)
205 make_visible (who); 204 make_visible (who);
206 205
207 if (op->type != PLAYER) 206 if (op->type != PLAYER)
210 if (who->type == PLAYER) 209 if (who->type == PLAYER)
211 { 210 {
212 npc_call_help (op); 211 npc_call_help (op);
213 new_draw_info_format (NDI_UNIQUE, 0, who, "%s notices your attempted pilfering!", query_name (op)); 212 new_draw_info_format (NDI_UNIQUE, 0, who, "%s notices your attempted pilfering!", query_name (op));
214 } 213 }
214
215 CLEAR_FLAG (op, FLAG_UNAGGRESSIVE); 215 CLEAR_FLAG (op, FLAG_UNAGGRESSIVE);
216 /* all remaining npc items are guarded now. Set flag NO_STEAL 216 /* all remaining npc items are guarded now. Set flag NO_STEAL
217 * on the victim. 217 * on the victim.
218 */ 218 */
219 SET_FLAG (op, FLAG_NO_STEAL); 219 SET_FLAG (op, FLAG_NO_STEAL);
222 { /* stealing from another player */ 222 { /* stealing from another player */
223 char buf[MAX_BUF]; 223 char buf[MAX_BUF];
224 224
225 /* Notify the other player */ 225 /* Notify the other player */
226 if (success && who->stats.Int > random_roll (0, 19, op, PREFER_LOW)) 226 if (success && who->stats.Int > random_roll (0, 19, op, PREFER_LOW))
227 {
228 sprintf (buf, "Your %s is missing!", query_name (success)); 227 sprintf (buf, "Your %s is missing!", query_name (success));
229 }
230 else 228 else
231 {
232 sprintf (buf, "Your pack feels strangely lighter."); 229 sprintf (buf, "Your pack feels strangely lighter.");
233 } 230
234 new_draw_info (NDI_UNIQUE, 0, op, buf); 231 new_draw_info (NDI_UNIQUE, 0, op, buf);
235 if (!success) 232 if (!success)
236 { 233 {
237 if (who->invisible) 234 if (who->invisible)
238 {
239 sprintf (buf, "you feel itchy fingers getting at your pack."); 235 sprintf (buf, "you feel itchy fingers getting at your pack.");
240 }
241 else 236 else
242 {
243 sprintf (buf, "%s looks very shifty.", query_name (who)); 237 sprintf (buf, "%s looks very shifty.", query_name (who));
244 } 238
245 new_draw_info (NDI_UNIQUE, 0, op, buf); 239 new_draw_info (NDI_UNIQUE, 0, op, buf);
246 } 240 }
247 } /* else stealing from another player */ 241 } /* else stealing from another player */
248 /* play_sound("stop! thief!"); kindofthing */ 242 /* play_sound("stop! thief!"); kindofthing */
249 } /* if you weren't 100% successful */ 243 } /* if you weren't 100% successful */
244
250 return success ? 1 : 0; 245 return success ? 1 : 0;
251} 246}
252 247
253int 248int
254steal (object *op, int dir, object *skill) 249steal (object *op, int dir, object *skill)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines