Jump to content
  • 0
Sign in to follow this  
ShadowLight

Custom NPC Trader not working

Question

Hi all,

 

I used the example from doc/npc_trader_sample.txt:

 

/* custom npc trader */prontera,153,152,1	trader	TestCustom2	4_F_EDEN_OFFICER,{	OnInit:	tradertype(NST_CUSTOM);	sellitem Red_Potion,2;	end;}

 

But I am still buying the items using zeny instead of points. What did I do wrong?

 

Thank in advance,

ShadowLight

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Use full script:

 

prontera,153,152,1 trader TestCustom2 4_F_EDEN_OFFICER,{

OnInit:

tradertype(NST_CUSTOM);

sellitem Red_Potion,2;

end;

 

/* allows currency to be item 501 and 502 */

OnCountFunds:

setcurrency(countitem(Red_Potion),countitem(Orange_Potion));

end;

 

/* receives @price (total cost) and @points (the secondary input field for cash windows) */

OnPayFunds:

dispbottom "Hi: price="+@price+" and points="+@points;

if( countitem(Orange_Potion) < @points || countitem(Red_Potion) < @price-@points )

end;

delitem Orange_Potion,@points;

delitem Red_Potion,@price-@points;

purchaseok();

end;

}

Share this post


Link to post
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.   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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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