Hmm.... Ok, now I'm confused. For the New_Dam_message, I changed what I thought I needed to but it didn't work, now I have an error and I'm not real sure what I did.. Any clue?
Here is the Error message I get:
error C2371: 'new_dam_message' : redefinition; different basic types
This is what my code looks like now:
void new_dam_message( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt, OBJ_DATA *obj )
{
char buf1[256], buf2[256], buf3[256];
char bugbuf[MAX_STRING_LENGTH];
const char *vs;
const char *vp;
const char *attack;
char punct;
sh_int dampc;
struct skill_type *skill = NULL;
bool gcflag = FALSE;
bool gvflag = FALSE;
int d_index, w_index;
ROOM_INDEX_DATA *was_in_room;
if ( ! dam )
dampc = 0;
else
dampc = ( (dam * 1000) / victim->max_hit) +
( 50 - ((victim->hit * 50) / victim->max_hit) );
if ( ch->in_room != victim->in_room )
{
was_in_room = ch->in_room;
char_from_room(ch);
char_to_room(ch, victim->in_room);
}
else
was_in_room = NULL;
/* Get the weapon index */
if ( dt > 0 && dt < top_sn )
{
w_index = 0;
}
else
if ( dt >= TYPE_HIT && dt < TYPE_HIT + sizeof(attack_table)/sizeof(attack_table[0]) )
{
w_index = dt - TYPE_HIT;
}
else
{
sprintf(bugbuf, "Dam_message: bad dt %d from %s in %d.",
dt, ch->name, ch->in_room->vnum );
bug( bugbuf, 0);
dt = TYPE_HIT;
w_index = 0;
}
/* get the damage index */
if(dam == 0)
d_index = 0;
else if(dampc < 0)
d_index = 1;
else if(dampc <= 100)
d_index = 1 + dampc/10;
else if(dampc <= 200)
d_index = 11 + (dampc - 100)/20;
else if(dampc <= 900)
d_index = 16 + (dampc - 200)/100;
else
d_index = 23;
/* Lookup the damage message */
vs = s_message_table[w_index][d_index];
vp = p_message_table[w_index][d_index];
punct = (dampc <= 30) ? '.' : '!';
if ( dam == 0 && (!IS_NPC(ch) &&
(IS_SET(ch->pcdata->flags, PCFLAG_GAG)))) gcflag = TRUE;
if ( dam == 0 && (!IS_NPC(victim) &&
(IS_SET(victim->pcdata->flags, PCFLAG_GAG)))) gvflag = TRUE;
if ( dt >=0 && dt < top_sn )
skill = skill_table[dt];
if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c", vp, punct );
sprintf( buf2, "You %s $N%c", vs, punct );
sprintf( buf3, "$n %s you%c", vp, punct );
}
else
if ( dt > TYPE_HIT && is_wielding_poisoned( ch ) )
{
if ( dt < TYPE_HIT + sizeof(attack_table)/sizeof(attack_table[0]) )
attack = attack_table[dt - TYPE_HIT];
else
{
sprintf(bugbuf, "Dam_message: bad dt %d from %s in %d.",
dt, ch->name, ch->in_room->vnum );
bug( bugbuf, 0);
dt = TYPE_HIT;
attack = attack_table[0];
}
sprintf( buf1, "$n's poisoned %s %s $N%c", attack, vp, punct );
sprintf( buf2, "Your poisoned %s %s $N%c", attack, vp, punct );
sprintf( buf3, "$n's poisoned %s %s you%c", attack, vp, punct );
}
else
{
if ( skill )
{
attack = skill->noun_damage;
if ( dam == 0 )
{
bool found = FALSE;
if ( skill->miss_char && skill->miss_char[0] != '\0' )
{
act( AT_HIT, skill->miss_char, ch, NULL, victim, TO_CHAR );
found = TRUE;
}
if ( skill->miss_vict && skill->miss_vict[0] != '\0' )
{
act( AT_HITME, skill->miss_vict, ch, NULL, victim, TO_VICT );
found = TRUE;
}
if ( skill->miss_room && skill->miss_room[0] != '\0' )
{
if (strcmp( skill->miss_room,"supress" ) )
act( AT_ACTION, skill->miss_room, ch, NULL, victim, TO_NOTVICT );
found = TRUE;
}
|