Exemplo n.º 1
0
void build_save_specs()
{
     MOB_INDEX_DATA *pMob;
     
     if (Pointer==NULL)  /* Start */
      {
       if (CurSaveArea->first_area_specfunc==NULL)
	{
	 Section++;
	 return;
	}
       send_to_char("Saving specials.\n",CurSaveChar);
       fprintf(SaveFile,"#SPECIALS\n");
       Pointer=CurSaveArea->first_area_specfunc;
      }
    
     pMob=Pointer->data;

     fprintf(SaveFile,"M %i ",pMob->vnum);
     fprintf(SaveFile,"%s\n",rev_spec_lookup(pMob->spec_fun));


     Pointer=Pointer->next;
     if (Pointer==NULL) /* End */
      {
          fprintf(SaveFile,"S\n");
          Section++;
      }
      return;
}
Exemplo n.º 2
0
CHAR_DATA *get_quest_giver( int min_level, int max_level )
{
    CHAR_DATA *target = NULL;
    list<CHAR_DATA *>::iterator li;
    int min_index = 0;

    min_index = number_range(0, mob_index_list.size() - 1);

    for ( li = char_list.begin(); li != char_list.end(); li++ )
    {
        target = *li;
        if ( !IS_NPC( target ) )
            continue;
        min_index--;

        if ( min_index > 0 )
            continue;


        /*
         * Check if mobile is suitable for the quest -
         * Ignore mobs that are likely to be in well known places, such
         * as train/prac mobs, healers, etc
         */

        if ( ( target->level < min_level )
                || ( target->level > max_level )
                || ( IS_VAMP( target ) )
                || ( target->in_room->area->flags.test(AFLAG_NO_SHOW) )
                || ( target->act.test(ACT_SENTINEL) )
                || ( target->act.test(ACT_PET) )
                || ( !str_cmp( rev_spec_lookup( target->npcdata->spec_fun ), "spec_stephen" ) )
                || ( !str_cmp( rev_spec_lookup( target->npcdata->spec_fun ), "spec_tax_man" ) ) )

            continue;
        {
            if ( number_percent(  ) < 2 )
                break;
        }

    }

    if ( !IS_NPC(target) )
        target = NULL;

    return target;
}