Jump to content
  • 0
DrFlakes

Castle Drop Exchanger NPC

Question

1 answer to this question

Recommended Posts

  • 0

Here,

don't forget to change the map /no1

 

//budekzkie castle drop exchanger 

mall01,100,134,5	script	Castle Drop Exchanger	719,{

   mes "Hi!";
   mes "I can trade your castle drop to any castle drop you like";
   mes "You just need to pay "+ .req_zeny +" zeny";
   next;
   if ( zeny < .req_zeny ) {
       mes "you don't have enough zeny";
       close;
   }
   getinventorylist;
   for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
       if ( compare( .itemidcompare$, ":"+ @inventorylist_id[.@i] +":" ) ) {
           .@menu$ = .@menu$ + getitemname( @inventorylist_id[.@i] ) +":";
           .@select[ .@c ] = @inventorylist_id[.@i];
           .@c++;
       }
   }
   if ( .@c == 0 ) {
       mes "you don't have required items in your inventory";
       close;
   }
   .@pickid = .@select[ select( .@menu$ ) -1 ];
   mes "picked : "+ getitemname( .@pickid );
   next;
   .@menu$ = getitemname( .itemid );
   for ( .@i = 1; .@i < .itemidsize; .@i++ )
       .@menu$ = .@menu$ +":"+ getitemname( .itemid[.@i] );
   .@buyid = .itemid[ select( .@menu$ ) -1 ];
   mes "are you sure you want to spend "+ .req_zeny +" zeny";
   mes "trade "+ getitemname( .@pickid ) +" into "+ getitemname( .@buyid ) +"?";
   next;
   if ( select ( "Yes", "No" ) == 2 ) close;
   if ( countitem( .@pickid ) == 0 || zeny < .req_zeny ) {
       mes "don't cheat by sending mail away !";
       close;
   }
   delitem .@pickid, 1;
   getitem .@buyid, 1;
  announce  "Announcement: "+strcharinfo(0)+" exchanged his/her "+ getitemname( .@pickid ) +" into "+ getitemname( .@buyid ) +". ",0;
   zeny = zeny - .req_zeny;
   mes "traded successfully";
   close;
OnInit:
   .req_zeny = 750000000; // payment
   setarray .itemid, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092; // cdrops id's

   set .itemidsize, getarraysize( .itemid );
   set .itemidcompare$, ":"+ .itemid[0];
   for ( .@i = 1; .@i < .itemidsize; .@i++ )
       .itemidcompare$ = .itemidcompare$ +":"+ .itemid[.@i] +":";
   waitingroom "Castle Drop Exchanger",0;
   end;
   
   
}

 

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

Important Information

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