# Unit Changes Ability Auto Cast State
Grammar — unit changes ability Auto Cast state change (includeSharedAbilities|Include/Ignore shared abilities)
Flags —Native
|Event
This event fires when a unit changes an ability’s auto cast state. Use “Triggering Ability” to get the ability that was used. Use “Triggering Player” to get the player that used the ability. Use “Triggering Unit” to get the unit that used the ability. If the parameter “Include Shared Abilities” is set to true, instead of matching the specific event, it will match any event that has the same ability set id (AbilSetId).
# Arguments
unitref
<unit> — Unitabilcmd
— Abilityint
<preset::AbilityAutoCastChange> — Changebool
<preset::IncludeIgnoreOption> — Include Shared Abilities
Returns — void
native void TriggerAddEventUnitAbilityAutoCastChange(
trigger t,
unitref u,
abilcmd a,
int inChangeType,
bool includeSharedAbils,
);
# Event parameters
- Triggering Ability — EventUnitAbility
- Triggering Ability Other Unit — EventUnitAbilityOtherUnit
- Ability From Item or Trigger — libNtve_gf_EventItemAbilityOrUnitAbility
- Triggering Game User — EventGameUser
- Triggering Player — EventPlayer
- Triggering Unit — EventUnit
# Related
Category: Ability / Basic
- Remove Ability —
void
— UnitAbilityRemove - Add Ability —
void
— UnitAbilityAdd - Unit Uses Ability —
void
— TriggerAddEventUnitAbility - Unit Changes Ability Auto Cast State —
void
— TriggerAddEventUnitAbilityAutoCastChange - Triggering Ability —
abilcmd
— EventUnitAbility - Triggering Ability Stage —
int
<preset::AbilityStage> — EventUnitAbilityStage - Triggering Ability Target Point —
point
— EventUnitTargetPoint - Triggering Ability Target Unit —
unit
— EventUnitTargetUnit - Triggering Ability Other Unit —
unit
— EventUnitAbilityOtherUnit - Ability From Item or Trigger —
abilcmd
— libNtve_gf_EventItemAbilityOrUnitAbility - Unit Is Created —
void
— TriggerAddEventUnitCreated - Created Unit —
unit
— EventUnitCreatedUnit - Behavior That Created Unit —
string
<gamelink::Behavior> — EventUnitCreatedBehavior - Ability That Created Unit —
string
<gamelink::Abil> — EventUnitCreatedAbil - Show/Hide Ability For Unit —
void
— UnitAbilityShow - Ability Enabled For Unit —
bool
— UnitAbilityCheck - Number Of Abilities On Unit —
int
— UnitAbilityCount - Unit Ability —
string
<gamelink::Abil> — UnitAbilityGet - Unit Ability By Class —
string
<gamelink::Abil> — libNtve_gf_UnitAbilityGetByType - Unit Ability Command State —
bool
— UnitCheckAbilCmdState - Unit Ability Order State (Flags) —
int
— UnitAbilOrderStateFlags - Unit Has Ability —
bool
— UnitAbilityExists - Enable/Disable Ability For Unit —
void
— UnitAbilityEnable - Add Level To Unit Ability —
void
— UnitAbilityChangeLevel - Replace Unit Ability —
void
— UnitAbilityChangeLink - Set Ability Default Submenu —
void
— UnitAbilityChangeCardId - Current Level For Unit Ability —
int
— UnitAbilityGetLevel - Maximum Level For Unit Ability —
int
— UnitAbilityMaxLevel - Ability Matches Filters —
bool
— libNtve_gf_AbilityMatchesFilters - Unit Ability By Filters —
string
<gamelink::Abil> — libNtve_gf_UnitAbilityByFilters - Unit Ability Default Submenu —
string
— UnitAbilityGetCardId
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17417
libCOMI_gt_CM_DehakaAutocastSettingsOn = TriggerCreate("libCOMI_gt_CM_DehakaAutocastSettingsOn_Func");
TriggerEnable(libCOMI_gt_CM_DehakaAutocastSettingsOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOn, false);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17418
TriggerEnable(libCOMI_gt_CM_DehakaAutocastSettingsOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOn, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17419
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOn, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOn, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17453
libCOMI_gt_CM_DehakaAutocastSettingsOff = TriggerCreate("libCOMI_gt_CM_DehakaAutocastSettingsOff_Func");
TriggerEnable(libCOMI_gt_CM_DehakaAutocastSettingsOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOff, false);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17454
TriggerEnable(libCOMI_gt_CM_DehakaAutocastSettingsOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOff, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17455
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("DehakaGlevigFirebreath", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("MurvarCoopPuke", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_DehakaAutocastSettingsOff, null, AbilityCommand("CoopMurvarSpawnCreepers", 0), c_unitAbilAutoCastChangeOff, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19399
libCOMI_gt_CM_FenixAutocastSettingsOn = TriggerCreate("libCOMI_gt_CM_FenixAutocastSettingsOn_Func");
TriggerEnable(libCOMI_gt_CM_FenixAutocastSettingsOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOn, null, AbilityCommand("FenixSoAWhirlwind", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOn, null, AbilityCommand("VoidShieldCapacitor", 0), c_unitAbilAutoCastChangeOn, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19400
TriggerEnable(libCOMI_gt_CM_FenixAutocastSettingsOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOn, null, AbilityCommand("FenixSoAWhirlwind", 0), c_unitAbilAutoCastChangeOn, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOn, null, AbilityCommand("VoidShieldCapacitor", 0), c_unitAbilAutoCastChangeOn, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19431
libCOMI_gt_CM_FenixAutocastSettingsOff = TriggerCreate("libCOMI_gt_CM_FenixAutocastSettingsOff_Func");
TriggerEnable(libCOMI_gt_CM_FenixAutocastSettingsOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOff, null, AbilityCommand("FenixSoAWhirlwind", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOff, null, AbilityCommand("VoidShieldCapacitor", 0), c_unitAbilAutoCastChangeOff, false);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19432
TriggerEnable(libCOMI_gt_CM_FenixAutocastSettingsOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOff, null, AbilityCommand("FenixSoAWhirlwind", 0), c_unitAbilAutoCastChangeOff, false);
TriggerAddEventUnitAbilityAutoCastChange(libCOMI_gt_CM_FenixAutocastSettingsOff, null, AbilityCommand("VoidShieldCapacitor", 0), c_unitAbilAutoCastChangeOff, false);
}