Re: Dam Messages and Spells

From: ;P (siv@CYBERENET.NET)
Date: 01/31/98


>         I am trying to discover a way to put the amount of damage you take in the
> damage message. I just don't understand how replace_string quite works, as
> when I attempt to put it in, I get:

to do this, all you have to do is add the lines marked with a plus:

  act(buf, FALSE, ch, NULL, victim, TO_NOTVICT);

  /* damage message to damager */
  send_to_char(CCYEL(ch, C_CMP), ch);
+  sprintf(buf, "(%d Damage) ", dam);
+  send_to_char(buf, ch);
  buf = replace_string(dam_weapons[msgnum].to_char,
       attack_hit_text[w_type].singular, attack_hit_text[w_type].plural);
  act(buf, FALSE, ch, NULL, victim, TO_CHAR);
  send_to_char(CCNRM(ch, C_CMP), ch);

  /* damage message to damagee */
  send_to_char(CCRED(victim, C_CMP), victim);
+  sprintf(buf, "(%d Damage) ", dam);
+  send_to_char(buf, victim);
  buf = replace_string(dam_weapons[msgnum].to_victim,


this will show the damage to the person hitting and the person being
hit..you could also add it to the first one to show the onlookers..also,
you can do something similar in skill_message to have the damage show for
skills..it ends up looking like:

(23 Damage) You hit Tadrith hard!


as to the other thing, i would think that all you'd need to do is use the
spells[] array..then just do something like this:

sprintf(buf, "Your %s hits $n hard!", spells[spell_num]);
act(buf, ch, victim, NULL, TRUE);

you'd get spell_num from whatever the attack_type is..

all of the above is psuedo code..

siv


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST