No categories assigned

LUA:CheckRaceType

Revision as of 14:54, 1 April 2014 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: CheckRaceType() = Will check the spawns race type against the race id provided ==== Syntax ==== var = CheckRaceType(param1, param2) ==== Parameters ==== ; Re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: CheckRaceType()

Will check the spawns race type against the race id provided


Syntax

var = CheckRaceType(param1, param2)


Parameters

Required - param1 (Spawn), param2 (int16)
param1 is the spawn to check
param2 is the race id to check against

Returns

Bool, true if the spawn is of the provided race

Usage

function cast(Caster, Target)
    -- do normal damage here

    if CheckRace(Target, 233) then
        -- do extra damage to undead here
    end
end

This spell will do extra damage to undead NPC's

Notes

Race id's are defined in RaceTypes.h