Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hit Chance
Author Message
ISOcol
Apprentice
*

Posts: 16
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2022
Reputation: 0



Post: #1
Hit Chance
// Discord Collection
// Example for sphere.ini custom [CombatHitChanceEra=0]
// // Events related to all players
// // EventsPlayer=
//

[EVENTS e_combat_hitchance]
ON=@HitTry
LOCAL.AnimDelay=6 // speed of how early damage happens from swing animation (1=fastest 6=best 10=long anim)
ARGN1=7 // delay between attacks (1=fastest can cause dbl hits) (7=best)
local.R=<R900> // store Random number of 900 in local.R
IF (<ISPLAYER>) //
serv.log (<local.R> <= <<ACTION>>) % // show in console the Rrandom number and the skill amount being used in <<ACTION>>
IF (<local.R> <= <<ACTION>>) // IF random number is lesser then or equal to the skillbeingused number
ACTDIFF=1 // (1 success) (-1 fail/miss) (1000 skill = 100% chance)
SERV.LOG <i.NAME> hitchance using <i.ACTION> is: <<ACTION>>) % // console show name, skill, skill%
ELSE // else if your skill isnt high enough you will have a miss chance
IF (<EVAL RAND(5)> > 1) // 1 in 5 chance // faster swing maybe need more than 5 // or less than 5
SERV.LOG <i.NAME> hitchance using <i.ACTION> is: <<ACTION>>) %%% <EVAL RAND(2)> // show in console
ACTDIFF=-1000 // (1 success) (-1 fail/miss)
ENDIF
ENDIF

//or

[EVENTS e_combat_hitchance]
ON=@HITTRY
LOCAL.AnimDelay=6
actdiff = 1000 //actdiff above or equal 0always hit
if ((<argo.isvalid>) && (<argo.isweapon>))
local.skill = <<weapon.skill>>
endif
if <action> == skill_wrestling
local.skill = <wrestling>
endif
local.x = <R1,<dlocal.skill>>
if <dlocal.skill> <= <dlocal.x> + 75
actdiff = -1000 //actdiff < 0 always miss
endif
(This post was last modified: 09-01-2022 07:47 PM by ISOcol.)
08-28-2022 04:27 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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