Well, it loops through the wear locations.
If you want to do this, the EASY way would be to create an array with the
wear locations in the order you want
and display them based on that.

and loop through it.

Original:
=========

    for (iWear = 0; iWear < MAX_WEAR; iWear++) {
           if (iWear == WEAR_SECOND && get_skill(ch, gsn_dual_wield) <25)
                 continue;
           if ((obj = get_eq_char(ch, iWear)) == NULL){
                  sprintf(buf, where_name[iWear], "{W", "{w", "{W", "{w");
                  send_to_char(buf, ch);                  
                  send_to_char("{yNothing.{x\n\r", ch);           
                  continue;
           }
           
           if (ch->level - obj->level < 5) 
                 sprintf(buf, where_name[iWear], "{G", "{g", "{G", "{x");
       
       else if (ch->level - obj->level < 10) 
                 sprintf(buf, where_name[iWear], "{Y", "{y", "{Y", "{x");
       else
                 sprintf(buf, where_name[iWear], "{R", "{r", "{R", "{x");
           
           send_to_char(buf, ch);
       
       
           if (can_see_obj(ch, obj)) {
                  send_to_char(format_obj_to_char(obj, ch, TRUE), ch);
                  send_to_char("\n\r", ch);
           } else {
                  send_to_char("{ySomething.{x\n\r", ch);
           }
    }

Change to:
==========
/* at the top */
int loop;
int wear_loc = {WEAR_HEAD, WEAR_NECK, WEAR_NECK1} /* etc etc */

/* the loop now look like this */
    for (loop = 0; loop < MAX_WEAR; loop++) {
        iWear = wear_loc[loop];
           if (iWear == WEAR_SECOND && get_skill(ch, gsn_dual_wield) <25)
                 continue;
           if ((obj = get_eq_char(ch, iWear)) == NULL){
                  sprintf(buf, where_name[iWear], "{W", "{w", "{W", "{w");
                  send_to_char(buf, ch);                  
                  send_to_char("{yNothing.{x\n\r", ch);           
                  continue;
           }
           
           if (ch->level - obj->level < 5) 
                 sprintf(buf, where_name[iWear], "{G", "{g", "{G", "{x");
       
       else if (ch->level - obj->level < 10) 
                 sprintf(buf, where_name[iWear], "{Y", "{y", "{Y", "{x");
       else
                 sprintf(buf, where_name[iWear], "{R", "{r", "{R", "{x");
           
           send_to_char(buf, ch);
       
       
           if (can_see_obj(ch, obj)) {
                  send_to_char(format_obj_to_char(obj, ch, TRUE), ch);
                  send_to_char("\n\r", ch);
           } else {
                  send_to_char("{ySomething.{x\n\r", ch);
           }
    }


I think that should work.

Reply via email to