Jump to content
  • 0

Valor Badges to Cash Point =)


Aya

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

can someone make me an npc where in valor badges (or any other BG Badges) will be exchange to cash points?

Thank you!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


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

prontera,155,177,6    script    Badge Exchange    725,{
   mes "[badge Exchange]";
   mes "I can exchange your badges for Cash Points.";
   mes "Which would you like to exchange?";
   next;
   set .@i, select(.Menu$)-1;
   mes "[badge Exchange]";
   setarray .@j, .Items[.@i*2], .Items[.@i*2+1], countitem(.Items[.@i*2]);
   if (.@j[2]) {
       mes "You have "+.@j[2]+"x "+getitemname(.@j[0])+".";
       mes "They are worth "+.@j[1]+" Cash Points each.";
       mes "How many would you like to exchange?";
       next;
       input .@k,0,.@j[2];
       mes "[badge Exchange]";
       if (.@k) {
           delitem .@j[0],.@k;
           set #CASHPOINTS, #CASHPOINTS+(.@k*.@j[1]);
           mes "Traded "+.@k+"x "+getitemname(.@j[0])+".";
           dispbottom "Total Cash Points: "+#CASHPOINTS;
       }
       else mes "Okay, come back later.";
       close;
   }
   mes "You don't have any "+getitemname(.@j[0])+".";
   close;

OnInit:
   // Format: ItemID,Points,ItemID2,Points2,...
   setarray .Items[0],7829,1,7828,1;
   set .Menu$,"";
   for(set .@i,0; .@i<getarraysize(.Items); set .@i,.@i+2)
       set .Menu$, .Menu$+getitemname(.Items[.@i])+":";
   end;
}

uPaste: http://upaste.me/raw/c91613307a10fb12

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Thanks Euphy! =) I'll try it ;D

Sir Euphy it works perfectly but this is not what I want. Im sorry I didn't specify. Cash Point in my server is an item. My players can use this to obtain items. =) It's like I made an NPC where people can exchange Cash Points. Sorry ..

can you make me a script like this? Thank you! =) btw the ID of Cashpoint is 30000 =)

Link to comment
Share on other sites


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

change

set #CASHPOINTS, #CASHPOINTS+(.@k*.@j[1]);

to

getitem 30000,(.@k*.@j[1]);

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Worked perfectly, thanks Emistry and Euphy =)

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