# Method Unit:SetImmuneTo [-] [+]

Sets a mechanic immunity for the Unit.

      MECHANIC_NONE             = 0,
      MECHANIC_CHARM            = 1,
      MECHANIC_DISORIENTED      = 2,
      MECHANIC_DISARM           = 3,
      MECHANIC_DISTRACT         = 4,
      MECHANIC_FEAR             = 5,
      MECHANIC_GRIP             = 6,
      MECHANIC_ROOT             = 7,
      MECHANIC_SLOW_ATTACK      = 8,
      MECHANIC_SILENCE          = 9,
      MECHANIC_SLEEP            = 10,
      MECHANIC_SNARE            = 11,
      MECHANIC_STUN             = 12,
      MECHANIC_FREEZE           = 13,
      MECHANIC_KNOCKOUT         = 14,
      MECHANIC_BLEED            = 15,
      MECHANIC_BANDAGE          = 16,
      MECHANIC_POLYMORPH        = 17,
      MECHANIC_BANISH           = 18,
      MECHANIC_SHIELD           = 19,
      MECHANIC_SHACKLE          = 20,
      MECHANIC_MOUNT            = 21,
      MECHANIC_INFECTED         = 22,
      MECHANIC_TURN             = 23,
      MECHANIC_HORROR           = 24,
      MECHANIC_INVULNERABILITY  = 25,
      MECHANIC_INTERRUPT        = 26,
      MECHANIC_DAZE             = 27,
      MECHANIC_DISCOVERY        = 28,
      MECHANIC_IMMUNE_SHIELD    = 29,     // Divine (Blessing) Shield/Protection and Ice Block
      MECHANIC_SAPPED           = 30,
      MECHANIC_ENRAGED          = 31

## Synopsis

`Unit:SetImmuneTo( immunity )`

`Unit:SetImmuneTo( immunity, apply )`

## Arguments

`number immunity`

  New value for the immunity mask.

  Valid numbers: integers from -2,147,483,647 to 2,147,483,647.

`boolean apply (true)`

  If true, the immunity is applied, otherwise it is removed.

## Returns

Nothing.

# Keyboard shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

# Search tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct` (or `str`), `enum`, `trait`, `typedef` (or `tdef`).

Generated on
© 2010 - 2024 Eluna Lua Engine