Theraze
Active member
I had been wondering if an item was available through NPC stores. I was looking through NPCStoreDatabase and saw that the contains and price functions both seemed that they would give information on this. I whipped up this patch to add a new command, npc_price. This runs a validating contains to check whether or not the item is purchasable, and returns the price is possible. If not, it returns 0.
Demonstrating that it works exactly the same as existing functions, with both ASH and CLI, and properly returns 0 if the item isn't available yet.> ash npc_price($item[plum])
Returned: 0
> npc_price flat dough
Returned: 70
> npc_price bleargh
Bad item value: "bleargh"
Returned: null
> mall_price bleargh
Bad item value: "bleargh"
Returned: null
> ash npc_price($item[bleargh])
Bad item value: "bleargh" ()
Returned: void
> ash mall_price($item[bleargh])
Bad item value: "bleargh" ()
Returned: void