diff options
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r-- | npc/functions/main.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 787c230a1..2818d1fb7 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -327,6 +327,31 @@ function script getmap { return .@mapName$; } +// Get unit BL from type +// ( unittype ) +function script getunitbl { + switch (getarg(0)) { + case UNITTYPE_PC: + return BL_PC; + case UNITTYPE_NPC: + return BL_NPC; + case UNITTYPE_PET: + return BL_PET; + case UNITTYPE_MOB: + return BL_MOB; + case UNITTYPE_HOM: + return BL_HOM; + case UNITTYPE_MER: + return BL_MER; + case UNITTYPE_ELEM: + return BL_ELEM; + default: + consolewarn("Invalid unit type on getunitbl: %d", getarg(0)); + return BL_ALL; + } + return 0; +} + // isin( map, x1, y1, {[x2, y2][radius]} ) function script isin { if (getmapxy(.@mapName$, .@xpos, .@ypos, 0) != 0) |