Code:
int dam = 0;
one_argument(argument, arg);
if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM))) {
if (FIGHTING(ch) && IN_ROOM(ch) == IN_ROOM(FIGHTING(ch))) {
vict = FIGHTING(ch);
} else {
send_to_char(ch, "Exactly whom did you wish to attack?\r\n");
return;
}
}
if (vict == ch) {
send_to_char(ch, "Your mother would be sad!\r\n");
return;
}
percent = rand_number(1, 115);
prob = GET_SKILL(ch, SKILL_***);
if (percent > prob) {
damage(ch, vict, 0, SKILL_***);
} else
if (GET_LEVEL(vict) < LVL_IMMORT) {
if (GET_LEVEL(ch)>0) potency=1;
if (GET_LEVEL(ch)>1) potency++;
if (GET_LEVEL(ch)>4) potency++;
if (GET_LEVEL(ch)>7) potency++;
if (GET_LEVEL(ch)>10) potency++;
if (GET_LEVEL(ch)>20) potency+=2;
if (GET_LEVEL(ch)>30) potency+=2;
if (GET_LEVEL(ch)>40) potency+=2;
if (GET_LEVEL(ch)>49) potency+=2;
if (GET_LEVEL(ch)>54) potency+=2;
if (GET_LEVEL(ch)>57) potency=17;
if ((potency<14) && (rand_number(1, 50) < GET_LEVEL(vict)))
potency--;
switch(potency) {
case 0:
dam = 1;
break;
case 1:
dam = rand_number(1,4);
break;
case 2:
dam = rand_number(2,10);
break;
case 3:
dam = rand_number(3,12);
break;
case 4:
dam = rand_number(4,16);
break;
case 5:
dam = 20;
break;
case 6:
dam = 20;
break;
case 7:
dam = 35;
break;
case 8:
dam = 50;
break;
case 9:
dam = 70;
break;
case 10:
dam = 75;
break;
case 11:
dam = 100;
break;
case 12:
dam = 100;
break;
case 13:
dam = 150;
break;
case 14:
case 15:
case 16:
case 17:
dam = 150;
break;
}
}
damage(ch, vict, dam, SKILL_***);
And how come it some times fires twice (in like 1/5 times) ?
The cityguard is missed by your *****.
The cityguard is missed by your *****.
If i instead use:
damage(ch, vict, 10, SKILL_***);
Then i haven't seen it fire twice, any ideas ??