Jump to content
  • 0

Armor Enchant that selects what you equipped


Yudax

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

- How to set that it will only give Min-Max stat ( +1 - +3 )?

- The requirement is 10TCG each

- Then they can enchant this armor for 3 times only.

Crystilia,63,73,5	script	Armor Echant	100,{
mes "[^0000FFArmor Enchant^000000]";
mes "Do you want to Enchat your ^0000FFArmor^000000?";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
if ( !getequipisequiped( EQI_ARMOR ) ) {
	mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
	close;
}
.@id = getequipid( EQI_ARMOR );
.@ref = getequiprefinerycnt( EQI_ARMOR );
.@card1 = getequipcardid( EQI_ARMOR, 0 );
.@card2 = getequipcardid( EQI_ARMOR, 1 );
.@card3 = getequipcardid( EQI_ARMOR, 2 );
.@card4 = getequipcardid( EQI_ARMOR, 3 );
if ( .@card1 == 255 || .@card1 == 254 ) {
	mes "[^0000FFArmor Enchant^000000]";
	mes "I can't enchant a signed equipment.";
	close;
}
if ( .@card4 ) {
	mes "[^0000FFArmor Enchant^000000]";
	mes "Sorry, this ^0000FFArmor^000000 has already been enchanted.";
	close;
}

.@rand = rand(.totalchance);
while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
.@o = rand(0,5); // orb of str/int/dex ....

delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0;
getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
equip .@id;
close;
OnInit:
setarray .rate, 55,50,45,40,35,30,25,20,15,10; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...

while ( .@i < 10 ) {
	.totalchance = .totalchance + .rate[.@i];
	.@i++;
}
end;
}

Edited by Emistry
Please use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

- How to set that it will only give Min-Max stat ( +1 - +3 )?

- The requirement is 10TCG each

Crystilia,63,73,5    script    Armor Echant    100,{
   mes "[^0000FFArmor Enchant^000000]";
   mes "Do you want to Enchat your ^0000FFArmor^000000?";
   if ( .item )
       mes "You will need "+ .ask$;
   next;
   if ( select ( "Yes", "No" ) == 2 ) close;
   if ( !getequipisequiped( EQI_ARMOR ) ) {
       mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
       close;
   }
   .@id = getequipid( EQI_ARMOR );
   .@ref = getequiprefinerycnt( EQI_ARMOR );
   .@card1 = getequipcardid( EQI_ARMOR, 0 );
   .@card2 = getequipcardid( EQI_ARMOR, 1 );
   .@card3 = getequipcardid( EQI_ARMOR, 2 );
   .@card4 = getequipcardid( EQI_ARMOR, 3 );
   if ( .@card1 == 255 || .@card1 == 254 ) {
       mes "[^0000FFArmor Enchant^000000]";
       mes "I can't enchant a signed equipment.";
       close;
   }
   if ( .@card4 ) {
       mes "[^0000FFArmor Enchant^000000]";
       mes "Sorry, this ^0000FFArmor^000000 has already been enchanted.";
       close;
   }
   if ( .item ) {
       for ( .@j = 0; .@j < getarraysize( .item ); .@j += 2 )
           if ( countitem( .item[.@j] ) < .item[.@j+1] ) {
               mes "[^0000FFArmor Enchant^000000]";
               mes "You need "+ (.item[.@j+1] - countitem( .item[.@j] )) + " " + getitemname( .item[.@j] ) + " to process.";
               close;
           }
       for ( .@j = 0; .@j < getarraysize( .item ); .@j += 2 )
           delitem .item[.@j], .item[.@j+1];
   }

   .@rand = rand(.totalchance);
   while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
   .@o = rand(0,5); // orb of str/int/dex ....

   delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0;
   getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
   equip .@id;
   close;
OnInit:
   setarray .rate, 55,50,45; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...

   while ( .@i < 10 ) {
       .totalchance = .totalchance + .rate[.@i];
       .@i++;
   }

   setarray .item, 7227, 10;        // ID / number of items
   while ( .@j < getarraysize( .item ) ) {
       .ask$ = .ask$ + .item[.@j+1] + " " + getitemname( .item[.@j] ) + ( .@j+2 > getarraysize( .item ) ? ",":"." );
       .@j += 2;
   }

   end;
}

- Then they can enchant this armor for 3 times only.

Sorry i don't get it. In this script, once the armor is enchanted you can't re-enchant it. You want multi-enchant ? another try to enchant ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

- How to set that it will only give Min-Max stat ( +1 - +3 )?

- The requirement is 10TCG each

Crystilia,63,73,5	script	Armor Echant	100,{
mes "[^0000FFArmor Enchant^000000]";
mes "Do you want to Enchat your ^0000FFArmor^000000?";
if ( .item )
	mes "You will need "+ .ask$;
next;
if ( select ( "Yes", "No" ) == 2 ) close;
if ( !getequipisequiped( EQI_ARMOR ) ) {
	mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
	close;
}
.@id = getequipid( EQI_ARMOR );
.@ref = getequiprefinerycnt( EQI_ARMOR );
.@card1 = getequipcardid( EQI_ARMOR, 0 );
.@card2 = getequipcardid( EQI_ARMOR, 1 );
.@card3 = getequipcardid( EQI_ARMOR, 2 );
.@card4 = getequipcardid( EQI_ARMOR, 3 );
if ( .@card1 == 255 || .@card1 == 254 ) {
	mes "[^0000FFArmor Enchant^000000]";
	mes "I can't enchant a signed equipment.";
	close;
}
if ( .@card4 ) {
	mes "[^0000FFArmor Enchant^000000]";
	mes "Sorry, this ^0000FFArmor^000000 has already been enchanted.";
	close;
}
if ( .item ) {
	for ( .@j = 0; .@j < getarraysize( .item ); .@j += 2 )
		if ( countitem( .item[.@j] ) < .item[.@j+1] ) {
			mes "[^0000FFArmor Enchant^000000]";
			mes "You need "+ (.item[.@j+1] - countitem( .item[.@j] )) + " " + getitemname( .item[.@j] ) + " to process.";
			close;
		}
	for ( .@j = 0; .@j < getarraysize( .item ); .@j += 2 )
		delitem .item[.@j], .item[.@j+1];
}

.@rand = rand(.totalchance);
while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
.@o = rand(0,5); // orb of str/int/dex ....

delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0;
getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
equip .@id;
close;
OnInit:
setarray .rate, 55,50,45; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...

while ( .@i < 10 ) {
	.totalchance = .totalchance + .rate[.@i];
	.@i++;
}

setarray .item, 7227, 10;		// ID / number of items
while ( .@j < getarraysize( .item ) ) {
	.ask$ = .ask$ + .item[.@j+1] + " " + getitemname( .item[.@j] ) + ( .@j+2 > getarraysize( .item ) ? ",":"." );
	.@j += 2;
}

end;
}

- Then they can enchant this armor for 3 times only.

Sorry i don't get it. In this script, once the armor is enchanted you can't re-enchant it. You want multi-enchant ? another try to enchant ?

Sorry, let me clarify things

- Once the armor has been enchanted, you can enchant it back, to a maximum of 3x Only (multiple enchant).

- The enchant item only gives +1 +2 +3. ( Not more than +4 )

- The requirement for the first enchant is 3 TCG, next enchant is 5TCG, and the last one will be 7TCG.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,156,179,5	script	Armor Echant	100,{
mes "[^0000FFArmor Enchant^000000]";
mes "Do you want to Enchat your ^0000FFArmor^000000?";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
mes "[^0000FFArmor Enchant^000000]";
if ( !getequipisequiped( EQI_ARMOR ) ) {
	mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
	close;
}
.@id = getequipid( EQI_ARMOR );
.@ref = getequiprefinerycnt( EQI_ARMOR );
.@card1 = getequipcardid( EQI_ARMOR, 0 );
.@card2 = getequipcardid( EQI_ARMOR, 1 );
.@card3 = getequipcardid( EQI_ARMOR, 2 );
.@card4 = getequipcardid( EQI_ARMOR, 3 );
if ( .@card1 == 255 || .@card1 == 254 ) {
	mes "I can't enchant a signed equipment.";
	close;
}
if ( !.@card4 )
	.@enchant = 0;
else if ( !.@card3 )
	.@enchant = 1;
else if ( !.@card2 )
	.@enchant = 2;
else {
	mes "Sorry, this ^0000FFArmor^000000 has already been enchanted 3 times.";
	close;
}
if ( countitem( .item_id ) < .item_req[ .@enchant ] ) {
	mes "Sorry, you need "+ .item_req[ .@enchant ] +" "+ getitemname( .item_id ) +" to enchant this armor.";
	close;
}
.@rand = rand(.totalchance);
while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
.@o = rand(0,5); // orb of str/int/dex ...
delitem .item_id, .item_req[ .@enchance ];
delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
if ( !.@card4 )
	getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
else if ( !.@card3 )
	getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, 4700 + .@o * 10 + .@r, .@card4;
else
	getitem2 .@id, 1,1, .@ref, 0, .@card1, 4700 + .@o * 10 + .@r, .@card3, .@card4;
equip .@id;
mes "Armor Enchancement successful !";
close;
OnInit:
setarray .rate, 50,33,17; // rate of getting +1 is 50%, +2 is 33%, +3 is 17%
.item_id = 7227; // item ID requirement use to refine
setarray .item_req, 3,5,7;

while ( .@i < 3 ) {
	.totalchance = .totalchance + .rate[.@i];
	.@i++;
}
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

Wow, Thankyou sir! How do you edit the enchant item? the one that has +1 +2 +3? If example I would like to add up until +4, but still the number of times you can enchant your armor is still 3?

- Is it possible to make the first enchant costs 3 TCG, the second one is 5TCG and the third one is 7TCG?

I really need to know how to edit this, sorry for the too much question.

prontera,156,179,5	script	Armor Echant	100,{
mes "[^0000FFArmor Enchant^000000]";
mes "Do you want to Enchat your ^0000FFArmor^000000?";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
mes "[^0000FFArmor Enchant^000000]";
if ( !getequipisequiped( EQI_ARMOR ) ) {
	mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
	close;
}
.@id = getequipid( EQI_ARMOR );
.@ref = getequiprefinerycnt( EQI_ARMOR );
.@card1 = getequipcardid( EQI_ARMOR, 0 );
.@card2 = getequipcardid( EQI_ARMOR, 1 );
.@card3 = getequipcardid( EQI_ARMOR, 2 );
.@card4 = getequipcardid( EQI_ARMOR, 3 );
if ( .@card1 == 255 || .@card1 == 254 ) {
	mes "I can't enchant a signed equipment.";
	close;
}
if ( !.@card4 )
	.@enchant = 0;
else if ( !.@card3 )
	.@enchant = 1;
else if ( !.@card2 )
	.@enchant = 2;
else {
	mes "Sorry, this ^0000FFArmor^000000 has already been enchanted 3 times.";
	close;
}
if ( countitem( .item_id ) < .item_req[ .@enchant ] ) {
	mes "Sorry, you need "+ .item_req[ .@enchant ] +" "+ getitemname( .item_id ) +" to enchant this armor.";
	close;
}
.@rand = rand(.totalchance);
while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
.@o = rand(0,5); // orb of str/int/dex ...
delitem .item_id, .item_req[ .@enchance ];
delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
if ( !.@card4 )
	getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
else if ( !.@card3 )
	getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, 4700 + .@o * 10 + .@r, .@card4;
else
	getitem2 .@id, 1,1, .@ref, 0, .@card1, 4700 + .@o * 10 + .@r, .@card3, .@card4;
equip .@id;
mes "Armor Enchancement successful !";
close;
OnInit:
setarray .rate, 50,33,17; // rate of getting +1 is 50%, +2 is 33%, +3 is 17%
.item_id = 7227; // item ID requirement use to refine
setarray .item_req, 3,5,7;

while ( .@i < 3 ) {
	.totalchance = .totalchance + .rate[.@i];
	.@i++;
}
end;
}

Edited by Yudax
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Wow, Thankyou sir!
address people properly <.<

its madam ...

How do you edit the enchant item? the one that has +1 +2 +3? If example I would like to add up until +4, but still the number of times you can enchant your armor is still 3?

    setarray .rate, 40,30,20,10; // rate of getting +1 is 40%, +2 is 30%, +3 is 20%, +4 is 10%
   .item_id = 7227; // item ID requirement use to enchant
   setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...

   while ( .@i < 4 ) {
       .totalchance = .totalchance + .rate[.@i];
       .@i++;
   }
   end;

- Is it possible to make the first enchant costs 3 TCG, the second one is 5TCG and the third one is 7TCG?
already did it

    .item_id = 7227; // item ID requirement use to enchant
   setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...


nvm ....

prontera,156,179,5    script    Armor Echant    100,{
   mes "[^0000FFArmor Enchant^000000]";
   mes "Do you want to Enchat your ^0000FFArmor^000000?";
   next;
   if ( select ( "Yes", "No" ) == 2 ) close;
   mes "[^0000FFArmor Enchant^000000]";
   if ( !getequipisequiped( EQI_ARMOR ) ) {
       mes "You dont have any ^0000FFArmor^000000 that is being equipped.";
       close;
   }
   .@id = getequipid( EQI_ARMOR );
   .@ref = getequiprefinerycnt( EQI_ARMOR );
   .@card1 = getequipcardid( EQI_ARMOR, 0 );
   .@card2 = getequipcardid( EQI_ARMOR, 1 );
   .@card3 = getequipcardid( EQI_ARMOR, 2 );
   .@card4 = getequipcardid( EQI_ARMOR, 3 );
   if ( .@card1 == 255 || .@card1 == 254 ) {
       mes "I can't enchant a signed equipment.";
       close;
   }
   if ( !.@card4 )
       .@enchant = 0;
   else if ( !.@card3 )
       .@enchant = 1;
   else if ( !.@card2 )
       .@enchant = 2;
   else {
       mes "Sorry, this ^0000FFArmor^000000 has already been enchanted 3 times.";
       close;
   }
   if ( countitem( .item_id ) < .item_req[ .@enchant ] ) {
       mes "Sorry, you need "+ .item_req[ .@enchant ] +" "+ getitemname( .item_id ) +" to enchant this armor.";
       close;
   }
   .@rand = rand(.totalchance);
   while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
   .@o = rand(0,5); // orb of str/int/dex ...
   delitem .item_id, .item_req[ .@enchant ];
   delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
   if ( !.@card4 )
       getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
   else if ( !.@card3 )
       getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, 4700 + .@o * 10 + .@r, .@card4;
   else
       getitem2 .@id, 1,1, .@ref, 0, .@card1, 4700 + .@o * 10 + .@r, .@card3, .@card4;
   equip .@id;
   mes "Armor Enchancement successful !";
   close;
OnInit:
   setarray .rate, 40,30,20,10; // rate of getting +1 is 40%, +2 is 30%, +3 is 20%, +4 is 10%
   .item_id = 7227; // item ID requirement use to enchant
   setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...

   while ( .rate[.@i] ) {
       .totalchance = .totalchance + .rate[.@i];
       .@i++;
   }
   end;
}

EDIT: fix typo .@enhance ...

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

So if I add rate, 40,30,20,10, that means they can have +4 enchant?

What if I only put 50,30,20. Then that will limit to only +3?

How do you edit the enchant item? the one that has +1 +2 +3? If example I would like to add up until +4, but still the number of times you can enchant your armor is still 3?

	setarray .rate, 40,30,20,10; // rate of getting +1 is 40%, +2 is 30%, +3 is 20%, +4 is 10%
.item_id = 7227; // item ID requirement use to enchant
setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...

while ( .@i < 4 ) {
	.totalchance = .totalchance + .rate[.@i];
	.@i++;
}
end;

Sorry if im not correct, You are not allowed to enchant if your TCG is below 5 or 7. But the deduction is still 3 even though you got 5 TCGs

- Is it possible to make the first enchant costs 3 TCG, the second one is 5TCG and the third one is 7TCG?

	already did it
.item_id = 7227; // item ID requirement use to enchant
setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...

I've also tested this, But i even though theres a 97% chance of getting +4. I still cant get it. I've tested 5 Armors already.

setarray .rate, 1,1,1,97;

Sorry ma'am :)

Edited by Yudax
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

this is my last support on this topic

you should have test the script in a test server before you ask a question

because all the question I keep answering is yes/no, means you didn't even try to edit it yourself

and 2nd, you keep changing your request, it has already gone very far from your 1st post

So if I add rate, 40,30,20,10, that means they can have +4 enchant?
yes
Sorry if im not correct, You are not allowed to enchant if your TCG is below 5 or 7. But the deduction is still 3 even though you got 5 TCGs

change

delitem .item_id, .item_req[ .@enchance ];

into

delitem .item_id, 3;

while keep the rest intact

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

I've tested everything you told me to do ma'am into my test server, but still wont work. Thank you for keep supporting on the topic.

this is my last support on this topic

you should have test the script in a test server before you ask a question

because all the question I keep answering is yes/no, means you didn't even try to edit it yourself

and 2nd, you keep changing your request, it has already gone very far from your 1st post

So if I add rate, 40,30,20,10, that means they can have +4 enchant?
yes
Sorry if im not correct, You are not allowed to enchant if your TCG is below 5 or 7. But the deduction is still 3 even though you got 5 TCGs

change

delitem .item_id, .item_req[ .@enchance ];

into

delitem .item_id, 3;

while keep the rest intact

AnnieRuru,

I solved the TCG problem with this:

delitem .item_id, .item_req[ .@enchant ];

While the one you put is

delitem .item_id, .item_req[ .@enchance ];

Thank you, havn't thought that this was the problem.

Edited by Yudax
Link to comment
Share on other sites

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...