rayleigh Posted February 29, 2016 Posted February 29, 2016 Hi guys im using euphys script //===== eAthena Script ======================================= //= Custom-Currency Multi-Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.2 //===== Description: ========================================= //= Allows for better organization in a single shop call. //= Note that there are two configuration areas. //============================================================ // -------------------- Config 1 -------------------- // For each shop added, copy this MSHOPX dummy data. // Write your shop names in the select() function. - shop MSHOP1 -1,512:-1 - shop MSHOP2 -1,512:-1 - shop MSHOP3 -1,512:-1 - shop MSHOP4 -1,512:-1 - shop MSHOP5 -1,512:-1 - shop MSHOP6 -1,512:-1 - shop MSHOP7 -1,512:-1 - shop MSHOP8 -1,512:-1 prontera,163,174,4 script A Shop 984,{ set @s, select("Weapons:Headgears:Armors:Garments:Shoes:Shields:Cards:Misc"); // -------------------------------------------------- message strcharinfo(0),"This shop only accepts "+getitemname(.Currency[@s])+"."; dispbottom "You have "+countitem(.Currency[@s])+" "+getitemname(.Currency[@s])+"."; callshop "MSHOP"+@s,1; npcshopattach "MSHOP"+@s; end; OnBuyItem: set .@i,0; while (.@i < getarraysize(@bought_nameid)) { set .@j, 0; while (.@j < getarraysize(getd(".Shop"+@s))) { if(getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) { set @itemcost, (getd(".Shop"+@s+"["+(.@j+1)+"]") * @bought_quantity[.@i]); set @totalcost, @totalcost + @itemcost; break; } set .@j, .@j+2; } set .@i, .@i+1; } if (@totalcost > countitem(.Currency[@s])) dispbottom "You don't have enough "+getitemname(.Currency[@s])+"."; else { set .@i,0; while (.@i < getarraysize(@bought_nameid)) { getitem @bought_nameid[.@i], @bought_quantity[.@i]; dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"."; set .@i, .@i+1; } delitem .Currency[@s], @totalcost; } set @totalcost, 0; deletearray @bought_nameid[0], 128; deletearray @bought_quantity[0], 128; end; OnInit: // -------------------- Config 2 -------------------- // Currency: The ID of each shop currency, // in the same order as the shops. // Shop order follows that of the select() call, // and is formatted "ID1,Count1,ID2,Count2,..." setarray .Currency[1],513,513,513,513,513,513,513,513; setarray .Shop1[0],1202,5,1229,20; setarray .Shop2[0],5116,15; setarray .Shop3[0],2302,2,2348,30; setarray .Shop4[0],2502,2,2513,15,2523,15; setarray .Shop5[0],2441,15; setarray .Shop6[0],2199,32768; setarray .Shop7[0],4051,3,4285,6; setarray .Shop8[0],513,1,532,2,634,4; // -------------------------------------------------- set .@i,1; while (.@i <= getarraysize(.Currency)) { set .@j,0; while (.@j < getarraysize(getd(".Shop"+.@i))) { npcshopdelitem "MSHOP"+.@i,512; npcshopadditem "MSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]"); set .@j, .@j+2; } set .@i, .@i+1; } end; } I want to use pods [item id 7179 as the currency] Can u explain to me which line im going to change and where will I going to put the items I want to sell using PODS. TY. sorry for noob question. Quote
0 PandaLovesHamster Posted February 29, 2016 Posted February 29, 2016 Change .currency, the position of where you put the pod id corresponds to which shop it changes. Play around with the script and see how it works, best way to test lol. Don't be afraid to change something, part of learning too. Quote
0 rayleigh Posted February 29, 2016 Author Posted February 29, 2016 where will I put the id 7179 sir. Can u explain it further? thank you. Quote
0 PandaLovesHamster Posted February 29, 2016 Posted February 29, 2016 setarray .Currency[1],513,513,513,513,513,513,513,513; First 513 means its the currency for .Shop1 and so on. setarray .Shop1[0],1202,5,1229,20; So for instance setarray .Currency[1],7179,513,513,513,513,513,513,513; then .Shop1 will accept pods, while the rest will accept whatever 513 is. Quote
0 rayleigh Posted March 4, 2016 Author Posted March 4, 2016 Woah thats amazing thank you sir panda. But it is possible to add an announcement script on this one? For example "Paul bought 10x megaphone" Is that possible? Ty so much sir. Quote
0 PandaLovesHamster Posted March 4, 2016 Posted March 4, 2016 After this line: dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"."; Add announce strcharinfo(0)+" has purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i]+".",0; Please have a test. Quote
0 rayleigh Posted March 4, 2016 Author Posted March 4, 2016 Hi sir. I tried to change the currency and it worked. ty so much for that. But when i try to add the one that uve said im getting the error on map server. What do you think is wrong? See attachment for the error. Quote
0 PandaLovesHamster Posted March 5, 2016 Posted March 5, 2016 "+getitemname(@bought_nameid[.@i]+".",0; Something wrong with this line. Try to figure out what is missing Quote
0 rayleigh Posted March 5, 2016 Author Posted March 5, 2016 ahahaha... Im sorry I dont know whats wrong sir. Can anyone help me with this? Thank you in advance. Quote
0 PandaLovesHamster Posted March 6, 2016 Posted March 6, 2016 "+getitemname(@bought_nameid[.@i]+".",0; It lacks ), just before + Quote
0 rayleigh Posted March 6, 2016 Author Posted March 6, 2016 "+getitemname(@bought_nameid[.@i]+".",0; It lacks ), just before + So it will be like this sir? "+getitemname(@bought_nameid[.@i])+".",0; I tested it already sir. But still give me this error. (see attachment) I made it to something like this like what you instructed. getitem @bought_nameid[.@i], @bought_quantity[.@i]; dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"."; announce strcharinfo(0)+" has purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i]+".",0; set .@i, .@i+1; } I cant click the npc and the error again on map server. ty sir for helping me.. Quote
0 BlackSnow Posted March 6, 2016 Posted March 6, 2016 (edited) prontera,150,150,3 itemshop blob1 497,6030:0,507:1,508:2,509:3 prontera,152,152,3 itemshop blob2 497,6031:0,507:1,508:2,509:3 Currency shop1: Glitering_PaperA - 6030 Currency shop2: Glitering_PaperB - 6031 If you want to have 1 NPC for all the shops just use simple switch cases. <map name>,<x>,<y>,<facing>%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>{:<discount>},<itemid>:<price>{,<itemid>:<price>...} Edited March 6, 2016 by BlackSnow Quote
0 PandaLovesHamster Posted March 6, 2016 Posted March 6, 2016 getitem @bought_nameid[.@i], @bought_quantity[.@i]; dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"."; announce strcharinfo(0)+" has purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".",0; set .@i, .@i+1; } Show error message or post your entire code if it still errors. Quote
Question
rayleigh
Hi guys im using euphys script
I want to use pods [item id 7179 as the currency]
Can u explain to me which line im going to change and where will I going to put the items I want to sell using PODS.
TY. sorry for noob question.
12 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.