diff options
author | AJ Keresztes <aj@keresztes.us> | 2024-06-01 22:25:24 +0000 |
---|---|---|
committer | AJ Keresztes <aj@keresztes.us> | 2024-06-01 22:25:24 +0000 |
commit | a5a1212e67f2a27e93dabd0d1b63884093bea756 (patch) | |
tree | 164b369b2be2f0e853395128b8a62fff16362394 /src/map | |
parent | 354c8402d3fcd830c1f2671aeaa0436963432efb (diff) | |
parent | 1841311e6302ff88e53446744e571bed703d2087 (diff) | |
download | tmwa-a5a1212e67f2a27e93dabd0d1b63884093bea756.tar.gz tmwa-a5a1212e67f2a27e93dabd0d1b63884093bea756.tar.bz2 tmwa-a5a1212e67f2a27e93dabd0d1b63884093bea756.tar.xz tmwa-a5a1212e67f2a27e93dabd0d1b63884093bea756.zip |
Merge branch tmwa:master into master
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script-fun.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 2c09ba6..e4ecdf1 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -3201,8 +3201,8 @@ void builtin_summon(ScriptState *st) } mob->mode |= - MobMode::SUMMONED | MobMode::TURNS_AGAINST_BAD_MASTER; - + MobMode::SUMMONED; // | MobMode::TURNS_AGAINST_BAD_MASTER; <- its fun but bugged. + // This flag identified to be source of AFK PK city exploits, etc. mob->deletetimer = Timer(gettick() + lifespan, std::bind(mob_timer_delete, ph::_1, ph::_2, mob_id)); @@ -3740,6 +3740,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) + { + val = bool(md->mode & MobMode::SUMMONED); + } + + push_int<ScriptDataInt>(st->stack, val); +} + +/*========================================== * エリア指定ユーザー数所得 * Area Designated User Income *------------------------------------------ @@ -5770,6 +5787,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'), |