Buff level

Lmfaocj

Active Member
Reaction score
1
I know that you can't detect a buff level because it only returns one but can someone help me find out a way to make this work.

JASS:
function Trig_Dark_Aura_Conditions takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetEventDamageSource(), 'B007') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Dark_Aura_Actions takes nothing returns nothing
    call UnitDamageTargetEx(GetEventDamageSource(),GetTriggerUnit(),GetEventDamage() * (I2R(GetUnitAbilityLevel(GetEventDamageSource(),'B007')) * 0.02), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
endfunction

//===========================================================================
function InitTrig_Dark_Aura takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerAddCondition( t, Condition( function Trig_Dark_Aura_Conditions ) )
    call TriggerAddAction( t, function Trig_Dark_Aura_Actions )
    call Damage_RegisterEvent(t)
endfunction
 

UndeadDragon

Super Moderator
Reaction score
447
Can I ask why you converted that into JASS before posting it? It was obviously not originally written in it.

It just makes it harder to read.
 

Lmfaocj

Active Member
Reaction score
1
I converted it to jass because I'm using damage. a system made by jesus4lyf
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
scope Something initializer Init

private function Cond takes nothing returns boolean
    return GetUnitAbilityLevel(GetEventDamageSource(), 'B007') > 0
endfunction

private function Acts takes nothing returns nothing
    call UnitDamageTargetEx(GetEventDamageSource(), GetTriggerUnit(), GetEventDamage() * I2R(GetUnitAbilityLevel(GetEventDamageSource(), 'B007')) * 0.02), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerAddCondition(t, Condition(function Cond))
    call TriggerAddAction(t, function Acts)
    call Damage_RegisterEvent(t)
endfunction

endscope


better you try to get the level of ability instead of buff, buff don't use levels, you can also use one buff per level <stupid choice> anyway..
 

Lmfaocj

Active Member
Reaction score
1
This would've been easier to make if I was making the hero only gets picked once... But I want to make this for a rpg map.
 

Lmfaocj

Active Member
Reaction score
1
Edit: Never mind thanks for the help guys. I am just going to make this skill have one level.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top