28 May, 2012, halmud wrote in the 1st comment:
Votes: 0
I have managed to get melee damage to show for the attacker, and the attacked. But I cannot seem to get it for spells. Anyone have any success doing this?

Thanks!

Hal
29 May, 2012, Vatiken wrote in the 2nd comment:
Votes: 0
Although I have no idea which version of circleMUD you are using I will take a guess that you put your damage displays in the hit() function. Spells and other non-round combat damage is run through the damage() function.
29 May, 2012, halmud wrote in the 3rd comment:
Votes: 0
Mostly TBA (Circle Derivative)

It was simple to show them for regular melee hits, but having trouble with spells/skills.
29 May, 2012, halmud wrote in the 4th comment:
Votes: 0
Right below where I did it for melee hits, I noticed this. But not sure if it is even remotely close to where I need to be
to do this for spells/skills.

/* message for doing damage with a spell or skill. Also used for weapon
* damage on miss and death blows. */
int skill_message(int dam, struct char_data *ch, struct char_data *vict,
int attacktype)
{
int i, j, nr;
struct message_type *msg;

struct obj_data *weap = GET_EQ(ch, WEAR_WIELD);

for (i = 0; i < MAX_MESSAGES; i++) {
if (fight_messages.a_type == attacktype) {
nr = dice(1, fight_messages.number_of_attacks);
for (j = 1, msg = fight_messages.msg; (j < nr) && msg; j++)
msg = msg->next

if (!IS_NPC(vict) && (GET_LEVEL(vict) >= LVL_IMPL)) {
act(msg->god_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);
act(msg->god_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT);
act(msg->god_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT);
} else if (dam != 0) {
29 May, 2012, plamzi wrote in the 5th comment:
Votes: 0
You may have "fight_message" as well as "skill_message". One is for "default" attacks and the other is for attacks listed in the skill table. Spells are the latter, so "skill_message" should be a good place to intercept them. But there's a slight problem if you want the damage to be shown on the same line as the attack message. The function "act" auto-appends CR/LF and accepts a limited number of arguments. The easiest thing to do probably would be to create a modified act_something function to you can pass "dam" to it, and it would print it anywhere you want it in the skill message.

This is a relatively simple task, but let me know how it goes.
29 May, 2012, Vatiken wrote in the 6th comment:
Votes: 0
/* Set the maximum damage per round and subtract the hit points */
dam = MAX(MIN(dam, 100), 0);
GET_HIT(victim) -= dam;

+send_to_char(ch, "[Damage: %d] ", dam);


I'd argue that the easiest way would be to just slap this in the damage() function as it will display the damage before both melee and skill/spell messages.

If you'd wish for the damage to be shown following the attack message then plamzi is correct, as "act" will append the CR/LF and thus any damage display would be shown on the following line. Unless you modified it of course.
29 May, 2012, halmud wrote in the 7th comment:
Votes: 0
That worked beautifully, Many thanks ;)

It is usually the simple solutions that I will always overlook lol. I was making it over complicated.

Thanks!!
0.0/7