Dmage Numbers

Posted by Saryn on Sat 23 Aug 2003 05:42 PM — 7 posts, 29,194 views.

USA #0
Ok I want to add an extra thing to fight messages.

Bob oliterates you! (244 dmg)

I know to start in fight.c but after that I am lost. I want to add the numbers at the end when taking and giving hits so people know how much damage they are doing to their targets or had bad they are getting smacked around. Any help?
Amended on Sat 23 Aug 2003 05:44 PM by Saryn
#1
find this piece of code in fight.c

sprintf( buf1, "$n's %s %s $N%c (%d)", attack, vp, punct );
sprintf( buf2, "Your %s %s $N%c (%d)", attack, vp, punct );
sprintf( buf3, "$n's %s %s you%c (%d)", attack, vp, punct );

and change it to read

sprintf( buf1, "$n's %s %s $N%c (%d)", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c (%d)", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c (%d)", attack, vp, punct, dam );

Amended on Sat 23 Aug 2003 05:54 PM by Yourdrunkendad
USA #2
Thank you! Works perfectly :P but now I have another probelm that I havnt seen befor..first time I've typed kill since I got the mud running.


3 [main] SEMBIA 1924 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION

593 [main] SEMBIA 1924 open_stackdumpfile: Dumping stack trace to sembia.exe
.stackdump

this looks greek to me. After:

Your (null) jolts Rupart! (2)

The mud crashes and the mud window returns the above stackdump error. Anybody know?

Edit: The null is barehand damage..I need to set that dmg type soon.
Amended on Sat 23 Aug 2003 07:14 PM by Saryn
Australia Forum Administrator #3
This doesn't look good:

Your (null) jolts Rupart! (2)

Sounds like "attack" is a null pointer. Better work out why.

USA #4
Make sure you've added your attack type to const.c

-Bobo
Canada #5
Also, I recently had to do this with my SWR code, if you have the mob set to have bite, sting, tail, or claw, the skills are not included in stock SWR and just close with {}'s, so you have to right them, make sure that the gsn's are in, as well as make the skills inside the game, making sure that you are setting the dammsg on them.
USA #6
OK this is the weirdest thing. It took out the dam out of the end of those 3 lines and fighitng doesnt crash my mud. Right now I just get

Log: [*****] BUG: Dam_message: bad dt 204 from rupart in 2000.
Rupart brushes you.
Log: [*****] BUG: Dam_message: bad dt 170 from rupart in 2000.

Havn't figured that one yet. But I noticed without the dam at the end of those 3 lines, it 1) doesn't crash my mud and 2) doesn't give a null when someone fights. Anybody have any thoughts?