13 Dec, 2006, gazzy123 wrote in the 1st comment:
Votes: 0
I need help figuring out how to do a combined dam_message to the player if he sets combatbrief on, then he should only see the total amound of damage he does that round. When I tried I got conflicts with the spells.. and first damage round, they didn't show.

I've defined a var in ch->num_damage that I use to store the damage.

in damage() I use this:

dam_message( ch, victim, dam, dt, immune );
if (!immune)
{
ch->num_damage += dam;
}

to save the amound of damage.


in dam_message I do this:

if (ch == victim)
{
act(buf1,ch,NULL,NULL,TO_ROOM);
act(buf2,ch,NULL,NULL,TO_CHAR);
}
else
{
list = ch->in_room->people;


if (!immune)
{
sprintf( buf4, "%s's %s %s %s %c\n\r", !IS_NPC(ch) ? ch->name : ch->short_descr, attack, va, !IS_NPC(victim) ? victim->name : victim->short_descr, punct);
}
else
{
sprintf( buf4, "%s's is unaffected by %s's %s\n\r", !IS_NPC(ch) ? ch->name : ch->short_descr, !IS_NPC(victim) ? victim->name : victim->short_descr, attack);
}
for ( rch = list; rch != NULL; rch = rch->next_in_room )
{
if ( rch == ch )
continue;
if ( rch == victim )
continue;

if (!IS_SET(rch->comm, COMM_UBRIEF))
send_to_char( buf4, rch );
}

if (IS_NPC(ch) || ( dt >= 0 && dt < MAX_SKILL ))
{
act( buf2, ch, NULL, victim, TO_CHAR );
}
else if (!IS_SET(ch->comm, COMM_UBRIEF))
act( buf2, ch, NULL, victim, TO_CHAR );


if (IS_NPC(ch) || ( dt >= 0 && dt < MAX_SKILL ))
{
act( buf3, ch, NULL, victim, TO_VICT );
}
else if (!IS_SET(victim->comm, COMM_UBRIEF))
act( buf3, ch, NULL, victim, TO_VICT );
}


and then at end of multi_hit I have a call to a function that is showing the ch->num_damage to the char, victim and the in_room people.

someway the first attack if I type "kill <player>" doesnt show the first attack but the other rounds are ok, also it doens't show freezing for example when using a freezing weapon.

so if anyone got a better idea that could help me please tell me cause I'm going insane soon.
13 Dec, 2006, Omega wrote in the 2nd comment:
Votes: 0
DoC Codebase has something like this, either DoC or DRM (both rot)

One or the Other contains the code todo this.
13 Dec, 2006, gazzy123 wrote in the 3rd comment:
Votes: 0
What is DoC?
13 Dec, 2006, Omega wrote in the 4th comment:
Votes: 0
DoC is a ROT mud, and it may contain the damage code, its either DOC or DRM, i can never remember which one has it.

I used to use the damage system from it, it allowed a player to basicaly 'turn off' damage spam, so you'd only see the amount of damage delt to you within a round, (if you so wanted to) aswell as configure the ability to turn off seeing stuff like dodging/parrying, so you could essentaily cut down on combat spam.

I'm currently working on my own version of this now, because frankly, its cool, and i want it again. :P
13 Dec, 2006, gazzy123 wrote in the 5th comment:
Votes: 0
I cannot find DoC anywhere on the net. could you perhaps tell me where to get it?
13 Dec, 2006, Davion wrote in the 6th comment:
Votes: 0
I don't really know how well you know your ROM, but here's a theory :). Store a 2 cell array on your pc character ->
int dam[2];


In in dam_message if the attacker has brief on, don't send them the string, instead,

attacker->pcdata->dam[DAM_GIVEN]+= dam;


if the victim has breif on, don't send them the message, and

attacker->pcdata->dam[DAM_TAKEN] += dam;


Then, after the round is over (violence_update finish it's loop) loop through all the pc's and send them the brief. Something like
for(d = descriptor_list ; d ; d = d->next)
{ CHAR_DATA *ch = d->character ? d->character : d->original;
if(!ISSET(ch->comm, PLR_COMBATBRIEF) ) continue;
printf_to_char(ch, "You did %d damage that round.\r\nYou took %d damage that round.", ch->pcdata->dam[DAM_GIVEN], ch->pcdata->dam[DAM_TAKEN]);
ch->pcdata->dam[DAM_GIVEN] = ch->pcdata->dam[DAM_TAKEN] = 0;
}


This is all theory with some code that look like it works :) No promises!
13 Dec, 2006, gazzy123 wrote in the 7th comment:
Votes: 0
if (( dt >= 0 && dt < MAX_SKILL ))
{
if ((!IS_SET(ch->comm, COMM_UBRIEF)) || skill_table[dt].slot!=0)
act( buf2, ch, NULL, victim, TO_CHAR );
}

throwed that in to check if the damagetype is froma spell or not.. and if it is it displays the normal damage… this works.. now I just got the problem with the first damageround right after "kill" doesn.,t show when briefultra
13 Dec, 2006, Omega wrote in the 8th comment:
Votes: 0
DoC can be evily found at mudmagic.com, and i hate posting that address, but its the only site where the guy posts his DoC updates.

nevermind, he removed his posts. I'll see if i can dig up my old copy.
13 Dec, 2006, cbunting wrote in the 9th comment:
Votes: 0
Hello,

Do you want to show the total damage or all of the hits combined? I use + or -BATTLESELF, I'm using merc with config -+..

Your attacks strike the red dragon 5 times, with *MUTILATING* brutality!
The red dragon has fled south!

Anyway, Is this what you are trying to achive?

Chris

BTW: I got the code to do this out of the Dalaken Codebase. Just grep the source for BATTLESELF AND BATTLEOTHER.. There is also a purge_spam function that takes care of combining the messages.
0.0/9