Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with damages
Author Message
Snaigel
Journeyman
*

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



Post: #11
RE: Problem with damages
Now it works with SRC.AR instead of SRC.ARMOR
12-25-2019 04:01 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: #12
RE: Problem with damages
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
(This post was last modified: 01-03-2020 03:55 AM by Snaigel.)
01-03-2020 03:32 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: #13
RE: Problem with damages
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.
(This post was last modified: 01-03-2020 07:36 AM by Coruja.)
01-03-2020 07:36 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: #14
RE: Problem with damages
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
(This post was last modified: 01-03-2020 08:21 AM by Snaigel.)
01-03-2020 08:16 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: #15
RE: Problem with damages
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>>
01-03-2020 08:28 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: #16
RE: Problem with damages
Now it works!!
01-03-2020 08:56 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)