Jump to content
  • 0

Just making sure


rayleigh

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

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.

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

where will I put the id 7179 sir.

Can u explain it further? thank you.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

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.

post-20366-0-93815800-1457103565_thumb.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

"+getitemname(@bought_nameid[.@i]+".",0;

Something wrong with this line. Try to figure out what is missing  :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

ahahaha... Im sorry I dont know whats wrong sir.

 

Can anyone help me with this?

Thank you in advance.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

"+getitemname(@bought_nameid[.@i]+".",0;

It lacks ), just before +

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   0
  • Joined:  02/19/16
  • Last Seen:  

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 by BlackSnow
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

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.

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