Like this?
//===== rAthena Script ================================
//= Costume Preview
//===== By: ==================================================
//= JETH-RO
//===== Last Updated: ========================================
//= 03-30-2017
//===== Description: =========================================
//= Costume Preview?
//============================================================
alexandria,165,177,4 script Costume Preview 509,{
setarray @look[0], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE);
@i = 0;
M_REPEAT:
@equip = getiteminfo(.items[@i], 5);
@view = getiteminfo(.items[@i], 11);
if(@equip != -1 && @view > 0) {
changelook LOOK_HEAD_BOTTOM, @look[0];
changelook LOOK_HEAD_TOP, @look[1];
changelook LOOK_HEAD_MID, @look[2];
changelook LOOK_ROBE, @look[3];
deltimer strnpcinfo(0)+"::OnEnd";
if ((@equip & 1) || (@equip & 4096)) changelook LOOK_HEAD_BOTTOM, @view;
else if ((@equip & 256) || (@equip & 1024)) changelook LOOK_HEAD_TOP, @view;
else if ((@equip & 512) || (@equip & 2048)) changelook LOOK_HEAD_MID, @view;
else if ((@equip & 4) || (@equip & 8192)) changelook LOOK_ROBE, @view;
addtimer 5000, strnpcinfo(0)+"::OnEnd";
}
@next = @i == getarraysize(.items)-1 ? 0 : @i+1;
@prev = @i == 0 ? getarraysize(.items)-1 : @i-1;
mes "[ ^FF0000Costume Preview^000000 ]";
mes "Item Name: ^6666ff"+getitemname(.items[@i])+"^000000";
mes "Item ID: "+.items[@i];
menu "Next [ ^6666ff"+getitemname(.items[@next])+" ^000000]",M_NEXT,"Previous [ ^6666ff"+getitemname(.items[@prev])+"^000000 ]",M_PREVIOUS,"Random",M_RANDOM;
end;
M_NEXT:
next;
@i = @next;
goto M_REPEAT;
end;
M_PREVIOUS:
next;
@i = @prev;
goto M_REPEAT;
end;
M_RANDOM:
next;
@i = rand(getarraysize(.items));
goto M_REPEAT;
end;
OnEnd:
changelook LOOK_HEAD_BOTTOM, @look[0];
changelook LOOK_HEAD_TOP, @look[1];
changelook LOOK_HEAD_MID, @look[2];
changelook LOOK_ROBE, @look[3];
end;
OnInit:
setarray .items[0],
31265,
31599,
31284,
31285,
31286,
31287,
31288,
31289,
31433,
31434,
31435,
31436,
31437,
31460,
31440,
31441,
31442,
31443,
31444,
31445,
31446,
31447,
31448,
31449,
31450,
31451,
31452,
31453,
31454,
31455,
31458,
31459,
31462,
31466,
31467;
end;
}