Jump to content
  • 0
astralprojection

Check @sold_nameid

Question

need help on this, what i  need to accomplish here is player click npc and open sell window.  Player drag items to window and sell.  If item sold matches the given array, they will get the predefined  item from the array.  I can pay for this to accomplish, just pm me.

-	shop	dyn_shop1	FAKE_NPC,501:50.

prontera,145,94,3	script	Jaiho	4_F_JPNOBA,{
	callshop "dyn_shop1",2;  // sell only
	npcshopattach "dyn_shop1";
	end;

OnSellItem:
	check all @sold_nameid if matches the needed item below, then give the .@?item if matches. 

OnInit:
	// if 1 item sold to npc then cancell
	
	// if 2 item sold to npc then check from the array below
	setarray .@2items[ 0 ] = 501,502,503,504,505,506,545,546;
	setarray .@2need1[ 0 ], 507, 1, 508, 1;
	setarray .@2need2[ 0 ], 509, 1, 510, 2;
	setarray .@2need3[ 0 ], 511, 2, 512, 1;
	setarray .@2need4[ 0 ], 513, 1, 514, 1;
	setarray .@2need5[ 0 ], 515, 1, 516, 2;
	setarray .@2need6[ 0 ], 517, 1, 518, 1;
	setarray .@2need7[ 0 ], 519, 2, 520, 1;
	setarray .@2need8[ 0 ], 521, 1, 522, 3;	
	
	// if 3 item sold to npc then check from the array below
	setarray .@3items[ 0 ] = 501,502,503,504,505;
	setarray .@3need1[ 0 ], 507, 1, 508, 1, 509, 1;
	setarray .@3need2[ 0 ], 509, 1, 510, 2, 511, 2;
	setarray .@3need3[ 0 ], 511, 2, 512, 1, 513, 4;
	setarray .@3need4[ 0 ], 513, 1, 514, 1, 515, 2;
	setarray .@3need5[ 0 ], 515, 1, 516, 2, 517, 1;

	// if 4 item sold to npc then cancell
	// if 5 item sold to npc then cancell

	
	// if 6 item sold to npc then check from the array below
	setarray .@6items[ 0 ] = 501,502,503,504,505 ...;
	setarray .@6need1[ 0 ], 507, 1, 508, 1, 509, 1, 509, 1, 510, 2, 511, 2;
	setarray .@6need2[ 0 ], 509, 1, 510, 2, 511, 2, 511, 2, 512, 1, 513, 4;
	setarray .@6need3[ 0 ], 511, 2, 512, 1, 513, 4, 513, 1, 514, 1, 515, 2;
	setarray .@6need4[ 0 ], 513, 1, 514, 1, 515, 2, 515, 1, 516, 2, 517, 1;
	setarray .@6need5[ 0 ], 515, 1, 516, 2, 517, 1, 507, 1, 508, 1, 509, 1;
	...
	...
	...
	
	// if more than 6 item sold to npc then cancel
			
	end;
}

 

Edited by astralprojection

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.