karazu Posted March 12, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 374 Reputation: 5 Joined: 03/09/12 Last Seen: June 19, 2018 Share Posted March 12, 2012 (edited) This script is simply the Dynamic Shop NPC but just improve to add some "MENU" (just downloaded in eathena I am having some problem here that every time i brought an item their is/are error in the "map server" prontera,141,176,5, script Donation NPC 992,{ mes "//////////////////////////////////////////////"; mes "// PLEASE BUY 1 ITEM"; mes "//ONLY PER TRANSACTION"; mes "// THANK YOU.."; mes "//////////////////////////////////////////////"; next; mes "Choose your Shop"; switch (select ("Upper:Middle:Lower:Boxes")) { Case 1: doevent "Upper::OnShop"; end; Case 2: doevent "Middle::OnShop"; end; Case 3: doevent "Lower::OnShop"; end; Case 4: doevent "Boxes::OnShop"; end; } } // -- ***************************************** F I R S T S H O P ********************************************** - shop quest_shop1 -1,501:50 - script Upper -1,{ OnShop: set @i,0; mes "[shop Quest NPC]"; mes "Which item do you wish to obtain?"; mes "Select only one."; callshop "quest_shop1",1; npcshopattach "quest_shop1"; end; OnBuyItem: if(.BuildQuest) { for(set .e,0; !compare(""+getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "quest_shop1",getarg(.e+2),0; 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); 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); set @i,@i+2) getitem getarg(@i),getarg(@i+1); close; case 2: set @bottomview, getlook(3); set @topview, getlook(4); set @midview, getlook(5); addtimer 1000, strnpcinfo(3)+"::On_Leave"; set @equip,getiteminfo(@bought_nameid, 5); set @view, getiteminfo(@bought_nameid, 11); if(@equip != -1 && @view > 0) { if(@equip & 1) atcommand "@changelook 3 " + @view; if(@equip & 256) atcommand "@changelook 1 " + @view; if(@equip & 512) atcommand "@changelook 2 " + @view; } next; goto OnBuyItem; case 3: close; } On_Leave: atcommand "@changelook 1 " + @topview; atcommand "@changelook 2 " + @midview; atcommand "@changelook 3 " + @bottomview; set @equip,0; set @view,0; set @topview,0; set @midview,0; set @bottomview,0; end; OnInit: npcshopitem "quest_shop1",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,7179,300,0,"SZeny",5754,1,0; case 2: callsub OnBuyItem,7179,300,0,"SZeny",5749,1,0; case 3: callsub OnBuyItem,7179,300,0,"SZeny",5746,1,0; case 4: callsub OnBuyItem,7179,300,0,"SZeny",5753,1,0; case 5: callsub OnBuyItem,7179,300,0,"SZeny",5752,1,0; case 6: callsub OnBuyItem,7179,300,0,"SZeny",5751,1,0; case 7: callsub OnBuyItem,7179,300,0,"SZeny",5747,1,0; case 8: callsub OnBuyItem,7179,300,0,"SZeny",5750,1,0; case 9: callsub OnBuyItem,7179,300,0,"SZeny",5756,1,0; case 10: callsub OnBuyItem,7179,300,0,"SZeny",5757,1,0; case 11: callsub OnBuyItem,7179,300,0,"SZeny",5755,1,0; case 12: callsub OnBuyItem,7179,300,0,"SZeny",5748,1,0; case 13: callsub OnBuyItem,7179,300,0,"SZeny",5758,1,0; } } // -- ***************************************** S E C O N D S H O P ********************************************** - shop quest_shop2 -1,501:50 - script Middle -1,{ OnShop: set @i,0; mes "[shop Quest NPC]"; mes "Which item do you wish to obtain?"; mes "Select only one."; callshop "quest_shop2",1; npcshopattach "quest_shop2"; end; OnBuyItem: if(.BuildQuest) { for(set .e,0; !compare(""+getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "quest_shop2",getarg(.e+2),0; 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); 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); set @i,@i+2) getitem getarg(@i),getarg(@i+1); close; case 2: set @bottomview, getlook(3); set @topview, getlook(4); set @midview, getlook(5); addtimer 1000, strnpcinfo(3)+"::On_Leave"; set @equip,getiteminfo(@bought_nameid, 5); set @view, getiteminfo(@bought_nameid, 11); if(@equip != -1 && @view > 0) { if(@equip & 1) atcommand "@changelook 3 " + @view; if(@equip & 256) atcommand "@changelook 1 " + @view; if(@equip & 512) atcommand "@changelook 2 " + @view; } next; goto OnBuyItem; case 3: close; } On_Leave: atcommand "@changelook 1 " + @topview; atcommand "@changelook 2 " + @midview; atcommand "@changelook 3 " + @bottomview; set @equip,0; set @view,0; set @topview,0; set @midview,0; set @bottomview,0; end; OnInit: npcshopitem "quest_shop2",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,7179,170,0,"SZeny",5401,1,0; case 2: callsub OnBuyItem,7179,170,0,"SZeny",5402,1,0; case 3: callsub OnBuyItem,7179,170,0,"SZeny",5421,1,0; case 4: callsub OnBuyItem,7179,170,0,"SZeny",5288,1,0; case 5: callsub OnBuyItem,7179,170,0,"SZeny",5389,1,0; case 6: callsub OnBuyItem,7179,170,0,"SZeny",5786,1,0; case 7: callsub OnBuyItem,7179,170,0,"SZeny",5788,1,0; case 8: callsub OnBuyItem,7179,170,0,"SZeny",5664,1,0; case 9: callsub OnBuyItem,7179,170,0,"SZeny",5592,1,0; case 10: callsub OnBuyItem,7179,170,0,"SZeny",18503,1,0; } } // -- ***************************************** T H I R D S H O P ********************************************** - shop quest_shop3 -1,501:50 - script Lower -1,{ OnShop: set @i,0; mes "[shop Quest NPC]"; mes "Which item do you wish to obtain?"; mes "Select only one."; callshop "quest_shop3",1; npcshopattach "quest_shop3"; end; OnBuyItem: if(.BuildQuest) { for(set .e,0; !compare(""+getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "quest_shop3",getarg(.e+2),0; 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); 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); set @i,@i+2) getitem getarg(@i),getarg(@i+1); close; case 2: set @bottomview, getlook(3); set @topview, getlook(4); set @midview, getlook(5); addtimer 1000, strnpcinfo(3)+"::On_Leave"; set @equip,getiteminfo(@bought_nameid, 5); set @view, getiteminfo(@bought_nameid, 11); if(@equip != -1 && @view > 0) { if(@equip & 1) atcommand "@changelook 3 " + @view; if(@equip & 256) atcommand "@changelook 1 " + @view; if(@equip & 512) atcommand "@changelook 2 " + @view; } next; goto OnBuyItem; case 3: close; } On_Leave: atcommand "@changelook 1 " + @topview; atcommand "@changelook 2 " + @midview; atcommand "@changelook 3 " + @bottomview; set @equip,0; set @view,0; set @topview,0; set @midview,0; set @bottomview,0; end; OnInit: npcshopitem "quest_shop3",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,7179,100,0,"SZeny",5377,1,0; case 2: callsub OnBuyItem,7179,100,0,"SZeny",5419,1,0; case 3: callsub OnBuyItem,7179,100,0,"SZeny",5362,1,0; } } // -- ***************************************** F O U R T H S H O P ********************************************** - shop quest_shop4 -1,501:50 - script Boxes -1,{ OnShop: set @i,0; mes "[shop Quest NPC]"; mes "Which item do you wish to obtain?"; mes "Select only one."; callshop "quest_shop4",1; npcshopattach "quest_shop4"; end; OnBuyItem: if(.BuildQuest) { for(set .e,0; !compare(""+getarg(.e+1),"Zeny"); set .e,.e+2) {} npcshopadditem "quest_shop4",getarg(.e+2),0; 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); 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); set @i,@i+2) getitem getarg(@i),getarg(@i+1); close; case 2: set @bottomview, getlook(3); set @topview, getlook(4); set @midview, getlook(5); addtimer 1000, strnpcinfo(3)+"::On_Leave"; set @equip,getiteminfo(@bought_nameid, 5); set @view, getiteminfo(@bought_nameid, 11); if(@equip != -1 && @view > 0) { if(@equip & 1) atcommand "@changelook 3 " + @view; if(@equip & 256) atcommand "@changelook 1 " + @view; if(@equip & 512) atcommand "@changelook 2 " + @view; } next; goto OnBuyItem; case 3: close; } On_Leave: atcommand "@changelook 1 " + @topview; atcommand "@changelook 2 " + @midview; atcommand "@changelook 3 " + @bottomview; set @equip,0; set @view,0; set @topview,0; set @midview,0; set @bottomview,0; end; OnInit: npcshopitem "quest_shop4",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,7179,100,0,"SZeny",12920,1,0; case 2: callsub OnBuyItem,7179,100,0,"SZeny",12921,1,0; case 3: callsub OnBuyItem,7179,50,0,"SZeny",12912,1,0; case 4: callsub OnBuyItem,7179,140,0,"SZeny",13710,1,0; case 5: callsub OnBuyItem,7179,15,0,"SZeny",7776,1,0; case 6: callsub OnBuyItem,7179,12,0,"SZeny",7619,1,0; case 7: callsub OnBuyItem,7179,12,0,"SZeny",7620,1,0; } } That is my script! please help me! Do i need to change something? Edited March 12, 2012 by karazu Quote Link to comment Share on other sites More sharing options...
Earthlingz Posted March 12, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 187 Reputation: 35 Joined: 01/01/12 Last Seen: September 20, 2014 Share Posted March 12, 2012 I am having some problem here that every time i brought an item their is/are error in the "map server" why dont you tell us the error that is shown in map server? btw, please use codebox insead of code Quote Link to comment Share on other sites More sharing options...
simplemhan Posted March 12, 2012 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 308 Reputation: 3 Joined: 12/18/11 Last Seen: March 4, 2014 Share Posted March 12, 2012 i think you need to specify the location of your npc thats why you got an error on map server. every npc shop you made Quote Link to comment Share on other sites More sharing options...
karazu Posted March 12, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 374 Reputation: 5 Joined: 03/09/12 Last Seen: June 19, 2018 Author Share Posted March 12, 2012 (edited) I already posted an Image.. OK will code box it! sorry dont know about that... i think you need to specify the location of your npc thats why you got an error on map server. every npc shop you made If I m going to put a location of each NPC then it will not be a single NPC anymore? Edited March 12, 2012 by karazu Quote Link to comment Share on other sites More sharing options...
Winz Posted March 12, 2012 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 1479 Reputation: 174 Joined: 12/14/11 Last Seen: November 21, 2016 Share Posted March 12, 2012 are you sure that this problem comes from the script? I guess this problem comes from an item inside your inventory. Can you find any "Unknown Item" or "Apple" on each section of inventory (usable, equip, misc)? If yes, drop them and do @cleanmap. Quote Link to comment Share on other sites More sharing options...
karazu Posted March 12, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 374 Reputation: 5 Joined: 03/09/12 Last Seen: June 19, 2018 Author Share Posted March 12, 2012 No I dont have! I did just do a @itemreset to make everything clean. and @item some PODS and its still their.. Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 12, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted March 12, 2012 use this.. http://rathena.org/board/topic/53320-%e2%99%a5-e-m-i-s-t-r-y-s-s-c-r-i-p-t-s-%e2%99%a5/page__view__findpost__p__70657 Quote Link to comment Share on other sites More sharing options...
karazu Posted March 12, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 374 Reputation: 5 Joined: 03/09/12 Last Seen: June 19, 2018 Author Share Posted March 12, 2012 Thank you Mr. I will test it! I was supposed to PM you after I hit the F5 button lol,, and ur name appears.. haha By the way! can u tell me what caused it to send error? Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 12, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted March 12, 2012 perhap it is come from this line npcshopitem "quest_shop1",0,0; perhap it is my mistake last time when i copy paste the script to make it into several shop inside a npc menu listing.. anyway..if you are just looking for Dynamic Shop that sell using different currency.. no offence but.i think it is time to stop using LunarCast's dynamic shop..since it caused alot problem.. and alot users cant solve ( cant find solution / lazy find solution for that ) but still thank to lunarcast script that give me the idea how to make a dynamic shop. Quote Link to comment Share on other sites More sharing options...
karazu Posted March 13, 2012 Group: Members Topic Count: 57 Topics Per Day: 0.01 Content Count: 374 Reputation: 5 Joined: 03/09/12 Last Seen: June 19, 2018 Author Share Posted March 13, 2012 (edited) OK thank you! By the way Emistry what's with this Apple ISSUE? every time i start the server it will complain about the apple being in 1z because of the overcharge/discount issue - shop Emistry_Shop -1,512:1 I change the 1 in to 100 and it works fine now.. - shop Emistry_Shop -1,512:100 Is their a possible error coming soon? Edited March 13, 2012 by karazu Quote Link to comment Share on other sites More sharing options...
Question
karazu
This script is simply the Dynamic Shop NPC but just improve to add some "MENU" (just downloaded in eathena
I am having some problem here that every time i brought an item their is/are error in the "map server"
That is my script! please help me!
Do i need to change something?
Edited by karazuLink to comment
Share on other sites
9 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.