fighting mobs question

Posted by Lt_noodle on Sat 11 Jun 2005 05:25 PM — 10 posts, 37,991 views.

#0
Okay i searched about this and found nothing about but i found how to make the fight thingy like rom which is really good. But can someone tell me how to make it like every round you can see the condition of your opponents if he's dyin or if he's in excellent condition or whatever? Like in other rom games where the health of your opponent is located at the end of the round. This is an example: (got this from a different topic sorry for copyin.)



Your wrath *** DEVASTATES *** the Crested Gibbon! [71]
The Crested Gibbon is poisoned by the venom on the Blade of Denmark.
Your wrath *** DEVASTATES *** the Crested Gibbon! [65]
The Crested Gibbon is poisoned by the venom on the Blade of Denmark.
Your wrath misses the Crested Gibbon.
Your wrath *** DEVASTATES *** the Crested Gibbon! [72]
Your wrath *** DEVASTATES *** the Crested Gibbon! [74]
Your wrath *** DEVASTATES *** the Crested Gibbon! [64]
The Crested Gibbon is DEAD!!
You receive 0 experience points.
The Crested Gibbon's heart is torn from his chest.

Someone please help me. I tried everything and looked at fight.c because i know its in fight.c i even changed the damage outputs and all but it just won't work. Help me please. Thanks.
USA #1
Go here and click on code[a-f], then look under letter b and that gives you a battle prompt. Will need to port it a little for smaug.


http://darkoth.kyndig.com/


That should be what your looking for. It's an overall good site.

Ithildin

**********************Edit*************************

A quick search through the boards showed my original questions and a ported version for smaug.

Amended on Sat 11 Jun 2005 05:52 PM by Ithildin
#2
Umm it says for rom, not for smaug
USA #3
Read Ithildin's edit, there's a port.
#4
alright do i put that in fight.c void new_dam_message?
USA #5
If the function already exists, then you'll need to append the new changes to it.
#6
alright i downloaded the one from darkoth. I don't know where to put the code but i am workin on it but i got a question. How can i change the colors to the default smaugfuss color codes?
#7
damn i don't know what to do i looked everywhere for the
void bust_a_prompt( CHAR_DATA *ch )
on fight.c and i still can't find it.
USA #8
go into comm.c and find display_prompt

right after the case a break, put this:


        case 'C':  /* Tank */
	  //if ( !IS_IMMORTAL( ch ) ) break;
          if ( !ch->fighting || ( victim = ch->fighting->who ) == NULL )
             strcpy( pbuf, "N/A" );
          else if(!victim->fighting||(victim = victim->fighting->who)==NULL)
             strcpy( pbuf, "N/A" );
          else {
              if ( victim->max_hit > 0 )
                    percent = (100 * victim->hit) / victim->max_hit;
              else
                    percent = -1;
                   if (percent >= 100)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &gPerfect Health", victim->name );
                   else if (percent >= 90)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &OSlightly Scratched", victim->name);
                   else if (percent >= 80)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &YFew Bruises", victim->name);
                    else if (percent >= 70) 
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &YSome Cuts", victim->name);
                    else if (percent >= 60)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &PSeveral Wounds", victim->name);
                    else if (percent >= 50)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &pNasty Wounds", victim->name);
                    else if (percent >= 40)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &pBleeding Freely", victim->name);
                    else if (percent >= 30)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &rCovered in Blood", victim->name);
                    else if (percent >= 20)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &rLeaking Guts", victim->name);
                    else if (percent >= 10)
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &RAlmost Dead", victim->name);
                    else
                       sprintf (pbuf, "&g<&cT:&w%s &cTC: &RDYING", victim->name);
             }
          break;
        case 'c':
	  //if ( !IS_IMMORTAL( ch ) ) break;
          if ( !ch->fighting || ( victim = ch->fighting->who ) == NULL )
             strcpy( pbuf, "N/A" );
          else {
              if ( victim->max_hit > 0 )
                    percent = (100 * victim->hit) / victim->max_hit;
              else
                    percent = -1;
                if (percent >= 100)
                       sprintf (pbuf, "&cE:&w%s &cEC: &gPerfect Health&g>", victim->name);
                   else if (percent >= 90)
                       sprintf (pbuf, "&cE:&w%s &cEC: &OSlightly Scratched&g>", victim->name);
                   else if (percent >= 80)
                       sprintf (pbuf, "&cE:&w%s &cEC: &YFew Bruises&g>", victim->name);
                    else if (percent >= 70)
                       sprintf (pbuf, "&cE:&w%s &cEC: &YSome Cuts&g>", victim->name);
                    else if (percent >= 60)
                       sprintf (pbuf, "&cE:&w%s &cEC: &PSeveral Wounds&g>", victim->name);
                    else if (percent >= 50)
                       sprintf (pbuf, "&cE:&w%s &cEC: &pNasty Wounds&g>", victim->name);
                    else if (percent >= 40)
                       sprintf (pbuf, "&cE:&w%s &cEC: &pBleeding Freely&g>", victim->name);
                    else if (percent >= 30)
                       sprintf (pbuf, "&cE:&w%s &cEC: &rCovered in Blood&g>", victim->name);
                    else if (percent >= 20)
                       sprintf (pbuf, "&cE:&w%s &cEC: &rLeaking Guts&g>", victim->name);
                    else if (percent >= 10)
                       sprintf (pbuf, "&cE:&w%s &cEC: &RAlmost Dead&g>", victim->name);
                    else
                       sprintf (pbuf, "&cE:&w%s &cEC: &RDYING&g>", victim->name);
           }
          break;


And then modify it to your liking.

*****edit*****

You will also have to change your default_prompts. Find char *default_fprompt and char *default_prompt and put this in instead:


char *default_fprompt( CHAR_DATA *ch )
{
  static char buf[60];

  strcpy(buf, "<&g%hhp ");
  if ( IS_VAMPIRE(ch) )
    strcat(buf, "&R%bbp ");
    
  else
  strcat(buf, " &g%vmv> ");
  
  if ( IS_NPC(ch) || IS_IMMORTAL(ch) )
    strcat(buf, "%i%R");
  strcat(buf, "\n\r%C %c ");  
  return buf;
}

char *default_prompt( CHAR_DATA *ch )
{
  
		
  static char buf[60];

  strcpy(buf, "&g<%hhp ");
  if ( IS_VAMPIRE(ch) )
    strcat(buf, "&R%bbp");
  else
  strcat(buf, " &g%vmv> ");
  strcat(buf, "\n\r&g<   > ");
   
  return buf;
	


}


That should do the trick for you.
Amended on Sun 12 Jun 2005 05:36 AM by Ithildin
#9
alright i got some minor problems after that but it worked out real good. Thanks man. NOW THE AUTOMAPPER.