--- deliantra/server/server/attack.c 2006/02/22 18:03:19 1.1.1.2 +++ deliantra/server/server/attack.c 2006/05/03 05:50:06 1.12 @@ -564,8 +564,7 @@ return; /* Did a player hurt another player? Inform both! */ - /* only show half the player->player combat messages */ - if(op->type==PLAYER && rndm(0, 1) && + if(op->type==PLAYER && (get_owner(hitter)==NULL?hitter->type:hitter->owner->type)==PLAYER) { if(get_owner(hitter)!=NULL) sprintf(buf,"%s's %s %s you.", @@ -584,8 +583,7 @@ new_draw_info(NDI_BLACK, 0,op,buf); } /* end of player hitting player */ - /* scale down these messages too */ - if(hitter->type==PLAYER && rndm(0, 2) == 0) { + if(hitter->type==PLAYER) { sprintf(buf,"You %s.",buf1); if (dam != 0) { if (dam < 10) @@ -875,7 +873,7 @@ object *hit_with_arrow (object *op, object *victim) { object *container, *hitter; - int hit_something; + int hit_something = 0; tag_t victim_tag, hitter_tag; sint16 victim_x, victim_y; @@ -1191,15 +1189,10 @@ int rate; if(op->resist[ATNR_DRAIN] >= 0) - rate = 50 + op->resist[ATNR_DRAIN] / 2; - else if(op->resist[ATNR_DRAIN] < 0) - rate = 5000 / (100 - op->resist[ATNR_DRAIN]); + rate = 400 + op->resist[ATNR_DRAIN] * 3; + else + rate = 400 * 100 / (100 - op->resist[ATNR_DRAIN]); - /* full protection has no effect. Nothing else in this - * function needs to get done, so just return. */ - if(!rate) - return 0; - if(op->stats.exp <= rate) { if(op->type == GOLEM) dam = 999; /* Its force is "sucked" away. 8) */ @@ -1655,6 +1648,18 @@ if (QUERY_FLAG (op, FLAG_WIZ) || QUERY_FLAG (op, FLAG_NO_DAMAGE)) return 0; +#ifdef PROHIBIT_PLAYERKILL + if (op->type == PLAYER) { + object *owner = get_owner (hitter); + if (!owner) owner = hitter; + if (owner->type == PLAYER + && (!op_on_battleground (op, 0, 0) && (op->contr->peaceful || owner->contr->peaceful)) + && op != owner) { + return 0; + } + } +#endif + op_tag = op->count; hitter_tag = hitter->count; @@ -1768,8 +1773,11 @@ */ friendlyfire = friendly_fire(op, hitter); if (friendlyfire && maxdam){ - maxdam = ((dam * settings.set_friendly_fire) / 100)+1; - + maxdam = ((dam * settings.set_friendly_fire) / 100); +#ifndef COZY_SERVER + maxdam++; +#endif + #ifdef ATTACK_DEBUG LOG(llevDebug,"Friendly fire (type:%d setting: %d%) did %d damage dropped to %d\n", friendlyfire, settings.set_friendly_fire, dam, maxdam);