# Method Unit:DealDamage [-] [+]

Makes the Unit damage the target Unit

    enum SpellSchools
    {
        SPELL_SCHOOL_NORMAL  = 0,
        SPELL_SCHOOL_HOLY    = 1,
        SPELL_SCHOOL_FIRE    = 2,
        SPELL_SCHOOL_NATURE  = 3,
        SPELL_SCHOOL_FROST   = 4,
        SPELL_SCHOOL_SHADOW  = 5,
        SPELL_SCHOOL_ARCANE  = 6,
        MAX_SPELL_SCHOOL     = 7
    };

## Synopsis

`Unit:DealDamage( target, damage )`

`Unit:DealDamage( target, damage, durabilityloss )`

`Unit:DealDamage( target, damage, durabilityloss, school )`

`Unit:DealDamage( target, damage, durabilityloss, school, spell )`

## Arguments

`Unit target`

  Unit to damage.

`number damage`

  Amount to damage.

  Valid numbers: integers from 0 to 4,294,967,295.

`boolean durabilityloss (true)`

  If false, the damage does not do durability damage.

`SpellSchools school (MAX_SPELL_SCHOOL)`

  School the damage is done in or MAX_SPELL_SCHOOL for direct damage.

`number spell (0)`

  Spell that inflicts the damage.

  Valid numbers: integers from 0 to 4,294,967,295.

## 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