1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
465 | if (object *pl = op->in_player ()) |
465 | if (object *pl = op->in_player ()) |
466 | { |
466 | { |
467 | if (pl->ms ().flags () & P_NO_CLERIC && !QUERY_FLAG (pl, FLAG_WIZCAST)) |
467 | if (pl->ms ().flags () & P_NO_CLERIC && !QUERY_FLAG (pl, FLAG_WIZCAST)) |
468 | new_draw_info (NDI_UNIQUE, 0, pl, "You feel something fizzle inside you."); |
468 | new_draw_info (NDI_UNIQUE, 0, pl, "You feel something fizzle inside you."); |
469 | else |
469 | else |
470 | { |
470 | pl->player_goto (op->slaying, op->stats.hp, op->stats.sp); |
471 | // remove first so we do not call update_stats |
|
|
472 | op->remove (); |
|
|
473 | pl->enter_exit (op); |
|
|
474 | } |
|
|
475 | } |
471 | } |
476 | |
472 | |
477 | op->destroy (); |
473 | op->destroy (); |
478 | } |
474 | } |
479 | |
475 | |
… | |
… | |
2274 | object *tmp; |
2270 | object *tmp; |
2275 | |
2271 | |
2276 | for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
2272 | for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
2277 | { |
2273 | { |
2278 | int atk_lev, def_lev; |
2274 | int atk_lev, def_lev; |
2279 | object *victim = tmp; |
2275 | object *victim = tmp->head_ (); |
2280 | |
2276 | |
2281 | if (tmp->head) |
|
|
2282 | victim = tmp->head; |
|
|
2283 | if (!QUERY_FLAG (victim, FLAG_MONSTER)) |
2277 | if (!QUERY_FLAG (victim, FLAG_MONSTER)) |
2284 | continue; |
2278 | continue; |
|
|
2279 | |
2285 | if (QUERY_FLAG (victim, FLAG_UNAGGRESSIVE)) |
2280 | if (QUERY_FLAG (victim, FLAG_UNAGGRESSIVE)) |
2286 | continue; |
2281 | continue; |
|
|
2282 | |
2287 | if (victim->stats.exp == 0) |
2283 | if (victim->stats.exp == 0) |
2288 | continue; |
2284 | continue; |
2289 | |
2285 | |
2290 | def_lev = MAX (1, victim->level); |
2286 | def_lev = MAX (1, victim->level); |
2291 | atk_lev = MAX (1, op->level); |
2287 | atk_lev = MAX (1, op->level); |
2292 | |
2288 | |
2293 | if (rndm (0, atk_lev - 1) > def_lev) |
2289 | if (rndm (0, atk_lev - 1) > def_lev) |
2294 | { |
2290 | { |
2295 | /* make this sucker peaceful. */ |
2291 | /* make this sucker peaceful. */ |
2296 | |
2292 | |
|
|
2293 | INVOKE_OBJECT (KILL, victim, ARG_OBJECT (op)); |
2297 | change_exp (op->owner, victim->stats.exp, op->skill, 0); |
2294 | change_exp (op->owner, victim->stats.exp, op->skill, 0); |
2298 | victim->stats.exp = 0; |
2295 | victim->stats.exp = 0; |
2299 | #if 0 |
2296 | #if 0 |
2300 | /* No idea why these were all set to zero - if something |
2297 | /* No idea why these were all set to zero - if something |
2301 | * makes this creature agressive, he should still do damage. |
2298 | * makes this creature agressive, he should still do damage. |
… | |
… | |
2308 | victim->attack_movement = RANDO2; |
2305 | victim->attack_movement = RANDO2; |
2309 | SET_FLAG (victim, FLAG_UNAGGRESSIVE); |
2306 | SET_FLAG (victim, FLAG_UNAGGRESSIVE); |
2310 | SET_FLAG (victim, FLAG_RUN_AWAY); |
2307 | SET_FLAG (victim, FLAG_RUN_AWAY); |
2311 | SET_FLAG (victim, FLAG_RANDOM_MOVE); |
2308 | SET_FLAG (victim, FLAG_RANDOM_MOVE); |
2312 | CLEAR_FLAG (victim, FLAG_MONSTER); |
2309 | CLEAR_FLAG (victim, FLAG_MONSTER); |
|
|
2310 | |
2313 | if (victim->name) |
2311 | if (victim->name) |
2314 | { |
|
|
2315 | new_draw_info_format (NDI_UNIQUE, 0, op->owner, "%s no longer feels like fighting.", &victim->name); |
2312 | new_draw_info_format (NDI_UNIQUE, 0, op->owner, "%s no longer feels like fighting.", &victim->name); |
2316 | } |
|
|
2317 | } |
2313 | } |
2318 | } |
2314 | } |
2319 | } |
2315 | } |
2320 | |
2316 | |
2321 | |
2317 | |