• 🏆 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!

Auto-Cast discussion

Status
Not open for further replies.
Level 4
Joined
Sep 4, 2007
Messages
54
Ok, here's the thing. With normal autocast(lets just a-c for short) abilities, you can set the default used ability for the unit to that a-c and it will a-c it! BUT what do you do when the ability is NOT a-c?

For Example:

My unit, Grengel, has a Roar ability, since the game I'm making is using massive armies, the player does not have time to click each Grengels' Roar ability individually.

So, my question is: how do I make it a-c when it is not a-c?


JASS:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'Ahea' ) ) then
        return false
    endif
    if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'n00H' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call UnitRemoveAbilityBJ( 'Ahea', GetSpellAbilityUnit() )
    call UnitAddAbilityBJ( 'Aroa', GetSpellAbilityUnit() )
    call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "roar" )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

Well, my method didn't work, Grengel simply lost both abilities but played the spell animation anyway. Anyone have and a-c methods that might work?
 
Status
Not open for further replies.
Top