summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-10-17 12:25:58 -0300
committerJesusaves <cpntb1@ymail.com>2021-10-17 12:25:58 -0300
commit189d41d88e229a7a1b5572d2dcdd95818703f664 (patch)
treed17656e8b66df3495e07505d6a4b908c59bb04e7 /npc/functions
parentc2d5e591dc3ed47457774dfe8ee9e0e1fe003609 (diff)
downloadserverdata-189d41d88e229a7a1b5572d2dcdd95818703f664.tar.gz
serverdata-189d41d88e229a7a1b5572d2dcdd95818703f664.tar.bz2
serverdata-189d41d88e229a7a1b5572d2dcdd95818703f664.tar.xz
serverdata-189d41d88e229a7a1b5572d2dcdd95818703f664.zip
Spice up things at Fortress Town Siege - The Five Heroes are immune to the stun
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/main.txt25
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)