summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasuratva <asuratva@proton.me>2024-05-15 10:49:57 +0530
committerasuratva <asuratva@proton.me>2024-05-15 10:49:57 +0530
commitb770e11f539de8b86a6e042d357e248fc25845b2 (patch)
tree21871ab88c7efa682984a0acb6cc65a99cb428ed /src
parentaaaf2321b8a0e47c46f8ba8a2090c423f5947cf9 (diff)
downloadtmwa-b770e11f539de8b86a6e042d357e248fc25845b2.tar.gz
tmwa-b770e11f539de8b86a6e042d357e248fc25845b2.tar.bz2
tmwa-b770e11f539de8b86a6e042d357e248fc25845b2.tar.xz
tmwa-b770e11f539de8b86a6e042d357e248fc25845b2.zip
Add function to check for summoned creature in scripts
Diffstat (limited to 'src')
-rw-r--r--src/map/script-fun.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 13b4bc8..8d5bf94 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -3727,6 +3727,23 @@ void builtin_aggravate(ScriptState *st)
}
/*==========================================
+ * Check for summoned creature
+ *------------------------------------------
+ */
+static
+void builtin_issummon(ScriptState *st)
+{
+ dumb_ptr<mob_data> md = map_id_is_mob(wrap<BlockId>(conv_num(st, &AARG(0))));
+ int val = 0;
+ if (md && md->name.contains_seq("Summon"_s))
+ {
+ val = 1;
+ }
+
+ push_int<ScriptDataInt>(st->stack, val);
+}
+
+/*==========================================
* エリア指定ユーザー数所得
* Area Designated User Income
*------------------------------------------
@@ -5757,6 +5774,7 @@ BuiltinFunction builtin_functions[] =
BUILTIN(shop, "s"_s, '\0'),
BUILTIN(isdead, ""_s, 'i'),
BUILTIN(aggravate, "i?"_s, '\0'),
+ BUILTIN(issummon, "i?"_s, 'i'),
BUILTIN(fakenpcname, "ssi"_s, '\0'),
BUILTIN(puppet, "mxysi??"_s, 'i'),
BUILTIN(destroy, "?"_s, '\0'),