Jump to content
  • 0

H>Euphy Custom-Currency Multi-Shop


Question

Posted
//===== 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	VSHOP1	-1,512:-1

turbo_room,107,121,4	script	Vote Shop	73,{

	set @s, select("Shop");

// --------------------------------------------------

	message strcharinfo(0),"This shop only accepts "+getitemname(.Currency[@s])+".";
	dispbottom "You have "+countitem(.Currency[@s])+" "+getitemname(.Currency[@s])+".";
	callshop "VSHOP"+@s,1;
	npcshopattach "VSHOP"+@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:
	waitingroom "Vote Shop",0;

// -------------------- 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],7350;
	setarray .Shop1[0],30300,100,30301,100,30302,100,30303,100;


// --------------------------------------------------

	set .@i,1;
	while (.@i <= getarraysize(.Currency)) {
		set .@j,0;
		while (.@j < getarraysize(getd(".Shop"+.@i))) {
			npcshopdelitem "VSHOP"+.@i,512;
			npcshopadditem "VSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
			set .@j, .@j+2; }
		set .@i, .@i+1; }
	end;
}

How Can i make this shop sells guild/party/account/character bound items?

2 answers to this question

Recommended Posts

Posted

find

getitem @bought_nameid[.@i], @bought_quantity[.@i];

replace

getitembound @bought_nameid[.@i], @bought_quantity[.@i],x;

change x to

 

Valid bound types are:
 1 - Account Bound
 2 - Guild Bound
 3 - Party Bound
 4 - Character Bound
  • Upvote 1
Posted

 

find

getitem @bought_nameid[.@i], @bought_quantity[.@i];

replace

getitembound @bought_nameid[.@i], @bought_quantity[.@i],x;

change x to

 

Valid bound types are:

 1 - Account Bound

 2 - Guild Bound

 3 - Party Bound

 4 - Character Bound

 

okay will try this later! thanks for replying

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...