--- deliantra/server/server/attack.c 2006/03/26 08:32:11 1.6 +++ deliantra/server/server/attack.c 2006/06/14 07:33:03 1.15 @@ -405,7 +405,7 @@ || attack_mess[ATM_SUFFER][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_SUFFER][i].buf1, op->name, attack_mess[ATM_SUFFER][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_SUFFER][i].buf3); + strcpy (buf2, attack_mess[ATM_SUFFER][i].buf3); found++; break; } @@ -416,7 +416,7 @@ || attack_mess[ATM_DOOR][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_DOOR][i].buf1, op->name, attack_mess[ATM_DOOR][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_DOOR][i].buf3); + strcpy (buf2, attack_mess[ATM_DOOR][i].buf3); found++; break; } @@ -428,7 +428,7 @@ || attack_mess[ATM_KARATE][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_KARATE][i].buf1, op->name, attack_mess[ATM_KARATE][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_KARATE][i].buf3); + strcpy (buf2, attack_mess[ATM_KARATE][i].buf3); found++; break; } @@ -439,7 +439,7 @@ || attack_mess[ATM_CLAW][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_CLAW][i].buf1, op->name, attack_mess[ATM_CLAW][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_CLAW][i].buf3); + strcpy (buf2, attack_mess[ATM_CLAW][i].buf3); found++; break; } @@ -450,7 +450,7 @@ || attack_mess[ATM_PUNCH][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_PUNCH][i].buf1, op->name, attack_mess[ATM_PUNCH][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_PUNCH][i].buf3); + strcpy (buf2, attack_mess[ATM_PUNCH][i].buf3); found++; break; } @@ -463,7 +463,7 @@ for (i=0; i < MAXATTACKMESS; i++) if (dam < attack_mess[ATM_ARROW][i].level || attack_mess[ATM_ARROW][i+1].level == -1) { - sprintf(buf2, "%s", attack_mess[ATM_ARROW][i].buf3); + strcpy (buf2, attack_mess[ATM_ARROW][i].buf3); found++; break; } @@ -475,7 +475,7 @@ || attack_mess[ATM_DRAIN][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_DRAIN][i].buf1, op->name, attack_mess[ATM_DRAIN][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_DRAIN][i].buf3); + strcpy (buf2, attack_mess[ATM_DRAIN][i].buf3); found++; break; } @@ -486,7 +486,7 @@ || attack_mess[ATM_ELEC][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_ELEC][i].buf1, op->name, attack_mess[ATM_ELEC][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_ELEC][i].buf3); + strcpy (buf2, attack_mess[ATM_ELEC][i].buf3); found++; break; } @@ -497,7 +497,7 @@ || attack_mess[ATM_COLD][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_COLD][i].buf1, op->name, attack_mess[ATM_COLD][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_COLD][i].buf3); + strcpy (buf2, attack_mess[ATM_COLD][i].buf3); found++; break; } @@ -508,7 +508,7 @@ || attack_mess[ATM_FIRE][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_FIRE][i].buf1, op->name, attack_mess[ATM_FIRE][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_FIRE][i].buf3); + strcpy (buf2, attack_mess[ATM_FIRE][i].buf3); found++; break; } @@ -532,7 +532,7 @@ || attack_mess[mtype][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[mtype][i].buf1, op->name, attack_mess[mtype][i].buf2); - sprintf(buf2, "%s", attack_mess[mtype][i].buf3); + strcpy (buf2, attack_mess[mtype][i].buf3); found++; break; } @@ -543,15 +543,15 @@ || attack_mess[ATM_BASIC][i+1].level == -1) { sprintf(buf1, "%s %s%s", attack_mess[ATM_BASIC][i].buf1, op->name, attack_mess[ATM_BASIC][i].buf2); - sprintf(buf2, "%s", attack_mess[ATM_BASIC][i].buf3); + strcpy (buf2, attack_mess[ATM_BASIC][i].buf3); found++; break; } } if (!found) { - sprintf(buf1, "hit"); - sprintf(buf2, "hits"); + strcpy (buf1, "hit"); + strcpy (buf2, " hits"); } /* bail out if a monster is casting spells */ @@ -564,11 +564,10 @@ 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.", + sprintf(buf,"%s's %s%s you.", hitter->owner->name, hitter->name, buf2); else { sprintf(buf,"%s%s you.",hitter->name, buf2); @@ -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) */ @@ -1380,8 +1373,6 @@ op->owner->contr->ranges[range_golem]=NULL; op->owner->contr->golem_count=0; } - else - LOG (llevError, "BUG: hit_player(): Encountered golem without owner.\n"); remove_ob(op); free_object(op); @@ -1506,17 +1497,23 @@ if(owner!=op && !QUERY_FLAG(op, FLAG_WAS_WIZ)) { int exp; - exp = calc_skill_exp(owner,op, skop); - /* Really don't give much experience for killing other players */ + // schmorp: temporary? reduce the amount of exp gained for pking enourmously if (op->type==PLAYER) { if (battleg) { new_draw_info(NDI_UNIQUE, 0,owner, "Your foe has fallen!"); new_draw_info(NDI_UNIQUE, 0,owner, "VICTORY!!!"); } else - exp = MIN(5000000, MAX(0, exp/10)); - } + exp = op->stats.exp / 1000; + } + else + exp = calc_skill_exp(owner, op, skop); + + /* if op is standing on "battleground" (arena), no way to gain + * exp by killing him + */ + if (battleg) exp = 0; /* Don't know why this is set this way - doesn't make * sense to just divide everything by two for no reason. @@ -1525,11 +1522,6 @@ if (!settings.simple_exp) exp=exp/2; - /* if op is standing on "battleground" (arena), no way to gain - * exp by killing him - */ - if (battleg) exp = 0; - if(owner->type!=PLAYER || owner->contr->party==NULL) { change_exp(owner,exp, skill, 0); } @@ -1611,6 +1603,8 @@ friendlyfire = 0; if(op->type == PLAYER) { + if (op_on_battleground (hitter, 0, 0)) + return 0; if(hitter->type == PLAYER && hitter->contr->peaceful == 1) return 1; @@ -1660,7 +1654,7 @@ object *owner = get_owner (hitter); if (!owner) owner = hitter; if (owner->type == PLAYER - && !op_on_battleground (op, 0, 0) + && (!op_on_battleground (op, 0, 0) && (op->contr->peaceful || owner->contr->peaceful)) && op != owner) { return 0; } @@ -1775,7 +1769,7 @@ /* if this is friendly fire then do a set % of damage only * Note - put a check in to make sure this attack is actually - * doing damage - otherwise, the +1 in the coe below will make + * doing damage - otherwise, the +1 in the code below will make * an attack do damage before when it otherwise didn't */ friendlyfire = friendly_fire(op, hitter);