event OnPCColor {
// @type == 4, 컬러 0~7
set @id, myid();
set @sd, mysd();
set @e_type, .type & 0x07;
set @slot, .type & 0x08;
set @type, (.type & 0xE0) >> 5;
set @color, (.type & 0x3FF00) >> 9; // 필요 x -> type: 5
set @rcolor, ((@color%32 == 24) ? rand(@color-24, @color+8) : 0x00);
if (checkitem(@sd, name2item_id(#cash_item$), 1) == 0) {
message @sd, 8, #cash_item$ + "이 필요합니다.\n( @ bug!!!!!!! )";
end;
}
switch (@e_type) {
case 0: // 얼굴장식
case 1: // 머리장식
case 2: // 망토
case 3: // 겉옷
case 4: // 신발
delitem @sd, name2item_id(#cash_item$), 1;
switch (@type) {
case 1: // 랜덤 + 색 선택 염색
// @color:후, @rcolor:선 이용해서 색상 입혀주기.
if (@rcolor) set @color, @rcolor;
break;
case 2: // 기간 연장
break;
case 5: // 한 부위 염색
if (@rcolor) set @color, @rcolor;
switch (@e_type) {
case 0: // 얼굴장식
if (@slot) { // 2번째 슬롯 염색
set_faceacccolor2 @sd, 0, @color;
set_faceacccolor2 @sd, 1, @color;
set_faceacccolor2_expiration @sd, 0, gettimetick(3) + #cash_expiration;
set_faceacccolor2_expiration @sd, 1, gettimetick(3) + #cash_expiration;
} else {
set_faceacccolor1 @sd, 0, @color;
set_faceacccolor1 @sd, 1, @color;
set_faceacccolor1_expiration @sd, 0, gettimetick(3) + #cash_expiration;
set_faceacccolor1_expiration @sd, 1, gettimetick(3) + #cash_expiration;
}
set #cash_expiration, 0;
if (@slot) { set @slot, 1; }
cashcolor @sd, 1, @e_type+8, @slot, 0;
updatelookpc @sd, 1;
break;
case 1: // 머리장식
break;
case 2: // 망토
break;
case 3: // 겉옷
break;
case 4: // 신발
break;
}
break;
case 6: // 염색 지우기
break;
}
break;
}
end;
}