frotek Posted February 27, 2012 Posted February 27, 2012 whats wrong with my script? //Made by Lunar //Version 1.6 //6.1.09 - shop armor_keeper -1,501:50 jupe_ele,37,53,5, script Armor Keeper 899,{ set @i,0; mes "[black Death Keeper]"; mes "Which item do you wish to obtain?"; mes "Select only one."; mes "NOTE: merchant discount skills do not apply "; callshop "armor_keeper",1; npcshopattach "armor_keeper"; end; OnBuyItem: if(.BuildQuest) { for(set .e,0; !compare(getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "armor_keeper",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"SZeny"); setarray .Shop[.i],getarg(.e+2); set .i,.i+1; goto Quest_Setup; } if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Quest_Setup; } for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Quest_Setup; } mes "[shop Quest NPC]"; mes "I require the following:"; for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]"; if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny"; mes "^000000In exchange, I will give you:^0000FF"; for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i)); switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) { case 1: for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) { next; mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + "."; mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000."; close; } if(Zeny < getarg(@i)) { next; mes "You do not have enough Zeny."; mes "Please obtain ^FF0000" + (getarg(@i)-Zeny) + " more Zeny^000000."; close; } for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1); set Zeny,Zeny-getarg(@i); for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1); if (compare(getarg(@i,0),"announce")) announce strcharinfo(0) + " has just obtained " + getitemname(@bought_nameid) + "!",bc_all; close; } OnInit: npcshopitem "armor_keeper",0,0; set .BuildQuest,1; set .i,1; Quest_Setup: switch(.i) { default: set .BuildQuest,0; set .e,0; set .i,0; end; case 1: callsub OnBuyItem,12390,50,50,"SZeny",2345,1,"announce"; case 2: callsub OnBuyItem,12390,50,50,"SZeny",2347,1,"announce"; case 3: callsub OnBuyItem,12390,50,50,"SZeny",2349,1,"announce"; case 4: callsub OnBuyItem,12390,50,50,"SZeny",2351,1,"announce"; case 5: callsub OnBuyItem,12390,40,40,"SZeny",2357,1,"announce"; case 6: callsub OnBuyItem,12390,40,40,"SZeny",2375,1,"announce"; case 7: callsub OnBuyItem,12390,40,40,"SZeny",2374,1,"announce"; case 8: callsub OnBuyItem,12390,35,35,"SZeny",2367,1,"announce"; case 9: callsub OnBuyItem,12390,70,70,"SZeny",2383,1,"announce"; case 10: callsub OnBuyItem,12390,80,80,"SZeny",2384,1,"announce"; case 11: callsub OnBuyItem,12390,40,40,"SZeny",2382,1,"announce"; case 12: callsub OnBuyItem,12390,40,40,"SZeny",2377,1,"announce"; case 13: callsub OnBuyItem,12390,40,40,"SZeny",2378,1,"announce"; case 14: callsub OnBuyItem,12390,40,40,"SZeny",2376,1,"announce"; case 15: callsub OnBuyItem,12390,40,40,"SZeny",2379,1,"announce"; case 16: callsub OnBuyItem,12390,40,40,"SZeny",2380,1,"announce"; case 17: callsub OnBuyItem,12390,40,40,"SZeny",2381,1,"announce"; case 18: callsub OnBuyItem,12390,40,40,"SZeny",2388,1,"announce"; } } Quote
uDe Posted February 27, 2012 Posted February 27, 2012 I saw a mistake at line 5 : jupe_ele,37,53,5, script Armor Keeper 899,{ and it should be jupe_ele,37,53,5 script Armor Keeper 899,{ Quote
Wynn_ Posted February 27, 2012 Posted February 27, 2012 if(.BuildQuest) { for(set .e,0; !compare(getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "armor_keeper",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"SZeny"); setarray .Shop[.i],getarg(.e+2); set .i,.i+1; goto Quest_Setup; } You're trying to compare a number (.e+1) with the string "Zeny", both compare parameters must be strings. 1 Quote
Emistry Posted February 27, 2012 Posted February 27, 2012 change compare( getarg(@i,0),...... into compare(""+getarg(@i,0),...... and actually this has been asnwered several time...try search in the topic... Quote
Question
frotek
whats wrong with my script?
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.