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
NPC Restock
Author Message
escribano
Journeyman
*

Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2

Dragon Shard

Post: #6
RE: NPC Restock
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 Smile

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

UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
(This post was last modified: 07-21-2015 10:04 AM by escribano.)
07-21-2015 09:29 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
NPC Restock - escribano - 07-19-2015, 12:51 PM
RE: NPC Restock - azmanomer - 07-19-2015, 04:19 PM
RE: NPC Restock - Paulo_BR - 07-20-2015, 03:59 AM
RE: NPC Restock - XuN - 07-20-2015, 05:46 PM
RE: NPC Restock - escribano - 07-21-2015, 08:01 AM
RE: NPC Restock - escribano - 07-21-2015 09:29 AM
RE: NPC Restock - XuN - 07-22-2015, 06:14 PM
RE: NPC Restock - escribano - 07-23-2015, 12:55 AM
RE: NPC Restock - XuN - 07-24-2015, 06:47 PM
RE: NPC Restock - escribano - 07-25-2015, 04:27 PM
RE: NPC Restock - XuN - 07-27-2015, 07:40 AM
RE: NPC Restock - escribano - 07-27-2015, 12:43 PM
RE: NPC Restock - escribano - 08-01-2015, 02:36 PM

Forum Jump:


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