• 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.

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