XuN, i didn't work... The itens are deleted on the "sphere default restock"... see this images:
http://s23.postimg.org/vfzs01zqi/Captura..._10_39.jpg
http://s23.postimg.org/z25lcp63u/Captura..._14_32.jpg
At 23:10 the itens was inside the vendor on layer 26 (buy) and 28 (sell)
At 23:14 all the itens is gone.... no error on console, no save, no resync, no nothing...
With no itens, i can't change the amount.. i even tryied to make this funcion:
Code:
[FUNCTION f_restock_tag_set]
ref1=<uid>
local.sell = 0
local.buy = 0
forcont <findlayer(26).uid>
if !(<ref1.tag0.sell.<baseid>>)
ref1.tag0.sell.<eval <local.sell>>.id = <baseid>
ref1.tag0.sell.<eval <local.sell>>.amount = <eval <ref1.f_count_itens <baseid>,26>>
else
ref1.tag0.sell.<eval <local.sell>>.amount += <eval <ref1.f_count_itens <baseid>,26>>
endif
local.sell += 1
endfor
forcont <findlayer(27).uid>
if !(<ref1.tag0.sell.<baseid>>)
ref1.tag0.sell.<eval <local.sell>>.id = <baseid>
ref1.tag0.sell.<eval <local.sell>>.amount = <eval <ref1.f_count_itens <baseid>,27>>
else
ref1.tag0.sell.<eval <local.sell>>.amount += <eval <ref1.f_count_itens <baseid>,27>>
endif
local.sell += 1
endfor
forcont <findlayer(28).uid>
if !(<ref1.tag0.sell.<baseid>>)
ref1.tag0.buy.<eval <local.buy>>.id = <baseid>
ref1.tag0.buy.<eval <local.buy>>.amount = <eval <ref1.f_count_itens <baseid>,28>>
else
ref1.tag0.buy.<eval <local.buy>>.amount += <eval <ref1.f_count_itens <baseid>,28>>
endif
local.buy += 1
endfor
ref1.tag0.buying = <eval <local.buy>>
ref1.tag0.selling = <eval <local.sell>>
On the restock stone i've made, when i set "restock 1" on the NPC this funcion run, (cuz if i use only "restocl" all itens was deleted too... i don't know why).
When the player goes on the NPC to buy or sell and there is no layer on some layer, i checked the tags, to re-create the missing itens.. but it makes the shard REALLY slow.
I don't know but i guess there is something wrong with restock in sphere... if the base function could run with the "1" argument the restock would be fixed
OBS: I'm using the spehre nightly build 2387 and i notice this behavior abount 1 month ago... buy just declared as "error" this days..
Thanks for helping XuN!
NOTE: With region.tag0.NoRestock=1 items do not disappear.. At least until now!
XuN, yeah...so far, so goo!
But to restock all NPCs the server is overloaded... so thinking better this may be a bad idea.
There is a way to change the restock time?
There is a way to set the "1" argument on default restock sphere code?
There is a way to run "background" functions to sphere?
Sorry for bothering!
Thanks