The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vendor Shop HELP
Author Message
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #1
Vendor Shop HELP
Hey guys, I'm thinking to remake how vendors will buy and sell items.
I'm planning to vendors sell only basic things, and the other things would be sold by players.
But, I want to vendors to buy some items, like blacksmiths buy plates and weapons from players and sell them.

I just want to know how to store the sold item on vendor and show them in the sell gump.
Is that possible?


I find 3 vendor box at the npc, one holding nothing, one holding the items that he will sell and one holding items that he will buy.

But these last 2 boxes have lots of items...
Looking at provisioner, the sell one have around 46 items and the buy one have around 176 items!
In a shard with lots of vendors this is a great item storage...
Just they are useless.

Another thing, can I read the items list from buy/sell templates?

Thanks!

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-23-2012 01:03 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
RE: Vendor Shop HELP
Yes you can. in speak_shopkeep.scp you will see a ON=BUY and ON=SELL trigger in there, those 2 are used to trigger BUY and SELL on vendors. Before BUY and SELL you can add/read/remove items in layers 26,27,28 - these layers are vendor boxes. You can see which layer is for sell, buy and sold in sphere_defs.scp

You can simply use 'forcont <findlayer.27>' as an example to list through the items in layer 27, or add new items using serv.newitem and new.cont=<findlayer.27>. These are 2 examples you can work with. I'm sure you can find more to do with these layers and the speech file.

Good luck!

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-23-2012 03:30 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #3
RE: Vendor Shop HELP
Thanks Skul I will work on it later.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-23-2012 04:34 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: Vendor Shop HELP
Okay, thats my tests.

I add an event to my player, E_AI_VENDOR, just to test.
PHP Code:
ON=@ITEMSELL
// ACT = ITEM BEING SOLD
// I = WHO IS SELLING THE ITEM
// ARGO = THE VENDOR THAT IS BUYING THE ITEM
ACT.ATTR |= ATTR_FORSALE
ACT
.CONT <ARGO.FINDLAYER.27
Well, it isn't working :/

When I place the item into vendor's vendor box ( layer 27 ), it appear on buy list but don't have value... and when I close the buy list, the item disappear...

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-24-2012 12:17 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #5
RE: Vendor Shop HELP
try:
Code:
act.cont=<uid.<argo.uid>.findlayer.27>
argo.xx props have a hard time handling functions, although reading a value from argo as an object works fine.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-24-2012 12:28 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #6
RE: Vendor Shop HELP
Hmm will try it out.

Edit: Don't work!
It just don't go to vendor's layer... its sucks!

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 09-24-2012 12:36 PM by Extreme.)
09-24-2012 12:31 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #7
RE: Vendor Shop HELP
I know why, same problem I ran into earlier, layer 27 does not exist, therefore no layer to place the object in.
Code:
on=@itemsell
if !(<argo.findlayer.27>)
  serv.newitem=i_vendorbox
  new.layer=27
  new.cont=<argo.uid>
endif
act.attr |= attr_forsale //this is really used for player vendors, be sure to remove it with @itembuy, it may cause some unwanted behavior.
act.cont=<argo.findlayer.27>

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-24-2012 12:42 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #8
RE: Vendor Shop HELP
I set RETURN 1 and the item don't get removed.
But the Sell List don't close.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-24-2012 12:51 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #9
RE: Vendor Shop HELP
interesting, return 1 stops most of the default behavior and if you don't halt default behavior then the item is not sent to the layer... I'm guessing:
Code:
act.timerf 1 cont=<argo.findlayer.27>
will do the trick, but it's not the most 'efficient' way to do it, considering the fact a player can prompt the 'buy' list before the timer expires... Is there a reason you want to toss the sold items into layer 27? Seeing as vendors have layers buy, sell, and bought. Why toss it into a seperate layer if it's sold by a player?

On my server i had to toss items 'for sale' by default into the 'items bought' layer to be sold back to players because of the item limit sphere has on the layer.

What is the purpose of tossing the items into layer 27?

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-24-2012 12:57 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #10
RE: Vendor Shop HELP
How I would love some new features on buy/sell system...
Maybe it should be remade...

@Skul
I'm not aiming the layer 27.
I just want to the items sold by players to vendors, the vendors keep them to sell for other players...

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 09-24-2012 01:11 PM by Extreme.)
09-24-2012 01:09 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 7 Guest(s)