SphereCommunity
Hitchance - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Hitchance (/Thread-Hitchance)



Hitchance - Snaigel - 12-24-2019 07:09 PM

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>



RE: Hitchance - Coruja - 12-25-2019 04:26 AM

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


RE: Hitchance - Snaigel - 01-03-2020 09:23 AM

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>>



RE: Hitchance - darksun84 - 01-03-2020 06:41 PM

In @HitTry, if you want to miss, the actdiff must be negative (to be more precise it should be <= -10)


RE: Hitchance - Snaigel - 01-04-2020 01:22 AM

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


RE: Hitchance - Coruja - 01-13-2020 09:19 AM

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