Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
614
BenitoVirg
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » breath mobs are biased based ...
Forum Rules | Mark all | Recent Posts

breath mobs are biased based on room order
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 1, 2006, 11:35 am   Last edited Sep 2, 2006, 6:47 am by Valcados
Go to the top of the page
Go to the bottom of the page

Valcados
Apprentice
GroupMembers
Posts63
JoinedAug 25, 2006

In special.c, find this:

bool dragon( CHAR_DATA * ch, char *fspell_name )
{
   CHAR_DATA *victim;
   CHAR_DATA *v_next;
   int sn;

   if( ch->position != POS_FIGHTING
       && ch->position != POS_EVASIVE
       && ch->position != POS_DEFENSIVE && ch->position != POS_AGGRESSIVE && ch->position != POS_BERSERK )
      return FALSE;

   for( victim = ch->in_room->first_person; victim; victim = v_next )
   {
      v_next = victim->next_in_room;
      if( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
         break;
   }

   if( !victim )
      return FALSE;

   if( ( sn = skill_lookup( fspell_name ) ) < 0 )
      return FALSE;
   ( *skill_table[sn]->spell_fun ) ( sn, ch->level, ch, victim );
   return TRUE;
}


Change it to this:
bool dragon( CHAR_DATA * ch, char *fspell_name )
{
   CHAR_DATA *victim, *chosen = NULL;
   int sn, count=0;

   if( ch->position != POS_FIGHTING
       && ch->position != POS_EVASIVE
       && ch->position != POS_DEFENSIVE && ch->position != POS_AGGRESSIVE && ch->position != POS_BERSERK )
      return FALSE;

   for( victim = ch->in_room->first_person; victim; victim = v->next_in_room )
   {
      if( who_fighting( victim ) != ch )
        continue;
      if ( !number_range(0,count) )
        chosen = victim, count++;        
   }

   if( !chosen )
      return FALSE;

   if( ( sn = skill_lookup( fspell_name ) ) < 0 )
      return FALSE;
   ( *skill_table[sn]->spell_fun ) ( sn, ch->level, ch, chosen );
   return TRUE;
}


EDIT: Fixed a typo.
       
Pages:<< prev 1 next >>