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
tag.override.moverate
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: tag.override.moverate
Here you have a 'bad' example of how does it works (its the code writed now 'in the fly' in spherescript to explain it. TICK_PER_SEC is equal to 10, which are the current ticks per second the Sphere is performing.
Code:
    if (<tag0.override.moverate>)
local.moverate = <tag.override.moverate>
else
local.moverate = <moverate>
endif
local.dex = <dex>
if (fRun) // If character is Moving
if (IsStatFlag(STATF_Pet))    // pets run a little faster.
  if (iDex < 75)
   local.dex = 75; // little adjust for have a minimum speed moverate on pets, so they can follow their master.
  endif
endif
local.NextMove = TICK_PER_SEC / 4 + Rand((100 - (<local.dex>*<local.tick>) / 100) / 5) * TICK_PER_SEC / 10
else
local.NextMove = TICK_PER_SEC + Rand((100 - (<local.dex>*<local.tick>) / 100) / 3) * TICK_PER_SEC / 10;
endif

So for a normal NPC (no pet) with 100 dex and 100 moverate the values will be these: 10 + Rand(33) * 10 / 10 = 41 (r33 gave me 31 when calculating). So this character will do a move each 0.4 seconds.
A normal NPC with 100 dex and 30 moverate will have thse values: 10 + Rand(10)* 10 /10 = 13 (r10 gave me 3), so this character will move each 0.1 seconds.


There are 2 more checks, one ensuring the nextmove is not lesser than 1 and other not allowing it to be higher than 50.
08-09-2014 08:12 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
tag.override.moverate - Skul - 08-09-2014, 02:03 AM
RE: tag.override.moverate - XuN - 08-09-2014 08:12 AM
RE: tag.override.moverate - Skul - 08-10-2014, 12:49 AM
RE: tag.override.moverate - amonvangrell - 01-07-2015, 03:02 PM

Forum Jump:


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