• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Hero Gets Blink ability at lvl 10 in Reign of Chaos

Status
Not open for further replies.
Level 5
Joined
Apr 21, 2006
Messages
82
JASS:
function Trig_Blink_Conditions takes nothing returns boolean
    if ( not ( GetHeroLevel(GetLevelingUnit()) == 10 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Blink_Actions takes nothing returns nothing
    call UnitAddAbilityBJ( 'AEbl', GetLevelingUnit() )
endfunction

//===========================================================================
function InitTrig_Blink takes nothing returns nothing
    set gg_trg_Blink = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Blink, EVENT_PLAYER_HERO_LEVEL )
    call TriggerAddCondition( gg_trg_Blink, Condition( function Trig_Blink_Conditions ) )
    call TriggerAddAction( gg_trg_Blink, function Trig_Blink_Actions )
endfunction

That is JASS Script what i have found, but i could make that so it would get ur hero a blink ability when the hero gets lvl 10? You choose hero from "Altar".
 
Level 5
Joined
May 9, 2006
Messages
162
I didn't understand what's the problem. Can you explain that more correctly.
Your script has no errors but I wonder why you are using JASS in this
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
(updated script for u)

JASS:
function Trig_Blink_Conditions takes nothing returns boolean 
    return GetHeroLevel(GetLevelingUnit()) == 10
endfunction 

function Trig_Blink_Actions takes nothing returns nothing 
    call UnitAddAbility( GetLevelingUnit(), 'AEbl' ) 
endfunction 

//=========================================================================== 
function InitTrig_Blink takes nothing returns nothing
    local boolexpr b = Condition( function Trig_Blink_Conditions )
    set gg_trg_Blink = CreateTrigger( ) 
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Blink, EVENT_PLAYER_HERO_LEVEL ) 
    call TriggerAddCondition( gg_trg_Blink, b ) 
    call TriggerAddAction( gg_trg_Blink, function Trig_Blink_Actions )
    call DestroyBoolExpr( b )
    set b = null
endfunction

oh yeah, and archworm, that wasnt coded in JASS, its ez to tell its a GUI convert
 
Status
Not open for further replies.
Top