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
|
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 |
|
|
User(s) browsing this thread: 1 Guest(s)