--- deliantra/server/server/apply.C 2009/01/13 12:07:42 1.186 +++ deliantra/server/server/apply.C 2009/01/13 13:29:57 1.187 @@ -317,17 +317,8 @@ { if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) { - object *fball; - op->failmsg ("Yech! Your lungs are on fire!"); - - /* Explodes a fireball centered at player */ - fball = get_archetype (EXPLODING_FIREBALL); - fball->dam_modifier = random_roll (1, op->level, op, PREFER_LOW) / 5 + 1; - fball->stats.maxhp = random_roll (1, op->level, op, PREFER_LOW) / 10 + 2; - fball->x = op->x; - fball->y = op->y; - insert_ob_in_map (fball, op->map, NULL, 0); + create_exploding_ball_at (op, op->level); } else cast_spell (op, tmp, op->facing, tmp->inv, NULL); @@ -380,7 +371,9 @@ /* Only thing left are the stat potions */ if (op->type == PLAYER) { /* only for players */ - if ((QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) && tmp->value != 0) + if ((QUERY_FLAG (tmp, FLAG_CURSED) + || QUERY_FLAG (tmp, FLAG_DAMNED)) + && tmp->value != 0) CLEAR_FLAG (tmp, FLAG_APPLIED); else SET_FLAG (tmp, FLAG_APPLIED); @@ -2435,6 +2428,28 @@ } /** + * This function generates a cursed effect for cursed lamps and torches. + */ +void player_apply_lamp_cursed_effect (object *who, object *op) +{ + if (op->level) + { + who->failmsg (format ( + "The %s was cursed, it explodes in a big fireball!", + &op->name)); + create_exploding_ball_at (who, op->level); + } + else + { + who->failmsg (format ( + "The %s was cursed, it crumbles to dust, at least it didn't explode.!", + &op->name)); + } + + op->destroy (); +} + +/** * Apply for players and lamps * * who - the player @@ -2467,6 +2482,12 @@ return; } + if (op->flag [FLAG_CURSED]) + { + player_apply_lamp_cursed_effect (who, op); + return; + } + if (lighter) who->statusmsg (format ( "You light up the %s with the %s.", &op->name, &lighter->name)); @@ -2475,6 +2496,12 @@ } else { + if (op->flag [FLAG_CURSED]) + { + player_apply_lamp_cursed_effect (who, op); + return; + } + if (op->type == TORCH) { if (!op->flag [FLAG_IS_LIGHTABLE])