Jump to content
  • 0

Help me add something in this script


Critica

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

Hi guys this script works like "Horadic Cube" in diablo which will combine your item if you have the correct requirment..

but can i have a request to edit this script and add this:

if i have the requirments, it wil list the items that i can build or combine in a menu,,

so players may know which item they could possible combine

prontera,152,166,5 script Rune Master  498,{
mes "[Rune Master]";
mes "Hi there young warior, I'm the Rune Master! I have the skill to combine Rune Stones in one.";
next;
mes "Combining your Rune Stones can make it more powerfull, but make sure you only carry the Runes you want to combine.";
next;
mes "Would you like to combine some Rune Stones?";
 if(select("Yes","No")==2) { close; }
// these are examples
if (countitem(512)>=50 && countitem(513)>=60) {
	delitem 512,50;
	delitem 513,60;
	getitem 5116,1;
	mes "Done! Here's your "+getitemname(5116)+"!";
	set .@failmessage,1;
}
if (countitem(514)>=2 && countitem(515)>=54) {
	delitem 514,2;
	delitem 515,54;
	getitem 5075,1;
	mes "Done! Here's your "+getitemname(5075)+"!";
	set .@failmessage,1;
}
// etc.
if (.@failmessage != 1);

mes "You need to carry atleast two Seal or Glyph Runes.";  
close;
}

Edited by critica
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Try this...

setarray .@item_req, 671,1,672,1; // Item Required ( <item_id>,<amount>... )
setarray .@item_list, 1234,4321,1234,4321; // Item List
for ( set .@i, 0; .@i < getarraysize(.@item_list); set .@i, .@i + 1 )
set .@menu$, .@menu$ + (.@i?": ":"") + getitemname(.@item_list[.@i]);
mes "Possible Items";
set .@j, select ( .@menu$ ) - 1;
for ( set .@i, 0; .@i < getarraysize(.@item_req); set .@i, .@i + 2 )
{
if ( countitem(.@item_req[.@j]) < .@item_req[.@j + 1] )
 set .@fail, 1;
}
if ( .@fail )
{
mes "Infsufficient materials.";
close;
}
for ( set .@i, 0; .@i < getarraysize(.@item_req); set .@i, .@i + 2 )
delitem .@item_req[.@i], .@item_req[.@i + 1];

getitem .@item_list[.@j], 1;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

Hi thanks for the reply, your script is working fine,

but is there a way that it will only list* the items that you have a complete requirments, on the menu,?

Edited by critica
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

I read this and thought... didn't I do this before...? And -voila-, here's the exact script!

http://www.eathena.ws/board/index.php?s=&showtopic=284912&view=findpost&p=1061104378

Now, critica, how exactly do you want this modified? Most of us don't know how "Horadic Cube" works, so you'll have to explain.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

yea it was you who did this haha!! thanks to you again,

this horadic cube" actually kinda like what the first script is, its just like guessing what item requirments are" to build the item,

but i want it to modified like Joseph did, but will only show the items that you have full requirments, and the other items that you have missing requirments wont show on the menu list..

its kinda like this,

Item1 - needs itemA itemB

Item2 - needs itemA itemB itemC

item3 - needs itemA itemB itemC itemD

on my inventory i have itemA itemB and itemC

so in the menu list of the NPC only item1 and item2 will show, item3 wont be on the list because i dont have all the requirments,

sorry if its really hard to understand my idea,, xD

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

prontera,148,166,6 script Rune Master 498,{
mes "[Rune Master]";
for(set .@i,1; getd(".R"+.@i+"[0]"); set .@i,.@i+1)
 for(set .@j,2; .@j<getarraysize(getd(".R"+.@i)); set .@j,.@j+2) {
  if (countitem(getd(".R"+.@i+"["+.@j+"]")) < getd(".R"+.@i+"["+(.@j+1)+"]")) break;
  if (!getd(".R"+.@i+"["+(.@j+2)+"]")) set .@R$[getarraysize(.@R$)],".R"+.@i; }
if (!getarraysize(.@R$)) { mes "You have much to learn..."; close; }
mes "Select your reward.";
set .@menu$,"";
for(set .@i,0; .@i<getarraysize(.@R$); set .@i,.@i+1)
 set .@menu$, .@menu$+getitemname(getd(.@R$[.@i]+"[0]"))+":";
set .@menu$, .@menu$+"^777777Cancel^000000";
set .@c, select(.@menu$)-1;
if (.@c==getarraysize(.@R$)) { mes "...so be it."; close; }
for(set .@i,2; .@i<getarraysize(getd(.@R$[.@c])); set .@i,.@i+2)
 delitem getd(.@R$[.@c]+"["+.@i+"]"), getd(.@R$[.@c]+"["+(.@i+1)+"]");
getitem getd(.@R$[.@c]+"[0]"), getd(.@R$[.@c]+"[1]");
mes "Here's your ^0055FF"+getitemname(getd(.@R$[.@c]+"[0]"))+"^000000, young one.";
close;
OnInit:
// Format: <reward ID>,<reward count>,<required ID>,<required count>{,...};
setarray .R1[0],5116,1,512,50,513,60;
setarray .R2[0],5075,1,514,2,515,54;
setarray .R3[0],531,1,512,1,713,1;
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

gReat works like a charm!!

thanks again Eunphy!! you're so awesome haha! /no1

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