Jump to content
  • 0

Card Recycle Need input and getinfo form cards


kabra

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  12/11/18
  • Last Seen:  

Hi guys, this is my Card Recycle but i cant make it work as i want (5 poring coins and 1 card = enriched elunium or enriched oridecon ) this npc let me choose if i want ori or elu but this are my 2 problems 

1: This npc take the poring coins and doesnt let you decide how many you want

2: I cant make it "read" any random card you have in your inventory 

The server i play is in spanish if you need english code i can translate it 

prontera,148,152,4    script    Reciclador    89,{

//ID 7539 Poring Coin, 7619 Enriched Elunium, 7620 Enriched Oridecon

mes "Te dare un Enriched Oridecon o un Enriched Elunium ";
  next;    
mes "Lo que necesitas para este intercambio es:";
mes "1 Card y 5 Poring Coins";
  next;
    switch(select("Enriched Oridecon","Enriched Elunium","Nada Gracias.")) { 
case 1:
    if(countitem(7539) < 5 ){
mes "Necesitas los items";
  close;
}
  next;
    .Amount = countitem(7539);
    .Amount2 =  countitem(7539)/5;
    switch(select("Si","No")) {     
 case 1:  
    .Amount = countitem(7539);     
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
         delitem 7539, 5;
         getitem 7619, 1; 
}
    .Offset = .Amount-countitem(7539);
mes "Veamos cuanto tienes("+.Offset+") for Enriched Elunium x "+.Amount2+".";
  close;
case 2:
mes "No vuelvas a molestar más";
close;
}
 case 2:
    if ( countitem(7539) < 5 ) {
mes "Te Faltan items";
close;
}
  next;
mes "Quieres Enriched Oridecon";
  next;
    switch(select("Si","No")) {
  case 1:
    .Amount = countitem(7539);
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
        delitem 7539, 5;
        getitem 7620, 1;
}
    .Offset = .Amount-countitem(7539);
mes "Veamos cuanto tienes("+.Offset+") for Enriched Oridecon x "+.Amount2+".";
close;
  case 2:
  mes "No vuelvas a molestar mas";
    close;

case 3:
    mes "Vuelve si me necesitas";
    close;
}}}


 

Edited by Emistry
codebox
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

change these 

    .Amount = countitem(7539);     
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
		delitem 7539, 5;
		getitem 7619, 1; 
	}

into this

	input .@amount, 0, (countitem(7539)/5);
	if (.@amount) {
		delitem 7539, (.@amount * 5);
		getitem 7619, .@amount; 
	}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   11
  • Joined:  12/03/18
  • Last Seen:  

You need to assign like an array of cards that i needs to identify before it can be detected by the npc. What i normally do is use existing script structure then try to modify it on how you want it to be designed.

https://rathena.org/board/topic/114236-mvp-card-trader/

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  12/11/18
  • Last Seen:  

On 7/28/2019 at 11:51 PM, Dev G Inc said:

You need to assign like an array of cards that i needs to identify before it can be detected by the npc. What i normally do is use existing script structure then try to modify it on how you want it to be designed.

https://rathena.org/board/topic/114236-mvp-card-trader/

Thnx, i will start trying that script 

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