• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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?
 
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.
 
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
 
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.
Back
Top