Emistry icon

[RO] Custom Craftsman - Category

Emistry | PRO | 06/04/16 02:38:14 PM UTC | 0 ⭐ | 561 👁️ | Never ⏰ | []
text |

1.68 KB

|

None

|

0 👍

/

0 👎

 // https://rathena.org/board/topic/106039-custom-craftsman/ 
 prontera,155,175,5	script	Craftman#xilence01	4_F_KAFRA9,{
	// success rate
	.@rate = 100;
	// required item
	setarray .@item,7227,10;
 	mes "Enchant Equipment: "+.@item[1]+"x "+getitemname( .@item[0] );
	switch ( select(
		"Armors",
		"Shields",
		"Garment",
		"Footgear",
		"Cancel"
	)) {
		case 1: 
			.@position = EQI_ARMOR;
			.@enchant = rand( 28000,28005 ); 
			break;
		case 2: 
			.@position = EQI_HAND_R;
			.@enchant = rand( 28006,28010 );
			break;
		case 3: 
			.@position = EQI_GARMENT;
			.@enchant = rand( 28010,28015 ); 
			break;
		case 4: 
			.@position = EQI_SHOES;
			.@enchant = rand( 28016,28020 );
			break;
		default: break;
	}
	if ( .@enchant ) {
		.@itemid = getequipid( .@position );
		if ( .@itemid <= 0 || getiteminfo( .@itemid,2 ) != IT_ARMOR ) {
			mes "You didnt wear any equipment.";
		}
		else if ( getequipcardid( .@position,1 ) ) {
			mes "The equipment already enchanted.";
		}
		else if ( countitem( .@item[0] ) < .@item[1] ) {
			mes "You didnt have "+.@item[1]+"x "+getitemname( .@item[0] );
		}
		else {
 			.@refine = getequiprefinerycnt( .@position );
			.@card1 = getequipcardid( .@position,0 );
			// .@card2 = getequipcardid( .@position,1 );
			.@card2 = .@enchant;
			.@card3 = getequipcardid( .@position,2 );
			.@card4 = getequipcardid( .@position,3 );
 			delequip .@position;
			delitem .@item[0],.@item[1]; 
 			if ( rand( 100 ) < .@rate ) {
				getitem2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
				mes "Success enchanted with "+getitemname( .@card2 );
			}
			else {
				mes "Fail";
			}
		}
	}	
	close;
}

Comments