• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

detect the level of an ability being cast

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
I’m making a triggered spell, and I am wondering whats the most effective way of detecting the level of an ability being cast?
 
Level 10
Joined
Apr 3, 2006
Messages
535
I dont fully understand the JASS part would it look like this.

Set hero as a unit variable

local integer i= GetUnitAbilityLevel(GetTriggerUnit(hero),GetSpellAbilityId(A0I3))

A0I3 is the abilitys raw code in the editor? or what ever my spell is that i want to use.
 
Level 10
Joined
Apr 3, 2006
Messages
535
ok i think i get it.

So i literally copy/paste your original JASS code.
Would i need an if/then/else afterwards
eg
if integar = 1
then do lvl 1 damage,
if integar = 2
then do lvl 2 damage,
etc
 
Level 7
Joined
Jul 18, 2009
Messages
272
Would i need an if/then/else afterwards
eg
if integar = 1
then do lvl 1 damage,
if integar = 2
then do lvl 2 damage,
etc
If you know the formula for the dmg, you don't need any ifs.

For example your spell does 100, 150, 200, 250 dmg (Level 1-4).
Then the dmg-formula would be dmg = (Abilitylevel + 1)*50.

Then you just have to use that formula in your trigger.
 
Status
Not open for further replies.
Top