Jump to content
  • 0

Call function enchant 3rd hidden socket


Rizz

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  07/29/17
  • Last Seen:  

Hello, I have tested a script made by Emistry called Usable Enchant item. However, the script doesn't work properly in latest Ra. For that reason, I ask a help to create or modify the existing script so that It can enchant 3rd hidden slot with a specific status stone like STR+1 etc to specific headgear/equipment. 

For example an item like Magic Scroll can be used to enchant Hat [1] with random Status stone.

 

// usage:
// callfunc( "F_DiabloEnchant",<delete item id>,<bonus item id> );

function	script	F_DiabloEnchant	{
	.@itemid = getarg( 0,0 );
	.@enchant = getarg( 1,0 );
	if ( .@itemid && .@enchant ) {
		for ( .@i = EQI_HEAD_TOP; .@i < EQI_ACC_R; .@i++ ) {
			.@equip_itemid = getequipid( .@i );
			.@menu$ = .@menu$ + ( .@equip_itemid == -1 ? "": getitemname( .@equip_itemid ) ) + ":";
		}
		.@i = select( .@menu$ );
		.@equip_itemid = getequipid( .@i );
		.@equip_refine = getequiprefinerycnt( .@i );
		for ( .@c = 0; .@c < 4; .@c++ ) 
			.@card[.@c] = getequipcardid( .@i,.@c );
		
		if ( .@card[0] && .@card[0] < 4001 ) {
			mes "Signed Item can't be enchanted.";
		}
		// else if ( .@card[3] ) {
			// mes "This item has been enchanted. Cant enchant twice.";
		// }
		else {
			delequip .@i;
			delitem .@itemid,1;
			.@card[3] = .@enchant;
			getitem2 .@equip_itemid,1,1,.@equip_refine,0,.@card[0],.@card[1],.@card[2],.@card[3];
			// equip2 .@equip_itemid,.@equip_refine,0,.@card[0],.@card[1],.@card[2],.@card[3];
			specialeffect2 154;
			message strcharinfo(0),"Enchant Success!";
		}
		close;
	}
	return;
}



 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...