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-nmm6 (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-nmm6 (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-nmm6 (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
Hitchance
Author Message
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #1
Hitchance
I found this formula in the forum for hitchance based on tactics + weapon skill. But what does the ":43" means?

Quote: ON=@HitTry

LOCAL.Skill = <QVAL (<WEAPON>)? <WEAPON.SKILL> :43>
LOCAL.SkillAttack = <eval (<I.<LOCAL.Skill>> + <TACTICS>) / 2>
12-24-2019 07:09 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Hitchance
This line seems to store a skill, so maybe 43 should be skill 43, which makes sense because skill 43 on sphere_skills.scp is wrestling

So this line will use weapon skill when there's a weapon equipped, otherwise it will use wrestling skill
12-25-2019 04:26 AM
Find all posts by this user Like Post Quote this message in a reply
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #3
RE: Hitchance
Ok I'm using this trigger on an event for the hitchance of every player
but I want it to make some sound when you fail the attack, or some sysmessage to appear. But I'm not sure how and where to write it

Quote:ON=@HitTry
LOCAL.Skill = <QVAL (<WEAPON>)? <WEAPON.SKILL> : 43>
LOCAL.SkillAttack = <eval (<I.<LOCAL.Skill>> + <TACTICS>) / 2>
LOCAL.SkillDefend = <eval (<SRC.PARRYING> + <SRC.TACTICS>) / 2>

LOCAL.Diff = <eval (<LOCAL.SkillAttack> - <LOCAL.SkillDefend>) / 5>
LOCAL.Diff = <eval (<I.<LOCAL.Skill>> - <LOCAL.Diff>) / 10>
IF (<LOCAL.Diff> < 0)
LOCAL.Diff = 0
ELIF (<LOCAL.Diff> > 100)
LOCAL.Diff = 100
ENDIF
ACTDIFF = <R<LOCAL.Diff>>
01-03-2020 09:23 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Hitchance
In @HitTry, if you want to miss, the actdiff must be negative (to be more precise it should be <= -10)
01-03-2020 06:41 PM
Find all posts by this user Like Post Quote this message in a reply
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #5
RE: Hitchance
Hmm but what I mean is: the player who misses a hit doesn't make any sound, either gets any message like "you failed the attack", and I would like to add that
01-04-2020 01:22 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #6
RE: Hitchance
Setting negative ACTDIFF will make the action fail and call @HitMiss, so you can add any message or sound here

But maybe you doesn't need to use @HitMiss, because you can set DETAIL=1 on char to enable combat messages (including parry/miss messages), and also set AMMOSOUNDHIT / AMMOSOUNDMISS on weapon scripts to override default hit/miss sound
01-13-2020 09:19 AM
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)