SphereCommunity
weapon speed calculating formula - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: weapon speed calculating formula (/Thread-weapon-speed-calculating-formula)



weapon speed calculating formula - WRWR - 05-12-2012 09:43 AM

How is weapon speed calculating in core?


RE: weapon speed calculating formula - ShiryuX - 05-12-2012 02:31 PM

I scripted it some time ago for SCP, it is:
Code:
return <eval (<serv.SpeedScaleFactor> * 10) / ((<dex> + 100) * <feval <floatval 150 / <fval <local.speed>>>>)>



RE: weapon speed calculating formula - WRWR - 05-12-2012 05:49 PM

SpeedscaleFactor from spehre.ini
local.speed is speed from weapon script?
right?


RE: weapon speed calculating formula - ShiryuX - 05-13-2012 01:31 AM

Exactly.
If you have no weapon, local.speed = 20


RE: weapon speed calculating formula - WRWR - 05-13-2012 03:36 AM

Thanks


RE: weapon speed calculating formula - WRWR - 05-16-2012 11:36 PM

How about ARGN in @HITTRY?


RE: weapon speed calculating formula - admin phoenix - 05-16-2012 11:46 PM

(05-12-2012 02:31 PM)ShiryuX Wrote:  I scripted it some time ago for SCP, it is:
Code:
return <eval (<serv.SpeedScaleFactor> * 10) / ((<dex> + 100) * <feval <floatval 150 / <fval <local.speed>>>>)>

how you put this in the script?


RE: weapon speed calculating formula - ShiryuX - 05-18-2012 12:13 AM

Copy and paste in a file.


RE: weapon speed calculating formula - Extreme - 06-04-2012 03:29 AM

Hi, I made my swing speed calculation using this: http://uo.stratics.com/content/arms-armor/combat.php#speed

If you want to show the weapon speed in the tooltips I recommend to use this:

Code:
[EVENTS E_PlayerTooltipEvent]
ON=@ITEMCLIENTTOOLTIP
IF <ACT.ISWEAPON>
ADDCLILOC 1061168,<ACT.DAM>
IF ( <EVAL <FVAL ((<ACT.SPEED>) - <EVAL (<ACT.SPEED>/10)*10>)>> == 2 ) || ( <EVAL <FVAL ((<ACT.SPEED>) - <EVAL (<ACT.SPEED>/10)*10>)>> == 7 )
  ADDCLILOC 1061167,<FVAL <ACT.SPEED>>5s
ELSE
  ADDCLILOC 1061167,<FVAL <ACT.SPEED>>s
ENDIF
ENDIF
Obs: you should use the weapon speed in weapon script like that
ex 1: Hammer pick REAL speed is 3.25s, then you should set the speed in 32
ex 2: Katana REAL speed is 2.5s, then you shoud set the speed in 25

I think the SCP scripts is already like this, but you can check.

So, the Swing Speed calculation I did this:
Code:
IF ( <EVAL <FVAL ((<UID.<WEAPON>.SPEED>) - <EVAL (<UID.<WEAPON>.SPEED>/10)*10>)>> == 2 ) || ( <EVAL <FVAL ((<UID.<WEAPON>.SPEED>) - <EVAL (<UID.<WEAPON>.SPEED>/10)*10>)>> == 7 )
FLOAT.SPEED <FLOATVAL <UID.<WEAPON>.SPEED>+0.5>
ELSE
FLOAT.SPEED <FLOATVAL <UID.<WEAPON>.SPEED>>
ENDIF
SMSG @044,,1 Weapon Speed <FLOATVAL <FLOAT.SPEED>/10>
SMSG @063,,1 Swing Speed <FLOATVAL <FLOAT.SPEED>/2.5> ticks of 0.25s

FLOAT.SPEED -= <FLOATVAL (<SRC.STAMINA>/30)*2.5>
SMSG @035,,1 Stamina Bonus <FLOATVAL (<SRC.STAMINA>/30)*2.5>
SMSG @063,,1 Swing Speed <FLOATVAL <FLOAT.SPEED>/2.5> ticks of 0.25s

FLOAT.SPEED <FLOATVAL <FLOAT.SPEED>*(100.0/(100+<SRC.dTAG.SWINGSPEEDINCREASE>)>
SMSG @055,,1 Swing Speed Bonus <FLOATVAL 100.0/(100+<SRC.dTAG.SWINGSPEEDINCREASE>)>
SMSG @063,,1 Swing Speed <FLOATVAL <FLOAT.SPEED>/2.5> ticks of 0.25s

FLOAT.SPEED <FLOATVAL <EVAL <FLOATVAL <FLOAT.SPEED>/2.5>/1000000>>

IF <FLOATVAL <FLOAT.SPEED>> < <FLOATVAL 5>
FLOAT.SPEED <FLOATVAL 5>
ENDIF
SMSG @0481,,1 Swing Speed <FLOATVAL <FLOAT.SPEED>*0.25>s
You just need comment the `debug` messages, its just to understand what its doing