How do you save the description that I edited? Does it have to do with HSET? And I want to add the damage thing to my MUD but it is written in C and my MUD code is based on C++ so what things would I need to change to make it into C++? Heres the code: :P
Overview: This will allow you to put damage into the damage display line
example: Xerves slices a dog for 120
File: fight.c
Code: Find this function
void new_dam_message( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt, OBJ_DATA *obj )
Next go down a few lines to find this code
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 );
}
Change that code to this
if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c for %d", vp, punct, dam );
sprintf( buf2, "You %s $N%c for %d", vs, punct, dam );
sprintf( buf3, "$n %s you%c for %d", vp, punct, dam );
}
Go down even farther to find this
sprintf( buf1, "$n's %s %s $N%c", attack, vp, punct );
sprintf( buf2, "Your %s %s $N%c", attack, vp, punct );
sprintf( buf3, "$n's %s %s you%c", attack, vp, punct );
And change it to this
sprintf( buf1, "$n's %s %s $N%c for %d", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c for %d", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c for %d", attack, vp, punct, dam );
Notes: dam is the value of the damage done to either you or the mob. If you
look closely you can see %d in the sprintf function and then dam at
the very end of the function. %d is used to tell the machine that it
is going to accept a number and dam will be that number.
Secondly, buf1 is to all but the attacker/defender
buf2 is to the attacker
buf3 is to the defender
|