Jump to content
  • 0
Sign in to follow this  
rans

Custom Armor enchanter

Question

Hi there can i request a custom enchanter?
i mean only work if i have the item to be compounded on my equip

Example: npc will only work if i have the +3stats orb(id 9999) and i want it to compund on 3rd slot of my mink coat. 

i found other script but their script works without the orb in my inventory. i want to make a requirement. 
Thanks 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi there can i request a custom enchanter?

i mean only work if i have the item to be compounded on my equip

 

Example: npc will only work if i have the +3stats orb(id 9999) and i want it to compund on 3rd slot of my mink coat. 

 

i found other script but their script works without the orb in my inventory. i want to make a requirement. 

Thanks 

 

If you want to make a requirement go http://herc.ws/wiki/Basic_Scripting read it all, analyze and then use 

if (countitem(9999) >= 1) 
 

Where you need this.

Share this post


Link to post
Share on other sites
  • 0

Well yeah thnx but i was expecting for someone who could make it an array i mean easy configure each time i add an item. if that is possible since my coding skills are not that good and messy script result into a server lag.

Share this post


Link to post
Share on other sites
  • 0

setarray .equipid[0], 1599; <= items that can be enchanted
setarray .enchant[0], 9999; <= enchant item id
setarray .itemsid[0], 909; <= items that need for enchant
setarray .amounts[0], 1;

.@menu$ = "";
for( .i = 0; .i < getarraysize( .equipid ); .i ++ )
{
   .@menu$ += ( .i + 1 ) + ". " + getitemname(.equipid[.i];
   .@menu$ += ":";
}

@select = select(.@menu$) - 1;

if( !isequipped( .equipid[@select] ) )
{
    mes "equip the item first.";
    close;
}
@error = 0;
for( .a = 0; .a < getarraysize( .itemsid ); .a ++ )
{
  if( countitem( .itemsid[.a] ) < .amounts[.a] )
    close; // no items
  
  delitem .itemsid[.a], .amounts[.a];
}

delitem .equipid[@select], 1;
getitem2 .equipid[@select], 1, 1, 0, 1, 0, 0, 0, .enchant[0];
close;
     

this is sample.

need a menu for select the enchant orbs. But you can use this code for create your script :)

(not tested)

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.