I`m having some problems with combat. Basically, whenever a player hits a bob for damage, the next line has a little chunk of odd text in front of it. This text is sometimes something from another room in the area, and sometimes just nonsense(as far as I can tell. Let me give you an example:
Your slash lacerates a lemure! [1]
C"A lemure thrashes you! [1]
I can only think of two things that could be causing this, but I can't see in eaither of them what the problem is. In fight.c, I added an autoglance snippet to violence_update that looks like this:
if ( IS_AWAKE(ch) && ch->in_room == victim->in_room )
{
retcode = multi_hit( ch, victim, TYPE_UNDEFINED );
/*
* Just some checks to keep the code from going off at unnecessary times.
* Also moved the call to show_condition after the call to multi_hit. This
* is to make sure the damage shown is accurate. -Orion Elder
*/
if ( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_AUTOGLANCE )
&& ch != NULL && victim != NULL && who_fighting( ch ) == victim
&& !char_died( victim ) && !char_died( ch ) )
{
show_condition( ch, victim );
}
}
And also in fight.c, I changed new_dam_message to numerically display the amount of damage inflicted or received. For regular hits:
if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c [%i]", vp, punct, dam );
sprintf( buf2, "You %s $N%c [%i]", vs, punct, dam );
sprintf( buf3, "$n %s you%c [%i]", vp, punct, dam );
}
For poisoned hits:
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 [%i]", attack, vp, punct, dam );
sprintf( buf2, "Your poisoned %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf3, "$n's poisoned %s %s you%c [%i]", attack, vp, punct, dam );
}
And another one of these:
sprintf( buf1, "$n's %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c [%i]", attack, vp, punct, dam );
Any idea what the problem is? I can clarify anything you have questions about. |