I have this script (see below) and I was wondering if someone perhaps knows how to add the function in there that this person is asking for.
Would it work with Arrays? Currently, my script has over 128 items in its arrays and so it drops of the last few IDs (doesnt regocnize), and I hoped that perhaps throwing in a "next page" option would fix this issue. Would it?
Any help would be greatly appreciated!
Indoor2,52,50,4 script Custom Headgear Trader 797,{
mes "[Custom Headgear Trader]";
mes "Hello " +strcharinfo(0)+ ", I can exchange your Custom Headgear. That means if you're ever bored of your current Custom Headgear sprite, I can easily give you another!";
next;
mes "[Custom Headgear Trader]";
mes "This service however is not free, if you want to change your Custom Headgear, I require:";
mes "1x Custom Headgear";
mes "3x Cash Points";
next;
if (select("Continue, please.:I'm not interested.") - 1) close;
if(#CASHPOINTS < 3) {
mes "[Custom Headgear Trader]";
mes "I'm sorry You do not meet the requirements. For you to use my service, I need 3 Cash Points and a Custom Headgear.";
close;
}
mes "[Custom Headgear Trader]";
mes "Very well, let's proceed with the process. Select the Customized Headgear that you want to exchange:";
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) {
sleep2 2000;
mes "...Oh, it appears that you have no Custom Headgear, sorry but I can't help you.";
close;
}
.@pickid = .@select[select(.@menu$) - 1];
mes "You've selected your ^FF0000" +getitemname(.@pickid)+ "^000000, is that correct?";
if (select("Yes, it is.:No.") - 1) close;
next;
mes "[Custom Headgear Trader]";
mes "Very well then, now select the item you want to exchange your " +getitemname(.@pickid)+ " for:";
mes "^FF0000To see a list of available sprites, please talk to the Headgear NPC!^000000";
.@menu$ = getitemname(.itemid);
for (.@i = 1; .@i < .itemidsize; .@i++)
.@menu$ = .@menu$ + ":" + getitemname(.itemid[.@i]);
.@tradeid = .itemid[select( .@menu$ ) -1];
next;
mes "[Custom Headgear Trader]";
mes "Please confirm that you want to use 3 Cash Points for trading your ^FF0000" +getitemname(.@pickid) + "^000000 for a ^FF0000" + getitemname(.@tradeid)+ "^000000:";
next;
if (select("Confirm:Cancel") - 1) close;
if (countitem(.@pickid) == 0 || #CASHPOINTS < 3) {
mes "[Custom Headgear Trader]";
mes "It appears that you don't meet the requirements. In order to use my service, you need to have a Custom Headgear and 3 Cash Points.";
close;
}
getinventorylist;
for(set .@i,0; .@i < @inventorylist_count; set .@i,.@i+1){
if( @inventorylist_id[.@i] == .@pickid ) {
set .@refine_rate, @inventorylist_refine[.@i];
}
}
delitem .@pickid, 1;
if ( !.@refine_rate )
getitem .@tradeid, 1;
else
getitem2 .@tradeid,1,1,.@refine_rate,0,@card1,@card2,@card3,@card4;
//getitem .@tradeid, 1;
set #CASHPOINTS,#CASHPOINTS - 3;
mes "[Custom Headgear Trader]";
mes "===================================";
mes "Official Receipt";
mes "===================================";
mes "From : " +getitemname(.@pickid);
mes "To : " +getitemname(.@tradeid);
mes "===================================";
dispbottom "3 Cash Points have been deducted. Current Balance = "+#CASHPOINTS+" Cash Points.";
next;
mes "[Custom Headgear Trader]";
mes "Thank you for using my Custom Headgear trading system, " +strcharinfo(0)+ ". Have a nice day!";
close;
OnInit:
setarray .itemid,8005,8006,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8052,8053,8054,8055,8056,8057,8058,8059,8060,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8094,8095,8098,8100,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8112,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8130,8131,8132,8133,20051,20052,20053,20054,20055,20056,20057,20058,20059,20060,20061,20062,20063,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077; // Put all Headgear's here
set .itemidsize, getarraysize( .itemid );
set .itemidcompare$, ":"+ .itemid[0];
for ( .@i = 1; .@i < .itemidsize; .@i++ )
.itemidcompare$ = .itemidcompare$ +":"+ .itemid[.@i] +":";
end;
}
}
Question
Mistique
Hi rAthena.
I have this script (see below) and I was wondering if someone perhaps knows how to add the function in there that this person is asking for.
Would it work with Arrays? Currently, my script has over 128 items in its arrays and so it drops of the last few IDs (doesnt regocnize), and I hoped that perhaps throwing in a "next page" option would fix this issue. Would it?
Any help would be greatly appreciated!
Anyone?
I'm willing to pay for it.
Edited by MistiqueLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.