Difference between revisions of "LUA:GetRaceType"

(Created page with "= LUA Functions: GetRaceType() = Will get the race id for the given spawn ==== Syntax ==== var = GetRaceType(param1) ==== Parameters ==== ; Required - ''param1'' (Spawn) : ''...")
 
(No difference)

Latest revision as of 14:56, 1 April 2014

LUA Functions: GetRaceType()

Will get the race id for the given spawn


Syntax

var = GetRaceType(param1)


Parameters

Required - param1 (Spawn)
param1 is the spawn who's race id we want

Returns

int32, the id of the spawns race

Usage

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

    if GetRaceType(Target) == 242 then
        -- do extra damage to vampires here
    end
end

This spell will do extra damage to vampire NPC's

Notes

Race id's are defined in RaceTypes.h