SphereCommunity
Problem with damages - Printable Version

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

Pages: 1 2


RE: Problem with damages - Snaigel - 12-25-2019 04:01 PM

Now it works with SRC.AR instead of SRC.ARMOR


RE: Problem with damages - Snaigel - 01-03-2020 03:32 AM

Okay so now this formula that we worked in this post, works perfectly for me:

Quote: ARGN1 = <eval (<R250,310>*10)/<SRC.AR>>
ARGN2 |= dam_fixed
SYSMESSAGE @0501 You did <ARGN1> points of damage.

And now I would like to add a bonus of dmg based on your combat skill (fencing,swordsmanship etc), how should I write it?
for example +1dmg for every 10.0 points above 100.0 in fencing

This is what I have done atm

Quote:ON=@Hit
LOCAL.Skill = <QVAL (<WEAPON>)? <WEAPON.SKILL> : 43>
IF <LOCAL.Skill> = 1100
ARGN1 += 1
ENDIF
IF <LOCAL.Skill> = 1200
ARGN1 += 2
ENDIF
.........
// I do it splitting in separated IFs because anyway the cap will be like 140



RE: Problem with damages - Coruja - 01-03-2020 07:36 AM

This should work, but note that single "=" is only used to define variables. To compare variables (if, elif, etc) you must use ==, !=, >= or <=

But you can also replace these IF's with a single formula
Code:
ON=@Hit
ARGN1 = <eval (<R250,310> * 10) / <SRC.AR>>
LOCAL.Skill = <QVAL (<WEAPON>)? <WEAPON.SKILL> : 43>
IF (<LOCAL.Skill> > 1000)
  ARGN1 += <eval (<LOCAL.Skill> - 1000) / 100>
ENDIF
ARGN2 |= dam_fixed
SYSMESSAGE @0501 You did <ARGN1> points of damage.



RE: Problem with damages - Snaigel - 01-03-2020 08:16 AM

Hmm I'm doing tests and doesn't seem to work, it does the first formula but seems to ignore the formula for the bonus based on skill

I've replaced just in case:
Quote:ARGN1 += <eval (<LOCAL.Skill> - 1000) / 100>
for
Quote:ARGN1 += 500
but not working


RE: Problem with damages - Coruja - 01-03-2020 08:28 AM

Nah I just forgot to convert the skill number into skill value

<LOCAL.Skill> will just return the skill number (43 = wrestling, etc). To get the skill value (75.0, 100.0, etc) you must use <I.<LOCAL.Skill>>. So you just need to replace <LOCAL.Skill> with <I.<LOCAL.Skill>>


RE: Problem with damages - Snaigel - 01-03-2020 08:56 AM

Now it works!!