Aller au contenu

Photo

Limiting store sales by gold piece amount


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Quilistan

Quilistan
  • Members
  • 111 messages
I know that you can limit stores to only buy certain items.

Is it possible to limit a store to only buy items above a certain Price?

Something simple like checking the price of the item the player tries to sell and if it is above the set limit (perhaps set on a variable), the merchant says "they won't buy such a cheap item".

It seems simple enough, but I am not sure how to get this done.

Modifié par Quilistan, 24 mars 2011 - 04:30 .


#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
There's a maximum buy price, but no minimum. You can also give the store a limited amount of gold, which can practically limit what items a store can buy.

#3
Quilistan

Quilistan
  • Members
  • 111 messages
I understand there is a MaxBuy Price and an item type limit that is set in the toolset.

I am looking to see if you can script a check to limit the things a store will purchase regarding their cost. I am hoping to create a store that only buys items ABOVE a certain (preferably settable) price.

#4
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
I don't think so.

#5
dethia

dethia
  • Members
  • 146 messages
Well this is sort of blatant advertising but you can using a custom shop system. I have made one recently but on top of being a custom shop it also changes the appearance of currency (just the appearance, the default game currency is still used). You'd essentially add a variable on the store with whatever name you want "DontBuyItemsCheaperThan" set the value and in the buy section just check the item's value against said variable. Not sure any other way you can do this, if you are curious check the following thread for details:

http://social.biowar...3/index/6697490

Modifié par dethia, 25 mars 2011 - 05:42 .


#6
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Quilistan wrote...

I understand there is a MaxBuy Price and an item type limit that is set in the toolset.

I am looking to see if you can script a check to limit the things a store will purchase regarding their cost. I am hoping to create a store that only buys items ABOVE a certain (preferably settable) price.


Hi Quillstan,

There are (possibly) two approaches, depending upon how accurate this needs to be.

1) ROUGH APPROACH: If the items are generally of the same type, then simply using the "Will Not Buy" system to prevent the store from buying items of that type would suffice. E.g. If all daggers were too cheap for your vendor, then make sure "dagger" is in the "Will Not Buy" list. However, this approach does not work so well if you wish to distinguish between items of the same "type" but of different values.

2) ACCURATE APPROACH: (This may or may not be possible as I have not checked it): There is a command inside the store.xml that says: OnMouseDropReceived=UIListBox_OnDropReceived_SellToStore(). Now, if you were to add your own OnMouseDropReceived to fire a script prior to this line, then you could have the code check the item being dropped and "reject" it if too cheap.

Without testing, I cannot give you any more info, but I don't see why this could not work.

Lance.

#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Just thought of a possible third way ...

I have thought of a third approach that might work: If you looped through a PCs items as the store is opened and temporarily set any items below a certain gold value as a plot item. Plot items cannot be sold. When the PC leaves the store, then revert the items back to non-plot. You would have to put in a couple of checks, such as make sure you only convert/revert items that were not plot in the first place and secondly, make sure items cannot be dropped or exchanged in this state.

EDIT: I had already used this way to prevent items over a certain value being sellable, so I do not know why I did not consider this method in the first place. Posted Image

Lance.

Modifié par Lance Botelle, 02 avril 2011 - 11:11 .