summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/025-1/ctrl.c3
-rw-r--r--npc/functions/main.txt25
2 files changed, 27 insertions, 1 deletions
diff --git a/npc/025-1/ctrl.c b/npc/025-1/ctrl.c
index 1bd138488..1b42e6c7f 100644
--- a/npc/025-1/ctrl.c
+++ b/npc/025-1/ctrl.c
@@ -104,7 +104,8 @@ function script FTStatue {
if (askyesno() == ASK_YES) {
if ($@FORTRESS_STATUE & .@id)
return false;
- sc_start SC_STUN, 10000, 1;
+ if (!islegendary())
+ sc_start SC_STUN, 10000, 1;
doevent("Gate#F::OnStatueBreach");
mapannounce("025-1", strcharinfo(0)+" has broken a statue!", bc_map);
$@FORTRESS_STATUE=$@FORTRESS_STATUE|.@id;
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)