DR] 타라님의! 염색약을 만들어보자!
첫째!
아이템을 추가하고나서, 아이템 속성값 을 '캐시'로 줍니다.
둘째!
스크립트를 추가해 봅시다.
item 천연염색약(파랑색) {
onuse:
set @id, myid();
set @sd, mysd();
// 이름과, 기간 수정
set @day, 30;
set @color, 75;
set #cash_item$, "천연염색약(파랑색)";
set #cash_expiration, @day*3600*24;
cashcolor @sd, 3, -1, -1, @color;
end;
}
위에서 이름과 기간을 자기 마음대로 수정하시면 됩니다~
셋째!
이벤트 스크립트 부분으로 가서
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;
}
이런식으로 추가해주시면 완료!
참! 쉽죠잉~

행복e 님의 최근 댓글