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: 0 in 0 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: 958
Likes Given: 5
Likes Received: 222 in 184 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: 0 in 0 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,681
Likes Given: 243
Likes Received: 161 in 150 posts
Joined: Mar 2012
Reputation: 34



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: 0 in 0 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: 958
Likes Given: 5
Likes Received: 222 in 184 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)

This forum uses Lukasz Tkacz MyBB addons.