--- deliantra/server/server/skills.C 2007/05/18 13:54:52 1.34 +++ deliantra/server/server/skills.C 2007/05/19 00:31:08 1.35 @@ -411,7 +411,6 @@ } } - /* HIDE CODE. The user becomes undetectable (not just 'invisible') for * a short while (success and duration dependant on player SK_level, * dexterity, charisma, and map difficulty). @@ -420,7 +419,6 @@ * Implemented by b.t. (thomas@astro.psu.edu) * July 7, 1995 - made hiding possible for monsters. -b.t. */ - static int attempt_hide (object *op, object *skill) { @@ -433,16 +431,19 @@ /* Hiding success and duration dependant on skill level, * op->stats.Dex, map difficulty and terrain. */ - number = (die_roll (2, 25, op, PREFER_LOW) - 2) / 2; + if (!stand_near_hostile (op) && (number < (op->stats.Dex + skill->level + terrain - difficulty))) { op->invisible += 100; /* set the level of 'hiddeness' */ + if (op->type == PLAYER) op->contr->tmp_invis = 1; + op->hide = 1; return 1; } + return 0; } @@ -450,7 +451,6 @@ int hide (object *op, object *skill) { - /* the preliminaries -- Can we really hide now? */ /* this keeps monsters from using invisibilty spells and hiding */ @@ -465,7 +465,7 @@ make_visible (op); } - if (op->invisible > (50 * skill->level)) + if (op->invisible > 50 * skill->level) { new_draw_info (NDI_UNIQUE, 0, op, "You are as hidden as you can get."); return 0; @@ -477,11 +477,11 @@ update_object (op, UP_OBJ_FACE); return calc_skill_exp (op, NULL, skill); } + new_draw_info (NDI_UNIQUE, 0, op, "You fail to conceal yourself."); return 0; } - /* stop_jump() - End of jump. Clear flags, restore the map, and * freeze the jumper a while to simulate the exhaustion * of jumping. @@ -1197,10 +1197,12 @@ else { for (tmp = pl->inv; tmp; tmp = tmp->below) - if (((tmp->type == ARMOUR && skill->level < 12) + if (((tmp->type == ARMOUR && skill->level < 12) || (tmp->type == HELMET && skill->level < 10) - || (tmp->type == SHIELD && skill->level < 6) - || (tmp->type == BOOTS && skill->level < 4) || (tmp->type == GLOVES && skill->level < 2)) && QUERY_FLAG (tmp, FLAG_APPLIED)) + || (tmp->type == SHIELD && skill->level < 6) + || (tmp->type == BOOTS && skill->level < 4) + || (tmp->type == GLOVES && skill->level < 2)) + && QUERY_FLAG (tmp, FLAG_APPLIED)) { new_draw_info (NDI_UNIQUE, 0, pl, "You can't concentrate while wearing so much armour!\n"); return;