gref
New Member
- Reaction score
- 33
The Premise->
All damage a unit does has a chance to crit.
The chance to crit depends on what type of attack it was:
A Spell: dependent on intelligence
A Melee/Range attack: dependent on agility
So I need something that will detect whether the damage taken by a unit was done by a spell (Magic or Spells attack) or done by a unit's default attack (Normal, Piercing, Hero etc.) so I can determine whether I use Agility or Intelligence to determine the chance for a crit.
Old:
"I'm wanting to implement a system that gives spell crits depending on intelligence, melee crits depending on agility and crit-resistance depending on strength.
To do this I need to know what type of Attack the Damage Source implies on the Triggering unit in the Event:
Does anyone know how to do this?
(+Rep of course will be awarded. (But helping people is good anyway))"
All damage a unit does has a chance to crit.
The chance to crit depends on what type of attack it was:
A Spell: dependent on intelligence
A Melee/Range attack: dependent on agility
So I need something that will detect whether the damage taken by a unit was done by a spell (Magic or Spells attack) or done by a unit's default attack (Normal, Piercing, Hero etc.) so I can determine whether I use Agility or Intelligence to determine the chance for a crit.
Code:
//Obviously pseudo code.
Events
Unit - ArbitraryUnit Takes damage
Conditions...
Actions...
If (Attack type = BLAH)
Then
If Agility/ Random(0 -> 500) > 1
Do crit damage
Else
If Intelligence/ Random(0 -> 500) > 1
Do crit damage
//Numbers are arbitrary
Old:
"I'm wanting to implement a system that gives spell crits depending on intelligence, melee crits depending on agility and crit-resistance depending on strength.
To do this I need to know what type of Attack the Damage Source implies on the Triggering unit in the Event:
Code:
Events
Unit - ArbitraryUnit Takes damage
Conditions...
Actions...
Does anyone know how to do this?
(+Rep of course will be awarded. (But helping people is good anyway))"