diff --git a/hs_err_pid30541.log b/hs_err_pid30541.log deleted file mode 100644 index ec86189..0000000 --- a/hs_err_pid30541.log +++ /dev/null @@ -1,1613 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGBUS (0x7) at pc=0x00007fe6fdb66497, pid=30541, tid=30639 -# -# JRE version: OpenJDK Runtime Environment Temurin-21.0.2+13 (21.0.2+13) (build 21.0.2+13-LTS) -# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (21.0.2+13-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) -# Problematic frame: -# V [libjvm.so+0xf66497] ThreadService::remove_thread(JavaThread*, bool)+0x157 -# -# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/morr/work/foundryvtt/foundryvtt-wh4-lang-fr-fr/core.30541) -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# - ---------------- S U M M A R Y ------------ - -Command Line: /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/server/sonarlint-ls.jar -stdio -analyzers /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonargo.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarjava.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarjs.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarphp.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarpython.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarhtml.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarxml.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarcfamily.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonartext.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonariac.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarlintomnisharp.jar - -Host: AMD Ryzen 7 4800H with Radeon Graphics, 16 cores, 30G, openSUSE Tumbleweed -Time: Tue Feb 27 21:56:29 2024 CET elapsed time: 1916.307781 seconds (0d 0h 31m 56s) - ---------------- T H R E A D --------------- - -Current thread (0x00007fe5d0035a40): JavaThread "ForkJoinPool.commonPool-worker-1" [_thread_in_vm, id=30639, stack(0x00007fe6d26e8000,0x00007fe6d27e8000) (1024K)] - -Stack: [0x00007fe6d26e8000,0x00007fe6d27e8000], sp=0x00007fe6d27e6c90, free space=1019k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [libjvm.so+0xf66497] ThreadService::remove_thread(JavaThread*, bool)+0x157 -V [libjvm.so+0xf6b58c] Threads::remove(JavaThread*, bool)+0xac -V [libjvm.so+0x91dc6b] JavaThread::exit(bool, JavaThread::ExitType)+0x47b -V [libjvm.so+0x91e216] JavaThread::post_run()+0x16 -V [libjvm.so+0xcee34a] thread_native_entry(Thread*)+0xda - -siginfo: si_signo: 7 (SIGBUS), si_code: 2 (BUS_ADRERR), si_addr: 0x00007fe6fe4482b0 - -Registers: -RAX=0x00007fe6fe4482b0, RBX=0x00007fe5d0035a40, RCX=0x00007fe6fd28d9e0, RDX=0x00007fe6fd28bdb0 -RSP=0x00007fe6d27e6c90, RBP=0x00007fe6d27e6cc0, RSI=0x0000000000000001, RDI=0x00007fe5d0035bf0 -R8 =0x00007fe5c80008e0, R9 =0x0000000000000007, R10=0x00007fe5c88c2370, R11=0xe620a9ef8cf909c2 -R12=0x000000000720dfb8, R13=0x0000000000000000, R14=0x0000000000000001, R15=0x00007fe5d0035bf0 -RIP=0x00007fe6fdb66497, EFLAGS=0x0000000000010293, CSGSFS=0x002b000000000033, ERR=0x0000000000000006 - TRAPNO=0x000000000000000e - - -Register to memory mapping: - -RAX=0x00007fe6fe4482b0 is an unknown value -RBX=0x00007fe5d0035a40 points into unknown readable memory: 0x00007fe6fdfdcf60 | 60 cf fd fd e6 7f 00 00 -RCX=0x00007fe6fd28d9e0: in /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so at 0x00007fe6fcc00000 -RDX=0x00007fe6fd28bdb0: in /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so at 0x00007fe6fcc00000 -RSP=0x00007fe6d27e6c90 points into unknown readable memory: 0x0000000000000001 | 01 00 00 00 00 00 00 00 -RBP=0x00007fe6d27e6cc0 points into unknown readable memory: 0x00007fe6d27e6cf0 | f0 6c 7e d2 e6 7f 00 00 -RSI=0x0000000000000001 is an unknown value -RDI=0x00007fe5d0035bf0 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -R8 =0x00007fe5c80008e0 points into unknown readable memory: 0x0002000100070005 | 05 00 07 00 01 00 02 00 -R9 =0x0000000000000007 is an unknown value -R10=0x00007fe5c88c2370 points into unknown readable memory: 0x00007fe6fe08fc78 | 78 fc 08 fe e6 7f 00 00 -R11=0xe620a9ef8cf909c2 is an unknown value -R12=0x000000000720dfb8 is an unknown value -R13=0x0 is null -R14=0x0000000000000001 is an unknown value -R15=0x00007fe5d0035bf0 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 - -Top of Stack: (sp=0x00007fe6d27e6c90) -0x00007fe6d27e6c90: 0000000000000001 0000000000000001 -0x00007fe6d27e6ca0: 00007fe5d0035a40 00007fe6fe0ffda0 -0x00007fe6d27e6cb0: 0000000000000001 0000000614011f10 -0x00007fe6d27e6cc0: 00007fe6d27e6cf0 00007fe6fdb6b58c -0x00007fe6d27e6cd0: 00007fe5d0035a40 00007fe6fe0e4248 -0x00007fe6d27e6ce0: 00007fe5d0035a40 0000000000000000 -0x00007fe6d27e6cf0: 00007fe6d27e6e80 00007fe6fd51dc6b -0x00007fe6d27e6d00: 00007fe6d27e6d80 00007fe6fd98d50d -0x00007fe6d27e6d10: 0000000000000021 00007fe6d27e6d6c -0x00007fe6d27e6d20: 00007fe6d27e6d50 00007fe6fdb9f0b8 -0x00007fe6d27e6d30: 00000006140017b8 00007fe6fd5184a0 -0x00007fe6d27e6d40: 00007fe6700569b0 00007fe5d0035a40 -0x00007fe6d27e6d50: 00007fe6d27e6e10 00000000fd506c37 -0x00007fe6d27e6d60: 00007fe6d27e6d90 00007fe5d0035a40 -0x00007fe6d27e6d70: 0000000000000000 00007fe6fd508cb1 -0x00007fe6d27e6d80: 00007fe6d27e6e00 00007fe6fd51a0d2 -0x00007fe6d27e6d90: 0000000000000000 00007fe6700569c0 -0x00007fe6d27e6da0: 00007fe670056d00 00000020700569b0 -0x00007fe6d27e6db0: 0000000000000000 00007fe6700569c0 -0x00007fe6d27e6dc0: 0000000000000000 00000000000077af -0x00007fe6d27e6dd0: 0000000000000000 00007fe5d0036190 -0x00007fe6d27e6de0: 00007fe5d001f400 00007fe5d001f4a0 -0x00007fe6d27e6df0: 00007fe5d0035a40 00007fe5d001f4a8 -0x00007fe6d27e6e00: 0000006518fb2311 00000000000077af -0x00007fe6d27e6e10: 00007fe5d0035a40 00007fe5d0036190 -0x00007fe6d27e6e20: 00007fe5d001f490 00007fe5d001f4a0 -0x00007fe6d27e6e30: 00007fe5d001f578 00000000000000d8 -0x00007fe6d27e6e40: 00007fe5d00362f0 00007fe6fdb5fd98 -0x00007fe6d27e6e50: 00007fe6d27e6e80 00007fe5d0036830 -0x00007fe6d27e6e60: 00007fe5d0035a40 00007fe5d0035a40 -0x00007fe6d27e6e70: 00007fe6d28e6450 00007fe6d26e7000 -0x00007fe6d27e6e80: 00007fe6d27e6ea0 00007fe6fd51e216 - -Instructions: (pc=0x00007fe6fdb66497) -0x00007fe6fdb66397: 8b 40 60 48 8d 15 0f 5a 72 ff 48 39 d0 0f 85 c6 -0x00007fe6fdb663a7: 00 00 00 8b 83 70 04 00 00 2d ab de 00 00 83 f8 -0x00007fe6fdb663b7: 03 0f 86 c2 00 00 00 b8 ff ff ff ff 48 8d 0d da -0x00007fe6fdb663c7: f5 5b 00 89 c2 f0 0f c1 11 45 84 f6 0f 84 e7 00 -0x00007fe6fdb663d7: 00 00 48 8d 15 c0 f5 5b 00 f0 0f c1 02 8b 05 b6 -0x00007fe6fdb663e7: f5 5b 00 8b 05 b4 f5 5b 00 48 8b 05 c1 f5 5b 00 -0x00007fe6fdb663f7: 48 8b 40 28 48 83 28 01 e9 9c 00 00 00 0f 1f 40 -0x00007fe6fdb66407: 00 4c 8d bf b0 01 00 00 4c 89 ff e8 a9 c4 ff ff -0x00007fe6fdb66417: 4c 89 ff 49 89 c5 e8 8e c4 ff ff 49 39 c5 0f 86 -0x00007fe6fdb66427: 43 ff ff ff 49 29 c5 48 8d 05 4b f4 5b 00 4b 8d -0x00007fe6fdb66437: 14 2c 48 8b 00 48 c1 e0 03 49 39 c5 4c 0f 46 e2 -0x00007fe6fdb66447: e9 22 ff ff ff 0f 1f 40 00 48 89 df ff d2 84 c0 -0x00007fe6fdb66457: 0f 84 83 00 00 00 48 83 c4 08 5b 41 5c 41 5d 41 -0x00007fe6fdb66467: 5e 41 5f 5d c3 0f 1f 40 00 48 89 df ff d0 84 c0 -0x00007fe6fdb66477: 75 e4 e9 2c ff ff ff 66 90 8b 05 1a f5 5b 00 8b -0x00007fe6fdb66487: 05 18 f5 5b 00 48 8b 05 25 f5 5b 00 48 8b 40 28 -0x00007fe6fdb66497: 48 83 28 01 45 84 f6 74 bd 48 8b 05 01 f5 5b 00 -0x00007fe6fdb664a7: 48 8b 40 28 48 83 28 01 48 83 c4 08 5b 41 5c 41 -0x00007fe6fdb664b7: 5d 41 5e 41 5f 5d c3 66 90 8b 05 da f4 5b 00 8b -0x00007fe6fdb664c7: 05 d8 f4 5b 00 48 8b 05 e5 f4 5b 00 48 8b 40 28 -0x00007fe6fdb664d7: 48 83 28 01 e9 7d ff ff ff 48 8b 03 e9 ae fe ff -0x00007fe6fdb664e7: ff 0f 1f 84 00 00 00 00 00 55 48 8d 0d e8 74 72 -0x00007fe6fdb664f7: ff 48 89 e5 41 54 49 89 fc 53 48 8b 07 89 f3 48 -0x00007fe6fdb66507: 8b 50 58 48 39 ca 75 39 48 8b 40 60 48 8d 15 96 -0x00007fe6fdb66517: 58 72 ff 48 39 d0 75 39 b8 ff ff ff ff 48 8d 0d -0x00007fe6fdb66527: 79 f4 5b 00 89 c2 f0 0f c1 11 84 db 74 0b 48 8d -0x00007fe6fdb66537: 15 64 f4 5b 00 f0 0f c1 02 5b 41 5c 5d c3 0f 1f -0x00007fe6fdb66547: 00 ff d2 84 c0 75 f2 49 8b 04 24 eb bb 0f 1f 40 -0x00007fe6fdb66557: 00 4c 89 e7 ff d0 84 c0 75 df eb bc 90 66 66 2e -0x00007fe6fdb66567: 0f 1f 84 00 00 00 00 00 90 55 48 89 e5 53 48 83 -0x00007fe6fdb66577: ec 08 4c 8b 87 20 04 00 00 4d 85 c0 74 5b 4c 89 -0x00007fe6fdb66587: c7 e8 c3 fe d5 ff 48 89 c3 66 48 8d 3d f0 79 53 - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x0000000000000001 is an unknown value -stack at sp + 1 slots: 0x0000000000000001 is an unknown value -stack at sp + 2 slots: 0x00007fe5d0035a40 points into unknown readable memory: 0x00007fe6fdfdcf60 | 60 cf fd fd e6 7f 00 00 -stack at sp + 3 slots: 0x00007fe6fe0ffda0: in /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so at 0x00007fe6fcc00000 -stack at sp + 4 slots: 0x0000000000000001 is an unknown value -stack at sp + 5 slots: 0x0000000614011f10 is an oop: java.util.concurrent.ForkJoinWorkerThread -{0x0000000614011f10} - klass: 'java/util/concurrent/ForkJoinWorkerThread' - - ---- fields (total size 16 words): - - 'threadLocalRandomProbe' 'I' @12 1013904242 (0x3c6ef372) - - private volatile 'eetop' 'J' @16 0 (0x0000000000000000) - - private final 'tid' 'J' @24 42 (0x000000000000002a) - - 'threadLocalRandomSeed' 'J' @32 6645453498032594854 (0x5c3964bf519c1fa6) - - injected 'jvmti_thread_state' 'J' @40 0 (0x0000000000000000) - - 'threadLocalRandomSecondarySeed' 'I' @48 -1489346229 (0xa73a614b) - - injected 'jvmti_VTMS_transition_disable_count' 'I' @52 0 (0x00000000) - - injected 'jfr_epoch' 'S' @56 0 (0x0000) - - volatile 'interrupted' 'Z' @58 false (0x00) - - injected 'jvmti_is_in_VTMS_transition' 'Z' @59 false (0x00) - - private volatile 'name' 'Ljava/lang/String;' @60 "ForkJoinPool.commonPool-worker-1"{0x00000006140017b8} (0xc28002f7) - - private volatile 'contextClassLoader' 'Ljava/lang/ClassLoader;' @64 a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x000000061383d8f0} (0xc2707b1e) - - private 'inheritedAccessControlContext' 'Ljava/security/AccessControlContext;' @68 null (0x00000000) - - private final 'holder' 'Ljava/lang/Thread$FieldHolder;' @72 a 'java/lang/Thread$FieldHolder'{0x000000061428b848} (0xc2851709) - - 'threadLocals' 'Ljava/lang/ThreadLocal$ThreadLocalMap;' @76 null (0x00000000) - - 'inheritableThreadLocals' 'Ljava/lang/ThreadLocal$ThreadLocalMap;' @80 null (0x00000000) - - private 'scopedValueBindings' 'Ljava/lang/Object;' @84 a 'java/lang/Class'{0x000000061383b9d0} = 'java/lang/Thread' (0xc270773a) - - final 'interruptLock' 'Ljava/lang/Object;' @88 a 'java/lang/Object'{0x00000006142b0ab0} (0xc2856156) - - private volatile 'parkBlocker' 'Ljava/lang/Object;' @92 a 'java/util/concurrent/ForkJoinPool'{0x0000000614003478} (0xc280068f) - - volatile 'nioBlocker' 'Lsun/nio/ch/Interruptible;' @96 null (0x00000000) - - private 'cont' 'Ljdk/internal/vm/Continuation;' @100 null (0x00000000) - - private volatile 'uncaughtExceptionHandler' 'Ljava/lang/Thread$UncaughtExceptionHandler;' @104 null (0x00000000) - - private 'container' 'Ljdk/internal/vm/ThreadContainer;' @108 a 'jdk/internal/vm/SharedThreadContainer'{0x0000000614003b40} (0xc2800768) - - private volatile 'headStackableScopes' 'Ljdk/internal/vm/StackableScope;' @112 null (0x00000000) - - final 'pool' 'Ljava/util/concurrent/ForkJoinPool;' @116 a 'java/util/concurrent/ForkJoinPool'{0x0000000614003478} (0xc280068f) - - final 'workQueue' 'Ljava/util/concurrent/ForkJoinPool$WorkQueue;' @120 a 'java/util/concurrent/ForkJoinPool$WorkQueue'{0x0000000614142838} (0xc2828507) -stack at sp + 6 slots: 0x00007fe6d27e6cf0 points into unknown readable memory: 0x00007fe6d27e6e80 | 80 6e 7e d2 e6 7f 00 00 -stack at sp + 7 slots: 0x00007fe6fdb6b58c: in /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so at 0x00007fe6fcc00000 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007fe5c818b4b0, length=56, elements={ -0x00007fe6f8029410, 0x00007fe6f81f9140, 0x00007fe6f81fa190, 0x00007fe6f81fbd70, -0x00007fe6f81fd2e0, 0x00007fe6f82068a0, 0x00007fe6f8208360, 0x00007fe6f8209a20, -0x00007fe6f82b2070, 0x00007fe6f82b6900, 0x00007fe6f86613e0, 0x00007fe6f867eb80, -0x00007fe5c802ccd0, 0x00007fe5d003c080, 0x00007fe5d0043bf0, 0x00007fe5d006a030, -0x00007fe5c84fa720, 0x00007fe568000ff0, 0x00007fe568002250, 0x00007fe5680034c0, -0x00007fe568004650, 0x00007fe5680057e0, 0x00007fe568006970, 0x00007fe568007b00, -0x00007fe568009020, 0x00007fe56800a2c0, 0x00007fe56800b960, 0x00007fe56800d000, -0x00007fe56800e6b0, 0x00007fe56800fd60, 0x00007fe568011420, 0x00007fe568012ae0, -0x00007fe5680141b0, 0x00007fe5c850d500, 0x00007fe5c856ecd0, 0x00007fe5c8671b20, -0x00007fe5c8678580, 0x00007fe5c86ef640, 0x00007fe5c8731cb0, 0x00007fe5c8750a70, -0x00007fe5c8891c30, 0x00007fe5c888ec50, 0x00007fe5c88865f0, 0x00007fe5c8899cf0, -0x00007fe5c88b9b20, 0x00007fe5b0017950, 0x00007fe5b001f980, 0x00007fe5a0020e90, -0x00007fe5a0a22e80, 0x00007fe5a0a38cd0, 0x00007fe46051bb70, 0x00007fe4604cd840, -0x00007fe4604ce2d0, 0x00007fe460606f80, 0x00007fe458019dc0, 0x00007fe45800e180 -} - -Java Threads: ( => current thread ) - 0x00007fe6f8029410 JavaThread "main" [_thread_blocked, id=30554, stack(0x00007fe6fca19000,0x00007fe6fcb19000) (1024K)] - 0x00007fe6f81f9140 JavaThread "Reference Handler" [_thread_blocked, id=30562, stack(0x00007fe6d84f0000,0x00007fe6d85f0000) (1024K)] - 0x00007fe6f81fa190 JavaThread "Finalizer" [_thread_blocked, id=30563, stack(0x00007fe6d8100000,0x00007fe6d8200000) (1024K)] - 0x00007fe6f81fbd70 JavaThread "Signal Dispatcher" [_thread_blocked, id=30564, stack(0x00007fe6d3f00000,0x00007fe6d4000000) (1024K)] - 0x00007fe6f81fd2e0 JavaThread "Service Thread" [_thread_blocked, id=30565, stack(0x00007fe6d3dff000,0x00007fe6d3eff000) (1024K)] - 0x00007fe6f82068a0 JavaThread "Monitor Deflation Thread" [_thread_blocked, id=30566, stack(0x00007fe6d3cfe000,0x00007fe6d3dfe000) (1024K)] - 0x00007fe6f8208360 JavaThread "C2 CompilerThread0" [_thread_blocked, id=30567, stack(0x00007fe6d3bfd000,0x00007fe6d3cfd000) (1024K)] - 0x00007fe6f8209a20 JavaThread "C1 CompilerThread0" [_thread_blocked, id=30568, stack(0x00007fe6d3afc000,0x00007fe6d3bfc000) (1024K)] - 0x00007fe6f82b2070 JavaThread "Notification Thread" [_thread_blocked, id=30570, stack(0x00007fe6d38fa000,0x00007fe6d39fa000) (1024K)] - 0x00007fe6f82b6900 JavaThread "Common-Cleaner" [_thread_blocked, id=30571, stack(0x00007fe6d37f9000,0x00007fe6d38f9000) (1024K)] - 0x00007fe6f86613e0 JavaThread "Binding updates checker" [_thread_blocked, id=30637, stack(0x00007fe6d28ea000,0x00007fe6d29ea000) (1024K)] - 0x00007fe6f867eb80 JavaThread "SonarLint LSP message processor" [_thread_in_native, id=30638, stack(0x00007fe6d27e9000,0x00007fe6d28e9000) (1024K)] - 0x00007fe5c802ccd0 JavaThread "sonarlint-auto-trigger" [_thread_blocked, id=30641, stack(0x00007fe6d24e6000,0x00007fe6d25e6000) (1024K)] - 0x00007fe5d003c080 JavaThread "SonarLint Language Server Branch Manager" [_thread_blocked, id=30643, stack(0x00007fe6d22e4000,0x00007fe6d23e4000) (1024K)] - 0x00007fe5d0043bf0 JavaThread "SonarLint Language Server Analysis Scheduler" [_thread_blocked, id=30644, stack(0x00007fe6d21e3000,0x00007fe6d22e3000) (1024K)] - 0x00007fe5d006a030 JavaThread "SonarLint Language Server Analysis Scheduler" [_thread_blocked, id=30645, stack(0x00007fe6d20e2000,0x00007fe6d21e2000) (1024K)] - 0x00007fe5c84fa720 JavaThread "httpclient-main-1" [_thread_blocked, id=30658, stack(0x00007fe6d1ee0000,0x00007fe6d1fe0000) (1024K)] - 0x00007fe568000ff0 JavaThread "httpclient-dispatch-1" [_thread_in_native, id=30659, stack(0x00007fe6d1ddf000,0x00007fe6d1edf000) (1024K)] - 0x00007fe568002250 JavaThread "httpclient-dispatch-2" [_thread_in_native, id=30660, stack(0x00007fe6d1814000,0x00007fe6d1914000) (1024K)] - 0x00007fe5680034c0 JavaThread "httpclient-dispatch-3" [_thread_in_native, id=30661, stack(0x00007fe6d1713000,0x00007fe6d1813000) (1024K)] - 0x00007fe568004650 JavaThread "httpclient-dispatch-4" [_thread_in_native, id=30662, stack(0x00007fe6d1612000,0x00007fe6d1712000) (1024K)] - 0x00007fe5680057e0 JavaThread "httpclient-dispatch-5" [_thread_in_native, id=30663, stack(0x00007fe6d1511000,0x00007fe6d1611000) (1024K)] - 0x00007fe568006970 JavaThread "httpclient-dispatch-6" [_thread_in_native, id=30664, stack(0x00007fe6d1410000,0x00007fe6d1510000) (1024K)] - 0x00007fe568007b00 JavaThread "httpclient-dispatch-7" [_thread_in_native, id=30665, stack(0x00007fe6d130f000,0x00007fe6d140f000) (1024K)] - 0x00007fe568009020 JavaThread "httpclient-dispatch-8" [_thread_in_native, id=30666, stack(0x00007fe6d120e000,0x00007fe6d130e000) (1024K)] - 0x00007fe56800a2c0 JavaThread "httpclient-dispatch-9" [_thread_in_native, id=30667, stack(0x00007fe6d110d000,0x00007fe6d120d000) (1024K)] - 0x00007fe56800b960 JavaThread "httpclient-dispatch-10" [_thread_in_native, id=30668, stack(0x00007fe6d100c000,0x00007fe6d110c000) (1024K)] - 0x00007fe56800d000 JavaThread "httpclient-dispatch-11" [_thread_in_native, id=30669, stack(0x00007fe6d0f0b000,0x00007fe6d100b000) (1024K)] - 0x00007fe56800e6b0 JavaThread "httpclient-dispatch-12" [_thread_in_native, id=30670, stack(0x00007fe6d0e0a000,0x00007fe6d0f0a000) (1024K)] - 0x00007fe56800fd60 JavaThread "httpclient-dispatch-13" [_thread_in_native, id=30671, stack(0x00007fe6d0d09000,0x00007fe6d0e09000) (1024K)] - 0x00007fe568011420 JavaThread "httpclient-dispatch-14" [_thread_in_native, id=30672, stack(0x00007fe6d0c08000,0x00007fe6d0d08000) (1024K)] - 0x00007fe568012ae0 JavaThread "httpclient-dispatch-15" [_thread_in_native, id=30673, stack(0x00007fe6d0b07000,0x00007fe6d0c07000) (1024K)] - 0x00007fe5680141b0 JavaThread "httpclient-dispatch-16" [_thread_in_native, id=30674, stack(0x00007fe6d0a06000,0x00007fe6d0b06000) (1024K)] - 0x00007fe5c850d500 JavaThread "SonarLint Local Storage Synchronizer" [_thread_blocked, id=30675, stack(0x00007fe6d0905000,0x00007fe6d0a05000) (1024K)] - 0x00007fe5c856ecd0 JavaThread "HTTP-listener-64120-1" [_thread_in_native, id=30676, stack(0x00007fe6d064c000,0x00007fe6d074c000) (1024K)] - 0x00007fe5c8671b20 JavaThread "threadJobProcessorPoolSpawner" [_thread_blocked, id=30677, stack(0x00007fe6d0804000,0x00007fe6d0904000) (1024K)] - 0x00007fe5c8678580 JavaThread "Exodus shared timer thread" [_thread_blocked, id=30678, stack(0x00007fe6d054b000,0x00007fe6d064b000) (1024K)] - 0x00007fe5c86ef640 JavaThread "Exodus shared deferred I/O job processor" [_thread_blocked, id=30679, stack(0x00007fe6d36f8000,0x00007fe6d37f8000) (1024K)] - 0x00007fe5c8731cb0 JavaThread "Exodus shared background cleaner" [_thread_blocked, id=30682, stack(0x00007fe6d0349000,0x00007fe6d0449000) (1024K)] - 0x00007fe5c8750a70 JavaThread "Exodus shared stuck transaction monitor" [_thread_blocked, id=30683, stack(0x00007fe6d0248000,0x00007fe6d0348000) (1024K)] - 0x00007fe5c8891c30 JavaThread "EntityStoreSharedAsyncProcessor0" [_thread_blocked, id=30684, stack(0x00007fe6d0147000,0x00007fe6d0247000) (1024K)] - 0x00007fe5c888ec50 JavaThread "EntityStoreSharedAsyncProcessor1" [_thread_blocked, id=30685, stack(0x00007fe6d0046000,0x00007fe6d0146000) (1024K)] - 0x00007fe5c88865f0 JavaThread "EntityStoreSharedAsyncProcessor2" [_thread_blocked, id=30686, stack(0x00007fe6cbf00000,0x00007fe6cc000000) (1024K)] - 0x00007fe5c8899cf0 JavaThread "EntityStoreSharedAsyncProcessor3" [_thread_blocked, id=30687, stack(0x00007fe6cbdff000,0x00007fe6cbeff000) (1024K)] - 0x00007fe5c88b9b20 JavaThread "Smart Notifications Polling" [_thread_blocked, id=30696, stack(0x00007fe6cbcfe000,0x00007fe6cbdfe000) (1024K)] - 0x00007fe5b0017950 JavaThread "SonarLint Client Events Processor" [_thread_blocked, id=30697, stack(0x00007fe6cbbfd000,0x00007fe6cbcfd000) (1024K)] - 0x00007fe5b001f980 JavaThread "SonarLint Telemetry" [_thread_blocked, id=30698, stack(0x00007fe6cbafc000,0x00007fe6cbbfc000) (1024K)] - 0x00007fe5a0020e90 JavaThread "process reaper (pid 31015)" [_thread_in_native, id=30700, stack(0x00007fe6e3560000,0x00007fe6e3582000) (136K)] - 0x00007fe5a0a22e80 JavaThread "HttpClient-1-SelectorManager" [_thread_in_native, id=30723, stack(0x00007fe6cb7f9000,0x00007fe6cb8f9000) (1024K)] - 0x00007fe5a0a38cd0 JavaThread "sonarlint-analysis-engine" [_thread_blocked, id=30727, stack(0x00007fe6cb9fb000,0x00007fe6cbafb000) (1024K)] - 0x00007fe46051bb70 JavaThread "pool-5-thread-1" [_thread_blocked, id=30730, stack(0x00007fe6cb6f8000,0x00007fe6cb7f8000) (1024K)] - 0x00007fe4604cd840 JavaThread "nodejs-stream-consumer" [_thread_in_native, id=31016, stack(0x00007fe6d39fb000,0x00007fe6d3afb000) (1024K)] - 0x00007fe4604ce2d0 JavaThread "nodejs-stream-consumer" [_thread_in_native, id=31017, stack(0x00007fe6d35f7000,0x00007fe6d36f7000) (1024K)] - 0x00007fe460606f80 JavaThread "pool-3-thread-1" [_thread_blocked, id=31039, stack(0x00007fe6cb5f7000,0x00007fe6cb6f7000) (1024K)] - 0x00007fe458019dc0 JavaThread "HttpClient-1-Worker-11" [_thread_blocked, id=12731, stack(0x00007fe6d1fe1000,0x00007fe6d20e1000) (1024K)] - 0x00007fe45800e180 JavaThread "HttpClient-1-Worker-12" [_thread_blocked, id=14159, stack(0x00007fe6d34f6000,0x00007fe6d35f6000) (1024K)] -Total: 56 - -Other Threads: - 0x00007fe6f81241a0 VMThread "VM Thread" [id=30561, stack(0x00007fe6d85f1000,0x00007fe6d86f1000) (1024K)] - 0x00007fe6f8117200 WatcherThread "VM Periodic Task Thread" [id=30560, stack(0x00007fe6d86f2000,0x00007fe6d87f2000) (1024K)] - 0x00007fe6f8053fe0 WorkerThread "GC Thread#0" [id=30555, stack(0x00007fe6e55fd000,0x00007fe6e56fd000) (1024K)] - 0x00007fe6a0009050 WorkerThread "GC Thread#1" [id=30627, stack(0x00007fe6d32f4000,0x00007fe6d33f4000) (1024K)] - 0x00007fe6a0009b30 WorkerThread "GC Thread#2" [id=30628, stack(0x00007fe6d31f3000,0x00007fe6d32f3000) (1024K)] - 0x00007fe6a000a610 WorkerThread "GC Thread#3" [id=30629, stack(0x00007fe6d30f2000,0x00007fe6d31f2000) (1024K)] - 0x00007fe6a000b0f0 WorkerThread "GC Thread#4" [id=30630, stack(0x00007fe6d2ff1000,0x00007fe6d30f1000) (1024K)] - 0x00007fe6a000bbd0 WorkerThread "GC Thread#5" [id=30631, stack(0x00007fe6d2ef0000,0x00007fe6d2ff0000) (1024K)] - 0x00007fe6a000c6e0 WorkerThread "GC Thread#6" [id=30632, stack(0x00007fe6d2def000,0x00007fe6d2eef000) (1024K)] - 0x00007fe6a000d1f0 WorkerThread "GC Thread#7" [id=30633, stack(0x00007fe6d2cee000,0x00007fe6d2dee000) (1024K)] - 0x00007fe6a000dd40 WorkerThread "GC Thread#8" [id=30634, stack(0x00007fe6d2bed000,0x00007fe6d2ced000) (1024K)] - 0x00007fe6a000e890 WorkerThread "GC Thread#9" [id=30635, stack(0x00007fe6d2aec000,0x00007fe6d2bec000) (1024K)] - 0x00007fe6a000f3e0 WorkerThread "GC Thread#10" [id=30636, stack(0x00007fe6d29eb000,0x00007fe6d2aeb000) (1024K)] - 0x00007fe6a00176f0 WorkerThread "GC Thread#11" [id=30653, stack(0x00007fe6d1c18000,0x00007fe6d1d18000) (1024K)] - 0x00007fe6a0010880 WorkerThread "GC Thread#12" [id=30654, stack(0x00007fe6d1b17000,0x00007fe6d1c17000) (1024K)] - 0x00007fe6f8064c50 ConcurrentGCThread "G1 Main Marker" [id=30556, stack(0x00007fe6db900000,0x00007fe6dba00000) (1024K)] - 0x00007fe6f8065bf0 WorkerThread "G1 Conc#0" [id=30557, stack(0x00007fe6db7ff000,0x00007fe6db8ff000) (1024K)] - 0x00007fe6cc000d90 WorkerThread "G1 Conc#1" [id=30655, stack(0x00007fe6d1a16000,0x00007fe6d1b16000) (1024K)] - 0x00007fe6cc0018b0 WorkerThread "G1 Conc#2" [id=30656, stack(0x00007fe6d1915000,0x00007fe6d1a15000) (1024K)] - 0x00007fe6f81060c0 ConcurrentGCThread "G1 Refine#0" [id=30558, stack(0x00007fe6d88f4000,0x00007fe6d89f4000) (1024K)] - 0x00007fe6f8107070 ConcurrentGCThread "G1 Service" [id=30559, stack(0x00007fe6d87f3000,0x00007fe6d88f3000) (1024K)] - -=>0x00007fe5d0035a40 (exited) JavaThread "ForkJoinPool.commonPool-worker-1" [_thread_in_vm, id=30639, stack(0x00007fe6d26e8000,0x00007fe6d27e8000) (1024K)] -Total: 22 - -Threads with active compile tasks: -Total: 0 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007fe6fe0ffda0] Threads_lock - owner thread: 0x00007fe5d0035a40 - -Heap address: 0x0000000613800000, size: 7880 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x0000000800000000-0x0000000840000000, reserved size: 1073741824 -Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192 - CPUs: 16 total, 16 available - Memory: 31510M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 4M - Heap Min Capacity: 8M - Heap Initial Capacity: 496M - Heap Max Capacity: 7880M - Pre-touch: Disabled - Parallel Workers: 13 - Concurrent Workers: 3 - Concurrent Refinement Workers: 13 - Periodic GC: Disabled - -Heap: - garbage-first heap total 249856K, used 81097K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 4 young (16384K), 3 survivors (12288K) - Metaspace used 82889K, committed 86208K, reserved 1179648K - class space used 10227K, committed 11712K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000613800000, 0x0000000613c00000, 0x0000000613c00000|100%| O| |TAMS 0x0000000613800000| PB 0x0000000613800000| Untracked -| 1|0x0000000613c00000, 0x0000000614000000, 0x0000000614000000|100%| O| |TAMS 0x0000000613c00000| PB 0x0000000613c00000| Untracked -| 2|0x0000000614000000, 0x0000000614400000, 0x0000000614400000|100%| O| |TAMS 0x0000000614000000| PB 0x0000000614000000| Untracked -| 3|0x0000000614400000, 0x0000000614732650, 0x0000000614800000| 79%| O| |TAMS 0x0000000614400000| PB 0x0000000614400000| Untracked -| 4|0x0000000614800000, 0x0000000614c00000, 0x0000000614c00000|100%| O| |TAMS 0x0000000614800000| PB 0x0000000614800000| Untracked -| 5|0x0000000614c00000, 0x0000000615000000, 0x0000000615000000|100%| O| |TAMS 0x0000000614c00000| PB 0x0000000614c00000| Untracked -| 6|0x0000000615000000, 0x0000000615400000, 0x0000000615400000|100%| O| |TAMS 0x0000000615000000| PB 0x0000000615000000| Untracked -| 7|0x0000000615400000, 0x0000000615400000, 0x0000000615800000| 0%| F| |TAMS 0x0000000615400000| PB 0x0000000615400000| Untracked -| 8|0x0000000615800000, 0x0000000615c00000, 0x0000000615c00000|100%| O| |TAMS 0x0000000615800000| PB 0x0000000615800000| Untracked -| 9|0x0000000615c00000, 0x0000000616000000, 0x0000000616000000|100%| O| |TAMS 0x0000000615c00000| PB 0x0000000615c00000| Untracked -| 10|0x0000000616000000, 0x0000000616400000, 0x0000000616400000|100%| O| |TAMS 0x0000000616000000| PB 0x0000000616000000| Untracked -| 11|0x0000000616400000, 0x0000000616800000, 0x0000000616800000|100%| O|Cm|TAMS 0x0000000616400000| PB 0x0000000616400000| Complete -| 12|0x0000000616800000, 0x0000000616c00000, 0x0000000616c00000|100%| O| |TAMS 0x0000000616800000| PB 0x0000000616800000| Untracked -| 13|0x0000000616c00000, 0x0000000616c00000, 0x0000000617000000| 0%| F| |TAMS 0x0000000616c00000| PB 0x0000000616c00000| Untracked -| 14|0x0000000617000000, 0x0000000617400000, 0x0000000617400000|100%| O| |TAMS 0x0000000617000000| PB 0x0000000617000000| Untracked -| 15|0x0000000617400000, 0x0000000617800000, 0x0000000617800000|100%| O| |TAMS 0x0000000617400000| PB 0x0000000617400000| Untracked -| 16|0x0000000617800000, 0x0000000617800000, 0x0000000617c00000| 0%| F| |TAMS 0x0000000617800000| PB 0x0000000617800000| Untracked -| 17|0x0000000617c00000, 0x0000000618000000, 0x0000000618000000|100%| O| |TAMS 0x0000000617c00000| PB 0x0000000617c00000| Untracked -| 18|0x0000000618000000, 0x0000000618400000, 0x0000000618400000|100%| O| |TAMS 0x0000000618000000| PB 0x0000000618000000| Untracked -| 19|0x0000000618400000, 0x0000000618800000, 0x0000000618800000|100%| O| |TAMS 0x0000000618400000| PB 0x0000000618400000| Untracked -| 20|0x0000000618800000, 0x0000000618800000, 0x0000000618c00000| 0%| F| |TAMS 0x0000000618800000| PB 0x0000000618800000| Untracked -| 21|0x0000000618c00000, 0x0000000618c00000, 0x0000000619000000| 0%| F| |TAMS 0x0000000618c00000| PB 0x0000000618c00000| Untracked -| 22|0x0000000619000000, 0x0000000619000000, 0x0000000619400000| 0%| F| |TAMS 0x0000000619000000| PB 0x0000000619000000| Untracked -| 23|0x0000000619400000, 0x0000000619400000, 0x0000000619800000| 0%| F| |TAMS 0x0000000619400000| PB 0x0000000619400000| Untracked -| 24|0x0000000619800000, 0x0000000619c00000, 0x0000000619c00000|100%| S|CS|TAMS 0x0000000619800000| PB 0x0000000619800000| Complete -| 25|0x0000000619c00000, 0x0000000619c00000, 0x000000061a000000| 0%| F| |TAMS 0x0000000619c00000| PB 0x0000000619c00000| Untracked -| 26|0x000000061a000000, 0x000000061a400000, 0x000000061a400000|100%| S|CS|TAMS 0x000000061a000000| PB 0x000000061a000000| Complete -| 27|0x000000061a400000, 0x000000061a800000, 0x000000061a800000|100%| S|CS|TAMS 0x000000061a400000| PB 0x000000061a400000| Complete -| 28|0x000000061a800000, 0x000000061a800000, 0x000000061ac00000| 0%| F| |TAMS 0x000000061a800000| PB 0x000000061a800000| Untracked -| 29|0x000000061ac00000, 0x000000061ac00000, 0x000000061b000000| 0%| F| |TAMS 0x000000061ac00000| PB 0x000000061ac00000| Untracked -| 30|0x000000061b000000, 0x000000061b000000, 0x000000061b400000| 0%| F| |TAMS 0x000000061b000000| PB 0x000000061b000000| Untracked -| 31|0x000000061b400000, 0x000000061b400000, 0x000000061b800000| 0%| F| |TAMS 0x000000061b400000| PB 0x000000061b400000| Untracked -| 32|0x000000061b800000, 0x000000061b800000, 0x000000061bc00000| 0%| F| |TAMS 0x000000061b800000| PB 0x000000061b800000| Untracked -| 33|0x000000061bc00000, 0x000000061bc00000, 0x000000061c000000| 0%| F| |TAMS 0x000000061bc00000| PB 0x000000061bc00000| Untracked -| 34|0x000000061c000000, 0x000000061c000000, 0x000000061c400000| 0%| F| |TAMS 0x000000061c000000| PB 0x000000061c000000| Untracked -| 35|0x000000061c400000, 0x000000061c400000, 0x000000061c800000| 0%| F| |TAMS 0x000000061c400000| PB 0x000000061c400000| Untracked -| 36|0x000000061c800000, 0x000000061c800000, 0x000000061cc00000| 0%| F| |TAMS 0x000000061c800000| PB 0x000000061c800000| Untracked -| 37|0x000000061cc00000, 0x000000061cc00000, 0x000000061d000000| 0%| F| |TAMS 0x000000061cc00000| PB 0x000000061cc00000| Untracked -| 38|0x000000061d000000, 0x000000061d000000, 0x000000061d400000| 0%| F| |TAMS 0x000000061d000000| PB 0x000000061d000000| Untracked -| 39|0x000000061d400000, 0x000000061d400000, 0x000000061d800000| 0%| F| |TAMS 0x000000061d400000| PB 0x000000061d400000| Untracked -| 40|0x000000061d800000, 0x000000061d800000, 0x000000061dc00000| 0%| F| |TAMS 0x000000061d800000| PB 0x000000061d800000| Untracked -| 41|0x000000061dc00000, 0x000000061dc00000, 0x000000061e000000| 0%| F| |TAMS 0x000000061dc00000| PB 0x000000061dc00000| Untracked -| 42|0x000000061e000000, 0x000000061e000000, 0x000000061e400000| 0%| F| |TAMS 0x000000061e000000| PB 0x000000061e000000| Untracked -| 43|0x000000061e400000, 0x000000061e400000, 0x000000061e800000| 0%| F| |TAMS 0x000000061e400000| PB 0x000000061e400000| Untracked -| 44|0x000000061e800000, 0x000000061e800000, 0x000000061ec00000| 0%| F| |TAMS 0x000000061e800000| PB 0x000000061e800000| Untracked -| 45|0x000000061ec00000, 0x000000061ec00000, 0x000000061f000000| 0%| F| |TAMS 0x000000061ec00000| PB 0x000000061ec00000| Untracked -| 46|0x000000061f000000, 0x000000061f000000, 0x000000061f400000| 0%| F| |TAMS 0x000000061f000000| PB 0x000000061f000000| Untracked -| 47|0x000000061f400000, 0x000000061f400000, 0x000000061f800000| 0%| F| |TAMS 0x000000061f400000| PB 0x000000061f400000| Untracked -| 48|0x000000061f800000, 0x000000061f800000, 0x000000061fc00000| 0%| F| |TAMS 0x000000061f800000| PB 0x000000061f800000| Untracked -| 49|0x000000061fc00000, 0x000000061fc00000, 0x0000000620000000| 0%| F| |TAMS 0x000000061fc00000| PB 0x000000061fc00000| Untracked -| 50|0x0000000620000000, 0x0000000620000000, 0x0000000620400000| 0%| F| |TAMS 0x0000000620000000| PB 0x0000000620000000| Untracked -| 51|0x0000000620400000, 0x0000000620400000, 0x0000000620800000| 0%| F| |TAMS 0x0000000620400000| PB 0x0000000620400000| Untracked -| 52|0x0000000620800000, 0x0000000620800000, 0x0000000620c00000| 0%| F| |TAMS 0x0000000620800000| PB 0x0000000620800000| Untracked -| 53|0x0000000620c00000, 0x0000000620c00000, 0x0000000621000000| 0%| F| |TAMS 0x0000000620c00000| PB 0x0000000620c00000| Untracked -| 54|0x0000000621000000, 0x0000000621000000, 0x0000000621400000| 0%| F| |TAMS 0x0000000621000000| PB 0x0000000621000000| Untracked -| 55|0x0000000621400000, 0x0000000621400000, 0x0000000621800000| 0%| F| |TAMS 0x0000000621400000| PB 0x0000000621400000| Untracked -| 56|0x0000000621800000, 0x0000000621800000, 0x0000000621c00000| 0%| F| |TAMS 0x0000000621800000| PB 0x0000000621800000| Untracked -| 57|0x0000000621c00000, 0x0000000621c00000, 0x0000000622000000| 0%| F| |TAMS 0x0000000621c00000| PB 0x0000000621c00000| Untracked -| 58|0x0000000622000000, 0x0000000622000000, 0x0000000622400000| 0%| F| |TAMS 0x0000000622000000| PB 0x0000000622000000| Untracked -| 123|0x0000000632400000, 0x0000000632400000, 0x0000000632800000| 0%| F| |TAMS 0x0000000632400000| PB 0x0000000632400000| Untracked -|1969|0x00000007ffc00000, 0x00000007ffeae860, 0x0000000800000000| 67%| E| |TAMS 0x00000007ffc00000| PB 0x00000007ffc00000| Complete - -Card table byte_map: [0x00007fe6e3600000,0x00007fe6e4564000] _byte_map_base: 0x00007fe6e0564000 - -Marking Bits: (CMBitMap*) 0x00007fe6f8054b00 - Bits: [0x00007fe6dba00000, 0x00007fe6e3520000) - -Polling page: 0x00007fe6fe450000 - -Metaspace: - -Usage: - Non-class: 70,96 MB used. - Class: 9,99 MB used. - Both: 80,95 MB used. - -Virtual space: - Non-class space: 128,00 MB reserved, 72,75 MB ( 57%) committed, 2 nodes. - Class space: 1,00 GB reserved, 11,44 MB ( 1%) committed, 1 nodes. - Both: 1,12 GB reserved, 84,19 MB ( 7%) committed. - -Chunk freelists: - Non-Class: 7,31 MB - Class: 4,53 MB - Both: 11,84 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1,00 GB -Initial GC threshold: 21,00 MB -Current GC threshold: 140,31 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 9. -num_arena_births: 5544. -num_arena_deaths: 674. -num_vsnodes_births: 3. -num_vsnodes_deaths: 0. -num_space_committed: 1355. -num_space_uncommitted: 6. -num_chunks_returned_to_freelist: 1363. -num_chunks_taken_from_freelist: 9953. -num_chunk_merges: 417. -num_chunk_splits: 6292. -num_chunks_enlarged: 3474. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=119168Kb used=9011Kb max_used=9118Kb free=110157Kb - bounds [0x00007fe6ed5a0000, 0x00007fe6edec0000, 0x00007fe6f4a00000] -CodeHeap 'profiled nmethods': size=119164Kb used=10900Kb max_used=20962Kb free=108263Kb - bounds [0x00007fe6e5a00000, 0x00007fe6e6e80000, 0x00007fe6ece5f000] -CodeHeap 'non-nmethods': size=7428Kb used=1610Kb max_used=3351Kb free=5817Kb - bounds [0x00007fe6ece5f000, 0x00007fe6ed1bf000, 0x00007fe6ed5a0000] - total_blobs=6522 nmethods=5840 adapters=587 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 1857,108 Thread 0x00007fe668356290 nmethod 15910 0x00007fe6e5f4a890 code [0x00007fe6e5f4aaa0, 0x00007fe6e5f4af88] -Event: 1857,108 Thread 0x00007fe6f8209a20 nmethod 15911 0x00007fe6e6256090 code [0x00007fe6e62562c0, 0x00007fe6e62568a0] -Event: 1857,108 Thread 0x00007fe668356290 15904 3 java.lang.invoke.LambdaForm$MH/0x00000008009b8400::invoke (63 bytes) -Event: 1857,108 Thread 0x00007fe6f8209a20 15905 3 java.lang.invoke.LambdaForm$MH/0x00000008009b8800::invoke (63 bytes) -Event: 1857,109 Thread 0x00007fe6f8209a20 nmethod 15905 0x00007fe6e6dffe10 code [0x00007fe6e6e00120, 0x00007fe6e6e01450] -Event: 1857,109 Thread 0x00007fe668356290 nmethod 15904 0x00007fe6e5a36c90 code [0x00007fe6e5a36fa0, 0x00007fe6e5a382d0] -Event: 1857,109 Thread 0x00007fe6f8209a20 15906 3 java.lang.invoke.LambdaForm$MH/0x00000008009b8c00::invoke (63 bytes) -Event: 1857,109 Thread 0x00007fe668356290 15907 3 java.lang.invoke.LambdaForm$MH/0x00000008009b7000::invoke (47 bytes) -Event: 1857,109 Thread 0x00007fe668356290 nmethod 15907 0x00007fe6e60a1110 code [0x00007fe6e60a1360, 0x00007fe6e60a1f28] -Event: 1857,109 Thread 0x00007fe668356290 15908 3 java.lang.invoke.LambdaForm$MH/0x00000008009b7400::invoke (45 bytes) -Event: 1857,110 Thread 0x00007fe6f8209a20 nmethod 15906 0x00007fe6e5c94890 code [0x00007fe6e5c94ba0, 0x00007fe6e5c95ed0] -Event: 1857,110 Thread 0x00007fe6f8209a20 15909 3 java.lang.invoke.LambdaForm$MH/0x00000008009b7800::invoke (63 bytes) -Event: 1857,110 Thread 0x00007fe668356290 nmethod 15908 0x00007fe6e6bd1910 code [0x00007fe6e6bd1b60, 0x00007fe6e6bd25d0] -Event: 1857,110 Thread 0x00007fe6f8209a20 nmethod 15909 0x00007fe6e61af910 code [0x00007fe6e61afbc0, 0x00007fe6e61b0bd0] -Event: 1861,512 Thread 0x00007fe6f8208360 15912 4 jdk.internal.net.http.common.Utils$$Lambda/0x0000000800746c98::run (12 bytes) -Event: 1861,522 Thread 0x00007fe6f8208360 nmethod 15912 0x00007fe6edc98190 code [0x00007fe6edc98460, 0x00007fe6edc99430] -Event: 1898,177 Thread 0x00007fe6f8208360 15913 4 java.util.concurrent.locks.AbstractQueuedSynchronizer::tryAcquireSharedNanos (62 bytes) -Event: 1898,179 Thread 0x00007fe6f8208360 nmethod 15913 0x00007fe6ed9d3510 code [0x00007fe6ed9d36c0, 0x00007fe6ed9d3938] -Event: 1901,512 Thread 0x00007fe6f8208360 15914 4 java.util.LinkedList::linkLast (59 bytes) -Event: 1901,514 Thread 0x00007fe6f8208360 nmethod 15914 0x00007fe6ed7bf090 code [0x00007fe6ed7bf220, 0x00007fe6ed7bf600] - -GC Heap History (20 events): -Event: 1512,724 GC heap before -{Heap before GC invocations=71 (full 0): - garbage-first heap total 249856K, used 214455K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 82493K, committed 85824K, reserved 1179648K - class space used 10211K, committed 11648K, reserved 1048576K -} -Event: 1512,726 GC heap after -{Heap after GC invocations=72 (full 0): - garbage-first heap total 249856K, used 74791K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 82493K, committed 85824K, reserved 1179648K - class space used 10211K, committed 11648K, reserved 1048576K -} -Event: 1530,761 GC heap before -{Heap before GC invocations=72 (full 0): - garbage-first heap total 249856K, used 209959K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 2 survivors (8192K) - Metaspace used 82631K, committed 85824K, reserved 1179648K - class space used 10218K, committed 11648K, reserved 1048576K -} -Event: 1530,766 GC heap after -{Heap after GC invocations=73 (full 0): - garbage-first heap total 249856K, used 78870K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 82631K, committed 85824K, reserved 1179648K - class space used 10218K, committed 11648K, reserved 1048576K -} -Event: 1574,151 GC heap before -{Heap before GC invocations=73 (full 0): - garbage-first heap total 249856K, used 214038K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 82805K, committed 85888K, reserved 1179648K - class space used 10227K, committed 11648K, reserved 1048576K -} -Event: 1574,155 GC heap after -{Heap after GC invocations=74 (full 0): - garbage-first heap total 249856K, used 74435K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 82805K, committed 85888K, reserved 1179648K - class space used 10227K, committed 11648K, reserved 1048576K -} -Event: 1589,578 GC heap before -{Heap before GC invocations=75 (full 0): - garbage-first heap total 249856K, used 213699K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 2 survivors (8192K) - Metaspace used 82809K, committed 85888K, reserved 1179648K - class space used 10227K, committed 11648K, reserved 1048576K -} -Event: 1589,582 GC heap after -{Heap after GC invocations=76 (full 0): - garbage-first heap total 249856K, used 79843K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 82809K, committed 85888K, reserved 1179648K - class space used 10227K, committed 11648K, reserved 1048576K -} -Event: 1615,801 GC heap before -{Heap before GC invocations=76 (full 0): - garbage-first heap total 249856K, used 210915K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 82943K, committed 86016K, reserved 1179648K - class space used 10234K, committed 11648K, reserved 1048576K -} -Event: 1615,807 GC heap after -{Heap after GC invocations=77 (full 0): - garbage-first heap total 249856K, used 79131K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 82943K, committed 86016K, reserved 1179648K - class space used 10234K, committed 11648K, reserved 1048576K -} -Event: 1634,180 GC heap before -{Heap before GC invocations=77 (full 0): - garbage-first heap total 249856K, used 214299K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 83207K, committed 86336K, reserved 1179648K - class space used 10242K, committed 11712K, reserved 1048576K -} -Event: 1634,183 GC heap after -{Heap after GC invocations=78 (full 0): - garbage-first heap total 249856K, used 76152K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 83207K, committed 86336K, reserved 1179648K - class space used 10242K, committed 11712K, reserved 1048576K -} -Event: 1657,016 GC heap before -{Heap before GC invocations=79 (full 0): - garbage-first heap total 249856K, used 215416K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 2 survivors (8192K) - Metaspace used 82773K, committed 86208K, reserved 1179648K - class space used 10220K, committed 11712K, reserved 1048576K -} -Event: 1657,019 GC heap after -{Heap after GC invocations=80 (full 0): - garbage-first heap total 249856K, used 80193K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 82773K, committed 86208K, reserved 1179648K - class space used 10220K, committed 11712K, reserved 1048576K -} -Event: 1684,400 GC heap before -{Heap before GC invocations=80 (full 0): - garbage-first heap total 249856K, used 215361K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 82943K, committed 86208K, reserved 1179648K - class space used 10228K, committed 11712K, reserved 1048576K -} -Event: 1684,406 GC heap after -{Heap after GC invocations=81 (full 0): - garbage-first heap total 249856K, used 75914K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 82943K, committed 86208K, reserved 1179648K - class space used 10228K, committed 11712K, reserved 1048576K -} -Event: 1743,445 GC heap before -{Heap before GC invocations=81 (full 0): - garbage-first heap total 249856K, used 215178K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 2 survivors (8192K) - Metaspace used 83078K, committed 86208K, reserved 1179648K - class space used 10235K, committed 11712K, reserved 1048576K -} -Event: 1743,449 GC heap after -{Heap after GC invocations=82 (full 0): - garbage-first heap total 249856K, used 79660K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 83078K, committed 86208K, reserved 1179648K - class space used 10235K, committed 11712K, reserved 1048576K -} -Event: 1857,097 GC heap before -{Heap before GC invocations=83 (full 0): - garbage-first heap total 249856K, used 214828K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 36 young (147456K), 3 survivors (12288K) - Metaspace used 82845K, committed 86208K, reserved 1179648K - class space used 10225K, committed 11712K, reserved 1048576K -} -Event: 1857,101 GC heap after -{Heap after GC invocations=84 (full 0): - garbage-first heap total 249856K, used 81097K [0x0000000613800000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 82845K, committed 86208K, reserved 1179648K - class space used 10225K, committed 11712K, reserved 1048576K -} - -Dll operation events (10 events): -Event: 0,002 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -Event: 0,007 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -Event: 0,075 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -Event: 0,091 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -Event: 0,109 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -Event: 0,147 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -Event: 1,310 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -Event: 1,925 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -Event: 1,991 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -Event: 1,992 Loaded shared library /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so - -Deoptimization events (20 events): -Event: 1445,135 Thread 0x00007fe5a0a38cd0 DEOPT PACKING pc=0x00007fe6e626db9f sp=0x00007fe6cbaf8070 -Event: 1445,135 Thread 0x00007fe5a0a38cd0 DEOPT UNPACKING pc=0x00007fe6eceb372f sp=0x00007fe6cbaf7538 mode 0 -Event: 1457,117 Thread 0x00007fe5d0035a40 DEOPT PACKING pc=0x00007fe6e5b7dfce sp=0x00007fe6d27e6830 -Event: 1457,118 Thread 0x00007fe5d0035a40 DEOPT UNPACKING pc=0x00007fe6eceb372f sp=0x00007fe6d27e5d48 mode 0 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: trap_request=0xffffffbe fr.pc=0x00007fe6ed767538 relative=0x0000000000001138 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: reason=profile_predicate action=maybe_recompile pc=0x00007fe6ed767538 method=org.sonarsource.sonarlint.core.analysis.container.analysis.filesystem.OrPredicate.create(Ljava/util/Collection;)Lorg/sonar/api/batch/fs/FilePredicate; @ 34 c2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT PACKING pc=0x00007fe6ed767538 sp=0x00007fe6cbaf9170 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT UNPACKING pc=0x00007fe6eceb2f99 sp=0x00007fe6cbaf9140 mode 2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: trap_request=0xffffffbe fr.pc=0x00007fe6ed767538 relative=0x0000000000001138 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: reason=profile_predicate action=maybe_recompile pc=0x00007fe6ed767538 method=org.sonarsource.sonarlint.core.analysis.container.analysis.filesystem.OrPredicate.create(Ljava/util/Collection;)Lorg/sonar/api/batch/fs/FilePredicate; @ 34 c2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT PACKING pc=0x00007fe6ed767538 sp=0x00007fe6cbaf9170 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT UNPACKING pc=0x00007fe6eceb2f99 sp=0x00007fe6cbaf9140 mode 2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: trap_request=0xffffffbe fr.pc=0x00007fe6ed767538 relative=0x0000000000001138 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: reason=profile_predicate action=maybe_recompile pc=0x00007fe6ed767538 method=org.sonarsource.sonarlint.core.analysis.container.analysis.filesystem.OrPredicate.create(Ljava/util/Collection;)Lorg/sonar/api/batch/fs/FilePredicate; @ 34 c2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT PACKING pc=0x00007fe6ed767538 sp=0x00007fe6cbaf9170 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT UNPACKING pc=0x00007fe6eceb2f99 sp=0x00007fe6cbaf9140 mode 2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: trap_request=0xffffffbe fr.pc=0x00007fe6ed767538 relative=0x0000000000001138 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 Uncommon trap: reason=profile_predicate action=maybe_recompile pc=0x00007fe6ed767538 method=org.sonarsource.sonarlint.core.analysis.container.analysis.filesystem.OrPredicate.create(Ljava/util/Collection;)Lorg/sonar/api/batch/fs/FilePredicate; @ 34 c2 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT PACKING pc=0x00007fe6ed767538 sp=0x00007fe6cbaf9170 -Event: 1634,216 Thread 0x00007fe5a0a38cd0 DEOPT UNPACKING pc=0x00007fe6eceb2f99 sp=0x00007fe6cbaf9140 mode 2 - -Classes loaded (20 events): -Event: 33,451 Loading class java/util/stream/ReduceOps$CountingSink$OfRef -Event: 33,451 Loading class java/util/stream/ReduceOps$CountingSink -Event: 33,451 Loading class java/util/stream/ReduceOps$CountingSink done -Event: 33,451 Loading class java/util/stream/ReduceOps$CountingSink$OfRef done -Event: 33,453 Loading class java/util/stream/SliceOps -Event: 33,453 Loading class java/util/stream/SliceOps done -Event: 33,453 Loading class java/util/stream/SliceOps$1 -Event: 33,453 Loading class java/util/stream/SliceOps$1 done -Event: 33,454 Loading class java/util/stream/SliceOps$1$1 -Event: 33,454 Loading class java/util/stream/SliceOps$1$1 done -Event: 34,218 Loading class java/util/Spliterators$IntArraySpliterator -Event: 34,218 Loading class java/util/Spliterators$IntArraySpliterator done -Event: 34,218 Loading class java/util/stream/IntPipeline$1 -Event: 34,218 Loading class java/util/stream/IntPipeline$1 done -Event: 34,218 Loading class java/util/stream/IntPipeline$1$1 -Event: 34,218 Loading class java/util/stream/IntPipeline$1$1 done -Event: 62,379 Loading class java/util/IdentityHashMap$KeyIterator -Event: 62,380 Loading class java/util/IdentityHashMap$KeyIterator done -Event: 558,126 Loading class java/util/regex/Pattern$End -Event: 558,126 Loading class java/util/regex/Pattern$End done - -Classes unloaded (20 events): -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a73800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a73000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a7a800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a7a000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009ddc00 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a75c00 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a72800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009df000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009dd000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009db800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a74000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800a7b000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800b7e800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x0000000800b7e000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009cd800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009cd000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009cc800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009cc000 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009c3800 'GeneratedBySSLR' -Event: 1743,467 Thread 0x00007fe6f81241a0 Unloading class 0x00000008009c3000 'GeneratedBySSLR' - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 1740,656 Thread 0x00007fe4606dbfa0 Exception (0x000000061b800088) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1740,955 Thread 0x00007fe46088b020 Exception (0x000000061ba227e0) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1740,957 Thread 0x00007fe4606dbfa0 Exception (0x000000061ba44be0) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1743,417 Thread 0x00007fe4606dbfa0 Exception (0x000000061b200840) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1743,459 Thread 0x00007fe4606dbfa0 Exception (0x0000000632600888) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1743,757 Thread 0x00007fe4606dbfa0 Exception (0x000000062205c540) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1743,760 Thread 0x00007fe4606dbfa0 Exception (0x000000062207ce38) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1746,221 Thread 0x00007fe4606dbfa0 Exception (0x0000000621a00840) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1746,259 Thread 0x00007fe4606dbfa0 Exception (0x0000000620600888) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1746,518 Thread 0x00007fe4606dbfa0 Exception (0x0000000620032a50) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1746,520 Thread 0x00007fe4606dbfa0 Exception (0x0000000620072a78) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1786,033 Thread 0x00007fe4606dbfa0 Exception (0x000000061fa00840) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1786,070 Thread 0x00007fe4606dbfa0 Exception (0x000000061e600888) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1786,583 Thread 0x00007fe4606dbfa0 Exception (0x000000061e024318) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1786,586 Thread 0x00007fe4606dbfa0 Exception (0x000000061e05ca98) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1809,879 Thread 0x00007fe4606dbfa0 Exception (0x000000061c600888) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1809,881 Thread 0x00007fe4606dbfa0 Exception (0x000000061c617128) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1857,062 Thread 0x00007fe4606dbfa0 Exception (0x000000061b800040) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1857,104 Thread 0x00007fe4606dbfa0 Exception (0x00000007ffc00088) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] -Event: 1857,107 Thread 0x00007fe4606dbfa0 Exception (0x00000007ffe01d60) -thrown [src/hotspot/share/prims/jvm.cpp, line 3074] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 1746,482 Executing VM operation: Cleanup -Event: 1746,482 Executing VM operation: Cleanup done -Event: 1747,482 Executing VM operation: Cleanup -Event: 1747,482 Executing VM operation: Cleanup done -Event: 1796,486 Executing VM operation: Cleanup -Event: 1796,486 Executing VM operation: Cleanup done -Event: 1800,527 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 1800,527 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 1800,527 Executing VM operation: RendezvousGCThreads -Event: 1800,527 Executing VM operation: RendezvousGCThreads done -Event: 1810,528 Executing VM operation: Cleanup -Event: 1810,528 Executing VM operation: Cleanup done -Event: 1857,097 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 1857,101 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done -Event: 1860,543 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 1860,543 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 1860,543 Executing VM operation: RendezvousGCThreads -Event: 1860,543 Executing VM operation: RendezvousGCThreads done -Event: 1866,544 Executing VM operation: Cleanup -Event: 1866,544 Executing VM operation: Cleanup done - -Events (20 events): -Event: 1809,842 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1809,874 Thread 0x00007fe4606dbfa0 Thread added: 0x00007fe4606dbfa0 -Event: 1809,874 Protecting memory [0x00007fe6d23e5000,0x00007fe6d23e9000] with protection modes 0 -Event: 1809,879 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1809,879 Thread 0x00007fe4606dbfa0 Thread added: 0x00007fe4606dbfa0 -Event: 1809,879 Protecting memory [0x00007fe6d23e5000,0x00007fe6d23e9000] with protection modes 0 -Event: 1809,881 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1846,513 Thread 0x00007fe458010100 Thread exited: 0x00007fe458010100 -Event: 1857,061 Thread 0x00007fe4606dbfa0 Thread added: 0x00007fe4606dbfa0 -Event: 1857,062 Protecting memory [0x00007fe6d33f5000,0x00007fe6d33f9000] with protection modes 0 -Event: 1857,062 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1857,097 Thread 0x00007fe4606dbfa0 Thread added: 0x00007fe4606dbfa0 -Event: 1857,097 Protecting memory [0x00007fe6d33f5000,0x00007fe6d33f9000] with protection modes 0 -Event: 1857,104 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1857,105 Thread 0x00007fe4606dbfa0 Thread added: 0x00007fe4606dbfa0 -Event: 1857,105 Protecting memory [0x00007fe6d33f5000,0x00007fe6d33f9000] with protection modes 0 -Event: 1857,107 Thread 0x00007fe4606dbfa0 Thread exited: 0x00007fe4606dbfa0 -Event: 1857,108 Thread 0x00007fe668356290 Thread added: 0x00007fe668356290 -Event: 1857,108 Protecting memory [0x00007fe6d33f5000,0x00007fe6d33f9000] with protection modes 0 -Event: 1861,512 Thread 0x00007fe668356290 Thread exited: 0x00007fe668356290 - - -Dynamic libraries: -613800000-622400000 rw-p 00000000 00:00 0 -622400000-632400000 ---p 00000000 00:00 0 -632400000-632800000 rw-p 00000000 00:00 0 -632800000-7ffc00000 ---p 00000000 00:00 0 -7ffc00000-800030000 rw-p 00000000 00:00 0 -800030000-8000b0000 rw-p 00000000 00:00 0 -8000b0000-800130000 rw-p 00000000 00:00 0 -800130000-800170000 rw-p 00000000 00:00 0 -800170000-800230000 rw-p 00000000 00:00 0 -800230000-800270000 rw-p 00000000 00:00 0 -800270000-800330000 rw-p 00000000 00:00 0 -800330000-800430000 rw-p 00000000 00:00 0 -800430000-800830000 rw-p 00000000 00:00 0 -800830000-800860000 rw-p 00000000 00:00 0 -800860000-800880000 ---p 00000000 00:00 0 -800880000-800b90000 rw-p 00000000 00:00 0 -800b90000-840000000 ---p 00000000 00:00 0 -55690664d000-55690664e000 r--p 00000000 00:32 45049817 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/bin/java -55690664e000-55690664f000 r-xp 00001000 00:32 45049817 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/bin/java -55690664f000-556906650000 r--p 00002000 00:32 45049817 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/bin/java -556906650000-556906651000 r--p 00002000 00:32 45049817 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/bin/java -556906651000-556906652000 rw-p 00003000 00:32 45049817 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/bin/java -556907557000-55690759e000 rw-p 00000000 00:00 0 [heap] -7fe41b000000-7fe41b1d0000 rw-p 00000000 00:00 0 -7fe41b1d0000-7fe41b200000 ---p 00000000 00:00 0 -7fe41b200000-7fe41b8a0000 rw-p 00000000 00:00 0 -7fe41b8a0000-7fe41b8c0000 ---p 00000000 00:00 0 -7fe41b8c0000-7fe41b910000 rw-p 00000000 00:00 0 -7fe41b910000-7fe41f000000 ---p 00000000 00:00 0 -7fe420000000-7fe421794000 rw-p 00000000 00:00 0 -7fe421794000-7fe424000000 ---p 00000000 00:00 0 -7fe428000000-7fe42813c000 rw-p 00000000 00:00 0 -7fe42813c000-7fe42c000000 ---p 00000000 00:00 0 -7fe430000000-7fe431543000 rw-p 00000000 00:00 0 -7fe431543000-7fe434000000 ---p 00000000 00:00 0 -7fe438000000-7fe438f94000 rw-p 00000000 00:00 0 -7fe438f94000-7fe43c000000 ---p 00000000 00:00 0 -7fe440000000-7fe440a81000 rw-p 00000000 00:00 0 -7fe440a81000-7fe444000000 ---p 00000000 00:00 0 -7fe448000000-7fe448021000 rw-p 00000000 00:00 0 -7fe448021000-7fe44c000000 ---p 00000000 00:00 0 -7fe450000000-7fe450021000 rw-p 00000000 00:00 0 -7fe450021000-7fe454000000 ---p 00000000 00:00 0 -7fe458000000-7fe458026000 rw-p 00000000 00:00 0 -7fe458026000-7fe45c000000 ---p 00000000 00:00 0 -7fe460000000-7fe4609dc000 rw-p 00000000 00:00 0 -7fe4609dc000-7fe464000000 ---p 00000000 00:00 0 -7fe468000000-7fe46858f000 rw-p 00000000 00:00 0 -7fe46858f000-7fe46c000000 ---p 00000000 00:00 0 -7fe470000000-7fe470021000 rw-p 00000000 00:00 0 -7fe470021000-7fe474000000 ---p 00000000 00:00 0 -7fe478000000-7fe478021000 rw-p 00000000 00:00 0 -7fe478021000-7fe47c000000 ---p 00000000 00:00 0 -7fe480000000-7fe480021000 rw-p 00000000 00:00 0 -7fe480021000-7fe484000000 ---p 00000000 00:00 0 -7fe488000000-7fe488021000 rw-p 00000000 00:00 0 -7fe488021000-7fe48c000000 ---p 00000000 00:00 0 -7fe490000000-7fe490021000 rw-p 00000000 00:00 0 -7fe490021000-7fe494000000 ---p 00000000 00:00 0 -7fe498000000-7fe498021000 rw-p 00000000 00:00 0 -7fe498021000-7fe49c000000 ---p 00000000 00:00 0 -7fe4a0000000-7fe4a0021000 rw-p 00000000 00:00 0 -7fe4a0021000-7fe4a4000000 ---p 00000000 00:00 0 -7fe4a8000000-7fe4a8021000 rw-p 00000000 00:00 0 -7fe4a8021000-7fe4ac000000 ---p 00000000 00:00 0 -7fe4b0000000-7fe4b0021000 rw-p 00000000 00:00 0 -7fe4b0021000-7fe4b4000000 ---p 00000000 00:00 0 -7fe4b8000000-7fe4b8021000 rw-p 00000000 00:00 0 -7fe4b8021000-7fe4bc000000 ---p 00000000 00:00 0 -7fe4c0000000-7fe4c1058000 rw-p 00000000 00:00 0 -7fe4c1058000-7fe4c4000000 ---p 00000000 00:00 0 -7fe4c8000000-7fe4c8021000 rw-p 00000000 00:00 0 -7fe4c8021000-7fe4cc000000 ---p 00000000 00:00 0 -7fe4d0000000-7fe4d0021000 rw-p 00000000 00:00 0 -7fe4d0021000-7fe4d4000000 ---p 00000000 00:00 0 -7fe4d8000000-7fe4d8021000 rw-p 00000000 00:00 0 -7fe4d8021000-7fe4dc000000 ---p 00000000 00:00 0 -7fe4e0000000-7fe4e0021000 rw-p 00000000 00:00 0 -7fe4e0021000-7fe4e4000000 ---p 00000000 00:00 0 -7fe4e8000000-7fe4e8021000 rw-p 00000000 00:00 0 -7fe4e8021000-7fe4ec000000 ---p 00000000 00:00 0 -7fe4f0000000-7fe4f0021000 rw-p 00000000 00:00 0 -7fe4f0021000-7fe4f4000000 ---p 00000000 00:00 0 -7fe4f8000000-7fe4f8021000 rw-p 00000000 00:00 0 -7fe4f8021000-7fe4fc000000 ---p 00000000 00:00 0 -7fe500000000-7fe500021000 rw-p 00000000 00:00 0 -7fe500021000-7fe504000000 ---p 00000000 00:00 0 -7fe508000000-7fe508021000 rw-p 00000000 00:00 0 -7fe508021000-7fe50c000000 ---p 00000000 00:00 0 -7fe510000000-7fe510021000 rw-p 00000000 00:00 0 -7fe510021000-7fe514000000 ---p 00000000 00:00 0 -7fe518000000-7fe518021000 rw-p 00000000 00:00 0 -7fe518021000-7fe51c000000 ---p 00000000 00:00 0 -7fe520000000-7fe520021000 rw-p 00000000 00:00 0 -7fe520021000-7fe524000000 ---p 00000000 00:00 0 -7fe528000000-7fe528021000 rw-p 00000000 00:00 0 -7fe528021000-7fe52c000000 ---p 00000000 00:00 0 -7fe530000000-7fe530021000 rw-p 00000000 00:00 0 -7fe530021000-7fe534000000 ---p 00000000 00:00 0 -7fe538000000-7fe538021000 rw-p 00000000 00:00 0 -7fe538021000-7fe53c000000 ---p 00000000 00:00 0 -7fe540000000-7fe540021000 rw-p 00000000 00:00 0 -7fe540021000-7fe544000000 ---p 00000000 00:00 0 -7fe548000000-7fe548021000 rw-p 00000000 00:00 0 -7fe548021000-7fe54c000000 ---p 00000000 00:00 0 -7fe550000000-7fe550021000 rw-p 00000000 00:00 0 -7fe550021000-7fe554000000 ---p 00000000 00:00 0 -7fe558000000-7fe558021000 rw-p 00000000 00:00 0 -7fe558021000-7fe55c000000 ---p 00000000 00:00 0 -7fe560000000-7fe560021000 rw-p 00000000 00:00 0 -7fe560021000-7fe564000000 ---p 00000000 00:00 0 -7fe568000000-7fe568021000 rw-p 00000000 00:00 0 -7fe568021000-7fe56c000000 ---p 00000000 00:00 0 -7fe570000000-7fe570021000 rw-p 00000000 00:00 0 -7fe570021000-7fe574000000 ---p 00000000 00:00 0 -7fe578000000-7fe578021000 rw-p 00000000 00:00 0 -7fe578021000-7fe57c000000 ---p 00000000 00:00 0 -7fe580000000-7fe580021000 rw-p 00000000 00:00 0 -7fe580021000-7fe584000000 ---p 00000000 00:00 0 -7fe588000000-7fe588021000 rw-p 00000000 00:00 0 -7fe588021000-7fe58c000000 ---p 00000000 00:00 0 -7fe590000000-7fe590021000 rw-p 00000000 00:00 0 -7fe590021000-7fe594000000 ---p 00000000 00:00 0 -7fe598000000-7fe598021000 rw-p 00000000 00:00 0 -7fe598021000-7fe59c000000 ---p 00000000 00:00 0 -7fe5a0000000-7fe5a0a40000 rw-p 00000000 00:00 0 -7fe5a0a40000-7fe5a4000000 ---p 00000000 00:00 0 -7fe5a8000000-7fe5a8021000 rw-p 00000000 00:00 0 -7fe5a8021000-7fe5ac000000 ---p 00000000 00:00 0 -7fe5b0000000-7fe5b0a43000 rw-p 00000000 00:00 0 -7fe5b0a43000-7fe5b4000000 ---p 00000000 00:00 0 -7fe5b8000000-7fe5b8021000 rw-p 00000000 00:00 0 -7fe5b8021000-7fe5bc000000 ---p 00000000 00:00 0 -7fe5c0000000-7fe5c0d5e000 rw-p 00000000 00:00 0 -7fe5c0d5e000-7fe5c4000000 ---p 00000000 00:00 0 -7fe5c8000000-7fe5c8a59000 rw-p 00000000 00:00 0 -7fe5c8a59000-7fe5cc000000 ---p 00000000 00:00 0 -7fe5d0000000-7fe5d00bd000 rw-p 00000000 00:00 0 -7fe5d00bd000-7fe5d4000000 ---p 00000000 00:00 0 -7fe5d8000000-7fe5d8021000 rw-p 00000000 00:00 0 -7fe5d8021000-7fe5dc000000 ---p 00000000 00:00 0 -7fe5e0000000-7fe5e002c000 rw-p 00000000 00:00 0 -7fe5e002c000-7fe5e4000000 ---p 00000000 00:00 0 -7fe5e8000000-7fe5e8021000 rw-p 00000000 00:00 0 -7fe5e8021000-7fe5ec000000 ---p 00000000 00:00 0 -7fe5f0000000-7fe5f0021000 rw-p 00000000 00:00 0 -7fe5f0021000-7fe5f4000000 ---p 00000000 00:00 0 -7fe5f8000000-7fe5f8021000 rw-p 00000000 00:00 0 -7fe5f8021000-7fe5fc000000 ---p 00000000 00:00 0 -7fe600000000-7fe600021000 rw-p 00000000 00:00 0 -7fe600021000-7fe604000000 ---p 00000000 00:00 0 -7fe608000000-7fe608024000 rw-p 00000000 00:00 0 -7fe608024000-7fe60c000000 ---p 00000000 00:00 0 -7fe610000000-7fe61002c000 rw-p 00000000 00:00 0 -7fe61002c000-7fe614000000 ---p 00000000 00:00 0 -7fe618000000-7fe618021000 rw-p 00000000 00:00 0 -7fe618021000-7fe61c000000 ---p 00000000 00:00 0 -7fe620000000-7fe620021000 rw-p 00000000 00:00 0 -7fe620021000-7fe624000000 ---p 00000000 00:00 0 -7fe628000000-7fe628021000 rw-p 00000000 00:00 0 -7fe628021000-7fe62c000000 ---p 00000000 00:00 0 -7fe630000000-7fe6319a2000 rw-p 00000000 00:00 0 -7fe6319a2000-7fe634000000 ---p 00000000 00:00 0 -7fe638000000-7fe6388e1000 rw-p 00000000 00:00 0 -7fe6388e1000-7fe63c000000 ---p 00000000 00:00 0 -7fe640000000-7fe641162000 rw-p 00000000 00:00 0 -7fe641162000-7fe644000000 ---p 00000000 00:00 0 -7fe648000000-7fe648832000 rw-p 00000000 00:00 0 -7fe648832000-7fe64c000000 ---p 00000000 00:00 0 -7fe650000000-7fe650021000 rw-p 00000000 00:00 0 -7fe650021000-7fe654000000 ---p 00000000 00:00 0 -7fe658000000-7fe658021000 rw-p 00000000 00:00 0 -7fe658021000-7fe65c000000 ---p 00000000 00:00 0 -7fe660000000-7fe6612cf000 rw-p 00000000 00:00 0 -7fe6612cf000-7fe664000000 ---p 00000000 00:00 0 -7fe668000000-7fe6688a6000 rw-p 00000000 00:00 0 -7fe6688a6000-7fe66c000000 ---p 00000000 00:00 0 -7fe670000000-7fe671e31000 rw-p 00000000 00:00 0 -7fe671e31000-7fe674000000 ---p 00000000 00:00 0 -7fe678000000-7fe678021000 rw-p 00000000 00:00 0 -7fe678021000-7fe67c000000 ---p 00000000 00:00 0 -7fe680000000-7fe680021000 rw-p 00000000 00:00 0 -7fe680021000-7fe684000000 ---p 00000000 00:00 0 -7fe688000000-7fe688021000 rw-p 00000000 00:00 0 -7fe688021000-7fe68c000000 ---p 00000000 00:00 0 -7fe690000000-7fe690021000 rw-p 00000000 00:00 0 -7fe690021000-7fe694000000 ---p 00000000 00:00 0 -7fe698000000-7fe698021000 rw-p 00000000 00:00 0 -7fe698021000-7fe69c000000 ---p 00000000 00:00 0 -7fe6a0000000-7fe6a0021000 rw-p 00000000 00:00 0 -7fe6a0021000-7fe6a4000000 ---p 00000000 00:00 0 -7fe6a7000000-7fe6a74f0000 rw-p 00000000 00:00 0 -7fe6a74f0000-7fe6a7570000 rw-p 00000000 00:00 0 -7fe6a7570000-7fe6a7650000 rw-p 00000000 00:00 0 -7fe6a7650000-7fe6a7670000 rw-p 00000000 00:00 0 -7fe6a7670000-7fe6a76f0000 rw-p 00000000 00:00 0 -7fe6a76f0000-7fe6a78f0000 rw-p 00000000 00:00 0 -7fe6a78f0000-7fe6a79f0000 rw-p 00000000 00:00 0 -7fe6a79f0000-7fe6a7af0000 rw-p 00000000 00:00 0 -7fe6a7af0000-7fe6a7cf0000 rw-p 00000000 00:00 0 -7fe6a7cf0000-7fe6a7df0000 rw-p 00000000 00:00 0 -7fe6a7df0000-7fe6a7f70000 rw-p 00000000 00:00 0 -7fe6a7f70000-7fe6a7ff0000 rw-p 00000000 00:00 0 -7fe6a7ff0000-7fe6a80f0000 rw-p 00000000 00:00 0 -7fe6a80f0000-7fe6a81f0000 rw-p 00000000 00:00 0 -7fe6a81f0000-7fe6a8570000 rw-p 00000000 00:00 0 -7fe6a8570000-7fe6a85f0000 rw-p 00000000 00:00 0 -7fe6a85f0000-7fe6a8650000 rw-p 00000000 00:00 0 -7fe6a8650000-7fe6a8670000 rw-p 00000000 00:00 0 -7fe6a8670000-7fe6a86f0000 rw-p 00000000 00:00 0 -7fe6a86f0000-7fe6a88f0000 rw-p 00000000 00:00 0 -7fe6a88f0000-7fe6a8970000 rw-p 00000000 00:00 0 -7fe6a8970000-7fe6a89f0000 rw-p 00000000 00:00 0 -7fe6a89f0000-7fe6a8af0000 rw-p 00000000 00:00 0 -7fe6a8af0000-7fe6a8bf0000 rw-p 00000000 00:00 0 -7fe6a8bf0000-7fe6a8f10000 rw-p 00000000 00:00 0 -7fe6a8f10000-7fe6a8f30000 rw-p 00000000 00:00 0 -7fe6a8f30000-7fe6a8f70000 rw-p 00000000 00:00 0 -7fe6a8f70000-7fe6a90f0000 rw-p 00000000 00:00 0 -7fe6a90f0000-7fe6aa1b0000 rw-p 00000000 00:00 0 -7fe6aa1b0000-7fe6aa1f0000 rw-p 00000000 00:00 0 -7fe6aa1f0000-7fe6aa6f0000 rw-p 00000000 00:00 0 -7fe6aa6f0000-7fe6aa7f0000 rw-p 00000000 00:00 0 -7fe6aa7f0000-7fe6aaf70000 rw-p 00000000 00:00 0 -7fe6aaf70000-7fe6ab000000 rw-p 00000000 00:00 0 -7fe6ac000000-7fe6ac021000 rw-p 00000000 00:00 0 -7fe6ac021000-7fe6b0000000 ---p 00000000 00:00 0 -7fe6b4000000-7fe6b4021000 rw-p 00000000 00:00 0 -7fe6b4021000-7fe6b8000000 ---p 00000000 00:00 0 -7fe6bc000000-7fe6bc021000 rw-p 00000000 00:00 0 -7fe6bc021000-7fe6c0000000 ---p 00000000 00:00 0 -7fe6c4000000-7fe6c4021000 rw-p 00000000 00:00 0 -7fe6c4021000-7fe6c8000000 ---p 00000000 00:00 0 -7fe6cae00000-7fe6cb0df000 rw-p 00000000 00:00 0 -7fe6cb0f1000-7fe6cb0f2000 ---p 00000000 00:00 0 -7fe6cb0f2000-7fe6cb0f6000 ---p 00000000 00:00 0 -7fe6cb0f6000-7fe6cb1f2000 rw-p 00000000 00:00 0 -7fe6cb1f2000-7fe6cb1f3000 ---p 00000000 00:00 0 -7fe6cb1f3000-7fe6cb1f7000 ---p 00000000 00:00 0 -7fe6cb1f7000-7fe6cb2f3000 rw-p 00000000 00:00 0 -7fe6cb2f3000-7fe6cb2f4000 ---p 00000000 00:00 0 -7fe6cb2f4000-7fe6cb2f8000 ---p 00000000 00:00 0 -7fe6cb2f8000-7fe6cb3f4000 rw-p 00000000 00:00 0 -7fe6cb3f4000-7fe6cb3f5000 ---p 00000000 00:00 0 -7fe6cb3f5000-7fe6cb3f9000 ---p 00000000 00:00 0 -7fe6cb3f9000-7fe6cb4f5000 rw-p 00000000 00:00 0 -7fe6cb4f5000-7fe6cb4f6000 ---p 00000000 00:00 0 -7fe6cb4f6000-7fe6cb4fa000 ---p 00000000 00:00 0 -7fe6cb4fa000-7fe6cb5f6000 rw-p 00000000 00:00 0 -7fe6cb5f6000-7fe6cb5f7000 ---p 00000000 00:00 0 -7fe6cb5f7000-7fe6cb5fb000 ---p 00000000 00:00 0 -7fe6cb5fb000-7fe6cb6f7000 rw-p 00000000 00:00 0 -7fe6cb6f7000-7fe6cb6f8000 ---p 00000000 00:00 0 -7fe6cb6f8000-7fe6cb6fc000 ---p 00000000 00:00 0 -7fe6cb6fc000-7fe6cb7f8000 rw-p 00000000 00:00 0 -7fe6cb7f8000-7fe6cb7f9000 ---p 00000000 00:00 0 -7fe6cb7f9000-7fe6cb7fd000 ---p 00000000 00:00 0 -7fe6cb7fd000-7fe6cb8f9000 rw-p 00000000 00:00 0 -7fe6cb8f9000-7fe6cb8fa000 ---p 00000000 00:00 0 -7fe6cb8fa000-7fe6cb8fe000 ---p 00000000 00:00 0 -7fe6cb8fe000-7fe6cb9fa000 rw-p 00000000 00:00 0 -7fe6cb9fa000-7fe6cb9fb000 ---p 00000000 00:00 0 -7fe6cb9fb000-7fe6cb9ff000 ---p 00000000 00:00 0 -7fe6cb9ff000-7fe6cbafb000 rw-p 00000000 00:00 0 -7fe6cbafb000-7fe6cbafc000 ---p 00000000 00:00 0 -7fe6cbafc000-7fe6cbb00000 ---p 00000000 00:00 0 -7fe6cbb00000-7fe6cbbfc000 rw-p 00000000 00:00 0 -7fe6cbbfc000-7fe6cbbfd000 ---p 00000000 00:00 0 -7fe6cbbfd000-7fe6cbc01000 ---p 00000000 00:00 0 -7fe6cbc01000-7fe6cbcfd000 rw-p 00000000 00:00 0 -7fe6cbcfd000-7fe6cbcfe000 ---p 00000000 00:00 0 -7fe6cbcfe000-7fe6cbd02000 ---p 00000000 00:00 0 -7fe6cbd02000-7fe6cbdfe000 rw-p 00000000 00:00 0 -7fe6cbdfe000-7fe6cbdff000 ---p 00000000 00:00 0 -7fe6cbdff000-7fe6cbe03000 ---p 00000000 00:00 0 -7fe6cbe03000-7fe6cbeff000 rw-p 00000000 00:00 0 -7fe6cbeff000-7fe6cbf00000 ---p 00000000 00:00 0 -7fe6cbf00000-7fe6cbf04000 ---p 00000000 00:00 0 -7fe6cbf04000-7fe6cc021000 rw-p 00000000 00:00 0 -7fe6cc021000-7fe6d0000000 ---p 00000000 00:00 0 -7fe6d0045000-7fe6d0046000 ---p 00000000 00:00 0 -7fe6d0046000-7fe6d004a000 ---p 00000000 00:00 0 -7fe6d004a000-7fe6d0146000 rw-p 00000000 00:00 0 -7fe6d0146000-7fe6d0147000 ---p 00000000 00:00 0 -7fe6d0147000-7fe6d014b000 ---p 00000000 00:00 0 -7fe6d014b000-7fe6d0247000 rw-p 00000000 00:00 0 -7fe6d0247000-7fe6d0248000 ---p 00000000 00:00 0 -7fe6d0248000-7fe6d024c000 ---p 00000000 00:00 0 -7fe6d024c000-7fe6d0348000 rw-p 00000000 00:00 0 -7fe6d0348000-7fe6d0349000 ---p 00000000 00:00 0 -7fe6d0349000-7fe6d034d000 ---p 00000000 00:00 0 -7fe6d034d000-7fe6d0449000 rw-p 00000000 00:00 0 -7fe6d0449000-7fe6d044a000 ---p 00000000 00:00 0 -7fe6d044a000-7fe6d044e000 ---p 00000000 00:00 0 -7fe6d044e000-7fe6d054a000 rw-p 00000000 00:00 0 -7fe6d054a000-7fe6d054b000 ---p 00000000 00:00 0 -7fe6d054b000-7fe6d054f000 ---p 00000000 00:00 0 -7fe6d054f000-7fe6d064b000 rw-p 00000000 00:00 0 -7fe6d064b000-7fe6d064c000 ---p 00000000 00:00 0 -7fe6d064c000-7fe6d0650000 ---p 00000000 00:00 0 -7fe6d0650000-7fe6d074c000 rw-p 00000000 00:00 0 -7fe6d0803000-7fe6d0804000 ---p 00000000 00:00 0 -7fe6d0804000-7fe6d0808000 ---p 00000000 00:00 0 -7fe6d0808000-7fe6d0904000 rw-p 00000000 00:00 0 -7fe6d0904000-7fe6d0905000 ---p 00000000 00:00 0 -7fe6d0905000-7fe6d0909000 ---p 00000000 00:00 0 -7fe6d0909000-7fe6d0a05000 rw-p 00000000 00:00 0 -7fe6d0a05000-7fe6d0a06000 ---p 00000000 00:00 0 -7fe6d0a06000-7fe6d0a0a000 ---p 00000000 00:00 0 -7fe6d0a0a000-7fe6d0b06000 rw-p 00000000 00:00 0 -7fe6d0b06000-7fe6d0b07000 ---p 00000000 00:00 0 -7fe6d0b07000-7fe6d0b0b000 ---p 00000000 00:00 0 -7fe6d0b0b000-7fe6d0c07000 rw-p 00000000 00:00 0 -7fe6d0c07000-7fe6d0c08000 ---p 00000000 00:00 0 -7fe6d0c08000-7fe6d0c0c000 ---p 00000000 00:00 0 -7fe6d0c0c000-7fe6d0d08000 rw-p 00000000 00:00 0 -7fe6d0d08000-7fe6d0d09000 ---p 00000000 00:00 0 -7fe6d0d09000-7fe6d0d0d000 ---p 00000000 00:00 0 -7fe6d0d0d000-7fe6d0e09000 rw-p 00000000 00:00 0 -7fe6d0e09000-7fe6d0e0a000 ---p 00000000 00:00 0 -7fe6d0e0a000-7fe6d0e0e000 ---p 00000000 00:00 0 -7fe6d0e0e000-7fe6d0f0a000 rw-p 00000000 00:00 0 -7fe6d0f0a000-7fe6d0f0b000 ---p 00000000 00:00 0 -7fe6d0f0b000-7fe6d0f0f000 ---p 00000000 00:00 0 -7fe6d0f0f000-7fe6d100b000 rw-p 00000000 00:00 0 -7fe6d100b000-7fe6d100c000 ---p 00000000 00:00 0 -7fe6d100c000-7fe6d1010000 ---p 00000000 00:00 0 -7fe6d1010000-7fe6d110c000 rw-p 00000000 00:00 0 -7fe6d110c000-7fe6d110d000 ---p 00000000 00:00 0 -7fe6d110d000-7fe6d1111000 ---p 00000000 00:00 0 -7fe6d1111000-7fe6d120d000 rw-p 00000000 00:00 0 -7fe6d120d000-7fe6d120e000 ---p 00000000 00:00 0 -7fe6d120e000-7fe6d1212000 ---p 00000000 00:00 0 -7fe6d1212000-7fe6d130e000 rw-p 00000000 00:00 0 -7fe6d130e000-7fe6d130f000 ---p 00000000 00:00 0 -7fe6d130f000-7fe6d1313000 ---p 00000000 00:00 0 -7fe6d1313000-7fe6d140f000 rw-p 00000000 00:00 0 -7fe6d140f000-7fe6d1410000 ---p 00000000 00:00 0 -7fe6d1410000-7fe6d1414000 ---p 00000000 00:00 0 -7fe6d1414000-7fe6d1510000 rw-p 00000000 00:00 0 -7fe6d1510000-7fe6d1511000 ---p 00000000 00:00 0 -7fe6d1511000-7fe6d1515000 ---p 00000000 00:00 0 -7fe6d1515000-7fe6d1611000 rw-p 00000000 00:00 0 -7fe6d1611000-7fe6d1612000 ---p 00000000 00:00 0 -7fe6d1612000-7fe6d1616000 ---p 00000000 00:00 0 -7fe6d1616000-7fe6d1712000 rw-p 00000000 00:00 0 -7fe6d1712000-7fe6d1713000 ---p 00000000 00:00 0 -7fe6d1713000-7fe6d1717000 ---p 00000000 00:00 0 -7fe6d1717000-7fe6d1813000 rw-p 00000000 00:00 0 -7fe6d1813000-7fe6d1814000 ---p 00000000 00:00 0 -7fe6d1814000-7fe6d1818000 ---p 00000000 00:00 0 -7fe6d1818000-7fe6d1914000 rw-p 00000000 00:00 0 -7fe6d1914000-7fe6d1915000 ---p 00000000 00:00 0 -7fe6d1915000-7fe6d1a15000 rw-p 00000000 00:00 0 -7fe6d1a15000-7fe6d1a16000 ---p 00000000 00:00 0 -7fe6d1a16000-7fe6d1b16000 rw-p 00000000 00:00 0 -7fe6d1b16000-7fe6d1b17000 ---p 00000000 00:00 0 -7fe6d1b17000-7fe6d1c17000 rw-p 00000000 00:00 0 -7fe6d1c17000-7fe6d1c18000 ---p 00000000 00:00 0 -7fe6d1c18000-7fe6d1d18000 rw-p 00000000 00:00 0 -7fe6d1dde000-7fe6d1ddf000 ---p 00000000 00:00 0 -7fe6d1ddf000-7fe6d1de3000 ---p 00000000 00:00 0 -7fe6d1de3000-7fe6d1edf000 rw-p 00000000 00:00 0 -7fe6d1edf000-7fe6d1ee0000 ---p 00000000 00:00 0 -7fe6d1ee0000-7fe6d1ee4000 ---p 00000000 00:00 0 -7fe6d1ee4000-7fe6d1fe0000 rw-p 00000000 00:00 0 -7fe6d1fe0000-7fe6d1fe1000 ---p 00000000 00:00 0 -7fe6d1fe1000-7fe6d1fe5000 ---p 00000000 00:00 0 -7fe6d1fe5000-7fe6d20e1000 rw-p 00000000 00:00 0 -7fe6d20e1000-7fe6d20e2000 ---p 00000000 00:00 0 -7fe6d20e2000-7fe6d20e6000 ---p 00000000 00:00 0 -7fe6d20e6000-7fe6d21e2000 rw-p 00000000 00:00 0 -7fe6d21e2000-7fe6d21e3000 ---p 00000000 00:00 0 -7fe6d21e3000-7fe6d21e7000 ---p 00000000 00:00 0 -7fe6d21e7000-7fe6d22e3000 rw-p 00000000 00:00 0 -7fe6d22e3000-7fe6d22e4000 ---p 00000000 00:00 0 -7fe6d22e4000-7fe6d22e8000 ---p 00000000 00:00 0 -7fe6d22e8000-7fe6d23e4000 rw-p 00000000 00:00 0 -7fe6d23e4000-7fe6d23e5000 ---p 00000000 00:00 0 -7fe6d23e5000-7fe6d23e9000 ---p 00000000 00:00 0 -7fe6d23e9000-7fe6d24e5000 rw-p 00000000 00:00 0 -7fe6d24e5000-7fe6d24e6000 ---p 00000000 00:00 0 -7fe6d24e6000-7fe6d24ea000 ---p 00000000 00:00 0 -7fe6d24ea000-7fe6d25e6000 rw-p 00000000 00:00 0 -7fe6d25e6000-7fe6d25e7000 ---p 00000000 00:00 0 -7fe6d25e7000-7fe6d25eb000 ---p 00000000 00:00 0 -7fe6d25eb000-7fe6d26e7000 rw-p 00000000 00:00 0 -7fe6d26e7000-7fe6d26e8000 ---p 00000000 00:00 0 -7fe6d26e8000-7fe6d26ec000 ---p 00000000 00:00 0 -7fe6d26ec000-7fe6d27e8000 rw-p 00000000 00:00 0 -7fe6d27e8000-7fe6d27e9000 ---p 00000000 00:00 0 -7fe6d27e9000-7fe6d27ed000 ---p 00000000 00:00 0 -7fe6d27ed000-7fe6d28e9000 rw-p 00000000 00:00 0 -7fe6d28e9000-7fe6d28ea000 ---p 00000000 00:00 0 -7fe6d28ea000-7fe6d28ee000 ---p 00000000 00:00 0 -7fe6d28ee000-7fe6d29ea000 rw-p 00000000 00:00 0 -7fe6d29ea000-7fe6d29eb000 ---p 00000000 00:00 0 -7fe6d29eb000-7fe6d2aeb000 rw-p 00000000 00:00 0 -7fe6d2aeb000-7fe6d2aec000 ---p 00000000 00:00 0 -7fe6d2aec000-7fe6d2bec000 rw-p 00000000 00:00 0 -7fe6d2bec000-7fe6d2bed000 ---p 00000000 00:00 0 -7fe6d2bed000-7fe6d2ced000 rw-p 00000000 00:00 0 -7fe6d2ced000-7fe6d2cee000 ---p 00000000 00:00 0 -7fe6d2cee000-7fe6d2dee000 rw-p 00000000 00:00 0 -7fe6d2dee000-7fe6d2def000 ---p 00000000 00:00 0 -7fe6d2def000-7fe6d2eef000 rw-p 00000000 00:00 0 -7fe6d2eef000-7fe6d2ef0000 ---p 00000000 00:00 0 -7fe6d2ef0000-7fe6d2ff0000 rw-p 00000000 00:00 0 -7fe6d2ff0000-7fe6d2ff1000 ---p 00000000 00:00 0 -7fe6d2ff1000-7fe6d30f1000 rw-p 00000000 00:00 0 -7fe6d30f1000-7fe6d30f2000 ---p 00000000 00:00 0 -7fe6d30f2000-7fe6d31f2000 rw-p 00000000 00:00 0 -7fe6d31f2000-7fe6d31f3000 ---p 00000000 00:00 0 -7fe6d31f3000-7fe6d32f3000 rw-p 00000000 00:00 0 -7fe6d32f3000-7fe6d32f4000 ---p 00000000 00:00 0 -7fe6d32f4000-7fe6d33f4000 rw-p 00000000 00:00 0 -7fe6d33f4000-7fe6d33f5000 ---p 00000000 00:00 0 -7fe6d33f5000-7fe6d33f9000 ---p 00000000 00:00 0 -7fe6d33f9000-7fe6d34f5000 rw-p 00000000 00:00 0 -7fe6d34f5000-7fe6d34f6000 ---p 00000000 00:00 0 -7fe6d34f6000-7fe6d34fa000 ---p 00000000 00:00 0 -7fe6d34fa000-7fe6d35f6000 rw-p 00000000 00:00 0 -7fe6d35f6000-7fe6d35f7000 ---p 00000000 00:00 0 -7fe6d35f7000-7fe6d35fb000 ---p 00000000 00:00 0 -7fe6d35fb000-7fe6d36f7000 rw-p 00000000 00:00 0 -7fe6d36f7000-7fe6d36f8000 ---p 00000000 00:00 0 -7fe6d36f8000-7fe6d36fc000 ---p 00000000 00:00 0 -7fe6d36fc000-7fe6d37f8000 rw-p 00000000 00:00 0 -7fe6d37f8000-7fe6d37f9000 ---p 00000000 00:00 0 -7fe6d37f9000-7fe6d37fd000 ---p 00000000 00:00 0 -7fe6d37fd000-7fe6d38f9000 rw-p 00000000 00:00 0 -7fe6d38f9000-7fe6d38fa000 ---p 00000000 00:00 0 -7fe6d38fa000-7fe6d38fe000 ---p 00000000 00:00 0 -7fe6d38fe000-7fe6d39fa000 rw-p 00000000 00:00 0 -7fe6d39fa000-7fe6d39fb000 ---p 00000000 00:00 0 -7fe6d39fb000-7fe6d39ff000 ---p 00000000 00:00 0 -7fe6d39ff000-7fe6d3afb000 rw-p 00000000 00:00 0 -7fe6d3afb000-7fe6d3afc000 ---p 00000000 00:00 0 -7fe6d3afc000-7fe6d3b00000 ---p 00000000 00:00 0 -7fe6d3b00000-7fe6d3bfc000 rw-p 00000000 00:00 0 -7fe6d3bfc000-7fe6d3bfd000 ---p 00000000 00:00 0 -7fe6d3bfd000-7fe6d3c01000 ---p 00000000 00:00 0 -7fe6d3c01000-7fe6d3cfd000 rw-p 00000000 00:00 0 -7fe6d3cfd000-7fe6d3cfe000 ---p 00000000 00:00 0 -7fe6d3cfe000-7fe6d3d02000 ---p 00000000 00:00 0 -7fe6d3d02000-7fe6d3dfe000 rw-p 00000000 00:00 0 -7fe6d3dfe000-7fe6d3dff000 ---p 00000000 00:00 0 -7fe6d3dff000-7fe6d3e03000 ---p 00000000 00:00 0 -7fe6d3e03000-7fe6d3eff000 rw-p 00000000 00:00 0 -7fe6d3eff000-7fe6d3f00000 ---p 00000000 00:00 0 -7fe6d3f00000-7fe6d3f04000 ---p 00000000 00:00 0 -7fe6d3f04000-7fe6d4021000 rw-p 00000000 00:00 0 -7fe6d4021000-7fe6d8000000 ---p 00000000 00:00 0 -7fe6d80ff000-7fe6d8100000 ---p 00000000 00:00 0 -7fe6d8100000-7fe6d8104000 ---p 00000000 00:00 0 -7fe6d8104000-7fe6d8200000 rw-p 00000000 00:00 0 -7fe6d8200000-7fe6d8478000 r--p 00000000 00:24 30173565 /usr/lib/locale/fr_FR.utf8/LC_COLLATE -7fe6d84ef000-7fe6d84f0000 ---p 00000000 00:00 0 -7fe6d84f0000-7fe6d84f4000 ---p 00000000 00:00 0 -7fe6d84f4000-7fe6d85f0000 rw-p 00000000 00:00 0 -7fe6d85f0000-7fe6d85f1000 ---p 00000000 00:00 0 -7fe6d85f1000-7fe6d86f1000 rw-p 00000000 00:00 0 -7fe6d86f1000-7fe6d86f2000 ---p 00000000 00:00 0 -7fe6d86f2000-7fe6d87f2000 rw-p 00000000 00:00 0 -7fe6d87f2000-7fe6d87f3000 ---p 00000000 00:00 0 -7fe6d87f3000-7fe6d88f3000 rw-p 00000000 00:00 0 -7fe6d88f3000-7fe6d88f4000 ---p 00000000 00:00 0 -7fe6d88f4000-7fe6db600000 rw-p 00000000 00:00 0 -7fe6db6fd000-7fe6db7fe000 rw-p 00000000 00:00 0 -7fe6db7fe000-7fe6db7ff000 ---p 00000000 00:00 0 -7fe6db7ff000-7fe6db8ff000 rw-p 00000000 00:00 0 -7fe6db8ff000-7fe6db900000 ---p 00000000 00:00 0 -7fe6db900000-7fe6dbdb0000 rw-p 00000000 00:00 0 -7fe6dbdb0000-7fe6dc1b0000 ---p 00000000 00:00 0 -7fe6dc1b0000-7fe6dc1c0000 rw-p 00000000 00:00 0 -7fe6dc1c0000-7fe6e3510000 ---p 00000000 00:00 0 -7fe6e3510000-7fe6e3520000 rw-p 00000000 00:00 0 -7fe6e355f000-7fe6e3560000 ---p 00000000 00:00 0 -7fe6e3560000-7fe6e3564000 ---p 00000000 00:00 0 -7fe6e3564000-7fe6e3582000 rw-p 00000000 00:00 0 -7fe6e3582000-7fe6e35a7000 r--p 00000000 00:24 29813096 /usr/share/locale/fr/LC_MESSAGES/libc.mo -7fe6e35a7000-7fe6e3600000 r--p 00000000 00:24 30173566 /usr/lib/locale/fr_FR.utf8/LC_CTYPE -7fe6e3600000-7fe6e3676000 rw-p 00000000 00:00 0 -7fe6e3676000-7fe6e36f6000 ---p 00000000 00:00 0 -7fe6e36f6000-7fe6e36f8000 rw-p 00000000 00:00 0 -7fe6e36f8000-7fe6e4562000 ---p 00000000 00:00 0 -7fe6e4562000-7fe6e4564000 rw-p 00000000 00:00 0 -7fe6e457f000-7fe6e4676000 rw-p 00000000 00:00 0 -7fe6e4676000-7fe6e46f6000 ---p 00000000 00:00 0 -7fe6e46f6000-7fe6e46f8000 rw-p 00000000 00:00 0 -7fe6e46f8000-7fe6e5562000 ---p 00000000 00:00 0 -7fe6e5562000-7fe6e5564000 rw-p 00000000 00:00 0 -7fe6e556c000-7fe6e55a1000 r--s 00000000 00:1a 7656 /run/nscd/dbXsuruP (deleted) -7fe6e55a1000-7fe6e55fc000 rw-p 00000000 00:00 0 -7fe6e55fc000-7fe6e55fd000 ---p 00000000 00:00 0 -7fe6e55fd000-7fe6e5a00000 rw-p 00000000 00:00 0 -7fe6e5a00000-7fe6e6e80000 rwxp 00000000 00:00 0 -7fe6e6e80000-7fe6ece5f000 ---p 00000000 00:00 0 -7fe6ece5f000-7fe6ed1bf000 rwxp 00000000 00:00 0 -7fe6ed1bf000-7fe6ed5a0000 ---p 00000000 00:00 0 -7fe6ed5a0000-7fe6edec0000 rwxp 00000000 00:00 0 -7fe6edec0000-7fe6f4a00000 ---p 00000000 00:00 0 -7fe6f4a01000-7fe6f4c00000 rw-p 00000000 00:00 0 -7fe6f4c00000-7fe6f7ec7000 r--s 00000000 00:32 45050231 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/modules -7fe6f7ed7000-7fe6f7ed9000 r--p 00000000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7ed9000-7fe6f7edc000 r-xp 00002000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7edc000-7fe6f7edd000 r--p 00005000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7edd000-7fe6f7ede000 ---p 00006000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7ede000-7fe6f7edf000 r--p 00006000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7edf000-7fe6f7ee0000 rw-p 00007000 00:32 45050218 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement_ext.so -7fe6f7ee0000-7fe6f7ee4000 r--p 00000000 00:32 45050229 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -7fe6f7ee4000-7fe6f7eeb000 r-xp 00004000 00:32 45050229 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -7fe6f7eeb000-7fe6f7eed000 r--p 0000b000 00:32 45050229 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -7fe6f7eed000-7fe6f7eef000 r--p 0000c000 00:32 45050229 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -7fe6f7eef000-7fe6f7ef0000 rw-p 0000e000 00:32 45050229 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libverify.so -7fe6f7ef0000-7fe6f7ef3000 r--p 00000000 00:32 45050221 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -7fe6f7ef3000-7fe6f7efb000 r-xp 00003000 00:32 45050221 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -7fe6f7efb000-7fe6f7efd000 r--p 0000b000 00:32 45050221 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -7fe6f7efd000-7fe6f7efe000 r--p 0000c000 00:32 45050221 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -7fe6f7efe000-7fe6f7eff000 rw-p 0000d000 00:32 45050221 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnet.so -7fe6f7eff000-7fe6f8688000 rw-p 00000000 00:00 0 -7fe6f8688000-7fe6fc000000 ---p 00000000 00:00 0 -7fe6fc002000-7fe6fc005000 r--p 00000000 00:32 45050219 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -7fe6fc005000-7fe6fc006000 r-xp 00003000 00:32 45050219 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -7fe6fc006000-7fe6fc007000 r--p 00004000 00:32 45050219 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -7fe6fc007000-7fe6fc008000 r--p 00004000 00:32 45050219 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -7fe6fc008000-7fe6fc009000 rw-p 00005000 00:32 45050219 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libmanagement.so -7fe6fc009000-7fe6fc011000 r--p 00000000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc011000-7fe6fc01a000 r-xp 00008000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc01a000-7fe6fc01e000 r--p 00011000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc01e000-7fe6fc01f000 ---p 00015000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc01f000-7fe6fc020000 r--p 00015000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc020000-7fe6fc021000 rw-p 00016000 00:32 45050222 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libnio.so -7fe6fc021000-7fe6fc023000 r--p 00000000 00:32 45050230 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -7fe6fc023000-7fe6fc035000 r-xp 00002000 00:32 45050230 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -7fe6fc035000-7fe6fc03d000 r--p 00014000 00:32 45050230 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -7fe6fc03d000-7fe6fc03e000 r--p 0001b000 00:32 45050230 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -7fe6fc03e000-7fe6fc03f000 rw-p 0001c000 00:32 45050230 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libzip.so -7fe6fc03f000-7fe6fc85a000 rw-p 00000000 00:00 0 -7fe6fc85a000-7fe6fc930000 ---p 00000000 00:00 0 -7fe6fc930000-7fe6fc959000 rw-p 00000000 00:00 0 -7fe6fc959000-7fe6fca19000 ---p 00000000 00:00 0 -7fe6fca19000-7fe6fca1d000 ---p 00000000 00:00 0 -7fe6fca1d000-7fe6fcb19000 rw-p 00000000 00:00 0 -7fe6fcb19000-7fe6fcb29000 r--p 00000000 00:24 29797234 /usr/lib64/libm.so.6 -7fe6fcb29000-7fe6fcba3000 r-xp 00010000 00:24 29797234 /usr/lib64/libm.so.6 -7fe6fcba3000-7fe6fcbfd000 r--p 0008a000 00:24 29797234 /usr/lib64/libm.so.6 -7fe6fcbfd000-7fe6fcbfe000 r--p 000e3000 00:24 29797234 /usr/lib64/libm.so.6 -7fe6fcbfe000-7fe6fcc00000 rw-p 000e4000 00:24 29797234 /usr/lib64/libm.so.6 -7fe6fcc00000-7fe6fce97000 r--p 00000000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fce97000-7fe6fdcf7000 r-xp 00297000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fdcf7000-7fe6fdfcd000 r--p 010f7000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fdfcd000-7fe6fdfce000 ---p 013cd000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fdfce000-7fe6fe09e000 r--p 013cd000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fe09e000-7fe6fe0ce000 rw-p 0149d000 00:32 45050242 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/server/libjvm.so -7fe6fe0ce000-7fe6fe134000 rw-p 00000000 00:00 0 -7fe6fe134000-7fe6fe135000 r--p 00000000 00:32 45050199 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -7fe6fe135000-7fe6fe136000 r-xp 00001000 00:32 45050199 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -7fe6fe136000-7fe6fe137000 r--p 00002000 00:32 45050199 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -7fe6fe137000-7fe6fe138000 r--p 00002000 00:32 45050199 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -7fe6fe138000-7fe6fe139000 rw-p 00003000 00:32 45050199 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libextnet.so -7fe6fe139000-7fe6fe13a000 r--p 00000000 00:24 30173666 /usr/lib/locale/fr_FR.utf8/LC_NUMERIC -7fe6fe13a000-7fe6fe13b000 r--p 00000000 00:24 15581768 /usr/lib/locale/fr_FR.utf8/LC_TIME -7fe6fe13b000-7fe6fe13c000 r--p 00000000 00:24 30173665 /usr/lib/locale/fr_FR.utf8/LC_MONETARY -7fe6fe13c000-7fe6fe13d000 r--p 00000000 00:24 30173838 /usr/lib/locale/fr_FR.utf8/LC_MESSAGES/SYS_LC_MESSAGES -7fe6fe13d000-7fe6fe13e000 r--p 00000000 00:24 30173572 /usr/lib/locale/fr_FR.utf8/LC_PAPER -7fe6fe13e000-7fe6fe13f000 r--p 00000000 00:24 30173595 /usr/lib/locale/fr_FR.utf8/LC_NAME -7fe6fe13f000-7fe6fe140000 r--p 00000000 00:24 15581766 /usr/lib/locale/fr_FR.utf8/LC_ADDRESS -7fe6fe140000-7fe6fe1c3000 rw-p 00000000 00:00 0 -7fe6fe1c3000-7fe6fe1cb000 ---p 00000000 00:00 0 -7fe6fe1cb000-7fe6fe200000 r--s 00000000 00:25 14259 /var/lib/nscd/passwd -7fe6fe200000-7fe6fe228000 r--p 00000000 00:24 29797231 /usr/lib64/libc.so.6 -7fe6fe228000-7fe6fe395000 r-xp 00028000 00:24 29797231 /usr/lib64/libc.so.6 -7fe6fe395000-7fe6fe3eb000 r--p 00195000 00:24 29797231 /usr/lib64/libc.so.6 -7fe6fe3eb000-7fe6fe3ef000 r--p 001ea000 00:24 29797231 /usr/lib64/libc.so.6 -7fe6fe3ef000-7fe6fe3f8000 rw-p 001ee000 00:24 29797231 /usr/lib64/libc.so.6 -7fe6fe3f8000-7fe6fe405000 rw-p 00000000 00:00 0 -7fe6fe405000-7fe6fe406000 r--p 00000000 00:24 30173667 /usr/lib/locale/fr_FR.utf8/LC_TELEPHONE -7fe6fe406000-7fe6fe407000 r--p 00000000 00:24 30173567 /usr/lib/locale/fr_FR.utf8/LC_MEASUREMENT -7fe6fe407000-7fe6fe415000 r--p 00000000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe415000-7fe6fe423000 r-xp 0000e000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe423000-7fe6fe428000 r--p 0001c000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe428000-7fe6fe429000 ---p 00021000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe429000-7fe6fe42a000 r--p 00021000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe42a000-7fe6fe42b000 rw-p 00022000 00:32 45050207 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjava.so -7fe6fe42b000-7fe6fe42c000 rw-p 00000000 00:00 0 -7fe6fe42c000-7fe6fe42d000 r--p 00000000 00:24 29797243 /usr/lib64/librt.so.1 -7fe6fe42d000-7fe6fe42e000 r-xp 00001000 00:24 29797243 /usr/lib64/librt.so.1 -7fe6fe42e000-7fe6fe42f000 r--p 00002000 00:24 29797243 /usr/lib64/librt.so.1 -7fe6fe42f000-7fe6fe430000 r--p 00002000 00:24 29797243 /usr/lib64/librt.so.1 -7fe6fe430000-7fe6fe431000 rw-p 00003000 00:24 29797243 /usr/lib64/librt.so.1 -7fe6fe431000-7fe6fe434000 rw-p 00000000 00:00 0 -7fe6fe434000-7fe6fe435000 r--p 00000000 00:24 29797233 /usr/lib64/libdl.so.2 -7fe6fe435000-7fe6fe436000 r-xp 00001000 00:24 29797233 /usr/lib64/libdl.so.2 -7fe6fe436000-7fe6fe437000 r--p 00002000 00:24 29797233 /usr/lib64/libdl.so.2 -7fe6fe437000-7fe6fe438000 r--p 00002000 00:24 29797233 /usr/lib64/libdl.so.2 -7fe6fe438000-7fe6fe439000 rw-p 00003000 00:24 29797233 /usr/lib64/libdl.so.2 -7fe6fe439000-7fe6fe43b000 rw-p 00000000 00:00 0 -7fe6fe43b000-7fe6fe43c000 r--p 00000000 00:24 29797241 /usr/lib64/libpthread.so.0 -7fe6fe43c000-7fe6fe43d000 r-xp 00001000 00:24 29797241 /usr/lib64/libpthread.so.0 -7fe6fe43d000-7fe6fe43e000 r--p 00002000 00:24 29797241 /usr/lib64/libpthread.so.0 -7fe6fe43e000-7fe6fe43f000 r--p 00002000 00:24 29797241 /usr/lib64/libpthread.so.0 -7fe6fe43f000-7fe6fe440000 rw-p 00003000 00:24 29797241 /usr/lib64/libpthread.so.0 -7fe6fe440000-7fe6fe447000 r--s 00000000 00:24 30173390 /usr/lib64/gconv/gconv-modules.cache -7fe6fe447000-7fe6fe448000 r--p 00000000 00:24 15581767 /usr/lib/locale/fr_FR.utf8/LC_IDENTIFICATION -7fe6fe448000-7fe6fe450000 rw-s 00000000 00:21 7797175 /tmp/hsperfdata_morr/30541 -7fe6fe450000-7fe6fe451000 ---p 00000000 00:00 0 -7fe6fe451000-7fe6fe452000 r--p 00000000 00:00 0 -7fe6fe452000-7fe6fe453000 ---p 00000000 00:00 0 -7fe6fe453000-7fe6fe457000 r--p 00000000 00:32 45050211 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -7fe6fe457000-7fe6fe46a000 r-xp 00004000 00:32 45050211 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -7fe6fe46a000-7fe6fe470000 r--p 00017000 00:32 45050211 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -7fe6fe470000-7fe6fe472000 r--p 0001c000 00:32 45050211 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -7fe6fe472000-7fe6fe473000 rw-p 0001e000 00:32 45050211 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjimage.so -7fe6fe473000-7fe6fe476000 r--p 00000000 00:32 45050212 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjli.so -7fe6fe476000-7fe6fe486000 r-xp 00003000 00:32 45050212 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjli.so -7fe6fe486000-7fe6fe48d000 r--p 00013000 00:32 45050212 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjli.so -7fe6fe48d000-7fe6fe48e000 r--p 00019000 00:32 45050212 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjli.so -7fe6fe48e000-7fe6fe48f000 rw-p 0001a000 00:32 45050212 /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/jre/21.0.2-linux-x86_64.tar/lib/libjli.so -7fe6fe48f000-7fe6fe491000 rw-p 00000000 00:00 0 -7fe6fe491000-7fe6fe492000 r--p 00000000 00:24 29797228 /usr/lib64/ld-linux-x86-64.so.2 -7fe6fe492000-7fe6fe4ba000 r-xp 00001000 00:24 29797228 /usr/lib64/ld-linux-x86-64.so.2 -7fe6fe4ba000-7fe6fe4c5000 r--p 00029000 00:24 29797228 /usr/lib64/ld-linux-x86-64.so.2 -7fe6fe4c5000-7fe6fe4c7000 r--p 00033000 00:24 29797228 /usr/lib64/ld-linux-x86-64.so.2 -7fe6fe4c7000-7fe6fe4c9000 rw-p 00035000 00:24 29797228 /usr/lib64/ld-linux-x86-64.so.2 -7ffea2760000-7ffea2782000 rw-p 00000000 00:00 0 [stack] -7ffea27ef000-7ffea27f3000 r--p 00000000 00:00 0 [vvar] -7ffea27f3000-7ffea27f5000 r-xp 00000000 00:00 0 [vdso] -ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] -Total number of mappings: 629 - - -VM Arguments: -java_command: /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/server/sonarlint-ls.jar -stdio -analyzers /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonargo.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarjava.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarjs.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarphp.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarpython.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarhtml.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarxml.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarcfamily.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonartext.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonariac.jar /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/analyzers/sonarlintomnisharp.jar -java_class_path (initial): /home/morr/.vscode/extensions/sonarsource.sonarlint-vscode-4.3.0-linux-x64/server/sonarlint-ls.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 12 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 13 {product} {ergonomic} - size_t G1HeapRegionSize = 4194304 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 520093696 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 8262778880 {product} {ergonomic} - size_t MaxNewSize = 4957667328 {product} {ergonomic} - size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 8262778880 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -PATH=/home/morr/anaconda/bin:/usr/local/bin:/usr/local/cuda/bin:/home/morr/anaconda3/condabin:/usr/bin:/bin:/usr/X11R6/bin:/snap/bin -SHELL=/usr/bin/fish -DISPLAY=:0 -LANG=fr_FR.UTF-8 -TERM=xterm-256color - -Active Locale: -LC_ALL=fr_FR.UTF-8 -LC_COLLATE=fr_FR.UTF-8 -LC_CTYPE=fr_FR.UTF-8 -LC_MESSAGES=fr_FR.UTF-8 -LC_MONETARY=fr_FR.UTF-8 -LC_NUMERIC=fr_FR.UTF-8 -LC_TIME=fr_FR.UTF-8 - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.so, mask=00000000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -NAME="openSUSE Tumbleweed" -# VERSION="20240225" -ID="opensuse-tumbleweed" -ID_LIKE="opensuse suse" -VERSION_ID="20240225" -PRETTY_NAME="openSUSE Tumbleweed" -ANSI_COLOR="0;32" -# CPE 2.3 format, boo#1217921 -CPE_NAME="cpe:2.3:o:opensuse:tumbleweed:20240225:*:*:*:*:*:*:*" -#CPE 2.2 format -#CPE_NAME="cpe:/o:opensuse:tumbleweed:20240225" -BUG_REPORT_URL="https://bugzilla.opensuse.org" -SUPPORT_URL="https://bugs.opensuse.org" -HOME_URL="https://www.opensuse.org" -DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed" -LOGO="distributor-logo-Tumbleweed" -uname: Linux 6.7.5-1-default #1 SMP PREEMPT_DYNAMIC Sat Feb 17 07:45:40 UTC 2024 (a3bab56) x86_64 -OS uptime: 1 days 0:07 hours -libc: glibc 2.39 NPTL 2.39 -rlimit (soft/hard): STACK 8192k/infinity , CORE infinity/infinity , NPROC 125655/125655 , NOFILE 524288/524288 , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK 8192k/8192k -load average: 4,86 4,07 3,76 - -/proc/meminfo: -MemTotal: 32267176 kB -MemFree: 8175876 kB -MemAvailable: 18960004 kB -Buffers: 164480 kB -Cached: 10476964 kB -SwapCached: 97816 kB -Active: 6245052 kB -Inactive: 15255800 kB -Active(anon): 320512 kB -Inactive(anon): 10790076 kB -Active(file): 5924540 kB -Inactive(file): 4465724 kB -Unevictable: 104 kB -Mlocked: 104 kB -SwapTotal: 51308352 kB -SwapFree: 50481728 kB -Zswap: 0 kB -Zswapped: 0 kB -Dirty: 1708 kB -Writeback: 0 kB -AnonPages: 10484812 kB -Mapped: 2289604 kB -Shmem: 250816 kB -KReclaimable: 851992 kB -Slab: 1464792 kB -SReclaimable: 851992 kB -SUnreclaim: 612800 kB -KernelStack: 36416 kB -PageTables: 138280 kB -SecPageTables: 0 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 67441940 kB -Committed_AS: 25884892 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 177984 kB -VmallocChunk: 0 kB -Percpu: 14144 kB -HardwareCorrupted: 0 kB -AnonHugePages: 3710976 kB -ShmemHugePages: 0 kB -ShmemPmdMapped: 0 kB -FileHugePages: 0 kB -FilePmdMapped: 0 kB -CmaTotal: 0 kB -CmaFree: 0 kB -Unaccepted: 0 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -Hugetlb: 0 kB -DirectMap4k: 5911264 kB -DirectMap2M: 27037696 kB -DirectMap1G: 0 kB - -/sys/kernel/mm/transparent_hugepage/enabled: [always] madvise never -/sys/kernel/mm/transparent_hugepage/defrag (defrag/compaction efforts parameter): always defer defer+madvise [madvise] never - -Process Memory: -Virtual Size: 15657476K (peak: 15670920K) -Resident Set Size: 649828K (peak: 649828K) (anon: 615704K, file: 34124K, shmem: 0K) -Swapped out: 0K -C-Heap outstanding allocations: 74414K, retained: 193385K -glibc malloc tunables: (default) - -/proc/sys/kernel/threads-max (system-wide limit on the number of threads): 251311 -/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): 1048576 -/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): 32768 - -container (cgroup) information: -container_type: cgroupv2 -cpu_cpuset_cpus: not supported -cpu_memory_nodes: not supported -active_processor_count: 16 -cpu_quota: not supported -cpu_period: not supported -cpu_shares: not supported -memory_limit_in_bytes: unlimited -memory_and_swap_limit_in_bytes: unlimited -memory_soft_limit_in_bytes: unlimited -memory_usage_in_bytes: 3615008 k -memory_max_usage_in_bytes: not supported -memory_swap_current_in_bytes: 72240 k -memory_swap_max_limit_in_bytes: unlimited -maximum number of tasks: 4915 -current number of tasks: 336 - -Steal ticks since vm start: 0 -Steal ticks percentage since vm start: 0,000 - -CPU: total 16 (initial active 16) (16 cores per cpu, 2 threads per core) family 23 model 96 stepping 1 microcode 0x8600106, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, rdtscp, rdpid, f16c -CPU Model and flags from /proc/cpuinfo: -model name : AMD Ryzen 7 4800H with Radeon Graphics -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca - -Online cpus: 0-15 -Offline cpus: -BIOS frequency limitation: -Frequency switch latency (ns): 0 -Available cpu frequencies: -Current governor: powersave -Core performance/turbo boost: - -Memory: 4k page, physical 32267176k(18980232k free), swap 51308352k(50481728k free) -Page Sizes: 4k - -vm_info: OpenJDK 64-Bit Server VM (21.0.2+13-LTS) for linux-amd64 JRE (21.0.2+13-LTS), built on 2024-01-16T00:00:00Z by "admin" with gcc 11.2.0 - -END. diff --git a/loadScripts.js b/loadScripts.js index c170606..d99913d 100644 --- a/loadScripts.js +++ b/loadScripts.js @@ -1,6 +1,5 @@ export default function() -{ - console.log("effectScripts loaded !!!"); - mergeObject(game.wfrp4e.config.effectScripts, {"00ZCnahnTGvzG9KA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item])","01VFjGVxkjb5P1ve":"return args.item?.system?.isRanged && args.data.targets[0]?.actor?.sizeNum < 3","03mJu59V4iByWlsO":"// The imbiber immediately\n// takes 3 Poisoned Conditions that cannot be resisted at first,\nawait this.actor.addCondition(\"poisoned\", 3)\n\n// recovers a number of Wounds equal to their Toughness Bonus, \nawait this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\n\n// and acquires the Regenerate Creature Trait.\nconst hasRegenerate = this.actor.has(\"Régénération\")\nif (hasRegenerate === undefined) {\n fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\").then(trait => {\n let traitItem = trait.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\n })\n}\n\nthis.script.scriptMessage(`

${this.actor.prototypeToken.name} :\n

    \n
  • Reçoit 3 états Empoisonnés, sans Test de Résistance possible
  • \n
  • Récupère ${this.actor.system.characteristics.t.bonus} Blessures
  • \n
  • Acuiert le Trait de Creature Régénération.
  • \n
\n C'est à Ranaldde choisir si la régénératin peut guérir de l'empoisonnement.

\n

Lorsque tout les états Empoisonnés sont terminés, le Trait Régénération est perdu également.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n","04bAiHISSW53w94Y":"this.actor.addCondition(\"blinded\", 3)","06IaVCOC0RCJbxEf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.8piWcBKFlQ2J1E3A\")\nlet data = item.toObject();\ndata.system.location.key= this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","09sSpnW8z2zcVEdf":"if (!args.flags.quietenedApplied)\n{\n args.fields.modifier += 10;\n args.flags.quietenedApplied = true\n}","0BP5l7bIkf744G1k":"return !args.options.terror && !args.extendedTest?.flags.wfrp4e?.fear","0FNOq4J1AdPd2A0q":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Row\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","0FWto1oEr3jbWggw":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\")\n\nlet text = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).result\n\nlore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1]\n\nif (text == \"GM's Choice\")\n{\n return this.script.scriptNotification(text)\n}\n\nif (spellsWithLore.length > 0)\n{\n let spellsWithLore = spells.filter(i => game.wfrp4e.config.magicLores[i.system.lore.value] == lore)\n let selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\n this.script.scriptNotification(selectedSpell.name);\n this.actor.createEmbeddedDocuments(\"Item\", [selectedSpell])\n}\nelse\n{\n ui.notifications.notify(`Impossible de trouver le sort ${lore}. Essayez à nouveau`)\n}","0KG3HoTNoZhaINIj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4CMKeDTDrRQZbPIJ\")\nlet fixation = (await game.wfrp4e.tables.rollTable(\"fixations\"))\nlet data = item.toObject();\ndata.system.specification.value = fixation.result;\nthis.item.updateSource({name : this.item.name += ` (${fixation.result})`});\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0LCQtsiK2aUfYRmD":"return ![\"t\", \"wp\"].includes(args.characteristic)","0R0QAr3D024kWPfo":"let table = game.wfrp4e.tables.findTable(\"mutatephys\");\nif (!table)\n{\n\treturn ui.notifications.error(\"La table des Mutations n'a pas été trouvée. Assurez vous que la table avec la clé `mutatephys` est bien importée dans le monde.\")\n}\nlet result = (await table.roll()).results[0];\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\nlet item = await fromUuid(uuid);\n\nif (item)\n{\n this.script.scriptNotification(`${item.name} added`)\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n}\nelse \n{\n ui.notifications.error(\"L'item ne peut être trouvé: \" + uuid)\n}","0Uly7OmkH0zqYbxQ":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"max(1, 1d10 - @system.characteristics.t.bonus)\", this.actor).roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","0YKQGbsKdHSmYGE7":"if (args.skill?.name != game.i18n.localize(\"NAME.Gossip\"))\n{\n\treturn true;\n}\nelse \n{\n\targs.data.canReverse = true; // Kind of a kludge here, the talent Tests has a specific condition, but the description simply says \"any gossip test can be reversed\" so check it here instead of submission\n}\n ","0abwNjpzo3SbEOeO":"if (args.applyAP && args.modifiers.ap.metal) \n{\n args.modifiers.ap.ignored += args.modifiers.ap.metal\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore le m�tal (\" + args.modifiers.ap.metal + \")\");\n args.modifiers.ap.metal = 0\n}","0e0UZT2FodOJDdgW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0e7OkamNAaAk4Oit":"let item1 = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\nlet item2 = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\n\nlet data1 = item1.toObject();\ndata1.system.location.key = this.item.system.location.key\n\nlet data2 = item2.toObject();\ndata2.system.location.key = this.item.system.location.key\n\nthis.actor.createEmbeddedDocuments(\"Item\", [data1, data2], {fromEffect: this.effect.id})\n","0iTLDgFHO9Rgc010":"args.fields.modifier -= 20;","0mrUnxzufYgsR0Ph":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"stunned\")\n }\n})\n","0vaYwAlMWTmOBl8k":"if (!args.flags.strikeToStun)\n{\n args.flags.strikeToStun = true\n args.fields.modifier += 20;\n args.fields.hitLocation = \"head\";\n}\nargs.fields.successBonus++;","0yyofYHeDRQlFliO":"return args.options.terror || args.extendedTest?.flags.wfrp4e?.fear","11uCC0mK2uL783al":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\n\nif ([\"feu\", \"electricité\", \"poison\"].includes(type))\n{\n args.applyAP = false;\n}","16nCOByUaSFDym1V":"args.fields.modifier -= 20\n","190PHSHKGaJ74wsR":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"Terrain\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let terrain = name.split(\"(\")[1].split(\")\")[0]\n tests = tests.replace(\"Terrain\", terrain)\n }\n else // If no sense specified, provide dialog choice\n {\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\n coastal : \"Côtes\",\n deserts : \"Déserts\",\n marshes : \"Marches\",\n rocky : \"Rocailles\",\n tundra : \"Tundra\",\n woodlands : \"Forêts\"\n }, this.item.img), 1, \"Choisir le Terrain\");\n if (choice[0])\n {\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\n tests = tests.replace(\"Terrain\", \"Terrain \" + choice[0].name )\n }\n }\n\n this.effect.updateSource({name})\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","1A87vGLh2PXH0rG0":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","1BT0MWM2cbhlEnrn":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 5,\n \"s\" : 5,\n \"t\" : 0,\n \"i\" : 5,\n \"ag\" : 5,\n \"dex\" : 5,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let items = []\n\n let updateObj = this.actor.toObject();\n\n let talents = (await Promise.all([game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\")])).map(i => i.text)\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n","1E47r2ba6IGe8uFK":"return args.characteristic != \"t\"","1IodsW9ImamYoEYz":"args.actor.details.move.run += 4","1JwxZujbDcueLWBL":"await this.actor.addCondition(\"ablaze\", 2)\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","1LDm3OB32skZe6Xv":"return args.characteristic != \"wp\"","1MDOKny7IirJPoI6":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` ${this.effect.name}`})\nawait test.roll()\nif (test.succeeded)\n{\n this.effect.delete();\n}\n","1OpT3CXs07XFWWCT":"args.options.cardsharp = true;","1PQPxFjmRlulHHzo":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2);\n}\n ","1UalUmNzjB4rp3SZ":"return [\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","1ZArMNUI8qqH6zkX":"let test = await args.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gain d'un état Assomé\"}})\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"stunned\")\n}\n\n","1ZrzpfVwPJHdwp23":"this.actor.status.addArmour(1, {source: this.effect, magical : true})","1exiWlVUHsXDLLAH":"this.script.scriptNotification(`Ne peut saisir ${this.effect.name}!`);","1fQr1Dg7DX0vfz3r":"let healed = parseInt(this.effect.sourceTest.result.SL)\nthis.actor.modifyWounds(healed)\nthis.script.scriptMessage(`Soins de ${healed} Blessures`)","1kB2su7hLRYDhZ2H":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (!test.succeeded)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\")\n let data = item.toObject();\n if (this.item.system.location.key == \"rLeg\")\n {\n data.system.location.value = \"Pied droit\"\n\t data.system.location.key = \"rToe\";\n }\n else if (this.item.system.location.key == \"lLeg\")\n {\n data.system.location.value = \"Pied gauche\"\n\tdata.system.location.key = \"lToe\";\n }\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n}\nthis.effect.delete();","1l7Jz2ZHbAWko7Vm":"args.options.ballockKnife = true;","1mNkLj9JYNr3ofC6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"stunned\", 3)\n }\n})","1wEjrgff7ASxKVmy":"if (args.effect.conditionId == \"bleeding\")\n args.data.damage -= 1","1wKVvxRTHOyV4Qdv":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Sail\"))","1wrPvP6lJwIAfmsl":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, \"Choisir une localisation\");\n\nlet location = choice[0].id;\n\nlet itemTargeted = this.actor.items.get(this.effect.getFlag(\"wfrp4e\", \"itemTargets\")[0])\n\nif (itemTargeted)\n{\n itemTargeted.update({[`system.APdamage.${location}`] : itemTargeted.system.APdamage[location] + 1})\n}","1yOvw74jzFfaI87b":"return args.options.reload\n","22bW97lkvCqisfHX":"return args.type != \"channelling\" && !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","23HgjCB1oecxANvA":"if (args.item.range && args.item.range.bands)\n{\nargs.item.range.bands[game.i18n.localize(\"Long Range\")].modifier = 0\nargs.item.range.bands[game.i18n.localize(\"Extreme\")].modifier /= 2\n}","23vWiHUjxtRQ3Efz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.eWPN3CV2Eddwz8aM\")\nlet data = item.toObject();\ndata.system.location.value = \"Dos\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","2AOo7KUyzMrgIlgM":"game.wfrp4e.utility.postCorruptionTest(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}})","2AdSBXw7IwCiqawQ":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","2Cw5j0iGAnFNegWr":"return args.item?.system.attackType\n","2GYAd4OC888oQFBp":"return ![\"fel\"].includes(args.characteristic)","2NLINicPQWbuvp2n":"return args.item?.name != game.i18n.localize(\"NAME.Navigation\")","2OqLHRqEBEjBm2LW":"args.fields.slBonus += this.actor.system.characteristics.wp.bonus","2Qi1hwLYhdE6v6Hs":"if (![\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n\treturn true;\n\nif (args.options.dodge)\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Impossible d'Esquiver!\")\n}\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","2VNnVrtktdGUqXEV":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed && parseInt(args.opposedTest.attackerTest.result.SL) > 0)\n {\n args.actor.addCondition(\"stunned\", parseInt(args.opposedTest.attackerTest.result.SL))\n }\n} ","2W9uMTT6iJhfQ044":"let skill = `Métier (${this.item.parenthesesText})`\nlet currentCareer = this.actor.system.currentCareer;\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\n\nif (!currentCareer) return\n\n\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\nif (existingSkill && inCurrentCareer)\n{\n\texistingSkill.system.advances.costModifier = -5;\n}\nelse \n{\n\tcurrentCareer.system.skills.push(skill);\n}\n\n\n","2WBq5gW780C6zfCp":"if (args.weapon && this.item.system.usesLocation(args.weapon))\n{\n args.bleedingHand = true;\n let success = await this.effect.manualScripts[0].execute({actor: this.actor})\n if (!success)\n {\n args.abort = true;\n }\n}","2WSN306tL4apjRtD":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name = data.name += \" (Ouïe)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2cKarG9ToyW2ptCd":"if (this.item.system.quantity.value)\n{\n\tthis.item.update({\"system.quantity.value\" : this.item.system.quantity.value - 0.25})\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Vide !\", \"error\")\n}","2hzDv8ROulOe1elK":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","2mFNelLOAQ6iJsZl":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[doomrocket-fumble]\")\n}","2miWWeRrEpq1beG4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","2p9IK6Y5Z4NQD6FY":"args.prefillModifiers.difficulty = \"hard\"","2rzxQlL7A9ujZ9uK":"if (args.opposedTest.result.winner == \"attacker\") {\n if (args.opposedTest.defenderTest.weapon && args.opposedTest.defenderTest.item.properties.qualities.shield) {\n ui.notifications.notify(`${this.effect.name}: Gain de ${this.item.Advances} Avantages`)\n this.actor.setAdvantage(this.item.Advances)\n }\n}","2sDH6RvoOAR40oqH":"\n\nif (![\"Goblin\", \"Orc\"].includes(this.actor.system.details.species.value)) {\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { appendTitle: ` - ${this.effect.name}` })\n await test.roll();\n if (test.failed) {\n let infection = await fromUuid(\"Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg\")\n this.actor.createEmbeddedDocuments(\"Item\", [infection])\n }\n}\n\n// Since wounds change when the effect is deleted, need to wait until after \n// the max wounds have been recalculated to apply damage\ngame.wfrp4e.utility.sleep(1000).then(async () => {\n let roll = await new Roll(\"1d10\").roll();\n\n roll.toMessage(this.script.getChatData());\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))\n\n})","2vTVR0quRZQtjNfQ":"let currentCareer = this.actor.system.currentCareer;\nif (!currentCareer)\n{\n return;\n}\n\nlet talents = [\"Aethyric Attunement\",\n\"Arcane Magic (Any)\",\n\"Chaos Magic (Tzeentch)\",\n\"Fast Hands\",\n\"Instinctive Diction\",\n\"Magical Sense\",\n\"Petty Magic\",\n\"Second Sight\",\n\"War Wizard\",\n\"Witch!\"].filter(t => !currentCareer.system.talents.includes(t))\n\ncurrentCareer.system.talents = currentCareer.system.talents.concat(talents)","2wk0yrRPlPsdqr3L":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2yctEihGmdCfTTVx":"args.data.canReverse = true;\nargs.options.fieldDressing = true;","2zeP2nMSURjxrqYz":"let wounds = this.actor.system.status.wounds\nif (wounds.value == 0)\n return this.script.scriptNotification(\"Aucun effet à 0 Blessures\", \"error\")\n\nthis.script.scriptNotification(`Soin de ${this.actor.characteristics.t.bonus} Blessures`)\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus)","33PWizq5F7pkKnQT":"if (args.item.type == \"spell\")\n{\n args.item.cn.value = Math.floor(args.item.cn.value / 2)\n}","33US8YRgaMqYu2We":"return !args.options.handling","37UN17gb8suFeZIW":"this.script.scriptMessage(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))","3Cn2TlRahlm5LkSj":"args.fields.successBonus += 1;","3D5ImpMgpOTPucvv":"if (args.test.options.cardsharp && args.test.succeeded)\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n args.test.result.other.push(`${this.effect.name}: ${ones + args.test.successBonus + args.test.slBonus} DR`)\n}","3IGO7xEjRjat937X":"let fatigue = this.actor.hasCondition(\"fatigued\")\nif (fatigue)\n{\n this.script.scriptNotification(\"Suppression de l'état Fatigué, effet désactivé.\")\n this.effect.update({disabled : true})\n await this.actor.removeCondition(\"fatigued\")\n}","3JEzEzF1SeYA9lsV":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations, this.effect.img), 1, \"Choose Location\");\nif (choice[0])\n{\n this.effect.updateSource({name : `${this.effect.name} (${choice[0].name})`})\nthis.effect.updateSource({\"flags.wfrp4e.location\" : choice[0].id})\n}\n\nlet location = choice[0].id;\n\nif ([\"lArm\", \"rArm\"].includes(location))\n{\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nif (location == \"body\")\n{\n await this.actor.addCondition(\"fatigued\");\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"prone\");\n }\n}\n\nif (location == \"head\")\n{\n await this.actor.addCondition(\"stunned\");\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"unconscious\");\n }\n}","3LLiSgj6KGtgqcmo":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","3R6Y4NpNTqPc83wh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IPKRMGry6WotuS1G\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","3TesBGh8HnlGuafu":"let modifier = this.effect.sourceTest?.result.overcast.usage.other.current || 0\n\nlet test = await this.actor.setupCharacteristic(\"dex\", {fields: {modifier}, skipTargets: true, appendTitle : \" - \" + this.script.label});\n\ntest.roll();","3Vbe6gdW8N0bIvXJ":"if (args.item.type == \"weapon\" || args.item.type == \"trait\")\n{\n args.item.qualities.value.push({name : \"penetrating\"})\n args.item.qualities.value.push({name : \"impale\"})\n}","3aEzK0DehSHtVykd":"this.effect.manualScripts[0].execute({actor : this.actor});","3eSaX0BeaUalNkEP":"return args.options.mutate","3fdCQ3h3iVuhdDs9":"args.fields.slBonus += this.actor.characteristics.ag.bonus;","3hfMQkUKYI4rCuBy":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","3jm0NoYpgB6ZuUSl":"args.options.useOnesAttractive = true;","3l7MQSa10Kve2K3P":"this.script.scriptMessage(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\nthis.actor.addCondition(\"ablaze\");","3plV9WFqs2prfAdp":"return ![\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","3sfD1nedXLzuYoXJ":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => test.roll())\n}\n","3tE8gFSl28EhCmo5":"await args.actor.addCondition(\"ablaze\")\nawait args.actor.addCondition(\"prone\")","454x3Q95pLvZm0Kx":"return args.skill?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\");","4FGKZk2f0xrmIDnp":"return args.skill?.name != game.i18n.localize(\"NAME.Research\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\"));","4HN98hMdQJxM35pA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.gz2xy41OSVZ8YBgI\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n","4JVIy5xtVwvadoqv":"this.actor.details.move.run *= 2","4MQ7u4INxp51oyyR":"let characteristics = {\n \"ws\" : 25,\n \"bs\" : 10,\n \"s\" : 15,\n \"t\" : 15,\n \"i\" : 25,\n \"ag\" : 20,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 25,\n \"fel\" : 10\n}\n//let skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skills = [\"Calme\", \"Equive\", \"Intimidation\", \"Intuition\", \"Commandement\", \"Savoir (Guerre)\", \"Perception\"]\n\nlet skillAdvancements = [15, 15, 15, 15, 15, 10, 10]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Inspiring\", \"Resolute\", \"War Leader\"]\n\nlet trappings = [\"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","4QoxhoekgVeZcQA7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","4XrAeL2DitxE8OaK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.0hn6UaKq8CoZP2zD\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","4cOZzUvu1nytcqNn":"args.initiative = \"-10\"","4fnTKgl0HW9ZrWyJ":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n let char = Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"s\" : \"t\";\n this.script.scriptMessage(`${this.actor.name} perd 1 point de ${game.wfrp4e.config.characteristics[char]}`)\n this.actor.update({[`system.characteristics.${char}.initial`] : this.actor.system.characteristics[char].initial - 1})\n }\n})","4gkz3LR7CK1b8ulK":"return args.item?.system.attackType != \"ranged\" || this.actor.uuid != this.effect.sourceActor.uuid","4iuTz0uInAfMaoGl":"return args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) || args.type == \"cast\"","4pQW4WLyhjbZR85k":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gain d'un Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","4rTmV3TNxctUe0ly":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"bleeding\");\n}\n","4rb7LfMq9CTnlrpn":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\n await test.roll();\n if (test.failed)\n {\n args.totalWoundLoss += 5;\n args.modifiers.other.push({label : this.effect.name, value : 5})\n }\n}","4rhxLzau7jZ4SDxg":"await args.actor.addCondition(\"grappling\")\nawait args.actor.addCondition(\"entangled\")","52kbfuWrOh6dsTtd":"if (!this.actor.hasCondition(\"blinded\"))\n\tthis.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.flockOfDoom\" : true})","52mwb33mGrQjq89B":"return args.skill?.name != game.i18n.localize(\"NAME.Research\");","53HFDNuMnX1Aw1a4":"return [\"ws\", \"bs\", \"s\", \"ag\", \"dex\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","58rFc9HiBoX66J6p":"let sourceActor = this.effect.sourceActor;\nlet damage = args.totalWoundLoss;\nlet tb = sourceActor.system.characteristics.t.bonus\nargs.abort = `${this.effect.name}: Dommages appliqués à ${sourceActor.name}`;\n\nlet message = await sourceActor.applyBasicDamage(damage - tb, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true})\n\nthis.script.scriptMessage(message.replace(`${tb} TB`, `${tb} × 2 TB`))\nargs.abort = true;","5DI6cHAg1LHo54Yv":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.actor.update({\"system.status.fortune.value\" : Math.max(0, (this.actor.system.status.fortune?.value - 1) || 0)})\n this.script.scriptMessage(`1 Point de Fortune volé à ${this.actor.name}`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","5Fe1ELaS6Gnvy0Cj":"return args.skill?.name.includes(\"Focalisation\") || args.type == \"channelling\" || args.skill?.name == game.i18n.localize(\"NAME.Charm\") || args.skill?.name.includes(\"Langue (Magick)\") || args.type == \"cast\"","5IoYTyedCMYwt3ys":"args.fields.slBonus += 2;","5JWC0l3JEpOsqbR9":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 0\n}\nlet skills = [\"Esquive\", \"Perception\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Flee!\", \"Marksman\"]\nlet trappings = [\"Hand Weapon\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5JvKJZPcd6Hz5zvn":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 20,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 15,\n \"fel\" : 0\n}\n//let skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Leadership\"]\nlet skills = [\"Calme\", \"Esquive\", \"Intimidation\", \"Commandement\"]\nlet skillAdvancements = [15, 15, 10, 5]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Resolute\"]\nlet trappings = [\"Mail Coat\", \"Mail Chausses\", \"Mail Coif\", \"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = this.effect.name + \" \" + updateObj.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5LdJCKfQem1AQK24":"\nif (!args.flags.howlingWarpGale)\n{\n args.fields.modifier -= 10;\n args.flags.howlingWarpGale = true; // prevent double application\n}","5M6IgCUncCwyxHok":"let etiquette = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\")).toObject();\netiquette.name += ` (Suivants de Tzeentch)`;\n\nlet animosity = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f\")).toObject();\nanimosity.system.specification.value = \"Suivants de Nurgle\";\n\nlet roll = await new Roll(\"ceil(1d10 / 3)\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nlet mutations = [];\nlet msg = `

Mutations acquises

`\nfor(let i = 0; i < roll.total; i++)\n{\n let item;\n let uuid;\n let result;\n if (i % 2 == 0)\n {\n result = await game.wfrp4e.tables.rollTable(\"mutatemental\", {hideDSN: true}, \"Tzeentch\")\n }\n else \n {\n result = await game.wfrp4e.tables.rollTable(\"mutatephys\", {hideDSN: true}, \"Tzeentch\")\n }\n uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\n item = await fromUuid(uuid);\n if (item)\n {\n msg += `

@UUID[${uuid}]{${item.name}}

`\n mutations.push(item.toObject());\n }\n}\nthis.actor.createEmbeddedDocuments(\"Item\", mutations.concat([etiquette, animosity]), {fromEffect : this.effect.id})\nthis.script.scriptMessage(msg);","5MxRDXzUBPfp2KKD":"args.options.useOnesSupportive = true;","5dR7Erj3nwsxLAV7":"let characteristics = {\n \"ws\" : 35,\n \"bs\" : 10,\n \"s\" : 25,\n \"t\" : 30,\n \"i\" : 30,\n \"ag\" : 25,\n \"dex\" : 0,\n \"int\" : 15,\n \"wp\" : 35,\n \"fel\" : 15\n}\nlet skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skillAdvancements = [25, 15, 25, 25, 30, 20, 20]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Inspiring\", \"Luck\", \"Resolute\", \"Unshakable\", \"War Leader\"]\nlet trappings = [\"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5lc1eHIYQNpSRWip":"if ([\"death\", \"necromancy\"].includes(args.spell?.system.lore.value))\n{\n args.fields.successBonus += 1\n}\nelse if([\"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value))\n{\n args.fields.modifier -= 10;\n}","5o1XiceC4rutjMms":"return !args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","5sI9iYh5j2nx2XyT":"return !([\"Soin aux animaux\", \"Emprise sur les animaux\"].includes(args.item?.name) || args.item?.name.includes(\"Chevaucher\") || args.item?.name.includes(\"Dressage\"))","62Ky6bC1EnTllSJA":"if (this.effect.sourceActor.uuid != args.actor.uuid)\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.overcast.usage.other.current, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}));\n}","65o8pQj6oGNnXce6":"let ch = this.effect.getFlag(\"wfrp4e\", \"characteristic\")\nthis.actor.system.characteristics[ch].modifier += 10;","65xE9OV5sA1ZWT7j":"if (args.test.options.diceman && args.test.succeeded)\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n args.test.result.other.push(`${this.effect.name}: ${ones + args.test.successBonus + args.test.slBonus} DR`)\n}","6Aqq4F4Xui923sc6":"// Imbibing this substance grants the user the Painless Creature Trait.\nconst hasColdBlooded = this.actor.has(\"A Sang Froid\")\nif (hasColdBlooded === undefined) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.mCh1KK9jomwFZcLB\")\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n this.script.scriptMessage(`

${this.actor.prototypeToken.name} reçoit le Trait de Créatuer A Sang Froid et peut inverser n'importe quel test de Force Mentale échoué.

\n

Si il reçoit un état Surpris, cet état n'est pas perdu la première fois (typiquement à la fin du Round ou si il est attaqué).

`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}","6BmvV9c03FkfisnE":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte le ${this.item.name}.
\n Il gagne +1 Point de Corruption point si un Test de Corruption est échoué, à appliquer manuellement.
Si le personnage porte le masque pendant plus d'une heure ou utilise les effets du masque, il est exposé à une @Corruption[moderate]{Corruption Modérée} \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Utilisé)\"})\n this.script.scriptMessage(`${this.item.name} de ${this.actor.name} a été enlevé et a perdu ses propriétés. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils devront être manuellement supprimés.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}","6EXkbVTRBhKTEu81":"if (!args.flags.bothEyes)\n{\n\targs.flags.bothEyes = true;\n\targs.fields.modifier -= 30\n}","6Fe8M5MdklKS2olx":"return args.characteristic != \"fel\"","6H6vNjzvMGl2ZqCR":"if (args.totalWoundLoss > 0)\n this.script.scriptMessage(`Lame de Nurglitch: ${args.actor.name} doit réussir un Test d'Endurance Difficile (-10) ou recevoir une @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Blessure Purulente}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","6JrUjs3g5x6bFnj3":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet sense = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet biteData = bite.toObject();\nlet senseData = sense.toObject();\n\nbiteData.system.specification.value = 6 - this.actor.characteristics.s.bonus;\nsenseData.name = senseData.name += \" (Odorat)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, senseData], {fromEffect : this.effect.id})","6MSodMuZ5xk2JJJ9":"if (!this.actor.hasCondition(\"ablaze\"))\n{\n this.effect.delete();\n}","6Mjy0jDqczA8BxhS":"return ![\"roll\", \"none\"].includes(args.fields.hitLocation)","6QZUX7ZrFxOzqI0b":"let regenerate = this.actor.items.getName('Régénération')\n\nif (regenerate)\n{\n let effect = regenerate.effects.contents[0]\n let scriptData = effect.getFlag(\"wfrp4e\", \"scriptData\");\n \n scriptData[0].script = scriptData[0].script.replace(\"1d10\", \"1d10 * 2\")\n}","6U8xox4mBrn5eYIp":"if (args.totalWoundLoss > 0)\n args.actor.addCondition(\"ablaze\")","6V3qHON3mcerlBlB":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","6XWJWOUQPgKMsFul":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale","6ZS1rQLkNvMDO0Fp":"let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\nif (args.test.isFumble && roll == 1 && !args.test.result.misfire)\n{\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Résultat 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n}\nelse if (args.test.isFumble && roll != 1)\n{\n args.test.result.other.push(\"Résultat du Raté: \" + roll)\n}\n\n","6elUNF58TaiYjxcx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gained a Stunned Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","6fElmBxTjdAaubbK":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}\n","6hAgggYpNR3r4QWC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Q2MCUrG2HppMcvN0\")\nitem = item.toObject()\nlet species = args.actor.Species || \" de votre espèce\"\nitem.name = `Animosité (tous sauf ${species})`\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","6jcTzK1XEuWqAacN":"args.abort = true;\nthis.script.scriptNotification(`Impossible d'utiliser ${game.wfrp4e.config.locations[this.effect.getFlag(\"wfrp4e\", \"location\")]}!`, \"error\")","6kifXp2jXEaQVJsg":"let useWard = await Dialog.wait({\n\ttitle : this.effect.name,\n\tcontent : `

Utiliser Ward fourni par ${this.effect.name}?`,\n\tbuttons : {\n\t\tyes : {\n\t\t\tlabel : \"Yes\",\n\t\t\tcallback: () => {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\t\tno : {\n\t\t\tlabel: \"No\",\n\t\t\tcallback: () => {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n})\n\nif (useWard)\n\targs.ward = 9;","6mpw9cGseG4W4eyd":"if (this.actor.system.status.advantage.value >= 2)\n{\n await this.actor.modifyAdvantage(-2);\n this.script.scriptNotification(\"Avvantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","6qUKKep5vhFYmo1J":"return args.type == \"channelling\" || args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","6tjn0RH4VyOPFneS":"return [\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","6uldpFvKOCoW92cC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\nitem = item.toObject()\n\nitem.system.specification.value = 10;\nitem.name += \" (Feu)\"\nsetProperty(item, \"flags.wfrp4e.breath\", \"fire\")\n\nItem.create(item, {parent : this.actor, fromEffect: this.effect.id})","6xTtJEhRc4OjcDTf":"if (getProperty(args.data, \"system.status.fortune.value\"))\n{\n\tthis.script.scriptNotification(\"Impossible de mettre à jour la Fortune\");\n\tdelete args.data.system.status.wounds.value;\n}","715G1Bf0haOHvmYQ":"return !(args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")))","71DmrxCTKGYL4Z7X":"return [\"fel\"].includes(args.characteristic)","7Ck0fkzE4WQ62qVe":"if (args.item.type == \"skill\" && args.item.name == \"Corps à corps (Base)\")\n{\n args.item.system.modifier.value += 20;\n}","7F3miqRA0ceMUBIu":"return args.characteristic != \"int\" || args.skill","7F6aGxZJjwxm5e5P":"if (args.test.result.castOutcome == \"failure\")\n{\n ValueDialog.create(\"Sasir le nombre de Blessures perdues en échange de DR\", this.effect.name, \"0\").then(async value => {\n value = Math.clamped(value, 0, 3)\n if (value == 0)\n {\n return; \n }\n else if (Number.isNumeric(value))\n {\n this.script.scriptNotification(`Perte de ${value} Blessures`)\n this.actor.modifyWounds(-1 * value)\n await this.item.system.toggleEquip();\n args.test.addSL(value);\n args.test.preData.other.push(`${this.effect.name}: +${value} DR`)\n }\n })\n}","7H6wYyJ6cpaoc2QQ":"return args.skill?.name == game.i18n.localize(\"NAME.Cool\");","7JW9t8AYSDkkzG2V":"// Apply changes when the mask is worn\n\nif (args.equipped) \n{ \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte le ${this.item.name}.
\n Si le personnage porte le masque pendant plus d'une heure ou bénéficie de ses effets, il s'espose à une @Corruption[moderate]{Corruption Modérée}. \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Utilisé)\"})\n this.script.scriptMessage(`${this.item.name} porté par ${this.actor.name} a été enlevé et a perdu ses capacités. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils doivent être retirés manuellement.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}","7OmrMjaU48o2FEZi":"\nthis.actor.characteristics.t.bonus = 10\n\nthis.actor.details.move.value = 0;\nthis.actor.details.move.walk= 0;\nthis.actor.details.move.run = 0;","7ScfB4o1QhXnNUfq":"return ![\"int\", \"wp\"].includes(args.characteristic)","7VAhXHov6pR1SkgD":"return args.item?.name == game.i18n.localize(\"NAME.Endurance\");","7WR2hJjHPhHhHxAq":"let poisoned = args.actor.hasCondition(\"poisoned\")\nif (poisoned)\n{\n this.script.scriptNotification(`Suppression de ${poisoned.conditionValue} états Empoisonné`)\n poisoned.delete(); \n}\nelse\n this.script.scriptNotification(`Aucun état Empoisonné`)","7ZoFUMDG2WJd8RMg":"this.script.scriptMessage(`Revendiquer le Bonus de ${this.effect.name} `);","7e8FgQUF2oANANmx":"return args.skill?.name == \"Corps à corps (Bagarre)\" || args.item?.weaponGroup?.value == \"brawling\"","7f6OsttTzE7Hvzfk":"if (this.actor.statuses.has(\"infighting\")) // Only add +10 if already infighting\n args.prefillModifiers.modifier += 10; \n\n\nargs.prefillModifiers.successBonus += 1; \n","7n3SEAGRA5ESK8gV":"args.options.disarm = true;","7szLG4VALuuy1cPm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}})\nawait test.roll();\nif (test.failed)\n{ \n await this.actor.addCondition(\"fatigued\")\n} ","7wBWUw05q0igh508":"// Imbibing this substance grants the user the Painless Creature Trait.\nconst hasPainless = this.actor.has(\"Insensible à la douleur\");\nif (hasPainless === undefined) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\");\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n this.script.scriptMessage(\n `

${this.actor.prototypeToken.name} gagne le Trait de Creature Insensible à la Douleur. Cet effet dure 1 heure, après quoi il disparait et le total des Blessures encaissés par le buveur sont encaissés d'un coup.

\n

Notez que cela n'empêche pas le buveur de recevoir une Blessure Critique ou de mourrir. Cela permet par contre d'éviter la majorité de leur effets.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true})\n}","84IB8CWa55XzoAkv":"return ([\"Soin aux animaux\", \"Emprise sur les animaux\"].includes(args.item?.name) || args.item?.name.includes(\"Chevaucher\") || args.item?.name.includes(\"Dressage\"))","87rrZ3ojHrXa3lCn":"this.actor.modifyWounds(1)","8AoA4bnstBtglRGZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8ByuHnUZ4RNTdGVv":"let strLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\nlet tghLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n\nif (!this.actor.has(\"Mort-vivant\") && !this.actor.has(\"Démoniaque\")) \n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), { appendTitle: \" - \" + this.effect.name, fields: { difficulty: \"average\" }, context: { failure: `Pert de ${strLoss} en Force et ${tghLoss} en Endurance` } }).then(async test => {\n await test.roll();\n if (test.failed) {\n this.actor.update({ \"system.characteristics.s.initial\": this.actor.system.characteristics.s.initial - strLoss, \"system.characteristics.t.initial\": this.actor.system.characteristics.t.initial - tghLoss })\n }\n })\n\n}\nelse {\n this.script.scriptNotification(`${this.actor.name} est immunisé à ${this.effect.name}`)\n}\n","8GyJgdHVBaLrHCY8":"let type = this.item.getFlag(\"wfrp4e\", \"breath\")\nlet types = {\n none : \"Aucun\",\n cold : \"Froid\",\n corrosion : \"Corrosion\",\n fire : \"Feu\",\n electricity : \"Electricité\",\n poison : \"Poison\",\n smoke : \"Fumée\",\n various : \"Divers\"\n}\nif (!type)\n{\n type = (await ItemDialog.create(ItemDialog.objectToArray(types, this.item.img), 1, \"Choisir le Souffle\"))[0]?.id;\n this.item.updateSource({\"flags.wfrp4e.breath\" : type})\n}\n\nif (!this.item.name.includes(\"(\") && types[type] && type != \"none\")\n{\n this.item.updateSource({name : this.item.name += ` (${types[type]})`, \"system.specification.value\" : this.item.system.specification.value.replace(\"(Type)\", \"\").trim()})\n}","8K9tpCwvFC9INk5V":"if ([\"t\", \"wp\"].includes(args.characteristic))\n{\n\targs.fields.modifier += 10;\n}\nelse if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\n{\n\targs.fields.modifier -= 10;\n}","8LmUVQxOwTLSeabg":"return args.data.targets.length > 0 || !args.weapon?.system.qualities.value.find(i => i.name == \"shield\") // Should count even if they don't have the skill","8N3Uqjq1ZxPxo4pk":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Lore\"))","8RNziYGGb4sp3BGQ":"if (!args.test.weapon?.name.includes(\"Drakefire\"))\n{\n args.test.result.misfire = game.i18n.localize(\"Misfire\");\n args.test.result.misfireDamage = (0, eval)(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.weapon.system.Damage);\n}","8ShLVT0bK1eQpinj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","8TRiAJ8thIKE4IoL":"\nlet SL = Number(getProperty(this.item, \"flags.wfrp4e.sourceTest.result.SL\") || 1)\n\nargs.actor.characteristics.i.modifier += 10 * SL\nargs.actor.characteristics.ag.modifier += 10 * SL","8ThudCYRqkjQIwJH":"if (args.opposedTest.attackerTest.result.critical)\n{\n args.actor.addCondition(\"ablaze\")\n}","8WJsecxdndaHRxxS":"this.actor.status.addArmour(this.actor.characteristics.wp.bonus, {source: this.effect, magical : true})","8WeYU5e5LN9UeWFs":"if (args.item.type == \"spell\")\n{\n let range = parseInt(args.item.Range)\n if (Number.isNumeric(range))\n {\n args.item.system.range.value = \"2 * \" + args.item.system.range.value\n }\n}","8ZAUBSH9CM9OTpTL":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}});\nawait test.roll();\n\nif (test.succeeded)\n{\n this.actor.addCondition(\"stunned\") \n}\nelse if (test.failed)\n{\n this.actor.addCondition(\"poisoned\", 2);\n}","8araLuwmBq8GKEw3":"let APIgnored = args.AP.layers.reduce((prev, current) => prev + ((current.weakpoints && !current.ignored) ? current.value : 0), 0)\n\nif (APIgnored)\n{\n args.modifiers.ap.ignored += APIgnored\n args.modifiers.ap.details.push(`${this.effect.name}: Ignorer les PA avec des Points Faibles (${APIgnored})`)\n}","8fefDfiYKFOWdPER":"args.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}});","8g2iitsgaJarKQpr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","8gCja0mfKt4nYVZc":"args.fields.slBonus += 2 ","8hIyWDyfbgGAig65":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"dex\"].includes(args.characteristic)","8jvEVPUCg3rKG48Y":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9fq6p9Q6H02LjaSi\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8noxHUQKR55Kx1YN":"this.actor.system.status.corruption.max += 1","8oE0DTzz0krOfFlV":"args.item.system.qualities.value.push({name : \"magical\"})\nargs.item.system.qualities.value.push({name : \"impact\"})\n","8rq4GL5d5nCn4kO7":"let caster = this.effect.sourceActor\nif (caster)\n{\n let healed= caster.characteristics.wp.bonus\n this.actor.modifyWounds(healed);\n this.script.scriptMessage(`${this.actor.prototypeToken.name} regagne ${healed} Blessures`)\n}","8tyMXDfHR8AJBdDu":"let weakpointsAP = args.AP.layers.filter(i => !i.ignored && i.weakpoints).reduce((ap, layer) => ap + layer.value, 0);\n\nif (weakpointsAP > 0)\n{\n args.modifiers.ap.ignored += weakpointsAP;\n args.modifiers.ap.details.push(`${this.effect.name} - Ignore les Points Faibles (${weakpointsAP})`);\n}","8vpAtJ93GIeye1qj":"return args.type == \"cast\"","8wG9l4T9fc1bM0TN":"let item = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.kJNAY1YRaCy9IgmT\")).toObject();\nitem.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","8yBr6VbdKcrWUuqw":"this.actor.characteristics.i.value= \"-\"\nthis.actor.characteristics.int.value= \"-\"\nthis.actor.characteristics.wp.value= \"-\"\nthis.actor.characteristics.fel.value = \"-\"","8zTkDVziBPaNbMQX":"let filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 6, \"Choisir 6 sorts de Magie Mineure\")\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"\"\n }\n]\n\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 9, \"Choisir 9 Sorts d'Arcane\")\n\nlet items = petty.concat(arcane).map(i => i.toObject())\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","91S2GnBFYFbxmOCK":"this.actor.characteristics.s.bonus += 1\nthis.actor.characteristics.s.calculationBonusModifier -= 1","93K85NnVwjVNXlZq":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Trade\"));","956dUb5sd6OtbWZR":"args.fields.successBonus++;","96Y1yIH1lRjTs5hL":"if (args.test.succeeded)\n return\n\nif (args.test.characteristicKey == \"wp\")\n this.actor.addCondition(\"broken\")","98nKfcimlaPeM9h5":"await this.actor.addCondition(\"bleeding\")\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(10, {suppressMsg : true}));","9A7rYY3FKi5XLihG":"fromUuid(\"Compendium.wfrp4e-core.items.5QcrpLQWWrsbKR79\").then(item => {\n let data = item.toObject();\n data.system.tests.value = data.system.tests.value.replace(\"coins\", \"metal objects\");\n data.system.description.value += \"

Ce Talent s'applique également à tout objet métallique à cause de l'Affinité Metallique

\"\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n})","9EVj4bmZJex45Mt7":"return args.skill?.name != game.i18n.localize(\"NAME.Athletics\");","9JnPK1jNUEso7Pv8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name += ` (Odorat)`\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9MDi3ok9gPwtbALf":"args.actor.details.move.value /= 2","9MwRUzRinhq1IjhG":"args.actor.addCondition(\"grappling\");","9RFoasDcFnYZ1txR":"return args.skill?.name == game.i18n.localize(\"NAME.Perception\");","9VfeubiCV83LN9iY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.name += ` (Si Charge)`\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9WZa63lr0K3SsP4G":"let sourceItem = this.effect.sourceItem;\n\nif (sourceItem)\n{\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[2].uuid]})\n\tthis.script.scriptNotification(\"Applique après les effets\");\n}","9Yn9uViEjcuaESJ2":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\n{\n this.item.name += \" (Aucun PA)\"\n this.item.system.AP = {\n \"head\": 0,\n \"lArm\": 0,\n \"rArm\": 0,\n \"lLeg\": 0,\n \"rLeg\": 0,\n \"body\": 0\n }\n}","9ZFPDCk8M2TQxh7x":"args.fields.modifier += 20\n","9bJGJrLqslV5lBya":" return args.characteristic == \"bs\"","9eWR4mdaoCSQawDT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","9fK07tqqZyPg7dpx":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"veasy\"}})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptNotification(\"Subi une Blessure Purulente\")\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()])\n}\nelse \n{\n this.script.scriptNotification(\"Evite une Blessure Purulente\")\n}\n","9nroaZDkW3WXNkB7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.4MJJCiOKPkBByYwW\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","9ob2lPnk3PDot9Tx":"this.actor.addCondition(\"blinded\", this.effect.sourceTest.result.SL)","9qWUuEF8F5nehF1y":"args.item.system.qualities.value = args.item.system.qualities.value.concat([{name : \"magical\"}, {name : \"unbreakable\"}])\nargs.item.system.damage.value += ` + ${this.effect.sourceActor.system.characteristics.wp.bonus}`","A0OK0qAMmnf8iNJf":"if (args.test.result.SL < 0)\n{\n this.script.scriptMessage(`Reçoit ${Math.abs(args.test.result.SL)} Points de Corruption`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n if (args.test.failed && this.actor.type == \"character\")\n {\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + Math.abs(args.test.result.SL)})\n }\n}","A1odAcuRbq9797ZB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Base)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Armes d'hast)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choix\",\n content : \n `

\n Choisissez une option\n

\n
    \n
  1. Corps à corps (Base)
  2. \n
  3. Corps à corps (Armes d'hast)
  4. \n
\n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"Armes d'hast\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","A3MW0UksYrHGa0Qw":"return [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic);","A3fvV69RS1lYgma0":"if (this.actor.type == \"character\") \n this.actor.corruptionDialog(\"minor\")\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif(test.failed)\n{\n await this.actor.addCondition(\"unconscious\");\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\n await secondTest.roll();\n if(secondTest.failed)\n {\n await this.actor.addCondition(\"fatigued\");\n }\n}","A6DcKPzAGntzSCil":"let roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","ACgKpKrEEHoNGG0h":"return !args.skill?.name.includes(\"Focalisation\") && args.type != \"channelling\"","ACtDCTLZXmd5uXjX":"let halve;\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\n{\n halve = await Dialog.confirm({title : this.effect.name, content : \"Diviser les dommages? (Divise par 2 tout les dommages autre que ceux causés par le feu, le froid et magiques)\"})\n}\nelse\n{\n halve = false;\n}\n\nif (halve)\n{\n args.totalWoundLoss /= 2;\n args.modifiers.other.push({label : this.effect.name, details : \"Divisé par 2\", value : \"× 0.5\"})\n}","AGD7zCyV4zruvnWu":"return args.type != \"cast\" || ![\"mort\", \"nécromancie\", \"vie\", \"lumière\", \"cieux\"].includes(args.spell?.system.lore.value)","AHZ8f7dfN8jNsYk6":"let token = this.actor.getActiveTokens()[0];\nlet target = args.data.targets[0];\nlet weapon = args.weapon;\n\nif(!target || !token)\n{\n return;\n}\n\nlet distance = canvas.grid.measureDistances([{ ray: new Ray({ x: token.center.x, y: token.center.y }, { x: target.center.x, y: target.center.y }) }], { gridSpaces: true })[0]\nlet currentBand\n\nfor (let band in weapon.range.bands) \n{\n if (distance >= weapon.range.bands[band].range[0] && distance <= weapon.range.bands[band].range[1]) \n {\n currentBand = band;\n break;\n }\n}\n\nreturn [game.i18n.localize(\"Long Range\"), game.i18n.localize(\"Extreme\")].includes(currentBand)","AI6bFrjWk4NH9FBd":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","ALuPRzf85dmkEfLo":"return args.skill?.name == game.i18n.localize(\"NAME.Intuition\");","AMI2wDJqsIZsoq1e":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Émet un nuage de poudre noire nauséabonde. Active l'effet Fellowship Penalty sur @UUID[${this.actor.uuid}].`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","AMxezwtYnWCF6Oza":"return args.skill?.name == \"Projectiles (Poudre noire)\"","AS7CstSosuCrwZ19":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 20,\n \"bright\": 10,\n \"angle\": 360,\n \"alpha\": 0.4,\n \"animation\": {\n \"speed\": 3,\n \"intensity\": 3,\n \"type\": \"torch\",\n },\n \"color\": \"#ffcc66\",\n }}));","AV2Kj6jgmIc45zKi":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","AVROqafFhKjN6TPR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","AWgZnm9xLyIWCDnp":"let robust = args.modifiers.other.find(i => i.key == \"robust\")\nif (robust)\n{\n\trobust.value--;\n}\nelse \n{\n\targs.modifiers.other.push({key: \"robust\", label : this.effect.name, value : -1})\n}\n","AZGXrZOQ4EzjxRL9":"return true;","Adgs6Zs0FdefO6qx":"if (args.test.options.pilot && args.test.result.reversed)\n{\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\n\targs.test.result.other.push(`${this.effect.name}: DR limité à 1`)\n}","Ah2wyywkL8hjJNXM":"args.options.healWounds = true;","AjC4dsiuhVCOnRGI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","AmOMCUaWLJ2iJAt5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IFKWu98qmWpaSfUi\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","AmpDbT0BkDHeaRzf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\");\nlet data = item.toObject();\ndata.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ApaLcUhuty3EzJoP":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\nlet current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses points de Destin augmentés de ${current} à ${fortunePoints + current}`)","AqHLHp4kH6KULk3e":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun disponible!\", \"error\")\n}","AyNb5sj6FD2Z3Q5T":"this.actor.addCondition(\"dead\")\nthis.actor.setWounds(0);\nthis.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"scatter\"))","AyS3iLljxHRKsHg4":"let broken = this.actor.hasCondition(\"broken\");\nlet fatigued = this.actor.hasCondition(\"fatigued\");\nawait broken?.delete();\nawait fatigued?.delete()\nlet drilled = await fromUuid(\"Compendium.wfrp4e-core.items.Item.J9MK0AIaTbvd5oF6\")\nlet fearless = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\nlet stout = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IogM5gnsoOX63w7j\")\nthis.actor.createEmbeddedDocuments(\"Item\", [drilled, fearless, stout], {fromEffect : this.effect.id})","B063u4vrbvzMaCQt":"args.item.system.flaws.value = args.item.system.flaws.value.concat([{name : \"bulky\"}, {name : \"unreliable\"}])","B1xgRS00RcTIZLnO":"return [\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\")","B6ZbY3bxTPg6nCng":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\");","B87v1twc65qyvUWi":"args.fields.modifier += 10 * this.effect.conditionValue","B950b0XnIUYCdVwu":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\n\nif (test.succeeded)\n{\n if (args.totalWoundLoss <= parseInt(test.result.SL))\n {\n args.abort = `${this.effect.name}: Attaque détournée et renvoyée`\n }\n args.modifiers.other.push({label : this.effect.name, value : -1 * parseInt(test.result.SL)})\n}","BAOv7moTxsKlT3JS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"broken\")\n}","BD7bVTU2pVoRSRBe":"let symptoms = {\n convulsions : \"Convulsions\",\n coughsandsneezes : \"Coughs and Sneezes\",\n fever : \"Fever\",\n flux : \"Flux\",\n nausea : \"Nausée\"\n}\n\nlet roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\nroll.toMessage(this.script.getChatData());\n\nlet choices = await ItemDialog.create(ItemDialog.objectToArray(symptoms), roll.total, \"Choisissez les Symptomes\");\n\nif (choices.length)\n{\n let symptomEffects = duplicate(game.wfrp4e.config.symptomEffects)\n let added = []\n for(let choice of choices)\n {\n let symptom = symptomEffects[choice.id];\n symptom.origin = this.effect.uuid;\n added.push(symptom);\n }\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", added)\n}\nelse \n{\n this.effect.delete();\n}\n\n","BHbFqhJPzZI2txLs":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 2\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","BcXTujburrHpjpwa":"args.fields.slBonus -= 3;","Be5rdfnZorbILhpC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 3 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Bexspr5viPhHiFmU":"let fatigued = this.actor.hasCondition(\"fatigued\");\nlet value = fatigued?.conditionValue || 0;\nargs.fields.modifier += value * 10;","Bj6bxItlgtI2sXVN":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nargs.totalWoundLoss = Math.max(0, args.totalWoundLoss - roll.total)\nargs.modifiers.other.push({label: this.effect.name, value : -1 * roll.total})\nthis.effect.update({disabled : true})","BtyFhdGMKiMamGhM":"let test = await args.actor.setupSkill(\"Esquive\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nlet damage = parseInt(this.effect.sourceTest.result.SL)\n\nif (test.succeded)\n{\n damage = damage + 8 - parseInt(test.result.SL)\n}\n\nelse \n{\n damage = damage + 10\n this.actor.addCondition(\"entangled\", 3)\n}\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", suppressMsg: true}))\n","Bv3431tnG3VKaTJr":"if (args.test.result.castOutcome == \"success\")\n{\n args.test.result.other.push(`@Fear[2,${this.actor.name}]`);\n}","ByhEa1BxQOyrOmqg":"return args.item?.attackType == 'melee'","BzDLuxBNw1QNIacg":"if (args.item.type == \"skill\")\n args.item.system.advances.value = 0\n\nif (args.item.type == \"talent\")\n args.item.system.tests.value = \"\"\n\nif (args.item.type == \"weapon\") \n args.item.system.qualities.value = []","CCK1iIfPmB398ziT":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {fields : {difficulty : \"difficult\"}, skipTargets: true, appendTitle : \" - Walking\"})\ntest.roll();","CCwuu3bPLCpVGAmb":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n\n","CDASLC4fWKSGQKf9":"let blinded = this.actor.hasCondition(\"blinded\");\nif (blinded?.getFlag(\"wfrp4e\", \"flockOfDoom\"))\n{\n blinded.delete();\n}","CHnaBPHk6HdFS512":"let arm = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\");\nlet leg = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\");\n\nlet choice = await ItemDialog.create([arm, leg], 1, \"Choisir le Membre\")\n\nthis.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})","CIxZYkHggBQ6EsHP":"this.script.scriptNotification(\"Effet utilisé\");\nthis.effect.delete();","CM43kvw5mIIE1OsB":"let key = this.item.system.location.key\n\nlet lostFingers = this.actor.flags.useless[key] || 0;\n\nlostFingers += 1\n\nthis.actor.flags.useless[key] = lostFingers;\n\nif (lostFingers >= 4)\n{\n\tthis.actor.flags.useless[key[0] + \"Arm\"] = true;\n}","CMUFtmNA1kkD1ay7":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 30,\n \"bright\": 20,\n \"angle\": 90,\n \"alpha\": 0.6,\n \"animation\": {\n \"speed\": 3,\n \"intensity\": 3,\n \"type\": \"torch\",\n },\n \"color\": \"#ffcc66\",\n }}));","CPQoK7NjzOwVTFXS":"for(let effect of this.actor.effects.filter(e => e.isCondition))\n{\n if (effect.isCondition)\n {\n effect.delete();\n }\n}","CW5Vlr57OaMkKJ8Q":"if (this.actor.system.status.advantage.value >= 3)\n{\n this.actor.modifyAdvantage(-3);\n this.script.scriptNotification(\"Avantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","CWNGrg7se91RC95g":"if (args.totalWoundLoss > 0) {\n args.opposedTest.result.other.push(\n `@Corruption[minor]{Exposition Mineure à la Corruption}`\n )\n this.script.scriptMessage(`${this.effect.name}: \n @Corruption[moderate]{Exposition Modérée à la Corruption}
\n ${args.actor.prototypeToken.name} doit réussir un \n Test de Corruption (Modéré)`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n}","Ca1fXHTA1e2QLx0D":"args.fields.modifier += 50;","CiFeduksZJ6PRulx":"return args.skill?.name == \"Chevaucher (Cheval)\" || (args.options.dodge && this.actor.isMounted);","Cjj4iLkdY1NaZRCi":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Projectiles\")))\n{\n let choice = await Dialog.wait({\n title: this.effect.name,\n content: `

Appliquer les dommages de ${this.effect.name} à l'attquant?`,\n buttons: {\n yes: {\n label: \"Oui\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"Non\",\n callback: () => {\n return false;\n }\n }\n }\n })\n\n if (choice)\n {\n this.script.scriptMessage(await args.attacker.applyBasicDamage(this.actor.system.characteristics.wp.bonus, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}));\n }\n}","CkE8NZOhzPkuRrKJ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n\n\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tthis.actor.addCondition(\"unconscious\")\n}","CoImIH9OCMx9DfQZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nbhn2wX35b7Jrcbg\")\nlet data = item.toObject();\ndata.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","D5XmzrUGFa1JN0cl":"args.prefillModifiers.modifier += 10\n\n","DANLE5HxrkTNelhl":"args.wounds += 4;","DBafsY1HrclJRTtA":"return args.type != \"cast\"","DHxUKY9LMyifFgCi":"return args.skill?.name == \"Métier (Apothicaire)\" || args.skill?.name == \"Métier (Alchimiste)\"","DL9vYNft9aXdV2aW":"let tooth = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\ntooth = tooth.toObject()\ntooth.system.specification.value = 3\ntooth.system.qualities.value = [{name : \"magical\"}]\n \nlet claw = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nclaw = claw.toObject()\nclaw.system.specification.value = 4\nclaw.system.qualities.value = [{name : \"magical\"}]\nclaw.name = \"Claw\"\n\nthis.actor.createEmbeddedDocuments(\"Item\", [tooth, claw], {fromEffect : this.effect.id})","DMQ0taEpBUJU5njV":"args.actor.status.fortune.value = 0","DTiHS6RfwhF4THbf":"return args.skill?.name != game.i18n.localize(\"NAME.Drive\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Ride\"));","DVlZGbiuMIHEQOnM":"if (this.actor.getFlag(\"wfrp4e\", \"isAttached\")) \n{\n\tlet roll = await new Roll(\"1d10\").roll()\n\tawait roll.toMessage(this.script.getChatData());\n\tif (roll.total == 9 || roll.total == 10)\n\t{\n\t this.script.scriptMessage(`${this.actor.name} attaché à ${this.actor.getFlag(\"wfrp4e\", \"isAttached\")} tombe.`)\n\t await this.actor.unsetFlag(\"wfrp4e\", \"isAttached\") \n\t}\n }","DWBxvzfWGcG7PVNP":"let letter = this.item.system.location.key[0]; // \"l\" or \"r\";\n\nthis.item.updateSource({\"system.location.key\" : letter + \"Doigt\"})\n\n// We want the location to be Right or Left Hand, but the key to be rFinger or lFinger","DcSJNRBXE9ZBBY7T":"this.actor.addCondition(\"blinded\", Math.max(0, this.effect.sourceTest.result.SL))","DhZqJso1JWYtGrKk":"this.actor.addCondition(\"ablaze\")\nlet damage = this.effect.sourceTest.result.damage + this.effect.sourceTest.result.additionalDamage\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))","DmbWR9s5I8LHBwxB":"let column = await ValueDialog.create(\"Selectionnez la colonne pour déterminer la Tête de Bête\", \"Sélectionner la colonne\", \"\", [\"Undivided\", \"Khorne\", \"Nurgle\", \"Slaanesh\", \"Tzeentch\"]);\n\nif (column)\n{\n let result = await game.wfrp4e.tables.rollTable(\"beasthead\", {}, column);\n this.script.scriptMessage(`${result.title}
${result.result}`);\n let uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\n let item = await fromUuid(uuid);\n if (item)\n {\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n this.item.delete();\n }\n}","DpdSEHM6NMN1ey6h":"if (parseInt(this.item.system.specification.value) > 0)\n{\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\n}","DqJFo74trI916qXN":"let fatigued = args.actor.hasCondition(\"fatigued\")\nif (fatigued)\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","DsE6rTSzxEn6uWMz":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\nawait test.roll();\nif (test.failed)\n{ \n await this.actor.addCondition(\"blinded\");\n await this.actor.addCondition(\"fatigued\")\n} ","DuM5l2Yb4bdvDeaG":"return args.skill?.name != \"Athlétisme\"","DxQnamsb2AuW0p2e":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","DyZ1jH88EAp1ueOK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\ndata.system.location.value = data.system.location.value.replace(\"Arm\", \"Wrist\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","E1Xo4RVuN1YRRxg7":"return args.item?.attackType != \"ranged\"","E1vUepgop09FF5wy":"if (this.actor.system.status.advantage.value == 0)\n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet hatred = await fromUuid(\"Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0\")\nlet frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\n\nif (this.actor.system.status.advantage.value >= 3)\n{\n this.script.scriptNotification(`Ajout de ${frenzy.name}`)\n this.actor.setAdvantage(0)\n this.actor.createEmbeddedDocuments(\"Item\", [frenzy])\n}\nelse if (this.actor.system.status.advantage.value >= 1)\n{\n let data = hatred.toObject();\n data.system.specification.value = \"Combatants au corps à corps\"\n this.script.scriptNotification(`Ajout de ${hatred.name}`)\n this.actor.setAdvantage(0)\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n}","E2VfOVuju67qO3VL":"let blinded = this.actor.hasCondition(\"blinded\");\nif (blinded.getFlag(\"wfrp4e\", \"nightshroud\"))\n{\n blinded.delete()\n}","E4CHDe1xfmcV3oGv":"return args.skill?.name == game.i18n.localize(\"NAME.Navigation\");","E6DMqfDeczqmVMFV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\n\nawait test.roll();","E7D4bxz8gy4e1wL7":"if ([\"Stealth (Rural)\", \"Track\", \"Outdoor Survival\", \"Swim\", \"Perception\", \"Intuition\"].includes(args.item?.name))","EGWF3LHav3e2zFL4":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\");","EJObiSth3WdcJOXN":"if (args.test.characteristicKey == \"wp\" && args.test.failed && args.test.result.SL <= -3)\n{\n this.script.scriptNotification(\"Ajout de A Terre\");\n this.actor.addCondition(\"prone\")\n}","EJaBfqADqlo92Fx6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oGbDwnLOn3isPJpO\")\nlet data = item.toObject();\ndata.name += \" (A déterminer)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","EKkdyp51Wf4csw2B":"return this.actor.statuses.has(\"frenzy\");","ENGmwaItRXO5s0XY":"await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 3)\nthis.script.scriptMessage(`Soigne ${this.actor.system.characteristics.t.bonus * 3} Blessures`)\n\nthis.actor.hasCondition(\"bleeding\")?.delete()\nthis.actor.hasCondition(\"fatigued\")?.delete()\n","EQ5dtGW5kQhtAb87":"await this.actor.addCondition(\"prone\")\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (test.failed)\n{\n\tawait this.actor.addCondition(\"stunned\")\n}","ERxrWzSpw8qwxFVi":"this.script.scriptNotification(`Ne peut entrer ${this.effect.name}!`); this.actor.addCondition(\"broken\");","EU5j0hnDTG9Z6d1e":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif(test.failed)\n{\n this.actor.addCondition(\"stunned\", 2)\n}","EVBSHEC5nmmj2X41":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","EYny6z5oTOhxGDfb":"args.fields.modifier -= 10;\n","EaSNOmXUxAkUHnm5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","Eay7GpDyfsEE40jT":"if (args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"ablaze\")\n}","EdTChmSouS0MSmk5":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.succeeded)\n{\n this.script.scriptMessage(\"Peut effectuer une Action ou un Mouvement (en choisir un)\")\n}\nelse \n{\n this.script.scriptMessage(\"Ne peut pas effectuer d'Action ou de Mouvement ce round\") \n}","EiLaZW4b4ypw5sLV":"// can't use Damage application type because that checks if wounds were dealt\nargs.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})","EmXwcuycEH8slEn5":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif(test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}","EmmG49pMOPHRwDzR":" let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n if (args.test.isFumble && roll == 1 && !args.test.result.misfire)\n {\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Résultat 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n }\n else if (args.test.isFumble && roll != 1)\n args.test.result.other.push(\"Raté résultat: \" + roll)\n","EpdMj9d9SYPeP44q":"return args.characteristic != \"ag\" && args.item?.id != this.item?.id","ErgOwSiVnm9VLVHN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.DrNUTPeodEgpWTnT\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","Et4tPHlrkueLqP3T":"if (args.item.type == \"skill\") args.item.system.modifier.value -= 10","Ew3C2WmLCtc1KT46":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")) || args.item?.id == this.item?.id","EwD053Fyy46b59ZI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.6l3jvIAvrKxt0lA9\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","Eye6dranWpNsILjm":"if (this.actor.system.status.wounds.value <= 1)\n{\n this.effect.delete();\n}","F4aGsdzJ9SYcX57F":"if (args.equipped)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.HpFkVJ2lYPAWumUL\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}\nelse \n{\n this.effect.deleteCreatedItems(); \n}","FAB12eLcSCAOOQwk":"this.script.scirptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true});","FAf4iXj5LkdvukS2":"fromUuid(\"Compendium.wfrp4e-wom.items.0Xdm4r7l2EwC4fcg\").then(item => Item.create(item.toObject(), {fromEffect : this.effect.id, parent : this.actor}))","FMA16PvoObBV8vDl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\nitem = item.toObject()\nitem.system.specification.value = 20\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\nthis.script.scriptNotification(item.name + \" added\")","FMSN5uRskkATexzB":"game.wfrp4e.tables.rollToChat(\"crithead\")","FSqUqSByMiztYOQM":"if (args.totalWoundLoss > 0)\n this.script.scriptMessage(`Infected: ${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","FUgCtIoj1Stgqxt7":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","FXuyiJoXdAh6WhRK":"return args.skill?.name == \"Ride (Horse)\" && game.combat?.active","FXwfqF0jpXlBQ9Y3":"return args.item?.system?.isMelee && this.actor.attacker","FYUPfYyTYZkxRLFT":"return ![\"NAME.Endurance\", \"NAME.Cool\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","FZFOC7bip0oiWEzk":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2);\n this.script.scriptNotification(\"Added Bleeding\")\n}","FciJSTq7dZsZIPgl":"if (args.equipped)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}\nelse \n{\n this.effect.deleteCreatedItems(); \n}","FfTqCPxCoxwGDTQs":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","FiD3mvWIBHNNIuO9":"if (args.opposedTest.result.hitloc.value == \"body\")\n{\n if ((await new Roll(\"1d2\").roll()).total == 1)\n {\n args.opposedTest.result.hitloc.value = \"head\"\n this.script.scriptMessage(`Hit location changed to Head`)\n }\n}","FkTwk8hfHpRLbAp2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","FmLx9pwOkzqqU7Ph":"return args.skill?.name == game.i18n.localize(\"NAME.Track\");","FqevMs0ukQ9WuUHl":"// Each time the blade is used, the GM should secretly roll a d10.\n// On a 1, its poison has run dry, \n// and the next time it is employed it will shatter.\n\nif (this.item.getFlag(\"wfrp4e\", \"brittle\"))\n{\n ChatMessage.create({content: `${this.item.name} shatters!`})\n this.item.update({name : `${this.item.name} (Shattered)`})\n}","Fvlc4RkeF4dHjW3m":"let caster = this.effect.sourceActor\nif (caster && (this.actor.has(game.i18n.localize(\"NAME.Undead\")) || this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))) {\n let wp = caster.system.characteristics.wp.value\n if (wp > this.actor.system.characteristics.t.value) {\n if (this.actor.has(game.i18n.localize(\"NAME.Unstable\"))) {\n this.actor.update({ \"system.status.wounds.value\": 0 })\n this.actor.addCondition(\"dead\")\n }\n else {\n fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\").then(item => {\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], { fromEffect: this.effect.id })\n ChatMessage.create({ content: `Added Unstable to ${this.actor.prototypeToken.name}`, speaker: { alias: caster.name } })\n })\n }\n }\n}","G1RletYc6BzigJrK":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 5\nargs.actor.addCondition(\"ablaze\", ablaze)","G7sFEnJlXZvfXL3V":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[1].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","GAO8AozttWOyRkta":"if (!args.flags.lostHand)\n{\n\targs.fields.lostHand = true;\n\targs.fields.modifier += -20;\n}","GEfWIFBSrXt0ldBM":"(await new Roll(\"1d10\").roll()).toMessage(this.script.getChatData())\nawait this.actor.addCondition(\"dead\")","GFaTz8f6PBNWrlad":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : `Confused: Determine behaviour by @Table[bewilder] Table.`}})\nawait test.roll();\nreturn test.failed","GFkVnx4m9OwYsKGH":"args.actor.flags.ambi+= 1","GNl5Zk7BZ2jhRV1I":"if (args.item.type == \"armour\")\n{\n args.item.system.AP.head = 0;\n}","GOq4TcnWbfyfCo2V":"this.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus * 2} Wounds`)\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus * 2)\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - Side Effects`,fields : {difficulty : \"difficult\"}})\nawait test.roll();\nif (test.failed)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData())\n if (roll.total <= 3)\n {\n this.actor.addCondition(\"blinded\", 3)\n }\n else if (roll.total <= 6)\n {\n this.actor.addCondition(\"broken\");\n }\n else if (roll.total <= 9)\n {\n this.actor.addCondition(\"stunned\");\n }\n else if (roll.total == 10)\n {\n this.actor.addConditon(\"unconscious\")\n }\n}","GRfCxtYzmEx2LYU7":"if (args.totalWoundLoss >= 1)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData());\n if (roll.total == 9)\n {\n this.script.scriptMessage(`Two @UUID[Compendium.wfrp4e-eis.actors.iDy8SDTwJSlCzZMl]{Blue Horror of Tzeentch} claw their way out of ${this.actor.name}'s screaming flesh, killing them in the process.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","GTZUO73pUJKpM1JB":" let roll = await new Roll(\"1d10\").roll();\n game.dice3d?.showForRoll(roll);\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n","GUkpYdPwoC5pc9BT":"return !args.weapon?.system.properties.flaws.crewed","GZFsuynUhgZqwTGo":"if (args.totalWoundLoss >= 1)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"Gained a Poisoned Condition\", success: \"Resisted the poison\" }})\n await test.roll();\n if (test.failed)\n {\n args.actor.addCondition(\"poisoned\");\n }\n}\n ","GbPEy22VuCNzlNv2":"return !this.actor.isMounted || (!args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\")) && !args.options.dodge)","Gc8S5TYlVdV8NnOT":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name, context: { failure: \"Gained a Broken Condition\", success: \"Resisted the Broken Condition\" } })\n\n await test.roll();\n\n if (!test.succeeded)\n {\n args.actor.addCondition(\"broken\");\n }","GcIQtshex11AMmh2":"if (this.item.system.isEquipped)\n{\n let removeRepeater = false\n if(!this.item.system.offhand.value) // main\n {\n let offhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && i.system.offhand.value)\n if (offhandUsed)\n {\n removeRepeater = true;\n }\n }\n else // offhand\n {\n let mainhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && !i.system.offhand.value)\n if (mainhandUsed)\n {\n removeRepeater = true;\n }\n }\n \n if (removeRepeater)\n {\n this.item.system.qualities.value = this.item.system.qualities.value.filter(i => i.name != \"repeater\")\n }\n}","Gh7OidY6UdpWBS1g":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.KII1gWnxIZ8HzmU5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","GjkxWj9wCAclM9WA":"let effects = foundry.utils.deepClone(this.item.effects.contents.filter(e => e.active));\n\neffects.splice(effects.length - 1);\n\nif (effects.length == 0)\n{\n return this.script.scriptNotification(\"All Effects have been used. Reset to select them again\")\n}\nlet choice = await ItemDialog.create(effects, 1, \"Choose Power to Gain\");\n\nif (choice[0])\n{\n choice[0].update({disabled : true})\n let effect = choice[0].convertToApplied();\n effect.name += ` (${this.effect.name})`\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [effect]);\n}","GrF6tQ08jgKmUH4i":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"i\"].includes(args.characteristic)","GuUCErVbk5hrFzR3":"args.multiplier.tb += 1","GuxbvztcvzJz2oH1":"args.item.system.qualities.value = [];","GzSFlqL1YrIK1dxh":"let items = await Promise.all([\"Compendium.wfrp4e-wom.items.Item.EjGYZ4CgX2jZW7Ot\",\n\"Compendium.wfrp4e-wom.items.Item.O2v9RQiFf0obskP5\",\n\"Compendium.wfrp4e-wom.items.Item.2cv6hhZ57iV6z5Il\",\n\"Compendium.wfrp4e-wom.items.Item.YgDEUO0G0XcqQJqg\",\n\"Compendium.wfrp4e-wom.items.Item.J6K5TPxI8qIGQKKH\",\n\"Compendium.wfrp4e-wom.items.Item.K9FPtiDLwTkC7FuO\",\n\"Compendium.wfrp4e-wom.items.Item.CkMYRYCLrkMnyVm5\",\n\"Compendium.wfrp4e-wom.items.Item.0Xdm4r7l2EwC4fcg\"].map(fromUuid));\n\nlet choice = await game.wfrp4e.apps.ItemDialog.create(items, 1, \"Select Wind\")\n//this.actor.createEmbeddedDocuments(\"Item\", items);\n\nthis.item.update(choice[0]?.toObject(), {diff: false, recursive : false});\n\n//this.actor.items.getName(this.effect.item.name).delete() // For some reason this.effect.item.delete() throws an error\n\n","GzsuEg7gZy1f0ljy":"let bleeding = this.actor.hasCondition(\"bleeding\")\nif (bleeding)\n{\n this.script.scriptNotification(`Cleared ${bleeding.conditionValue} Bleeding Conditions`)\n bleeding.delete(); \n}\nelse \n{\n this.script.scriptNotification(`No Bleeding Conditions`)\n}","H06Ysj7oPiemW7S6":"if (args.test.options.income && !args.test.options.criminal)\n{\n args.test.options.criminal = true;\n let currentCareer = args.test.actor.system.currentCareer;\n let coin = {1 : \"b\", 2 : \"s\", 3 : \"s\", 4 : \"g\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n let term = {1 : \"bp\", 2 : \"ss\", 3 : \"ss\", 4 : \"gc\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n let dieAmount = {1 : \"2d10\", 2 : \"1d10\", 3 : \"2d10\", 4 : \"1\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n dieAmount = parseInt(dieAmount[0]) * this.item.system.Advances; // Multilpy that first letter by your standing (Brass 4 = 8d10 pennies)\n if (coin != \"g\") // Don't roll for gold, just use standing value\n {\n dieAmount = dieAmount + \"d10\";\n }\n let moneyEarned = (await new Roll(dieAmount.toString()).roll()).total;\n let moneyString = `${moneyEarned}${coin}`\n let transactionString = `${moneyEarned}${term}`\n\n this.script.scriptMessage(`
Earned an additional ${game.wfrp4e.market.amountToString(game.wfrp4e.market.parseMoneyTransactionString(transactionString))}`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","H1z3nWW7Rj3Oisxy":"return args.type != \"channelling\"","H2CJvApKMnfGNNoo":" if (args.test.item?.type == \"skill\" && args.test.item.name.includes(game.i18n.localize(\"NAME.Stealth\")))\n{ \n args.test.result.description = \"Astounding Failure\";\n args.test.result.outcome = \"failure\";\n ChatMessage.create({content : \"SQUEAK\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\n AudioHelper.play({ src: `${game.settings.get(\"wfrp4e\", \"soundPath\")}squeek.wav` }, true);\n}","H3Wls12aVWAWTp9J":"this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => {\n test.roll();\n})","H3pZ9UeIzIz3luKh":"args.actor.addCondition(\"bleeding\")\n\nthis.actor.setFlag(\"wfrp4e\", \"isAttached\", args.actor.name)\n\nthis.script.scriptMessage(`Attaches to ${args.actor.name}`)","HASsi6wYHVALExWq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Corruption Point Gained\" } })\nawait test.roll();\n\nif (test.failed && args.actor.type == \"character\") \n{\n let msg = \"\"\n msg += `

${this.actor.prototypeToken.name} gained a Corruption point

`\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n msg += `${args.actor.prototypeToken.name} gains a mutation (@Table[expandedmutatephys]{Physical} or @Table[expandedmutatemental]{Mental}) and gains @UUID[Compendium.wfrp4e-core.items.hiU7vhBOVpVI8c7C]{Chaos Magic (Tzeentch)}`\n }\n this.script.scriptMessage(msg, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n await this.actor.update({ \"system.status.corruption.value\": parseInt(args.actor.status.corruption.value) + 1 })\n}","HJ2X4ZtXei0BXbxf":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"PzimjNx9Ojq4g6mV\"), game.wfrp4e.utility.findItemId(\"rOPmyLWa37e7s9v6\")])\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choose a Skill\")\n\n items = items.map(i => i.toObject())\n items.forEach(i => i.system.advances.value = 20)\n\nitems.forEach(i => equip(i))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.data.worn.value = true\n else if (item.type == \"weapon\")\n item.data.equipped = true\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\n item.data.worn = true\n}","HKhyn0kijKfzW6cw":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nthis.item.updateSource({\"flags.wfrp4e.passed\" : test.succeeded})","HMC6hPND9DWLFfZE":"if (this.item.name.includes(\"(\"))\n{\n\treturn;\n}\n\nlet index = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Lore\")))\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(index, 1, \"Choose a Lore\")\nlet text;\nif (!choice[0])\n{\n let custom = await Dialog.wait({\n title : \"Enter Lore\",\n content : \"\",\n buttons : {\n confirm : {\n label : game.i18n.localize(\"Confirm\"),\n callback : (dlg) => {\n return dlg.find(\"input\")[0].value\n }\n }\n },\n default : \"confirm\",\n close : () => {\n return \"\"\n }\n }) \n text = custom || \"\"\n}\nelse \n{\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\n}\n\nawait this.item.updateSource({name : this.item.name + ` (${text})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"chosen Lore\", text)})\nawait this.effect.updateSource({name : this.effect.name + ` (${text})`})","HOt2hHOiHDZ7oBgW":"if ([\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n{\n\targs.actor.details.move.value /= 2\n}\n","HX6CjNapYdC0VmQ8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.epPBu7x6BRWp2PHG\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","HXJKkmpfxQUOnWOS":"if (!this.item.system.twohanded.value)\n{\n this.item.system.flaws.value = this.item.system.flaws.value.concat([{name : \"tiring\"}, {name : \"slow\"}])\n}","Hcpn1gU58DIKIhty":"if (args.item.type == \"skill\" && args.item.name == \"Melee (Flail)\")\n{\n args.item.system.modifier.value += 10;\n}","HfCxNd7mFGZH4s9Y":"// An opponent that takes more than a single Wound from a Warp Blade strike \n// in melee combat must make an Average (+20) Endurance Test \n// or take a Stunned Condition\n\n\nif (args.totalWoundLoss > 1) {\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if(test.failed)\n {\n await args.actor.addCondition(\"stunned\");\n }\n}","HiMBS6GeOwEydWYN":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\");","HmImVzvw6ecBy99l":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0) \n{\n args.actor.addCondition(\"bleeding\", 2)\n this.script.scriptNotification(\"Added Bleeding\")\n}","HoNTnPphrJISSQr1":"ChatMessage.create({content : \"Speak and be known to me\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})","Hq1G30lhJYvtOSNb":" \n if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.preData.characteristic))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","HrOBAXsEX073ReKl":"let skill = `Entertain (Singing)`\nlet currentCareer = this.actor.system.currentCareer;\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\n\nif (!currentCareer) return\n\n\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\nif (existingSkill && inCurrentCareer)\n{\n\texistingSkill.system.advances.costModifier = -5;\n}\nelse \n{\n\tcurrentCareer.system.skills.push(skill);\n}\n\n\n","HrYchgkdZBiu1yPF":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\");","HwbgUIbpX0D8JLOR":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n this.actor.addCondition(\"bleeding\")","I0Jo6cbNAJtXUloc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.J9MK0AIaTbvd5oF6\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","I0oRZ7AWde5KI5jw":"return ![\"t\", \"int\"].includes(args.characteristic)","I1J2m5uud84N50Lk":"if ([\"cast\", \"channelling\", \"pray\"].includes(args.type))\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Cannot cast Spells or use Prayers\");\n}\nelse return true;","I7ieW0hNYvvX0KFg":"return args.skill?.name != game.i18n.localize(\"NAME.Heal\");","I93i49wI9ZrDHT4n":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.jt0DmVK9IiF6Sd2h\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","I9QAPKbaXwMMMBT4":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif(test.failed)\n{\n await this.actor.addCondition(\"stunned\");\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\n await secondTest.roll();\n if(secondTest.failed)\n {\n this.effect.updateSource({name : \"Taste of Death\"})\n await this.actor.addCondition(\"fatigued\");\n }\n else \n {\n return false;\n }\n}","IAGla7HJlYN0wa4H":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n this.actor.addSystemEffect(\"convulsions\")\n this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @Symptom[Convulsions] for [[1d10]] hours`)\n }\n}","ID8mCcjkl7PCQhDq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif(test.failed)\n{\n let damage = this.effect.sourceItem.system.computeSpellDamage(\"3\", true);\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg: true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))\n}","IG4zYqtN9fRSYE7q":"args.actor.addCondition(\"ablaze\");","IKiZv9YSFmKmHo6a":"return args.spell?.system.lore.value == \"fire\"","ILqHxk7deotgI3KD":"if (args.item.type != \"weapon\")\n return\n\nlet reach = args.item.reach.value\nlet reachNum = game.wfrp4e.config.reachNum[reach]\nreachNum = Math.min(reachNum + 2, 7)\n\nlet key = game.wfrp4e.utility.findKey(reachNum, game.wfrp4e.config.reachNum)\n\nargs.item.reach.value = key","IPPDvZdE8kn3H9z7":"let test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\n\nif (test.failed)\n{\n await this.actor.addCondition(\"grappling\")\n}","IR5URcjnCuWBFMoN":"// If a full dose is imbibed, \n// the victim must pass a Hard (-20) Endurance Test.\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\nawait test.roll()\nif (test.failed)\n{\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} notices nothing amiss save that they become tired a little earlier than usual. At this point it is still possible to save the victim via a powerful antidote or magical means.

\n

Once they fall asleep however, it is almost impossible. At this point the victim must make a Hard (-20) Endurance Test. If they fail, they never awaken.

`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n })\n}\nreturn test.failed;","IR86DuMbVdbGOJYt":"this.actor.addCondition(\"blinded\")","IfEu1hO8sKEZBpvg":"let value = parseInt(this.item.specification.value)\nlet name = this.actor.prototypeToken.name\n\nif (game.user.isGM && game.user.targets.size)\n{\n game.user.targets.forEach(t => {\n t.actor.applyFear(value, name)\n })\n game.user.updateTokenTargets([]);\n}\nelse \n{\n game.wfrp4e.utility.postFear(value, name)\n}","IkGegSuQwwVPhrjF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 1\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Ip8sctF9SIE1Z2vF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.UnJ25lL8aUzem5JO\")\nlet data = item.toObject();\ndata.system.specification.value = 3\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","IpoOOjYJs6RmVrpb":"if (args.totalWoundLoss > 0)\n{\n args.attacker.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[1].uuid})\n}","IsLAvY9ikR1cOJWw":"return ![\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","IslMfFgpgQq2brpu":"if (this.actor.hasCondition(\"broken\"))\n{\n this.actor.removeCondition(\"broken\")\n this.script.scriptNotification(`Cannot have Broken`);\n}","IukS0clr1yAleacc":"this.actor.system.characteristics.ag.modifier -= parseInt(this.item.system.location.value || 1)\n\nthis.actor.system.characteristics.ws.modifier -= parseInt(this.item.system.location.value || 1)","IupskvzvoGyD2H5o":"if (this.actor.type != \"character\")\n{\n return;\n}\n\nlet god = await ValueDialog.create(\"Enter a Deity\", \"Blessed\")\n\nif (god)\n{\n let prayers = await game.wfrp4e.utility.findAll(\"prayer\", \"Loading Prayers\")\n let blessings = prayers.filter(p => p.system.god.value.split(\",\").map(i => i.trim().toLowerCase()).includes(god.toLowerCase()) && p.system.type.value == \"blessing\")\n if (blessings.length)\n {\n this.script.scriptNotification(\"Adding \" + blessings.map(i => i.name).join(\", \"))\n await this.actor.createEmbeddedDocuments(\"Item\", blessings, {fromEffect : this.effect.id})\n }\n else \n {\n this.script.scriptNotification(`Could not find any Blessings associated with ${god}.`)\n }\n this.item.updateSource({name : this.item.name.replace(\"Any\", god)})\n await this.actor.update({\"system.details.god.value\": god})\n}","IzZcsSngI8TZH4d8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","J0IWUhxada2ONowP":" return args.skill?.name == \"Entertain (Sing)\" || args.skill?.name == \"Entertain (Singing)\" || (args.skill?.name.includes(\"Language\") && (args.skill?.name.includes(\"Magick\") || args.skill?.name.includes(\"Elthárin\") || args.skill?.name.includes(\"Cathayan\")))","J1FPDdrXGctKDTZz":"if (args.equipped)\n{\n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\n wardData = ward.toObject()\n wardData.system.specification.value = \"8\"\n \n let mr = await fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\")\n mrData = mr.toObject()\n mrData.system.specification.value = 2\n \n this.actor.createEmbeddedDocuments(\"Item\", [wardData, mrData], {fromEffect : this.effect.id})\n}\nelse\n{\n this.effect.deleteCreatedItems()\n}","J8aPichsl25t1QZ9":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.SL)","JEbs0WlqhKNDOo5A":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}\n","JFgXyb6bKjZJLmF8":"return args.characteristic == \"ag\"","JQruHprM5R5vZ9DA":"let caster = this.effect.sourceActor;\nif (caster)\n{\n let healed= caster.system.characteristics.wp.bonus + caster.system.characteristics.int.bonus\n await this.actor.modifyWounds(healed);\n this.script.scriptMessage(`${this.actor.prototypeToken.name} regains ${healed} Wounds`)\n}\n \n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"vhard\"}, context : {success : \"1 Corruption point that was gained within the last hour is removed.\", failure: \"Nothing happens\"}})\n await test.roll();","JZIn1dsKHFE3smJU":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 1\nargs.actor.addCondition(\"ablaze\", ablaze)","JaiC5P6nIgctOacH":"if (args.actor.system.details.species?.value?.toLowerCase() == \"dwarf\")\n{\n args.weaponProperties.flaws.undamaging = true;\n}","JavuFNZ9Pj5elVLc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","JeThJbOf6Xmbtgo1":"this.script.scriptMessage(await this.actor.applyBasicDamage(8 + parseInt(this.effect.sourceTest.result.SL), {suppressMsg : true}))\n\nlet test = await this.actor.setupSkill(\"Athletics\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","JgCcgDVZX54slrWx":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption","JibNjuQrJRnY0yf9":"return this.actor.flags.useless.rEye && this.actor.flags.useless.lEye && ([\"ws\", \"bs\"].includes(args.characteristic) || args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\")) || args.weapon || args.options.dodge)","JjDzMnUxaWQePIYh":"return args.characteristic != \"int\"","JjiPprLSlSmmB5Ga":"args.item.system.damage.value += \" + 1\"","Jjq3oPYbI26zjxME":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","Jk7OHqx06oCUVAzb":"return ![\"Language (Magick)\", \"Channelling (Hysh)\"].includes(args.skill?.name) ","JmZQRvdWjm9ykYfn":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.actor.removeCondition(\"surprised\")\n this.script.scriptMessage(`Cannot be Surprised`);\n}","Jnp5c09sPzDD61EK":"this.script.scriptNotification(`${args.actor.prototypeToken.name} must pass an Average (+20) Willpower Test to attack this target!`)\n\nreturn true; // No need to show this in the dialog","JstrA46EYSEuRSy5":"if (this.actor.has(game.i18n.localize(\"NAME.Undead\")) && this.actor.has(game.i18n.localize(\"NAME.Construct\")))\n this.actor.addCondition(\"dead\")","JwYZJGkZMSM2M3Si":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\n await test.roll()\n if (test.failed)\n {\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\n }\n}","JwgFQmPQtXWAP94i":"this.actor.addCondition(\"fatigued\");","JyTxUG5dNW670Sf7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\nlet data = item.toObject();\ndata.system.location.key= this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}","K06v93N4FXb70mB7":"args.item.system.encumbrance.value = Math.max(0, args.item.system.encumbrance.value - 1);","KD4nCSdSXJVJmk0R":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg : true}))\nawait this.actor.addCondition(\"ablaze\")","KF69WqF4PSEtpdb2":"args.fields.slBonus += 2;\n ","KG4TxnXiLLpfWOQO":"args.fields.difficulty = \"average\"","KGK9vL1Yl0qmCeCN":"let specification = this.item.system.specification.value;\nlet choice = [];\n\nif (!specification || specification == \"Trained Skills\")\n{\n choice = await ItemDialog.create(ItemDialog.objectToArray({\n broken: \"Broken\",\n drive: \"Drive\",\n entertain: \"Entertain\",\n fetch: \"Fetch\",\n guard: \"Guard\",\n home: \"Home\",\n magic: \"Magic\",\n mount: \"Mount\",\n war: \"War\"\n }, this.effect.img), \"unlimited\", \"Choose Training\");\n}\nelse \n{\n choice = specification.split(\", \").map(i => {\n return {\n id : i.toLowerCase(),\n name : i\n }\n });\n}\n\nif (choice.length)\n{\n let changes = foundry.utils.deepClone(this.effect.changes);\n\n for(let training of choice)\n {\n switch(training.id)\n {\n case \"broken\" : \n let roll = await new Roll(\"2d10\").roll(); \n roll.toMessage(this.script.getChatData());\n changes.push({value : roll.total, mode : 2, key : \"system.characteristics.fel.modifier\"})\n\n if (this.actor.type == \"creature\")\n {\n let bestial = this.actor.itemTypes.trait.find(i => i.name == \"Bestial\");\n if (bestial)\n {\n bestial.update({\"system.disabled\" : true})\n }\n }\n break;\n\n case \"drive\" : \n\n break;\n\n case \"entertain\" : \n\n break;\n\n case \"fetch\" : \n\n break;\n\n case \"guard\" : \n let territorial = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JIAe7i7dqTQBu4do\");\n await this.actor.createEmbeddedDocuments(\"Item\", [territorial], {fromEffect: this.effect.id})\n setProperty(args, \"options.keepId\", true);\n break;\n\n case \"home\" : \n\n break;\n\n case \"magic\" : \n\n break;\n\n case \"mount\" : \n\n break;\n\n case \"war\" : \n changes.push({value : 10, mode : 2, key : \"system.characteristics.ws.modifier\"})\n break;\n }\n }\n this.effect.updateSource({name : `${this.effect.name} (${choice.map(i => i.name).join(\", \")})`, changes, \"flags.wfrp4e.trained\" : choice.map(i => i.id)})\n this.item.updateSource({\"system.specification.value\" : `${choice.map(i => i.name).join(\", \")}`})\n}","KICZPwLvbUSxbDrE":"let table = game.wfrp4e.tables.findTable(\"mutatemental\");\nif (!table)\n{\n\tui.notifications.error(\"Cannot find table with key: mutatemental\")\n}\nlet result = (await table.roll()).results[0];\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\nlet item = await fromUuid(uuid);\n\nif (item)\n{\n this.script.scriptNotification(`${item.name} added`)\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n}\nelse \n{\n ui.notifications.error(\"Item could not be found: \" + uuid)\n}","KIoVBinAZK8sMOqD":"\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - Wounded\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Gained \" + disease.name)\n })\n }\n ","KJLAan0glJlyOyqF":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 10,\n \"bright\": 5,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"flame\",\n },\n \"color\": \"#ac9e6c\",\n }}));","KPQfupKuaf4LCv4R":"const talents = await Promise.all([\"Schemer\", \"Second Sight\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","KQmb5B27eJ1lkbVL":"return this.item.system.quantity.value > 0 && args.type != \"channelling\"","KQzbrpb0T5a7it4k":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vMYEkrWj0ip6ZOdv\");\nlet data = item.toObject();\ndata.name += ` (Disease)`;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","KSjsDlsx3DD6cT16":"return args.skill?.name != game.i18n.localize(\"NAME.Bribery\");","KT670CjGBEprx2fO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.RWJrupj9seau0w31\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","KTBVDHUndI3qDOXM":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"))\nawait test.roll();\nif (!test.succeeded)\n{\n args.actor.addCondition(\"stunned\")\n}","KUx0deSF3xNzMucL":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","KVpDUEjHhd3nLa0f":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"enrage-beast\"))\n}","KVuPduDztyMZQNt9":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus","KXzDe7cN2vynHjJO":"this.actor.hasCondition(\"blinded\")?.delete();\nthis.actor.hasCondition(\"deafened\")?.delete()\nthis.actor.hasCondition(\"unconscious\")?.delete()","KkjkYAGI9Em1NgiQ":"if (this.item.system.quantity.value) \n{\n this.item.system.reduceQuantity();\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Heal\"), { appendTitle: ` - ${this.effect.name}`, skipTargets: true })\n await test.roll();\n if (test.succeeded) \n {\n let actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n actor.applyEffect({ effectData: [this.item.effects.contents[0].convertToApplied()] })\n }\n else \n {\n this.script.scriptNotification(\"Heal Test failed!\", \"error\")\n }\n}\nelse \n{\n this.script.scriptNotification(\"None left!\", \"error\")\n}","KmngDrPD72xn22kZ":"if (this.actor.Species.toLowerCase() != \"skaven\") {\n this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - Used ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\n await test.roll()\n if (test.failed) \n {\n let toughnessLost = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n this.actor.update({ \"system.characteristics.t.initial\": this.actor.characteristics.t.initial - toughnessLost })\n this.script.scriptMessage(`${this.actor.prototypeToken.name} lost ${toughnessLost} Toughness`)\n }\n })\n }","KnwYZbeRSBA94hfl":"if (!args.flags.lostFingers)\n{\n\targs.flags.lostFingers = true;\n\targs.fields.modifier -= 5 * this.actor.flags.useless[this.item.system.location.key]\n}","KuUkUmOOLf05I4Bp":"this.actor.hasCondition(\"broken\")?.delete();\n","KuuWAhoSzk0rCxxw":"args.fields.modifier += -20;","KyUPYV1RXJxPOfyA":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"veasy\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"fatigued\");\n}","KyswmGj1uG3QS3ng":"args.applyAP = false;","L1RMLvKtRPFtnczI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","L2cdQppcPwxz24hN":"return !args.weapon","L89UcafRHqUfxoux":"let injury = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\ninjury.updateSource({\"system.location.key\" : this.item.system.location.key})\nthis.actor.createEmbeddedDocuments(\"Item\", [injury], {fromEffect: this.effect.id})","L9eAtDyaoHvqryk4":"return args.skill?.name != game.i18n.localize(\"NAME.Intimidate\");","LAyLbcC0lOPwZP3U":"this.actor.addCondition(\"ablaze\", parseInt(this.effect.sourceTest.result.SL))","LHUUXfZVLBhWqRvb":"this.actor.status.addArmour(5, {magical: true, source : this.effect})","LLqAT9wEUGMLfDhU":"return !args.item?.system.isRanged","LOL2TGf8p8KxP14D":"let wind = this.effect.name.split(\" \")[2]\nreturn args.type != \"cast\" || game.wfrp4e.config.magicWind[args.item.system.lore.value] != wind;","LQEWSN5KnHHATPsf":"if (args.totalWoundLoss > 0)\n{\n this.script.scriptMessage(`${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","LXEUhHuXe8keEPI9":"let test = await this.actor.setupCharacteristic(\"wp\", {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tlet stuns = Math.max(1, Math.abs(test.result.SL))\n\tthis.actor.addCondition(\"stunned\", stuns)\n}","LeKLtvEDrWh4yHsx":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\") || args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","LedRsrVo2f7lm3Ix":"return args.skill?.name == game.i18n.localize(\"NAME.Intimidate\");","Lg1oRg4oNRvucsvi":"return !(args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\"))","LjXPlgdXBdllnA3i":"return ![\"s\", \"t\"].includes(args.characteristic)","LkPtgN9A36OI6Frh":"return args.skill?.name == game.i18n.localize(\"NAME.Leadership\");","LlRhPGorLl5qJCU8":"if (this.actor.hasCondition(\"prone\")) \n{\n this.actor.addCondition(\"unconscious\");\n}\nelse \n{\n this.actor.addCondition(\"prone\");\n}","Lm9IBkc918Duw3US":"let career = this.actor.itemTypes.career.find(c => c.getFlag(\"wfrp4e\", \"doubleLife\"))\n\nif(career)\n{\n career.system.current.value = true;\n}","Lp261O9fgEXmgPf3":"// If this actor wins a defending test, swap the test\nif (!args.opposedTest.result.swapped && args.opposedTest.result.winner == \"defender\" && args.opposedTest.attackerTest.result.damage)\n{\n args.opposedTest.swap(this.effect.label);\n}","Lpv2N9LK9loeumiW":"if (this.actor.uuid != this.effect.sourceActor.uuid)\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"hard\"}, context : {failure : `${this.effect.name}: cannot move or take actions`}}).then(test => {\n test.roll();\n })\n}","Lrb1S2aK7SFVD0C7":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n await args.actor.addCondition(\"fatigued\");\n }\n}","Lu27iXtJVkrJ8bOx":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"))","LxdLkPxH3SFvYrCJ":"if (args.effect.conditionId == \"ablaze\")\n{\n args.data.formula += ` - ${this.actor.system.characteristics.t.bonus}`\n}","LyAK0dVDS5L09yq2":"let caster = this.effect.sourceActor\n\nif (caster)\n{\n let bonus = caster.system.characteristics.wp.bonus\n this.actor.modifyWounds(bonus)\n\n this.script.scriptMessage(`${this.actor.prototypeToken.name} regains ${bonus} Wounds`)\n}","M0XhKnWjG14pk3iH":"return !args.skill?.name.includes(\"Channelling\") && args.type != \"channelling\" && args.skill?.name != game.i18n.localize(\"NAME.Charm\") && !args.skill?.name.includes(\"Language (Magick)\") && args.type != \"cast\"","M2FshTX4PjKFVU8y":"args.flags.earCount = Number.isNumeric(args.flags.earCount) ? args.flags.earCount+1 : 1;\nif (args.characteristic == \"fel\")\n{\n\targs.fields.modifier -= 5;\n}\nif (args.flags.earCount == 2 && args.skill?.name == game.i18n.localize(\"NAME.Perception\"))\n{\n\targs.fields.modifier -= 20;\n}\n","M5bh0heeafA2fQQ8":"if (args.test.spell?.getFlag(\"wfrp4e\", \"boonOfTzeentch\"))\n{\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\n {\n this.script.scriptMessage(`${this.effect.name} quits your mind in disgust and erases itself from your grimoire!`)\n this.effect.sourceItem.delete();\n }\n}","M9VgeYGiUO97ZUW4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\nlet data = item.toObject();\ndata.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n\targs.actor.addCondition(\"unconscious\")\n}\n\n","MCK6WyjwYT28lsTN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.u0CFf3xwiyidD9T5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","MDLttXplnNthncGr":"return args.type == \"cast\" && [\"death\", \"necromancy\", \"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value)","MFKhU9vp8bQpHP3I":"let value = parseInt(this.item.specification.value)\nlet name = this.actor.prototypeToken.name\n\nif (game.user.isGM && game.user.targets.size)\n{\n game.user.targets.forEach(t => {\n t.actor.applyTerror(value, name)\n })\n game.user.updateTokenTargets([]);\n}\nelse \n{\n game.wfrp4e.utility.postTerror(value, name)\n}","MI2GgNi3fZtUCtQD":"return [\"int\", \"wp\"].includes(args.characteristic)","MJB6WbZSF6Briz30":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\")","MSJWJEUrX7ZmMvAD":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\"))","McLR9YcgVUG3MooC":"args.applyTB = false;","MfxWXZwaZUjGSBqw":"if (this.actor.hasCondition(\"ablaze\"))\n{\n this.script.scriptNotification(\"Immune to Ablaze\")\n await this.actor.hasCondition(\"ablaze\")?.delete()\n}","MfxzwJz2o9ho2hOM":"return args.skill?.name == \"Lore (Apothecary)\"","MgMMoC4Umpg7fmNI":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.
\n They cannot cast Spells or pray for Blessings and Miracles.
\n If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}. \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n\n\n\n","MgTqCMRjxhezT73T":"return args.fields.hitLocation == \"head\" && args.weapon?.system.properties.qualities.pummel","MgZreqq3Jua10c8s":"return ![\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","Mhb67xufvA9uWO21":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\n\nif (attackerSize > actorSize)\n{\n args.actor.addCondition(\"prone\")\n this.script.scriptMessage(`Tail Attack: ${args.actor.prototypeToken.name} is now Prone`)\n}","Mir4FMHQRdVqazAF":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\n\nif (attackerSize > actorSize)\n{\n let msg = `Tongue Attack: ${args.actor.prototypeToken.name} is now @Condition[Entangled]`;\n await args.actor.addCondition(\"entangled\");\n if (actorSize <= 2)\n {\n msg += `and @Condition[Engaged]`\n }\n this.script.scriptMessage(msg, {speaker : {alias: args.attacker.prototypeToken.name}})\n}","MkEcdViivk7abf1x":"args.actor.flags.meleeDamageIncrease += 1","MnXny8SCh6OceJc9":"return args.characteristic == \"int\"","MnqQkXVp20Lw84I1":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(3, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n}","Mp8UjuCLa9jdzhBS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n if (!this.actor.hasCondition(\"fatigued\"))\n {\n await this.actor.addCondition(\"fatigued\");\n }\n else\n {\n await this.actor.addCondition(\"blinded\");\n await this.actor.addCondition(\"deafened\");\n }\n \n if (((this.actor.hasCondition(\"blinded\").conditionValue || 0) + (this.actor.hasCondition(\"deafened\").conditionValue || 0)) > this.actor.system.characteristics.i.bonus)\n {\n await this.actor.addCondition(\"unconscious\"); \n }\n}","Msygc7oQQPB5fw0b":"let test = this.effect.sourceTest;\nif (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\n{\n\tlet points = await new Roll(\"1d10\").roll();\n\tgame.dice3d?.showForRoll(points)\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value + points.total})\n\tthis.script.scriptMessage(`Gains ${points.total} Corruption`)\n}\nelse \n{\n\tlet points = this.effect.sourceTest.result.overcast.usage.other.current;\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value - points})\n\tthis.script.scriptMessage(`Loses ${points} Corruption`)\n}","MwUzyAgd0yPnmZCH":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.klCJX0mNpXYH5AIx\")\nlet data = item.toObject(); \ndata.name = data.name.replace(\"Target\", \"Strangers\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","Myl1Ishu9GBraYUZ":"this.actor.removeCondition(\"bleeding\")","N2MeOlf0GjPiRcSb":"let test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : \"Drops the item\"}})\nawait test.roll();","N7nGncsPrTz2ZbDA":"return !args.options.dodge || !this.actor.isMounted","N8hA6ysHCTlLd8Kj":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 15,\n \"ag\" : 0,\n \"dex\" : 10,\n \"int\" : 15,\n \"wp\" : 15,\n \"fel\" : 0\n}\nlet skills = [\"Channelling\", \"Cool\", \"Dodge\", \"Entertain (Storytelling)\", \"Intuition\", \"Language (Magick)\", \"Lore (Magic)\", \"Perception\"]\nlet skillAdvancements = [5, 15, 10, 10, 15, 10, 10, 20]\nlet talents = [\"Arcane Magic\", \"Petty Magic\", \"Second Sight\"]\nlet trappings = [\"Hand Weapon\", \"Quarterstaff\", \"Ritual Dress incorporating many ingredients and fetishes\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","N9kA46ZQ9LiRjy6T":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\");","NDvNGATDM2xPFJK0":"brokenbone = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\nteeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\ntongue = await fromUuid(\"Compendium.wfrp4e-core.items.rkJA1DlK51QuRlJy\")\nbrokenbone = brokenbone.toObject();\nteeth = teeth.toObject();\ntongue = tongue.toObject();\n\n\nlet roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData({flavor : \"Teeth Lost\"}))\n\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\nbrokenbone.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [brokenbone, teeth, tongue])\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"vhard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}","NNytXz5XFPrEF6dw":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n}\n ","NQSvFWhmBQAyx5Zz":"return args.item?.isRanged","Na7Nanl9YmxZlTo7":"return args.type != \"cast\" && args.type != \"channelling\")","NdquQqyuOkGCj8Uo":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nfear = fear.toObject();\nfear.system.specification.value = 1;\nacutesense = acutesense.toObject();\nacutesense.name += \" (Smell)\";\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","NkqtQaLEGYst0PUO":"if (this.actor.has(\"Magic Resistance\", \"talent\")) \n return\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","NnA4zpuO6iUXKhH7":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Ranged\")))\n{\n let AP = parseInt(this.effect.sourceTest.result.SL)\n args.modifiers.ap.value += AP;\n args.modifiers.ap.magical += AP;\n args.modifiers.ap.details.push(`${this.effect.name} (${AP})`)\n}","NnDq4miIPNEtZUWb":"args.test.result.critModifier = args.test.result.critModifier || 0;\nargs.test.result.critModifier += 20;\n\nif (args.test.result.critical)\n{\n args.test.result.critical = `${game.i18n.localize(\"Critical\")} (+${args.test.result.critModifier})`\n}","NrVFrIXM8GnIbojv":"args.item.system.damage.value = `SB + ${this.actor.system.characteristics.fel.bonus}`;","O7lXFZLrLdFaShGR":"args.options.catfall = true;","O9fc0hLHdkTgSuLg":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet venom = await fromUuid(\"Compendium.wfrp4e-core.items.gFkRm9wS65qe18Xv\")\nlet biteData = bite.toObject();\nlet venomData = venom.toObject();\n\nbiteData.system.specification.value = 3 - this.actor.characteristics.s.bonus;\nvenomData.system.specification.value = \"Average\"\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, venomData], {fromEffect : this.effect.id})","OCFrGXAYfo9OYnhc":"return args.item?.system.magicMissile?.value || args.item?.system.attackType","OEy2lxvic37dRBEt":"let filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choose 3 Petty Spells\")\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"\"\n }\n]\n\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choose 3 Arcane Spells\")\n\nlet items = petty.concat(arcane).map(i => i.toObject())\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","OGX4BneaYAnV25TO":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\nlet message = \"\"\n\nlet wounds = duplicate(this.actor.status.wounds)\nlet regenRoll = await new Roll(\"1d10\").roll();\nlet regen = regenRoll.total;\n\nif (wounds.value >= wounds.max)\n return\n\nif (wounds.value > 0) \n{\n wounds.value += regen\n if (wounds.value > wounds.max)\n {\n wounds.value = wounds.max\n }\n message += `${this.actor.name} regains ${regen} Wounds.`\n\n if (regen == 10)\n {\n message += `
Additionally, they regenerate a Critical Wound.`\n }\n}\nelse if (regen >= 8) \n{\n message += `${this.actor.name} rolled a ${regen} and regains 1 Wound.`\n wounds.value += 1\n if (regen == 10)\n {\n message += `
Additionally, they regenerate a Critical Wound.`\n }\n}\nelse \n{\n message += `${this.actor.name} Regenerate roll of ${regen} - No effect.`\n}\n\nawait this.actor.update({ \"system.status.wounds\": wounds })\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","OJMgS8ZQv0j4tEFf":"return [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","OMAUX1fnHyIpplul":"return ![\"fel\", \"dex\"].includes(args.characteristic)","OXoqtpOdfkURZbuL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","Oa9FmLXRRZRpLrrq":"let test = await this.actor.setupTrait(this.item); \nawait test.roll();","OcQe0zfksf1DCJYe":"args.actor.system.characteristics.s.value += 30\nargs.actor.system.characteristics.t.value += 30\n\nargs.actor.system.characteristics.s.bonus += 3\nargs.actor.system.characteristics.t.bonus += 3\n\nif (args.actor.system.characteristics.s.value > 100)\n{\n args.actor.system.characteristics.s.value = 100\n args.actor.system.characteristics.s.bonus = 10\n}\n\nif (args.actor.system.characteristics.t.value > 100)\n{\n args.actor.system.characteristics.t.value = 100\nargs.actor.system.characteristics.t.bonus = 10\n}","OeCgX3hIsfLfmGvC":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"))\nawait test.roll();\nif (test.succeeded)\n{\n this.actor.removeCondition(\"surprised\");\n}","OeKeQAAcJhdI4Qky":"if (this.actor.hasCondition(\"stunned\") || this.actor.hasCondition(\"unconscious\"))\n{\n\tthis.script.scriptNotification(\"Disabled!\");\n\tawait this.effect.update({\"disabled\" : true})\n}","Ofn6vDbP3fZ4UlSc":"args.fields.modifier += -20;\n ","OgSI0Z6SHjYuqKIz":"let blows = this.item.getFlag(\"wfrp4e\", \"blows\") || 0\nlet difficulties = Object.keys(game.wfrp4e.config.difficultyLabels)\n\nblows = Math.clamped(blows, 0, difficulties.length - 1)\nif (this.item.system.protects[args.opposedTest.result.hitloc.value])\n{\n let difficulty = difficulties[blows];\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields: {difficulty}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.script.scriptMessage(`${this.actor.name} must break from combat and flee until they pass a Challenging (+0) Willpower Test`);\n this.item.setFlag(\"wfrp4e\", \"failedCool\", true);\n }\n })\n}","OicQSEVZBbqLtrcf":"let choice = await ItemDialog.create(this.actor.itemTypes.critical, (this.effect.sourceTest.result.overcast.usage.other.current || 1), \"Choose the Critical Wounds to heal (cannot reattach body parts)\")\n\nthis.script.scriptMessage(`Healed ${choice.map(i => i.name).join(`, `)}`);\nthis.actor.deleteEmbeddedDocuments(\"Item\", choice.map(i => i.id))","OnkEe4ISru1hjJWP":"this.actor.flags.useless[this.item.system.location.key] = true;","Op88kMtimSEWlY2h":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","OqLKL0PiCvYH2QxW":"if (args.test.options.wallcrawler)\n{\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\n\t{\n\t\tif (parseInt(args.test.result.SL) < 0)\n\t\t{\n\t\t\targs.test.result.SL = \"+0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\n\t\t}\n\t\targs.test.result.outcome = \"success\"\n args.test.result.other.push(`${this.effect.name}: Minimum +0 SL`)\n\t}\n}","OqxeuZfZDfm9ax6h":"this.actor.system.status.addArmour(1, {locations : \"head\", source : this.effect})","OvIELZLvnlN2H2uw":"args.update({light : {\n \"dim\": 2,\n \"bright\": 1,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"pulse\",\n },\n \"color\": \"#949bff\",\n}});","OxsBnnVI3Smpknpb":"if (this.actor.status.advantage.value && !this.actor.sameSideAs(this.effect.sourceActor))\n{\n this.actor.modifyAdvantage(-1);\n this.script.scriptNotification(`${this.actor.name} loses 1 Advantage`);\n}","Oz7pWF9mEc1pQypj":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage({flavor : this.effect.name, speaker : {alias : this.actor.prototypeToken.name}})\nthis.actor.addCondition(\"stunned\", roll.total)","P29tT1eMMdAw3CPF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tthis.actor.addCondition(\"unconscious\")\n}","PBW6IZtwawNHxB6y":"return args.options.dodge && this.actor.isMounted","PI1QNaKFeqood6d7":"if (args.attackerTest.weapon && args.defenderTest.weapon)\n{\n\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\n \n if (attackerReach == defenderReach)\n attackerReach = attackerReach < 7 ? attackerReach + 1 : attackerReach\n\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\n\n args.attackerTest.weapon.reach.value = attackerReach\n args.defenderTest.weapon.reach.value = defenderReach\n}","PMISUsaEDBA7D3od":"// After consumption, the user gains the Magic Resistance 3 Creature Trait, \n// reducing the SL of any spell affecting it by 3. \n// This effect lasts for one hour.\nconst hasMagicResistance = this.actor.has(\"Magic Resistance\")\n\nif (hasMagicResistance === undefined) {\n fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\").then(trait => {\n let traitItem = trait.toObject()\n traitItem.system.specification.value = 2\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\n })\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} has gained the Magic Resistance Trait. This effect lasts for one hour.

`, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}\n\nif (hasMagicResistance) {\n // Multiple doses may be consumed at once, with each one adding an additional 1 to the Magic Resistance rating and increasing the duration by one hour. \n let msg = `

${this.actor.prototypeToken.name} has enhanced their Magic Resistance by 1 to Rating ${parseInt(hasMagicResistance.system.specification.value)}. This effect lasts for one hour.

`\n\n // Resist toxic effect\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n fields: {difficulty: \"challenging\"}\n }).then(async test => {\n await test.roll()\n\n // If they fail ...\n if (!test.succeeded) {\n msg += `

However, they begin to ooze the thick, poisonous slime that coats every Dreadmaw. They have gained 1 Poisoned Condition now and should continue to receive an additional @Condition[Poisoned] Condition at the end of each of the round.

\n

If they are still alive at the end of 10 rounds, the effect ends and all Poisoned Conditions gained from ${this.effect.name} are removed.

`\n this.actor.addCondition(\"poisoned\", 1)\n }\n this.script.scriptMessage(msg, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true })\n })\n}\n","PVjaKAHTKDA0rA9J":"let test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();","PdClojv7yNgQpOUc":"return args.skill?.name != game.i18n.localize(\"NAME.Endurance\");","PeZYj8b0vedyJj00":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\n\nlet mainEffect = this.item.effects.contents[0];\nif (mainEffect.name.includes(\"(Lore)\"))\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choose Lore\");\n if (choice.length)\n {\n mainEffect.update({name : mainEffect.name.replace(\"Lore\", choice[0].name)})\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\n }\n}\n\nthis.effect.delete();","Pg9C6nJX5QHIdqa9":"return !args.item?.system.attackType\n","Ph3TdQw1lGiFr049":" if (!args.test.context.phantasmal && \n (this.actor.isOpposing || args.test.context.defending) && \n args.test.result.roll % 11 == 0 && \n args.test.succeeded && \n [\"Language (Magick)\", \"Dodge\"].includes(args.test.item?.name))\n {\n args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited\n let text = `${this.effect.name}: Adding Unstable and Ward`\n args.test.result.other.push(text) \n this.script.scriptNotification(text);\n \n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\n let wardData = ward.toObject();\n wardData.system.specification.value = 9;\n \n let unstable = await fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\")\n let unstableData = unstable.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [wardData, unstableData], {fromEffect: this.effect.id})\n }\n","PjRxGuUDKGmSmVDc":"fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\").then(item => {\n item = item.toObject()\n item.system.specification.value = this.actor.characteristics.ag.value\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\n})","PmELrzD3RmF9qKkO":"if (this.item.system.specification.value == \"Size\")\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.actorSizes, this.item.img), 1, \"Choose Size\");\n if (choice[0])\n {\n this.item.updateSource({\"system.specification.value\" : choice[0].name})\n this.effect.updateSource({name : this.effect.name + ` (${choice[0].name})`})\n }\n}","PoNnT5EqvLj2r5yf":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","PwqTmw7rsG8hzqCS":"if (args.test.result.critical && args.test.result.roll % 10 == 0) \n{\n game.wfrp4e.tables.findTable(\"knuckleduster-diseases\").roll().then(roll => {\n let results = roll.results[0]\n\n this.script.scriptMessage(`${this.actor.name} contracts @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n })\n\n }\n\n","Q1trEhtqjIiDvFPF":"args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')","Q4EQgP4gZR8TTm7S":"let penalty = 0\nif (args.item?.system.attackType)\n{\n penalty -= 30\n}\nif (args.actor.has(\"Second Sight\", \"talent\"))\n penalty += 10\n\nargs.prefillModifiers.modifier += penalty","Q68WiUWY7GxiXBbT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\nlet data = item.toObject();\ndata.system.specification.value = \"When Alone\";\ndata.effects[0].disabled = true;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Q9EmlWmuDac83cJw":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","QF8LanKNoAlTkQG0":"this.actor.system.status.encumbrance.max += 2","QKTA2TqZ77pvHWSJ":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 0,\n \"bright\": 0,\n \"alpha\": 0.5,\n \"animation\": {\n \"type\": \"\",\n },\n \"color\": \"#000000\",\n }}));","QKjR6P1WEHXf4K77":"args.fields.slBonus -= 2\n","QPVVDPcJ4Xi5FmQl":"if(this.actor.hasCondition(\"fatigued\") && args.opposedTest.result.hitloc.value == \"head\" && (args.opposedTest.attackerTest.result.critical || args.actor.status.wounds.value - args.totalWoundLoss < 0))\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"unconscious\")\n }\n}","QQ2gHThZHdO4yLLX":"return args.skill?.name == game.i18n.localize(\"NAME.Swim\");","QQPiREc50HT5W2Tr":"if (args.item.type == \"weapon\" && args.item.weaponGroup.value == \"brawling\")\n args.item.damage.value += \" + 1\"","QRSACifDrvojIXHB":"if (!this.actor.effects.find(e => e.isCondition))\n{\n\treturn this.script.scriptNotification(\"No Conditions on this Actor\")\n}\n\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choose a Condition\")\n\nif (choice[0])\n{\n\tthis.actor.removeCondition(choice[0].conditionId)\n}\n","QaGNsqKm2Nf0zGVm":"return [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","QbIYnshWeP1U8SUy":"args.applyAP = false;\nargs.applyTB = false;","Qgn92fZyc3Psn8QJ":"if (args.test.options.useOnesAttractive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`)\n}","Qk7t2l5ep9RDVpgE":"args.options.diceman= true;","QoEOxRruQXYrZrv3":"let filters = [\n {\n property : \"type\",\n value : \"skill\"\n },\n {\n property : \"name\",\n value : /Melee/gm,\n regex: true\n }\n]\n\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, \"Choose 2 Skills to add +20\")\nitems = items.map(i => i.toObject())\nitems.forEach(i => i.system.advances.value = 20)\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","QqkE7rlqhkeRohFD":"return !([\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\"))","QqybHxNCzPEzG1Qh":"return args.fields.dualWielding || args.options.dualWieldOffhand","QwHoqu2oO8QO8Mad":"let content = `${this.effect.name}: All targets engaged with ${this.actor.prototypeToken.name} take [[/r 1d10]] Damage, modified by TB and AP.`\n\nthis.script.scriptMessage(content)","R32U01LBjBrK1pns":" const templateMap = {\n 'P2e7Yx98bK3u110a' : \"\",\n 'iuMp3KLaMT2WCmie' : \"Xp4r2KUhqfjak8zq\", \n 'RBuYcT5tppwcmnC5' : \"wYN19h3WVF1yOVq2\", \n 'vcGpNwNbhvfzVveQ' : \"ac5ClOuaYtzOYyWp\", \n 'jmhKZy0w9TzkEK9c' : \"IS3LTdTuay6uRHUq\", \n '9Byj6k7SmdTYis2V' : \"LjMlx99gBGeRJUQu\", \n 'laJwc2l9tzJPgaaJ' : \"x5wpMprsObuqMCYg\",\n }\n let template = (await game.wfrp4e.tables.rollTable(\"hireling-templates\", {hideDSN: true})).object;\n let physicalQuirk = (await game.wfrp4e.tables.rollTable(\"physical-quirks\", {hideDSN: true})).text;\n let workEthic = (await game.wfrp4e.tables.rollTable(\"work-ethic\", {hideDSN: true})).text;\n let personalityQuirk = (await game.wfrp4e.tables.rollTable(\"personality-quirks\", {hideDSN: true})).text;\n\n\n let templateItem = await game.wfrp4e.utility.findItemId(templateMap[template._id]);\n\n let bio = \n `\n

Template: ${template.text}

\n

Phsyical Quirk: ${physicalQuirk}

\n

Work Ethic: ${workEthic}

\n

Personality Quirk: ${personalityQuirk}

\n `\n \n this.script.scriptMessage(bio, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n\n await this.actor.update({\"system.details.gmnotes.value\" : bio})\n\n if (templateItem)\n {\n this.actor.createEmbeddedDocuments(\"Item\", [templateItem.toObject()])\n }","R5dOZWFxE2n6tooX":"return this.item.system.usesLocation(args.weapon)","R6SnyF3y4Vsq6oga":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 1\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","R95pDZMHnD9iHAl8":"return args.skill?.name.includes(this.item.system.tests.value);","RDtJXji3hgcKnEBk":"let as = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\nlet hv = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR\")).toObject();\nlet ms = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.6w30u0VPsAicrqb5\")).toObject();\nlet ss = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2\")).toObject();\n\nas.name += \" (Sight)\";\n\nlet roll = (await new Roll(\"1d10\").roll());\nroll.toMessage(this.script.getChatData())\nlet items = []\n\nif (roll.total <= 2)\n{\n items = items.concat([as]);\n}\nelse if (roll.total <= 4)\n{\n items = items.concat([hv]);\n}\nelse if (roll.total <= 6)\n{\n items = items.concat([ms]);\n}\nelse if (roll.total <= 8)\n{\n items = items.concat([ss]);\n}\nelse if (roll.total <= 10)\n{\n items = items.concat([as, hv, ms, ss]);\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","RHyBLYT5oHf7EPnG":"let skills = this.actor.itemTypes.skill.filter(i => i.name.includes(game.i18n.localize(\"NAME.Melee\")))\n\nlet skill = await ItemDialog.create(skills, 1, \"Select the skill used by the weapon\")\nlet group = game.wfrp4e.utility.extractParenthesesText(skill[0]?.name)\nlet groupKey = game.wfrp4e.utility.findKey(group, game.wfrp4e.config.weaponGroups)\n\nlet weapon = {\n\tname : this.effect.name,\n\ttype : \"weapon\",\n\timg : this.effect.img,\n\tsystem : {\n\t\t\"damage.value\" : this.actor.system.characteristics.wp.bonus,\n\t\t\"weaponGroup.value\" : groupKey || \"basic\",\n\t\t\"twohanded.value\" : [\"polearm\", \"twohanded\"].includes(groupKey),\n\t\t\"reach.value\" : \"average\",\n\t\t\"qualities.value\" : [{name : \"magical\"}]\n\t},\n}\n\nItem.implementation.create(foundry.utils.expandObject(weapon), {parent : this.actor, fromEffect : this.effect.id})\nthis.script.scriptNotification(\"Item created. Further customization must be done manually within the Item's sheet\");","RI8crJxeD8JLDwMh":"return args.weapon?.system?.weaponGroup?.value != \"fencing\"","RJpglw5eVRM1f9t0":"args.wounds *= 5","RKIFGN583PQnqHGk":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2)\n this.script.scriptMessage(\"Gained 2 Bleeding Conditions\")\n}","RNHrSTfMLXm5sXkC":"return [\"ws\", \"bs\", \"s\", \"ag\"].includes(args.characteristic)","RNr9CwyvLhlnwD2h":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","ROXCqAFSTLouJniL":"if (args.test.spell.name == \"Warp Lightning\")\n{\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\n {\n this.script.scriptMessage(`${this.item.name} Overloads!`)\n }\n}","RSsGiDFibuqg3sHr":"let diseaseIndex = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"disease\")\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(diseaseIndex , 1, \"Choose a Disease\")\n\nif (choice[0])\n{\n\tawait this.item.updateSource({\"system.specification.value\" : choice[0].name})\n}","RZlMkxJz5apn0mUj":"return args.item?.system.attackType != \"ranged\"","RprZWlnopSqZt7KZ":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","RqWnhnwFxaHubgiA":"await args.actor.addCondition(\"blinded\");\nawait args.actor.addCondition(\"deafened\");\nawait args.actor.addCondition(\"stunned\");","RrchOMpEdIvceJxl":"return args.skill?.name == \"Stealth (Rural)\"","RuW1PWUFxIbbSlIm":"return ![\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","RvipIYj9H7n4UDMe":" let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : -5,\n \"t\" : -5,\n \"i\" : -10,\n \"ag\" : -10,\n \"dex\" : -10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = []\n let skillAdvancements = []\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","S1QihXuvdEVzeRtB":"let dice = await new Roll(\"1d10\").roll()\nlet roll = dice.total\nlet talent \nlet message\nlet modifier = 0\n\nif (roll <= 3)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\n}\n\nelse if (roll <= 6)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.OEjUvJKi0xmBwbS2\")\n modifier = -3\n}\n\nelse if (roll <= 9)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mdPGZsn2396dEpOf\")\n modifier = -3\n}\n\nelse if (roll = 10)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\n modifier = -5\n}\n\nmessage = `${roll} Rolled, gain ${item.name}, ${modifier} Strength`\ndice.toMessage(this.script.getChatData())\n\nlet changes = duplicate(this.effect.changes)\nchanges[0].value = modifier\n\nthis.effect.updateSource({changes})\n\nawait this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})\n\nthis.script.scriptNotification(message)","S3DCTw4yJ85eSaKp":"this.actor.setupCharacteristic(\"s\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(test => test.roll())","S3Dev4hleOYqDNe9":"if (args.test.options.healWounds) {\n if (args.test.succeeded) \n {\n let wounds = this.actor.characteristics.int.bonus + Number(args.test.result.SL)\n if (args.test.options.fieldDressing && args.test.result.reversed)\n {\n wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL))\n }\n\targs.test.result.woundsHealed = wounds\n\targs.test.result.other.push(`${this.actor.name} healed ${wounds} wounds of the patient.`)\n }\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\n {\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\n }\n}","S4793DLFhjMxpM8x":"return ![\"ws\", \"bs\"].includes(args.characteristic) && !args.item?.system.attackType && !args.options.dodge","S6tUyFJvGMV19mvP":"this.actor.status.addArmour(2, {source: this.effect})","S95QqpX1cZyIVCPy":"if (parseInt(this.item.system.specification.value) > 0)\n{\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\n}\n\n","SGr50Hq1AHIEzIFN":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\n int : game.wfrp4e.config.characteristics.int,\n fel : game.wfrp4e.config.characteristics.fel\n}, this.effect.img), 1, \"Choose Characteristic\");\n\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","SLy1Fs3oXcHgFgjK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\nlet value = getProperty(this.effect.sourceTest, \"result.overcast.usage.other.current\") || 1\ndata.system.specification.value = value\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","SO4Aa9argKbuO9rQ":"args.prefillModifiers.modifier -= 20","SPOkFWZWziZk5b7A":"return args.item?.system?.attackType != \"melee\"","SRmfstEs278bP9Pz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","SSqGxyN9hw0HDmED":"this.actor.addCondition(\"prone\");","SWIJjM2RCmzfr64u":"if (args.test.result.hitloc.result == \"head\")\n{\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40\n\n args.test.result.critical += ` (+${args.test.result.critModifier})`\n}\n","SrCHfOJFZwDickqa":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","StAderQaQQsxb6Rv":"let target = await game.wfrp4e.tables.rollTable(\"fixations\")\nif (target)\n{\n this.script.scriptNotification(target.result);\n let hatred = this.actor.items.find(i => i.getFlag(\"wfrp4e\", \"fromEffect\") == this.effect.id)\n if (hatred)\n {\n hatred.update({\"system.specification.value\" : target.result})\n }\n}","SvFKt9hMcFQjeILA":"args.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","T5fiTzhXEQAv9Drf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rlDZZTj5PXjuRXa2\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key;\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n\nlet location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","T74FEjfFrh3f6MKv":"args.wpb = args.sb;","TAw9vXnfyIAl5DGs":"if (this.item.system.quantity.value)\n{\n game.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData());\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","TBpNFRL5uehs0fze":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[0]]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","TEiNj5FgkoD3YbhS":"this.actor.hasCondition(\"bleeding\")?.delete()","TGN070HeJLl3gSMY":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"Goes Prone\" }})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","TNWmIkuubqBn38he":"this.effect.deleteCreatedItems();","TOyQLrugFGzwc5nY":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption);","TQRL4mZhZohXg1Au":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\ntest.roll();","TU2xjbJ0zFtytF3J":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\");","TY0xSQ00XXyEr49r":"args.fields.slBonus += 1;","TcqumwUFAL6V0cty":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\n{\n this.item.system.AP = {\n \"head\": 0,\n \"lArm\": 0,\n \"rArm\": 0,\n \"lLeg\": 0,\n \"rLeg\": 0,\n \"body\": 0\n }\n}","TdjlJro0RRVSh8g8":"return args.skill?.name != game.i18n.localize(\"NAME.Gamble\") && args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\");","TmaS8o33825QUMrx":"let stomp = game.wfrp4e.config.systemItems.stomp;\nlet test = await this.actor.setupTrait(stomp)\nawait test.roll();","TnFobCxG4pxlYmKr":"let gorCharacteristics = {\n \"ws\": 45,\n \"bs\": 30,\n \"s\": 35,\n \"t\": 45,\n \"i\": 30,\n \"ag\": 35,\n \"dex\": 25,\n \"int\": 25,\n \"wp\": 30,\n \"fel\": 25\n}\nfor (let char in this.actor.characteristics) {\n if (this.actor.characteristics[char].initial < gorCharacteristics[char])\n this.actor.characteristics[char].initial = gorCharacteristics[char]\n}","ToKlHDAjJOsC51ag":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"unconscious\")\n}","TpZItJ5Ugbazaobd":"let locations = [];\n\nwhile (locations.length < 2)\n{\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\n if (!locations.includes(loc.result))\n {\n locations.push(loc.result);\n }\n}\n\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\n\nthis.item.updateSource({name : this.item.name += ` (${locationText})`, \"flags.wfrp4e.locations\" : locations})\nthis.effect.updateSource({\"flags.wfrp4e.locations\" : locations})","Tq45Nd8J3eTvHT41":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.SetTrap\");","TrIYdcG3jDER4WgY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xsGbDFqK2qh7lsIj\")\nlet data = item.toObject();\ndata.system.specification.value = \"Minor\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","TwgdEucxcHloc4cX":"let choice1 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n]\nlet choice2 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n {\n type : \"armour\",\n name : \"Leather Leggings\"\n },\n {\n type : \"armour\",\n name : \"Leather Skullcap\"\n },\n {\n type : \"armour\",\n name : \"Leather Jack\"\n },\n]\nlet choice3 = [\n {\n type : \"armour\",\n name : \"Plate Breastplate\"\n },\n {\n type : \"armour\",\n name : \"Plate Bracers\"\n },\n {\n type : \"armour\",\n name : \"Plate Helm\"\n },\n {\n type : \"armour\",\n name : \"Plate Leggings\"\n },\n]\n\nlet choice = await new Promise((resolve, reject) => {\n new Dialog({\n title : \"Choice\",\n content : \n `

\n Select your choice\n

\n
    \n
  1. Mail
  2. \n
  3. Mail & Leather
  4. \n
  5. Plate
  6. \n
\n `,\n buttons : {\n 1 : {\n label : \"Mail\",\n callback : () => {\n resolve(choice1)\n }\n },\n 2 : {\n label : \"Mail & Leather\",\n callback : () => {\n resolve(choice2)\n }\n },\n 3 : {\n label : \"Plate\",\n callback : () => {\n resolve(choice3)\n }\n }\n }\n }).render(true)\n}) \n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Could not find ${c.name}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","TwwKxFjK6TNGKbRB":"this.script.scriptMessage(await this.actor.applyBasicDamage(12, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addSystemEffect(\"cold1\")\n}\n\n","TxfmxDGBj04AQQpt":"let weapon = args.opposedTest.defenderTest.weapon\nif (\n !args.opposedTest.result.swapped && \n args.opposedTest.result.winner == \"defender\" && \n args.opposedTest.attackerTest.result.damage && \n weapon && \n weapon?.system.properties.qualities.fast\n )\n{\n args.opposedTest.swap(this.effect.label);\n}","TzgmYRXFXRspIo1i":"this.effect.delete();","U1RUcgP8LD2qeGTm":"return !args.options.reload","U1UpSRJOSjPpO4HS":"let mutations = await game.wfrp4e.utility.findAll(\"mutation\", \"Loading Mutations\")\nlet roll = Math.floor(CONFIG.Dice.randomUniform() * mutations.length);\nthis.actor.createEmbeddedDocuments(\"Item\", [mutations[roll]]);\nthis.script.scriptNotification(`Added ${mutations[roll].name}`)","U26XMie3Kjoddisj":"let stunned = this.actor.hasCondition(\"stunned\")\nif (stunned)\n{\n this.script.scriptNotification(`Cleared 1 Stunned Condition`)\n this.actor.removeCondition(\"stunned\");\n}\nelse \n{\n\tthis.script.scriptNotification(`No Stunned Conditions`)\n}","U2xKn7R1gm8kiQm8":"this.actor.hasCondition(\"broken\")?.delete();\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","U4A8FDNmwBGTuQZO":"if (args.attacker.has(\"Undead\") && !args.attacker.has(\"Ethereal\"))\n{\n args.totalWoundLoss = Math.floor(args.totalWoundLoss / 2)\n args.modifiers.other.push({label : this.effect.name, details : \"Halved\", value : \"× 0.5\"})\n}","U5ndCwcJ1s3Ns26w":"args.item.system.qualities.value.push({name : \"magical\"});\nargs.item.system.damage.value += ` + ${parseInt(this.effect.sourceTest.result.SL)}`;\nargs.item.name += ` (${this.effect.name})`","U78c4oUjKwyUu6jT":"return (args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.characteristic != \"fel\")","U9xh2wriSqCosugW":"if (args.test.options.stag)\n{\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\n\t{\n\t\tif (parseInt(args.test.result.SL) < 0)\n\t\t{\n\t\t\targs.test.result.SL = \"+0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\n\t\t}\n\t\targs.test.result.outcome = \"success\"\n args.test.result.other.push(`${this.effect.name}: Minimum +0 SL`)\n\t}\n}","UC6G3pFQwzUhrw6F":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\");","UH5MIzqi2MvEqTwj":"if (args.totalWoundLoss > 0)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData());\n args.totalWoundLoss += roll.total;\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\n}","ULmZMLezDamerN04":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Loading Spells\")\n\nlet lore = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).text\nthis.script.scriptNotification(lore)\nif (lore == \"GM's Choice\") {\n return\n}\n\nelse if (lore == \"Arcane Magic\") {\n lore = \"Arcane\"\n}\n\nelse if (lore == \"Petty Magic\") {\n lore = \"petty\"\n}\n\nelse {\n lore = lore.toLowerCase();\n}\n\nlet spellsWithLore = []\nif (lore == \"Arcane\") {\n spellsWithLore = spells.filter(i => !i.system.lore.value)\n}\nelse {\n spellsWithLore = spells.filter(i => i.system.lore.value == lore)\n}\n\nlet selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\nItem.implementation.create(selectedSpell.toObject(), { parent: this.actor}).then(item => {\n this.actor.setupCast(item).then(test => test.roll());\n})","UTlgF4azrGQZsoDv":"const talents = await Promise.all([\"Ambidextrous\", \"Distract\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","UWrzokgabRKUpnkG":"return [\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","UYLXm2W6jVn21Age":"args.fields.modifier += 40;","UaImulhbPURkLJg2":"return this.actor.attacker && (args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","UgQW0UMPOZ0jwfVJ":"let current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : 1 + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} fortune points increased from ${current} to ${1 + current}`)","Um6xMMiUftLXJxEt":"return [\"fel\", \"dex\"].includes(args.characteristic)","UnqnWi0dZYLf5fTT":"let choice1 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n]\nlet choice2 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n {\n type : \"armour\",\n name : \"Leather Leggings\"\n },\n {\n type : \"armour\",\n name : \"Leather Skullcap\"\n },\n {\n type : \"armour\",\n name : \"Leather Jack\"\n },\n]\nlet choice3 = [\n {\n type : \"armour\",\n name : \"Plate Breastplate\"\n },\n {\n type : \"armour\",\n name : \"Plate Bracers\"\n },\n {\n type : \"armour\",\n name : \"Plate Helm\"\n },\n {\n type : \"armour\",\n name : \"Plate Leggings\"\n },\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `

\n Select your choice\n

\n
    \n
  1. Mail
  2. \n
  3. Mail & Leather
  4. \n
  5. Plate
  6. \n
\n `,\n buttons : {\n 1 : {\n label : \"Mail\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Mail & Leather\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"Plate\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Could not find ${c.name}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","UsAHQecRlWL5PhP6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.corruptionDialog(\"moderate\") \n }\n})","UsuwsmU1TUQLQVM2":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\nreturn !args.spell || (args.type == \"cast\" && [\"petty\", lore].includes(args.spell.system.lore.value));","UvycHOjSPm5Zv9KJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nlet baseDamage = \"4\";\nif (test.succeeded)\n baseDamage = \"0\";\n \nlet damage = this.effect.sourceItem.system.computeSpellDamage(baseDamage, true) + parseInt(this.effect.sourceTest.result.SL);\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg : true}))\nthis.actor.addCondition(\"ablaze\")","UwjkHRAQHESdYXJs":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 2,\n \"bright\": 1,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"pulse\",\n },\n \"color\": \"#949bff\",\n}}));","Ux4buMc7llF1Kg8p":"if (!this.actor.hasCondition(\"stunned\") && !this.actor.hasCondition(\"unconcscious\"))\n{\n this.effect.delete();\n}","V1D2Uo3WDKYQePU3":"let damage = this.effect.sourceTest.result.damage;\n \nlet loc = \"head\"\nlet APatLoc = this.actor.system.status.armour[loc];\n\nlet metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\n\nlet APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\n\ndamage -= (APused + this.actor.system.characteristics.t.bonus)\n\nlet msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\nmsg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`\nthis.script.scriptMessage(msg)\n","V2lsVTi6q28eL5jl":"args.fields.slBonus += parseInt(this.effect.sourceTest.result.SL)","V7qmFwUMCY2tfziH":"this.actor.addCondition(\"stunned\")","V9wD9FWHWxZUOGSI":"let roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\nlet fatigued = roll.total\nroll.toMessage(this.script.getChatData());\nif (fatigued > this.actor.characteristics.wp.bonus)\n{\n this.actor.addCondition(\"unconscious\")\n this.script.scriptNotification(`Fell Unconscious`)\n}\nelse \n{\n fatigued = Math.max(0, fatigued)\n if (fatigued)\n this.actor.addCondition(\"fatigued\", fatigued)\n this.script.scriptNotification(`Gained ${fatigued} conditions`)\n}","V9xm4X1x3lPYTQaI":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\tthis.script.scriptNotification(\"Immune to Fear\");\n\targs.extendedTest.delete();\n\targs.abort = true;\n}","V9zm2hKUVLVZtAcN":"let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : 0,\n \"t\" : 15,\n \"i\" : 15,\n \"ag\" : -20,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charm\", \"Channelling\", \"Entertain (Prophecy)\", \"Intuition\"]\nlet skillAdvancements = [0, 0, 20, 10]\nlet talents = [\"Detect Artefact\", \"Menacing\", \"Sixth Sense\"]\nlet traits = [\"Dooming\", \"Spellcaster (Lore of Life)\", \"Ward\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Forest of Thorns\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Could not find ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","VAPsww9x3HAw1sKP":"return !args.options.dodge","VAs1nXvicdQK18Do":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","VKpKq4RSbI1KkUQK":"this.actor.flags.useless[this.effect.getFlag(\"wfrp4e\", \"location\")] = true;","VNOKTzCrFbZ6PJUj":"return ![\"Charm Animal\", \"Endurance\", \"Outdoor Survival\"].includes(args.skill?.name)","VQaC6ynouW5EQCbC":"let roll = await new Roll(\"1d10\").roll();\n\nawait roll.toMessage(this.script.getChatData());\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}));\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\nawait test.roll();\n\nif (test.succeeded)\n{\n return false;\n}","Vb7rgl8T4VRswbnZ":"this.actor.status.addArmour(parseInt(this.item.system.specification.value) || 0, {source: this.effect, damage : this.item.getFlag(\"wfrp4e\", \"APdamage\")})","VbL0TgaBAmYjrezZ":"const talents = await Promise.all([\"Hardy\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","Vkuu70BZV4DPYO2Q":"return args.item?.system?.attackType != \"ranged\"","VlFUDaKUYoBYKYn0":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","VqTrKPtxv9hpn0Hr":"return args.skill?.name != \"Language (Magick)\"","VuE1mhrB6X6MYTzg":"return args.characteristic == \"fel\"","VurA2XNqC0d9U49C":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"fatigued\") \n }\n})","VzO0ZDcTWvaBn4vm":"if (args.test.preData.skillName?.includes(game.i18n.localize(\"NAME.Language\")) || args.test instanceof CastTest)\n{\n\tif (parseInt(args.test.result.SL) > 0 || args.test.succeeded)\n\t{\n\t\tif (parseInt(args.test.result.SL) > 0)\n\t\t{\n\t\t\targs.test.result.SL = \"-0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalFailure\");\n\t\t}\n\t\targs.test.result.outcome = \"failure\"\n args.test.result.other.push(`${this.effect.name}: Maximum -0 SL`)\n\t}\n}","VzgTGb5QXKoyPNh3":"if (args.attackerTest.weapon && args.defenderTest.weapon)\n{\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\n \n if (attackerReach == defenderReach)\n defenderReach = defenderReach < 7 ? defenderReach + 1 : defenderReach \n\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\n\n args.attackerTest.weapon.reach.value = attackerReach\n args.defenderTest.weapon.reach.value = defenderReach\n}","W9nyUNQStMr1pUHJ":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Added Bleeding\")\n}","WB6sIpLEPC8YPX67":"if (args.options.dodge)\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Cannot Dodge!\")\n}\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","WKXyVHQwQCNTfSKv":"if ((args.item.type == \"weapon\" || args.item.system.attackType) && !args.item.isMagical )\n{\n args.item.system.qualities.value.push({name : \"magical\"})\n}","WO5n7Vbx8AgoVrwC":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let skills = [\"Intuition\", \"Lore (Local)\", \"Perception\"]\n let skillAdvancements = [10, 10, 10]\n let talents = []\n let trappings = [\"Mail Coat\", \"Mail Chausses\", \"Mail Coif\", \"Hand Weapon\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","WPQbVpD1uwSLAXq1":"if (this.actor.system.status.wounds.value == 0)\n{\n\tthis.actor.addCondition(\"dead\");\n}","WRe1eGmGVGejPcS8":"let wind = this.effect.name.split(\" \")[2]\nreturn args.type == \"cast\" && game.wfrp4e.config.magicWind[args.item.system.lore.value] == wind;","WTRYAEzwxRuGENyI":" // Every living creature within 10 yards, other than the wielder of the hammer,\n // must make a Challenging (+0) Endurance Test \n\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true, appendTitle : \" - \" + this.effect.name,\n fields: {difficulty: \"challenging\"}\n })\n \n await test.roll();\n if (test.failed)\n {\n // or gain a Deafened Condition \n this.actor.addCondition(\"deafened\");\n // and suffer 1d10 Wounds which bypass armour but not Toughness Bonus.\n let damage = (await new Roll(\"1d10\").roll());\n await damage.toMessage(this.script.getChatData());\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n }","WY3DajPRGcMNt158":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","WiYtNU2Y5BJfIpeM":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","WnWA0e0bgqBsZp2L":"this.item.update({\"system.twohanded.value\" : !this.item.system.twohanded.value})","Wo4wQKUxSItAhRzZ":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 3\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","WwxXgsNxlccmqTze":"this.actor.addCondition(\"dead\")","WzMmwjZbhyCbHxyZ":"this.actor.status.encumbrance.state += 2\nthis.actor.status.encumbrance.pct = 100;","X3bLbOfcJAftOMa7":"return [\"ws\", \"bs\", \"ag\"].includes(args.characteristic)","X7ikFOGKYzTMr4d1":"args.fields.difficulty = \"difficult\"","XClTZOjuhcxWLF51":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"difficult\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}\n\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.4lj1ik958mbgAlaF\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","XO9m2AvFRAAeEuty":"if (args.test.options.fieldDressing && args.test.result.reversed)\n{\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\n\targs.test.result.other.push(`${this.effect.name}: SL limited to 1`)\n}","XPxAKqPpPYE4E6B5":"args.fields.modifier -= 10 * this.effect.conditionValue","XRrGBbplNLZpXnCH":"let item;\nlet items = []\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\n{\n let data = item.toObject();\n data.system.specification.value = 2\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\n{\n let data = item.toObject();\n data.system.specification.value = 1;\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\n{\n let data = item.toObject();\n data.system.specification.value = 1;\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.mDgEMOoJpi8DkRYb\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\n{\n let data = item.toObject();\n data.system.specification.value = 2;\n items.push(data)\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\n","XXnzUdsIYQ9Wjyu0":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale || this.actor.sameSideAs(this.effect.sourceActor)","XYaYeiVkc5GKYTjC":"return args.spell?.system.lore.value != \"fire\"","XcvDYNZgJ2rpAdDV":"\n let fatigued = this.actor.hasCondition(\"fatigued\")\n if (!fatigued)\n {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Fatigued added to \" + this.actor.name + \" which cannot be removed until the Malaise symptom is gone.\")\n }","Xe8ijqWU3bbtq7ZY":"if (args.opposedTest.defenderTest.actor.Species.toLowerCase().includes(\"skaven\"))\n{\n args.addImpact = true;\n args.opposedTest.result.other.push(\"Impact against Skaven\")\n}","Xf4FcZ4ZLdWmOXBa":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","XfRvVBTVIuAm8RaZ":"return args.item?.name != game.i18n.localize(\"NAME.CharmAnimal\")","Xg4qHLsyXGuUZfT8":"this.actor.hasCondition(\"ablaze\")?.delete();","Xk9XPklxxTvFlwpI":"args.options.useOnesArgumentative = true;","XthZ3GCC3WhsEI2g":"args.update({light : {\n \"dim\": 10,\n \"bright\": 5,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"flame\",\n },\n \"color\": \"#ac9e6c\",\n}});","Xu5cED1MhT4ba7da":"args.fields.modifier += 10\n","XuFxKPYheYF4WMmQ":"return args.skill?.name != game.i18n.localize(\"NAME.Cool\");","Y6ppJBerpM3TtSic":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.g4Q6AtzZuo5iIvD4\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","Y7McxsHFeGhwQx0J":"this.actor.createEmbeddedDocuments(\"Item\", [expandObject({\n name : \"Ghostly Flame\",\n type : \"weapon\",\n img : this.effect.img,\n system : {\n \"weaponGroup.value\" : \"throwing\",\n \"damage.value\" : \"SB + WPB\",\n \"qualities.value\" : [{name : \"magical\"}],\n \"equipped\" : true\n }\n})], {fromEffect: this.effect.id})","Y8J66v8VTKUASGuK":"if (!this.actor.effects.find(e => e.isCondition))\n{\n\treturn this.script.scriptNotification(\"No Conditions on this Actor\")\n}\n\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choose a Condition\")\n\nif (choice[0])\n{\n\tawait this.actor.removeCondition(choice[0].conditionId)\n}\n\nif (this.actor.effects.find(e => e.isCondition))\n{\n return false; // Delete the effect if there are still conditions, otherwise, effect remains and provides the bonus\n}","YDqpKJVy8ijEKdLX":"return !(this.actor.attacker && (args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\")))","YEBw2CzHYxsTpTy5":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\");","YFSgWRXel0bWE3EE":"return [\"ag\", \"ws\", \"bs\"].includes(args.characteristic) || args.skill?.name == game.i18n.localize(\"NAME.Climb\");","YHEIkBKWXKNPqglh":"if (args.test.result.castOutcome == \"success\")\n{\n game.wfrp4e.utility.postCorruptionTest(\"moderate\", this.script.getChatData())\n}\n","YMaxpXnml01bLGpO":"return args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","YOKoZFlBEpFavfOS":"return args.type == \"channelling\"","YQ2LnLxp0xgy3meI":"if (args.test.preData.options?.corruption && args.test.failed) {\n args.test?.result?.other.push(\"Gain additional +1 Corruption from \" + this.effect.name)\n}","YRUTliBzAQvncGNX":"this.actor.addCondition(\"fatigued\");\nthis.script.scriptNotification(\"Added Fatigued\")","YaKnYEbmmZZtByJc":"if (args.opposedTest.attackerTest.options.ballockKnife)\n{\n args.weaponProperties.impale = true;\n args.extraMessages.push(`${this.item.name}: Impale Added`)\n}","Yf2MmOzazzMdmoPU":"let armour = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\nlet armourData = armour.toObject()\narmourData.system.specification.value = 1\n \nlet fury = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\nlet furyData = fury.toObject();\n\nlet horns = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet hornsData = horns.toObject()\nhornsData.system.specification.value = 6\n\nthis.actor.createEmbeddedDocuments(\"Item\", [armourData, furyData, hornsData], {fromEffect : this.effect.id})","YhhiWEQbox3WZA3Q":"return args.skill?.name == game.i18n.localize(\"NAME.Heal\") && game.combat?.active","YjAIsFlxKTJvYs60":"this.item.system.reduceQuantity();","YjJcRdytVRm88qLn":"args.options.additionalDamage = 1","YsS2RZsl2ZsqjhWV":"return !args.fields.charging","YwLEw4BiKq4EMy57":"let i_gain = (await new Roll(\"2d10\").roll()).total\nlet fel_gain = 0\nif (args.actor.characteristics.fel.value <= 0)\n{\n fel_gain += (await new Roll(\"2d10\").roll()).total\n}\n\nlet msg = `${this.actor.prototypeToken.name} gains ${i_gain} Intelligence`\n\nif (fel_gain)\n msg += ` and ${fel_gain} Fellowship`\n\n\nlet newInt = i_gain + args.actor.characteristics.int.modifier\nlet newFel = fel_gain + args.actor.characteristics.fel.modifier\n\nargs.actor.update({\"system.characteristics.int.modifier\" : newInt, \"system.characteristics.fel.modifier\" : newFel})\n\nthis.script.scriptMessage(msg)","YyKU2rIRmFSCqSlW":"let newEffect = this.effect.sourceItem.effects?.contents[1]\n\nif (newEffect)\n{\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [newEffect.convertToApplied()]);\n}","Z1zriXibT0mAmdhb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nitem = item.toObject()\nitem.name = this.effect.name\nitem.system.specification.value = this.actor.characteristics.s.bonus\nitem.system.description.value = \"\"\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","Z30zYayPryXOjT5N":"args.item.system.damage.value = \"SB + 6\";","Z4WrrlVGpPY4iUbG":"await this.actor.addCondition(\"ablaze\")","Z52yZDm6lP6fOP3O":"let ablaze = this.actor.hasCondition(\"ablaze\")\nif (ablaze)\n{\n this.script.scriptNotification(\"Immune to Ablaze\");\n ablaze.delete()\n}","Z6OmmC0irJzxSnMH":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\nlet message = \"\"\n\nlet wounds = duplicate(this.actor.status.wounds)\nlet regenRoll = await new Roll(\"1d10\").roll();\nlet regen = regenRoll.total;\n\nif (wounds.value >= wounds.max)\n return\n\nif (wounds.value > 0) \n{\n wounds.value += regen\n if (wounds.value > wounds.max)\n {\n wounds.value = wounds.max\n }\n message += `${this.actor.name} regains ${regen} Wounds.`\n\n if (regen == 10)\n {\n message += `
Additionally, they regenerate a Critical Wound.`\n }\n}\nelse if (regen >= 8) \n{\n message += `${this.actor.name} rolled a ${regen} and regains 1 Wound.`\n wounds.value += 1\n if (regen == 10)\n {\n message += `
Additionally, they regenerate a Critical Wound.`\n }\n}\nelse \n{\n message += `${this.actor.name} Regenerate roll of ${regen} - No effect.`\n}\n\nawait this.actor.update({ \"system.status.wounds\": wounds })\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n\nif (this.actor.Species?.toLowerCase() != \"ogre\")\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}}).then(test => {\n test.roll()\n })\n}\n\n\n\n\n\n\n\n\n\n\n\n\n","Z6jNlyZMECkW4Hon":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Loading Spells\", true);\n\nlet choice = await ItemDialog.create(spells, 1);\n\nif (choice[0])\n{\n this.script.scriptMessage(`Chose @UUID[${choice[0].uuid}]{${choice[0].name}}`)\n let spell = (await fromUuid(choice[0].uuid)).toObject(); // Might be an index so retrieve item object for sure\n setProperty(spell, \"flags.wfrp4e.boonOfTzeentch\", true);\n spell.system.wind.value = \"Channelling (Dhar)\";\n spell.system.memorized.value = true;\n this.actor.createEmbeddedDocuments(\"Item\", [spell], {fromEffect: this.effect.id})\n}","ZCkYe5XMVY1RWMXG":"args.options.wallcrawler = true;","ZCrfdLPOxiNDCDSg":"this.actor.effects.get(this.effect.id).delete(); // can't use this.effect because it thinks it's parent is the item, but it actually is the actor","ZCuOjLAeENKN1Q4L":"let halve;\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\n{\n halve = await Dialog.confirm({title : this.effect.name, content : \"Halve Damage? (Halves Damage from all fire)\"})\n}\nelse\n{\n halve = args.opposedTest.attackerTest.item?.system.lore?.value == \"fire\";\n}\n\nif (halve)\n{\n args.totalWoundLoss /= 2;\n args.modifiers.other.push({label : this.effect.name, details : \"Halved\", value : \"× 0.5\"})\n}","ZEXhYJqqxF6QAixX":"return args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","ZEdDcBka21rnMuz5":"let initiativeSetting = game.settings.get(\"wfrp4e\", \"initiativeRule\")\n\nswitch (initiativeSetting) {\n case \"default\":\n args.initiative += \"+10\"\n break;\n\n case \"sl\":\n args.initiative += \"+1\"\n break;\n\n case \"d10Init\":\n args.initiative += \"+10\"\n break;\n\n case \"d10InitAgi\":\n args.initiative += \"+1\"\n break;\n}","ZGlJnrIemqul24j7":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet biteData = bite.toObject();\nlet infectedData = infected.toObject();\n\nbiteData.system.specification.value = 4 - this.actor.characteristics.s.bonus\n\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, infectedData], {fromEffect : this.effect.id})","ZI2YnAAGoLpmVDIL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\nlet data = item.toObject();\ndata.system.specification.value = \"Religion\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZJy2rvpKmUHXGrAi":"args.actor.details.move.run *= 1.5","ZMwJad6v4G13SgjR":"return args.type == \"cast\" || args.type == \"channelling\"","ZNW3ubbKIYXAyE48":"let wounds = this.actor.itemTypes.disease.filter(i => i.name == \"Festering Wound\" && i.system.duration.active);\nlet selected;\nif (wounds.length == 0)\n{\n return this.script.scriptNotification(\"No Festering Wounds!\");\n}\nelse if (wounds.length == 1)\n{\n selected = wounds[0];\n}\nelse if (wounds.length >= 2)\n{\n selected = (await ItemDialog.create(wounds, 1))[0];\n}\n\nif (selected)\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}})\n await test.roll();\n if (test.succeeded)\n {\n let SL = parseInt(test.result.SL);\n if (SL >= 0)\n {\n selected.update({\"system.duration.value\" : selected.system.duration.value - SL})\n this.script.scriptMessage(`${selected.name} duration reduced by ${SL}!`)\n }\n }\n}","ZNu4B0OdjkM9lmtu":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name = data.name += \" (Vision)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZTE8LdRblyG4yYoE":"if (args.test.result.castOutcome == \"success\")\n{\n // Wait till after chat card is posted\n game.wfrp4e.utility.sleep(500).then(() => {\n game.wfrp4e.utility.postTerror(1, this.effect.name)\n game.wfrp4e.utility.postTerror(2, this.effect.name)\n })\n}","ZYsMgB4BwXBJcpYf":"// The wearer of the cloak causes Fear 2 \n// in Wolves, Lions, Goats, and Chimeras.\ngame.wfrp4e.utility.postFear(2, this.effect.name)\n","ZbuW8y7t9Y8oUFWq":"return !((args.type == \"weapon\" && (args.item.system.weaponGroup.value == \"blackpowder\" || args.item.system.weaponGroup.value == \"engineering\")) || (args.type == \"cast\" && args.item.system.lore.value == \"fire\"))","ZdHvGvSJBsIuPphF":"return !args.fields.dualWielding && !args.options.dualWieldOffhand","Ze9E2zR1GFGWGMVH":"return [\"Pick Lock\", \"Sleight of Hand\", \"Channelling (Ulgu)\"].includes(args.skill?.name)","ZhuitY1KOU1Xe7cP":"return !args.weapon?.system.properties.qualities.pummel","ZqTW093qENOwGONP":"let msg = \"\"\n\nlet SL = parseInt(this.effect.sourceTest.result.SL);\n\nfor(let i = 0; i < SL; i++)\n{\n msg += `

${await this.actor.applyBasicDamage(3, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP})}

`\n}\n\nthis.script.scriptMessage(msg);","ZrePyV2spv3v65Tg":"return args.type != \"weapon\" && !this.actor.statuses.has(\"infighting\")","ZsQR3AVKi0v5U593":"args.actor.addCondition(\"ablaze\", 2)","ZvbBM4gTJHPdU8jU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nreturn test.failed","Zxh4RAENoaAQAaNg":"return !this.actor.flags.useless.rEye || !this.actor.flags.useless.lEye || [\"wp\", \"t\", \"s\"].includes(args.characteristic)","ZxtOdwsM2Sqj9Zam":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.system.specification.value = 0\ndata.name = this.effect.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","a02tlRCXpaoaDjSN":"let careers = await game.wfrp4e.utility.findAll(\"career\", \"\", true);\ncareers.forEach(c => {\n if (!c.id)\n {\n c.id = c._id;\n }\n});\nlet choice = await ItemDialog.create(careers, 1, \"Choisissez la carrière de votre double identité\");\nif (choice[0])\n{\n let career = await fromUuid(choice[0].uuid);\n let data = career.toObject();\n setProperty(data, \"flags.wfrp4e.doubleLife\", true);\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n this.effect.updateSource({name : this.effect.name + ` (${data.name})`})\n}\n","a0YU3whUm16wGBNu":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.addCondition(\"fatigued\");\n}","a4Aza4a9v8JMU8dC":"const talents = await Promise.all([\"Frénésie\", \"Résistance à la Magie\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","a6gacHsvgwtsIFSQ":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.Research\"))\n args.test.preData.canReverse = true","a7pEvCycVnFBXGAQ":"let test = await this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - Assomé\", fields : {difficulty : \"easy\"}})\nawait test.roll();\n\nif (!test.succeeded)\n{\n\tthis.actor.addCondition(\"stunned\");\n}","a8RabrnJ08O07rDX":"if (args.totalWoundLoss > 0)\n{\n // I'm assuming the endurance test specified is for the end-round check\n await args.actor.addCondition(\"poisoned\", 2);\n}","a8i0sA1RBnD8nHZt":"let caster = this.effect.sourceActor\nlet targetedItem = this.actor.items.get(this.effect.flags.wfrp4e.itemTargets[0])\n\nlet qualities = foundry.utils.deepClone(game.wfrp4e.config.itemQualities);\nlet flaws = foundry.utils.deepClone(game.wfrp4e.config.itemFlaws);\n\nif (targetedItem.type == \"weapon\")\n{\n mergeObject(qualities, game.wfrp4e.config.weaponQualities)\n mergeObject(flaws, game.wfrp4e.config.weaponFlaws)\n}\nelse if (targetedItem.type == \"armour\")\n{\n mergeObject(qualities, game.wfrp4e.config.armorQualities)\n mergeObject(flaws, game.wfrp4e.config.armorFlaws)\n}\n\nfor(let q in qualities)\n{\n // If the weapon already has a flaw, don't put it in the dialog\n if (targetedItem.system.properties.qualities[q])\n {\n delete qualities[q]\n }\n}\nfor(let f in flaws)\n{\n // If a weapon doesn't have a flaw, don't put it in the dialog\n if (!targetedItem.system.properties.flaws[f])\n {\n delete flaws[f]\n }\n}\n \nlet added = await ItemDialog.create(ItemDialog.objectToArray(qualities), \"unlimited\", \"Choisissez la Qualité à ajouter\");\nlet removed = []\nif (!foundry.utils.isEmpty(flaws))\n{\n removed = await ItemDialog.create(ItemDialog.objectToArray(flaws), \"unlimited\", \"Choisissez le Défaut à enlever\");\n}\n\nthis.effect.updateSource({\"flags.wfrp4e.propertiesChanged\" : {added : added.map(i => i.id), removed : removed.map(i => i.id)}})\n","aAvJrAKLzXhS9qN6":"return args.item?.name == game.i18n.localize(\"NAME.Climb\")","aCVtaW8ag1WibcAr":"args.attacker.modifyWounds(1)\nthis.script.scriptMessage(`${args.attacker.prototypeToken.name} récupère 1 Blessure.`)","aIYUsBIDKWJ3CEtj":"this.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true}));","aMHGjWyn6BXCI4pw":"let frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.hXcfygzujgyMN1uI\");\nthis.actor.createEmbeddedDocuments(\"Item\", [frenzy], {fromEffect: this.effect.id})","abLWYtNTu1UVDQAs":"if (args.opposedTest.result.hitloc.value == this.effect.flags.wfrp4e.location) // e.g. 'head', rLeg, 'lArm'\n{\n this.scriptMessage(`Reçoit l'état @Condition[Aveuglé] comme ${this.item.name} a été touché`);\n this.actor.addCondition(\"blinded\");\n}","abVIvJBzuskNzCQv":"let amount = this.effect.sourceTest.result.overcast.usage.other.current;\n\nlet sss = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\nlet strider = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\n\nlet items = Array(amount).fill(sss).concat(Array(amount).fill(strider))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","afdmOvPGMpEdZvCb":"return (args.skill?.name == game.i18n.localize(\"NAME.Perception\") || args.characteristic == \"fel\")","agsm3NI1NDtHRG4y":"this.actor.getActiveTokens().forEach(t => t.document.update({texture : this.actor.prototypeToken.texture}, {animate : false}));","ahbA7o5G9dzMFl76":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","alJgj25l3239h2SW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hTgrGkWnmIR4xhVe\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ayIbw2Vw2t9xg33P":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","b1zMefdoZYtzCm7i":"return [\"roll\", \"none\"].includes(args.fields.hitLocation) || args.item?.attackType != \"ranged\"","b2Kb4IuD22RhKhR0":"let actor = Array.from(game.user.targets)[0]?.actor;\n\nif (actor)\n{\n actor.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[0].uuid})\n}\nelse\n{\n this.script.scriptNotification(\"Aucune cible!\", \"error\")\n}","b2WaqRna5CFXmbDG":"args.options.stag = true;","b5DfAWtpV1x2R8If":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","b5prg1FLjCAvBjLy":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.zyocWSzEZEC826NS\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n await this.actor.addCondition(\"prone\")\n await this.actor.addCondition(\"stunned\")\n}","bBdXzBmxgFFBwMMS":"if(args.opposedTest.attackerTest.item?.isRanged && args.applyAP && !args.sureShot)\n{\n if (args.modifiers.ap.value)\n {\n args.sureShot = true;\n args.modifiers.ap.details.push(`${this.effect.name} (Ignore ${this.item.Advances})`)\n args.modifiers.ap.ignored += this.item.Advances;\n }\n}","bEVlJOOA1kLlzpWx":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 15,\n \"i\" : 20,\n \"ag\" : 15,\n \"dex\" : 20,\n \"int\" : 35,\n \"wp\" : 30,\n \"fel\" : 10\n}\nlet skills = [\"Channelling\", \"Cool\", \"Dodge\", \"Entertain (Storytelling)\", \"Intuition\", \"Language (Magick)\", \"Leadership\", \"Lore (Magic)\", \"Lore (Theology)\", \"Perception\"]\nlet skillAdvancements = [20, 25, 20, 25, 30, 25, 15, 20, 10, 30]\nlet talents = [\"Aethyric Attunement\", \"Arcane Magic\", \"Instinctive Diction\", \"Instinctive Diction\", \"Luck\", \"Magical Sense\", \"Menacing\", \"Petty Magic\", \"Second Sight\", \"Sixth Sense\"]\nlet trappings = [\"Hand Weapon\", \"Quarterstaff\", \"Ritual Dress incorporating many ingredients and fetishes\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","bLkt8VpTTPoTxW0W":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Ajout d'Hémorragie\")\n}\n","bMEFHPCei2evnZZw":"// Victims that take at least 1 Wound from a Fell Dagger\n// immediately take a Poisoned Condition \n// resisted with a Difficult (-10) Endurance Test. \n\n// TODO: Add Venom strength to message\n\nif (args.totalWoundLoss > 0) \n{\n args.actor.addCondition(\"poisoned\")\n this.script.scriptMessage(`\n ${this.effect.name}:
\n ${args.actor.name} reçoit un état @Condition[Empoisonné], qui peut être résisté avec un Test de Résistance Difficile (-10).`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}\n","bQyVajMN1ETwlzvM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\nlet data = item.toObject();\nlet target = await game.wfrp4e.tables.rollTable(\"fixations\")\nif (target)\n{\n data.system.specification.value = target.result\n this.script.scriptNotification(target.result);\n}\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bRtZH0xRh8dgqMeW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bWr8leucbWslBCYG":"return args.characteristic != \"s\"","bhXUW7IJtEaUGAoV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll(); \nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}\n ","brNRqfpPqD2Ki0cM":"args.prefillModifiers.modifier -= 10","btPrQkGRKUkhNe3N":"return args.skill?.name == \"Métier (Apothicaire)\"","bwtQOSWn120NICkf":"let test = await this.actor.setupCharacteristic(\"ag\", {fields : {difficulty : \"hard\"}});\nawait test.roll();\n\nif (test.failed)\n{\n await this.actor.addCondition(\"bleeding\")\n await this.actor.addCondition(\"entangled\")\n}","bwx9wuEOJPF7btD1":"return args.skill?.name != game.i18n.localize(\"NAME.Navigation\");","bzaoWcieMFaU5B5l":"return !this.actor.flags.useless[this.item.system.location.key] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","c31hjp7k0hlpdGBC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","c3KA1knL2NYNUEww":"return args.skill?.name != game.i18n.localize(\"NAME.Evaluate\");","cAioHYtlxuOCwRLh":"let ablaze = Number(args.opposedTest.attackerTest.result.SL) + 1\nargs.actor.addCondition(\"ablaze\", ablaze)","cApfxL7Ic0NKdoSr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cBSy9CR5NZvcLRg8":"\n args.prefillModifiers.modifier += 0;\n args.prefillModifiers.slBonus += 0;\n args.prefillModifiers.successBonus += 0;\n ","cDBhmHn5kjgWBAlT":"let num = (this.effect.sourceTest.result.overcast.usage.other.current || 1)\n\nthis.actor.addCondition(\"entangled\", num)","cEg09bnvZD6Ysnpc":"let item = await fromUuid(\"Compendium.wfrp4e-archives2.items.anIlqJXFOIEzIOo1\")\nlet data = item.toObject();\ndata.name = this.item.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cJFDnq1HI4gXWcJo":"if (isNaN(parseInt(this.item.system.specification.value)))\n{\n let value = await ValueDialog.create(\"Ward Value\", \"Enter the Ward value\");\n if (value)\n {\n this.item.updateSource({\"system.specification.value\" : value});\n }\n}","cK1Jysfu5IMUUH0C":"if (!args.ward)\n{\n\targs.ward = (this.effect.getFlag(\"wfrp4e\", \"ward\") || 0);\n\tif (args.wardRoll >= args.ward && args.ward > 3)\n {\n let newWard = Math.max(3, args.ward - 1)\n this.script.scriptMessage(\"Protection améliorée de \" + newWard)\n this.effect.setFlag(\"wfrp4e\", \"ward\", newWard)\n }\n\n}","cOuukVo8WakDZIUj":"args.prefillModifiers.slBonus += 1","cUFCL02JoaZObRcX":"let sl = this.effect.sourceTest.result.slOver;\n\nthis.actor.system.characteristics.s.modifier += sl * 10;\nthis.actor.system.characteristics.s.calculationBonusModifier -= sl;","cUnbADgOQ4fMKgrH":"let group\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\");\nlet data = item.toObject();\n\nif (this.item.name.includes(\"(\"))\n{\n\tgroup = this.item.parenthesesText\n}\n\nelse \n{\n\tgroup = await ValueDialog.create(\"Choisir le groupe haï\", \"Groupe Haï\")\n\n\tthis.item.updateSource({name : this.item.name + ` (${group})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"Group\", group)})\n\tthis.effect.updateSource({name : this.effect.name + ` (${group})`})\n}\n\n\ndata.name = data.name.replace(\"Target\", group);\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","cV9JiAgUPOeUHKnS":"args.fields.successBonus++;\nif (args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\"))\n{\n args.fields.modifier += 10;\n}","cYPIXzl86a3LFsTE":"if (args.item.type == \"spell\")\n{\n args.item.cn.value -=2\n if (args.item.cn.value < 0)\n args.item.cn.value = 0\n}","cgmA2N0MkjA7qIZy":"return args.type != \"cast\" || args.item?.system.lore?.value != \"shadow\"","ch5SD2XOQfcYo0X5":"if (args.sizeDiff <= -2 && args.opposedTest.attackerTest.result.critical)\n args.damageMultiplier = Math.abs(args.sizeDiff)\n\n let sBonusDiff = args.opposedTest.defenderTest.actor.characteristics.t.bonus - args.opposedTest.attackerTest.actor.characteristics.s.bonus\n let weapon = args.opposedTest.attackerTest.item\n if (sBonusDiff > 0 && weapon && weapon.damage.value.includes(\"SB\"))\n {\n args.damage += sBonusDiff\n args.breakdown.other.push({label : this.effect.name, value : sBonusDiff});\n }","chUpiI3el8IO8MSs":"if (args.opposedTest.attackerTest.item?.name.includes(\"Morsure\"))\n{\n let woundsGained = args.totalWoundLoss;\n this.script.scriptMessage(`Récupère ${woundsGained} Blessures`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n this.actor.modifyWounds(woundsGained)\n}","csLKDJKZaUK9vwLT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7rBhIRo96Mydo0Cv\")\nlet data = item.toObject();\ndata.system.location.value = \"Back\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","ct6WGaRMfrcnHhyv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cuqCtQsfLBBAGjnu":"args.fields.slBonus -= (Number(this.item.specification.value) || 0)","cysQDjlDzT8HdNeo":" args.prefillModifiers.slBonus += 1","d29mu8vRt9AQUm0L":"this.actor.characteristics.i.value = Math.min(this.actor.characteristics.i.value, 10);\nthis.actor.characteristics.i.bonus = 1;\n\nfor(let skill of this.actor.itemTypes.skill.filter(i => i.system.characteristic.value == \"i\"))\n{\n skill.system.total.value= Math.min(skill.system.total.value, 10)\n}","d6mVm08o8SeklAcW":"this.actor.system.status.ward.value = 9;","d9iU08yvqcffF026":"return args.weapon.system.usesHands.includes(this.effect.getFlag(\"wfrp4e\", \"location\"))","dAMtbn3uQwF8KpKU":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\");","dIxYt421K010eogY":"\n let modifier = 0\n if (this.effect.name.includes(\"Modéré\"))\n modifier = -20\n else\n modifier = -10\n args.fields.modifier += modifier\n ","dM449AU0FQRnOc3l":"if (args.opposedTest.result.hitloc.value == \"head\")\n{\n args.abort = \"Raté - Sans tête\"\n}","dM8FbRH2V8CpOkXw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\nlet data = item.toObject();\ndata.system.location.value = \"Ribs\";\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","dSmRhZ6o1bUcOSF9":"return args.skill?.name != game.i18n.localize(\"NAME.Leadership\");","dXGosSxdoYbET2O8":"await this.actor.addCondition(\"fatigued\");\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"))\n\nawait test.roll();\n\nif (!test.succeeded)\n{\n await this.actor.addCondition(\"fatigued\");\n await this.actor.addCondition(\"broken\");\n}","dZ4c5pKDqQV02aIK":"if (args.effect.conditionId == \"ablaze\")\n{\n args.data.formula += ` + parseInt(this.effect.sourceTest.result.SL)`\n}","dbOSvpgcPjsc2uvq":"let menacing = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0hn6UaKq8CoZP2zD\")).toObject();\nlet sense = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\n\nsense.name += \" (Vue)\";\nsense.system.tests.value = sense.system.tests.value.replace(\"Sens\", \"Vue\")\n\nthis.actor.createEmbeddedDocuments(\"Item\", [menacing, sense], {fromEffect : this.effect.id})","dbYjr4oG67Z880To":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[warpfire-thrower-fumble]\")\n}","dcwY8dCd3PNCEzk6":"let current = this.actor.status.fate.value\n\nthis.actor.update({\"system.status.fate.value\" : current + 1})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses Points de Destin augmentés de ${current} à ${current + 1}`)","dfEgat3jz4EtWszH":"return args.skill?.name == \"Discrétion (Urbaine)\"","dfnCK8jCPXNLM7Gh":"let aoeDamage = this.effect.sourceTest.result.damage - 5 // Easily handle magic missile damage by just subtracting 5 from the item's (which has +10 base)\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(aoeDamage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - Ablaze`})\n\nawait test.roll();\n\nif (!test.succeeded)\n{\n this.actor.addCondition(\"ablaze\");\n}","dk02qSJfJaIo3Geh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\");\nlet data = item.toObject();\ndata.system.specification.value = this.actor.characteristics.ag.value\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","dkY7WRYjFVh8GB0m":"return ['ws', 'bs', 'ag'].includes(args.characteristic)","dkiNmwFXztIVbuxg":"let currentCareer = this.actor.system.currentCareer;\n\nif (!currentCareer || currentCareer.system.talents.includes(game.i18n.localize(\"NAME.Frenzy\")))\n{\n return\n}\n\ncurrentCareer.system.talents.push(game.i18n.localize(\"NAME.Frenzy\"));","dqvHDMlcitLx1pUx":"this.actor.system.details.move.value /= 2;","dt85W8pzZ09w1QLi":"if (this.actor.sameSideAs(this.effect.sourceActor))\n args.fields.slBonus += 2;\nelse\n args.fields.slBonus -= 2;","dtFvpY96RPzNnphq":"return !(args.skill?.name.includes(\"Corps à corps (Base)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","dwSgcFxKN3S0hLJL":"return args.skill?.name != \"Corps à corps (Bagarre)\" && args.item?.weaponGroup?.value != \"brawling\"","e0TuMgYuI7ZtGoQr":"args.applyAP = false;\n\nawait args.actor.addCondition(\"ablaze\", 2);\nawait args.actor.addCondition(\"prone\");","e34s1XxHckAWfwHt":"if (args.test.options.beatBlade && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n args.test.result.other.push(`${this.effect.name}: L'opposant perd ${Number(args.test.result.SL) + 1} Avantage`)\n}","e7IxnxePdXSy6L4E":"if (args.opposedTest.result.hitloc.value == \"head\")\n{\n this.script.scriptMessage(`${this.actor.prototypeToken.name} subit une @Table[crithead]{Blessure Critique} si il n'y en avait pas d'autres.`)\n}","eAtqyBd1HsDWuBuI":"this.actor.system.characteristics.fel.modifier -= parseInt(this.item.system.location.value || 1)","eHRv7f2BTtle6Y1K":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.sJ3yX1kvzu2hgNq5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","eHgk3HZ6eyLFTZ9o":"return !args.item?.system.magicMissile?.value && !args.item?.system.attackType","ePPgxQOqL1Uhz2k9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Projectiles (Arc)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Arc\",\n },\n {\n type : \"ammunition\",\n name : \"Flèche\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `

\n Ajouter une Option?\n

\n
    \n
  1. Projectiles (Arc) +10 et un arc avec 12 Flèches
  2. \n
\n `,\n buttons : {\n 1 : {\n label : \"Oui\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Non\",\n callback : () => {\n choice2\n }\n }\n }\n })\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","eWWLmA2xINR321aK":"args.item.system.qualities.value.push({name : \"magical\"})","eb69QPmNQEJXtk4l":" return args.characteristic != \"bs\"","ebDQH0MdGAG02CHl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SYjWiKDzMS6CtROJ\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nif (this.item.system.location.key == \"rArm\")\n{\n\tdata.system.location.value = \"Main Droite\"\n\tdata.system.location.key = \"rHand\"\n}\nelse if (this.item.system.location.key == \"lArm\")\n{\n\tdata.system.location.value = \"Main Gauche\"\n\tdata.system.location.key = \"lHand\"\n}\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","ed7Sud9HM3uB2j6b":"ChatMessage.create({content : \"Céder ou Mourir!\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2;\nthis.script.scriptNotification(\"Ajout de \" + data.name);\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});\ngame.wfrp4e.utility.postFear(2, this.actor.prototypeToken.name)","egDtqMxe3iekc6hv":"let trait = args.opposedTest.attackerTest.item\nlet woundLossEffect = this.item.effects.get(\"7Amhi75wLv0PvGjd\")\nif (trait && trait.name.includes(\"Morsure\") && woundLossEffect)\n{\n args.actor.applyEffect({effectUuids : woundLossEffect.uuid})\n}","eh1J3s0s4A2AxoFp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\");\nlet data = item.toObject();\ndata.name += \" (Ennemi)\";\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","ekjJQHyMbZT2vqdc":"let uses = this.item.getFlag(\"wfrp4e\", \"uses\") || 0;\nuses++;\nthis.script.scriptNotification(`Utilisé ${uses} fois`)\nthis.item.setFlag(\"wfrp4e\", \"uses\", uses);\nif (uses >= 3)\n{\n\tthis.effect.update({\"flags.wfrp4e.applicationData.type\" : \"other\"})\n\tthis.script.scriptNotification(`Utilisé`);\n}\n","eqxE7nBO13yJS7hc":"let roll = (await new Roll(\"1d10\").roll())\nroll.toMessage({flavor: \" Blessures soignées\", speaker : {alias : this.actor.name}})\n\nthis.actor.modifyWounds(roll.total)\n\nthis.actor.hasCondition(\"bleeding\")?.delete();","esuLwq4g5T8k1kLT":"await args.actor.addCondition(\"ablaze\"); await args.actor.addCondition(\"prone\");","ezGqDoC9hNRBnFTB":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"1zaqojk0Oq1m8vYv\"), game.wfrp4e.utility.findItemId(\"zIuarD5mB0EF0ji0\")])\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choisir une arme\")\n items = items.map(i => i.toObject())\n \n items.forEach(i => equip(i))\n \n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.data.worn.value = true\n else if (item.type == \"weapon\")\n item.data.equipped = true\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\n item.data.worn = true\n }","f062aa2BNClx08D6":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed) \n {\n let toughnessLost = parseInt(this.effect.sourceTest.result.SL)\n\n let currentModifier = this.actor.characteristics.t.modifier\n\n await this.actor.update({ \"system.characteristics.t.modifier\": currentModifier - toughnessLost })\n this.script.scriptMessage(`${this.actor.prototypeToken.name} lost ${toughnessLost} Toughness`)\n if (this.actor.system.characteristics.t.value <= 0)\n {\n this.actor.addCondition(\"dead\");\n }\n\n }","f3rXusHh6VIpVPUl":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) && args.type != \"cast\"","f4vvAGQ8OGoEbrgy":"let SL = args.opposedTest.attackerTest.result.SL - args.opposedTest.attackerTest.item.cn.value\nlet difficulty = \"challenging\"\nif (SL >= 1)\n difficulty = \"difficult\"\nif (SL >= 2)\n difficulty = \"hard\"\nif (SL >= 3)\n difficulty = \"vhard\"\n \n\nlet test = await args.actor.setupCharacteristic(\"wp\", {fields: {difficulty}, skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gain a Stunned Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"stunned\");\n}","f5Mp3kXwCFdPkW6N":"return args.skill?.name != \"Entertain (Sing)\" && args.skill?.name != \"Entertain (Singing)\" && !args.skill?.name.includes(\"Language\");","f6WnrJvoNkfoNN9Y":"return args.item?.attackType != 'melee'","f7WZvYle9iqefRsh":"return args.weapon?.system?.attackType != \"melee\"","f8cnfvGKJH3bYVGN":"return [\"s\", \"t\"].includes(args.characteristic)","fEFfHFeJxkR0aIJK":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 3 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Everyone within 20 feet loses 1 Wound and makes a Difficult (-10) Endurance or gains @Condition[Deafened]`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}\n ","fEyKQqCjDwml3DXO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","fFGuTi0HLjwneMcJ":"return args.item?.system.isRanged","fIUxKZMWJ8HMPmH9":"return [\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","fKzlu6fFE2th9uIJ":"return args.item?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\")","fP2edYbj6QjPPAjL":"return [\"Charm Animal\", \"Endurance\", \"Outdoor Survival\"].includes(args.skill?.name)","fPKYkBllp7Et62lX":"if (args.test.spell.name == \"Warp Lightning\")\n{\n args.test.preData.canReverse = true;\n}","fY0TsQwnU14fdPl2":"args.fields.modifier += 30;","fYLSe6CrYciap5y8":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Consume Alcohol\", \"Row\", \"Sail\", \"Swim\"]\n let skillAdvancements = [10, 10, 10, 10]\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","faRFSsrQylQRZFLk":"return args.bleedingHand || !args.weapon || !this.actor.hasCondition(\"bleeding\")","fcY3pa72dELnOFXV":"return !args.options.reload\n","feMPZhhFeXRtKdKY":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectUuids : this.item.effects.contents[0]?.uuid})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","ffvcCEazZBinHlUX":"args.update({texture : {tint : \"#FFD700\"}});\n","fiF9sM5UpcHMYa33":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\");\nlet data = item.toObject();\ndata.name += \" (Poison, Disease, Chaos)\"\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect: this.effect.id})","fkFmNcesqqNTMhVn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.2iult41Jehz0F1O8\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key;\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","fl762icfKrt9ear2":"this.actor.removeCondition(\"broken\", parseInt(this.effect.sourceTest.result.SL)+1)","ft0LaRWZT5WtnptP":"let advantage = this.actor.system.status.advantage.value;\nif (advantage > 0)\n{\n await this.actor.setAdvantage(0);\n this.script.scriptNotification(\"Advantage Subtracted\")\n}\nelse \n{\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item, {fields : {slBonus : advantage}})\nawait test.roll();","fve7tiyF5X9B7mHJ":"args.fields.slBonus -= 2;","fzTB7t3x4bLmAXji":"let roll = await new Roll(\"1d10 + 1\").roll()\nawait roll.toMessage(this.script.getChatData());\nthis.script.scriptNotification(`Healed ${roll.total} Wounds`)\nthis.actor.corruptionDialog(\"moderate\")\nawait this.actor.modifyWounds(roll.total)","g07HI7vyqiFXPB0o":"// A Drinker must take a Difficult (-10) Endurance Test.\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"difficult\"}})\nawait test.roll()\n// If they fail, they acquire 2 Poisoned Conditions. \nif (test.failed) \n{\n this.actor.addCondition(\"poisoned\", 2)\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} has gained 2 @Condition[Poisoned] Conditions.

\n

Any being with the Bestial Creature Trait that bites them and takes damage will not bite them again during a hostile encounter, though the creature may still attack them in other ways.

`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n })\n}\n // If they succeed, for a number of rounds equal to 3+ their SL, they have the Corrosive Blood Creature Trait.\nelse if (test.succeeded) \n{\n // Don't attempt to add Corrosive Blood if actor already has it\n const hasCorrosiveBlood = this.actor.has(\"Corrosive Blood\")\n if (hasCorrosiveBlood !== undefined) return \n\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n const duration = 3 + parseInt(test.result.SL)\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} gains the Corrosive Blood Trait for ${duration} rounds.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}","g0SzfsLyW7aD2F19":"if (this.item.name.includes(\"(\") && this.item.system.tests.value.includes(\"(Social Group)\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let group = name.split(\"(\")[1].split(\")\")[0]\n tests = `${tests.split(\"(\")[0].trim()} (${group})`\n }\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","g1L8OYO9nCOhdKGL":"// Everything within Fellowship Bonus yards \n// of the target point is splashed with mystic poison, \n// suffering 1d10 + SL damage which ignores Armour Points\n\nlet damage = (await new Roll(`1d10 + ${parseInt(this.effect.sourceTest.result.SL)}`).roll())\n\nawait damage.toMessage(this.script.getChatData())\n\nthis.script.scriptMessage(await args.actor.applyBasicDamage(\n damage.total,\n {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}\n))\n\n// ... and gains the Poisoned Condition\n\nthis.actor.addCondition(\"poisoned\")","g4t56A09yrpZaJQ2":" let amberTalons = foundry.utils.deepClone(game.wfrp4e.config.systemItems.unarmed);\n amberTalons.name = \"Amber Talons\";\n amberTalons.img = this.effect.img;\n amberTalons.system.damage.value = \"SB + WPB\"\n amberTalons.system.equipped = true;\n amberTalons.system.qualities.value.push({name : \"magical\"})\n amberTalons.effects.push({\n label : \"Amber Talons\",\n transfer: false,\n icon : \"modules/wfrp4e-core/icons/spells/amber-talons.png\" ,\n flags : {\n wfrp4e : {\n applicationData : {\n documentType : \"Item\"\n },\n scriptData : [{\n trigger : \"applyDamage\",\n script : \"if (args.totalWoundLoss >= 1)\\n{ \\n args.actor.addCondition(\\\"bleeding\\\")\\n}\"\n }]\n }\n }\n })\n this.actor.createEmbeddedDocuments(\"Item\", [amberTalons], {fromEffect: this.effect.id})","gFUXBbTskQBKjxqm":"if (this.actor.hasCondition(\"entangled\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}}).then(async test => {\n await test.roll();\n if (test.failed)\n this.actor.addCondition(\"fatigued\") \n })\n}","gKIPujyuFSn0No9v":"for(let e of this.item.effects.contents)\n{\n e.update({disabled: false})\n}\nthis.script.scriptNotification(\"Reset Powers\")","gKPL3t4vlZAsvtGr":"return args.skill?.name == \"Stealth (Underground)\"","gL0ftUnK5TNXBRRt":"return this.effect.sourceActor.uuid == args.actor.uuid","gPQrszvIgGlW9yM4":"if (args.test.characteristicKey == \"wp\")\n args.test.preData.canReverse = true","gVpFUka7qfGiEC1v":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFD700\"}}));\n","ga6bQzPuoIiQQrKg":"if (args.totalWoundLoss > 0)\n{\n \n let test = await args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\n await test.roll()\n if (test.failed)\n {\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\n }\n}","gbhxWXboV9CytWNU":"await this.actor.addCondition(\"blinded\", 2)","gh2KS1prBKcsSK6M":"if (args.opposedTest.attackerTest.result.critical)\n args.actor.addCondition(\"ablaze\")","gnVpxOeBZpNF4HIF":"if (args.test.result.roll.toString().includes(\"9\") || args.test.result.roll.toString().includes(\"8\"))\n{\n args.test.result.fumble = game.i18n.localize(\"Fumble\")\n}","gpPaCe6yER79l4u8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","gpuBg3y9rocJL7yT":"this.actor.status.addArmour(1, {locations: [\"head\"], source: this.effect})","gqZLfIr6svrtdwdC":"return args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\") && args.skill?.name != game.i18n.localize(\"NAME.MeleeBrawling\") && args.weapon?.system?.weaponGroup?.value != \"brawling\"","gsCnd3mf1vXFU2ei":"this.actor.system.status.ward.value = 4;","gu72JaTs9GrSiVTd":"return !(args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\"))","h0DfPwUUOBjyAHMZ":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\");","h1XKoMuVnS0bagRO":"return args.item?.name != game.i18n.localize(\"NAME.Endurance\");","h766UvswLCsxcMow":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : -15,\n \"t\" : 0,\n \"i\" : 20,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 5,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charm\", \"Intimidate\", \"Melee (Basic)\"]\nlet skillAdvancements = [7, 60, 7]\nlet talents = [\"Menacing\", \"Shadow\"]\nlet traits = [\"Distracting\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Could not find ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","hA8PzeiCsHqqlUZm":"this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"nausea\"]])\nthis.script.scriptMessage(`Gains @Condition[Nausea] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})","hCzxUyO6mjLNIpaM":"let woundsGained = Math.min(args.totalWoundLoss, args.actor.status.wounds.value)\n\nwoundsGained = Math.floor(woundsGained / 2)\n\nargs.attacker.update({ \"system.status.wounds.value\": args.attacker.status.wounds.value + woundsGained })\n\nthis.script.scriptMessage(`Gains ${woundsGained} Wounds`)","hDC6lroDEPVBituR":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n this.script.scriptMessage(`Fumble: immediately gain 1 @Table[mutatemental]{Mental Mutation}, and may not take a Short-term Ambition for the next [[1d10]] weeks.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","hK0YMJfYbpbJZizO":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 0,\n \"bright\": 0,\n \"angle\": 360,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 0,\n \"intensity\": 0,\n \"type\": \"none\",\n },\n \"color\": \"\",\n }}));","hObTbWi4ZdwXimIW":"if (args.item.type == \"spell\")\n{\n args.item.system.cn.value = Math.floor(args.item.system.cn.value / 2);\n}","hR1qD2kpFHF8JT8h":"return args.skill?.name == \"Language (Magick)\"","hSlEY2oh8quVmdXR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","hZAax4emLahEEqcZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"(Tusks)\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","hfO4INH3EeETDTFt":"this.actor.status.addArmour(1, {locations: this.effect.flags.wfrp4e.locations, source: this.effect})","hhCs5VBKx50S5IsY":"return !args.options.mutate","hhv7PrRdlf9sfC82":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Cool\", \"Dodge\"]\n let skillAdvancements = [10, 10]\n let talents = [\"Combat Reflexes\"]\n let trappings = [\"Leather Jack\", \"Leather Skullcap\", \"Leather Leggings\", \"Shield\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","hlHKeFWrOA8CsLr9":"args.data.canReverse = true;\nargs.options.pilot = true;","hluehsCuBZYc1Ejt":"return args.characterisic != \"fel\"","hmk8zV1LTElHUI8A":"let msg = `${this.actor.prototypeToken.name} loses 1 Wound.
`\n if (this.actor.status.wounds.value <= 1)\n {\n msg += `${this.actor.prototypeToken.name} goes unconscious.
`\n await this.actor.addCondition(\"unconscious\")\n }\n this.script.scriptMessage(msg)\n this.actor.modifyWounds(-1)","hnsmzvcuiUYB065I":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, context: { failure : \"May not flee Combat\"}}).then(test => test.roll())","hpwJRAhCsXTp9bd9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Melee (Basic)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Melee (Polearm)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice3 = [\n {\n type : \"skill\",\n name : \"Melee (Two-Handed)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `

\n Select your choice\n

\n
    \n
  1. Melee (Basic)
  2. \n
  3. Melee (Polearm)
  4. \n
  5. Melee (Two-Handed)
  6. \n
\n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Polearm\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"Two-Handed\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","hwHpIunCq3ifk2QU":"if (args.item.type == \"spell\")\n{\n let range = parseInt(args.item.Duration)\n if (Number.isNumeric(range))\n {\n args.item.system.duration.value = \"2 * \" + args.item.system.duration.value\n }\n}","hwOZxgt7e65iWvYz":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n let damage = this.effect.sourceTest.result.damage\n\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n}","hxmwtw5zAHyS2upG":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"giftofthebeast\"))","i59IpmZNLJEPWZ3L":"return args.spell","i5AN97A7IOeygEFA":"if (args.applyAP && args.modifiers.ap.metal) \n{\n args.modifiers.ap.ignored += args.modifiers.ap.metal\n args.modifiers.other.push({value : args.modifiers.ap.metal, label : this.effect.name, details : \"Add Metal AP to Damage\" })\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore Metal (\" + args.modifiers.ap.metal + \")\");\n args.modifiers.ap.metal = 0\n}","i7xl0jNpLnBT2h2l":"args.actor.characteristics.dex.value = 0","iAo3wxMLA64rsKjj":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"skavenbrew\"))","iBEPQ3NwtI9DfkEy":"let locations = [];\n\nwhile (locations.length < 2)\n{\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\n if (!locations.includes(loc.result))\n {\n locations.push(loc.result);\n }\n}\n\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\n\nthis.item.updateSource({name : this.item.name += ` (${locationText})`})","iHn3YzvqNfbwzjZz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.system.specification.value = this.actor.characteristics.s.bonus\ndata.system.description.value = \"\"\ndata.name = this.effect.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","iLpq4yCFN6YACrYA":"if (args.test.result.castOutcome == \"success\")\n{\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"demonic-mien\"))\n}","iM4B3IZ4VtpZsl09":"args.size = \"sml\"","iM6JLF8jDXMViReZ":"return ![\"Pick Lock\", \"Sleight of Hand\", \"Channelling (Ulgu)\"].includes(args.skill?.name)","iMDZLr7ueJWBnilj":"args.actor.flags.rangedDamageIncrease += 1","iMu8BZ7eHMAbPEO1":"let healed = args.totalWoundLoss\n\nthis.script.scriptMessage(`this.actor.prototypeToken.name healed ${healed} Wounds`);\n\nthis.actor.modifyWounds(healed)","iNAQJa5HyaEckknX":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n let spells = this.actor.itemTypes.spell;\n if (spells.length)\n {\n let chosen = spells[Math.floor(CONFIG.Dice.randomUniform() * spells.length)]\n this.script.scriptMessage(`Loses access to ${chosen.name}`)\n chosen.update({name : chosen.name += \" (LOST)\"})\n }\n}\n\n\n","iT0h3VZLEBQnn5Bx":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\") && args.skill?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\");","iT3C15fMyQrj1RmG":"if (this.actor.has(\"Undead\") && this.actor.has(\"Ethereal\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if(test.failed)\n this.actor.addCondition(\"stunned\")\n })\n}","iVhi3Z6zPaf1bf8g":"return [\"t\", \"i\", \"ag\", \"dex\", \"int\", \"wp\"].includes(args.characteristic)","iX0ctHYHg12pjaCU":"let result = await game.wfrp4e.tables.rollTable(\"gift-of-slaanesh\")\n\nif (result.object.documentId && result.object.documentCollection)\n{\n let item = await fromUuid(`Compendium.${result.object.documentCollection}.${result.object.documentId}`);\n if (item)\n { \n let data = item.toObject();\n // Some items need sourceTest for their effects\n setProperty(data, \"flags.wfrp4e.sourceTest\", this.effect.sourceTest);\n await this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});\n }\n}\n\nthis.script.scriptMessage(game.wfrp4e.tables.formatChatRoll(\"gift-of-slaanesh\", {lookup : result.roll, hideDSN: true}));","id9ZdkERMZnZTWXt":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\tthis.script.scriptNotification(\"Immune to Fear\");\n\targs.extendedTest.delete();\n\targs.abort = true;\n}\nreturn args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\")","igVAVU7DOuzhNG14":"return args.item?.system.isMelee","imKVsCy8rya2gkwO":"// Any Characteristic penalties due to failed Consume Alcohol Tests\n// or the state of being Stinking Drunk are eliminated. \nawait this.actor.removeSystemEffect(\"consumealcohol1\")\nawait this.actor.removeSystemEffect(\"consumealcohol2\")\nawait this.actor.removeSystemEffect(\"consumealcohol3\")\nawait this.actor.removeSystemEffect(\"stinkingdrunk1\")\n\n// The drinker is thereafter Fatigued \n// for a number of hours equal to 10 minus their Toughness Bonus — \n// nothing but time and rest can eliminate this penalty.\nawait this.actor.addCondition(\"fatigued\")\nconst duration = 10 - parseInt(this.actor.system.characteristics.t.bonus)\nthis.effect.updateSource({\"duration.rounds\" : duration});\nthis.script.scriptMessage(`

${this.actor.prototypeToken.name} has lost all alcohol related penalties and gains the Fatigued Condition for ${duration} hours.

`, \n{\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n}) ","inPxRSx0CDj1nwAm":"if (args.test.result.fumble && !this.actor.itemTypes.talent.find(i => i.name == \"Arcane Magic (Fire)\"))\n{\n this.actor.addCondition(\"ablaze\");\n}","ioeTj5mx8jlA5EX5":"args.actor.addCondition(\"stunned\")","ipkkRffJh61WE7zR":"if (!args.flags.amputatedFootOrLeg)\n{\n\targs.flags.amputatedFootOrLeg= true;\n\targs.fields.modifier -= 20;\n}","iuSoKntfJ4eAPafQ":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Loading Spells\");\nspells = spells.filter(s => [\"fire\", \"heavens\", \"beasts\", \"shadow\", \"light\", \"life\", \"death\", \"metal\"].includes(s.system.lore.value)).sort((a, b) => a.system.lore.value > b.system.lore.value ? 1 : -1)\n\nlet choice = await ItemDialog.create(spells, 1, \"Choose Spell\");\nif (choice[0])\n{\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\n}\n","iuYuf05BNuZ5fllI":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[poisoned-wind-globe]\")\n}","j1AmrY1SxFJQyapo":"if (this.actor.status.advantage.value > 0 && args.item.system.attackType)\n{\n args.item.system.qualities.value.push({name : \"penetrating\"})\n}","j3zDMWkns32Yrxn3":"this.effect.updateSource({\"flags.wfrp4e.ward\" : 9})","j6Bf1iivH8cqSnnK":"let target = args.data.targets[0]\nreturn target?.actor.hasCondition(\"prone\") || target.hasCondition(\"surprised\")","j98hvy6r9G2Vjmid":"if (args.totalWoundLoss > 0) \n{\n args.opposedTest.result.other.push(\n `@Corruption[minor]{Minor Exposure to Corruption}`\n )\n this.script.scriptMessage(\n `${this.effect.name}: \n @Corruption[minor]{Minor Exposure to Corruption}
\n ${args.actor.prototypeToken.name} must take an \n Average (+20%) Corruption (Minor) Test`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","jC8o5PbnqEvOoZ9N":"this.actor.addCondition(\"poisoned\", 2)","jFwema0iwzBphxie":"let woundsGained = Math.min(args.actor.status.wounds.value, args.totalWoundLoss)\nwoundsGained = Math.ceil(woundsGained / 2)\n\nargs.attacker.update({\"system.status.wounds.value\" : args.attacker.system.status.wounds.value + woundsGained})\n\nargs.actor.addCondition(\"fatigued\")\nargs.attacker.hasCondition(\"fatigued\")?.delete();\n\nthis.script.scriptMessage(`${args.attacker.prototypeToken.name} gains ${woundsGained} Wounds`);","jGDk7avWFSnyFoql":"let broken = this.actor.hasCondition(\"broken\");\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\");\n\nif (broken && !broken.getFlag(\"wfrp4e\", \"blasted-mind\") && !this.actor.has(item.name))\n{\n await broken.delete();\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})\n this.script.scriptNotification(`Removed ${broken.name}, added ${item.name} (${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds)`)\n}","jHgxpe6TJDlP3oTn":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Loading Spells\");\nspells = spells.filter(s => [\"slaanesh\"].includes(s.system.lore.value))\n\nlet choice = await ItemDialog.create(spells, 1, \"Choose Spell\");\nif (choice[0])\n{\n this.item.updateSource({name : this.item.name + ` (${choice[0].name})`})\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\n}\n","jLsL4KRI6LEG9Ii2":"if (args.test.result.critical && ['rLeg', 'lLeg'].includes(args.test.result.hitloc.result))\n{\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 20 : 20\n args.test.result.critical += ` (+${args.test.result.critModifier})`\n}","jObJanFoev4N6ZRv":"if (!args.opposedTest.attackerTest.item?.system?.isMagical)\n\targs.abort = `${this.effect.name}: Ignored`","jRSgPhpfN7MH7TTp":"if (args.totalWoundLoss > 0)\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Poisoned Condition Gained\", success: \"Resisted Poisoned Condition\" } })\n await test.roll();\n if (test.failed)\n { \n args.actor.addCondition(\"poisoned\");\n if (args.actor.system.status.wounds.value - args.totalWoundLoss <= 0)\n {\n args.actor.addCondition(\"unconscious\")\n }\n }\n}\n\n // else\n // this.actor.setupCharacteristic(\"t\", { context: { failure: \"1 @Condition[Poisoned] Condition Gained\", success: \"Resisted @Condition[Poisoned] Condition\" } }).then(testCallback)\n","jW87rmQLtROdVEhW":" if ([\"orc\", \"ork\", \"goblin\", \"hobgoblin\", \"snotling\", \"greenskin\"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))\n {\n args.addImpact = true\n args.opposedTest.result.other.push(\"Rune of Goblin Bane: Impact Added\")\n }","jWkfoVpHLiRaHTza":"if (args.test.succeeded)\n{\n args.test.result.other.push(`${this.effect.name}: @Terror[1,${this.actor.prototypeToken.name}]`)\n}","jYJRO5XPyG7y6fih":"await this.actor.addCondition(\"blinded\")\nawait this.actor.addCondition(\"deafened\")\nawait this.actor.addCondition(\"fatigued\")","jbZPLb4wuqJpHLUx":"this.item.system.flaws.value.push({name : \"dangerous\"})","jdS2u1tQPYeO55WI":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\n\nif (type == \"cold\")\n{\n\tlet stunned = Math.max(1, Math.trunc(args.totalWoundLoss / 5))\n\tawait args.actor.addCondition(\"stunned\", stunned);\n}\n\nif (type == \"corrosion\")\n{\n let damageItems = await Dialog.confirm({title : this.item.name, content : `

Damage all Items carried?

`})\n\tif (damageItems)\n\t{\n\t\tlet msg = ``\n\t\tlet weapons = args.actor.itemTypes.weapon.filter(i => i.isEquipped);\n\t\tlet armour = args.actor.itemTypes.armour.filter(i => i.isEquipped);\n\t\tlet trappings = args.actor.itemTypes.trapping.filter(i => i.isEquipped);\n\t\tfor(let item of weapons)\n\t\t{\n\t\t\tif (item.system.properties.qualities.shield)\n\t\t\t{\n\t\t\t\tawait item.system.damageItem(1, \"shield\");\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tawait item.system.damageItem(1);\n\t\t\t}\n\t\t\tmsg += `

${item.name} damage by 1

`\n\t\t}\n\t\tfor(let item of armour)\n\t\t{\n\t\t\tawait item.system.damageItem(1);\n\t\t\tmsg += `

${item.name} damage by 1

`\n\t\t}\n\t\tfor(let item of trappings)\n\t\t{\n\t\t\tawait item.system.damageItem(1);\n\t\t\tmsg += `

${item.name} damage by 1

`\n\t\t}\n\t\tif (msg)\n\t\t{\n\t\t\tthis.script.scriptMessage(msg, {speaker : {alias : args.actor.name}});\n\t\t}\n\t}\n}\n\nif (type == \"fire\")\n{\n\tawait args.actor.addCondition(\"ablaze\");\n}\n\nif (type == \"electricity\")\n{\n\tawait args.actor.addCondition(\"stunned\");\n}\n\nif (type == \"poison\")\n{\n\tawait args.actor.addCondition(\"poisoned\");\n}\n\n","jfk5VDKMTIf4ee0v":"if (args.totalWoundLoss > 0)\n args.actor.addCondition(\"poisoned\")","jgO1Kf60Ctt6R0qO":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\")","jmxlpyLrIuoxQtvU":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}}));\n","jpcU8FFWSlQ3gD0L":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Trade\"))","jrvj7bRyMBB9LixP":"this.actor.addCondition(\"fatigued\", 3)","jsgLEVYvMieyYT6L":"let tokenImg = \"\"; // Put path to token image here, inbetween the quotation marks\nif (tokenImg)\n{\n if (this.effect.getFlag(\"wfrp4e\", \"transformed\"))\n {\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", false);\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: this.actor.prototypeToken.texture.src}})); \n }\n else \n {\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", true);\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: tokenImg}}));\n }\n}\nelse \n{\n this.script.scriptNotification(\"No Token Image path configured. The image path should be set in the first line of this script.\", \"error\");\n}","k3FqFgsF6a3TkxAD":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\ntest.roll();\nreturn true;","k8TC0yzp4xfOXD2n":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\n await test.roll();\n if (test.failed)\n {\n\t args.actor.addCondition(\"stunned\");\n }\n\targs.actor.hasCondition(\"bleeding\")?.delete()\n}","k9SvH4Lm3ZuI8S1N":"return ![\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","kBXVEnSWzaQZLkJH":"if(args.test.result.critical)\n{\n args.test.result.damage +=1 \n args.test.result.additionalDamage += 1\n}","kIM4Fs1lFVV7TSnj":"this.actor.modifyAdvantage(1);","kMSdRskYDI2J1gnp":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll(); \nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}\n ","kWynO1lQzjiSs8RK":"return args.skill?.name != game.i18n.localize(\"NAME.Haggle\");","kYiDBPRKIokFkr4Z":"if (args.item.type == \"skill\" && args.item.name == \"Ranged (Bow)\")\n{\n args.item.system.modifier.value += 20;\n}","kYmscP2HuXjDovBD":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\n","kiJ6AiaYVUjt6aV6":"teeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\nteeth = teeth.toObject();\n\nlet roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData({flavor : \"Teeth Lost\"}))\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\nthis.actor.createEmbeddedDocuments(\"Item\", [teeth])","kkC5EhqA05U6U0gU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n// Kind of insane but whatever\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n if (opposedResult.differenceSL < 6)\n {\n this.actor.addCondition(\"fatigued\", Math.floor(opposedResult.differenceSL / 2))\n }\n else if (opposedResult.differenceSL >= 6)\n {\n this.actor.addCondition(\"broken\");\n }\n}","kmsGLWGxCY8Z8jVG":"return args.skill?.name != game.i18n.localize(\"NAME.Intuition\");","kvaN100w0nBUlLbj":"let poisoned = this.actor.hasCondition(\"poisoned\")\nif (poisoned)\n{\n this.script.scriptMessage(\"Immune to Poisoned\")\n poisoned.delete()\n}","l8qFKSnMpy4P7XQR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","lCOdnKz8XpnkDs6Q":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();","lFO6XdfUODmFArqx":"args.actor.addCondition(\"bleeding\")","lII4KMRblqwFBlsV":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 15\n}\nlet skills = [\"Channelling\", \"Charm\", \"Perform (Dancing)\"]\nlet skillAdvancements = [0, 6, 3]\nlet talents = [\"Attractive\", \"Distract\", \"Mimic\"]\nlet traits = [\"Distracting\", \"Flight (6)\", \"Spellcaster (Petty)\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Marsh Lights\", \"Sleep\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Could not find ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","lOzkngzye4RmvALp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\nthis.script.scriptNotification(\"Added \" + item.name)","lPudo1grrVp05i7a":"let loc = Math.floor(CONFIG.Dice.randomUniform() * 2) == 0 ? \"head\" : \"body\"\nlet damage = this.actor.system.characteristics.s.bonus + 6\n\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if(test.failed)\n {\n await this.actor.addCondition(\"stunned\")\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n }\n })","lQJ68n3y1xDyNicE":"return !args.options.sizeModifier && args.item?.system?.attackType != \"ranged\"","lSOAZ4FG44bT4jh1":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\n\nlet infectedData = infected.toObject();\nlet fearData = fear.toObject();\nfearData.system.specification.value = 2;\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData, infectedData], {fromEffect : this.effect.id})","lU4s3UTtBkU38djI":"this.actor.addCondition(\"entangled\")\nlet msg = `${this.actor.prototypeToken.name} loses 1 Wound and gains 1 Entangled Condition.`\nthis.script.scriptMessage(msg)\nthis.actor.modifyWounds(-1)","lYYkGzqNshiYc7WI":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"poisoned\")\n}","laptAldsT0Fm1rDt":"let blunt = await Dialog.confirm({label : \"test\", content :`

Apply blunt damage reduction? (-3)

`})\n\nif (blunt)\n{\n args.modifiers.other.push({label : this.effect.name, details : \"Blunt Damage Reduction\", value : -3})\n}","lhemR8EP5tGNKout":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : \"Suffer Creeping Irrationality\"}})\nawait test.roll();\nif (test.failed)\n{\n msg = `

@UUID[${this.effect.sourceItem.uuid}]{Creeping Irratitonality} Roll: ${Math.ceil(CONFIG.Dice.randomUniform() * 10)}

`\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n msg += `

${this.actor.prototypeToken.name} also gained 1 Corruption Point. If mutating, this results in a @Table[mutatemental]{Mental Corruption}

`\n let newCorruption = Number(this.actor.status.corruption.value) + 1\n this.actor.update({\"system.status.corruption.value\" : newCorruption})\n }\n\n this.script.scriptMessage(msg);\n}\n","ljpM7muMyxGD04EX":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","lol5J6h0pErzM71s":"return args.weapon?.system.properties.flaws.crewed","lvjcddwRiN9iGruy":"let test = await this.actor.setupCharacteristic(\"t\", { appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"challenging\" } })\nawait test.roll();\n\nif (test.failed) \n{\n let ageAdded = Math.ceil(CONFIG.Dice.randomUniform() * 10) + Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let ws = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let bs = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let s = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let t = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let ag = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let dex = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n\n let currentAge = parseInt(this.actor.system.details.age.value)\n\n let inline = `@ROLL`\n let msg =\n `

${this.actor.prototypeToken.name} ages by ${inline.replace(\"@ROLL\", ageAdded).replace(\"@TT\", \"2d10\")} and loses

\n

${inline.replace(\"@ROLL\", ws).replace(\"@TT\", \"1d10\")} Weapon Skill

\n

${inline.replace(\"@ROLL\", bs).replace(\"@TT\", \"1d10\")} Ballistic Skill

\n

${inline.replace(\"@ROLL\", s).replace(\"@TT\", \"1d10\")} Strength

\n

${inline.replace(\"@ROLL\", t).replace(\"@TT\", \"1d10\")} Toughness

\n

${inline.replace(\"@ROLL\", ag).replace(\"@TT\", \"1d10\")} Agility

\n

${inline.replace(\"@ROLL\", dex).replace(\"@TT\", \"1d10\")} Dexterity

\n `\n this.script.scriptMessage(msg);\n\n let characteristics = duplicate(this.actor.system.characteristics)\n\n characteristics.ws.initial -= ws\n characteristics.bs.initial -= bs\n characteristics.s.initial -= s\n characteristics.t.initial -= t\n characteristics.ag.initial -= ag\n characteristics.dex.initial -= dex\n\n this.actor.update({ \"system.characteristics\": characteristics, \"data.details.age.value\": ageAdded + currentAge })\n}","lwVhn4bSXJ3eoT9q":"if (this.item.system.weaponGroup.value == \"basic\")\n{\n let slash = this.item.system.qualities.value.find(i => i.name == \"slash\")\n if (slash)\n {\n slash.value = \"2A\"\n }\n}","m3qEVO5fseV6KHXa":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","m58MpMZBblpq5LJu":"args.prefillModifiers.slBonus++;\nargs.prefillModifiers.successBonus++;\n","m8qBlbH7ROoqa22o":"return args.options.reload","mBcLf11upaHS8AQq":"this.actor.status.addArmour(1, {source: this.effect})","mJ9eMPub4epJSf00":"return args.weapon?.system.qualities.value.find(i => i.name == \"shield\") && this.actor.attacker","mPxmCsXYirAIT913":"let key = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.characteristics, this.effect.img), 1, \"Choose Characteristic\");\n\nthis.effect.updateSource({changes : [{key : `system.characteristics.${key[0].id}.modifier`, mode : 2, value : 10}]})","mRvLsSVxNyt8LVZb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GRRN3XAKIpEVCY7z\")\nlet data = item.toObject();\ndata.name += \" (To Be Determined)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","mTnmPcjWmvScIBWY":"return args.skill?.name.includes(\"Channelling\") || args.type == \"channelling\"","mV4Tmc0yfpL09KV7":"args.actor.addCondition(\"entangled\")","mYL4i1vNlMl4vFYy":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","ma0sWhebqwdRHWvY":"if (!args.flags.trained)\n{\n args.flags.trained = true;\n args.fields.modifier += 10;\n}","maKr58mvvyKxFyC3":"if (args.item.type == \"prayer\" && (args.item.damage.value || args.item.damage.dice))\n args.item.damage.value += \"+1\"","masOBNgSi5HYkf3m":"return args.type != \"cast\" && args.type != \"channelling\"","mgLGN1XPzPE4dReN":"args.fields.slBonus--;","mr8qm5Bg6k1idZ6Q":"return args.item?.name == \"Play (Lute)\"","mziJBUYcsrhkdcCJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{ \n this.actor.addCondition(\"prone\")\n}","n5RJqJL9fdRIxkuN":"if (this.actor.system.status.advantage.value > 0)\n{\n await this.actor.modifyAdvantage(-1);\n this.script.scriptNotification(\"Advantage Subtracted\")\n}\nelse \n{\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","nCWAflBj7Si2BI1Q":"if (args.item.type == \"spell\" && args.item.system.lore.value != \"petty\")\n{\n args.item.cn.value = Math.max(4, args.item.cn.value * 2)\n}","nD2QVg3DrPK3foMf":"args.actor.setupSkill(\"Dodge\", { fields: { difficulty: \"average\" } }).then(async test => {\n await test.roll();\n if (test.failed) {\n await args.actor.addCondition(\"bleeding\")\n await args.actor.addCondition(\"entangled\")\n }\n })","nEaF3jbCiVYD8jia":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","nGTxNWBUBgTr87wU":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Becomes lodged in the armour or flesh of the opponent. See @UUID[${this.item.uuid}]{${this.item.name}}.`, speaker : {alias : this.item.name}, {blind: true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}\n ","nHJdlqbOP0ECgywb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CnydL8p3PVAuF98w\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","nSXzktHyNjGUXjaw":"return args.item?.system.isRanged","nYtAjSArsNbrU2ob":"if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\n{\n args.fields.modifier -= 10;\n}\nelse if ([\"wp\"].includes(args.characteristic))\n{\n args.fields.modifier += 10;\n}","naF5EWr1CBkYRZTK":"if (args.opposedTest?.attackerTest?.item?.system?.isRanged) \n{\n let choice = await Dialog.wait({\n title: this.effect.name,\n content: `

Abort damage with ${this.effect.name}?`,\n buttons: {\n yes: {\n label: \"Yes\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"No\",\n callback: () => {\n return false;\n }\n }\n }\n })\n\n if (choice)\n {\n args.abort = `${this.effect.name}: Damage cancelled`\n }\n}","ncIjDE6TFx88IQA1":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\");","neaaVy6D6tfcst5P":"args.fields.slBonus += this.actor.characteristics.i.bonus;\n","ngMm7SgtVqVovFJG":"if (args.test.result.critical && args.test.result.critical != \"Total Power\")\n{\n args.test.result.other.push(` Bonecrusher Critical (+20) (only if Critical Cast selected)`)\n}","njPP9wDAsdh4WHIj":"if (args.totalWoundLoss > 0 && [\"trait\", \"weapon\"].includes(args.opposedTest.attackerTest.item?.type))\n{\n this.script.scriptMessage(`Infected: ${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","nkbTnaeBpthyhw4J":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\nlet current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} fortune points increased from ${current} to ${fortunePoints + current}`)","nkdKBJ8ItqWiRAWL":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.
\n They gain +50 to Swim Tests and can breathe underwater.
\n If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}. \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n","nuIpPD4uaZRuJni8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","nvrFhHHVq3KzirlR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\n","nxNqWmmF6mJTnrLo":"return args.weapon?.system.usesHands.includes(this.item.system.location.key);","nzh8d46l1ikhkz8Q":"return (args.type == \"weapon\" && (args.item.system.weaponGroup.value == \"blackpowder\" || args.item.system.weaponGroup.value == \"engineering\")) || (args.type == \"cast\" && args.item.system.lore.value == \"fire\")","o1zD8mej9TWKNxUq":"args.fields.slBonus -= 1;","o3JUBKLvE6bBxK2n":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" } })\nawait test.roll();\nif (test.failed) \n{\n await this.actor.addCondition(\"prone\")\n let injury = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\");\n injury = injury.toObject()\n let toes = Math.clamped(Math.abs(test.result.SL) + 1, 1, 5)\n injury.system.location.key = this.item.system.location.key[0] + injury.system.location.value\n if (injury.system.location.key[0] == \"r\")\n {\n injury.system.location.value = `${toes} Right ${injury.system.location.value}s`\n }\n else if (injury.system.location.key[0] == \"l\")\n {\n injury.system.location.value = `${toes} Left ${injury.system.location.value}s`\n }\n setProperty(injury, \"system.wfrp4e.count\", toes)\n this.actor.createEmbeddedDocuments(\"Item\", [injury])\n}","o88xuUConwt0vFLw":"let points = this.effect.sourceTest.result.overcast.usage.other.current;\n\nthis.actor.update({\"system.status.fortune.value\" : this.actor.system.status.fortune.value + points});\n\nthis.script.scriptMessage(`Gained ${points} Fortune Points`)","oDNfCNyt5KaUYmg2":"if(args.opposedTest.result.winner == \"defender\")\n{\n let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let msg = `Rolled ${roll}.`\n if (roll >= 7)\n {\n msg = `Attack hits with an SL of ${roll - 6}.`\n }\n this.script.scriptMessage(msg, {blind: true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","oEsUsI74yGTZ9CwU":"return args.item?.name == game.i18n.localize(\"NAME.CharmAnimal\")","oGdsGPgJWcyWkiWl":"this.actor.addCondition(\"broken\")\n\nif (this.actor.has(game.i18n.localize(\"NAME.Undead\")))\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\n}","oHenUKtaS3jT5xQn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4xF7M6ylIiGntekh\")\nitem = item.toObject()\nitem.name = this.effect.name\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\n","oPg4se8iQRD14kmB":"let filters = [\n {\n property : \"type\",\n value : \"weapon\"\n },\n {\n property : \"system.weaponGroup.value\",\n value : [\"twohanded\", \"polearm\"]\n }\n]\n\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 1, \"Choose an appropriate Polearm or Two-Handed Weapon\")\nitems = items.map(i => i.toObject())\n\nitems.forEach(i => equip(i))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","oV81zgbZsuTFG6L2":"let caster = this.effect.sourceActor;\n\nthis.actor.modifyWounds(caster.system.characteristics.fel.bonus);\n\nthis.script.scriptMessage(`Healed ${caster.system.characteristics.fel.bonus} Wounds`);","oW1gtYVT5nrxDjM7":"return args.characteristic != \"ag\"","oWM43EdUiyHgUlfW":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.ConsumeAlcohol\"))\n args.test.preData.canReverse = true","oWa7RkScnl6lR5vd":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n \n this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @UUID[Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP] for [[1d10]] hours`)\n }\n}","obIXhQXKFyyQoNNV":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"average\" } }).then(async test => {\n await test.roll()\n if (test.failed) {\n this.actor.modifyWounds(-1);\n this.script.scriptMessage(\"Takes 1 Damage\")\n }\n})","ocBW3osTFnb5JCfe":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","ofddAHvzn1xUueSG":"args.AP.head.value -= tinDifference(args.AP.head.layers)\nargs.AP.body.value -= tinDifference(args.AP.body.layers)\nargs.AP.lArm.value -= tinDifference(args.AP.lArm.layers)\nargs.AP.rArm.value -= tinDifference(args.AP.rArm.layers)\nargs.AP.rLeg.value -= tinDifference(args.AP.rLeg.layers)\nargs.AP.lLeg.value -= tinDifference(args.AP.lLeg.layers)\n\nfunction tinDifference(layers)\n{ \n let metalAP = layers.filter(i => i.metal).reduce((prev, current) => prev + current.value, 0)\n\n let tinAP = layers.filter(i => i.metal).reduce((prev, current) => prev + Math.max(0, current.value - 2), 0)\n\n return metalAP - tinAP;\n}","ogJBAXTXyhTqACPO":"return args.item?.system.attackType != \"melee\"","ohl803m0tUwNfKAk":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 5 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","okW06V9UiPC4Vcrn":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n}\nlet skills = [\"Cool\", \"Dodge\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Combat Reflexes\", \"Resolute\"]\nlet trappings = [\"Leather Jack\", \"Leather Leggings\", \"Leather Skullcap\", \"Hand Weapon\", \"Spear\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","okr3TtzpFoefUuJS":"let item = await fromUuid('Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX')\nlet data = item.toObject();\ndata.system.location.value = \"Collar Bone\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","oqgd9G6oI1ncPYLw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CV9btQn09S9Fn8Jk\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","p222EiR8RRtlPm31":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nreturn test.failed;","pAgiAGyaLJY10894":"return args.skill?.name == game.i18n.localize(\"NAME.Charm\");","pBMioPUtDn1mk9f5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5KP9sOoLSGvj9EXp\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","pG5OVokZzCRHIrwz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mgeiaDZXei7JBEgo\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","pHyXdPnWwoFrUA5n":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\"));","pLKv4moua6XhNdmA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\nlet data = item.toObject();\ndata.name += \" (Woodlands)\";\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect : this.effect.id})","pNPjXEoQGHLKzq0r":"let talent = this.actor.has(\"Arcane Magic (Light)\", \"talent\")\nlet demon = this.actor.has(game.i18n.localize(\"NAME.Daemonic\"))\n\nif (!talent)\n{\n await this.actor.addCondition(\"blinded\")\n}\n\nif (demon)\n{\n await this.actor.addCondition(\"stunned\")\n}","pPV9oEydXb7oi6jX":" if (args.totalWoundLoss > 0)\n {\n args.actor.addCondition('ablaze')\n }","pR4Q2OnPxXtwRVli":"let criticals = this.actor.itemTypes.critical;\n\nif (criticals.length)\n{\n this.script.scriptNotification(\"Cannot suffer Critical Wounds\");\n this.actor.deleteEmbeddedDocuments(\"Item\", criticals.map(i => i.id))\n}\n\nif (getProperty(args.data, \"system.status.wounds.value\") == 0)\n{\n this.script.scriptNotification(`Dormant for ${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds`)\n}","pnB9TzSEytkxk3Rb":"return this.actor.hasSystemEffect(\"infighting\")","pq1YQffxtOcqCRTn":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {appendTitle: ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n this.actor.addCondition(\"prone\")\n}","px7eEdhOEt7zOTrq":"return [\"int\", \"t\", \"wp\", \"i\"].includes(args.characteristic)","pzimrxrqpv282Oqb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.TaYriYcJkFuIdBKp\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\n","pzknBcJtZWeliE27":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\") || args.item?.name == game.i18n.localize(\"NAME.Cool\")","q0LvphC8RDSyR0oY":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\n ws : game.wfrp4e.config.characteristics.ws,\n t : game.wfrp4e.config.characteristics.t,\n ag : game.wfrp4e.config.characteristics.ag,\n wp : game.wfrp4e.config.characteristics.wp\n}, this.effect.img), 1, \"Choose Characteristic\");\n\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","q3nRyXaxksdCiLFM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.j6v78dnOOdCB6c3d\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","qAEZgtu5CrfUkxhx":"if (args.test.options.staunchBleeding) \n{\n if (args.test.succeeded) \n {\n let staunch = Number(args.test.result.SL) + 1\n if (args.test.options.fieldDressing && args.test.result.reversed)\n {\n staunch = Math.min(1, Number(args.test.result.SL)) + 1\n }\n args.test.result.other.push(`${this.actor.name} removed ${staunch} Bleeding conditions from the patient.`)\n }\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\n {\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\n }\n}","qK4q4o6cQhcGzFX3":"let fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet leader = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vCgEAetBMngR53aT\")\nlet fearData = fear.toObject();\nlet leaderData = leader.toObject();\nfearData.system.specification.value = this.effect.sourceTest.result.overcast.usage.other.current; \ntalents = new Array(1 + this.effect.sourceTest.result.overcast.available).fill(leaderData); // Assume any unused overcast is for war leader\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData].concat(talents), {fromEffect : this.effect.id})","qSwCYMMiIHmSV1X5":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n effectData.duration.seconds = 10800\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","qT0WBPxLMMO9gvCd":"if (!this.actor.has(\"Night Vision\") && !this.actor.has(\"Night Vision\", \"talent\") && !this.actor.hasCondition(\"blinded\"))\n{\n this.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.nightshroud\" : true})\n}","qUwnVlWpsmDom3RK":"args.fields.modifier -= 5;","qZschZU0nee0kJlk":"args.fields.modifier -= 30;","qaVde0sTuMBRi2nl":"return [\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","qcyl98GYD55BkJsD":"this.actor.status.encumbrance.state = 0;\nthis.actor.status.encumbrance.pct = 0;","qijgjcOBCDmhglRX":"return args.skill?.name == game.i18n.localize(\"NAME.SleightOfHand\");","qjli5evn8UA9uTeZ":"return args.actor.uuid == this.effect.sourceActor.uuid;","qmOt7h17hGAKqQe0":"\nlet choice = await Dialog.wait({\n title: this.effect.name,\n content: `

${this.effect.name}: Is this a ranged or magical attack that orignates outside the Dome?

`,\n buttons: {\n yes: {\n label: \"Yes\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"No\",\n callback: () => {\n return false;\n }\n }\n }\n})\n\nif (choice)\n{\n\targs.ward = 6;\n}","qu194dVXm9Vx1TGk":"if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`)\n}","quPcuKsq2fcild4a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"easy\"}, context: {failure : `${this.effect.name}: Vomit!`} })\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","qxzhPtysAjPWspKf":"if (this.actor.has(\"Undead\") || this.actor.has(\"Daemonic\"))\n{\n this.script.scriptNotification(`Cannot enter ${this.effect.name}!`);\n}","r6hi5vMdLhTaaPfb":"args.actor.details.move.value += this.effect.sourceTest.result.overcast.usage.other.current","rCh3ltUrUMovd2Kc":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.script.scriptNotification(\"Cannot be surprised\");\n this.actor.removeCondition(\"surprised\");\n}","rF0Z3hTUUnSxL3Mq":"let armour = (await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")).toObject()\nlet bite = (await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")).toObject()\nlet fear = (await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")).toObject()\nlet nightVision = (await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\")).toObject()\nlet tracker = (await fromUuid(\"Compendium.wfrp4e-core.items.ClOlztW6hH8rslbp\")).toObject()\nlet weapon = (await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")).toObject()\n\narmour.name = \"Armour (Hide)\"\narmour.system.specification.value = 2\nbite.system.specification.value = 3\nfear.system.specification.value = 2\nweapon.system.specification.value = 4\nlet items = [armour, bite, fear, nightVision, tracker, weapon]\n\n\nlet belligerent = (await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")).toObject()//{Belligerent}\nlet bestial = (await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")).toObject()//{Bestial}\nlet big = (await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")).toObject()//{Big}\nlet blessed = (await fromUuid(\"Compendium.wfrp4e-core.items.5muSFXd6oc760uVj\")).toObject()//{Blessed (Ulric)}\nlet champion = (await fromUuid(\"Compendium.wfrp4e-core.items.4mF5Sp3t09kZhBYc\")).toObject()//{Champion}\nlet die = (await fromUuid(\"Compendium.wfrp4e-core.items.UsJ2uIOOtHA7JqD5\")).toObject()//{Die Hard}\nlet fast = (await fromUuid(\"Compendium.wfrp4e-core.items.9MjH4xyVrd3Inzak\")).toObject()//{Fast}\nlet frenzy = (await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")).toObject()//{Frenzy}\nlet immunity = (await fromUuid(\"Compendium.wfrp4e-core.items.IAWyzDfC286a9MPz\")).toObject()//{Immunity to Psychology}\nlet regenerate = (await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")).toObject()//{Regenerate}\nlet size = (await fromUuid(\"Compendium.wfrp4e-core.items.8slW8CJ2oVTxeQ6q\")).toObject()//{Size (Large)}\n\nblessed.system.specification.value = \"Ulric\"\nsize.system.specification.value = \"Large\"\n\nlet optional = [belligerent, bestial, big, blessed, champion, die, fast, frenzy, immunity, regenerate, size];\n\nlet chosen = await ItemDialog.create(optional, \"unlimited\", \"Choose Optional Traits\");\n\nitems = items.concat(chosen || [])\nthis.script.scriptNotification(`Adding ${items.map(i => i.name).join(\", \")}`);\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\n","rIISfbCShejmJNKw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oRx92ByVNEBN6YkK\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","rLMaVNEGdZ6xj5Au":"return ![\"i\", \"int\", \"fel\"].includes(args.characteristic)","rRfff55c7elyvbCb":"return this.actor.flags.useless[this.item.system.location.key] && args.weapon?.system.usesHands.includes(this.item.system.location.key[0] + \"Arm\")","rUGSx06BuBvX9kgf":"if (args.test.result.charging)\n{\n args.test.result.damage += 1\n args.test.result.additionalDamage += 1\n if (!args.test.result.resolute) {\n args.test.result.breakdown.damage.other.push({label : this.effect.name, value : this.item.Advances});\n args.test.result.resolute = true // Prevent duplicate messages\n }\n}\n","rVpPNILEzWL9lj6b":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kJNAY1YRaCy9IgmT\")\nlet terrorTraitItem = item.toObject()\nterrorTraitItem.system.specification.value = Number(this.effect.item.system.specification.value) \nthis.actor.createEmbeddedDocuments(\"Item\", [terrorTraitItem]);","rXMylpnEtZpwou6x":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"fatigued\") \n }\n})","ramav4ymrDDkPKK4":"if (this.actor.hasCondition(\"bleeding\"))\n{\n this.actor.removeCondition(\"bleeding\");\n this.script.scriptNotification(\"Removed 1 Bleeding Condition\")\n}\nelse \n{\n this.script.scriptNotification(\"No Bleeding Conditions\");\n}","ratP9ByLjQPiLlFK":"args.data.canReverse = true","rdaMhMyHrJjQ6vVC":"game.wfrp4e.utility.postFear(this.item.Advances, this.actor.name)","re1UFtxvRRjpPB7Z":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nF5z1OEhpi4t6a6S\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nif (data.system.location.key[0] == \"r\")\n{\n\tdata.system.location.value = \"Right Ankle\"\n}\nelse if (data.system.location.key[0] == \"l\")\n{\n\tdata.system.location.value = \"Left Ankle\"\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {skipLocationValue : true, fromEffect: this.effect.id})\n","red2bt4PGgIWAdTR":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n let minutes = Math.ceil(CONFIG.Dice.randomUniform() * 10) * 10;\n effectData.duration.seconds = 60 * minutes\n this.script.scriptMessage(`Duration: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","rgSwSeB3shIMVMb6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.x0WMGwuQzReXcQrs\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","rnioLwiJP7ps5Jwy":"if (args.item.type == \"skill\" && args.item.name == \"Melee (Basic)\")\n{\n args.item.system.modifier.value += 30;\n}","roKvPHDSpX4IV11C":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && args.characteristic != \"ag\"","rpxQU26BU7nwjtqY":"let location = this.item.system.location.key\nlet test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : `${this.effect.name}: Drop the item!`}, skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}})\nawait test.roll();\n\n\nif (location && test.failed)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nreturn test.succeeded","rr4htuVq45onXdRG":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\ntest.roll();","rxB1AqfVMDqTRieE":"return ![\"ws\", \"bs\", \"ag\"].includes(args.characteristic) && args.skill?.name != game.i18n.localize(\"NAME.Perception\")","s0kTuDE0qv68V2KI":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFBF00\"}}));\n","s5bO0Sf0qpS27Tve":"await args.actor.addCondition(\"ablaze\", 3)\nawait args.actor.addCondition(\"prone\");","s6eZXfZkC1My6EXl":"let lore = this.effect.name.split(\" \")[2].toLowerCase();\nif (args.item.type == \"spell\" && args.item.system.lore.value == lore)\n{\n args.item.system.cn.value -= 1\n}\n","s7gJQdzuM3fz2zQK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\nlet data = item.toObject();\ndata.system.location.value = \"Hip\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","s8idWt9YdMTRfnjV":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","s8xU6OOZbbfo6VIw":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus\n","s94yKZ4o5XN4JWM1":"// Any attack with such ammunition which inflicts at least one Wound,\n// also inflicts one Bleeding Condition.\n\nif (args.totalWoundLoss > 0) {\n args.actor.addCondition(\"bleeding\")\n}\n","sAVpm7hFRHpbCLXm":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"i\"].includes(args.characteristic)","sB4KB9bT3nQhAoqG":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\n\nlet mainEffect = this.item.effects.contents[0];\nif (mainEffect.name.includes(\"\"))\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choose Lore\");\n if (choice.length)\n {\n mainEffect.update({name : mainEffect.name.replace(\"\", choice[0].name)})\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\n }\n}\n\nthis.effect.delete();","sHfkTRqTWPg2JAGN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","sKO8TcLIkCTnFvXu":"args.abort = true;\nthis.script.scriptNotification(`Cannot use ${this.item.system.location.value}!`, \"error\")","sNSfDBIA2k17hPYI":"let ablaze = this.actor.hasCondition(\"ablaze\");\nif (ablaze)\n{\n\tablaze?.delete();\n\tthis.script.scriptNotification(\"Ignore Ablaze\");\n}\n","sSMg43ZjnNmpytfj":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\nawait test.roll();\n","sUHuj00IpoZ7Gd03":"return args.skill?.name != game.i18n.localize(\"NAME.Swim\");","sWyO1DNaqb2EdHoW":"if (!this.actor.items.getName(game.i18n.localize(\"NAME.Frenzy\"))) // Either frenzy trait or psychology\n{\n // Add Frenzy psychology\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\n let data = item.toObject();\n data.effects[0].disabled = false;\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n}\n\nthis.script.scriptMessage(`

By imbibing this potion, ${this.actor.prototypeToken.name} has becomes subject to Frenzy. This Frenzy lasts [[1d10]] Rounds, and may not be ended sooner.

`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) ","sYlGRLApZ3Ub24ea":"this.actor.system.status.addArmour(3, {source: this.effect.name, magical: true})","sZwLitzwKBTaFca3":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\")\nlet data = item.toObject();\ndata.name = data.name.replace(\"Target\", \"Greenskins, Undead, Chaos\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","sagKJM6oDFlw4ED2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nreturn test.failed;","sbK1a7txpSoXFzyB":"if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`)\n}","scfm5iWWBxWI6QaK":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nfear = fear.toObject();\nfear.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","sgS9rblPkQB36C8S":"if (this.item.name.includes(\"(\"))\n{\n\tlet trade = this.item.parenthesesText;\n\tif (trade?.toLowerCase() != \"any\")\n\t return this.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"any one\", trade)})\n}\n\nlet index = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Trade\")))\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(index, 1, \"Choose a Trade Skill\")\nlet text;\nif (!choice[0])\n{\n let custom = await ValueDialog.create(\"Enter Custom Trade Skill\", \"Custom Trade\"); \n text = custom || \"\"\n}\nelse \n{\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\n}\n\nawait this.item.updateSource({name : this.item.name.replace(\"(Any)\", \"\").replace(\"(any)\", \"\").trim() + ` (${text})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"any one\", text)});","shkBUtUuMPDKvFm7":"let test = await this.actor.setupSkill(\"Dodge\", {fields : {difficulty : \"average\"}})\nlet caster = this.effect.sourceActor\n\nlet fallen = this.effect.sourceTest.result.SL + caster.characteristics.wp.bonus\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n this.script.scriptMessage(`${this.actor.prototypeToken.name} falls ${fallen} yards`)\n}","skVq3eDEYKFF2iZp":"// I'm assuming the endurance test specified is for the end-round check\nawait this.actor.addCondition(\"poisoned\", 4);\n","sm9d5lk6cM0OuUkf":"this.actor.applyFear(Math.min(4, this.effect.sourceTest.result.overcast.usage.other.current))","sx7Ikn8WW00gBFb4":"let location = (Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"r\" : \"l\") + \"Arm\"\n\nif (location == \"lArm\")\n{\n\tthis.script.scriptNotification(\"Rolled Left\")\n}\nelse if (location == \"rArm\")\n{\n\tthis.script.scriptNotification(\"Rolled Right\")\n}\n\nthis.effect.updateSource({\"flags.wfrp4e.location\" : location});\n\nif (location)\n{\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","syBgPp7rOymCZejX":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}","syqqBkyP5tGqZ78t":"this.actor.has(\"Immunity to Psychology\")?.delete();\n\nlet roll = await new Roll(\"1d10\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nthis.script.scriptNotification(`Removed Immunity to Psychology, Adding ${roll.total} Broken Conditions`)\nthis.actor.addCondition(\"broken\", roll.total, {\"flags.wfrp4e.blasted-mind\" : true})","t48hkacYdOpzWvK9":"args.options.beatBlade = true;","t56mnblo1kv3gM1M":"return args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\");","t8LYOuN5peEdWeXP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","tCIT1a12Gt6k2ohA":"let resistance\nif (this.item.name.includes(\"(\"))\n{\n\tresistance = this.item.parenthesesText\n}\nelse \n{\n resistance = await ValueDialog.create(\"Enter Resistance\", \"Resistance\") \n \n if (resistance)\n {\n this.item.updateSource({name : this.item.name + ` (${resistance})`})\n this.effect.updateSource({name : this.effect.name + ` (${resistance})`})\n }\n} \nthis.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"the associated Threat\", resistance)})\n\nif (resistance && !this.effect.name.includes(\"(\"))\n{\n this.effect.updateSource({name : this.effect.name += ` (${resistance})`})\n}","tDrs0aNIYmZPsOoS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}\n","tFAKRRRfTjQfdQz3":"this.actor.getActiveTokens().forEach(t => t.document.update({\"texture.tint\" : \"\"}));","tG1qGqzBLmAR3WHm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) \n{\n let add = 0\n\n if (test.result.roll % 11 == 0 || test.result.roll == 100) \n {\n add = 1 // can't use isFumble if no hit location\n }\n\n await this.actor.addCondition(\"stunned\", Math.max(1, Math.abs(test.result.SL)) + add)\n await this.actor.addCondition(\"blinded\", Math.max(1, Math.abs(test.result.SL)))\n\n}","tGVEV6TLl310mFLP":"let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\nif (args.applyAP && nonmagical) \n{\n let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\n args.modifiers.ap.ignored += nonmagical\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore Non-Magical AP (\" + nonmagical + \")\");\n}","tKBq1nGZo8t6vvQ6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5hH73j2NgPdsLCZN\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","tNTO1LVN7JqHf4YN":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"malaise\"]])\n this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @Condition[Malaise] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","tUwP7TjrOOOnaCYJ":"let fatigued = this.actor.hasCondition(\"fatigued\")\nif (fatigued)\n{\n this.script.scriptNotification(`Cleared ${fatigued.conditionValue} Fatigued Conditions`)\n fatigued.delete(); \n}\nelse \n{\n\tthis.script.scriptNotification(`No Fatigued Conditions`)\n}","tcZug8ehU6lyYBd9":"return args.skill?.name != \"Ranged (Blackpowder)\"","tdICiJ26rJrDbxT6":"return args.characteristic != \"i\"","tn6SwmjAuNzqE6dx":"let damage = 0\nlet test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\n\nif (test.succeeded)\n{\n damage = 10;\n}\nelse if (test.failed)\n{\n damage = 20;\n}\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", hideDSN: true, suppressMsg : true}))","tnE8LF6E3svIlLca":"return args.skill?.name == game.i18n.localize(\"NAME.Research\");","tnilBagajWM8UGQt":"return args.item?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\")","toSrgcvWq9b5eN0K":"let location = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN: true})\n\nthis.item.updateSource({name : `${this.item.name} (${location.description})`})\nthis.script.scriptMessage(`Location: ${location.description}`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","tolkNN5P7oOC8GKZ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\nawait test.roll();\n\nif (test.failed)\n{\n let sourceActor = this.effect.sourceActor;\n if (sourceActor)\n {\n this.script.scriptMessage(await this.actor.applyBasicDamage(sourceActor.system.characteristics.wp.bonus, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}))\n }\n}","u3olS2p7Ls1JXfAH":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"mutatephys\", {}, \"Tzeentch\"));","u5dNZ0s3lWfL8KFb":"return args.fields.charging","u6CYMSZADrfXd48Q":"args.fields.modifier += 20;","uACa6u4JLNMRgFlr":"const talents = await Promise.all([\"Furious Assault\", \"Sea Legs\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","uAy4w7y8Uu9POF8C":"args.item.system.qualities.value.push({name : \"impact\"})","uLBDnWC3S0lRitbj":"let test = await this.actor.setupCharacteristic(\"int\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\n {\n this.actor.addCondition(\"unconscious\")\n await this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n else \n {\n await this.actor.addCondition(\"stunned\", 1 + opposedResult.differenceSL);\n }\n}\nelse \n{\n return false;\n}","uNYstk3eXmWamhzs":"args.actor.addCondition(\"blinded\")","uOHAsKlkFuIaAmjb":"args.actor.modifyWounds(1)","uSwkYENTOcnfRrqA":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) && args.weapon?.system?.attackType != \"melee\"","ucF4aiJ1gpDB333G":"if (args.test.options.catfall && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target) && !args.test.result.catfall)\n{\n args.test.result.other.push(`${this.effect.name}: Fall distance damage reduced by ${Number(args.test.result.SL) + 1} yards`)\n args.test.result.catfall = true; // Prevent duplicate messages\n}","ugL5IBB6R2yWyMWd":"if (args.totalWoundLoss > 0)\n{\n let apply = await Dialog.confirm({title : this.effect.name, content : `

Appy ${this.effect.name} Damage? Attacker must have used bare hands or a melee weapon made of metal.`})\n if (apply)\n {\n \n let damage = 5 + this.actor.characteristics.wp.bonus;\n \n let loc = args.opposedTest.attackerTest.weapon?.system.usesHands[0] || \"rArm\";\n \n let APatLoc = args.opposedTest.attacker.system.status.armour[loc];\n \n let metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\n \n let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\n \n damage -= (APused + args.opposedTest.attacker.system.characteristics.t.bonus)\n \n let msg = await args.opposedTest.attacker.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\n msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`\n this.script.scriptMessage(msg)\n }\n}","upfK6GM33qZCZjll":"return args.item?.name != \"Play (Lute)\"","uwdQvZtzy2HVeEzx":"if (args.totalWoundLoss > 0)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData());\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\n \n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.script.scriptMessage(\"\" + args.actor.name + \" takes a @Table[critbody]{Critical Hit} to the torse\", {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n }\n })\n}\n","ux3jaLpAUhZ5YqA6":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\") && args.item?.name != game.i18n.localize(\"NAME.Cool\")","v00nVCRKqqRvY28t":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\", 3)\n}\n","v4CCxVaVGf9i8U7X":"let cured = await Dialog.wait({\n title : this.effect.name,\n content : \"

Enter the number of diseases/poisons cured

\",\n buttons : {\n confirm : {\n label : \"Confirm\",\n callback : (dlg) => {\n let input = dlg.find(\"input\");\n value = parseInt(input[0].value);\n return value;\n }\n }\n }\n})\n\n\nlet damage = 0;\n\nlet rolls = new Array(cured).fill(\"\").map(i => `max(0, 1d10 - ${this.actor.system.characteristics.fel.bonus})`)\n\nlet test = new Roll(`${rolls.join(\" + \")}`);\nawait test.roll();\ntest.toMessage({speaker : {alias : this.actor.name}, flavor : this.effect.name});\nthis.script.scriptMessage(await this.actor.applyBasicDamage(test.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true }))","v4ITTsSY9EvCbhZP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","v5xrDWcrTNFJkyQB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Ranged (Bow)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Longbow\",\n },\n {\n type : \"ammunition\",\n name : \"Arrow\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `

\n Add Option?\n

\n
    \n
  1. Ranged (Bow) +10 and a Longbow with 12 Arrows
  2. \n
\n `,\n buttons : {\n 1 : {\n label : \"Yes\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"No\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","v6LIG7EwWYALxCpP":"return !this.effect.getFlag(\"wfrp4e\", \"trained\")?.includes(\"entertain\") || (!args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Play\")))","vFUVWZ1l8wpTjLcx":"if (!this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))\n return\n\nlet caster = this.effect.sourceActor;\nif (caster) \n{\n let wp = caster.system.characteristics.wp\n if (this.actor.system.characteristics.wp.value >= wp.value)\n {\n this.script.scriptNotification(\"Target has higher Willpower, no effect\")\n return\n }\n this.actor.applyBasicDamage(wp.bonus, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL })\n}","vJQRBxDfPwHens0a":"if (args.totalWoundLoss > 0) \n{\n args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\n await test.roll();\n if (test.failed) \n {\n await args.actor.addCondition(\"poisoned\")\n this.script.scriptMessage(await args.actor.applyBasicDamage(3, {suppressMsg : true, damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL }))\n }\n })\n}","vM2BPwYhHQaBAt2C":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.KII1gWnxIZ8HzmU5\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","vNp9wgdSvnNEjZyS":"args.fields.slBonus -= 2; ","vPG4rV640aSzKzxe":"return !this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","vS2D9QUslR7ZtXXm":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData())\n\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\n}","vSDMygIT9nNvEGWG":"// Each time the blade is used, the GM should secretly roll a d10.\n// On a 1, its poison has run dry, \n// and the next time it is employed it will shatter.\n\nif (Math.ceil(CONFIG.Dice.randomUniform() * 10) == 1) {\n this.item.setFlag(\"wfrp4e\", \"brittle\", true)\n ChatMessage.create({\n content: `\n ${this.item.name} has run out of poison. It will shatter the next time it is used.`, \n whisper: ChatMessage.getWhisperRecipients(\"GM\"),\n blind: true\n })\n}\n","vY3xeTTL3ghPrJpN":"this.actor.addCondition(\"entangled\");","vZ5HCrhY8e4R1TrG":"let eye = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\nlet nose = await fromUuid(\"Compendium.wfrp4e-core.items.SpPRZZRHxly7uo2G\")\nthis.actor.createEmbeddedDocuments(\"Item\", [eye, nose]);","vc4bELo0cWYoILfB":"let choice = await ItemDialog.create(this.actor.itemTypes.disease, 1, \"Choose a disease to heal (must be naturally occuring)\")\n\nthis.script.scriptMessage(`Cured ${choice[0]?.name}`);\nchoice[0].delete()","vc8eVKtyjtOGvWlK":"if (!this.actor.hasCondition(\"entangled\"))\n{\n this.effect.delete();\n}","vcM0IgsYVmfWrlO3":"fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\").then(item => {\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\n})","vgfs0DXvF5iKrz1M":"return args.characteristic != \"ag\" || this.item.getFlag(\"wfrp4e\", \"passed\")","vj3zArmX27vCxYJW":"return ![\"NAME.Perception\", \"NAME.Navigation\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","vjyTKcNrJzX4XWnS":"let SL = parseInt(this.effect.sourceTest.result.SL)\nif (SL < 0)\n SL = 0\nthis.actor.addCondition(\"fatigued\", 1 + SL)","vuzRRj5d9XdNYx3o":"let broken = this.actor.hasCondition(\"broken\")\nif (broken)\n{\n broken.delete();\n this.script.scriptNotification(\"Removed Broken\")\n}","vvVhAqreedtmOR9b":"args.totalWoundLoss = Math.max(0, args.totalWoundLoss - 1)\nargs.modifiers.other.push({label : this.effect.name, value : -1)","vvdo1NxjmGVkmFCT":"await this.actor.addCondition(\"stunned\");\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (test.failed)\n{\n\tawait this.actor.addCondition(\"prone\")\n\tawait this.actor.addCondition(\"stunned\")\n}\n \nlet location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","vzMxIDjRlQSxXtCW":"// Remove the miscast if doubles rolled and succeeded\nif(args.test.succeeded && args.test.result.minormis && args.test.result.roll % 11 == 0)\n{\n delete args.test.result.minormis\n}\n// Decrement the major miscast to minor miscast\nelse if(args.test.succeeded && args.test.result.majormis && args.test.result.roll % 11 == 0)\n{\n delete args.test.result.majormis\n args.test.result.minormis = game.i18n.localize(\"ROLL.MinorMis\")\n}","w3r54pKZQKaH2Yer":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\nlet slOver = this.effect.sourceTest.result.slOver;\nlet overcast = this.effect.sourceTest.result.overcast\nslOver -= ((overcast.total - overcast.available) * 2) // If they used an overcast, subtract 2 SL for each one\nlet added = Math.floor(slOver / 3) || 0\ndata.system.specification.value = 1 + added; // For each +3 SL, add 1 specification\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","w4JKuTECFmu3YmTR":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\"))","w4zubIHP0XgMXsFe":"return !args.options.terror && !args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","w7K0lbxQKJ2tsc6f":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\nlet data = item.toObject();\ndata.system.specification.value = 60\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","wAETU6aTRr9d4oCU":"args.fields.slBonus++;","wAntJhgb8Og5vJXh":"args.options.staunchBleeding = true;","wS6OIR3QN4mOUHn0":"if (args.totalWoundLoss > args.actor.characteristics.t.bonus)\n{\n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\")).then(async test => {\n await test.roll()\n if (test.failed) {\n let disease = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\n disease = disease.toObject()\n disease.system.duration.active = true\n args.actor.createEmbeddedDocuments(\"Item\", [disease])\n }\n })\n}","wUlYLBT59Efys5aS":"args.actor.addCondition(\"prone\");","wbM7tpw4TxvadcWm":"let items = this.effect.itemTargets;\nlet msg = \"\";\nfor(let item of items)\n{\n if (item.system.properties.qualities.durable)\n {\n await item.update({\"system.qualities.value\" : []});\n msg += `

${item.name} loses all Qualities

`\n }\n else \n {\n msg += `

${item.name} crumbles into dust!

` \n await item.update({name : item.name + \" (Dust)\"})\n }\n}\nif(msg)\n{\n this.script.scriptMessage(msg);\n}","whUSkaR1yem21bXp":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 6,\n \"int\" : -5,\n \"wp\" : 0,\n \"fel\" : 10\n}\nlet skills = [\"Melee (Basic)\", \"Track\"]\nlet skillAdvancements = [8, 7]\nlet talents = [\"Berserk Charge\", \"Careful Strike\", \"Strike to Injure\"]\nlet traits = [\"Flight (8)\", \"Fury\", \"Swarm\", \"Tracker\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Could not find ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","wsqNM4NHnwaAAQym":" args.applyAP = false;\n\n this.script.scriptNotification(\"This test only applies to criminals, otherwise close the dialog.\");\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => \n {\n await test.roll();\n if (test.failed)\n {\n args.actor.addCondition(\"unconscious\");\n }\n });","wyTCozh9qGTx6yK0":"if (args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Does not need to make Fear or Terror tests\");\n}","wzkxiKjxVEeNS1di":"let roll = await new Roll(\"1d10\").roll();\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\n\nawait this.actor.addCondition(\"deafened\", 3)\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty: \"average\" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"Gain a Broken Condition\", success : \"Avoided Broken Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"broken\")\n}","x2RLUUNB7BiIDYCP":"\n let difficulty = \"\"\n if (this.effect.name.includes(\"Moderate\"))\n difficulty = \"easy\"\n else if (this.effect.name.includes(\"Severe\"))\n difficulty = \"average\"\n else\n difficulty = \"veasy\"\n \n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" dies from Blight\"}, fields: {difficulty}, skipTargets: true, appendTitle : \" - Blight\"})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"dead\");\n }\n ","x76tKw4L8dX00ikE":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\nlet data = item.toObject();\nsetProperty(data, \"flags.wfrp4e.breath\", \"fire\")\ndata.system.specification.value = 5\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","x8XK2fzzXCnSwfjt":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"))\nawait test.roll();\n\nif (test.succeeded)\n{\n\tthis.actor.removeCondition(\"prone\");\n}","x9G6Du5EWV6byf4C":"if (parseInt(this.effect.sourceTest.result.SL) >= 3)\n{\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 2)\n}\nelse \n{\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\n}","x9iKFYYc4Ocy8PTS":"let item = this.effect.getCreatedItems()?.[0];\nChatMessage.create({content : \"Grace is beyond style\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({\n \"nobles\" : \"Nobles\",\n \"guilders\" : \"Guilders\",\n \"servants\" : \"Servants\"\n}), 1, \"Choose Group\")\n\nlet name = choice[0]?.name\n\nif (!name)\n{\n return;\n}\n\nif (item)\n{\n item.update({\n name : item.name.split(\"(\")[0] + ` (${name})`, \n \"system.tests.value\" : item.system.tests.value.split(\"(\")[0] + ` (${name}`\n })\n}\nelse \n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\");\n let data = item.toObject();\n data.name += ` (${name})`\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n}","xBpLQa7yBPczDMY8":" let scythe = (await fromUuid(\"Compendium.wfrp4e-core.items.CXg7XOFJwu4LZ9LM\")).toObject();\n scythe.name = \"Scythe of Shyish\";\n scythe.system.damage.value = \"WPB + 3\"\n scythe.system.equipped = true;\n scythe.img = this.effect.icon;\n scythe.system.qualities.value.push({name : \"magical\"})\n this.actor.createEmbeddedDocuments(\"Item\", [scythe], {fromEffect : this.effect.id})","xIRU2SaqLeWmqGDI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\")\nlet data = item.toObject();\ndata.name += \" (Disease)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xL4S0H1RP8hhXW7c":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xneBqGOs1QS7kfUr\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xLKAuD6yzwjAL6tJ":"return !args.weapon || args.weapon?.system.properties?.qualities.shield || !this.item.system.usesLocation(args.weapon)","xMhhVol8Is3DJ3gb":"if (this.effect.sourceTest.succeeded)\n{\n let blinded = 1 + this.effect.sourceTest.result.overcast.usage.other.count\n this.actor.addCondition(\"blinded\", blinded)\n}","xPDMpOvC1ZBVxrNg":"args.fields.modifier += 10;","xPwa3NftkpMBc2AO":"return ![\"ws\", \"s\", \"ag\"].includes(args.characteristic)","xQ3xR2Wf0wHFa76H":"return [\"ws\", \"bs\", \"fel\", \"dex\"].includes(args.characteristic) || args.weapon","xQnoRTHotZKrwPrx":"return args.type == \"cast\" && args.item?.system.lore?.value == \"shadow\"","xRTmMwNfdirjsi8X":"this.actor.addCondition(\"ablaze\");\n\nthis.actor.applyBasicDamage(this.effect.sourceTest.result.damage)","xRd6oA1QWLVpfoBm":"if (!this.actor.has(\"Night Vision\"))\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\");\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}","xS2su09zcza9du09":"if ([\"Minor\", \"Moderate\", \"Major\"].includes(this.item.system.specification.value))\n{\n\treturn\n}\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({minor : \"Minor\", moderate : \"Moderate\", major : \"Major\"}, this.item.img), 1, \"Choose Corruption Severity\");\n\nthis.item.updateSource({\"system.specification.value\" : choice[0]?.name || \"\"})","xUpKYT7BZCSmAfUy":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[0].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","xYTkj8jhSVOSoLbC":"this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] = true;","xcy5GOUSZ0meIejZ":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[warp-grinder-fumble]\")\n}","xgdhf0wlNP2cHIQx":"await this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","xgplXZMs459X7XXM":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.
\n They suffer –20 to all attempts to resist Disease.
\n If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}. \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n","xklncIMwQIespDxS":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"vhard\"}});\nawait test.roll();\ngame.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData())\n\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\");\n}","xnHobI9HojObLHMp":"args.applyTB = false;\nargs.applyAP = false;","xobGBJbgFjQCrwvq":"let roll;\nif (this.actor.has(game.i18n.localize(\"NAME.Daemonic\")) || this.actor.has(game.i18n.localize(\"NAME.Undead\")) || [\"Goblin\", \"Orc\", \"Undead\"].includes(this.actor.system.details.species.value))\n{\n roll = await new Roll(`1d10 + ${this.effect.sourceTest.result.overcast.usage.other.current}`).roll()\n}\nelse \n{\n roll = await new Roll(`1d10`).roll()\n}\n\nroll.toMessage(this.script.getChatData())\nawait this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true})\n\nif (this.actor.has(\"Undead\") || args.actor.has(\"Daemonic\"))\n{\n this.actor.addCondition(\"ablaze\")\n}","xpgXWoK2zDnG1uiF":"let stunned = args.actor.hasCondition(\"stunned\")\nif (stunned)\n setProperty(stunned, \"flags.wfrp4e.scriptData\", getProperty(stunned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet poisoned= args.actor.hasCondition(\"poisoned\")\nif (poisoned)\n setProperty(poisoned, \"flags.wfrp4e.scriptData\", getProperty(poisoned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet deafened = args.actor.hasCondition(\"deafened\")\nif (deafened)\n setProperty(deafened, \"flags.wfrp4e.scriptData\", getProperty(deafened, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet entangled = args.actor.hasCondition(\"entangled\")\nif (entangled)\n setProperty(entangled, \"flags.wfrp4e.scriptData\", getProperty(entangled, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet fatigued = args.actor.hasCondition(\"fatigued\")\nif (fatigued)\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet blinded = args.actor.hasCondition(\"blinded\")\nif (blinded)\n setProperty(blinded, \"flags.wfrp4e.scriptData\", getProperty(blinded, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet broken = args.actor.hasCondition(\"broken\")\nif (broken)\n setProperty(broken, \"flags.wfrp4e.scriptData\", getProperty(broken, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet prone= args.actor.hasCondition(\"prone\")\nif (prone)\n setProperty(prone, \"flags.wfrp4e.scriptData\", getProperty(prone, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","xq3RANOtmPhy77ne":"args.update({texture : {tint : \"#FFBF00\"}});","xqWxV9w5ezBQdJkZ":"return args.options.corruption;","xvGxwv7X0Vq3vNqb":"args.fields.modifier -= 10;","xvH4PKJasHcehOZz":"return args.skill?.name == `${game.i18n.localize(\"NAME.Lore\")} (${this.item.parenthesesText})`","y3agVFVBR8tVqWyx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();","yAL0YwZWVm8o1nxa":"if (this.actor.hasCondition(\"dead\") && !this.actor.gardenOfCorpses)\n{\n this.script.scriptMessage(\"[[3d10]] @UUID[Compendium.wfrp4e-core.actors.T79RqnDOAQLn3I1s]{zombies} spring forth from the remains.\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n this.actor.gardenOfCorpses = true;\n // local storage is sufficient to prevent multiple messages\n}","yCgH3N9AurIiAv0i":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"(Sens)\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let sense = name.split(\"(\")[1].split(\")\")[0]\n tests = `${tests.split(\"(\")[0].trim()} (${sense})`;\n }\n else // If no sense specified, provide dialog choice\n {\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\n taste : \"Goût\",\n sight : \"Vue\",\n smell : \"Odorat\",\n hearing : \"Ouie\",\n touch : \"Toucher\"\n }, this.item.img), 1, \"Choisir un sens\");\n if (choice[0])\n {\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\n tests = `${tests.split(\"(\")[0].trim()} (${choice[0].name})`\n }\n }\n\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","yDvxF9llUYwJg0sE":"if (getProperty(args.data, \"system.loaded.value\") == true)\n{\n let repeaterValue = Math.ceil(CONFIG.Dice.randomUniform() * 10);\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value);\n let repeater = qualities.find(i => i.name == \"repeater\")\n if (repeater)\n {\n repeater.value = repeaterValue\n }\n else \n {\n qualities.push({name : \"repeater\", value : repeaterValue})\n }\n setProperty(args.data, \"system.loaded.amt\", repeaterValue)\n this.item.update({\"system.qualities.value\" : qualities});\n this.script.scriptNotification(\"Repeater \" + repeaterValue);\n}\nelse if (getProperty(args.data, \"system.loaded.value\") == false)\n{\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value).filter(i => i.name != \"repeater\");\n this.item.update({\"system.qualities.value\" : qualities});\n}","yFMvxecXAZ6T2O0S":"if (args.totalWoundLoss >= 1)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData());\n if (roll.total == 9)\n {\n this.script.scriptMessage(`Two @UUID[Compendium.wfrp4e-eis.actors.cLOGeMqUty61nYB9]{Blue Horror of Tzeentch} claw their way out of ${this.actor.name}'s screaming flesh, killing them in the process.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","yIGItnshXI4W46cp":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\");","yMMzZ7daCqRlGT3N":"let item = args.opposedTest.attackerTest.item;\nif (!item.isMagical && (item.type == \"weapon\" || item.type == \"trait\"))\n{\n args.modifiers.other.push({label : this.effect.name, details : \"Remove Damage Rating\", value : -1 * (args.totalWoundLoss - args.opposedTest.result.differenceSL)})\n}\n","yPxYRObUiqAIhlNB":"this.actor.system.status.encumbrance.max += 1","yRRzSKlcN3L7rEEe":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Play\"));","yTmRoUstxHMso91c":"if (args.item.name == \"Magic Resistance\" && args.item.type == \"trait\")\n{\n args.item.system.specification.value = Number(args.item.system.specification.value) + 1\n}","yXUPiWuQ5o0JBY4i":"return args.skill?.name == game.i18n.localize(\"Endurance\") || args.characteristic == \"int\"","yatUu0cd7iKs50rq":"return args.skill?.name != game.i18n.localize(\"NAME.Track\");","ybxDG2ezvRx02LYx":"return !args.options.corruption","ynNCBAYwJFkTiXV1":"this.actor.system.status.addArmour(4, {source : this.effect})","ynV7tz0OdCwlsQp6":"let msg = \"\"\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\n\nthis.script.scriptMessage(msg);","ynoHNXXCGRS6fTqF":"let msg = \"\"\n\nlet i_gain = (await new Roll(\"1d10\").roll()).total\n\nif (args.actor.characteristics.i.value <= 0)\n{\n i_gain += (await new Roll(\"2d10\").roll()).total\n}\n\nmsg = `${this.actor.prototypeToken.name} gains ${i_gain} Initiative`\n\nlet newValue = i_gain + args.actor.characteristics.i.modifier\n\nthis.actor.update({\"system.characteristics.i.modifier\" : newValue})\n\n\nlet hitloc = await game.wfrp4e.tables.rollTable(\"hitloc\")\n\nlet value = hitloc.result\nlet desc = hitloc.description\n\nthis.effect.updateSource({\"flags.wfrp4e.location\" : value})\n\nmsg += ` as eyes push out of their ${desc}`\n\nthis.script.scriptMessage(msg)","yzN7ZNlgCiSVJqsU":"let sourceItem = this.effect.sourceItem;\n\nif (sourceItem)\n{\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[1].uuid]})\n\tthis.script.scriptNotification(\"Applied after effects\");\n}","z5HfNUrHy5MS3K7a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","z926Cl2vxUfyLY0V":"if (![\"rArm\", \"lArm\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n\treturn true\n\nreturn [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","z9NEbIUBsKMaTuCz":"if (args.opposedTest.result.hitloc && args.opposedTest.result.hitloc.value == \"head\") \n{\n args.actor.addCondition(\"entangled\")\n}","zA6TDttpwMSMl7D8":"// An imbiber must take a Consume Alcohol Test.\nthis.actor.setupSkill(game.i18n.localize(\"NAME.ConsumeAlcohol\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll()\n // If they succeed, \n // as a result of whatever potential futures they glimpse, \n // they can spend a Fortune Point within the next hour to reverse the dice of any failed Test.\n if (test.succeeded) {\n this.script.scriptMessage(`As a result of whatever potential futures they glimpse, ${this.actor.prototypeToken.name} can spend a Fortune Point within the next hour to reverse the dice of any failed Test.`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n }) \n }\n})","zBHTIBU8OlYj1YIO":"args.fields.modifier += this.effect.sourceActor?.system.characteristics.wp.value;","zFYCaGR0wbFWjl4T":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\");","zK38Rl5t9zbFi4Se":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Added Bleeding\")\n}","zR4WAjzXHTZuiu5G":"let actor = this.actor;\n let effect = this.effect;\n let bleedingAmt;\n let bleedingRoll;\n let msg = \"\"\n\n let damage = effect.conditionValue;\n let scriptArgs = {msg, damage};\n await Promise.all(actor.runScripts(\"preApplyCondition\", {effect, data : scriptArgs}))\n msg = scriptArgs.msg;\n damage = scriptArgs.damage;\n msg += await actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne : false, suppressMsg : true})\n\n if (actor.status.wounds.value == 0 && !actor.hasCondition(\"unconscious\"))\n {\n await actor.addCondition(\"unconscious\")\n msg += \"
\" + game.i18n.format(\"BleedUnc\", {name: actor.prototypeToken.name })\n }\n\n if (actor.hasCondition(\"unconscious\"))\n {\n bleedingAmt = effect.conditionValue;\n bleedingRoll = (await new Roll(\"1d100\").roll()).total;\n if (bleedingRoll <= bleedingAmt * 10)\n {\n msg += \"
\" + game.i18n.format(\"BleedFail\", {name: actor.prototypeToken.name}) + \" (\" + game.i18n.localize(\"Rolled\") + \" \" + bleedingRoll + \")\";\n await actor.addCondition(\"dead\")\n }\n else if (bleedingRoll % 11 == 0)\n {\n msg += \"
\" + game.i18n.format(\"BleedCrit\", { name: actor.prototypeToken.name } ) + \" (\" + game.i18n.localize(\"Rolled\") + bleedingRoll + \")\"\n await actor.removeCondition(\"bleeding\")\n }\n else\n {\n msg += \"
\" + game.i18n.localize(\"BleedRoll\") + \": \" + bleedingRoll;\n }\n }\n\n await Promise.all(actor.runScripts(\"applyCondition\", {effect, data : {bleedingRoll}}))\n if (args.suppressMessage)\n {\n let messageData = game.wfrp4e.utility.chatDataSetup(msg);\n messageData.speaker = {alias: this.effect.name}\n messageData.flavor = this.effect.name;\n return messageData\n }\n else\n {\n return this.script.scriptMessage(msg)\n }\n ","zUv9e0A3OEXWY9Mv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 9 - this.actor.system.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","zY4ZjY7uyKIKMYmX":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"fleshy-curse\"))\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nif (test.succeeded)\n{\n this.effect.delete()\n}","zadppy7FEbXvgUON":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 5\n }\n let skills = [\"Perception\", \"Sleight of Hand\", \"Stealth (Urban)\"]\n let skillAdvancements = [10, 10, 10]\n let talents = [\"Criminal\", \"Etiquette (Criminals)\"]\n let trappings = [\"Rope, 10 yards\", \"Lockpick\", \"Mask\"]\n let items = []\n \n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","zi8Z3NlwVj3IfgAW":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[3].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","ziG9H5Kdb7xC3dFE":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","zk44dFEGkylB7kW6":" let modifier; let target = args.data.targets[0]\n if (target.actor.details.size.value == \"tiny\")\n modifier = 30\n if (target.actor.details.size.value == \"ltl\")\n modifier = 20\n if (target.actor.details.size.value == \"sml\")\n modifier = 10\n\t\n args.fields.modifier += (modifier || 0); // Offset size modifier ","zphxI8VSWbNQCMBy":"args.size = \"lrg\"","zqShIJnrRReGgP94":"let {added, removed} = this.effect.getFlag(\"wfrp4e\", \"propertiesChanged\");\n\nfor(let property of (added || []))\n{\n let hasValue = game.wfrp4e.config.propertyHasValue[property];\n if (!args.item.system.qualities.value.find(i => i.name == property))\n {\n args.item.system.qualities.value.push({name : property, value : (hasValue ? 2 : null)})\n }\n}\n\nfor(let property of (removed || []))\n{\n args.item.system.flaws.value = args.item.system.flaws.value.filter(i => i.name != property)\n}","zsiV6XEHlCNGLLPl":"return args.skill?.name == game.i18n.localize(\"NAME.SetTrap\");","zsoTVkHe4nHY1M52":"this.script.scriptMessage(await this.actor.applyBasicDamage(10 + parseInt(this.effect.sourceTest.result.SL), {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))","zzk2uRSFjFHB5kjw":"\n let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n if (args.test.isFumble && roll == 1 && !args.test.result.misfire)\n {\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Rolled 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n }\n else if (args.test.isFumble && roll != 1)\n args.test.result.other.push(\"Misfire Roll: \" + roll)"}); +{ + mergeObject(game.wfrp4e.config.effectScripts, {"00ZCnahnTGvzG9KA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item])","01VFjGVxkjb5P1ve":"return args.item?.system?.isRanged && args.data.targets[0]?.actor?.sizeNum < 3","03mJu59V4iByWlsO":"// The imbiber immediately\n// takes 3 Poisoned Conditions that cannot be resisted at first,\nawait this.actor.addCondition(\"poisoned\", 3)\n\n// recovers a number of Wounds equal to their Toughness Bonus, \nawait this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\n\n// and acquires the Regenerate Creature Trait.\nconst hasRegenerate = this.actor.has(\"Régénération\")\nif (hasRegenerate === undefined) {\n fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\").then(trait => {\n let traitItem = trait.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\n })\n}\n\nthis.script.scriptMessage(`

${this.actor.prototypeToken.name} :\n

    \n
  • Reçoit 3 états Empoisonnés, sans Test de Résistance possible
  • \n
  • Récupère ${this.actor.system.characteristics.t.bonus} Blessures
  • \n
  • Acuiert le Trait de Creature Régénération.
  • \n
\n C'est à Ranaldde choisir si la régénératin peut guérir de l'empoisonnement.

\n

Lorsque tout les états Empoisonnés sont terminés, le Trait Régénération est perdu également.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n","04bAiHISSW53w94Y":"this.actor.addCondition(\"blinded\", 3)","06IaVCOC0RCJbxEf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.8piWcBKFlQ2J1E3A\")\nlet data = item.toObject();\ndata.system.location.key= this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","09sSpnW8z2zcVEdf":"if (!args.flags.quietenedApplied)\n{\n args.fields.modifier += 10;\n args.flags.quietenedApplied = true\n}","0BP5l7bIkf744G1k":"return !args.options.terror && !args.extendedTest?.flags.wfrp4e?.fear","0FNOq4J1AdPd2A0q":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Row\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","0FWto1oEr3jbWggw":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\")\n\nlet text = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).result\n\nlore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1]\n\nif (text == \"GM's Choice\")\n{\n return this.script.scriptNotification(text)\n}\n\nif (spellsWithLore.length > 0)\n{\n let spellsWithLore = spells.filter(i => game.wfrp4e.config.magicLores[i.system.lore.value] == lore)\n let selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\n this.script.scriptNotification(selectedSpell.name);\n this.actor.createEmbeddedDocuments(\"Item\", [selectedSpell])\n}\nelse\n{\n ui.notifications.notify(`Impossible de trouver le sort ${lore}. Essayez à nouveau`)\n}","0KG3HoTNoZhaINIj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4CMKeDTDrRQZbPIJ\")\nlet fixation = (await game.wfrp4e.tables.rollTable(\"fixations\"))\nlet data = item.toObject();\ndata.system.specification.value = fixation.result;\nthis.item.updateSource({name : this.item.name += ` (${fixation.result})`});\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0LCQtsiK2aUfYRmD":"return ![\"t\", \"wp\"].includes(args.characteristic)","0R0QAr3D024kWPfo":"let table = game.wfrp4e.tables.findTable(\"mutatephys\");\nif (!table)\n{\n\treturn ui.notifications.error(\"La table des Mutations n'a pas été trouvée. Assurez vous que la table avec la clé `mutatephys` est bien importée dans le monde.\")\n}\nlet result = (await table.roll()).results[0];\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\nlet item = await fromUuid(uuid);\n\nif (item)\n{\n this.script.scriptNotification(`${item.name} added`)\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n}\nelse \n{\n ui.notifications.error(\"L'item ne peut être trouvé: \" + uuid)\n}","0Uly7OmkH0zqYbxQ":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"max(1, 1d10 - @system.characteristics.t.bonus)\", this.actor).roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","0YKQGbsKdHSmYGE7":"if (args.skill?.name != game.i18n.localize(\"NAME.Gossip\"))\n{\n\treturn true;\n}\nelse \n{\n\targs.data.canReverse = true; // Kind of a kludge here, the talent Tests has a specific condition, but the description simply says \"any gossip test can be reversed\" so check it here instead of submission\n}\n ","0abwNjpzo3SbEOeO":"if (args.applyAP && args.modifiers.ap.metal) \n{\n args.modifiers.ap.ignored += args.modifiers.ap.metal\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore le m�tal (\" + args.modifiers.ap.metal + \")\");\n args.modifiers.ap.metal = 0\n}","0e0UZT2FodOJDdgW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0e7OkamNAaAk4Oit":"let item1 = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\nlet item2 = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\n\nlet data1 = item1.toObject();\ndata1.system.location.key = this.item.system.location.key\n\nlet data2 = item2.toObject();\ndata2.system.location.key = this.item.system.location.key\n\nthis.actor.createEmbeddedDocuments(\"Item\", [data1, data2], {fromEffect: this.effect.id})\n","0iTLDgFHO9Rgc010":"args.fields.modifier -= 20;","0mrUnxzufYgsR0Ph":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"stunned\")\n }\n})\n","0vaYwAlMWTmOBl8k":"if (!args.flags.strikeToStun)\n{\n args.flags.strikeToStun = true\n args.fields.modifier += 20;\n args.fields.hitLocation = \"head\";\n}\nargs.fields.successBonus++;","0yyofYHeDRQlFliO":"return args.options.terror || args.extendedTest?.flags.wfrp4e?.fear","11uCC0mK2uL783al":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\n\nif ([\"feu\", \"electricité\", \"poison\"].includes(type))\n{\n args.applyAP = false;\n}","16nCOByUaSFDym1V":"args.fields.modifier -= 20\n","190PHSHKGaJ74wsR":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"Terrain\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let terrain = name.split(\"(\")[1].split(\")\")[0]\n tests = tests.replace(\"Terrain\", terrain)\n }\n else // If no sense specified, provide dialog choice\n {\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\n coastal : \"Côtes\",\n deserts : \"Déserts\",\n marshes : \"Marches\",\n rocky : \"Rocailles\",\n tundra : \"Tundra\",\n woodlands : \"Forêts\"\n }, this.item.img), 1, \"Choisir le Terrain\");\n if (choice[0])\n {\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\n tests = tests.replace(\"Terrain\", \"Terrain \" + choice[0].name )\n }\n }\n\n this.effect.updateSource({name})\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","1A87vGLh2PXH0rG0":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","1BT0MWM2cbhlEnrn":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 5,\n \"s\" : 5,\n \"t\" : 0,\n \"i\" : 5,\n \"ag\" : 5,\n \"dex\" : 5,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let items = []\n\n let updateObj = this.actor.toObject();\n\n let talents = (await Promise.all([game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\")])).map(i => i.text)\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n","1E47r2ba6IGe8uFK":"return args.characteristic != \"t\"","1IodsW9ImamYoEYz":"args.actor.details.move.run += 4","1JwxZujbDcueLWBL":"await this.actor.addCondition(\"ablaze\", 2)\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","1LDm3OB32skZe6Xv":"return args.characteristic != \"wp\"","1MDOKny7IirJPoI6":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` ${this.effect.name}`})\nawait test.roll()\nif (test.succeeded)\n{\n this.effect.delete();\n}\n","1OpT3CXs07XFWWCT":"args.options.cardsharp = true;","1PQPxFjmRlulHHzo":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2);\n}\n ","1UalUmNzjB4rp3SZ":"return [\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","1ZArMNUI8qqH6zkX":"let test = await args.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gain d'un état Assomé\"}})\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"stunned\")\n}\n\n","1ZrzpfVwPJHdwp23":"this.actor.status.addArmour(1, {source: this.effect, magical : true})","1exiWlVUHsXDLLAH":"this.script.scriptNotification(`Ne peut saisir ${this.effect.name}!`);","1fQr1Dg7DX0vfz3r":"let healed = parseInt(this.effect.sourceTest.result.SL)\nthis.actor.modifyWounds(healed)\nthis.script.scriptMessage(`Soins de ${healed} Blessures`)","1kB2su7hLRYDhZ2H":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (!test.succeeded)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\")\n let data = item.toObject();\n if (this.item.system.location.key == \"rLeg\")\n {\n data.system.location.value = \"Pied droit\"\n\t data.system.location.key = \"rToe\";\n }\n else if (this.item.system.location.key == \"lLeg\")\n {\n data.system.location.value = \"Pied gauche\"\n\tdata.system.location.key = \"lToe\";\n }\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n}\nthis.effect.delete();","1l7Jz2ZHbAWko7Vm":"args.options.ballockKnife = true;","1mNkLj9JYNr3ofC6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"stunned\", 3)\n }\n})","1wEjrgff7ASxKVmy":"if (args.effect.conditionId == \"bleeding\")\n args.data.damage -= 1","1wKVvxRTHOyV4Qdv":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Sail\"))","1wrPvP6lJwIAfmsl":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, \"Choisir une localisation\");\n\nlet location = choice[0].id;\n\nlet itemTargeted = this.actor.items.get(this.effect.getFlag(\"wfrp4e\", \"itemTargets\")[0])\n\nif (itemTargeted)\n{\n itemTargeted.update({[`system.APdamage.${location}`] : itemTargeted.system.APdamage[location] + 1})\n}","1yOvw74jzFfaI87b":"return args.options.reload\n","22bW97lkvCqisfHX":"return args.type != \"channelling\" && !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","23HgjCB1oecxANvA":"if (args.item.range && args.item.range.bands)\n{\nargs.item.range.bands[game.i18n.localize(\"Long Range\")].modifier = 0\nargs.item.range.bands[game.i18n.localize(\"Extreme\")].modifier /= 2\n}","23vWiHUjxtRQ3Efz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.eWPN3CV2Eddwz8aM\")\nlet data = item.toObject();\ndata.system.location.value = \"Dos\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","2AOo7KUyzMrgIlgM":"game.wfrp4e.utility.postCorruptionTest(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}})","2AdSBXw7IwCiqawQ":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","2Cw5j0iGAnFNegWr":"return args.item?.system.attackType\n","2GYAd4OC888oQFBp":"return ![\"fel\"].includes(args.characteristic)","2NLINicPQWbuvp2n":"return args.item?.name != game.i18n.localize(\"NAME.Navigation\")","2OqLHRqEBEjBm2LW":"args.fields.slBonus += this.actor.system.characteristics.wp.bonus","2Qi1hwLYhdE6v6Hs":"if (![\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n\treturn true;\n\nif (args.options.dodge)\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Impossible d'Esquiver!\")\n}\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","2VNnVrtktdGUqXEV":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed && parseInt(args.opposedTest.attackerTest.result.SL) > 0)\n {\n args.actor.addCondition(\"stunned\", parseInt(args.opposedTest.attackerTest.result.SL))\n }\n} ","2W9uMTT6iJhfQ044":"let skill = `Métier (${this.item.parenthesesText})`\nlet currentCareer = this.actor.system.currentCareer;\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\n\nif (!currentCareer) return\n\n\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\nif (existingSkill && inCurrentCareer)\n{\n\texistingSkill.system.advances.costModifier = -5;\n}\nelse \n{\n\tcurrentCareer.system.skills.push(skill);\n}\n\n\n","2WBq5gW780C6zfCp":"if (args.weapon && this.item.system.usesLocation(args.weapon))\n{\n args.bleedingHand = true;\n let success = await this.effect.manualScripts[0].execute({actor: this.actor})\n if (!success)\n {\n args.abort = true;\n }\n}","2WSN306tL4apjRtD":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name = data.name += \" (Ouïe)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2cKarG9ToyW2ptCd":"if (this.item.system.quantity.value)\n{\n\tthis.item.update({\"system.quantity.value\" : this.item.system.quantity.value - 0.25})\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Vide !\", \"error\")\n}","2hzDv8ROulOe1elK":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","2mFNelLOAQ6iJsZl":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[doomrocket-fumble]\")\n}","2miWWeRrEpq1beG4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","2p9IK6Y5Z4NQD6FY":"args.prefillModifiers.difficulty = \"hard\"","2rzxQlL7A9ujZ9uK":"if (args.opposedTest.result.winner == \"attacker\") {\n if (args.opposedTest.defenderTest.weapon && args.opposedTest.defenderTest.item.properties.qualities.shield) {\n ui.notifications.notify(`${this.effect.name}: Gain de ${this.item.Advances} Avantages`)\n this.actor.setAdvantage(this.item.Advances)\n }\n}","2sDH6RvoOAR40oqH":"\n\nif (![\"Goblin\", \"Orc\"].includes(this.actor.system.details.species.value)) {\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { appendTitle: ` - ${this.effect.name}` })\n await test.roll();\n if (test.failed) {\n let infection = await fromUuid(\"Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg\")\n this.actor.createEmbeddedDocuments(\"Item\", [infection])\n }\n}\n\n// Since wounds change when the effect is deleted, need to wait until after \n// the max wounds have been recalculated to apply damage\ngame.wfrp4e.utility.sleep(1000).then(async () => {\n let roll = await new Roll(\"1d10\").roll();\n\n roll.toMessage(this.script.getChatData());\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))\n\n})","2vTVR0quRZQtjNfQ":"let currentCareer = this.actor.system.currentCareer;\nif (!currentCareer)\n{\n return;\n}\n\nlet talents = [\"Harmonisation Aethyrique\",\n\"Magie des Arcanes (Domaine)\",\n\"Magie du Chaos (Tzeentch)\",\n\"Mains agiles\",\n\"Diction Instinctive\",\n\"Sens de la Magie\",\n\"Magie Mineure\",\n\"Seconde Vue\",\n\"Mage de guerre\",\n\"Sorcier!\"].filter(t => !currentCareer.system.talents.includes(t))\n\ncurrentCareer.system.talents = currentCareer.system.talents.concat(talents)","2wk0yrRPlPsdqr3L":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2yctEihGmdCfTTVx":"args.data.canReverse = true;\nargs.options.fieldDressing = true;","2zeP2nMSURjxrqYz":"let wounds = this.actor.system.status.wounds\nif (wounds.value == 0)\n return this.script.scriptNotification(\"Aucun effet à 0 Blessures\", \"error\")\n\nthis.script.scriptNotification(`Soin de ${this.actor.characteristics.t.bonus} Blessures`)\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus)","33PWizq5F7pkKnQT":"if (args.item.type == \"spell\")\n{\n args.item.cn.value = Math.floor(args.item.cn.value / 2)\n}","33US8YRgaMqYu2We":"return !args.options.handling","37UN17gb8suFeZIW":"this.script.scriptMessage(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))","3Cn2TlRahlm5LkSj":"args.fields.successBonus += 1;","3D5ImpMgpOTPucvv":"if (args.test.options.cardsharp && args.test.succeeded)\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n args.test.result.other.push(`${this.effect.name}: ${ones + args.test.successBonus + args.test.slBonus} DR`)\n}","3IGO7xEjRjat937X":"let fatigue = this.actor.hasCondition(\"fatigued\")\nif (fatigue)\n{\n this.script.scriptNotification(\"Suppression de l'état Fatigué, effet désactivé.\")\n this.effect.update({disabled : true})\n await this.actor.removeCondition(\"fatigued\")\n}","3JEzEzF1SeYA9lsV":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations, this.effect.img), 1, \"Choose Location\");\nif (choice[0])\n{\n this.effect.updateSource({name : `${this.effect.name} (${choice[0].name})`})\nthis.effect.updateSource({\"flags.wfrp4e.location\" : choice[0].id})\n}\n\nlet location = choice[0].id;\n\nif ([\"lArm\", \"rArm\"].includes(location))\n{\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nif (location == \"body\")\n{\n await this.actor.addCondition(\"fatigued\");\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"prone\");\n }\n}\n\nif (location == \"head\")\n{\n await this.actor.addCondition(\"stunned\");\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"unconscious\");\n }\n}","3LLiSgj6KGtgqcmo":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","3R6Y4NpNTqPc83wh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IPKRMGry6WotuS1G\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","3TesBGh8HnlGuafu":"let modifier = this.effect.sourceTest?.result.overcast.usage.other.current || 0\n\nlet test = await this.actor.setupCharacteristic(\"dex\", {fields: {modifier}, skipTargets: true, appendTitle : \" - \" + this.script.label});\n\ntest.roll();","3Vbe6gdW8N0bIvXJ":"if (args.item.type == \"weapon\" || args.item.type == \"trait\")\n{\n args.item.qualities.value.push({name : \"penetrating\"})\n args.item.qualities.value.push({name : \"impale\"})\n}","3aEzK0DehSHtVykd":"this.effect.manualScripts[0].execute({actor : this.actor});","3eSaX0BeaUalNkEP":"return args.options.mutate","3fdCQ3h3iVuhdDs9":"args.fields.slBonus += this.actor.characteristics.ag.bonus;","3hfMQkUKYI4rCuBy":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","3jm0NoYpgB6ZuUSl":"args.options.useOnesAttractive = true;","3l7MQSa10Kve2K3P":"this.script.scriptMessage(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\nthis.actor.addCondition(\"ablaze\");","3plV9WFqs2prfAdp":"return ![\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","3sfD1nedXLzuYoXJ":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => test.roll())\n}\n","3tE8gFSl28EhCmo5":"await args.actor.addCondition(\"ablaze\")\nawait args.actor.addCondition(\"prone\")","454x3Q95pLvZm0Kx":"return args.skill?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\");","4FGKZk2f0xrmIDnp":"return args.skill?.name != game.i18n.localize(\"NAME.Research\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\"));","4HN98hMdQJxM35pA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.gz2xy41OSVZ8YBgI\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n","4JVIy5xtVwvadoqv":"this.actor.details.move.run *= 2","4MQ7u4INxp51oyyR":"let characteristics = {\n \"ws\" : 25,\n \"bs\" : 10,\n \"s\" : 15,\n \"t\" : 15,\n \"i\" : 25,\n \"ag\" : 20,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 25,\n \"fel\" : 10\n}\n//let skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skills = [\"Calme\", \"Equive\", \"Intimidation\", \"Intuition\", \"Commandement\", \"Savoir (Guerre)\", \"Perception\"]\n\nlet skillAdvancements = [15, 15, 15, 15, 15, 10, 10]\nlet talents = [\"Vigilance\", \"Combat Instinctif\", \"Feinte\", \"Exaltant\", \"Déterminé\", \"Seigneur de guerre\"]\n// TODO\nlet trappings = [\"Arme simple\", \"Bouclier\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","4QoxhoekgVeZcQA7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","4XrAeL2DitxE8OaK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.0hn6UaKq8CoZP2zD\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","4cOZzUvu1nytcqNn":"args.initiative = \"-10\"","4fnTKgl0HW9ZrWyJ":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n let char = Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"s\" : \"t\";\n this.script.scriptMessage(`${this.actor.name} perd 1 point de ${game.wfrp4e.config.characteristics[char]}`)\n this.actor.update({[`system.characteristics.${char}.initial`] : this.actor.system.characteristics[char].initial - 1})\n }\n})","4gkz3LR7CK1b8ulK":"return args.item?.system.attackType != \"ranged\" || this.actor.uuid != this.effect.sourceActor.uuid","4iuTz0uInAfMaoGl":"return args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) || args.type == \"cast\"","4pQW4WLyhjbZR85k":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gain d'un Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","4rTmV3TNxctUe0ly":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"bleeding\");\n}\n","4rb7LfMq9CTnlrpn":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\n await test.roll();\n if (test.failed)\n {\n args.totalWoundLoss += 5;\n args.modifiers.other.push({label : this.effect.name, value : 5})\n }\n}","4rhxLzau7jZ4SDxg":"await args.actor.addCondition(\"grappling\")\nawait args.actor.addCondition(\"entangled\")","52kbfuWrOh6dsTtd":"if (!this.actor.hasCondition(\"blinded\"))\n\tthis.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.flockOfDoom\" : true})","52mwb33mGrQjq89B":"return args.skill?.name != game.i18n.localize(\"NAME.Research\");","53HFDNuMnX1Aw1a4":"return [\"ws\", \"bs\", \"s\", \"ag\", \"dex\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","58rFc9HiBoX66J6p":"let sourceActor = this.effect.sourceActor;\nlet damage = args.totalWoundLoss;\nlet tb = sourceActor.system.characteristics.t.bonus\nargs.abort = `${this.effect.name}: Dommages appliqués à ${sourceActor.name}`;\n\nlet message = await sourceActor.applyBasicDamage(damage - tb, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true})\n\nthis.script.scriptMessage(message.replace(`${tb} TB`, `${tb} × 2 TB`))\nargs.abort = true;","5DI6cHAg1LHo54Yv":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.actor.update({\"system.status.fortune.value\" : Math.max(0, (this.actor.system.status.fortune?.value - 1) || 0)})\n this.script.scriptMessage(`1 Point de Fortune volé à ${this.actor.name}`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","5Fe1ELaS6Gnvy0Cj":"return args.skill?.name.includes(\"Focalisation\") || args.type == \"channelling\" || args.skill?.name == game.i18n.localize(\"NAME.Charm\") || args.skill?.name.includes(\"Langue (Magick)\") || args.type == \"cast\"","5IoYTyedCMYwt3ys":"args.fields.slBonus += 2;","5JWC0l3JEpOsqbR9":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 0\n}\nlet skills = [\"Esquive\", \"Perception\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Flee!\", \"Marksman\"]\nlet trappings = [\"Hand Weapon\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5JvKJZPcd6Hz5zvn":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 20,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 15,\n \"fel\" : 0\n}\n//let skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Leadership\"]\nlet skills = [\"Calme\", \"Esquive\", \"Intimidation\", \"Commandement\"]\nlet skillAdvancements = [15, 15, 10, 5]\nlet talents = [\"Vigilance\", \"Combat Instinctif\", \"Feinte\", \"Déterminé\"]\nlet trappings = [\"Cotte de Mailles\", \"Chausses de Mailles\", \"Coiffe de Mailles\", \"Arme simple\", \"Bouclier\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = this.effect.name + \" \" + updateObj.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5LdJCKfQem1AQK24":"\nif (!args.flags.howlingWarpGale)\n{\n args.fields.modifier -= 10;\n args.flags.howlingWarpGale = true; // prevent double application\n}","5M6IgCUncCwyxHok":"let etiquette = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\")).toObject();\netiquette.name += ` (Suivants de Tzeentch)`;\n\nlet animosity = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f\")).toObject();\nanimosity.system.specification.value = \"Suivants de Nurgle\";\n\nlet roll = await new Roll(\"ceil(1d10 / 3)\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nlet mutations = [];\nlet msg = `

Mutations acquises

`\nfor(let i = 0; i < roll.total; i++)\n{\n let item;\n let uuid;\n let result;\n if (i % 2 == 0)\n {\n result = await game.wfrp4e.tables.rollTable(\"mutatemental\", {hideDSN: true}, \"Tzeentch\")\n }\n else \n {\n result = await game.wfrp4e.tables.rollTable(\"mutatephys\", {hideDSN: true}, \"Tzeentch\")\n }\n uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\n item = await fromUuid(uuid);\n if (item)\n {\n msg += `

@UUID[${uuid}]{${item.name}}

`\n mutations.push(item.toObject());\n }\n}\nthis.actor.createEmbeddedDocuments(\"Item\", mutations.concat([etiquette, animosity]), {fromEffect : this.effect.id})\nthis.script.scriptMessage(msg);","5MxRDXzUBPfp2KKD":"args.options.useOnesSupportive = true;","5dR7Erj3nwsxLAV7":"let characteristics = {\n \"ws\" : 35,\n \"bs\" : 10,\n \"s\" : 25,\n \"t\" : 30,\n \"i\" : 30,\n \"ag\" : 25,\n \"dex\" : 0,\n \"int\" : 15,\n \"wp\" : 35,\n \"fel\" : 15\n}\nlet skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skillAdvancements = [25, 15, 25, 25, 30, 20, 20]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Inspiring\", \"Luck\", \"Resolute\", \"Unshakable\", \"War Leader\"]\nlet trappings = [\"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Could not find ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5lc1eHIYQNpSRWip":"if ([\"death\", \"necromancy\"].includes(args.spell?.system.lore.value))\n{\n args.fields.successBonus += 1\n}\nelse if([\"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value))\n{\n args.fields.modifier -= 10;\n}","5o1XiceC4rutjMms":"return !args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","5sI9iYh5j2nx2XyT":"return !([\"Soin aux animaux\", \"Emprise sur les animaux\"].includes(args.item?.name) || args.item?.name.includes(\"Chevaucher\") || args.item?.name.includes(\"Dressage\"))","62Ky6bC1EnTllSJA":"if (this.effect.sourceActor.uuid != args.actor.uuid)\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.overcast.usage.other.current, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}));\n}","65o8pQj6oGNnXce6":"let ch = this.effect.getFlag(\"wfrp4e\", \"characteristic\")\nthis.actor.system.characteristics[ch].modifier += 10;","65xE9OV5sA1ZWT7j":"if (args.test.options.diceman && args.test.succeeded)\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL)\n args.test.result.other.push(`${this.effect.name}: ${ones + args.test.successBonus + args.test.slBonus} DR`)\n}","6Aqq4F4Xui923sc6":"// Imbibing this substance grants the user the Painless Creature Trait.\nconst hasColdBlooded = this.actor.has(\"A Sang Froid\")\nif (hasColdBlooded === undefined) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.mCh1KK9jomwFZcLB\")\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n this.script.scriptMessage(`

${this.actor.prototypeToken.name} reçoit le Trait de Créatuer A Sang Froid et peut inverser n'importe quel test de Force Mentale échoué.

\n

Si il reçoit un état Surpris, cet état n'est pas perdu la première fois (typiquement à la fin du Round ou si il est attaqué).

`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}","6BmvV9c03FkfisnE":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte le ${this.item.name}.
\n Il gagne +1 Point de Corruption point si un Test de Corruption est échoué, à appliquer manuellement.
Si le personnage porte le masque pendant plus d'une heure ou utilise les effets du masque, il est exposé à une @Corruption[moderate]{Corruption Modérée} \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Utilisé)\"})\n this.script.scriptMessage(`${this.item.name} de ${this.actor.name} a été enlevé et a perdu ses propriétés. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils devront être manuellement supprimés.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}","6EXkbVTRBhKTEu81":"if (!args.flags.bothEyes)\n{\n\targs.flags.bothEyes = true;\n\targs.fields.modifier -= 30\n}","6Fe8M5MdklKS2olx":"return args.characteristic != \"fel\"","6H6vNjzvMGl2ZqCR":"if (args.totalWoundLoss > 0)\n this.script.scriptMessage(`Lame de Nurglitch: ${args.actor.name} doit réussir un Test d'Endurance Difficile (-10) ou recevoir une @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Blessure Purulente}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","6JrUjs3g5x6bFnj3":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet sense = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet biteData = bite.toObject();\nlet senseData = sense.toObject();\n\nbiteData.system.specification.value = 6 - this.actor.characteristics.s.bonus;\nsenseData.name = senseData.name += \" (Odorat)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, senseData], {fromEffect : this.effect.id})","6MSodMuZ5xk2JJJ9":"if (!this.actor.hasCondition(\"ablaze\"))\n{\n this.effect.delete();\n}","6Mjy0jDqczA8BxhS":"return ![\"roll\", \"none\"].includes(args.fields.hitLocation)","6QZUX7ZrFxOzqI0b":"let regenerate = this.actor.items.getName('Régénération')\n\nif (regenerate)\n{\n let effect = regenerate.effects.contents[0]\n let scriptData = effect.getFlag(\"wfrp4e\", \"scriptData\");\n \n scriptData[0].script = scriptData[0].script.replace(\"1d10\", \"1d10 * 2\")\n}","6U8xox4mBrn5eYIp":"if (args.totalWoundLoss > 0)\n args.actor.addCondition(\"ablaze\")","6V3qHON3mcerlBlB":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","6XWJWOUQPgKMsFul":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale","6ZS1rQLkNvMDO0Fp":"let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\nif (args.test.isFumble && roll == 1 && !args.test.result.misfire)\n{\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Résultat 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n}\nelse if (args.test.isFumble && roll != 1)\n{\n args.test.result.other.push(\"Résultat du Raté: \" + roll)\n}\n\n","6elUNF58TaiYjxcx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gained a Stunned Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","6fElmBxTjdAaubbK":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}\n","6hAgggYpNR3r4QWC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Q2MCUrG2HppMcvN0\")\nitem = item.toObject()\nlet species = args.actor.Species || \" de votre espèce\"\nitem.name = `Animosité (tous sauf ${species})`\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","6jcTzK1XEuWqAacN":"args.abort = true;\nthis.script.scriptNotification(`Impossible d'utiliser ${game.wfrp4e.config.locations[this.effect.getFlag(\"wfrp4e\", \"location\")]}!`, \"error\")","6kifXp2jXEaQVJsg":"let useWard = await Dialog.wait({\n\ttitle : this.effect.name,\n\tcontent : `

Utiliser Ward fourni par ${this.effect.name}?`,\n\tbuttons : {\n\t\tyes : {\n\t\t\tlabel : \"Yes\",\n\t\t\tcallback: () => {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\t\tno : {\n\t\t\tlabel: \"No\",\n\t\t\tcallback: () => {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n})\n\nif (useWard)\n\targs.ward = 9;","6mpw9cGseG4W4eyd":"if (this.actor.system.status.advantage.value >= 2)\n{\n await this.actor.modifyAdvantage(-2);\n this.script.scriptNotification(\"Avvantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","6qUKKep5vhFYmo1J":"return args.type == \"channelling\" || args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","6tjn0RH4VyOPFneS":"return [\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","6uldpFvKOCoW92cC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\nitem = item.toObject()\n\nitem.system.specification.value = 10;\nitem.name += \" (Feu)\"\nsetProperty(item, \"flags.wfrp4e.breath\", \"fire\")\n\nItem.create(item, {parent : this.actor, fromEffect: this.effect.id})","6xTtJEhRc4OjcDTf":"if (getProperty(args.data, \"system.status.fortune.value\"))\n{\n\tthis.script.scriptNotification(\"Impossible de mettre à jour la Fortune\");\n\tdelete args.data.system.status.wounds.value;\n}","715G1Bf0haOHvmYQ":"return !(args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")))","71DmrxCTKGYL4Z7X":"return [\"fel\"].includes(args.characteristic)","7Ck0fkzE4WQ62qVe":"if (args.item.type == \"skill\" && args.item.name == \"Corps à corps (Base)\")\n{\n args.item.system.modifier.value += 20;\n}","7F3miqRA0ceMUBIu":"return args.characteristic != \"int\" || args.skill","7F6aGxZJjwxm5e5P":"if (args.test.result.castOutcome == \"failure\")\n{\n ValueDialog.create(\"Sasir le nombre de Blessures perdues en échange de DR\", this.effect.name, \"0\").then(async value => {\n value = Math.clamped(value, 0, 3)\n if (value == 0)\n {\n return; \n }\n else if (Number.isNumeric(value))\n {\n this.script.scriptNotification(`Perte de ${value} Blessures`)\n this.actor.modifyWounds(-1 * value)\n await this.item.system.toggleEquip();\n args.test.addSL(value);\n args.test.preData.other.push(`${this.effect.name}: +${value} DR`)\n }\n })\n}","7H6wYyJ6cpaoc2QQ":"return args.skill?.name == game.i18n.localize(\"NAME.Cool\");","7JW9t8AYSDkkzG2V":"// Apply changes when the mask is worn\n\nif (args.equipped) \n{ \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte le ${this.item.name}.
\n Si le personnage porte le masque pendant plus d'une heure ou bénéficie de ses effets, il s'espose à une @Corruption[moderate]{Corruption Modérée}. \n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Utilisé)\"})\n this.script.scriptMessage(`${this.item.name} porté par ${this.actor.name} a été enlevé et a perdu ses capacités. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils doivent être retirés manuellement.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}","7OmrMjaU48o2FEZi":"\nthis.actor.characteristics.t.bonus = 10\n\nthis.actor.details.move.value = 0;\nthis.actor.details.move.walk= 0;\nthis.actor.details.move.run = 0;","7ScfB4o1QhXnNUfq":"return ![\"int\", \"wp\"].includes(args.characteristic)","7VAhXHov6pR1SkgD":"return args.item?.name == game.i18n.localize(\"NAME.Endurance\");","7WR2hJjHPhHhHxAq":"let poisoned = args.actor.hasCondition(\"poisoned\")\nif (poisoned)\n{\n this.script.scriptNotification(`Suppression de ${poisoned.conditionValue} états Empoisonné`)\n poisoned.delete(); \n}\nelse\n this.script.scriptNotification(`Aucun état Empoisonné`)","7ZoFUMDG2WJd8RMg":"this.script.scriptMessage(`Revendiquer le Bonus de ${this.effect.name} `);","7e8FgQUF2oANANmx":"return args.skill?.name == \"Corps à corps (Bagarre)\" || args.item?.weaponGroup?.value == \"brawling\"","7f6OsttTzE7Hvzfk":"if (this.actor.statuses.has(\"infighting\")) // Only add +10 if already infighting\n args.prefillModifiers.modifier += 10; \n\n\nargs.prefillModifiers.successBonus += 1; \n","7n3SEAGRA5ESK8gV":"args.options.disarm = true;","7szLG4VALuuy1cPm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}})\nawait test.roll();\nif (test.failed)\n{ \n await this.actor.addCondition(\"fatigued\")\n} ","7wBWUw05q0igh508":"// Imbibing this substance grants the user the Painless Creature Trait.\nconst hasPainless = this.actor.has(\"Insensible à la douleur\");\nif (hasPainless === undefined) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\");\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n this.script.scriptMessage(\n `

${this.actor.prototypeToken.name} gagne le Trait de Creature Insensible à la Douleur. Cet effet dure 1 heure, après quoi il disparait et le total des Blessures encaissés par le buveur sont encaissés d'un coup.

\n

Notez que cela n'empêche pas le buveur de recevoir une Blessure Critique ou de mourrir. Cela permet par contre d'éviter la majorité de leur effets.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true})\n}","84IB8CWa55XzoAkv":"return ([\"Soin aux animaux\", \"Emprise sur les animaux\"].includes(args.item?.name) || args.item?.name.includes(\"Chevaucher\") || args.item?.name.includes(\"Dressage\"))","87rrZ3ojHrXa3lCn":"this.actor.modifyWounds(1)","8AoA4bnstBtglRGZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8ByuHnUZ4RNTdGVv":"let strLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\nlet tghLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n\nif (!this.actor.has(\"Mort-vivant\") && !this.actor.has(\"Démoniaque\")) \n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), { appendTitle: \" - \" + this.effect.name, fields: { difficulty: \"average\" }, context: { failure: `Pert de ${strLoss} en Force et ${tghLoss} en Endurance` } }).then(async test => {\n await test.roll();\n if (test.failed) {\n this.actor.update({ \"system.characteristics.s.initial\": this.actor.system.characteristics.s.initial - strLoss, \"system.characteristics.t.initial\": this.actor.system.characteristics.t.initial - tghLoss })\n }\n })\n\n}\nelse {\n this.script.scriptNotification(`${this.actor.name} est immunisé à ${this.effect.name}`)\n}\n","8GyJgdHVBaLrHCY8":"let type = this.item.getFlag(\"wfrp4e\", \"breath\")\nlet types = {\n none : \"Aucun\",\n cold : \"Froid\",\n corrosion : \"Corrosion\",\n fire : \"Feu\",\n electricity : \"Electricité\",\n poison : \"Poison\",\n smoke : \"Fumée\",\n various : \"Divers\"\n}\nif (!type)\n{\n type = (await ItemDialog.create(ItemDialog.objectToArray(types, this.item.img), 1, \"Choisir le Souffle\"))[0]?.id;\n this.item.updateSource({\"flags.wfrp4e.breath\" : type})\n}\n\nif (!this.item.name.includes(\"(\") && types[type] && type != \"none\")\n{\n this.item.updateSource({name : this.item.name += ` (${types[type]})`, \"system.specification.value\" : this.item.system.specification.value.replace(\"(Type)\", \"\").trim()})\n}","8K9tpCwvFC9INk5V":"if ([\"t\", \"wp\"].includes(args.characteristic))\n{\n\targs.fields.modifier += 10;\n}\nelse if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\n{\n\targs.fields.modifier -= 10;\n}","8LmUVQxOwTLSeabg":"return args.data.targets.length > 0 || !args.weapon?.system.qualities.value.find(i => i.name == \"shield\") // Should count even if they don't have the skill","8N3Uqjq1ZxPxo4pk":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Lore\"))","8RNziYGGb4sp3BGQ":"if (!args.test.weapon?.name.includes(\"Drakefire\"))\n{\n args.test.result.misfire = game.i18n.localize(\"Misfire\");\n args.test.result.misfireDamage = (0, eval)(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.weapon.system.Damage);\n}","8ShLVT0bK1eQpinj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","8TRiAJ8thIKE4IoL":"\nlet SL = Number(getProperty(this.item, \"flags.wfrp4e.sourceTest.result.SL\") || 1)\n\nargs.actor.characteristics.i.modifier += 10 * SL\nargs.actor.characteristics.ag.modifier += 10 * SL","8ThudCYRqkjQIwJH":"if (args.opposedTest.attackerTest.result.critical)\n{\n args.actor.addCondition(\"ablaze\")\n}","8WJsecxdndaHRxxS":"this.actor.status.addArmour(this.actor.characteristics.wp.bonus, {source: this.effect, magical : true})","8WeYU5e5LN9UeWFs":"if (args.item.type == \"spell\")\n{\n let range = parseInt(args.item.Range)\n if (Number.isNumeric(range))\n {\n args.item.system.range.value = \"2 * \" + args.item.system.range.value\n }\n}","8ZAUBSH9CM9OTpTL":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}});\nawait test.roll();\n\nif (test.succeeded)\n{\n this.actor.addCondition(\"stunned\") \n}\nelse if (test.failed)\n{\n this.actor.addCondition(\"poisoned\", 2);\n}","8araLuwmBq8GKEw3":"let APIgnored = args.AP.layers.reduce((prev, current) => prev + ((current.weakpoints && !current.ignored) ? current.value : 0), 0)\n\nif (APIgnored)\n{\n args.modifiers.ap.ignored += APIgnored\n args.modifiers.ap.details.push(`${this.effect.name}: Ignorer les PA avec des Points Faibles (${APIgnored})`)\n}","8fefDfiYKFOWdPER":"args.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}});","8g2iitsgaJarKQpr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","8gCja0mfKt4nYVZc":"args.fields.slBonus += 2 ","8hIyWDyfbgGAig65":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"dex\"].includes(args.characteristic)","8jvEVPUCg3rKG48Y":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9fq6p9Q6H02LjaSi\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8noxHUQKR55Kx1YN":"this.actor.system.status.corruption.max += 1","8oE0DTzz0krOfFlV":"args.item.system.qualities.value.push({name : \"magical\"})\nargs.item.system.qualities.value.push({name : \"impact\"})\n","8rq4GL5d5nCn4kO7":"let caster = this.effect.sourceActor\nif (caster)\n{\n let healed= caster.characteristics.wp.bonus\n this.actor.modifyWounds(healed);\n this.script.scriptMessage(`${this.actor.prototypeToken.name} regagne ${healed} Blessures`)\n}","8tyMXDfHR8AJBdDu":"let weakpointsAP = args.AP.layers.filter(i => !i.ignored && i.weakpoints).reduce((ap, layer) => ap + layer.value, 0);\n\nif (weakpointsAP > 0)\n{\n args.modifiers.ap.ignored += weakpointsAP;\n args.modifiers.ap.details.push(`${this.effect.name} - Ignore les Points Faibles (${weakpointsAP})`);\n}","8vpAtJ93GIeye1qj":"return args.type == \"cast\"","8wG9l4T9fc1bM0TN":"let item = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.kJNAY1YRaCy9IgmT\")).toObject();\nitem.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","8yBr6VbdKcrWUuqw":"this.actor.characteristics.i.value= \"-\"\nthis.actor.characteristics.int.value= \"-\"\nthis.actor.characteristics.wp.value= \"-\"\nthis.actor.characteristics.fel.value = \"-\"","8zTkDVziBPaNbMQX":"let filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 6, \"Choisir 6 sorts de Magie Mineure\")\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"\"\n }\n]\n\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 9, \"Choisir 9 Sorts d'Arcane\")\n\nlet items = petty.concat(arcane).map(i => i.toObject())\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","91S2GnBFYFbxmOCK":"this.actor.characteristics.s.bonus += 1\nthis.actor.characteristics.s.calculationBonusModifier -= 1","93K85NnVwjVNXlZq":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Trade\"));","956dUb5sd6OtbWZR":"args.fields.successBonus++;","96Y1yIH1lRjTs5hL":"if (args.test.succeeded)\n return\n\nif (args.test.characteristicKey == \"wp\")\n this.actor.addCondition(\"broken\")","98nKfcimlaPeM9h5":"await this.actor.addCondition(\"bleeding\")\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(10, {suppressMsg : true}));","9A7rYY3FKi5XLihG":"fromUuid(\"Compendium.wfrp4e-core.items.5QcrpLQWWrsbKR79\").then(item => {\n let data = item.toObject();\n data.system.tests.value = data.system.tests.value.replace(\"coins\", \"metal objects\");\n data.system.description.value += \"

Ce Talent s'applique également à tout objet métallique à cause de l'Affinité Metallique

\"\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n})","9EVj4bmZJex45Mt7":"return args.skill?.name != game.i18n.localize(\"NAME.Athletics\");","9JnPK1jNUEso7Pv8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name += ` (Odorat)`\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9MDi3ok9gPwtbALf":"args.actor.details.move.value /= 2","9MwRUzRinhq1IjhG":"args.actor.addCondition(\"grappling\");","9RFoasDcFnYZ1txR":"return args.skill?.name == game.i18n.localize(\"NAME.Perception\");","9VfeubiCV83LN9iY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.name += ` (Si Charge)`\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9WZa63lr0K3SsP4G":"let sourceItem = this.effect.sourceItem;\n\nif (sourceItem)\n{\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[2].uuid]})\n\tthis.script.scriptNotification(\"Applique après les effets\");\n}","9Yn9uViEjcuaESJ2":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\n{\n this.item.name += \" (Aucun PA)\"\n this.item.system.AP = {\n \"head\": 0,\n \"lArm\": 0,\n \"rArm\": 0,\n \"lLeg\": 0,\n \"rLeg\": 0,\n \"body\": 0\n }\n}","9ZFPDCk8M2TQxh7x":"args.fields.modifier += 20\n","9bJGJrLqslV5lBya":" return args.characteristic == \"bs\"","9eWR4mdaoCSQawDT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","9fK07tqqZyPg7dpx":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"veasy\"}})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptNotification(\"Subi une Blessure Purulente\")\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()])\n}\nelse \n{\n this.script.scriptNotification(\"Evite une Blessure Purulente\")\n}\n","9nroaZDkW3WXNkB7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.4MJJCiOKPkBByYwW\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","9ob2lPnk3PDot9Tx":"this.actor.addCondition(\"blinded\", this.effect.sourceTest.result.SL)","9qWUuEF8F5nehF1y":"args.item.system.qualities.value = args.item.system.qualities.value.concat([{name : \"magical\"}, {name : \"unbreakable\"}])\nargs.item.system.damage.value += ` + ${this.effect.sourceActor.system.characteristics.wp.bonus}`","A0OK0qAMmnf8iNJf":"if (args.test.result.SL < 0)\n{\n this.script.scriptMessage(`Reçoit ${Math.abs(args.test.result.SL)} Points de Corruption`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n if (args.test.failed && this.actor.type == \"character\")\n {\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + Math.abs(args.test.result.SL)})\n }\n}","A1odAcuRbq9797ZB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Base)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Armes d'hast)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choix\",\n content : \n `

\n Choisissez une option\n

\n
    \n
  1. Corps à corps (Base)
  2. \n
  3. Corps à corps (Armes d'hast)
  4. \n
\n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"Armes d'hast\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","A3MW0UksYrHGa0Qw":"return [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic);","A3fvV69RS1lYgma0":"if (this.actor.type == \"character\") \n this.actor.corruptionDialog(\"minor\")\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif(test.failed)\n{\n await this.actor.addCondition(\"unconscious\");\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\n await secondTest.roll();\n if(secondTest.failed)\n {\n await this.actor.addCondition(\"fatigued\");\n }\n}","A6DcKPzAGntzSCil":"let roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","ACgKpKrEEHoNGG0h":"return !args.skill?.name.includes(\"Focalisation\") && args.type != \"channelling\"","ACtDCTLZXmd5uXjX":"let halve;\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\n{\n halve = await Dialog.confirm({title : this.effect.name, content : \"Diviser les dommages? (Divise par 2 tout les dommages autre que ceux causés par le feu, le froid et magiques)\"})\n}\nelse\n{\n halve = false;\n}\n\nif (halve)\n{\n args.totalWoundLoss /= 2;\n args.modifiers.other.push({label : this.effect.name, details : \"Divisé par 2\", value : \"× 0.5\"})\n}","AGD7zCyV4zruvnWu":"return args.type != \"cast\" || ![\"mort\", \"nécromancie\", \"vie\", \"lumière\", \"cieux\"].includes(args.spell?.system.lore.value)","AHZ8f7dfN8jNsYk6":"let token = this.actor.getActiveTokens()[0];\nlet target = args.data.targets[0];\nlet weapon = args.weapon;\n\nif(!target || !token)\n{\n return;\n}\n\nlet distance = canvas.grid.measureDistances([{ ray: new Ray({ x: token.center.x, y: token.center.y }, { x: target.center.x, y: target.center.y }) }], { gridSpaces: true })[0]\nlet currentBand\n\nfor (let band in weapon.range.bands) \n{\n if (distance >= weapon.range.bands[band].range[0] && distance <= weapon.range.bands[band].range[1]) \n {\n currentBand = band;\n break;\n }\n}\n\nreturn [game.i18n.localize(\"Long Range\"), game.i18n.localize(\"Extreme\")].includes(currentBand)","AI6bFrjWk4NH9FBd":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","ALuPRzf85dmkEfLo":"return args.skill?.name == game.i18n.localize(\"NAME.Intuition\");","AMI2wDJqsIZsoq1e":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Émet un nuage de poudre noire nauséabonde. Active l'effet Fellowship Penalty sur @UUID[${this.actor.uuid}].`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","AMxezwtYnWCF6Oza":"return args.skill?.name == \"Projectiles (Poudre noire)\"","AS7CstSosuCrwZ19":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 20,\n \"bright\": 10,\n \"angle\": 360,\n \"alpha\": 0.4,\n \"animation\": {\n \"speed\": 3,\n \"intensity\": 3,\n \"type\": \"torch\",\n },\n \"color\": \"#ffcc66\",\n }}));","AV2Kj6jgmIc45zKi":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","AVROqafFhKjN6TPR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","AWgZnm9xLyIWCDnp":"let robust = args.modifiers.other.find(i => i.key == \"robust\")\nif (robust)\n{\n\trobust.value--;\n}\nelse \n{\n\targs.modifiers.other.push({key: \"robust\", label : this.effect.name, value : -1})\n}\n","AZGXrZOQ4EzjxRL9":"return true;","Adgs6Zs0FdefO6qx":"if (args.test.options.pilot && args.test.result.reversed)\n{\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\n\targs.test.result.other.push(`${this.effect.name}: DR limité à 1`)\n}","Ah2wyywkL8hjJNXM":"args.options.healWounds = true;","AjC4dsiuhVCOnRGI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","AmOMCUaWLJ2iJAt5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IFKWu98qmWpaSfUi\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","AmpDbT0BkDHeaRzf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\");\nlet data = item.toObject();\ndata.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ApaLcUhuty3EzJoP":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\nlet current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses points de Destin augmentés de ${current} à ${fortunePoints + current}`)","AqHLHp4kH6KULk3e":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun disponible!\", \"error\")\n}","AyNb5sj6FD2Z3Q5T":"this.actor.addCondition(\"dead\")\nthis.actor.setWounds(0);\nthis.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"scatter\"))","AyS3iLljxHRKsHg4":"let broken = this.actor.hasCondition(\"broken\");\nlet fatigued = this.actor.hasCondition(\"fatigued\");\nawait broken?.delete();\nawait fatigued?.delete()\nlet drilled = await fromUuid(\"Compendium.wfrp4e-core.items.Item.J9MK0AIaTbvd5oF6\")\nlet fearless = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\nlet stout = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IogM5gnsoOX63w7j\")\nthis.actor.createEmbeddedDocuments(\"Item\", [drilled, fearless, stout], {fromEffect : this.effect.id})","B063u4vrbvzMaCQt":"args.item.system.flaws.value = args.item.system.flaws.value.concat([{name : \"bulky\"}, {name : \"unreliable\"}])","B1xgRS00RcTIZLnO":"return [\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\")","B6ZbY3bxTPg6nCng":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\");","B87v1twc65qyvUWi":"args.fields.modifier += 10 * this.effect.conditionValue","B950b0XnIUYCdVwu":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\n\nif (test.succeeded)\n{\n if (args.totalWoundLoss <= parseInt(test.result.SL))\n {\n args.abort = `${this.effect.name}: Attaque détournée et renvoyée`\n }\n args.modifiers.other.push({label : this.effect.name, value : -1 * parseInt(test.result.SL)})\n}","BAOv7moTxsKlT3JS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"broken\")\n}","BD7bVTU2pVoRSRBe":"let symptoms = {\n convulsions : \"Convulsions\",\n coughsandsneezes : \"Coughs and Sneezes\",\n fever : \"Fever\",\n flux : \"Flux\",\n nausea : \"Nausée\"\n}\n\nlet roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\nroll.toMessage(this.script.getChatData());\n\nlet choices = await ItemDialog.create(ItemDialog.objectToArray(symptoms), roll.total, \"Choisissez les Symptomes\");\n\nif (choices.length)\n{\n let symptomEffects = duplicate(game.wfrp4e.config.symptomEffects)\n let added = []\n for(let choice of choices)\n {\n let symptom = symptomEffects[choice.id];\n symptom.origin = this.effect.uuid;\n added.push(symptom);\n }\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", added)\n}\nelse \n{\n this.effect.delete();\n}\n\n","BHbFqhJPzZI2txLs":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 2\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","BcXTujburrHpjpwa":"args.fields.slBonus -= 3;","Be5rdfnZorbILhpC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 3 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Bexspr5viPhHiFmU":"let fatigued = this.actor.hasCondition(\"fatigued\");\nlet value = fatigued?.conditionValue || 0;\nargs.fields.modifier += value * 10;","Bj6bxItlgtI2sXVN":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nargs.totalWoundLoss = Math.max(0, args.totalWoundLoss - roll.total)\nargs.modifiers.other.push({label: this.effect.name, value : -1 * roll.total})\nthis.effect.update({disabled : true})","BtyFhdGMKiMamGhM":"let test = await args.actor.setupSkill(\"Esquive\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nlet damage = parseInt(this.effect.sourceTest.result.SL)\n\nif (test.succeded)\n{\n damage = damage + 8 - parseInt(test.result.SL)\n}\n\nelse \n{\n damage = damage + 10\n this.actor.addCondition(\"entangled\", 3)\n}\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", suppressMsg: true}))\n","Bv3431tnG3VKaTJr":"if (args.test.result.castOutcome == \"success\")\n{\n args.test.result.other.push(`@Fear[2,${this.actor.name}]`);\n}","ByhEa1BxQOyrOmqg":"return args.item?.attackType == 'melee'","BzDLuxBNw1QNIacg":"if (args.item.type == \"skill\")\n args.item.system.advances.value = 0\n\nif (args.item.type == \"talent\")\n args.item.system.tests.value = \"\"\n\nif (args.item.type == \"weapon\") \n args.item.system.qualities.value = []","CCK1iIfPmB398ziT":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {fields : {difficulty : \"difficult\"}, skipTargets: true, appendTitle : \" - Walking\"})\ntest.roll();","CCwuu3bPLCpVGAmb":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n\n","CDASLC4fWKSGQKf9":"let blinded = this.actor.hasCondition(\"blinded\");\nif (blinded?.getFlag(\"wfrp4e\", \"flockOfDoom\"))\n{\n blinded.delete();\n}","CHnaBPHk6HdFS512":"let arm = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\");\nlet leg = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\");\n\nlet choice = await ItemDialog.create([arm, leg], 1, \"Choisir le Membre\")\n\nthis.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})","CIxZYkHggBQ6EsHP":"this.script.scriptNotification(\"Effet utilisé\");\nthis.effect.delete();","CM43kvw5mIIE1OsB":"let key = this.item.system.location.key\n\nlet lostFingers = this.actor.flags.useless[key] || 0;\n\nlostFingers += 1\n\nthis.actor.flags.useless[key] = lostFingers;\n\nif (lostFingers >= 4)\n{\n\tthis.actor.flags.useless[key[0] + \"Arm\"] = true;\n}","CMUFtmNA1kkD1ay7":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 30,\n \"bright\": 20,\n \"angle\": 90,\n \"alpha\": 0.6,\n \"animation\": {\n \"speed\": 3,\n \"intensity\": 3,\n \"type\": \"torch\",\n },\n \"color\": \"#ffcc66\",\n }}));","CPQoK7NjzOwVTFXS":"for(let effect of this.actor.effects.filter(e => e.isCondition))\n{\n if (effect.isCondition)\n {\n effect.delete();\n }\n}","CW5Vlr57OaMkKJ8Q":"if (this.actor.system.status.advantage.value >= 3)\n{\n this.actor.modifyAdvantage(-3);\n this.script.scriptNotification(\"Avantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","CWNGrg7se91RC95g":"if (args.totalWoundLoss > 0) {\n args.opposedTest.result.other.push(\n `@Corruption[minor]{Exposition Mineure à la Corruption}`\n )\n this.script.scriptMessage(`${this.effect.name}: \n @Corruption[moderate]{Exposition Modérée à la Corruption}
\n ${args.actor.prototypeToken.name} doit réussir un \n Test de Corruption (Modéré)`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n}","Ca1fXHTA1e2QLx0D":"args.fields.modifier += 50;","CiFeduksZJ6PRulx":"return args.skill?.name == \"Chevaucher (Cheval)\" || (args.options.dodge && this.actor.isMounted);","Cjj4iLkdY1NaZRCi":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Projectiles\")))\n{\n let choice = await Dialog.wait({\n title: this.effect.name,\n content: `

Appliquer les dommages de ${this.effect.name} à l'attquant?`,\n buttons: {\n yes: {\n label: \"Oui\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"Non\",\n callback: () => {\n return false;\n }\n }\n }\n })\n\n if (choice)\n {\n this.script.scriptMessage(await args.attacker.applyBasicDamage(this.actor.system.characteristics.wp.bonus, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}));\n }\n}","CkE8NZOhzPkuRrKJ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n\n\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tthis.actor.addCondition(\"unconscious\")\n}","CoImIH9OCMx9DfQZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nbhn2wX35b7Jrcbg\")\nlet data = item.toObject();\ndata.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","D5XmzrUGFa1JN0cl":"args.prefillModifiers.modifier += 10\n\n","DANLE5HxrkTNelhl":"args.wounds += 4;","DBafsY1HrclJRTtA":"return args.type != \"cast\"","DHxUKY9LMyifFgCi":"return args.skill?.name == \"Métier (Apothicaire)\" || args.skill?.name == \"Métier (Alchimiste)\"","DL9vYNft9aXdV2aW":"let tooth = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\ntooth = tooth.toObject()\ntooth.system.specification.value = 3\ntooth.system.qualities.value = [{name : \"magical\"}]\n \nlet claw = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nclaw = claw.toObject()\nclaw.system.specification.value = 4\nclaw.system.qualities.value = [{name : \"magical\"}]\nclaw.name = \"Claw\"\n\nthis.actor.createEmbeddedDocuments(\"Item\", [tooth, claw], {fromEffect : this.effect.id})","DMQ0taEpBUJU5njV":"args.actor.status.fortune.value = 0","DTiHS6RfwhF4THbf":"return args.skill?.name != game.i18n.localize(\"NAME.Drive\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Ride\"));","DVlZGbiuMIHEQOnM":"if (this.actor.getFlag(\"wfrp4e\", \"isAttached\")) \n{\n\tlet roll = await new Roll(\"1d10\").roll()\n\tawait roll.toMessage(this.script.getChatData());\n\tif (roll.total == 9 || roll.total == 10)\n\t{\n\t this.script.scriptMessage(`${this.actor.name} attaché à ${this.actor.getFlag(\"wfrp4e\", \"isAttached\")} tombe.`)\n\t await this.actor.unsetFlag(\"wfrp4e\", \"isAttached\") \n\t}\n }","DWBxvzfWGcG7PVNP":"let letter = this.item.system.location.key[0]; // \"l\" or \"r\";\n\nthis.item.updateSource({\"system.location.key\" : letter + \"Doigt\"})\n\n// We want the location to be Right or Left Hand, but the key to be rFinger or lFinger","DcSJNRBXE9ZBBY7T":"this.actor.addCondition(\"blinded\", Math.max(0, this.effect.sourceTest.result.SL))","DhZqJso1JWYtGrKk":"this.actor.addCondition(\"ablaze\")\nlet damage = this.effect.sourceTest.result.damage + this.effect.sourceTest.result.additionalDamage\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))","DmbWR9s5I8LHBwxB":"let column = await ValueDialog.create(\"Selectionnez la colonne pour déterminer la Tête de Bête\", \"Sélectionner la colonne\", \"\", [\"Undivided\", \"Khorne\", \"Nurgle\", \"Slaanesh\", \"Tzeentch\"]);\n\nif (column)\n{\n let result = await game.wfrp4e.tables.rollTable(\"beasthead\", {}, column);\n this.script.scriptMessage(`${result.title}
${result.result}`);\n let uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\n let item = await fromUuid(uuid);\n if (item)\n {\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n this.item.delete();\n }\n}","DpdSEHM6NMN1ey6h":"if (parseInt(this.item.system.specification.value) > 0)\n{\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\n}","DqJFo74trI916qXN":"let fatigued = args.actor.hasCondition(\"fatigued\")\nif (fatigued)\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","DsE6rTSzxEn6uWMz":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\nawait test.roll();\nif (test.failed)\n{ \n await this.actor.addCondition(\"blinded\");\n await this.actor.addCondition(\"fatigued\")\n} ","DuM5l2Yb4bdvDeaG":"return args.skill?.name != \"Athlétisme\"","DxQnamsb2AuW0p2e":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","DyZ1jH88EAp1ueOK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\ndata.system.location.value = data.system.location.value.replace(\"Arm\", \"Wrist\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","E1Xo4RVuN1YRRxg7":"return args.item?.attackType != \"ranged\"","E1vUepgop09FF5wy":"if (this.actor.system.status.advantage.value == 0)\n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet hatred = await fromUuid(\"Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0\")\nlet frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\n\nif (this.actor.system.status.advantage.value >= 3)\n{\n this.script.scriptNotification(`Ajout de ${frenzy.name}`)\n this.actor.setAdvantage(0)\n this.actor.createEmbeddedDocuments(\"Item\", [frenzy])\n}\nelse if (this.actor.system.status.advantage.value >= 1)\n{\n let data = hatred.toObject();\n data.system.specification.value = \"Combatants au corps à corps\"\n this.script.scriptNotification(`Ajout de ${hatred.name}`)\n this.actor.setAdvantage(0)\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n}","E2VfOVuju67qO3VL":"let blinded = this.actor.hasCondition(\"blinded\");\nif (blinded.getFlag(\"wfrp4e\", \"nightshroud\"))\n{\n blinded.delete()\n}","E4CHDe1xfmcV3oGv":"return args.skill?.name == game.i18n.localize(\"NAME.Navigation\");","E6DMqfDeczqmVMFV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\n\nawait test.roll();","E7D4bxz8gy4e1wL7":"if ([\"Stealth (Rural)\", \"Track\", \"Outdoor Survival\", \"Swim\", \"Perception\", \"Intuition\"].includes(args.item?.name))","EGWF3LHav3e2zFL4":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\");","EJObiSth3WdcJOXN":"if (args.test.characteristicKey == \"wp\" && args.test.failed && args.test.result.SL <= -3)\n{\n this.script.scriptNotification(\"Ajout de A Terre\");\n this.actor.addCondition(\"prone\")\n}","EJaBfqADqlo92Fx6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oGbDwnLOn3isPJpO\")\nlet data = item.toObject();\ndata.name += \" (A déterminer)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","EKkdyp51Wf4csw2B":"return this.actor.statuses.has(\"frenzy\");","ENGmwaItRXO5s0XY":"await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 3)\nthis.script.scriptMessage(`Soigne ${this.actor.system.characteristics.t.bonus * 3} Blessures`)\n\nthis.actor.hasCondition(\"bleeding\")?.delete()\nthis.actor.hasCondition(\"fatigued\")?.delete()\n","EQ5dtGW5kQhtAb87":"await this.actor.addCondition(\"prone\")\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (test.failed)\n{\n\tawait this.actor.addCondition(\"stunned\")\n}","ERxrWzSpw8qwxFVi":"this.script.scriptNotification(`Ne peut entrer ${this.effect.name}!`); this.actor.addCondition(\"broken\");","EU5j0hnDTG9Z6d1e":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif(test.failed)\n{\n this.actor.addCondition(\"stunned\", 2)\n}","EVBSHEC5nmmj2X41":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","EYny6z5oTOhxGDfb":"args.fields.modifier -= 10;\n","EaSNOmXUxAkUHnm5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","Eay7GpDyfsEE40jT":"if (args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"ablaze\")\n}","EdTChmSouS0MSmk5":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.succeeded)\n{\n this.script.scriptMessage(\"Peut effectuer une Action ou un Mouvement (en choisir un)\")\n}\nelse \n{\n this.script.scriptMessage(\"Ne peut pas effectuer d'Action ou de Mouvement ce round\") \n}","EiLaZW4b4ypw5sLV":"// can't use Damage application type because that checks if wounds were dealt\nargs.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})","EmXwcuycEH8slEn5":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif(test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}","EmmG49pMOPHRwDzR":" let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n if (args.test.isFumble && roll == 1 && !args.test.result.misfire)\n {\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Résultat 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n }\n else if (args.test.isFumble && roll != 1)\n args.test.result.other.push(\"Raté résultat: \" + roll)\n","EpdMj9d9SYPeP44q":"return args.characteristic != \"ag\" && args.item?.id != this.item?.id","ErgOwSiVnm9VLVHN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.DrNUTPeodEgpWTnT\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","Et4tPHlrkueLqP3T":"if (args.item.type == \"skill\") args.item.system.modifier.value -= 10","Ew3C2WmLCtc1KT46":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")) || args.item?.id == this.item?.id","EwD053Fyy46b59ZI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.6l3jvIAvrKxt0lA9\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","Eye6dranWpNsILjm":"if (this.actor.system.status.wounds.value <= 1)\n{\n this.effect.delete();\n}","F4aGsdzJ9SYcX57F":"if (args.equipped)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.HpFkVJ2lYPAWumUL\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}\nelse \n{\n this.effect.deleteCreatedItems(); \n}","FAB12eLcSCAOOQwk":"this.script.scirptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true});","FAf4iXj5LkdvukS2":"fromUuid(\"Compendium.wfrp4e-wom.items.0Xdm4r7l2EwC4fcg\").then(item => Item.create(item.toObject(), {fromEffect : this.effect.id, parent : this.actor}))","FMA16PvoObBV8vDl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\nitem = item.toObject()\nitem.system.specification.value = 20\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\nthis.script.scriptNotification(item.name + \" added\")","FMSN5uRskkATexzB":"game.wfrp4e.tables.rollToChat(\"crithead\")","FSqUqSByMiztYOQM":"if (args.totalWoundLoss > 0)\n this.script.scriptMessage(`Infecté: ${args.actor.name} doit réussir un Test de Résistance Facile (+40) ou recevoir une @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Blessure Purulente}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","FUgCtIoj1Stgqxt7":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","FXuyiJoXdAh6WhRK":"return args.skill?.name == \"Chevaucher (Cheval)\" && game.combat?.active","FXwfqF0jpXlBQ9Y3":"return args.item?.system?.isMelee && this.actor.attacker","FYUPfYyTYZkxRLFT":"return ![\"NAME.Endurance\", \"NAME.Cool\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","FZFOC7bip0oiWEzk":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2);\n this.script.scriptNotification(\"Ajout d'Hémorragie\")\n}","FciJSTq7dZsZIPgl":"if (args.equipped)\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}\nelse \n{\n this.effect.deleteCreatedItems(); \n}","FfTqCPxCoxwGDTQs":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","FiD3mvWIBHNNIuO9":"if (args.opposedTest.result.hitloc.value == \"body\")\n{\n if ((await new Roll(\"1d2\").roll()).total == 1)\n {\n args.opposedTest.result.hitloc.value = \"head\"\n this.script.scriptMessage(`Localisation changée : Tête`)\n }\n}","FkTwk8hfHpRLbAp2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","FmLx9pwOkzqqU7Ph":"return args.skill?.name == game.i18n.localize(\"NAME.Track\");","FqevMs0ukQ9WuUHl":"// Each time the blade is used, the GM should secretly roll a d10.\n// On a 1, its poison has run dry, \n// and the next time it is employed it will shatter.\n\nif (this.item.getFlag(\"wfrp4e\", \"brittle\"))\n{\n ChatMessage.create({content: `${this.item.name} shatters!`})\n this.item.update({name : `${this.item.name} (Brisé)`})\n}","Fvlc4RkeF4dHjW3m":"let caster = this.effect.sourceActor\nif (caster && (this.actor.has(game.i18n.localize(\"NAME.Undead\")) || this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))) {\n let wp = caster.system.characteristics.wp.value\n if (wp > this.actor.system.characteristics.t.value) {\n if (this.actor.has(game.i18n.localize(\"NAME.Unstable\"))) {\n this.actor.update({ \"system.status.wounds.value\": 0 })\n this.actor.addCondition(\"dead\")\n }\n else {\n fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\").then(item => {\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], { fromEffect: this.effect.id })\n ChatMessage.create({ content: `Ajout de Instable à ${this.actor.prototypeToken.name}`, speaker: { alias: caster.name } })\n })\n }\n }\n}","G1RletYc6BzigJrK":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 5\nargs.actor.addCondition(\"ablaze\", ablaze)","G7sFEnJlXZvfXL3V":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[1].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun restant!\", \"error\")\n}","GAO8AozttWOyRkta":"if (!args.flags.lostHand)\n{\n\targs.fields.lostHand = true;\n\targs.fields.modifier += -20;\n}","GEfWIFBSrXt0ldBM":"(await new Roll(\"1d10\").roll()).toMessage(this.script.getChatData())\nawait this.actor.addCondition(\"dead\")","GFaTz8f6PBNWrlad":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : `Confused: Determine behaviour by @Table[bewilder] Table.`}})\nawait test.roll();\nreturn test.failed","GFkVnx4m9OwYsKGH":"args.actor.flags.ambi+= 1","GNl5Zk7BZ2jhRV1I":"if (args.item.type == \"armour\")\n{\n args.item.system.AP.head = 0;\n}","GOq4TcnWbfyfCo2V":"this.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus * 2} Wounds`)\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus * 2)\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - Effets secondaires`,fields : {difficulty : \"difficult\"}})\nawait test.roll();\nif (test.failed)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData())\n if (roll.total <= 3)\n {\n this.actor.addCondition(\"blinded\", 3)\n }\n else if (roll.total <= 6)\n {\n this.actor.addCondition(\"broken\");\n }\n else if (roll.total <= 9)\n {\n this.actor.addCondition(\"stunned\");\n }\n else if (roll.total == 10)\n {\n this.actor.addConditon(\"unconscious\")\n }\n}","GRfCxtYzmEx2LYU7":"if (args.totalWoundLoss >= 1)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData());\n if (roll.total == 9)\n {\n this.script.scriptMessage(`Deux @UUID[Compendium.wfrp4e-eis.actors.iDy8SDTwJSlCzZMl]{Horreurs Bleues de Tzeentch} sortent de la chair hurlante de ${this.actor.name}, le tuant au passage.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","GTZUO73pUJKpM1JB":" let roll = await new Roll(\"1d10\").roll();\n game.dice3d?.showForRoll(roll);\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n","GUkpYdPwoC5pc9BT":"return !args.weapon?.system.properties.flaws.crewed","GZFsuynUhgZqwTGo":"if (args.totalWoundLoss >= 1)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"Gained a Poisoned Condition\", success: \"Resisted the poison\" }})\n await test.roll();\n if (test.failed)\n {\n args.actor.addCondition(\"poisoned\");\n }\n}\n ","GbPEy22VuCNzlNv2":"return !this.actor.isMounted || (!args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\")) && !args.options.dodge)","Gc8S5TYlVdV8NnOT":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name, context: { failure: \"Gained a Broken Condition\", success: \"Resisted the Broken Condition\" } })\n\n await test.roll();\n\n if (!test.succeeded)\n {\n args.actor.addCondition(\"broken\");\n }","GcIQtshex11AMmh2":"if (this.item.system.isEquipped)\n{\n let removeRepeater = false\n if(!this.item.system.offhand.value) // main\n {\n let offhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && i.system.offhand.value)\n if (offhandUsed)\n {\n removeRepeater = true;\n }\n }\n else // offhand\n {\n let mainhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && !i.system.offhand.value)\n if (mainhandUsed)\n {\n removeRepeater = true;\n }\n }\n \n if (removeRepeater)\n {\n this.item.system.qualities.value = this.item.system.qualities.value.filter(i => i.name != \"repeater\")\n }\n}","Gh7OidY6UdpWBS1g":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.KII1gWnxIZ8HzmU5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","GjkxWj9wCAclM9WA":"let effects = foundry.utils.deepClone(this.item.effects.contents.filter(e => e.active));\n\neffects.splice(effects.length - 1);\n\nif (effects.length == 0)\n{\n return this.script.scriptNotification(\"Tous les effets ont été utilisés. Les remettre à 0 pour les utiliser à nouveau\")\n}\nlet choice = await ItemDialog.create(effects, 1, \"Choisissez le Pouvoir à gagner\");\n\nif (choice[0])\n{\n choice[0].update({disabled : true})\n let effect = choice[0].convertToApplied();\n effect.name += ` (${this.effect.name})`\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [effect]);\n}","GrF6tQ08jgKmUH4i":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"i\"].includes(args.characteristic)","GuUCErVbk5hrFzR3":"args.multiplier.tb += 1","GuxbvztcvzJz2oH1":"args.item.system.qualities.value = [];","GzSFlqL1YrIK1dxh":"let items = await Promise.all([\"Compendium.wfrp4e-wom.items.Item.EjGYZ4CgX2jZW7Ot\",\n\"Compendium.wfrp4e-wom.items.Item.O2v9RQiFf0obskP5\",\n\"Compendium.wfrp4e-wom.items.Item.2cv6hhZ57iV6z5Il\",\n\"Compendium.wfrp4e-wom.items.Item.YgDEUO0G0XcqQJqg\",\n\"Compendium.wfrp4e-wom.items.Item.J6K5TPxI8qIGQKKH\",\n\"Compendium.wfrp4e-wom.items.Item.K9FPtiDLwTkC7FuO\",\n\"Compendium.wfrp4e-wom.items.Item.CkMYRYCLrkMnyVm5\",\n\"Compendium.wfrp4e-wom.items.Item.0Xdm4r7l2EwC4fcg\"].map(fromUuid));\n\nlet choice = await game.wfrp4e.apps.ItemDialog.create(items, 1, \"Sélectionner le Vent\")\n//this.actor.createEmbeddedDocuments(\"Item\", items);\n\nthis.item.update(choice[0]?.toObject(), {diff: false, recursive : false});\n\n//this.actor.items.getName(this.effect.item.name).delete() // For some reason this.effect.item.delete() throws an error\n\n","GzsuEg7gZy1f0ljy":"let bleeding = this.actor.hasCondition(\"bleeding\")\nif (bleeding)\n{\n this.script.scriptNotification(`Suppression de ${bleeding.conditionValue} états Hémorragiques`)\n bleeding.delete(); \n}\nelse \n{\n this.script.scriptNotification(`Aucune Hémorragie`)\n}","H06Ysj7oPiemW7S6":"if (args.test.options.income && !args.test.options.criminal)\n{\n args.test.options.criminal = true;\n let currentCareer = args.test.actor.system.currentCareer;\n let coin = {1 : \"b\", 2 : \"s\", 3 : \"s\", 4 : \"g\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n let term = {1 : \"bp\", 2 : \"ss\", 3 : \"ss\", 4 : \"gc\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n let dieAmount = {1 : \"2d10\", 2 : \"1d10\", 3 : \"2d10\", 4 : \"1\"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)\n dieAmount = parseInt(dieAmount[0]) * this.item.system.Advances; // Multilpy that first letter by your standing (Brass 4 = 8d10 pennies)\n if (coin != \"g\") // Don't roll for gold, just use standing value\n {\n dieAmount = dieAmount + \"d10\";\n }\n let moneyEarned = (await new Roll(dieAmount.toString()).roll()).total;\n let moneyString = `${moneyEarned}${coin}`\n let transactionString = `${moneyEarned}${term}`\n\n this.script.scriptMessage(`Gain d'un supplément de ${game.wfrp4e.market.amountToString(game.wfrp4e.market.parseMoneyTransactionString(transactionString))}`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","H1z3nWW7Rj3Oisxy":"return args.type != \"channelling\"","H2CJvApKMnfGNNoo":" if (args.test.item?.type == \"skill\" && args.test.item.name.includes(game.i18n.localize(\"NAME.Stealth\")))\n{ \n args.test.result.description = \"Echech Stupéfiant\";\n args.test.result.outcome = \"failure\";\n ChatMessage.create({content : \"SQUEAK\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\n AudioHelper.play({ src: `${game.settings.get(\"wfrp4e\", \"soundPath\")}squeek.wav` }, true);\n}","H3Wls12aVWAWTp9J":"this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => {\n test.roll();\n})","H3pZ9UeIzIz3luKh":"args.actor.addCondition(\"bleeding\")\n\nthis.actor.setFlag(\"wfrp4e\", \"isAttached\", args.actor.name)\n\nthis.script.scriptMessage(`Affecté à ${args.actor.name}`)","HASsi6wYHVALExWq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Point de Corruption Point gagné\" } })\nawait test.roll();\n\nif (test.failed && args.actor.type == \"character\") \n{\n let msg = \"\"\n msg += `

${this.actor.prototypeToken.name} gagne 1 Point de Corruption

`\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n msg += `${args.actor.prototypeToken.name} gagne une mutation (@Table[expandedmutatephys]{Physique} ou @Table[expandedmutatemental]{Mentale}) et gagne @UUID[Compendium.wfrp4e-core.items.hiU7vhBOVpVI8c7C]{Magie du Chaos (Tzeentch)}`\n }\n this.script.scriptMessage(msg, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n await this.actor.update({ \"system.status.corruption.value\": parseInt(args.actor.status.corruption.value) + 1 })\n}","HJ2X4ZtXei0BXbxf":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"PzimjNx9Ojq4g6mV\"), game.wfrp4e.utility.findItemId(\"rOPmyLWa37e7s9v6\")])\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choisir une compétence\")\n\n items = items.map(i => i.toObject())\n items.forEach(i => i.system.advances.value = 20)\n\nitems.forEach(i => equip(i))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.data.worn.value = true\n else if (item.type == \"weapon\")\n item.data.equipped = true\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\n item.data.worn = true\n}","HKhyn0kijKfzW6cw":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nthis.item.updateSource({\"flags.wfrp4e.passed\" : test.succeeded})","HMC6hPND9DWLFfZE":"if (this.item.name.includes(\"(\"))\n{\n\treturn;\n}\n\nlet index = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Lore\")))\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(index, 1, \"Choisir un Savoir\")\nlet text;\nif (!choice[0])\n{\n let custom = await Dialog.wait({\n title : \"Saisir le savoir\",\n content : \"\",\n buttons : {\n confirm : {\n label : game.i18n.localize(\"Confirmer\"),\n callback : (dlg) => {\n return dlg.find(\"input\")[0].value\n }\n }\n },\n default : \"confirm\",\n close : () => {\n return \"\"\n }\n }) \n text = custom || \"\"\n}\nelse \n{\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\n}\n\nawait this.item.updateSource({name : this.item.name + ` (${text})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"chosen Lore\", text)})\nawait this.effect.updateSource({name : this.effect.name + ` (${text})`})","HOt2hHOiHDZ7oBgW":"if ([\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n{\n\targs.actor.details.move.value /= 2\n}\n","HX6CjNapYdC0VmQ8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.epPBu7x6BRWp2PHG\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","HXJKkmpfxQUOnWOS":"if (!this.item.system.twohanded.value)\n{\n this.item.system.flaws.value = this.item.system.flaws.value.concat([{name : \"tiring\"}, {name : \"slow\"}])\n}","Hcpn1gU58DIKIhty":"if (args.item.type == \"skill\" && args.item.name == \"Corps à corps (Fléau)\")\n{\n args.item.system.modifier.value += 10;\n}","HfCxNd7mFGZH4s9Y":"// An opponent that takes more than a single Wound from a Warp Blade strike \n// in melee combat must make an Average (+20) Endurance Test \n// or take a Stunned Condition\n\n\nif (args.totalWoundLoss > 1) {\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if(test.failed)\n {\n await args.actor.addCondition(\"stunned\");\n }\n}","HiMBS6GeOwEydWYN":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\");","HmImVzvw6ecBy99l":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0) \n{\n args.actor.addCondition(\"bleeding\", 2)\n this.script.scriptNotification(\"Ajout Hémorragique\")\n}","HoNTnPphrJISSQr1":"ChatMessage.create({content : \"Parle et fais toi connaître\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})","Hq1G30lhJYvtOSNb":" \n if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.preData.characteristic))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","HrOBAXsEX073ReKl":"let skill = `Divertissement (Chant)`\nlet currentCareer = this.actor.system.currentCareer;\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\n\nif (!currentCareer) return\n\n\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\nif (existingSkill && inCurrentCareer)\n{\n\texistingSkill.system.advances.costModifier = -5;\n}\nelse \n{\n\tcurrentCareer.system.skills.push(skill);\n}\n\n\n","HrYchgkdZBiu1yPF":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\");","HwbgUIbpX0D8JLOR":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n this.actor.addCondition(\"bleeding\")","I0Jo6cbNAJtXUloc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.J9MK0AIaTbvd5oF6\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","I0oRZ7AWde5KI5jw":"return ![\"t\", \"int\"].includes(args.characteristic)","I1J2m5uud84N50Lk":"if ([\"cast\", \"channelling\", \"pray\"].includes(args.type))\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Impossible d'incanter un Sort ou d'utiliser un Prière\");\n}\nelse return true;","I7ieW0hNYvvX0KFg":"return args.skill?.name != game.i18n.localize(\"NAME.Heal\");","I93i49wI9ZrDHT4n":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.jt0DmVK9IiF6Sd2h\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","I9QAPKbaXwMMMBT4":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif(test.failed)\n{\n await this.actor.addCondition(\"stunned\");\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\n await secondTest.roll();\n if(secondTest.failed)\n {\n this.effect.updateSource({name : \"Taste of Death\"})\n await this.actor.addCondition(\"fatigued\");\n }\n else \n {\n return false;\n }\n}","IAGla7HJlYN0wa4H":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n this.actor.addSystemEffect(\"convulsions\")\n this.script.scriptMessage(`Test de Force Mentale échoué, ${this.actor.prototypeToken.name} subit des @Symptom[Convulsions] pour [[1d10]] heures`)\n }\n}","ID8mCcjkl7PCQhDq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif(test.failed)\n{\n let damage = this.effect.sourceItem.system.computeSpellDamage(\"3\", true);\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg: true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))\n}","IG4zYqtN9fRSYE7q":"args.actor.addCondition(\"ablaze\");","IKiZv9YSFmKmHo6a":"return args.spell?.system.lore.value == \"fire\"","ILqHxk7deotgI3KD":"if (args.item.type != \"weapon\")\n return\n\nlet reach = args.item.reach.value\nlet reachNum = game.wfrp4e.config.reachNum[reach]\nreachNum = Math.min(reachNum + 2, 7)\n\nlet key = game.wfrp4e.utility.findKey(reachNum, game.wfrp4e.config.reachNum)\n\nargs.item.reach.value = key","IPPDvZdE8kn3H9z7":"let test = await this.actor.setupSkill(\"Esquive\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\n\nif (test.failed)\n{\n await this.actor.addCondition(\"grappling\")\n}","IR5URcjnCuWBFMoN":"// If a full dose is imbibed, \n// the victim must pass a Hard (-20) Endurance Test.\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\nawait test.roll()\nif (test.failed)\n{\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} Jo ne remarque rien d'anormal si ce n'est qu'ils se fatiguent un peu plus tôt que d'habitude. À ce stade, il est encore possible de sauver la victime via un antidote puissant ou des moyens magiques.

\n

Cependant, une fois qu’ils s’endorment, c’est presque impossible. À ce stade, la victime doit effectuer un test d'Endurance difficile (-20). S'il échoue, il ne se réveille jamais.

`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n })\n}\nreturn test.failed;","IR86DuMbVdbGOJYt":"this.actor.addCondition(\"blinded\")","IfEu1hO8sKEZBpvg":"let value = parseInt(this.item.specification.value)\nlet name = this.actor.prototypeToken.name\n\nif (game.user.isGM && game.user.targets.size)\n{\n game.user.targets.forEach(t => {\n t.actor.applyFear(value, name)\n })\n game.user.updateTokenTargets([]);\n}\nelse \n{\n game.wfrp4e.utility.postFear(value, name)\n}","IkGegSuQwwVPhrjF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 1\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Ip8sctF9SIE1Z2vF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.UnJ25lL8aUzem5JO\")\nlet data = item.toObject();\ndata.system.specification.value = 3\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","IpoOOjYJs6RmVrpb":"if (args.totalWoundLoss > 0)\n{\n args.attacker.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[1].uuid})\n}","IsLAvY9ikR1cOJWw":"return ![\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","IslMfFgpgQq2brpu":"if (this.actor.hasCondition(\"broken\"))\n{\n this.actor.removeCondition(\"broken\")\n this.script.scriptNotification(`Impossible de supprimer l'état Brisé`);\n}","IukS0clr1yAleacc":"this.actor.system.characteristics.ag.modifier -= parseInt(this.item.system.location.value || 1)\n\nthis.actor.system.characteristics.ws.modifier -= parseInt(this.item.system.location.value || 1)","IupskvzvoGyD2H5o":"if (this.actor.type != \"character\")\n{\n return;\n}\n\nlet god = await ValueDialog.create(\"Saisir une Déité\", \"Béni\")\n\nif (god)\n{\n let prayers = await game.wfrp4e.utility.findAll(\"prayer\", \"Chargement des Prières\")\n let blessings = prayers.filter(p => p.system.god.value.split(\",\").map(i => i.trim().toLowerCase()).includes(god.toLowerCase()) && p.system.type.value == \"blessing\")\n if (blessings.length)\n {\n this.script.scriptNotification(\"Ajout de \" + blessings.map(i => i.name).join(\", \"))\n await this.actor.createEmbeddedDocuments(\"Item\", blessings, {fromEffect : this.effect.id})\n }\n else \n {\n this.script.scriptNotification(`Impossible de trouver des Bénédictions associées avec ${god}.`)\n }\n this.item.updateSource({name : this.item.name.replace(\"Savoir divin\", god)})\n await this.actor.update({\"system.details.god.value\": god})\n}","IzZcsSngI8TZH4d8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","J0IWUhxada2ONowP":" return args.skill?.name == \"Divertissement (Chant)\" || args.skill?.name == \"Divertissement (Chanter)\" || (args.skill?.name.includes(\"Langue\") && (args.skill?.name.includes(\"Magick\") || args.skill?.name.includes(\"Elthárin\") || args.skill?.name.includes(\"Cathayan\")))","J1FPDdrXGctKDTZz":"if (args.equipped)\n{\n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\n wardData = ward.toObject()\n wardData.system.specification.value = \"8\"\n \n let mr = await fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\")\n mrData = mr.toObject()\n mrData.system.specification.value = 2\n \n this.actor.createEmbeddedDocuments(\"Item\", [wardData, mrData], {fromEffect : this.effect.id})\n}\nelse\n{\n this.effect.deleteCreatedItems()\n}","J8aPichsl25t1QZ9":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.SL)","JEbs0WlqhKNDOo5A":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}\n","JFgXyb6bKjZJLmF8":"return args.characteristic == \"ag\"","JQruHprM5R5vZ9DA":"let caster = this.effect.sourceActor;\nif (caster)\n{\n let healed= caster.system.characteristics.wp.bonus + caster.system.characteristics.int.bonus\n await this.actor.modifyWounds(healed);\n this.script.scriptMessage(`${this.actor.prototypeToken.name} guéri ${healed} Blessures`)\n}\n \n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"vhard\"}, context : {success : \"1 Point de Corruption gagné durant la dernière heure doit être supprimé.\", failure: \"Rien ne se passe\"}})\n await test.roll();","JZIn1dsKHFE3smJU":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 1\nargs.actor.addCondition(\"ablaze\", ablaze)","JaiC5P6nIgctOacH":"if (args.actor.system.details.species?.value?.toLowerCase() == \"dwarf\")\n{\n args.weaponProperties.flaws.undamaging = true;\n}","JavuFNZ9Pj5elVLc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","JeThJbOf6Xmbtgo1":"this.script.scriptMessage(await this.actor.applyBasicDamage(8 + parseInt(this.effect.sourceTest.result.SL), {suppressMsg : true}))\n\nlet test = await this.actor.setupSkill(\"Athlétisme\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","JgCcgDVZX54slrWx":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption","JibNjuQrJRnY0yf9":"return this.actor.flags.useless.rEye && this.actor.flags.useless.lEye && ([\"ws\", \"bs\"].includes(args.characteristic) || args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\")) || args.weapon || args.options.dodge)","JjDzMnUxaWQePIYh":"return args.characteristic != \"int\"","JjiPprLSlSmmB5Ga":"args.item.system.damage.value += \" + 1\"","Jjq3oPYbI26zjxME":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","Jk7OHqx06oCUVAzb":"return ![\"Langue (Magick)\", \"Focalisation (Hysh)\"].includes(args.skill?.name) ","JmZQRvdWjm9ykYfn":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.actor.removeCondition(\"surprised\")\n this.script.scriptMessage(`Ne peut être surpris`);\n}","Jnp5c09sPzDD61EK":"this.script.scriptNotification(`${args.actor.prototypeToken.name} doit réussir un Test Accessible (+20) de Force Mentale pour attaquer cette cible!`)\n\nreturn true; // No need to show this in the dialog","JstrA46EYSEuRSy5":"if (this.actor.has(game.i18n.localize(\"NAME.Undead\")) && this.actor.has(game.i18n.localize(\"NAME.Construct\")))\n this.actor.addCondition(\"dead\")","JwYZJGkZMSM2M3Si":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\n await test.roll()\n if (test.failed)\n {\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\n }\n}","JwgFQmPQtXWAP94i":"this.actor.addCondition(\"fatigued\");","JyTxUG5dNW670Sf7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\nlet data = item.toObject();\ndata.system.location.key= this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}","K06v93N4FXb70mB7":"args.item.system.encumbrance.value = Math.max(0, args.item.system.encumbrance.value - 1);","KD4nCSdSXJVJmk0R":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg : true}))\nawait this.actor.addCondition(\"ablaze\")","KF69WqF4PSEtpdb2":"args.fields.slBonus += 2;\n ","KG4TxnXiLLpfWOQO":"args.fields.difficulty = \"average\"","KGK9vL1Yl0qmCeCN":"let specification = this.item.system.specification.value;\nlet choice = [];\n\nif (!specification || specification == \"Compétences entraînées\")\n{\n choice = await ItemDialog.create(ItemDialog.objectToArray({\n broken: \"Dompté\",\n drive: \"Trait\",\n entertain: \"Divertir\",\n fetch: \"Rapporter\",\n guard: \"Garder\",\n home: \"Revenir à la maison\",\n magic: \"Magie\",\n mount: \"Monture\",\n war: \"Guerre\"\n }, this.effect.img), \"unlimited\", \"Choisissez un Dressage\");\n}\nelse \n{\n choice = specification.split(\", \").map(i => {\n return {\n id : i.toLowerCase(),\n name : i\n }\n });\n}\n\nif (choice.length)\n{\n let changes = foundry.utils.deepClone(this.effect.changes);\n\n for(let training of choice)\n {\n switch(training.id)\n {\n case \"broken\" : \n let roll = await new Roll(\"2d10\").roll(); \n roll.toMessage(this.script.getChatData());\n changes.push({value : roll.total, mode : 2, key : \"system.characteristics.fel.modifier\"})\n\n if (this.actor.type == \"creature\")\n {\n let bestial = this.actor.itemTypes.trait.find(i => i.name == \"Bestial\");\n if (bestial)\n {\n bestial.update({\"system.disabled\" : true})\n }\n }\n break;\n\n case \"drive\" : \n\n break;\n\n case \"entertain\" : \n\n break;\n\n case \"fetch\" : \n\n break;\n\n case \"guard\" : \n let territorial = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JIAe7i7dqTQBu4do\");\n await this.actor.createEmbeddedDocuments(\"Item\", [territorial], {fromEffect: this.effect.id})\n setProperty(args, \"options.keepId\", true);\n break;\n\n case \"home\" : \n\n break;\n\n case \"magic\" : \n\n break;\n\n case \"mount\" : \n\n break;\n\n case \"war\" : \n changes.push({value : 10, mode : 2, key : \"system.characteristics.ws.modifier\"})\n break;\n }\n }\n this.effect.updateSource({name : `${this.effect.name} (${choice.map(i => i.name).join(\", \")})`, changes, \"flags.wfrp4e.trained\" : choice.map(i => i.id)})\n this.item.updateSource({\"system.specification.value\" : `${choice.map(i => i.name).join(\", \")}`})\n}","KICZPwLvbUSxbDrE":"let table = game.wfrp4e.tables.findTable(\"mutatemental\");\nif (!table)\n{\n\tui.notifications.error(\"Impossible de trouver la table des Mutations Mentales\")\n}\nlet result = (await table.roll()).results[0];\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\nlet item = await fromUuid(uuid);\n\nif (item)\n{\n this.script.scriptNotification(`${item.name} added`)\n this.actor.createEmbeddedDocuments(\"Item\", [item])\n}\nelse \n{\n ui.notifications.error(\"Impossible de trouver l'item: \" + uuid)\n}","KIoVBinAZK8sMOqD":"\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - Wounded\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Gain de \" + disease.name)\n })\n }\n ","KJLAan0glJlyOyqF":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 10,\n \"bright\": 5,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"flame\",\n },\n \"color\": \"#ac9e6c\",\n }}));","KPQfupKuaf4LCv4R":"const talents = await Promise.all([\"Intrigant\", \"Seconde Vue\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","KQmb5B27eJ1lkbVL":"return this.item.system.quantity.value > 0 && args.type != \"channelling\"","KQzbrpb0T5a7it4k":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vMYEkrWj0ip6ZOdv\");\nlet data = item.toObject();\ndata.name += ` (Maladie)`;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","KSjsDlsx3DD6cT16":"return args.skill?.name != game.i18n.localize(\"NAME.Bribery\");","KT670CjGBEprx2fO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.RWJrupj9seau0w31\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","KTBVDHUndI3qDOXM":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"))\nawait test.roll();\nif (!test.succeeded)\n{\n args.actor.addCondition(\"stunned\")\n}","KUx0deSF3xNzMucL":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","KVpDUEjHhd3nLa0f":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"enrage-beast\"))\n}","KVuPduDztyMZQNt9":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus","KXzDe7cN2vynHjJO":"this.actor.hasCondition(\"blinded\")?.delete();\nthis.actor.hasCondition(\"deafened\")?.delete()\nthis.actor.hasCondition(\"unconscious\")?.delete()","KkjkYAGI9Em1NgiQ":"if (this.item.system.quantity.value) \n{\n this.item.system.reduceQuantity();\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Heal\"), { appendTitle: ` - ${this.effect.name}`, skipTargets: true })\n await test.roll();\n if (test.succeeded) \n {\n let actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n actor.applyEffect({ effectData: [this.item.effects.contents[0].convertToApplied()] })\n }\n else \n {\n this.script.scriptNotification(\"Test de Guérison échoué!\", \"error\")\n }\n}\nelse \n{\n this.script.scriptNotification(\"Quantité insuffisante!\", \"error\")\n}","KmngDrPD72xn22kZ":"if (this.actor.Species.toLowerCase() != \"skaven\") {\n this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - Utilise ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\n await test.roll()\n if (test.failed) \n {\n let toughnessLost = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n this.actor.update({ \"system.characteristics.t.initial\": this.actor.characteristics.t.initial - toughnessLost })\n this.script.scriptMessage(`${this.actor.prototypeToken.name} perd ${toughnessLost} points d'Endurance`)\n }\n })\n }","KnwYZbeRSBA94hfl":"if (!args.flags.lostFingers)\n{\n\targs.flags.lostFingers = true;\n\targs.fields.modifier -= 5 * this.actor.flags.useless[this.item.system.location.key]\n}","KuUkUmOOLf05I4Bp":"this.actor.hasCondition(\"broken\")?.delete();\n","KuuWAhoSzk0rCxxw":"args.fields.modifier += -20;","KyUPYV1RXJxPOfyA":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"veasy\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"fatigued\");\n}","KyswmGj1uG3QS3ng":"args.applyAP = false;","L1RMLvKtRPFtnczI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","L2cdQppcPwxz24hN":"return !args.weapon","L89UcafRHqUfxoux":"let injury = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\ninjury.updateSource({\"system.location.key\" : this.item.system.location.key})\nthis.actor.createEmbeddedDocuments(\"Item\", [injury], {fromEffect: this.effect.id})","L9eAtDyaoHvqryk4":"return args.skill?.name != game.i18n.localize(\"NAME.Intimidate\");","LAyLbcC0lOPwZP3U":"this.actor.addCondition(\"ablaze\", parseInt(this.effect.sourceTest.result.SL))","LHUUXfZVLBhWqRvb":"this.actor.status.addArmour(5, {magical: true, source : this.effect})","LLqAT9wEUGMLfDhU":"return !args.item?.system.isRanged","LOL2TGf8p8KxP14D":"let wind = this.effect.name.split(\" \")[2]\nreturn args.type != \"cast\" || game.wfrp4e.config.magicWind[args.item.system.lore.value] != wind;","LQEWSN5KnHHATPsf":"if (args.totalWoundLoss > 0)\n{\n this.script.scriptMessage(`${args.actor.name} doit réussir un Test Facile (+40) d'Endurance ou subir une @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Blessure Purulente}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","LXEUhHuXe8keEPI9":"let test = await this.actor.setupCharacteristic(\"wp\", {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tlet stuns = Math.max(1, Math.abs(test.result.SL))\n\tthis.actor.addCondition(\"stunned\", stuns)\n}","LeKLtvEDrWh4yHsx":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\") || args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","LedRsrVo2f7lm3Ix":"return args.skill?.name == game.i18n.localize(\"NAME.Intimidate\");","Lg1oRg4oNRvucsvi":"return !(args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\"))","LjXPlgdXBdllnA3i":"return ![\"s\", \"t\"].includes(args.characteristic)","LkPtgN9A36OI6Frh":"return args.skill?.name == game.i18n.localize(\"NAME.Leadership\");","LlRhPGorLl5qJCU8":"if (this.actor.hasCondition(\"prone\")) \n{\n this.actor.addCondition(\"unconscious\");\n}\nelse \n{\n this.actor.addCondition(\"prone\");\n}","Lm9IBkc918Duw3US":"let career = this.actor.itemTypes.career.find(c => c.getFlag(\"wfrp4e\", \"doubleLife\"))\n\nif(career)\n{\n career.system.current.value = true;\n}","Lp261O9fgEXmgPf3":"// If this actor wins a defending test, swap the test\nif (!args.opposedTest.result.swapped && args.opposedTest.result.winner == \"defender\" && args.opposedTest.attackerTest.result.damage)\n{\n args.opposedTest.swap(this.effect.label);\n}","Lpv2N9LK9loeumiW":"if (this.actor.uuid != this.effect.sourceActor.uuid)\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"hard\"}, context : {failure : `${this.effect.name}: cannot move or take actions`}}).then(test => {\n test.roll();\n })\n}","Lrb1S2aK7SFVD0C7":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n await args.actor.addCondition(\"fatigued\");\n }\n}","Lu27iXtJVkrJ8bOx":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"))","LxdLkPxH3SFvYrCJ":"if (args.effect.conditionId == \"ablaze\")\n{\n args.data.formula += ` - ${this.actor.system.characteristics.t.bonus}`\n}","LyAK0dVDS5L09yq2":"let caster = this.effect.sourceActor\n\nif (caster)\n{\n let bonus = caster.system.characteristics.wp.bonus\n this.actor.modifyWounds(bonus)\n\n this.script.scriptMessage(`${this.actor.prototypeToken.name} récupère ${bonus} Blessures`)\n}","M0XhKnWjG14pk3iH":"return !args.skill?.name.includes(\"Focalisation\") && args.type != \"channelling\" && args.skill?.name != game.i18n.localize(\"NAME.Charm\") && !args.skill?.name.includes(\"Langue (Magick)\") && args.type != \"cast\"","M2FshTX4PjKFVU8y":"args.flags.earCount = Number.isNumeric(args.flags.earCount) ? args.flags.earCount+1 : 1;\nif (args.characteristic == \"fel\")\n{\n\targs.fields.modifier -= 5;\n}\nif (args.flags.earCount == 2 && args.skill?.name == game.i18n.localize(\"NAME.Perception\"))\n{\n\targs.fields.modifier -= 20;\n}\n","M5bh0heeafA2fQQ8":"if (args.test.spell?.getFlag(\"wfrp4e\", \"boonOfTzeentch\"))\n{\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\n {\n this.script.scriptMessage(`${this.effect.name} s'efface de votre esprit et s'efface de votre grimoire !`)\n this.effect.sourceItem.delete();\n }\n}","M9VgeYGiUO97ZUW4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\nlet data = item.toObject();\ndata.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n\targs.actor.addCondition(\"unconscious\")\n}\n\n","MCK6WyjwYT28lsTN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.u0CFf3xwiyidD9T5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","MDLttXplnNthncGr":"return args.type == \"cast\" && [\"mort\", \"nécromancie\", \"vie\", \"lumière\", \"cieux\"].includes(args.spell?.system.lore.value)","MFKhU9vp8bQpHP3I":"let value = parseInt(this.item.specification.value)\nlet name = this.actor.prototypeToken.name\n\nif (game.user.isGM && game.user.targets.size)\n{\n game.user.targets.forEach(t => {\n t.actor.applyTerror(value, name)\n })\n game.user.updateTokenTargets([]);\n}\nelse \n{\n game.wfrp4e.utility.postTerror(value, name)\n}","MI2GgNi3fZtUCtQD":"return [\"int\", \"wp\"].includes(args.characteristic)","MJB6WbZSF6Briz30":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\")","MSJWJEUrX7ZmMvAD":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\"))","McLR9YcgVUG3MooC":"args.applyTB = false;","MfxWXZwaZUjGSBqw":"if (this.actor.hasCondition(\"ablaze\"))\n{\n this.script.scriptNotification(\"Immunisé à En Flammes\")\n await this.actor.hasCondition(\"ablaze\")?.delete()\n}","MfxzwJz2o9ho2hOM":"return args.skill?.name == \"Savoir (Apothicaire)\"","MgMMoC4Umpg7fmNI":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte ${this.item.name}.
\n Il ne peut plus lancer de Sorts ni effectuer de Prières ni Miracles.
\n S'il porte le masque pendant plus d'1 heure ou bénéficie de l'un de ses effets, il est exposé à un @Corruption[moderate]{Corruption Modérée}.\n `,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} sur ${this.actor.name} a été enlevé et à perdu ses propriétés. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils devront être supprimés manuellement.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n\n\n\n","MgTqCMRjxhezT73T":"return args.fields.hitLocation == \"head\" && args.weapon?.system.properties.qualities.pummel","MgZreqq3Jua10c8s":"return ![\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","Mhb67xufvA9uWO21":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\n\nif (attackerSize > actorSize)\n{\n args.actor.addCondition(\"prone\")\n this.script.scriptMessage(`Attaque Caudale: ${args.actor.prototypeToken.name} est désormais A Terre`)\n}","Mir4FMHQRdVqazAF":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\n\nif (attackerSize > actorSize)\n{\n let msg = `Attaque de Langue préhensile: ${args.actor.prototypeToken.name} est désormais @Condition[Empêtré]`;\n await args.actor.addCondition(\"entangled\");\n if (actorSize <= 2)\n {\n msg += `et @Condition[Engagé]`\n }\n this.script.scriptMessage(msg, {speaker : {alias: args.attacker.prototypeToken.name}})\n}","MkEcdViivk7abf1x":"args.actor.flags.meleeDamageIncrease += 1","MnXny8SCh6OceJc9":"return args.characteristic == \"int\"","MnqQkXVp20Lw84I1":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\nawait test.roll();\nif (test.failed)\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(3, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n}","Mp8UjuCLa9jdzhBS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n if (!this.actor.hasCondition(\"fatigued\"))\n {\n await this.actor.addCondition(\"fatigued\");\n }\n else\n {\n await this.actor.addCondition(\"blinded\");\n await this.actor.addCondition(\"deafened\");\n }\n \n if (((this.actor.hasCondition(\"blinded\").conditionValue || 0) + (this.actor.hasCondition(\"deafened\").conditionValue || 0)) > this.actor.system.characteristics.i.bonus)\n {\n await this.actor.addCondition(\"unconscious\"); \n }\n}","Msygc7oQQPB5fw0b":"let test = this.effect.sourceTest;\nif (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\n{\n\tlet points = await new Roll(\"1d10\").roll();\n\tgame.dice3d?.showForRoll(points)\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value + points.total})\n\tthis.script.scriptMessage(`Reçoit ${points.total} Point de Corruption`)\n}\nelse \n{\n\tlet points = this.effect.sourceTest.result.overcast.usage.other.current;\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value - points})\n\tthis.script.scriptMessage(`Perd ${points} Point de Corruption`)\n}","MwUzyAgd0yPnmZCH":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.klCJX0mNpXYH5AIx\")\nlet data = item.toObject(); \ndata.name = data.name.replace(\"Cible\", \"Strangers\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","Myl1Ishu9GBraYUZ":"this.actor.removeCondition(\"bleeding\")","N2MeOlf0GjPiRcSb":"let test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : \"Lâche l'objet\"}})\nawait test.roll();","N7nGncsPrTz2ZbDA":"return !args.options.dodge || !this.actor.isMounted","N8hA6ysHCTlLd8Kj":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 15,\n \"ag\" : 0,\n \"dex\" : 10,\n \"int\" : 15,\n \"wp\" : 15,\n \"fel\" : 0\n}\nlet skills = [\"Focalisation\", \"Calme\", \"Esquive\", \"Divertissement (Narration)\", \"Intuition\", \"Langue (Magick)\", \"Savoir (Magie)\", \"Perception\"]\nlet skillAdvancements = [5, 15, 10, 10, 15, 10, 10, 20]\nlet talents = [\"Magie des Arcanes\", \"Magie Mineure\", \"Seconde Vue\"]\nlet trappings = [\"Arme simple\", \"(2M) Bâton de combat\", \"Robe de rituel incorporant des ingrédients et des fétiches\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","N9kA46ZQ9LiRjy6T":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\");","NDvNGATDM2xPFJK0":"brokenbone = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\nteeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\ntongue = await fromUuid(\"Compendium.wfrp4e-core.items.rkJA1DlK51QuRlJy\")\nbrokenbone = brokenbone.toObject();\nteeth = teeth.toObject();\ntongue = tongue.toObject();\n\n\nlet roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData({flavor : \"Dents perdues\"}))\n\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\nbrokenbone.system.location.value = \"Jaw\"\nthis.actor.createEmbeddedDocuments(\"Item\", [brokenbone, teeth, tongue])\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"vhard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\")\n}","NNytXz5XFPrEF6dw":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n}\n ","NQSvFWhmBQAyx5Zz":"return args.item?.isRanged","Na7Nanl9YmxZlTo7":"return args.type != \"cast\" && args.type != \"channelling\")","NdquQqyuOkGCj8Uo":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nfear = fear.toObject();\nfear.system.specification.value = 1;\nacutesense = acutesense.toObject();\nacutesense.name += \" (Odorat)\";\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","NkqtQaLEGYst0PUO":"if (this.actor.has(\"Résistance à la Magie\", \"talent\")) \n return\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","NnA4zpuO6iUXKhH7":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Ranged\")))\n{\n let AP = parseInt(this.effect.sourceTest.result.SL)\n args.modifiers.ap.value += AP;\n args.modifiers.ap.magical += AP;\n args.modifiers.ap.details.push(`${this.effect.name} (${AP})`)\n}","NnDq4miIPNEtZUWb":"args.test.result.critModifier = args.test.result.critModifier || 0;\nargs.test.result.critModifier += 20;\n\nif (args.test.result.critical)\n{\n args.test.result.critical = `${game.i18n.localize(\"Critical\")} (+${args.test.result.critModifier})`\n}","NrVFrIXM8GnIbojv":"args.item.system.damage.value = `SB + ${this.actor.system.characteristics.fel.bonus}`;","O7lXFZLrLdFaShGR":"args.options.catfall = true;","O9fc0hLHdkTgSuLg":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet venom = await fromUuid(\"Compendium.wfrp4e-core.items.gFkRm9wS65qe18Xv\")\nlet biteData = bite.toObject();\nlet venomData = venom.toObject();\n\nbiteData.system.specification.value = 3 - this.actor.characteristics.s.bonus;\nvenomData.system.specification.value = \"Average\"\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, venomData], {fromEffect : this.effect.id})","OCFrGXAYfo9OYnhc":"return args.item?.system.magicMissile?.value || args.item?.system.attackType","OEy2lxvic37dRBEt":"let filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choisir 3 sorts de Magie Mineure\")\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"\"\n }\n]\n\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choisir 3 sorts d'Arcane\")\n\nlet items = petty.concat(arcane).map(i => i.toObject())\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","OGX4BneaYAnV25TO":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\nlet message = \"\"\n\nlet wounds = duplicate(this.actor.status.wounds)\nlet regenRoll = await new Roll(\"1d10\").roll();\nlet regen = regenRoll.total;\n\nif (wounds.value >= wounds.max)\n return\n\nif (wounds.value > 0) \n{\n wounds.value += regen\n if (wounds.value > wounds.max)\n {\n wounds.value = wounds.max\n }\n message += `${this.actor.name} récupère ${regen} Blessures.`\n\n if (regen == 10)\n {\n message += `
En plus, il guérit d'une Blessure Critique.`\nB }\n}\nelse if (regen >= 8) \n{\n message += `${this.actor.name} résultat de ${regen} et récupère 1 Blessure.`\n wounds.value += 1\n if (regen == 10)\n {\n message += `
En plus, il guérit d'une Blessure Critique.`\n }\n}\nelse \n{\n message += `${this.actor.name} Résultat de ${regen} - Aucun effet.`\n}\n\nawait this.actor.update({ \"system.status.wounds\": wounds })\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","OJMgS8ZQv0j4tEFf":"return [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","OMAUX1fnHyIpplul":"return ![\"fel\", \"dex\"].includes(args.characteristic)","OXoqtpOdfkURZbuL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","Oa9FmLXRRZRpLrrq":"let test = await this.actor.setupTrait(this.item); \nawait test.roll();","OcQe0zfksf1DCJYe":"args.actor.system.characteristics.s.value += 30\nargs.actor.system.characteristics.t.value += 30\n\nargs.actor.system.characteristics.s.bonus += 3\nargs.actor.system.characteristics.t.bonus += 3\n\nif (args.actor.system.characteristics.s.value > 100)\n{\n args.actor.system.characteristics.s.value = 100\n args.actor.system.characteristics.s.bonus = 10\n}\n\nif (args.actor.system.characteristics.t.value > 100)\n{\n args.actor.system.characteristics.t.value = 100\nargs.actor.system.characteristics.t.bonus = 10\n}","OeCgX3hIsfLfmGvC":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"))\nawait test.roll();\nif (test.succeeded)\n{\n this.actor.removeCondition(\"surprised\");\n}","OeKeQAAcJhdI4Qky":"if (this.actor.hasCondition(\"stunned\") || this.actor.hasCondition(\"unconscious\"))\n{\n\tthis.script.scriptNotification(\"Désactivé!\");\n\tawait this.effect.update({\"disabled\" : true})\n}","Ofn6vDbP3fZ4UlSc":"args.fields.modifier += -20;\n ","OgSI0Z6SHjYuqKIz":"let blows = this.item.getFlag(\"wfrp4e\", \"blows\") || 0\nlet difficulties = Object.keys(game.wfrp4e.config.difficultyLabels)\n\nblows = Math.clamped(blows, 0, difficulties.length - 1)\nif (this.item.system.protects[args.opposedTest.result.hitloc.value])\n{\n let difficulty = difficulties[blows];\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields: {difficulty}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.script.scriptMessage(`${this.actor.name} doit cesser le combat et fuir à moins de réussir un jet Intermédiaire (+0) de Force Mentale`);\n this.item.setFlag(\"wfrp4e\", \"failedCool\", true);\n }\n })\n}","OicQSEVZBbqLtrcf":"let choice = await ItemDialog.create(this.actor.itemTypes.critical, (this.effect.sourceTest.result.overcast.usage.other.current || 1), \"Choisissez la Blessure Critique à soigner (ne peut guérir les membres perdus)\")\n\nthis.script.scriptMessage(`Guéri de ${choice.map(i => i.name).join(`, `)}`);\nthis.actor.deleteEmbeddedDocuments(\"Item\", choice.map(i => i.id))","OnkEe4ISru1hjJWP":"this.actor.flags.useless[this.item.system.location.key] = true;","Op88kMtimSEWlY2h":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun disponible!\", \"error\")\n}","OqLKL0PiCvYH2QxW":"if (args.test.options.wallcrawler)\n{\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\n\t{\n\t\tif (parseInt(args.test.result.SL) < 0)\n\t\t{\n\t\t\targs.test.result.SL = \"+0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\n\t\t}\n\t\targs.test.result.outcome = \"success\"\n args.test.result.other.push(`${this.effect.name}: Minimum +0 DR`)\n\t}\n}","OqxeuZfZDfm9ax6h":"this.actor.system.status.addArmour(1, {locations : \"head\", source : this.effect})","OvIELZLvnlN2H2uw":"args.update({light : {\n \"dim\": 2,\n \"bright\": 1,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"pulse\",\n },\n \"color\": \"#949bff\",\n}});","OxsBnnVI3Smpknpb":"if (this.actor.status.advantage.value && !this.actor.sameSideAs(this.effect.sourceActor))\n{\n this.actor.modifyAdvantage(-1);\n this.script.scriptNotification(`${this.actor.name} perd 1 Avantage`);\n}","Oz7pWF9mEc1pQypj":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage({flavor : this.effect.name, speaker : {alias : this.actor.prototypeToken.name}})\nthis.actor.addCondition(\"stunned\", roll.total)","P29tT1eMMdAw3CPF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tthis.actor.addCondition(\"unconscious\")\n}","PBW6IZtwawNHxB6y":"return args.options.dodge && this.actor.isMounted","PI1QNaKFeqood6d7":"if (args.attackerTest.weapon && args.defenderTest.weapon)\n{\n\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\n \n if (attackerReach == defenderReach)\n attackerReach = attackerReach < 7 ? attackerReach + 1 : attackerReach\n\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\n\n args.attackerTest.weapon.reach.value = attackerReach\n args.defenderTest.weapon.reach.value = defenderReach\n}","PMISUsaEDBA7D3od":"// After consumption, the user gains the Magic Resistance 3 Creature Trait, \n// reducing the SL of any spell affecting it by 3. \n// This effect lasts for one hour.\nconst hasMagicResistance = this.actor.has(\"Résistance à la Magie\")\n\nif (hasMagicResistance === undefined) {\n fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\").then(trait => {\n let traitItem = trait.toObject()\n traitItem.system.specification.value = 2\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\n })\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} bénéficie du Trait Résistance à la Magie. Cet effet dure 1 heure.

`, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}\n\nif (hasMagicResistance) {\n // Multiple doses may be consumed at once, with each one adding an additional 1 to the Magic Resistance rating and increasing the duration by one hour. \n let msg = `

${this.actor.prototypeToken.name} a amélioré sa Résistance à la Magie de 1 pour atteindre ${parseInt(hasMagicResistance.system.specification.value)}. Cette effte dure 1 heure.

`\n\n // Resist toxic effect\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n fields: {difficulty: \"challenging\"}\n }).then(async test => {\n await test.roll()\n\n // If they fail ...\n if (!test.succeeded) {\n msg += `

Cependant, il commence à suinter la bave épaisse et venimeuse qui recouvre chaque Dreadmaw. Il reçoit 1 état Empoisonné et doit continuer à recevoir 1 état @Condition[Empoisonné] andà la fin de chaque round.

\n

Si le personnage est toujours vivant à la fin de 10 rounds, les effets cessent et tout les états Empoisonnés dues à ${this.effect.name} sont supprimés.

`\n this.actor.addCondition(\"poisoned\", 1)\n }\n this.script.scriptMessage(msg, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true })\n })\n}\n","PVjaKAHTKDA0rA9J":"let test = await this.actor.setupSkill(\"Esquive\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();","PdClojv7yNgQpOUc":"return args.skill?.name != game.i18n.localize(\"NAME.Endurance\");","PeZYj8b0vedyJj00":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\n\nlet mainEffect = this.item.effects.contents[0];\nif (mainEffect.name.includes(\"(Savoir)\"))\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choisissez le Savoir\");\n if (choice.length)\n {\n mainEffect.update({name : mainEffect.name.replace(\"Savoir\", choice[0].name)})\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\n }\n}\n\nthis.effect.delete();","Pg9C6nJX5QHIdqa9":"return !args.item?.system.attackType\n","Ph3TdQw1lGiFr049":" if (!args.test.context.phantasmal && \n (this.actor.isOpposing || args.test.context.defending) && \n args.test.result.roll % 11 == 0 && \n args.test.succeeded && \n [\"Langue (Magick)\", \"Esquive\"].includes(args.test.item?.name))\n {\n args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited\n let text = `${this.effect.name}: Ajout de Instable et Protection`\n args.test.result.other.push(text) \n this.script.scriptNotification(text);\n \n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\n let wardData = ward.toObject();\n wardData.system.specification.value = 9;\n \n let unstable = await fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\")\n let unstableData = unstable.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [wardData, unstableData], {fromEffect: this.effect.id})\n }\n","PjRxGuUDKGmSmVDc":"fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\").then(item => {\n item = item.toObject()\n item.system.specification.value = this.actor.characteristics.ag.value\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\n})","PmELrzD3RmF9qKkO":"if (this.item.system.specification.value == \"Size\")\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.actorSizes, this.item.img), 1, \"Choose Size\");\n if (choice[0])\n {\n this.item.updateSource({\"system.specification.value\" : choice[0].name})\n this.effect.updateSource({name : this.effect.name + ` (${choice[0].name})`})\n }\n}","PoNnT5EqvLj2r5yf":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","PwqTmw7rsG8hzqCS":"if (args.test.result.critical && args.test.result.roll % 10 == 0) \n{\n game.wfrp4e.tables.findTable(\"knuckleduster-diseases\").roll().then(roll => {\n let results = roll.results[0]\n\n this.script.scriptMessage(`${this.actor.name} subit @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n })\n\n }\n\n","Q1trEhtqjIiDvFPF":"args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')","Q4EQgP4gZR8TTm7S":"let penalty = 0\nif (args.item?.system.attackType)\n{\n penalty -= 30\n}\nif (args.actor.has(\"Seconde Vue\", \"talent\"))\n penalty += 10\n\nargs.prefillModifiers.modifier += penalty","Q68WiUWY7GxiXBbT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\nlet data = item.toObject();\ndata.system.specification.value = \"Lorsque seul\";\ndata.effects[0].disabled = true;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Q9EmlWmuDac83cJw":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","QF8LanKNoAlTkQG0":"this.actor.system.status.encumbrance.max += 2","QKTA2TqZ77pvHWSJ":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 0,\n \"bright\": 0,\n \"alpha\": 0.5,\n \"animation\": {\n \"type\": \"\",\n },\n \"color\": \"#000000\",\n }}));","QKjR6P1WEHXf4K77":"args.fields.slBonus -= 2\n","QPVVDPcJ4Xi5FmQl":"if(this.actor.hasCondition(\"fatigued\") && args.opposedTest.result.hitloc.value == \"head\" && (args.opposedTest.attackerTest.result.critical || args.actor.status.wounds.value - args.totalWoundLoss < 0))\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"unconscious\")\n }\n}","QQ2gHThZHdO4yLLX":"return args.skill?.name == game.i18n.localize(\"NAME.Swim\");","QQPiREc50HT5W2Tr":"if (args.item.type == \"weapon\" && args.item.weaponGroup.value == \"brawling\")\n args.item.damage.value += \" + 1\"","QRSACifDrvojIXHB":"if (!this.actor.effects.find(e => e.isCondition))\n{\n\treturn this.script.scriptNotification(\"Aucun état sur cet Acteur\")\n}\n\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choisissez un état\")\n\nif (choice[0])\n{\n\tthis.actor.removeCondition(choice[0].conditionId)\n}\n","QaGNsqKm2Nf0zGVm":"return [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","QbIYnshWeP1U8SUy":"args.applyAP = false;\nargs.applyTB = false;","Qgn92fZyc3Psn8QJ":"if (args.test.options.useOnesAttractive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\nif (ones > SL) {\n args.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`)\n }\n}","Qk7t2l5ep9RDVpgE":"args.options.diceman= true;","QoEOxRruQXYrZrv3":"let filters = [\n {\n property : \"type\",\n value : \"skill\"\n },\n {\n property : \"name\",\n value : /Melee/gm,\n regex: true\n }\n]\n\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, \"Choisissez 2 Compétences pour y ajouter +20\")\nitems = items.map(i => i.toObject())\nitems.forEach(i => i.system.advances.value = 20)\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","QqkE7rlqhkeRohFD":"return !([\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\"))","QqybHxNCzPEzG1Qh":"return args.fields.dualWielding || args.options.dualWieldOffhand","QwHoqu2oO8QO8Mad":"let content = `${this.effect.name}: Toute les cibles au contact abec ${this.actor.prototypeToken.name} subissent [[/r 1d10]] dégats, modifiés par le BE et les PA.`\n\nthis.script.scriptMessage(content)","R32U01LBjBrK1pns":" const templateMap = {\n 'P2e7Yx98bK3u110a' : \"\",\n 'iuMp3KLaMT2WCmie' : \"Xp4r2KUhqfjak8zq\", \n 'RBuYcT5tppwcmnC5' : \"wYN19h3WVF1yOVq2\", \n 'vcGpNwNbhvfzVveQ' : \"ac5ClOuaYtzOYyWp\", \n 'jmhKZy0w9TzkEK9c' : \"IS3LTdTuay6uRHUq\", \n '9Byj6k7SmdTYis2V' : \"LjMlx99gBGeRJUQu\", \n 'laJwc2l9tzJPgaaJ' : \"x5wpMprsObuqMCYg\",\n }\n let template = (await game.wfrp4e.tables.rollTable(\"hireling-templates\", {hideDSN: true})).object;\n let physicalQuirk = (await game.wfrp4e.tables.rollTable(\"physical-quirks\", {hideDSN: true})).text;\n let workEthic = (await game.wfrp4e.tables.rollTable(\"work-ethic\", {hideDSN: true})).text;\n let personalityQuirk = (await game.wfrp4e.tables.rollTable(\"personality-quirks\", {hideDSN: true})).text;\n\n\n let templateItem = await game.wfrp4e.utility.findItemId(templateMap[template._id]);\n\n let bio = \n `\n

Template: ${template.text}

\n

Bizarrerie Physique: ${physicalQuirk}

\n

Etique de travail: ${workEthic}

\n

Bizarrerie de personnalité: ${personalityQuirk}

\n `\n \n this.script.scriptMessage(bio, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n\n await this.actor.update({\"system.details.gmnotes.value\" : bio})\n\n if (templateItem)\n {\n this.actor.createEmbeddedDocuments(\"Item\", [templateItem.toObject()])\n }","R5dOZWFxE2n6tooX":"return this.item.system.usesLocation(args.weapon)","R6SnyF3y4Vsq6oga":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 1\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","R95pDZMHnD9iHAl8":"return args.skill?.name.includes(this.item.system.tests.value);","RDtJXji3hgcKnEBk":"let as = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\nlet hv = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR\")).toObject();\nlet ms = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.6w30u0VPsAicrqb5\")).toObject();\nlet ss = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2\")).toObject();\n\nas.name += \" (Vue)\";\n\nlet roll = (await new Roll(\"1d10\").roll());\nroll.toMessage(this.script.getChatData())\nlet items = []\n\nif (roll.total <= 2)\n{\n items = items.concat([as]);\n}\nelse if (roll.total <= 4)\n{\n items = items.concat([hv]);\n}\nelse if (roll.total <= 6)\n{\n items = items.concat([ms]);\n}\nelse if (roll.total <= 8)\n{\n items = items.concat([ss]);\n}\nelse if (roll.total <= 10)\n{\n items = items.concat([as, hv, ms, ss]);\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","RHyBLYT5oHf7EPnG":"let skills = this.actor.itemTypes.skill.filter(i => i.name.includes(game.i18n.localize(\"NAME.Melee\")))\n\nlet skill = await ItemDialog.create(skills, 1, \"Sélectionnez la compétence à utiliser avec l'arme\")\nlet group = game.wfrp4e.utility.extractParenthesesText(skill[0]?.name)\nlet groupKey = game.wfrp4e.utility.findKey(group, game.wfrp4e.config.weaponGroups)\n\nlet weapon = {\n\tname : this.effect.name,\n\ttype : \"weapon\",\n\timg : this.effect.img,\n\tsystem : {\n\t\t\"damage.value\" : this.actor.system.characteristics.wp.bonus,\n\t\t\"weaponGroup.value\" : groupKey || \"basic\",\n\t\t\"twohanded.value\" : [\"polearm\", \"twohanded\"].includes(groupKey),\n\t\t\"reach.value\" : \"average\",\n\t\t\"qualities.value\" : [{name : \"magical\"}]\n\t},\n}\n\nItem.implementation.create(foundry.utils.expandObject(weapon), {parent : this.actor, fromEffect : this.effect.id})\nthis.script.scriptNotification(\"Item créé. Les modifications supplémentaires doivent être réalisées manuellement sur la fiche de l'objet.\");","RI8crJxeD8JLDwMh":"return args.weapon?.system?.weaponGroup?.value != \"fencing\"","RJpglw5eVRM1f9t0":"args.wounds *= 5","RKIFGN583PQnqHGk":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 2)\n this.script.scriptMessage(\"Ajout de 2 état Hémorragiques\")\n}","RNHrSTfMLXm5sXkC":"return [\"ws\", \"bs\", \"s\", \"ag\"].includes(args.characteristic)","RNr9CwyvLhlnwD2h":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","ROXCqAFSTLouJniL":"if (args.test.spell.name == \"Warp Lightning\")\n{\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\n {\n this.script.scriptMessage(`${this.item.name} Surcharge!`)\n }\n}","RSsGiDFibuqg3sHr":"let diseaseIndex = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"disease\")\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(diseaseIndex , 1, \"Choisissez une maladie\")\n\nif (choice[0])\n{\n\tawait this.item.updateSource({\"system.specification.value\" : choice[0].name})\n}","RZlMkxJz5apn0mUj":"return args.item?.system.attackType != \"ranged\"","RprZWlnopSqZt7KZ":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","RqWnhnwFxaHubgiA":"await args.actor.addCondition(\"blinded\");\nawait args.actor.addCondition(\"deafened\");\nawait args.actor.addCondition(\"stunned\");","RrchOMpEdIvceJxl":"return args.skill?.name == \"Discrétion (Rurale)\"","RuW1PWUFxIbbSlIm":"return ![\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","RvipIYj9H7n4UDMe":" let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : -5,\n \"t\" : -5,\n \"i\" : -10,\n \"ag\" : -10,\n \"dex\" : -10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = []\n let skillAdvancements = []\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","S1QihXuvdEVzeRtB":"let dice = await new Roll(\"1d10\").roll()\nlet roll = dice.total\nlet talent \nlet message\nlet modifier = 0\n\nif (roll <= 3)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\n}\n\nelse if (roll <= 6)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.OEjUvJKi0xmBwbS2\")\n modifier = -3\n}\n\nelse if (roll <= 9)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mdPGZsn2396dEpOf\")\n modifier = -3\n}\n\nelse if (roll = 10)\n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\n modifier = -5\n}\n\nmessage = `Résultat de ${roll}, gagnez ${item.name}, ${modifier} en Force`\ndice.toMessage(this.script.getChatData())\n\nlet changes = duplicate(this.effect.changes)\nchanges[0].value = modifier\n\nthis.effect.updateSource({changes})\n\nawait this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})\n\nthis.script.scriptNotification(message)","S3DCTw4yJ85eSaKp":"this.actor.setupCharacteristic(\"s\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(test => test.roll())","S3Dev4hleOYqDNe9":"if (args.test.options.healWounds) {\n if (args.test.succeeded) \n {\n let wounds = this.actor.characteristics.int.bonus + Number(args.test.result.SL)\n if (args.test.options.fieldDressing && args.test.result.reversed)\n {\n wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL))\n }\n\targs.test.result.woundsHealed = wounds\n\targs.test.result.other.push(`${this.actor.name} guérit ${wounds} Points de Blessures du patient.`)\n }\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\n {\n args.test.result.other.push(`Le patient subit une @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Infection Mineure}.`)\n }\n}","S4793DLFhjMxpM8x":"return ![\"ws\", \"bs\"].includes(args.characteristic) && !args.item?.system.attackType && !args.options.dodge","S6tUyFJvGMV19mvP":"this.actor.status.addArmour(2, {source: this.effect})","S95QqpX1cZyIVCPy":"if (parseInt(this.item.system.specification.value) > 0)\n{\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\n}\n\n","SGr50Hq1AHIEzIFN":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\n int : game.wfrp4e.config.characteristics.int,\n fel : game.wfrp4e.config.characteristics.fel\n}, this.effect.img), 1, \"Choisissez une caractéristique\");\n\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","SLy1Fs3oXcHgFgjK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\nlet value = getProperty(this.effect.sourceTest, \"result.overcast.usage.other.current\") || 1\ndata.system.specification.value = value\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","SO4Aa9argKbuO9rQ":"args.prefillModifiers.modifier -= 20","SPOkFWZWziZk5b7A":"return args.item?.system?.attackType != \"melee\"","SRmfstEs278bP9Pz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","SSqGxyN9hw0HDmED":"this.actor.addCondition(\"prone\");","SWIJjM2RCmzfr64u":"if (args.test.result.hitloc.result == \"head\")\n{\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40\n\n args.test.result.critical += ` (+${args.test.result.critModifier})`\n}\n","SrCHfOJFZwDickqa":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","StAderQaQQsxb6Rv":"let target = await game.wfrp4e.tables.rollTable(\"fixations\")\nif (target)\n{\n this.script.scriptNotification(target.result);\n let hatred = this.actor.items.find(i => i.getFlag(\"wfrp4e\", \"fromEffect\") == this.effect.id)\n if (hatred)\n {\n hatred.update({\"system.specification.value\" : target.result})\n }\n}","SvFKt9hMcFQjeILA":"args.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","T5fiTzhXEQAv9Drf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rlDZZTj5PXjuRXa2\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key;\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n\nlet location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","T74FEjfFrh3f6MKv":"args.wpb = args.sb;","TAw9vXnfyIAl5DGs":"if (this.item.system.quantity.value)\n{\n game.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData());\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Quantité insuffisante!\", \"error\")\n}","TBpNFRL5uehs0fze":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[0]]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Quantité insuffisante!\", \"error\")\n}","TEiNj5FgkoD3YbhS":"this.actor.hasCondition(\"bleeding\")?.delete()","TGN070HeJLl3gSMY":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"Goes Prone\" }})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","TNWmIkuubqBn38he":"this.effect.deleteCreatedItems();","TOyQLrugFGzwc5nY":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption);","TQRL4mZhZohXg1Au":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\ntest.roll();","TU2xjbJ0zFtytF3J":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\");","TY0xSQ00XXyEr49r":"args.fields.slBonus += 1;","TcqumwUFAL6V0cty":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\n{\n this.item.system.AP = {\n \"head\": 0,\n \"lArm\": 0,\n \"rArm\": 0,\n \"lLeg\": 0,\n \"rLeg\": 0,\n \"body\": 0\n }\n}","TdjlJro0RRVSh8g8":"return args.skill?.name != game.i18n.localize(\"NAME.Gamble\") && args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\");","TmaS8o33825QUMrx":"let stomp = game.wfrp4e.config.systemItems.stomp;\nlet test = await this.actor.setupTrait(stomp)\nawait test.roll();","TnFobCxG4pxlYmKr":"let gorCharacteristics = {\n \"ws\": 45,\n \"bs\": 30,\n \"s\": 35,\n \"t\": 45,\n \"i\": 30,\n \"ag\": 35,\n \"dex\": 25,\n \"int\": 25,\n \"wp\": 30,\n \"fel\": 25\n}\nfor (let char in this.actor.characteristics) {\n if (this.actor.characteristics[char].initial < gorCharacteristics[char])\n this.actor.characteristics[char].initial = gorCharacteristics[char]\n}","ToKlHDAjJOsC51ag":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"unconscious\")\n}","TpZItJ5Ugbazaobd":"let locations = [];\n\nwhile (locations.length < 2)\n{\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\n if (!locations.includes(loc.result))\n {\n locations.push(loc.result);\n }\n}\n\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\n\nthis.item.updateSource({name : this.item.name += ` (${locationText})`, \"flags.wfrp4e.locations\" : locations})\nthis.effect.updateSource({\"flags.wfrp4e.locations\" : locations})","Tq45Nd8J3eTvHT41":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.SetTrap\");","TrIYdcG3jDER4WgY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xsGbDFqK2qh7lsIj\")\nlet data = item.toObject();\ndata.system.specification.value = \"Minor\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","TwgdEucxcHloc4cX":"let choice1 = [\n {\n type: \"armour\",\n name: \"Chausses de Mailles\"\n },\n {\n type: \"armour\",\n name: \"Cotte de Mailles\"\n },\n {\n type: \"armour\",\n name: \"Coiffe de Mailles\"\n },\n]\nlet choice2 = [\n {\n type: \"armour\",\n name: \"Chausses de Mailles\"\n },\n {\n type: \"armour\",\n name: \"Cotte de Mailles\"\n },\n {\n type: \"armour\",\n name: \"Coiffe de Mailles\"\n },\n {\n type: \"armour\",\n name: \"Jambières de Cuir\"\n },\n {\n type: \"armour\",\n name: \"Calotte de Cuir\"\n },\n {\n type: \"armour\",\n name: \"Veste de Cuir\"\n },\n]\nlet choice3 = [\n {\n type: \"armour\",\n name: \"Plastron d'acier\"\n },\n {\n type: \"armour\",\n name: \"Brassards\"\n },\n {\n type: \"armour\",\n name: \"Heaume\"\n },\n {\n type: \"armour\",\n name: \"Jambières d'acier\"\n },\n]\n\nlet choice = await new Promise((resolve, reject) => {\n new Dialog({\n title: \"Choix\",\n content:\n `

\n Selectionnez votre choix\n

\n
    \n
  1. Mailles
  2. \n
  3. Mailles & Cuir
  4. \n
  5. Plates
  6. \n
\n `,\n buttons: {\n 1: {\n label: \"Mailles\",\n callback: () => {\n resolve(choice1)\n }\n },\n 2: {\n label: \"Mailles & Cuir\",\n callback: () => {\n resolve(choice2)\n }\n },\n 3: {\n label: \"Plates\",\n callback: () => {\n resolve(choice3)\n }\n }\n }\n }).render(true)\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice) {\n let existing\n if (c.type == \"skill\") {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value) {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing) {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item) {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${c.name}`, { permanent: true })\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item) {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","TwwKxFjK6TNGKbRB":"this.script.scriptMessage(await this.actor.applyBasicDamage(12, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addSystemEffect(\"cold1\")\n}\n\n","TxfmxDGBj04AQQpt":"let weapon = args.opposedTest.defenderTest.weapon\nif (\n !args.opposedTest.result.swapped && \n args.opposedTest.result.winner == \"defender\" && \n args.opposedTest.attackerTest.result.damage && \n weapon && \n weapon?.system.properties.qualities.fast\n )\n{\n args.opposedTest.swap(this.effect.label);\n}","TzgmYRXFXRspIo1i":"this.effect.delete();","U1RUcgP8LD2qeGTm":"return !args.options.reload","U1UpSRJOSjPpO4HS":"let mutations = await game.wfrp4e.utility.findAll(\"mutation\", \"Chargement des mutations\")\nlet roll = Math.floor(CONFIG.Dice.randomUniform() * mutations.length);\nthis.actor.createEmbeddedDocuments(\"Item\", [mutations[roll]]);\nthis.script.scriptNotification(`Ajout ${mutations[roll].name}`)","U26XMie3Kjoddisj":"let stunned = this.actor.hasCondition(\"stunned\")\nif (stunned)\n{\n this.script.scriptNotification(`Suppression de 1 état Assomé`)\n this.actor.removeCondition(\"stunned\");\n}\nelse \n{\n\tthis.script.scriptNotification(`Aucun état Assomé`)\n}","U2xKn7R1gm8kiQm8":"this.actor.hasCondition(\"broken\")?.delete();\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","U4A8FDNmwBGTuQZO":"if (args.attacker.has(\"Mort-vivant\") && !args.attacker.has(\"Ethéré\"))\n{\n args.totalWoundLoss = Math.floor(args.totalWoundLoss / 2)\n args.modifiers.other.push({label : this.effect.name, details : \"Divisé par deux\", value : \"× 0.5\"})\n}","U5ndCwcJ1s3Ns26w":"args.item.system.qualities.value.push({name : \"magical\"});\nargs.item.system.damage.value += ` + ${parseInt(this.effect.sourceTest.result.SL)}`;\nargs.item.name += ` (${this.effect.name})`","U78c4oUjKwyUu6jT":"return (args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.characteristic != \"fel\")","U9xh2wriSqCosugW":"if (args.test.options.stag)\n{\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\n\t{\n\t\tif (parseInt(args.test.result.SL) < 0)\n\t\t{\n\t\t\targs.test.result.SL = \"+0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\n\t\t}\n\t\targs.test.result.outcome = \"success\"\n args.test.result.other.push(`${this.effect.name}: Minimum +0 DR`)\n\t}\n}","UC6G3pFQwzUhrw6F":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\");","UH5MIzqi2MvEqTwj":"if (args.totalWoundLoss > 0)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData());\n args.totalWoundLoss += roll.total;\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\n}","ULmZMLezDamerN04":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\")\n\nlet lore = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).text\nthis.script.scriptNotification(lore)\nif (lore == \"Au choix\") {\n return\n}\n\nelse if (lore == \"Magie des Arcanes\") {\n lore = \"Arcane\"\n}\n\nelse if (lore == \"Magie Mineure \") {\n lore = \"petty\"\n}\n\nelse {\n lore = lore.toLowerCase();\n}\n\nlet spellsWithLore = []\nif (lore == \"Arcane\") {\n spellsWithLore = spells.filter(i => !i.system.lore.value)\n}\nelse {\n spellsWithLore = spells.filter(i => i.system.lore.value == lore)\n}\n\nlet selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\nItem.implementation.create(selectedSpell.toObject(), { parent: this.actor}).then(item => {\n this.actor.setupCast(item).then(test => test.roll());\n})","UTlgF4azrGQZsoDv":"const talents = await Promise.all([\"Ambidextre\", \"Distraire\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","UWrzokgabRKUpnkG":"return [\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","UYLXm2W6jVn21Age":"args.fields.modifier += 40;","UaImulhbPURkLJg2":"return this.actor.attacker && (args.skill?.name.includes(\"Corps à corps (Bas)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","UgQW0UMPOZ0jwfVJ":"let current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : 1 + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses Points de Chance augmenter de ${current} à ${1 + current}`)","Um6xMMiUftLXJxEt":"return [\"fel\", \"dex\"].includes(args.characteristic)","UnqnWi0dZYLf5fTT":"let choice1 = [\n {\n type : \"armour\",\n name : \"Chausses de Mailles\"\n },\n {\n type : \"armour\",\n name : \"Cotte de Mailles\"\n },\n {\n type : \"armour\",\n name : \"Coiffe de Mailles\"\n },\n]\nlet choice2 = [\n {\n type : \"armour\",\n name : \"Chausses de Mailles\"\n},\n{\n type : \"armour\",\n name : \"Cotte de Mailles\"\n},\n{\n type : \"armour\",\n name : \"Coiffe de Mailles\"\n},\n{\n type : \"armour\",\n name : \"Jambières de Cuir\"\n },\n {\n type : \"armour\",\n name : \"Calotte de Cuir\"\n },\n {\n type : \"armour\",\n name : \"Veste de Cuir\"\n },\n]\nlet choice3 = [\n {\n type : \"armour\",\n name : \"Plastron d'acier\"\n },\n {\n type : \"armour\",\n name : \"Brassards\"\n },\n {\n type : \"armour\",\n name : \"Heaume\"\n },\n {\n type : \"armour\",\n name : \"Jambières d'acier\"\n },\n]\n\nlet choice = await Dialog.wait({\n title : \"Choix\",\n content : \n `

\n Sélectionnez votre choix\n

\n
    \n
  1. Mailles
  2. \n
  3. Mailles & Cuir
  4. \n
  5. Plates
  6. \n
\n `,\n buttons : {\n 1 : {\n label : \"Mailles\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Mailles & Cuir\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"Plates\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${c.name}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","UsAHQecRlWL5PhP6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.corruptionDialog(\"moderate\") \n }\n})","UsuwsmU1TUQLQVM2":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\nreturn !args.spell || (args.type == \"cast\" && [\"petty\", lore].includes(args.spell.system.lore.value));","UvycHOjSPm5Zv9KJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nlet baseDamage = \"4\";\nif (test.succeeded)\n baseDamage = \"0\";\n \nlet damage = this.effect.sourceItem.system.computeSpellDamage(baseDamage, true) + parseInt(this.effect.sourceTest.result.SL);\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg : true}))\nthis.actor.addCondition(\"ablaze\")","UwjkHRAQHESdYXJs":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 2,\n \"bright\": 1,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"pulse\",\n },\n \"color\": \"#949bff\",\n}}));","Ux4buMc7llF1Kg8p":"if (!this.actor.hasCondition(\"stunned\") && !this.actor.hasCondition(\"unconcscious\"))\n{\n this.effect.delete();\n}","V1D2Uo3WDKYQePU3":"let damage = this.effect.sourceTest.result.damage;\n \nlet loc = \"head\"\nlet APatLoc = this.actor.system.status.armour[loc];\n\nlet metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\n\nlet APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\n\ndamage -= (APused + this.actor.system.characteristics.t.bonus)\n\nlet msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\nmsg += ` (ignore ${metalAP} PA métalliques sur ${game.wfrp4e.config.locations[loc]})`\nthis.script.scriptMessage(msg)\n","V2lsVTi6q28eL5jl":"args.fields.slBonus += parseInt(this.effect.sourceTest.result.SL)","V7qmFwUMCY2tfziH":"this.actor.addCondition(\"stunned\")","V9wD9FWHWxZUOGSI":"let roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\nlet fatigued = roll.total\nroll.toMessage(this.script.getChatData());\nif (fatigued > this.actor.characteristics.wp.bonus)\n{\n this.actor.addCondition(\"unconscious\")\n this.script.scriptNotification(`Tombe Incoscient`)\n}\nelse \n{\n fatigued = Math.max(0, fatigued)\n if (fatigued)\n this.actor.addCondition(\"fatigued\", fatigued)\n this.script.scriptNotification(`Subit ${fatigued} état Fatigué`)\n}","V9xm4X1x3lPYTQaI":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\tthis.script.scriptNotification(\"Immunisé à la Peur\");\n\targs.extendedTest.delete();\n\targs.abort = true;\n}","V9zm2hKUVLVZtAcN":"let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : 0,\n \"t\" : 15,\n \"i\" : 15,\n \"ag\" : -20,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charme\", \"Focalisation\", \"Divertissement (Prophecie)\", \"Intuition\"]\nlet skillAdvancements = [0, 0, 20, 10]\nlet talents = [\"Détection d’artefact\", \"Menaçant\", \"Sixième Sens\"]\nlet traits = [\"Destinée\", \"Lanceur de sorts (Domaine de la Vie)\", \"Protection\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Forêt d'épines\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","VAPsww9x3HAw1sKP":"return !args.options.dodge","VAs1nXvicdQK18Do":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","VKpKq4RSbI1KkUQK":"this.actor.flags.useless[this.effect.getFlag(\"wfrp4e\", \"location\")] = true;","VNOKTzCrFbZ6PJUj":"return ![\"Emprise sur les animaux\", \"Résistance\", \"Survie en extérieur\"].includes(args.skill?.name)","VQaC6ynouW5EQCbC":"let roll = await new Roll(\"1d10\").roll();\n\nawait roll.toMessage(this.script.getChatData());\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}));\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\nawait test.roll();\n\nif (test.succeeded)\n{\n return false;\n}","Vb7rgl8T4VRswbnZ":"this.actor.status.addArmour(parseInt(this.item.system.specification.value) || 0, {source: this.effect, damage : this.item.getFlag(\"wfrp4e\", \"APdamage\")})","VbL0TgaBAmYjrezZ":"const talents = await Promise.all([\"Dur à cuire\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","Vkuu70BZV4DPYO2Q":"return args.item?.system?.attackType != \"ranged\"","VlFUDaKUYoBYKYn0":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gain d'1 Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","VqTrKPtxv9hpn0Hr":"return args.skill?.name != \"Langue (Magick)\"","VuE1mhrB6X6MYTzg":"return args.characteristic == \"fel\"","VurA2XNqC0d9U49C":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"fatigued\") \n }\n})","VzO0ZDcTWvaBn4vm":"if (args.test.preData.skillName?.includes(game.i18n.localize(\"NAME.Language\")) || args.test instanceof CastTest)\n{\n\tif (parseInt(args.test.result.SL) > 0 || args.test.succeeded)\n\t{\n\t\tif (parseInt(args.test.result.SL) > 0)\n\t\t{\n\t\t\targs.test.result.SL = \"-0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalFailure\");\n\t\t}\n\t\targs.test.result.outcome = \"failure\"\n args.test.result.other.push(`${this.effect.name}: Maximum -0 DR`)\n\t}\n}","VzgTGb5QXKoyPNh3":"if (args.attackerTest.weapon && args.defenderTest.weapon)\n{\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\n \n if (attackerReach == defenderReach)\n defenderReach = defenderReach < 7 ? defenderReach + 1 : defenderReach \n\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\n\n args.attackerTest.weapon.reach.value = attackerReach\n args.defenderTest.weapon.reach.value = defenderReach\n}","W9nyUNQStMr1pUHJ":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Ajout de Hémorragique\");\n}\n","WB6sIpLEPC8YPX67":"if (args.options.dodge)\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"Ne peut pas esquiver!\")\n}\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","WKXyVHQwQCNTfSKv":"if ((args.item.type == \"weapon\" || args.item.system.attackType) && !args.item.isMagical )\n{\n args.item.system.qualities.value.push({name : \"magical\"})\n}","WO5n7Vbx8AgoVrwC":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let skills = [\"Intuition\", \"Savoir (Local)\", \"Perception\"]\n let skillAdvancements = [10, 10, 10]\n let talents = []\n let trappings = [\"Cotte de Mailles\", \"Chausses de Mailles\", \"Coiffe de Mailles\", \"Arme simple\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","WPQbVpD1uwSLAXq1":"if (this.actor.system.status.wounds.value == 0)\n{\n\tthis.actor.addCondition(\"dead\");\n}","WRe1eGmGVGejPcS8":"let wind = this.effect.name.split(\" \")[2]\nreturn args.type == \"cast\" && game.wfrp4e.config.magicWind[args.item.system.lore.value] == wind;","WTRYAEzwxRuGENyI":" // Every living creature within 10 yards, other than the wielder of the hammer,\n // must make a Challenging (+0) Endurance Test \n\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true, appendTitle : \" - \" + this.effect.name,\n fields: {difficulty: \"challenging\"}\n })\n \n await test.roll();\n if (test.failed)\n {\n // or gain a Deafened Condition \n this.actor.addCondition(\"deafened\");\n // and suffer 1d10 Wounds which bypass armour but not Toughness Bonus.\n let damage = (await new Roll(\"1d10\").roll());\n await damage.toMessage(this.script.getChatData());\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n }","WY3DajPRGcMNt158":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","WiYtNU2Y5BJfIpeM":"let location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","WnWA0e0bgqBsZp2L":"this.item.update({\"system.twohanded.value\" : !this.item.system.twohanded.value})","Wo4wQKUxSItAhRzZ":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\n\n// If channelling corresponding lore\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\n args.prefillModifiers.slBonus += 3\n// If channelling or casting different lore\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\n args.prefillModifiers.slBonus -= 1","WwxXgsNxlccmqTze":"this.actor.addCondition(\"dead\")","WzMmwjZbhyCbHxyZ":"this.actor.status.encumbrance.state += 2\nthis.actor.status.encumbrance.pct = 100;","X3bLbOfcJAftOMa7":"return [\"ws\", \"bs\", \"ag\"].includes(args.characteristic)","X7ikFOGKYzTMr4d1":"args.fields.difficulty = \"difficult\"","XClTZOjuhcxWLF51":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"difficult\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}\n\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.4lj1ik958mbgAlaF\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","XO9m2AvFRAAeEuty":"if (args.test.options.fieldDressing && args.test.result.reversed)\n{\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\n\targs.test.result.other.push(`${this.effect.name}: DR limité à 1`)\n}","XPxAKqPpPYE4E6B5":"args.fields.modifier -= 10 * this.effect.conditionValue","XRrGBbplNLZpXnCH":"let item;\nlet items = []\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\n{\n let data = item.toObject();\n data.system.specification.value = 2\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\n{\n let data = item.toObject();\n data.system.specification.value = 1;\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\n{\n let data = item.toObject();\n data.system.specification.value = 1;\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.mDgEMOoJpi8DkRYb\")\n{\n let data = item.toObject();\n items.push(data)\n}\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\n{\n let data = item.toObject();\n data.system.specification.value = 2;\n items.push(data)\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\n","XXnzUdsIYQ9Wjyu0":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale || this.actor.sameSideAs(this.effect.sourceActor)","XYaYeiVkc5GKYTjC":"return args.spell?.system.lore.value != \"fire\"","XcvDYNZgJ2rpAdDV":"\nlet fatigued = this.actor.hasCondition(\"fatigued\")\nif (!fatigued) {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Etat Fatigué ajouté à \" + this.actor.name + \" qui ne peut être enlevé tant que le symptôme de Malaise est présent.\")\n}","Xe8ijqWU3bbtq7ZY":"if (args.opposedTest.defenderTest.actor.Species.toLowerCase().includes(\"skaven\"))\n{\n args.addImpact = true;\n args.opposedTest.result.other.push(\"Impact contre les Skavens\")\n}","Xf4FcZ4ZLdWmOXBa":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","XfRvVBTVIuAm8RaZ":"return args.item?.name != game.i18n.localize(\"NAME.CharmAnimal\")","Xg4qHLsyXGuUZfT8":"this.actor.hasCondition(\"ablaze\")?.delete();","Xk9XPklxxTvFlwpI":"args.options.useOnesArgumentative = true;","XthZ3GCC3WhsEI2g":"args.update({light : {\n \"dim\": 10,\n \"bright\": 5,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 4,\n \"intensity\": 4,\n \"type\": \"flame\",\n },\n \"color\": \"#ac9e6c\",\n}});","Xu5cED1MhT4ba7da":"args.fields.modifier += 10\n","XuFxKPYheYF4WMmQ":"return args.skill?.name != game.i18n.localize(\"NAME.Cool\");","Y6ppJBerpM3TtSic":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.g4Q6AtzZuo5iIvD4\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","Y7McxsHFeGhwQx0J":"this.actor.createEmbeddedDocuments(\"Item\", [expandObject({\n name : \"Ghostly Flame\",\n type : \"weapon\",\n img : this.effect.img,\n system : {\n \"weaponGroup.value\" : \"throwing\",\n \"damage.value\" : \"SB + WPB\",\n \"qualities.value\" : [{name : \"magical\"}],\n \"equipped\" : true\n }\n})], {fromEffect: this.effect.id})","Y8J66v8VTKUASGuK":"if (!this.actor.effects.find(e => e.isCondition))\n{\n\treturn this.script.scriptNotification(\"Aucun état sur cet acteur\")\n}\n\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choisissez un état\")\n\nif (choice[0])\n{\n\tawait this.actor.removeCondition(choice[0].conditionId)\n}\n\nif (this.actor.effects.find(e => e.isCondition))\n{\n return false; // Delete the effect if there are still conditions, otherwise, effect remains and provides the bonus\n}","YDqpKJVy8ijEKdLX":"return !(this.actor.attacker && (args.skill?.name.includes(\"Corps à corps (Base)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\")))","YEBw2CzHYxsTpTy5":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\");","YFSgWRXel0bWE3EE":"return [\"ag\", \"ws\", \"bs\"].includes(args.characteristic) || args.skill?.name == game.i18n.localize(\"NAME.Climb\");","YHEIkBKWXKNPqglh":"if (args.test.result.castOutcome == \"success\")\n{\n game.wfrp4e.utility.postCorruptionTest(\"moderate\", this.script.getChatData())\n}\n","YMaxpXnml01bLGpO":"return args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","YOKoZFlBEpFavfOS":"return args.type == \"channelling\"","YQ2LnLxp0xgy3meI":"if (args.test.preData.options?.corruption && args.test.failed) {\n args.test?.result?.other.push(\"Reçoit 1 Point de Corruption de \" + this.effect.name)\n}","YRUTliBzAQvncGNX":"this.actor.addCondition(\"fatigued\");\nthis.script.scriptNotification(\"Ajout de Fatigué\")","YaKnYEbmmZZtByJc":"if (args.opposedTest.attackerTest.options.ballockKnife)\n{\n args.weaponProperties.impale = true;\n args.extraMessages.push(`${this.item.name}: Ajout de Empalement`)\n}","Yf2MmOzazzMdmoPU":"let armour = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\nlet armourData = armour.toObject()\narmourData.system.specification.value = 1\n \nlet fury = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\nlet furyData = fury.toObject();\n\nlet horns = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet hornsData = horns.toObject()\nhornsData.system.specification.value = 6\n\nthis.actor.createEmbeddedDocuments(\"Item\", [armourData, furyData, hornsData], {fromEffect : this.effect.id})","YhhiWEQbox3WZA3Q":"return args.skill?.name == game.i18n.localize(\"NAME.Heal\") && game.combat?.active","YjAIsFlxKTJvYs60":"this.item.system.reduceQuantity();","YjJcRdytVRm88qLn":"args.options.additionalDamage = 1","YsS2RZsl2ZsqjhWV":"return !args.fields.charging","YwLEw4BiKq4EMy57":"let i_gain = (await new Roll(\"2d10\").roll()).total\nlet fel_gain = 0\nif (args.actor.characteristics.fel.value <= 0)\n{\n fel_gain += (await new Roll(\"2d10\").roll()).total\n}\n\nlet msg = `${this.actor.prototypeToken.name} gagne ${i_gain} en Intelligence`\n\nif (fel_gain)\n msg += ` et ${fel_gain} en Sociabilité`\n\n\nlet newInt = i_gain + args.actor.characteristics.int.modifier\nlet newFel = fel_gain + args.actor.characteristics.fel.modifier\n\nargs.actor.update({\"system.characteristics.int.modifier\" : newInt, \"system.characteristics.fel.modifier\" : newFel})\n\nthis.script.scriptMessage(msg)","YyKU2rIRmFSCqSlW":"let newEffect = this.effect.sourceItem.effects?.contents[1]\n\nif (newEffect)\n{\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [newEffect.convertToApplied()]);\n}","Z1zriXibT0mAmdhb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nitem = item.toObject()\nitem.name = this.effect.name\nitem.system.specification.value = this.actor.characteristics.s.bonus\nitem.system.description.value = \"\"\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","Z30zYayPryXOjT5N":"args.item.system.damage.value = \"SB + 6\";","Z4WrrlVGpPY4iUbG":"await this.actor.addCondition(\"ablaze\")","Z52yZDm6lP6fOP3O":"let ablaze = this.actor.hasCondition(\"ablaze\")\nif (ablaze)\n{\n this.script.scriptNotification(\"Immunisé à En Flammes\");\n ablaze.delete()\n}","Z6OmmC0irJzxSnMH":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\nlet message = \"\"\n\nlet wounds = duplicate(this.actor.status.wounds)\nlet regenRoll = await new Roll(\"1d10\").roll();\nlet regen = regenRoll.total;\n\nif (wounds.value >= wounds.max)\n return\n\nif (wounds.value > 0) \n{\n wounds.value += regen\n if (wounds.value > wounds.max)\n {\n wounds.value = wounds.max\n }\n message += `${this.actor.name} guérit de ${regen} Points de Blessure.`\n\n if (regen == 10)\n {\n message += `
De plus, il guérit d'une Blessure Critique.`\n }\n}\nelse if (regen >= 8) \n{\n message += `${this.actor.name} a obtenu un ${regen} et guérit 1 Point de Blessure.`\n wounds.value += 1\n if (regen == 10)\n {\n message += `
De plus, il guérit d'une Blessure Critique.`\n }\n}\nelse \n{\n message += `${this.actor.name} Regenerate roll of ${regen} - No effect.`\n}\n\nawait this.actor.update({ \"system.status.wounds\": wounds })\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n\nif (this.actor.Species?.toLowerCase() != \"ogre\")\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}}).then(test => {\n test.roll()\n })\n}\n\n\n\n\n\n\n\n\n\n\n\n\n","Z6jNlyZMECkW4Hon":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\", true);\n\nlet choice = await ItemDialog.create(spells, 1);\n\nif (choice[0])\n{\n this.script.scriptMessage(`Choisir @UUID[${choice[0].uuid}]{${choice[0].name}}`)\n let spell = (await fromUuid(choice[0].uuid)).toObject(); // Might be an index so retrieve item object for sure\n setProperty(spell, \"flags.wfrp4e.boonOfTzeentch\", true);\n spell.system.wind.value = \"Focalisation (Dhar)\";\n spell.system.memorized.value = true;\n this.actor.createEmbeddedDocuments(\"Item\", [spell], {fromEffect: this.effect.id})\n}","ZCkYe5XMVY1RWMXG":"args.options.wallcrawler = true;","ZCrfdLPOxiNDCDSg":"this.actor.effects.get(this.effect.id).delete(); // can't use this.effect because it thinks it's parent is the item, but it actually is the actor","ZCuOjLAeENKN1Q4L":"let halve;\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\n{\n halve = await Dialog.confirm({title : this.effect.name, content : \"Diviser les Dégâts? (Divise les dégats de Feu)\"})\n}\nelse\n{\n halve = args.opposedTest.attackerTest.item?.system.lore?.value == \"fire\";\n}\n\nif (halve)\n{\n args.totalWoundLoss /= 2;\n args.modifiers.other.push({label : this.effect.name, details : \"Divisé\", value : \"× 0.5\"})\n}","ZEXhYJqqxF6QAixX":"return args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","ZEdDcBka21rnMuz5":"let initiativeSetting = game.settings.get(\"wfrp4e\", \"initiativeRule\")\n\nswitch (initiativeSetting) {\n case \"default\":\n args.initiative += \"+10\"\n break;\n\n case \"sl\":\n args.initiative += \"+1\"\n break;\n\n case \"d10Init\":\n args.initiative += \"+10\"\n break;\n\n case \"d10InitAgi\":\n args.initiative += \"+1\"\n break;\n}","ZGlJnrIemqul24j7":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet biteData = bite.toObject();\nlet infectedData = infected.toObject();\n\nbiteData.system.specification.value = 4 - this.actor.characteristics.s.bonus\n\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, infectedData], {fromEffect : this.effect.id})","ZI2YnAAGoLpmVDIL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\nlet data = item.toObject();\ndata.system.specification.value = \"Religion\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZJy2rvpKmUHXGrAi":"args.actor.details.move.run *= 1.5","ZMwJad6v4G13SgjR":"return args.type == \"cast\" || args.type == \"channelling\"","ZNW3ubbKIYXAyE48":"let wounds = this.actor.itemTypes.disease.filter(i => i.name == \"Blessure Purulente\" && i.system.duration.active);\nlet selected;\nif (wounds.length == 0)\n{\n return this.script.scriptNotification(\"Aucune Blessure Purulente!\");\n}\nelse if (wounds.length == 1)\n{\n selected = wounds[0];\n}\nelse if (wounds.length >= 2)\n{\n selected = (await ItemDialog.create(wounds, 1))[0];\n}\n\nif (selected)\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}})\n await test.roll();\n if (test.succeeded)\n {\n let SL = parseInt(test.result.SL);\n if (SL >= 0)\n {\n selected.update({\"system.duration.value\" : selected.system.duration.value - SL})\n this.script.scriptMessage(`${selected.name} durée réduite de ${SL}!`)\n }\n }\n}","ZNu4B0OdjkM9lmtu":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\nlet data = item.toObject();\ndata.name = data.name += \" (Vue)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZTE8LdRblyG4yYoE":"if (args.test.result.castOutcome == \"success\")\n{\n // Wait till after chat card is posted\n game.wfrp4e.utility.sleep(500).then(() => {\n game.wfrp4e.utility.postTerror(1, this.effect.name)\n game.wfrp4e.utility.postTerror(2, this.effect.name)\n })\n}","ZYsMgB4BwXBJcpYf":"// The wearer of the cloak causes Fear 2 \n// in Wolves, Lions, Goats, and Chimeras.\ngame.wfrp4e.utility.postFear(2, this.effect.name)\n","ZbuW8y7t9Y8oUFWq":"return !((args.type == \"weapon\" && (args.item.system.weaponGroup.value == \"blackpowder\" || args.item.system.weaponGroup.value == \"engineering\")) || (args.type == \"cast\" && args.item.system.lore.value == \"fire\"))","ZdHvGvSJBsIuPphF":"return !args.fields.dualWielding && !args.options.dualWieldOffhand","Ze9E2zR1GFGWGMVH":"return [\"Crochetage\", \"Escamotage\", \"Focalisation (Ulgu)\"].includes(args.skill?.name)","ZhuitY1KOU1Xe7cP":"return !args.weapon?.system.properties.qualities.pummel","ZqTW093qENOwGONP":"let msg = \"\"\n\nlet SL = parseInt(this.effect.sourceTest.result.SL);\n\nfor(let i = 0; i < SL; i++)\n{\n msg += `

${await this.actor.applyBasicDamage(3, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP})}

`\n}\n\nthis.script.scriptMessage(msg);","ZrePyV2spv3v65Tg":"return args.type != \"weapon\" && !this.actor.statuses.has(\"infighting\")","ZsQR3AVKi0v5U593":"args.actor.addCondition(\"ablaze\", 2)","ZvbBM4gTJHPdU8jU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nreturn test.failed","Zxh4RAENoaAQAaNg":"return !this.actor.flags.useless.rEye || !this.actor.flags.useless.lEye || [\"wp\", \"t\", \"s\"].includes(args.characteristic)","ZxtOdwsM2Sqj9Zam":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.system.specification.value = 0\ndata.name = this.effect.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","a02tlRCXpaoaDjSN":"let careers = await game.wfrp4e.utility.findAll(\"career\", \"\", true);\ncareers.forEach(c => {\n if (!c.id)\n {\n c.id = c._id;\n }\n});\nlet choice = await ItemDialog.create(careers, 1, \"Choisissez la carrière de votre double identité\");\nif (choice[0])\n{\n let career = await fromUuid(choice[0].uuid);\n let data = career.toObject();\n setProperty(data, \"flags.wfrp4e.doubleLife\", true);\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n this.effect.updateSource({name : this.effect.name + ` (${data.name})`})\n}\n","a0YU3whUm16wGBNu":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.addCondition(\"fatigued\");\n}","a4Aza4a9v8JMU8dC":"const talents = await Promise.all([\"Frénésie\", \"Résistance à la Magie\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","a6gacHsvgwtsIFSQ":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.Research\"))\n args.test.preData.canReverse = true","a7pEvCycVnFBXGAQ":"let test = await this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - Assomé\", fields : {difficulty : \"easy\"}})\nawait test.roll();\n\nif (!test.succeeded)\n{\n\tthis.actor.addCondition(\"stunned\");\n}","a8RabrnJ08O07rDX":"if (args.totalWoundLoss > 0)\n{\n // I'm assuming the endurance test specified is for the end-round check\n await args.actor.addCondition(\"poisoned\", 2);\n}","a8i0sA1RBnD8nHZt":"let caster = this.effect.sourceActor\nlet targetedItem = this.actor.items.get(this.effect.flags.wfrp4e.itemTargets[0])\n\nlet qualities = foundry.utils.deepClone(game.wfrp4e.config.itemQualities);\nlet flaws = foundry.utils.deepClone(game.wfrp4e.config.itemFlaws);\n\nif (targetedItem.type == \"weapon\")\n{\n mergeObject(qualities, game.wfrp4e.config.weaponQualities)\n mergeObject(flaws, game.wfrp4e.config.weaponFlaws)\n}\nelse if (targetedItem.type == \"armour\")\n{\n mergeObject(qualities, game.wfrp4e.config.armorQualities)\n mergeObject(flaws, game.wfrp4e.config.armorFlaws)\n}\n\nfor(let q in qualities)\n{\n // If the weapon already has a flaw, don't put it in the dialog\n if (targetedItem.system.properties.qualities[q])\n {\n delete qualities[q]\n }\n}\nfor(let f in flaws)\n{\n // If a weapon doesn't have a flaw, don't put it in the dialog\n if (!targetedItem.system.properties.flaws[f])\n {\n delete flaws[f]\n }\n}\n \nlet added = await ItemDialog.create(ItemDialog.objectToArray(qualities), \"unlimited\", \"Choisissez la Qualité à ajouter\");\nlet removed = []\nif (!foundry.utils.isEmpty(flaws))\n{\n removed = await ItemDialog.create(ItemDialog.objectToArray(flaws), \"unlimited\", \"Choisissez le Défaut à enlever\");\n}\n\nthis.effect.updateSource({\"flags.wfrp4e.propertiesChanged\" : {added : added.map(i => i.id), removed : removed.map(i => i.id)}})\n","aAvJrAKLzXhS9qN6":"return args.item?.name == game.i18n.localize(\"NAME.Climb\")","aCVtaW8ag1WibcAr":"args.attacker.modifyWounds(1)\nthis.script.scriptMessage(`${args.attacker.prototypeToken.name} récupère 1 Blessure.`)","aIYUsBIDKWJ3CEtj":"this.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true}));","aMHGjWyn6BXCI4pw":"let frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.hXcfygzujgyMN1uI\");\nthis.actor.createEmbeddedDocuments(\"Item\", [frenzy], {fromEffect: this.effect.id})","abLWYtNTu1UVDQAs":"if (args.opposedTest.result.hitloc.value == this.effect.flags.wfrp4e.location) // e.g. 'head', rLeg, 'lArm'\n{\n this.scriptMessage(`Reçoit l'état @Condition[Aveuglé] comme ${this.item.name} a été touché`);\n this.actor.addCondition(\"blinded\");\n}","abVIvJBzuskNzCQv":"let amount = this.effect.sourceTest.result.overcast.usage.other.current;\n\nlet sss = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\nlet strider = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\n\nlet items = Array(amount).fill(sss).concat(Array(amount).fill(strider))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","afdmOvPGMpEdZvCb":"return (args.skill?.name == game.i18n.localize(\"NAME.Perception\") || args.characteristic == \"fel\")","agsm3NI1NDtHRG4y":"this.actor.getActiveTokens().forEach(t => t.document.update({texture : this.actor.prototypeToken.texture}, {animate : false}));","ahbA7o5G9dzMFl76":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","alJgj25l3239h2SW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hTgrGkWnmIR4xhVe\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ayIbw2Vw2t9xg33P":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","b1zMefdoZYtzCm7i":"return [\"roll\", \"none\"].includes(args.fields.hitLocation) || args.item?.attackType != \"ranged\"","b2Kb4IuD22RhKhR0":"let actor = Array.from(game.user.targets)[0]?.actor;\n\nif (actor)\n{\n actor.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[0].uuid})\n}\nelse\n{\n this.script.scriptNotification(\"Aucune cible!\", \"error\")\n}","b2WaqRna5CFXmbDG":"args.options.stag = true;","b5DfAWtpV1x2R8If":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","b5prg1FLjCAvBjLy":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.zyocWSzEZEC826NS\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\n\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n await this.actor.addCondition(\"prone\")\n await this.actor.addCondition(\"stunned\")\n}","bBdXzBmxgFFBwMMS":"if(args.opposedTest.attackerTest.item?.isRanged && args.applyAP && !args.sureShot)\n{\n if (args.modifiers.ap.value)\n {\n args.sureShot = true;\n args.modifiers.ap.details.push(`${this.effect.name} (Ignore ${this.item.Advances})`)\n args.modifiers.ap.ignored += this.item.Advances;\n }\n}","bEVlJOOA1kLlzpWx":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 15,\n \"i\" : 20,\n \"ag\" : 15,\n \"dex\" : 20,\n \"int\" : 35,\n \"wp\" : 30,\n \"fel\" : 10\n}\nlet skills = [\"Focalisation\", \"Calme\", \"Esquive\", \"Divertissement (Narration)\", \"Intuition\", \"Langue (Magick)\", \"Commandement\", \"Savoir (Magic)\", \"Lore (Theologie)\", \"Perception\"]\nlet skillAdvancements = [20, 25, 20, 25, 30, 25, 15, 20, 10, 30]\nlet talents = [\"Harmonisation Aethyrique\", \"Magie des Arcanes (Domaine)\", \"Diction instinctive\", \"Diction instinctive\", \"Chance\", \"Sens de la Magie\", \"Menaçant\", \"Magie Mineure\", \"Seconde Vue\", \"Sixième sens\"]\nlet trappings = [\"Arme simple\", \"(2M) Bâton de combat\", \"Robe de rituel incorporant de nombreux ingrédients et fétiches\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","bLkt8VpTTPoTxW0W":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Ajout d'Hémorragie\")\n}\n","bMEFHPCei2evnZZw":"// Victims that take at least 1 Wound from a Fell Dagger\n// immediately take a Poisoned Condition \n// resisted with a Difficult (-10) Endurance Test. \n\n// TODO: Add Venom strength to message\n\nif (args.totalWoundLoss > 0) \n{\n args.actor.addCondition(\"poisoned\")\n this.script.scriptMessage(`\n ${this.effect.name}:
\n ${args.actor.name} reçoit un état @Condition[Empoisonné], qui peut être résisté avec un Test de Résistance Difficile (-10).`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}\n","bQyVajMN1ETwlzvM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\nlet data = item.toObject();\nlet target = await game.wfrp4e.tables.rollTable(\"fixations\")\nif (target)\n{\n data.system.specification.value = target.result\n this.script.scriptNotification(target.result);\n}\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bRtZH0xRh8dgqMeW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bWr8leucbWslBCYG":"return args.characteristic != \"s\"","bhXUW7IJtEaUGAoV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll(); \nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}\n ","brNRqfpPqD2Ki0cM":"args.prefillModifiers.modifier -= 10","btPrQkGRKUkhNe3N":"return args.skill?.name == \"Métier (Apothicaire)\"","bwtQOSWn120NICkf":"let test = await this.actor.setupCharacteristic(\"ag\", {fields : {difficulty : \"hard\"}});\nawait test.roll();\n\nif (test.failed)\n{\n await this.actor.addCondition(\"bleeding\")\n await this.actor.addCondition(\"entangled\")\n}","bwx9wuEOJPF7btD1":"return args.skill?.name != game.i18n.localize(\"NAME.Navigation\");","bzaoWcieMFaU5B5l":"return !this.actor.flags.useless[this.item.system.location.key] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","c31hjp7k0hlpdGBC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","c3KA1knL2NYNUEww":"return args.skill?.name != game.i18n.localize(\"NAME.Evaluate\");","cAioHYtlxuOCwRLh":"let ablaze = Number(args.opposedTest.attackerTest.result.SL) + 1\nargs.actor.addCondition(\"ablaze\", ablaze)","cApfxL7Ic0NKdoSr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cBSy9CR5NZvcLRg8":"\n args.prefillModifiers.modifier += 0;\n args.prefillModifiers.slBonus += 0;\n args.prefillModifiers.successBonus += 0;\n ","cDBhmHn5kjgWBAlT":"let num = (this.effect.sourceTest.result.overcast.usage.other.current || 1)\n\nthis.actor.addCondition(\"entangled\", num)","cEg09bnvZD6Ysnpc":"let item = await fromUuid(\"Compendium.wfrp4e-archives2.items.anIlqJXFOIEzIOo1\")\nlet data = item.toObject();\ndata.name = this.item.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cJFDnq1HI4gXWcJo":"if (isNaN(parseInt(this.item.system.specification.value)))\n{\n let value = await ValueDialog.create(\"Ward Value\", \"Enter the Ward value\");\n if (value)\n {\n this.item.updateSource({\"system.specification.value\" : value});\n }\n}","cK1Jysfu5IMUUH0C":"if (!args.ward)\n{\n\targs.ward = (this.effect.getFlag(\"wfrp4e\", \"ward\") || 0);\n\tif (args.wardRoll >= args.ward && args.ward > 3)\n {\n let newWard = Math.max(3, args.ward - 1)\n this.script.scriptMessage(\"Protection améliorée de \" + newWard)\n this.effect.setFlag(\"wfrp4e\", \"ward\", newWard)\n }\n\n}","cOuukVo8WakDZIUj":"args.prefillModifiers.slBonus += 1","cUFCL02JoaZObRcX":"let sl = this.effect.sourceTest.result.slOver;\n\nthis.actor.system.characteristics.s.modifier += sl * 10;\nthis.actor.system.characteristics.s.calculationBonusModifier -= sl;","cUnbADgOQ4fMKgrH":"let group\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\");\nlet data = item.toObject();\n\nif (this.item.name.includes(\"(\"))\n{\n\tgroup = this.item.parenthesesText\n}\n\nelse \n{\n\tgroup = await ValueDialog.create(\"Choisir le groupe haï\", \"Groupe Haï\")\n\n\tthis.item.updateSource({name : this.item.name + ` (${group})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"Group\", group)})\n\tthis.effect.updateSource({name : this.effect.name + ` (${group})`})\n}\n\n\ndata.name = data.name.replace(\"Target\", group);\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","cV9JiAgUPOeUHKnS":"args.fields.successBonus++;\nif (args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\"))\n{\n args.fields.modifier += 10;\n}","cYPIXzl86a3LFsTE":"if (args.item.type == \"spell\")\n{\n args.item.cn.value -=2\n if (args.item.cn.value < 0)\n args.item.cn.value = 0\n}","cgmA2N0MkjA7qIZy":"return args.type != \"cast\" || args.item?.system.lore?.value != \"shadow\"","ch5SD2XOQfcYo0X5":"if (args.sizeDiff <= -2 && args.opposedTest.attackerTest.result.critical)\n args.damageMultiplier = Math.abs(args.sizeDiff)\n\n let sBonusDiff = args.opposedTest.defenderTest.actor.characteristics.t.bonus - args.opposedTest.attackerTest.actor.characteristics.s.bonus\n let weapon = args.opposedTest.attackerTest.item\n if (sBonusDiff > 0 && weapon && weapon.damage.value.includes(\"SB\"))\n {\n args.damage += sBonusDiff\n args.breakdown.other.push({label : this.effect.name, value : sBonusDiff});\n }","chUpiI3el8IO8MSs":"if (args.opposedTest.attackerTest.item?.name.includes(\"Morsure\"))\n{\n let woundsGained = args.totalWoundLoss;\n this.script.scriptMessage(`Récupère ${woundsGained} Blessures`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\n this.actor.modifyWounds(woundsGained)\n}","csLKDJKZaUK9vwLT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7rBhIRo96Mydo0Cv\")\nlet data = item.toObject();\ndata.system.location.value = \"Back\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n","ct6WGaRMfrcnHhyv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cuqCtQsfLBBAGjnu":"args.fields.slBonus -= (Number(this.item.specification.value) || 0)","cysQDjlDzT8HdNeo":" args.prefillModifiers.slBonus += 1","d29mu8vRt9AQUm0L":"this.actor.characteristics.i.value = Math.min(this.actor.characteristics.i.value, 10);\nthis.actor.characteristics.i.bonus = 1;\n\nfor(let skill of this.actor.itemTypes.skill.filter(i => i.system.characteristic.value == \"i\"))\n{\n skill.system.total.value= Math.min(skill.system.total.value, 10)\n}","d6mVm08o8SeklAcW":"this.actor.system.status.ward.value = 9;","d9iU08yvqcffF026":"return args.weapon.system.usesHands.includes(this.effect.getFlag(\"wfrp4e\", \"location\"))","dAMtbn3uQwF8KpKU":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\");","dIxYt421K010eogY":"\n let modifier = 0\n if (this.effect.name.includes(\"Modéré\"))\n modifier = -20\n else\n modifier = -10\n args.fields.modifier += modifier\n ","dM449AU0FQRnOc3l":"if (args.opposedTest.result.hitloc.value == \"head\")\n{\n args.abort = \"Raté - Sans tête\"\n}","dM8FbRH2V8CpOkXw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\nlet data = item.toObject();\ndata.system.location.value = \"Ribs\";\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","dSmRhZ6o1bUcOSF9":"return args.skill?.name != game.i18n.localize(\"NAME.Leadership\");","dXGosSxdoYbET2O8":"await this.actor.addCondition(\"fatigued\");\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"))\n\nawait test.roll();\n\nif (!test.succeeded)\n{\n await this.actor.addCondition(\"fatigued\");\n await this.actor.addCondition(\"broken\");\n}","dZ4c5pKDqQV02aIK":"if (args.effect.conditionId == \"ablaze\")\n{\n args.data.formula += ` + parseInt(this.effect.sourceTest.result.SL)`\n}","dbOSvpgcPjsc2uvq":"let menacing = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0hn6UaKq8CoZP2zD\")).toObject();\nlet sense = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\n\nsense.name += \" (Vue)\";\nsense.system.tests.value = sense.system.tests.value.replace(\"Sens\", \"Vue\")\n\nthis.actor.createEmbeddedDocuments(\"Item\", [menacing, sense], {fromEffect : this.effect.id})","dbYjr4oG67Z880To":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[warpfire-thrower-fumble]\")\n}","dcwY8dCd3PNCEzk6":"let current = this.actor.status.fate.value\n\nthis.actor.update({\"system.status.fate.value\" : current + 1})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses Points de Destin augmentés de ${current} à ${current + 1}`)","dfEgat3jz4EtWszH":"return args.skill?.name == \"Discrétion (Urbaine)\"","dfnCK8jCPXNLM7Gh":"let aoeDamage = this.effect.sourceTest.result.damage - 5 // Easily handle magic missile damage by just subtracting 5 from the item's (which has +10 base)\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(aoeDamage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - Ablaze`})\n\nawait test.roll();\n\nif (!test.succeeded)\n{\n this.actor.addCondition(\"ablaze\");\n}","dk02qSJfJaIo3Geh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\");\nlet data = item.toObject();\ndata.system.specification.value = this.actor.characteristics.ag.value\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","dkY7WRYjFVh8GB0m":"return ['ws', 'bs', 'ag'].includes(args.characteristic)","dkiNmwFXztIVbuxg":"let currentCareer = this.actor.system.currentCareer;\n\nif (!currentCareer || currentCareer.system.talents.includes(game.i18n.localize(\"NAME.Frenzy\")))\n{\n return\n}\n\ncurrentCareer.system.talents.push(game.i18n.localize(\"NAME.Frenzy\"));","dqvHDMlcitLx1pUx":"this.actor.system.details.move.value /= 2;","dt85W8pzZ09w1QLi":"if (this.actor.sameSideAs(this.effect.sourceActor))\n args.fields.slBonus += 2;\nelse\n args.fields.slBonus -= 2;","dtFvpY96RPzNnphq":"return !(args.skill?.name.includes(\"Corps à corps (Base)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","dwSgcFxKN3S0hLJL":"return args.skill?.name != \"Corps à corps (Bagarre)\" && args.item?.weaponGroup?.value != \"brawling\"","e0TuMgYuI7ZtGoQr":"args.applyAP = false;\n\nawait args.actor.addCondition(\"ablaze\", 2);\nawait args.actor.addCondition(\"prone\");","e34s1XxHckAWfwHt":"if (args.test.options.beatBlade && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\n{\n args.test.result.other.push(`${this.effect.name}: L'opposant perd ${Number(args.test.result.SL) + 1} Avantage`)\n}","e7IxnxePdXSy6L4E":"if (args.opposedTest.result.hitloc.value == \"head\")\n{\n this.script.scriptMessage(`${this.actor.prototypeToken.name} subit une @Table[crithead]{Blessure Critique} si il n'y en avait pas d'autres.`)\n}","eAtqyBd1HsDWuBuI":"this.actor.system.characteristics.fel.modifier -= parseInt(this.item.system.location.value || 1)","eHRv7f2BTtle6Y1K":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.sJ3yX1kvzu2hgNq5\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","eHgk3HZ6eyLFTZ9o":"return !args.item?.system.magicMissile?.value && !args.item?.system.attackType","ePPgxQOqL1Uhz2k9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Projectiles (Arc)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Arc\",\n },\n {\n type : \"ammunition\",\n name : \"Flèche\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `

\n Ajouter une Option?\n

\n
    \n
  1. Projectiles (Arc) +10 et un arc avec 12 Flèches
  2. \n
\n `,\n buttons : {\n 1 : {\n label : \"Oui\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Non\",\n callback : () => {\n choice2\n }\n }\n }\n })\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","eWWLmA2xINR321aK":"args.item.system.qualities.value.push({name : \"magical\"})","eb69QPmNQEJXtk4l":" return args.characteristic != \"bs\"","ebDQH0MdGAG02CHl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SYjWiKDzMS6CtROJ\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nif (this.item.system.location.key == \"rArm\")\n{\n\tdata.system.location.value = \"Main Droite\"\n\tdata.system.location.key = \"rHand\"\n}\nelse if (this.item.system.location.key == \"lArm\")\n{\n\tdata.system.location.value = \"Main Gauche\"\n\tdata.system.location.key = \"lHand\"\n}\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","ed7Sud9HM3uB2j6b":"ChatMessage.create({content : \"Céder ou Mourir!\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2;\nthis.script.scriptNotification(\"Ajout de \" + data.name);\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});\ngame.wfrp4e.utility.postFear(2, this.actor.prototypeToken.name)","egDtqMxe3iekc6hv":"let trait = args.opposedTest.attackerTest.item\nlet woundLossEffect = this.item.effects.get(\"7Amhi75wLv0PvGjd\")\nif (trait && trait.name.includes(\"Morsure\") && woundLossEffect)\n{\n args.actor.applyEffect({effectUuids : woundLossEffect.uuid})\n}","eh1J3s0s4A2AxoFp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\");\nlet data = item.toObject();\ndata.name += \" (Ennemi)\";\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","ekjJQHyMbZT2vqdc":"let uses = this.item.getFlag(\"wfrp4e\", \"uses\") || 0;\nuses++;\nthis.script.scriptNotification(`Utilisé ${uses} fois`)\nthis.item.setFlag(\"wfrp4e\", \"uses\", uses);\nif (uses >= 3)\n{\n\tthis.effect.update({\"flags.wfrp4e.applicationData.type\" : \"other\"})\n\tthis.script.scriptNotification(`Utilisé`);\n}\n","eqxE7nBO13yJS7hc":"let roll = (await new Roll(\"1d10\").roll())\nroll.toMessage({flavor: \" Blessures soignées\", speaker : {alias : this.actor.name}})\n\nthis.actor.modifyWounds(roll.total)\n\nthis.actor.hasCondition(\"bleeding\")?.delete();","esuLwq4g5T8k1kLT":"await args.actor.addCondition(\"ablaze\"); await args.actor.addCondition(\"prone\");","ezGqDoC9hNRBnFTB":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"1zaqojk0Oq1m8vYv\"), game.wfrp4e.utility.findItemId(\"zIuarD5mB0EF0ji0\")])\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choisir une arme\")\n items = items.map(i => i.toObject())\n \n items.forEach(i => equip(i))\n \n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.data.worn.value = true\n else if (item.type == \"weapon\")\n item.data.equipped = true\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\n item.data.worn = true\n }","f062aa2BNClx08D6":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed) \n {\n let toughnessLost = parseInt(this.effect.sourceTest.result.SL)\n\n let currentModifier = this.actor.characteristics.t.modifier\n\n await this.actor.update({ \"system.characteristics.t.modifier\": currentModifier - toughnessLost })\n this.script.scriptMessage(`${this.actor.prototypeToken.name} perd ${toughnessLost} points d'Endurance`)\n if (this.actor.system.characteristics.t.value <= 0)\n {\n this.actor.addCondition(\"dead\");\n }\n\n }","f3rXusHh6VIpVPUl":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) && args.type != \"cast\"","f4vvAGQ8OGoEbrgy":"let SL = args.opposedTest.attackerTest.result.SL - args.opposedTest.attackerTest.item.cn.value\nlet difficulty = \"challenging\"\nif (SL >= 1)\n difficulty = \"difficult\"\nif (SL >= 2)\n difficulty = \"hard\"\nif (SL >= 3)\n difficulty = \"vhard\"\n \n\nlet test = await args.actor.setupCharacteristic(\"wp\", {fields: {difficulty}, skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gain a Stunned Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n args.actor.addCondition(\"stunned\");\n}","f5Mp3kXwCFdPkW6N":"return args.skill?.name != \"Divertissement (Chant)\" && args.skill?.name != \"Divertissement (Chanter)\" && !args.skill?.name.includes(\"Langue\");","f6WnrJvoNkfoNN9Y":"return args.item?.attackType != 'melee'","f7WZvYle9iqefRsh":"return args.weapon?.system?.attackType != \"melee\"","f8cnfvGKJH3bYVGN":"return [\"s\", \"t\"].includes(args.characteristic)","fEFfHFeJxkR0aIJK":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 3 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Tous ceux dans un rayon de 7 mètres perde 1 Point de Blessure et doivent faire un Test de Résistance Difficile (-10) ou recevoir l'état gains @Condition[Assourdi]`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}\n ","fEyKQqCjDwml3DXO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","fFGuTi0HLjwneMcJ":"return args.item?.system.isRanged","fIUxKZMWJ8HMPmH9":"return [\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","fKzlu6fFE2th9uIJ":"return args.item?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\")","fP2edYbj6QjPPAjL":"return [\"Emprise sur les animaux\", \"Résistance\", \"Survie en extérieur\"].includes(args.skill?.name)","fPKYkBllp7Et62lX":"if (args.test.spell.name == \"Warp Lightning\")\n{\n args.test.preData.canReverse = true;\n}","fY0TsQwnU14fdPl2":"args.fields.modifier += 30;","fYLSe6CrYciap5y8":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Résistance à l'alcool\", \"Ramer\", \"Voile\", \"Natation\"]\n let skillAdvancements = [10, 10, 10, 10]\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","faRFSsrQylQRZFLk":"return args.bleedingHand || !args.weapon || !this.actor.hasCondition(\"bleeding\")","fcY3pa72dELnOFXV":"return !args.options.reload\n","feMPZhhFeXRtKdKY":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectUuids : this.item.effects.contents[0]?.uuid})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun restant!\", \"error\")\n}","ffvcCEazZBinHlUX":"args.update({texture : {tint : \"#FFD700\"}});\n","fiF9sM5UpcHMYa33":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\");\nlet data = item.toObject();\ndata.name += \" (Poison, Maladie, Chaos)\"\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect: this.effect.id})","fkFmNcesqqNTMhVn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.2iult41Jehz0F1O8\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key;\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","fl762icfKrt9ear2":"this.actor.removeCondition(\"broken\", parseInt(this.effect.sourceTest.result.SL)+1)","ft0LaRWZT5WtnptP":"let advantage = this.actor.system.status.advantage.value;\nif (advantage > 0)\n{\n await this.actor.setAdvantage(0);\n this.script.scriptNotification(\"Avantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item, {fields : {slBonus : advantage}})\nawait test.roll();","fve7tiyF5X9B7mHJ":"args.fields.slBonus -= 2;","fzTB7t3x4bLmAXji":"let roll = await new Roll(\"1d10 + 1\").roll()\nawait roll.toMessage(this.script.getChatData());\nthis.script.scriptNotification(`Soins de ${roll.total} Blessures`)\nthis.actor.corruptionDialog(\"moderate\")\nawait this.actor.modifyWounds(roll.total)","g07HI7vyqiFXPB0o":"// A Drinker must take a Difficult (-10) Endurance Test.\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"difficult\"}})\nawait test.roll()\n// If they fail, they acquire 2 Poisoned Conditions. \nif (test.failed) \n{\n this.actor.addCondition(\"poisoned\", 2)\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} reçoit 2 états @Condition[Empoisonné].

\n

Toute créature avec le Trait Bestial qui le mord et provoque des dégats ne le mordra pas à nouveau durant un combat, la créature pouvant toutefois attaquer avec d'autres méthodes si disponibles..

`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n })\n}\n // If they succeed, for a number of rounds equal to 3+ their SL, they have the Corrosive Blood Creature Trait.\nelse if (test.succeeded) \n{\n // Don't attempt to add Corrosive Blood if actor already has it\n const hasCorrosiveBlood = this.actor.has(\"Sang corrosif\")\n if (hasCorrosiveBlood !== undefined) return \n\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\n let data = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \n const duration = 3 + parseInt(test.result.SL)\n this.script.scriptMessage(`

${this.actor.prototypeToken.name} gagne le Trait Sang Corrosif pour ${duration} rounds.

`, \n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \n}","g0SzfsLyW7aD2F19":"if (this.item.name.includes(\"(\") && this.item.system.tests.value.includes(\"(Groupe Social)\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let group = name.split(\"(\")[1].split(\")\")[0]\n tests = `${tests.split(\"(\")[0].trim()} (${group})`\n }\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","g1L8OYO9nCOhdKGL":"// Everything within Fellowship Bonus yards \n// of the target point is splashed with mystic poison, \n// suffering 1d10 + SL damage which ignores Armour Points\n\nlet damage = (await new Roll(`1d10 + ${parseInt(this.effect.sourceTest.result.SL)}`).roll())\n\nawait damage.toMessage(this.script.getChatData())\n\nthis.script.scriptMessage(await args.actor.applyBasicDamage(\n damage.total,\n {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}\n))\n\n// ... and gains the Poisoned Condition\n\nthis.actor.addCondition(\"poisoned\")","g4t56A09yrpZaJQ2":" let amberTalons = foundry.utils.deepClone(game.wfrp4e.config.systemItems.unarmed);\n amberTalons.name = \"Amber Talons\";\n amberTalons.img = this.effect.img;\n amberTalons.system.damage.value = \"SB + WPB\"\n amberTalons.system.equipped = true;\n amberTalons.system.qualities.value.push({name : \"magical\"})\n amberTalons.effects.push({\n label : \"Amber Talons\",\n transfer: false,\n icon : \"modules/wfrp4e-core/icons/spells/amber-talons.png\" ,\n flags : {\n wfrp4e : {\n applicationData : {\n documentType : \"Item\"\n },\n scriptData : [{\n trigger : \"applyDamage\",\n script : \"if (args.totalWoundLoss >= 1)\\n{ \\n args.actor.addCondition(\\\"bleeding\\\")\\n}\"\n }]\n }\n }\n })\n this.actor.createEmbeddedDocuments(\"Item\", [amberTalons], {fromEffect: this.effect.id})","gFUXBbTskQBKjxqm":"if (this.actor.hasCondition(\"entangled\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}}).then(async test => {\n await test.roll();\n if (test.failed)\n this.actor.addCondition(\"fatigued\") \n })\n}","gKIPujyuFSn0No9v":"for(let e of this.item.effects.contents)\n{\n e.update({disabled: false})\n}\nthis.script.scriptNotification(\"Ré-initialiser les pouvoirs\")","gKPL3t4vlZAsvtGr":"return args.skill?.name == \"Discrétion (Souterrains)\"","gL0ftUnK5TNXBRRt":"return this.effect.sourceActor.uuid == args.actor.uuid","gPQrszvIgGlW9yM4":"if (args.test.characteristicKey == \"wp\")\n args.test.preData.canReverse = true","gVpFUka7qfGiEC1v":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFD700\"}}));\n","ga6bQzPuoIiQQrKg":"if (args.totalWoundLoss > 0)\n{\n \n let test = await args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\n await test.roll()\n if (test.failed)\n {\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\n }\n}","gbhxWXboV9CytWNU":"await this.actor.addCondition(\"blinded\", 2)","gh2KS1prBKcsSK6M":"if (args.opposedTest.attackerTest.result.critical)\n args.actor.addCondition(\"ablaze\")","gnVpxOeBZpNF4HIF":"if (args.test.result.roll.toString().includes(\"9\") || args.test.result.roll.toString().includes(\"8\"))\n{\n args.test.result.fumble = game.i18n.localize(\"Fumble\")\n}","gpPaCe6yER79l4u8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","gpuBg3y9rocJL7yT":"this.actor.status.addArmour(1, {locations: [\"head\"], source: this.effect})","gqZLfIr6svrtdwdC":"return args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\") && args.skill?.name != game.i18n.localize(\"NAME.MeleeBrawling\") && args.weapon?.system?.weaponGroup?.value != \"brawling\"","gsCnd3mf1vXFU2ei":"this.actor.system.status.ward.value = 4;","gu72JaTs9GrSiVTd":"return !(args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\"))","h0DfPwUUOBjyAHMZ":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\");","h1XKoMuVnS0bagRO":"return args.item?.name != game.i18n.localize(\"NAME.Endurance\");","h766UvswLCsxcMow":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : -15,\n \"t\" : 0,\n \"i\" : 20,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 5,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charme\", \"Intimidation\", \"Corps à corps (Base)\"]\nlet skillAdvancements = [7, 60, 7]\nlet talents = [\"Menaçant\", \"Discret\"]\nlet traits = [\"Perturbant\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","hA8PzeiCsHqqlUZm":"this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"nausea\"]])\nthis.script.scriptMessage(`Gaine de @Condition[Nausée] pour [[1d10]] heures`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})","hCzxUyO6mjLNIpaM":"let woundsGained = Math.min(args.totalWoundLoss, args.actor.status.wounds.value)\n\nwoundsGained = Math.floor(woundsGained / 2)\n\nargs.attacker.update({ \"system.status.wounds.value\": args.attacker.status.wounds.value + woundsGained })\n\nthis.script.scriptMessage(`Récupération de ${woundsGained} Blessures`)","hDC6lroDEPVBituR":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Gagne un Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n this.script.scriptMessage(`Echec total: gain immédiat de 1 @Table[mutatemental]{Mutation Mentale}, et ne peut plus prendre d'Ambition à court-terme pour les [[1d10]] prochaines weeks.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","hK0YMJfYbpbJZizO":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\n \"dim\": 0,\n \"bright\": 0,\n \"angle\": 360,\n \"alpha\": 0.5,\n \"animation\": {\n \"speed\": 0,\n \"intensity\": 0,\n \"type\": \"none\",\n },\n \"color\": \"\",\n }}));","hObTbWi4ZdwXimIW":"if (args.item.type == \"spell\")\n{\n args.item.system.cn.value = Math.floor(args.item.system.cn.value / 2);\n}","hR1qD2kpFHF8JT8h":"return args.skill?.name == \"Langue (Magick)\"","hSlEY2oh8quVmdXR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\ndata.system.specification.value = 2\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","hZAax4emLahEEqcZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"(Tusks)\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","hfO4INH3EeETDTFt":"this.actor.status.addArmour(1, {locations: this.effect.flags.wfrp4e.locations, source: this.effect})","hhCs5VBKx50S5IsY":"return !args.options.mutate","hhv7PrRdlf9sfC82":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Calme\", \"Esquive\"]\n let skillAdvancements = [10, 10]\n let talents = [\"Combat Instinctif\"]\n let trappings = [\"Veste de cuir\", \"Calotte de cuir\", \"Jambières de cuir\", \"Bouclier\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","hlHKeFWrOA8CsLr9":"args.data.canReverse = true;\nargs.options.pilot = true;","hluehsCuBZYc1Ejt":"return args.characterisic != \"fel\"","hmk8zV1LTElHUI8A":"let msg = `${this.actor.prototypeToken.name} perd 1 Blessure.
`\n if (this.actor.status.wounds.value <= 1)\n {\n msg += `${this.actor.prototypeToken.name} tombe Inconscient.
`\n await this.actor.addCondition(\"unconscious\")\n }\n this.script.scriptMessage(msg)\n this.actor.modifyWounds(-1)","hnsmzvcuiUYB065I":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, context: { failure : \"Ne peut fuir les combats\"}}).then(test => test.roll())","hpwJRAhCsXTp9bd9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Base)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Corps à corps (Armes d'hast)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice3 = [\n {\n type : \"skill\",\n name : \"Corps à corps (A deux mains)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `

\n Faites un choix\n

\n
    \n
  1. Corps à corps (Base)
  2. \n
  3. Corps à corps (Armes d'hast)
  4. \n
  5. Corps à corps (A deux mains)
  6. \n
\n `,\n buttons : {\n 1 : {\n label : \"Base\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Armes d'hast\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"A deux mains\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","hwHpIunCq3ifk2QU":"if (args.item.type == \"spell\")\n{\n let range = parseInt(args.item.Duration)\n if (Number.isNumeric(range))\n {\n args.item.system.duration.value = \"2 * \" + args.item.system.duration.value\n }\n}","hwOZxgt7e65iWvYz":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n let damage = this.effect.sourceTest.result.damage\n\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n}","hxmwtw5zAHyS2upG":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"giftofthebeast\"))","i59IpmZNLJEPWZ3L":"return args.spell","i5AN97A7IOeygEFA":"if (args.applyAP && args.modifiers.ap.metal) \n{\n args.modifiers.ap.ignored += args.modifiers.ap.metal\n args.modifiers.other.push({value : args.modifiers.ap.metal, label : this.effect.name, details : \"Ajout les PA Métalliques aux Dommages\" })\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore le métal (\" + args.modifiers.ap.metal + \")\");\n args.modifiers.ap.metal = 0\n}","i7xl0jNpLnBT2h2l":"args.actor.characteristics.dex.value = 0","iAo3wxMLA64rsKjj":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"skavenbrew\"))","iBEPQ3NwtI9DfkEy":"let locations = [];\n\nwhile (locations.length < 2)\n{\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\n if (!locations.includes(loc.result))\n {\n locations.push(loc.result);\n }\n}\n\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\n\nthis.item.updateSource({name : this.item.name += ` (${locationText})`})","iHn3YzvqNfbwzjZz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\nlet data = item.toObject();\ndata.system.specification.value = this.actor.characteristics.s.bonus\ndata.system.description.value = \"\"\ndata.name = this.effect.name;\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","iLpq4yCFN6YACrYA":"if (args.test.result.castOutcome == \"success\")\n{\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"demonic-mien\"))\n}","iM4B3IZ4VtpZsl09":"args.size = \"sml\"","iM6JLF8jDXMViReZ":"return ![\"Crochetage\", \"Escamotage\", \"Focalisation (Ulgu)\"].includes(args.skill?.name)","iMDZLr7ueJWBnilj":"args.actor.flags.rangedDamageIncrease += 1","iMu8BZ7eHMAbPEO1":"let healed = args.totalWoundLoss\n\nthis.script.scriptMessage(`this.actor.prototypeToken.name Guérison de ${healed} Blessures`);\n\nthis.actor.modifyWounds(healed)","iNAQJa5HyaEckknX":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n let spells = this.actor.itemTypes.spell;\n if (spells.length)\n {\n let chosen = spells[Math.floor(CONFIG.Dice.randomUniform() * spells.length)]\n this.script.scriptMessage(`Ne se rappelle plus du sort ${chosen.name}`)\n chosen.update({name : chosen.name += \" (LOST)\"})\n }\n}\n\n\n","iT0h3VZLEBQnn5Bx":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\") && args.skill?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\");","iT3C15fMyQrj1RmG":"if (this.actor.has(\"Undead\") && this.actor.has(\"Ethereal\"))\n{\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if(test.failed)\n this.actor.addCondition(\"stunned\")\n })\n}","iVhi3Z6zPaf1bf8g":"return [\"t\", \"i\", \"ag\", \"dex\", \"int\", \"wp\"].includes(args.characteristic)","iX0ctHYHg12pjaCU":"let result = await game.wfrp4e.tables.rollTable(\"gift-of-slaanesh\")\n\nif (result.object.documentId && result.object.documentCollection)\n{\n let item = await fromUuid(`Compendium.${result.object.documentCollection}.${result.object.documentId}`);\n if (item)\n { \n let data = item.toObject();\n // Some items need sourceTest for their effects\n setProperty(data, \"flags.wfrp4e.sourceTest\", this.effect.sourceTest);\n await this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});\n }\n}\n\nthis.script.scriptMessage(game.wfrp4e.tables.formatChatRoll(\"gift-of-slaanesh\", {lookup : result.roll, hideDSN: true}));","id9ZdkERMZnZTWXt":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\tthis.script.scriptNotification(\"Immunisé à la Peur\");\n\targs.extendedTest.delete();\n\targs.abort = true;\n}\nreturn args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\")","igVAVU7DOuzhNG14":"return args.item?.system.isMelee","imKVsCy8rya2gkwO":"// Any Characteristic penalties due to failed Consume Alcohol Tests\n// or the state of being Stinking Drunk are eliminated. \nawait this.actor.removeSystemEffect(\"consumealcohol1\")\nawait this.actor.removeSystemEffect(\"consumealcohol2\")\nawait this.actor.removeSystemEffect(\"consumealcohol3\")\nawait this.actor.removeSystemEffect(\"stinkingdrunk1\")\n\n// The drinker is thereafter Fatigued \n// for a number of hours equal to 10 minus their Toughness Bonus — \n// nothing but time and rest can eliminate this penalty.\nawait this.actor.addCondition(\"fatigued\")\nconst duration = 10 - parseInt(this.actor.system.characteristics.t.bonus)\nthis.effect.updateSource({\"duration.rounds\" : duration});\nthis.script.scriptMessage(`

${this.actor.prototypeToken.name} ne souffre des pénalités dues à l'alcool et reçoit 1 état Fatigué pour ${duration} heures.

`, \n{\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n}) ","inPxRSx0CDj1nwAm":"if (args.test.result.fumble && !this.actor.itemTypes.talent.find(i => i.name == \"Magie des Arcanes (Feu)\"))\n{\n this.actor.addCondition(\"ablaze\");\n}","ioeTj5mx8jlA5EX5":"args.actor.addCondition(\"stunned\")","ipkkRffJh61WE7zR":"if (!args.flags.amputatedFootOrLeg)\n{\n\targs.flags.amputatedFootOrLeg= true;\n\targs.fields.modifier -= 20;\n}","iuSoKntfJ4eAPafQ":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\");\nspells = spells.filter(s => [\"feu\", \"cieux\", \"bêtes\", \"ombres\", \"lumière\", \"vie\", \"mort\", \"métal\"].includes(s.system.lore.value)).sort((a, b) => a.system.lore.value > b.system.lore.value ? 1 : -1)\n\nlet choice = await ItemDialog.create(spells, 1, \"Choisir un sort\");\nif (choice[0])\n{\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\n}\n","iuYuf05BNuZ5fllI":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[poisoned-wind-globe]\")\n}","j1AmrY1SxFJQyapo":"if (this.actor.status.advantage.value > 0 && args.item.system.attackType)\n{\n args.item.system.qualities.value.push({name : \"penetrating\"})\n}","j3zDMWkns32Yrxn3":"this.effect.updateSource({\"flags.wfrp4e.ward\" : 9})","j6Bf1iivH8cqSnnK":"let target = args.data.targets[0]\nreturn target?.actor.hasCondition(\"prone\") || target.hasCondition(\"surprised\")","j98hvy6r9G2Vjmid":"if (args.totalWoundLoss > 0) \n{\n args.opposedTest.result.other.push(\n `@Corruption[minor]{Exposition Mineure à la Corruption}`\n )\n this.script.scriptMessage(\n `${this.effect.name}: \n @Corruption[minor]{Exposition Mineure à la Corruption}
\n ${args.actor.prototypeToken.name} doit réaliser un Test \n Accessible (+20%) de Corruption (Mineur)`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","jC8o5PbnqEvOoZ9N":"this.actor.addCondition(\"poisoned\", 2)","jFwema0iwzBphxie":"let woundsGained = Math.min(args.actor.status.wounds.value, args.totalWoundLoss)\nwoundsGained = Math.ceil(woundsGained / 2)\n\nargs.attacker.update({\"system.status.wounds.value\" : args.attacker.system.status.wounds.value + woundsGained})\n\nargs.actor.addCondition(\"fatigued\")\nargs.attacker.hasCondition(\"fatigued\")?.delete();\n\nthis.script.scriptMessage(`${args.attacker.prototypeToken.name} guéri de ${woundsGained} Blessures`);","jGDk7avWFSnyFoql":"let broken = this.actor.hasCondition(\"broken\");\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\");\n\nif (broken && !broken.getFlag(\"wfrp4e\", \"blasted-mind\") && !this.actor.has(item.name))\n{\n await broken.delete();\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})\n this.script.scriptNotification(`Suppression de ${broken.name}, ajout de ${item.name} (${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds)`)\n}","jHgxpe6TJDlP3oTn":"let spells = await game.wfrp4e.utility.findAll(\"spell\", \"Chargement des sorts\");\nspells = spells.filter(s => [\"slaanesh\"].includes(s.system.lore.value))\n\nlet choice = await ItemDialog.create(spells, 1, \"Choisir un sort\");\nif (choice[0])\n{\n this.item.updateSource({name : this.item.name + ` (${choice[0].name})`})\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\n}\n","jLsL4KRI6LEG9Ii2":"if (args.test.result.critical && ['rLeg', 'lLeg'].includes(args.test.result.hitloc.result))\n{\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 20 : 20\n args.test.result.critical += ` (+${args.test.result.critModifier})`\n}","jObJanFoev4N6ZRv":"if (!args.opposedTest.attackerTest.item?.system?.isMagical)\n\targs.abort = `${this.effect.name}: Ignoré`","jRSgPhpfN7MH7TTp":"if (args.totalWoundLoss > 0)\n{\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Poisoned Condition Gained\", success: \"Resisted Poisoned Condition\" } })\n await test.roll();\n if (test.failed)\n { \n args.actor.addCondition(\"poisoned\");\n if (args.actor.system.status.wounds.value - args.totalWoundLoss <= 0)\n {\n args.actor.addCondition(\"unconscious\")\n }\n }\n}\n\n // else\n // this.actor.setupCharacteristic(\"t\", { context: { failure: \"1 @Condition[Poisoned] Condition Gained\", success: \"Resisted @Condition[Poisoned] Condition\" } }).then(testCallback)\n","jW87rmQLtROdVEhW":" if ([\"orc\", \"ork\", \"goblin\", \"hobgoblin\", \"snotling\", \"greenskin\"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))\n {\n args.addImpact = true\n args.opposedTest.result.other.push(\"Rune de Banissement de Gobelin: Ajout d'Impact\")\n }","jWkfoVpHLiRaHTza":"if (args.test.succeeded)\n{\n args.test.result.other.push(`${this.effect.name}: @Terror[1,${this.actor.prototypeToken.name}]`)\n}","jYJRO5XPyG7y6fih":"await this.actor.addCondition(\"blinded\")\nawait this.actor.addCondition(\"deafened\")\nawait this.actor.addCondition(\"fatigued\")","jbZPLb4wuqJpHLUx":"this.item.system.flaws.value.push({name : \"dangerous\"})","jdS2u1tQPYeO55WI":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\n\nif (type == \"cold\")\n{\n\tlet stunned = Math.max(1, Math.trunc(args.totalWoundLoss / 5))\n\tawait args.actor.addCondition(\"stunned\", stunned);\n}\n\nif (type == \"corrosion\")\n{\n let damageItems = await Dialog.confirm({title : this.item.name, content : `

Endommager tout les objets portés?

`})\n\tif (damageItems)\n\t{\n\t\tlet msg = ``\n\t\tlet weapons = args.actor.itemTypes.weapon.filter(i => i.isEquipped);\n\t\tlet armour = args.actor.itemTypes.armour.filter(i => i.isEquipped);\n\t\tlet trappings = args.actor.itemTypes.trapping.filter(i => i.isEquipped);\n\t\tfor(let item of weapons)\n\t\t{\n\t\t\tif (item.system.properties.qualities.shield)\n\t\t\t{\n\t\t\t\tawait item.system.damageItem(1, \"shield\");\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tawait item.system.damageItem(1);\n\t\t\t}\n\t\t\tmsg += `

${item.name} endommagé de 1

`\n\t\t}\n\t\tfor(let item of armour)\n\t\t{\n\t\t\tawait item.system.damageItem(1);\n\t\t\tmsg += `

${item.name} endommagé de 1

`\n\t\t}\n\t\tfor(let item of trappings)\n\t\t{\n\t\t\tawait item.system.damageItem(1);\n\t\t\tmsg += `

${item.name} endommagé de 1

`\n\t\t}\n\t\tif (msg)\n\t\t{\n\t\t\tthis.script.scriptMessage(msg, {speaker : {alias : args.actor.name}});\n\t\t}\n\t}\n}\n\nif (type == \"fire\")\n{\n\tawait args.actor.addCondition(\"ablaze\");\n}\n\nif (type == \"electricity\")\n{\n\tawait args.actor.addCondition(\"stunned\");\n}\n\nif (type == \"poison\")\n{\n\tawait args.actor.addCondition(\"poisoned\");\n}\n\n","jfk5VDKMTIf4ee0v":"if (args.totalWoundLoss > 0)\n args.actor.addCondition(\"poisoned\")","jgO1Kf60Ctt6R0qO":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\")","jmxlpyLrIuoxQtvU":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}}));\n","jpcU8FFWSlQ3gD0L":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Trade\"))","jrvj7bRyMBB9LixP":"this.actor.addCondition(\"fatigued\", 3)","jsgLEVYvMieyYT6L":"let tokenImg = \"\"; // Put path to token image here, inbetween the quotation marks\nif (tokenImg)\n{\n if (this.effect.getFlag(\"wfrp4e\", \"transformed\"))\n {\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", false);\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: this.actor.prototypeToken.texture.src}})); \n }\n else \n {\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", true);\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: tokenImg}}));\n }\n}\nelse \n{\n this.script.scriptNotification(\"Aucune image de Token configurée. Le chemin du token doit être configuré dans la première ligne de ce script.\", \"error\");\n}","k3FqFgsF6a3TkxAD":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\ntest.roll();\nreturn true;","k8TC0yzp4xfOXD2n":"if (args.totalWoundLoss > 0)\n{\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\n await test.roll();\n if (test.failed)\n {\n\t args.actor.addCondition(\"stunned\");\n }\n\targs.actor.hasCondition(\"bleeding\")?.delete()\n}","k9SvH4Lm3ZuI8S1N":"return ![\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","kBXVEnSWzaQZLkJH":"if(args.test.result.critical)\n{\n args.test.result.damage +=1 \n args.test.result.additionalDamage += 1\n}","kIM4Fs1lFVV7TSnj":"this.actor.modifyAdvantage(1);","kMSdRskYDI2J1gnp":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll(); \nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}\n ","kWynO1lQzjiSs8RK":"return args.skill?.name != game.i18n.localize(\"NAME.Haggle\");","kYiDBPRKIokFkr4Z":"if (args.item.type == \"skill\" && args.item.name == \"Projectiles (Arc)\")\n{\n args.item.system.modifier.value += 20;\n}","kYmscP2HuXjDovBD":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\n","kiJ6AiaYVUjt6aV6":"teeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\nteeth = teeth.toObject();\n\nlet roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData({flavor : \"Dents perdues\"}))\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\nthis.actor.createEmbeddedDocuments(\"Item\", [teeth])","kkC5EhqA05U6U0gU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\n// Kind of insane but whatever\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n if (opposedResult.differenceSL < 6)\n {\n this.actor.addCondition(\"fatigued\", Math.floor(opposedResult.differenceSL / 2))\n }\n else if (opposedResult.differenceSL >= 6)\n {\n this.actor.addCondition(\"broken\");\n }\n}","kmsGLWGxCY8Z8jVG":"return args.skill?.name != game.i18n.localize(\"NAME.Intuition\");","kvaN100w0nBUlLbj":"let poisoned = this.actor.hasCondition(\"poisoned\")\nif (poisoned)\n{\n this.script.scriptMessage(\"Immunisé aux Poisons\")\n poisoned.delete()\n}","l8qFKSnMpy4P7XQR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","lCOdnKz8XpnkDs6Q":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();","lFO6XdfUODmFArqx":"args.actor.addCondition(\"bleeding\")","lII4KMRblqwFBlsV":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 15\n}\nlet skills = [\"Focalisation\", \"Charme\", \"Représentation (Danser)\"]\nlet skillAdvancements = [0, 6, 3]\nlet talents = [\"Attirant\", \"Distraire\", \"Imitation\"]\nlet traits = [\"Perturbant\", \"Vol (6)\", \"Lanceur de Sorts (Magie Mineure)\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Feux follets\", \"Sommeil\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","lOzkngzye4RmvALp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\nthis.script.scriptNotification(\"Ajout de \" + item.name)","lPudo1grrVp05i7a":"let loc = Math.floor(CONFIG.Dice.randomUniform() * 2) == 0 ? \"head\" : \"body\"\nlet damage = this.actor.system.characteristics.s.bonus + 6\n\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if(test.failed)\n {\n await this.actor.addCondition(\"stunned\")\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n }\n })","lQJ68n3y1xDyNicE":"return !args.options.sizeModifier && args.item?.system?.attackType != \"ranged\"","lSOAZ4FG44bT4jh1":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\n\nlet infectedData = infected.toObject();\nlet fearData = fear.toObject();\nfearData.system.specification.value = 2;\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData, infectedData], {fromEffect : this.effect.id})","lU4s3UTtBkU38djI":"this.actor.addCondition(\"entangled\")\nlet msg = `${this.actor.prototypeToken.name} perd 1 Blessure et reçoit l'état Empêtré.`\nthis.script.scriptMessage(msg)\nthis.actor.modifyWounds(-1)","lYYkGzqNshiYc7WI":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"poisoned\")\n}","laptAldsT0Fm1rDt":"let blunt = await Dialog.confirm({label : \"test\", content :`

Appliquer la réduction des Dégats contondants? (-3)

`})\n\nif (blunt)\n{\n args.modifiers.other.push({label : this.effect.name, details : \"Réduction des dégats contondants\", value : -3})\n}","lhemR8EP5tGNKout":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : \"Souffre d'Irrationnalité Effrayante\"}})\nawait test.roll();\nif (test.failed)\n{\n msg = `

@UUID[${this.effect.sourceItem.uuid}]{Irrationnalité Effrayante} Lancez: ${Math.ceil(CONFIG.Dice.randomUniform() * 10)}

`\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\n {\n msg += `

${this.actor.prototypeToken.name} reçoit également 1 Point de Corruption. Si il subit une mutation, il doit la déterminer sur la table des @Table[mutatemental]{Mutations Mentales}.

`\n let newCorruption = Number(this.actor.status.corruption.value) + 1\n this.actor.update({\"system.status.corruption.value\" : newCorruption})\n }\n\n this.script.scriptMessage(msg);\n}\n","ljpM7muMyxGD04EX":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","lol5J6h0pErzM71s":"return args.weapon?.system.properties.flaws.crewed","lvjcddwRiN9iGruy":"let test = await this.actor.setupCharacteristic(\"t\", { appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"challenging\" } })\nawait test.roll();\n\nif (test.failed) \n{\n let ageAdded = Math.ceil(CONFIG.Dice.randomUniform() * 10) + Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let ws = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let bs = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let s = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let t = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let ag = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let dex = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n\n let currentAge = parseInt(this.actor.system.details.age.value)\n\n let inline = `@ROLL`\n let msg =\n `

${this.actor.prototypeToken.name} vieilli de ${inline.replace(\"@ROLL\", ageAdded).replace(\"@TT\", \"2d10\")} et perd

\n

${inline.replace(\"@ROLL\", ws).replace(\"@TT\", \"1d10\")} Capacité de Combat

\n

${inline.replace(\"@ROLL\", bs).replace(\"@TT\", \"1d10\")} Capacité de Tir

\n

${inline.replace(\"@ROLL\", s).replace(\"@TT\", \"1d10\")} Force

\n

${inline.replace(\"@ROLL\", t).replace(\"@TT\", \"1d10\")} Endurance

\n

${inline.replace(\"@ROLL\", ag).replace(\"@TT\", \"1d10\")} Agilité

\n

${inline.replace(\"@ROLL\", dex).replace(\"@TT\", \"1d10\")} Dexterité

\n `\n this.script.scriptMessage(msg);\n\n let characteristics = duplicate(this.actor.system.characteristics)\n\n characteristics.ws.initial -= ws\n characteristics.bs.initial -= bs\n characteristics.s.initial -= s\n characteristics.t.initial -= t\n characteristics.ag.initial -= ag\n characteristics.dex.initial -= dex\n\n this.actor.update({ \"system.characteristics\": characteristics, \"data.details.age.value\": ageAdded + currentAge })\n}","lwVhn4bSXJ3eoT9q":"if (this.item.system.weaponGroup.value == \"basic\")\n{\n let slash = this.item.system.qualities.value.find(i => i.name == \"slash\")\n if (slash)\n {\n slash.value = \"2A\"\n }\n}","m3qEVO5fseV6KHXa":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\")\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","m58MpMZBblpq5LJu":"args.prefillModifiers.slBonus++;\nargs.prefillModifiers.successBonus++;\n","m8qBlbH7ROoqa22o":"return args.options.reload","mBcLf11upaHS8AQq":"this.actor.status.addArmour(1, {source: this.effect})","mJ9eMPub4epJSf00":"return args.weapon?.system.qualities.value.find(i => i.name == \"shield\") && this.actor.attacker","mPxmCsXYirAIT913":"let key = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.characteristics, this.effect.img), 1, \"Choose Characteristic\");\n\nthis.effect.updateSource({changes : [{key : `system.characteristics.${key[0].id}.modifier`, mode : 2, value : 10}]})","mRvLsSVxNyt8LVZb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GRRN3XAKIpEVCY7z\")\nlet data = item.toObject();\ndata.name += \" (A déterminer)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","mTnmPcjWmvScIBWY":"return args.skill?.name.includes(\"Focalisation\") || args.type == \"channelling\"","mV4Tmc0yfpL09KV7":"args.actor.addCondition(\"entangled\")","mYL4i1vNlMl4vFYy":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","ma0sWhebqwdRHWvY":"if (!args.flags.trained)\n{\n args.flags.trained = true;\n args.fields.modifier += 10;\n}","maKr58mvvyKxFyC3":"if (args.item.type == \"prayer\" && (args.item.damage.value || args.item.damage.dice))\n args.item.damage.value += \"+1\"","masOBNgSi5HYkf3m":"return args.type != \"cast\" && args.type != \"channelling\"","mgLGN1XPzPE4dReN":"args.fields.slBonus--;","mr8qm5Bg6k1idZ6Q":"return args.item?.name == \"Musicien (Luth)\"","mziJBUYcsrhkdcCJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{ \n this.actor.addCondition(\"prone\")\n}","n5RJqJL9fdRIxkuN":"if (this.actor.system.status.advantage.value > 0)\n{\n await this.actor.modifyAdvantage(-1);\n this.script.scriptNotification(\"Avantage soustrait\")\n}\nelse \n{\n return this.script.scriptNotification(\"Pas assez d'Avantages!\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","nCWAflBj7Si2BI1Q":"if (args.item.type == \"spell\" && args.item.system.lore.value != \"petty\")\n{\n args.item.cn.value = Math.max(4, args.item.cn.value * 2)\n}","nD2QVg3DrPK3foMf":"args.actor.setupSkill(\"Esquive\", { fields: { difficulty: \"average\" } }).then(async test => {\n await test.roll();\n if (test.failed) {\n await args.actor.addCondition(\"bleeding\")\n await args.actor.addCondition(\"entangled\")\n }\n })","nEaF3jbCiVYD8jia":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","nGTxNWBUBgTr87wU":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\n{ \n this.script.scriptMessage(`Becomes lodged in the armour or flesh of the opponent. See @UUID[${this.item.uuid}]{${this.item.name}}.`, {alias : this.item.name}, {blind: true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}\n ","nHJdlqbOP0ECgywb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CnydL8p3PVAuF98w\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","nSXzktHyNjGUXjaw":"return args.item?.system.isRanged","nYtAjSArsNbrU2ob":"if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\n{\n args.fields.modifier -= 10;\n}\nelse if ([\"wp\"].includes(args.characteristic))\n{\n args.fields.modifier += 10;\n}","naF5EWr1CBkYRZTK":"if (args.opposedTest?.attackerTest?.item?.system?.isRanged) \n{\n let choice = await Dialog.wait({\n title: this.effect.name,\n content: `

Eviter les dégâts avec ${this.effect.name}?`,\n buttons: {\n yes: {\n label: \"Oui\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"Non\",\n callback: () => {\n return false;\n }\n }\n }\n })\n\n if (choice)\n {\n args.abort = `${this.effect.name}: Dégâts annulés`\n }\n}","ncIjDE6TFx88IQA1":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\");","neaaVy6D6tfcst5P":"args.fields.slBonus += this.actor.characteristics.i.bonus;\n","ngMm7SgtVqVovFJG":"if (args.test.result.critical && args.test.result.critical != \"Total Power\")\n{\n args.test.result.other.push(` Bonecrusher Critical (+20) (only if Critical Cast selected)`)\n}","njPP9wDAsdh4WHIj":"if (args.totalWoundLoss > 0 && [\"trait\", \"weapon\"].includes(args.opposedTest.attackerTest.item?.type))\n{\n this.script.scriptMessage(`Infctée: ${args.actor.name} doit réussir un Test Facile (+40) de Résistance ou subir une @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Blessure Purulente}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","nkbTnaeBpthyhw4J":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\nlet current = this.actor.status.fortune.value\n\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\n\nthis.script.scriptMessage(`${this.actor.prototypeToken.name} voit ses Points de Chance augmenter de ${current} à ${fortunePoints + current}`)","nkdKBJ8ItqWiRAWL":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte ${this.item.name}.
\n Il bénéficie de +50 aux Tests de Natation et peut respirer sous l'eau.
Si il porte le masque pendant plus d'une heure ou bénéficie de l'un de ses effets, il est exposé à une @Corruption[moderate]{Corruption Modérée}.`,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} porté par ${this.actor.name} a été enlevé et a perdu ses propriétés. Cependant, ses effets perdurent pendant [[1d10+4]] jours, après quoi il faudra les supprimer manuellement.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n","nuIpPD4uaZRuJni8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","nvrFhHHVq3KzirlR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\n","nxNqWmmF6mJTnrLo":"return args.weapon?.system.usesHands.includes(this.item.system.location.key);","nzh8d46l1ikhkz8Q":"return (args.type == \"weapon\" && (args.item.system.weaponGroup.value == \"blackpowder\" || args.item.system.weaponGroup.value == \"engineering\")) || (args.type == \"cast\" && args.item.system.lore.value == \"fire\")","o1zD8mej9TWKNxUq":"args.fields.slBonus -= 1;","o3JUBKLvE6bBxK2n":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" } })\nawait test.roll();\nif (test.failed) \n{\n await this.actor.addCondition(\"prone\")\n let injury = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\");\n injury = injury.toObject()\n let toes = Math.clamped(Math.abs(test.result.SL) + 1, 1, 5)\n injury.system.location.key = this.item.system.location.key[0] + injury.system.location.value\n if (injury.system.location.key[0] == \"r\")\n {\n injury.system.location.value = `${toes} Right ${injury.system.location.value}s`\n }\n else if (injury.system.location.key[0] == \"l\")\n {\n injury.system.location.value = `${toes} Left ${injury.system.location.value}s`\n }\n setProperty(injury, \"system.wfrp4e.count\", toes)\n this.actor.createEmbeddedDocuments(\"Item\", [injury])\n}","o88xuUConwt0vFLw":"let points = this.effect.sourceTest.result.overcast.usage.other.current;\n\nthis.actor.update({\"system.status.fortune.value\" : this.actor.system.status.fortune.value + points});\n\nthis.script.scriptMessage(`Gagne ${points} Points de Chance`)","oDNfCNyt5KaUYmg2":"if(args.opposedTest.result.winner == \"defender\")\n{\n let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\n let msg = `Résultat ${roll}.`\n if (roll >= 7)\n {\n msg = `L'attaque touche avec un DR de ${roll - 6}.`\n }\n this.script.scriptMessage(msg, {blind: true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","oEsUsI74yGTZ9CwU":"return args.item?.name == game.i18n.localize(\"NAME.CharmAnimal\")","oGdsGPgJWcyWkiWl":"this.actor.addCondition(\"broken\")\n\nif (this.actor.has(game.i18n.localize(\"NAME.Undead\")))\n{\n this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\n}","oHenUKtaS3jT5xQn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4xF7M6ylIiGntekh\")\nitem = item.toObject()\nitem.name = this.effect.name\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\n","oPg4se8iQRD14kmB":"let filters = [\n {\n property : \"type\",\n value : \"weapon\"\n },\n {\n property : \"system.weaponGroup.value\",\n value : [\"twohanded\", \"polearm\"]\n }\n]\n\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 1, \"Choisissez une Arme d'Hast ou à Deux Mains\")\nitems = items.map(i => i.toObject())\n\nitems.forEach(i => equip(i))\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","oV81zgbZsuTFG6L2":"let caster = this.effect.sourceActor;\n\nthis.actor.modifyWounds(caster.system.characteristics.fel.bonus);\n\nthis.script.scriptMessage(`Guérison de ${caster.system.characteristics.fel.bonus} Blessures`);","oW1gtYVT5nrxDjM7":"return args.characteristic != \"ag\"","oWM43EdUiyHgUlfW":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.ConsumeAlcohol\"))\n args.test.preData.canReverse = true","oWa7RkScnl6lR5vd":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data])\n \n this.script.scriptMessage(`Test de Force Mentale échoué, ${this.actor.prototypeToken.name} @UUID[Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP] pour [[1d10]] heures`)\n }\n}","obIXhQXKFyyQoNNV":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"average\" } }).then(async test => {\n await test.roll()\n if (test.failed) {\n this.actor.modifyWounds(-1);\n this.script.scriptMessage(\"Subit 1 Dégat\")\n }\n})","ocBW3osTFnb5JCfe":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","ofddAHvzn1xUueSG":"args.AP.head.value -= tinDifference(args.AP.head.layers)\nargs.AP.body.value -= tinDifference(args.AP.body.layers)\nargs.AP.lArm.value -= tinDifference(args.AP.lArm.layers)\nargs.AP.rArm.value -= tinDifference(args.AP.rArm.layers)\nargs.AP.rLeg.value -= tinDifference(args.AP.rLeg.layers)\nargs.AP.lLeg.value -= tinDifference(args.AP.lLeg.layers)\n\nfunction tinDifference(layers)\n{ \n let metalAP = layers.filter(i => i.metal).reduce((prev, current) => prev + current.value, 0)\n\n let tinAP = layers.filter(i => i.metal).reduce((prev, current) => prev + Math.max(0, current.value - 2), 0)\n\n return metalAP - tinAP;\n}","ogJBAXTXyhTqACPO":"return args.item?.system.attackType != \"melee\"","ohl803m0tUwNfKAk":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 5 - this.actor.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","okW06V9UiPC4Vcrn":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n}\nlet skills = [\"Calme\", \"Esquive\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Vigilance\", \"Déterminé\"]\nlet trappings = [\"Veste de cuir\", \"Jambières de cuir\", \"Callote de cuir\", \"Arme simple\", \"Lance\", \"Bouclier\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","okr3TtzpFoefUuJS":"let item = await fromUuid('Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX')\nlet data = item.toObject();\ndata.system.location.value = \"Collar Bone\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","oqgd9G6oI1ncPYLw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CV9btQn09S9Fn8Jk\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","p222EiR8RRtlPm31":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nreturn test.failed;","pAgiAGyaLJY10894":"return args.skill?.name == game.i18n.localize(\"NAME.Charm\");","pBMioPUtDn1mk9f5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5KP9sOoLSGvj9EXp\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","pG5OVokZzCRHIrwz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mgeiaDZXei7JBEgo\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","pHyXdPnWwoFrUA5n":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\"));","pLKv4moua6XhNdmA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\nlet data = item.toObject();\ndata.name += \" (Woodlands)\";\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect : this.effect.id})","pNPjXEoQGHLKzq0r":"let talent = this.actor.has(\"Magie des Arcanes (Lumière)\", \"talent\")\nlet demon = this.actor.has(game.i18n.localize(\"NAME.Daemonic\"))\n\nif (!talent)\n{\n await this.actor.addCondition(\"blinded\")\n}\n\nif (demon)\n{\n await this.actor.addCondition(\"stunned\")\n}","pPV9oEydXb7oi6jX":" if (args.totalWoundLoss > 0)\n {\n args.actor.addCondition('ablaze')\n }","pR4Q2OnPxXtwRVli":"let criticals = this.actor.itemTypes.critical;\n\nif (criticals.length)\n{\n this.script.scriptNotification(\"Ne peut subir de Blessures Critiques\");\n this.actor.deleteEmbeddedDocuments(\"Item\", criticals.map(i => i.id))\n}\n\nif (getProperty(args.data, \"system.status.wounds.value\") == 0)\n{\n this.script.scriptNotification(`Endormi pour ${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds`)\n}","pnB9TzSEytkxk3Rb":"return this.actor.hasSystemEffect(\"infighting\")","pq1YQffxtOcqCRTn":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {appendTitle: ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n this.actor.addCondition(\"prone\")\n}","px7eEdhOEt7zOTrq":"return [\"int\", \"t\", \"wp\", \"i\"].includes(args.characteristic)","pzimrxrqpv282Oqb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.TaYriYcJkFuIdBKp\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\n","pzknBcJtZWeliE27":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\") || args.item?.name == game.i18n.localize(\"NAME.Cool\")","q0LvphC8RDSyR0oY":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\n ws : game.wfrp4e.config.characteristics.ws,\n t : game.wfrp4e.config.characteristics.t,\n ag : game.wfrp4e.config.characteristics.ag,\n wp : game.wfrp4e.config.characteristics.wp\n}, this.effect.img), 1, \"Choisir une caractéristique\");\n\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","q3nRyXaxksdCiLFM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.j6v78dnOOdCB6c3d\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","qAEZgtu5CrfUkxhx":"if (args.test.options.staunchBleeding) \n{\n if (args.test.succeeded) \n {\n let staunch = Number(args.test.result.SL) + 1\n if (args.test.options.fieldDressing && args.test.result.reversed)\n {\n staunch = Math.min(1, Number(args.test.result.SL)) + 1\n }\n args.test.result.other.push(`${this.actor.name} guérit ${staunch} états Hémorragiques du patient.`)\n }\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\n {\n args.test.result.other.push(`Le patient est victime d'une @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Infection Mineure}.`)\n }\n}","qK4q4o6cQhcGzFX3":"let fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet leader = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vCgEAetBMngR53aT\")\nlet fearData = fear.toObject();\nlet leaderData = leader.toObject();\nfearData.system.specification.value = this.effect.sourceTest.result.overcast.usage.other.current; \ntalents = new Array(1 + this.effect.sourceTest.result.overcast.available).fill(leaderData); // Assume any unused overcast is for war leader\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData].concat(talents), {fromEffect : this.effect.id})","qSwCYMMiIHmSV1X5":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\n effectData.duration.seconds = 10800\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"None left!\", \"error\")\n}","qT0WBPxLMMO9gvCd":"if (!this.actor.has(\"Vision Nocturne\") && !this.actor.has(\"Vision Nocturne\", \"talent\") && !this.actor.hasCondition(\"blinded\"))\n{\n this.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.nightshroud\" : true})\n}","qUwnVlWpsmDom3RK":"args.fields.modifier -= 5;","qZschZU0nee0kJlk":"args.fields.modifier -= 30;","qaVde0sTuMBRi2nl":"return [\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","qcyl98GYD55BkJsD":"this.actor.status.encumbrance.state = 0;\nthis.actor.status.encumbrance.pct = 0;","qijgjcOBCDmhglRX":"return args.skill?.name == game.i18n.localize(\"NAME.SleightOfHand\");","qjli5evn8UA9uTeZ":"return args.actor.uuid == this.effect.sourceActor.uuid;","qmOt7h17hGAKqQe0":"\nlet choice = await Dialog.wait({\n title: this.effect.name,\n content: `

${this.effect.name}: Est-ce que l'attaque magique ou à distance provient de l'extérieur du Dome?

`,\n buttons: {\n yes: {\n label: \"Oui\",\n callback: () => {\n return true;\n }\n },\n no: {\n label: \"Non\",\n callback: () => {\n return false;\n }\n }\n }\n})\n\nif (choice)\n{\n\targs.ward = 6;\n}","qu194dVXm9Vx1TGk":"if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target)) {\n\n let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\n let ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\n if (ones > SL) {\n args.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`)\n }\n}","quPcuKsq2fcild4a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"easy\"}, context: {failure : `${this.effect.name}: Vomit!`} })\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","qxzhPtysAjPWspKf":"if (this.actor.has(\"Mort-vivant\") || this.actor.has(\"Démoniaque\"))\n{\n this.script.scriptNotification(`Ne peut entrer ${this.effect.name}!`);\n}","r6hi5vMdLhTaaPfb":"args.actor.details.move.value += this.effect.sourceTest.result.overcast.usage.other.current","rCh3ltUrUMovd2Kc":"if (this.actor.hasCondition(\"surprised\"))\n{\n this.script.scriptNotification(\"Ne peut être surpris\");\n this.actor.removeCondition(\"surprised\");\n}","rF0Z3hTUUnSxL3Mq":"let armour = (await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")).toObject()\nlet bite = (await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")).toObject()\nlet fear = (await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")).toObject()\nlet nightVision = (await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\")).toObject()\nlet tracker = (await fromUuid(\"Compendium.wfrp4e-core.items.ClOlztW6hH8rslbp\")).toObject()\nlet weapon = (await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")).toObject()\n\narmour.name = \"Armure (Caché)\"\narmour.system.specification.value = 2\nbite.system.specification.value = 3\nfear.system.specification.value = 2\nweapon.system.specification.value = 4\nlet items = [armour, bite, fear, nightVision, tracker, weapon]\n\n\nlet belligerent = (await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")).toObject()//{Belligerent}\nlet bestial = (await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")).toObject()//{Bestial}\nlet big = (await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")).toObject()//{Big}\nlet blessed = (await fromUuid(\"Compendium.wfrp4e-core.items.5muSFXd6oc760uVj\")).toObject()//{Blessed (Ulric)}\nlet champion = (await fromUuid(\"Compendium.wfrp4e-core.items.4mF5Sp3t09kZhBYc\")).toObject()//{Champion}\nlet die = (await fromUuid(\"Compendium.wfrp4e-core.items.UsJ2uIOOtHA7JqD5\")).toObject()//{Die Hard}\nlet fast = (await fromUuid(\"Compendium.wfrp4e-core.items.9MjH4xyVrd3Inzak\")).toObject()//{Fast}\nlet frenzy = (await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")).toObject()//{Frenzy}\nlet immunity = (await fromUuid(\"Compendium.wfrp4e-core.items.IAWyzDfC286a9MPz\")).toObject()//{Immunity to Psychology}\nlet regenerate = (await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")).toObject()//{Regenerate}\nlet size = (await fromUuid(\"Compendium.wfrp4e-core.items.8slW8CJ2oVTxeQ6q\")).toObject()//{Size (Large)}\n\nblessed.system.specification.value = \"Ulric\"\nsize.system.specification.value = \"Grande\"\n\nlet optional = [belligerent, bestial, big, blessed, champion, die, fast, frenzy, immunity, regenerate, size];\n\nlet chosen = await ItemDialog.create(optional, \"unlimited\", \"Choisissez un Trai optionnel\");\n\nitems = items.concat(chosen || [])\nthis.script.scriptNotification(`Ajout de ${items.map(i => i.name).join(\", \")}`);\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\n","rIISfbCShejmJNKw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oRx92ByVNEBN6YkK\")\nlet data = item.toObject()\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n","rLMaVNEGdZ6xj5Au":"return ![\"i\", \"int\", \"fel\"].includes(args.characteristic)","rRfff55c7elyvbCb":"return this.actor.flags.useless[this.item.system.location.key] && args.weapon?.system.usesHands.includes(this.item.system.location.key[0] + \"Arm\")","rUGSx06BuBvX9kgf":"if (args.test.result.charging)\n{\n args.test.result.damage += 1\n args.test.result.additionalDamage += 1\n if (!args.test.result.resolute) {\n args.test.result.breakdown.damage.other.push({label : this.effect.name, value : this.item.Advances});\n args.test.result.resolute = true // Prevent duplicate messages\n }\n}\n","rVpPNILEzWL9lj6b":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kJNAY1YRaCy9IgmT\")\nlet terrorTraitItem = item.toObject()\nterrorTraitItem.system.specification.value = Number(this.effect.item.system.specification.value) \nthis.actor.createEmbeddedDocuments(\"Item\", [terrorTraitItem]);","rXMylpnEtZpwou6x":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\n{\n await test.roll()\n if (test.failed)\n {\n this.actor.addCondition(\"fatigued\") \n }\n})","ramav4ymrDDkPKK4":"if (this.actor.hasCondition(\"bleeding\"))\n{\n this.actor.removeCondition(\"bleeding\");\n this.script.scriptNotification(\"Suppression d'1 état Hémmoragique\")\n}\nelse \n{\n this.script.scriptNotification(\"Aucun état Hémorragique\");\n}","ratP9ByLjQPiLlFK":"args.data.canReverse = true","rdaMhMyHrJjQ6vVC":"game.wfrp4e.utility.postFear(this.item.Advances, this.actor.name)","re1UFtxvRRjpPB7Z":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nF5z1OEhpi4t6a6S\");\nlet data = item.toObject();\ndata.system.location.key = this.item.system.location.key\nif (data.system.location.key[0] == \"r\")\n{\n\tdata.system.location.value = \"Right Ankle\"\n}\nelse if (data.system.location.key[0] == \"l\")\n{\n\tdata.system.location.value = \"Left Ankle\"\n}\n\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {skipLocationValue : true, fromEffect: this.effect.id})\n","red2bt4PGgIWAdTR":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n let effectData = this.item.effects.contents[0].convertToApplied();\n let minutes = Math.ceil(CONFIG.Dice.randomUniform() * 10) * 10;\n effectData.duration.seconds = 60 * minutes\n this.script.scriptMessage(`Durée: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n\tactor.applyEffect({effectData : [effectData]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Aucun disponible!\", \"error\")\n}","rgSwSeB3shIMVMb6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.x0WMGwuQzReXcQrs\")\nlet data = item.toObject(); \nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","rnioLwiJP7ps5Jwy":"if (args.item.type == \"skill\" && args.item.name == \"Corps à corps (Base)\")\n{\n args.item.system.modifier.value += 30;\n}","roKvPHDSpX4IV11C":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && args.characteristic != \"ag\"","rpxQU26BU7nwjtqY":"let location = this.item.system.location.key\nlet test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : `${this.effect.name}: Lâche l'objet!`}, skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}})\nawait test.roll();\n\n\nif (location && test.failed)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nreturn test.succeeded","rr4htuVq45onXdRG":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\ntest.roll();","rxB1AqfVMDqTRieE":"return ![\"ws\", \"bs\", \"ag\"].includes(args.characteristic) && args.skill?.name != game.i18n.localize(\"NAME.Perception\")","s0kTuDE0qv68V2KI":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFBF00\"}}));\n","s5bO0Sf0qpS27Tve":"await args.actor.addCondition(\"ablaze\", 3)\nawait args.actor.addCondition(\"prone\");","s6eZXfZkC1My6EXl":"let lore = this.effect.name.split(\" \")[2].toLowerCase();\nif (args.item.type == \"spell\" && args.item.system.lore.value == lore)\n{\n args.item.system.cn.value -= 1\n}\n","s7gJQdzuM3fz2zQK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\nlet data = item.toObject();\ndata.system.location.value = \"Hip\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n \nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}","s8idWt9YdMTRfnjV":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\nlet data = item.toObject();\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\ndata.name = item.name.replace(\"(Feature)\", \"\");\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","s8xU6OOZbbfo6VIw":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus\n","s94yKZ4o5XN4JWM1":"// Any attack with such ammunition which inflicts at least one Wound,\n// also inflicts one Bleeding Condition.\n\nif (args.totalWoundLoss > 0) {\n args.actor.addCondition(\"bleeding\")\n}\n","sAVpm7hFRHpbCLXm":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"i\"].includes(args.characteristic)","sB4KB9bT3nQhAoqG":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\n\nlet mainEffect = this.item.effects.contents[0];\nif (mainEffect.name.includes(\"\"))\n{\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choisissez le Savoir\");\n if (choice.length)\n {\n mainEffect.update({name : mainEffect.name.replace(\"\", choice[0].name)})\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\n }\n}\n\nthis.effect.delete();","sHfkTRqTWPg2JAGN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","sKO8TcLIkCTnFvXu":"args.abort = true;\nthis.script.scriptNotification(`Ne peut utiliser ${this.item.system.location.value}!`, \"error\")","sNSfDBIA2k17hPYI":"let ablaze = this.actor.hasCondition(\"ablaze\");\nif (ablaze)\n{\n\tablaze?.delete();\n\tthis.script.scriptNotification(\"Ignore En Flammes\");\n}\n","sSMg43ZjnNmpytfj":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\nawait test.roll();\n","sUHuj00IpoZ7Gd03":"return args.skill?.name != game.i18n.localize(\"NAME.Swim\");","sWyO1DNaqb2EdHoW":"if (!this.actor.items.getName(game.i18n.localize(\"NAME.Frenzy\"))) // Either frenzy trait or psychology\n{\n // Add Frenzy psychology\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\n let data = item.toObject();\n data.effects[0].disabled = false;\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n}\n\nthis.script.scriptMessage(`

En buvant cette potion, ${this.actor.prototypeToken.name} est devenu sujet à la Frénesie. Cette Frénésie dure [[1d10]] Rounds, et ne peut pas se terminer avant.

`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) ","sYlGRLApZ3Ub24ea":"this.actor.system.status.addArmour(3, {source: this.effect.name, magical: true})","sZwLitzwKBTaFca3":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\")\nlet data = item.toObject();\ndata.name = data.name.replace(\"Cible\", \"Peaux vertes, Mort-vivant, Chaos\")\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","sagKJM6oDFlw4ED2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nreturn test.failed;","sbK1a7txpSoXFzyB":"if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target)) {\n\n let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\n let ones = Number(args.test.result.roll.toString().split(\"\").pop())\n\n if (ones > SL) {\n args.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\n args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`)\n }\n}","scfm5iWWBxWI6QaK":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nfear = fear.toObject();\nfear.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","sgS9rblPkQB36C8S":"if (this.item.name.includes(\"(\"))\n{\n\tlet trade = this.item.parenthesesText;\n\tif (trade?.toLowerCase() != \"any\")\n\t return this.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"any one\", trade)})\n}\n\nlet index = game.packs\n.filter(i => i.metadata.type == \"Item\")\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Trade\")))\n.map(i => {\n\ti.id = i._id\n\treturn i\n})\n\nlet choice = await ItemDialog.create(index, 1, \"Choisissez une compétence Métier\")\nlet text;\nif (!choice[0])\n{\n let custom = await ValueDialog.create(\"Saisissez une spécialisation de Métier\", \"Custom Trade\"); \n text = custom || \"\"\n}\nelse \n{\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\n}\n\nawait this.item.updateSource({name : this.item.name.replace(\"(Any)\", \"\").replace(\"(any)\", \"\").trim() + ` (${text})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"any one\", text)});","shkBUtUuMPDKvFm7":"let test = await this.actor.setupSkill(\"Esquive\", {fields : {difficulty : \"average\"}})\nlet caster = this.effect.sourceActor\n\nlet fallen = this.effect.sourceTest.result.SL + caster.characteristics.wp.bonus\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n this.script.scriptMessage(`${this.actor.prototypeToken.name} tombe de ${fallen} mètres`)\n}","skVq3eDEYKFF2iZp":"// I'm assuming the endurance test specified is for the end-round check\nawait this.actor.addCondition(\"poisoned\", 4);\n","sm9d5lk6cM0OuUkf":"this.actor.applyFear(Math.min(4, this.effect.sourceTest.result.overcast.usage.other.current))","sx7Ikn8WW00gBFb4":"let location = (Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"r\" : \"l\") + \"Arm\"\n\nif (location == \"lArm\")\n{\n\tthis.script.scriptNotification(\"Résultat : gauche\")\n}\nelse if (location == \"rArm\")\n{\n\tthis.script.scriptNotification(\"Résultat : Droite\")\n}\n\nthis.effect.updateSource({\"flags.wfrp4e.location\" : location});\n\nif (location)\n{\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}\n\nlet roll = await new Roll(\"1d10\").roll()\n\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));\n\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","syBgPp7rOymCZejX":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\")\n}","syqqBkyP5tGqZ78t":"this.actor.has(\"Immunité Psychologique\")?.delete();\n\nlet roll = await new Roll(\"1d10\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nthis.script.scriptNotification(`Immunité Psychologique a été supprimé de l'acteur, ajout de ${roll.total} états Brisé`)\nthis.actor.addCondition(\"broken\", roll.total, {\"flags.wfrp4e.blasted-mind\" : true})","t48hkacYdOpzWvK9":"args.options.beatBlade = true;","t56mnblo1kv3gM1M":"return args.skill?.name.includes(\"Corps à corps (Base)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\");","t8LYOuN5peEdWeXP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","tCIT1a12Gt6k2ohA":"let resistance\nif (this.item.name.includes(\"(\"))\n{\n\tresistance = this.item.parenthesesText\n}\nelse \n{\n resistance = await ValueDialog.create(\"Entrez la Résistance\", \"Résistance\") \n \n if (resistance)\n {\n this.item.updateSource({name : this.item.name + ` (${resistance})`})\n this.effect.updateSource({name : this.effect.name + ` (${resistance})`})\n }\n} \nthis.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"menace associée\", resistance)})\n\nif (resistance && !this.effect.name.includes(\"(\"))\n{\n this.effect.updateSource({name : this.effect.name += ` (${resistance})`})\n}","tDrs0aNIYmZPsOoS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\")\n}\n","tFAKRRRfTjQfdQz3":"this.actor.getActiveTokens().forEach(t => t.document.update({\"texture.tint\" : \"\"}));","tG1qGqzBLmAR3WHm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) \n{\n let add = 0\n\n if (test.result.roll % 11 == 0 || test.result.roll == 100) \n {\n add = 1 // can't use isFumble if no hit location\n }\n\n await this.actor.addCondition(\"stunned\", Math.max(1, Math.abs(test.result.SL)) + add)\n await this.actor.addCondition(\"blinded\", Math.max(1, Math.abs(test.result.SL)))\n\n}","tGVEV6TLl310mFLP":"let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\nif (args.applyAP && nonmagical) \n{\n let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\n args.modifiers.ap.ignored += nonmagical\n args.modifiers.ap.details.push(\"\" + this.effect.name + \": Ignore les PA non-magiques (\" + nonmagical + \")\");\n}","tKBq1nGZo8t6vvQ6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5hH73j2NgPdsLCZN\");\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","tNTO1LVN7JqHf4YN":"if (args.test.characteristicKey == \"wp\") \n{\n if (args.test.failed)\n {\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"malaise\"]])\n this.script.scriptMessage(`Test de Force Mentale échoué, ${this.actor.prototypeToken.name} subit @Condition[Malaise] pour [[1d10]] heures`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","tUwP7TjrOOOnaCYJ":"let fatigued = this.actor.hasCondition(\"fatigued\")\nif (fatigued)\n{\n this.script.scriptNotification(`Suppression de ${fatigued.conditionValue} états Fatigué`)\n fatigued.delete(); \n}\nelse \n{\n\tthis.script.scriptNotification(`Aucun état Fatigué`)\n}","tcZug8ehU6lyYBd9":"return args.skill?.name != \"Projectiles (Poudre noire)\"","tdICiJ26rJrDbxT6":"return args.characteristic != \"i\"","tn6SwmjAuNzqE6dx":"let damage = 0\nlet test = await this.actor.setupSkill(\"Esquive\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();\n\nif (test.succeeded)\n{\n damage = 10;\n}\nelse if (test.failed)\n{\n damage = 20;\n}\n\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", hideDSN: true, suppressMsg : true}))","tnE8LF6E3svIlLca":"return args.skill?.name == game.i18n.localize(\"NAME.Research\");","tnilBagajWM8UGQt":"return args.item?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\")","toSrgcvWq9b5eN0K":"let location = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN: true})\n\nthis.item.updateSource({name : `${this.item.name} (${location.description})`})\nthis.script.scriptMessage(`Localisation: ${location.description}`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","tolkNN5P7oOC8GKZ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\nawait test.roll();\n\nif (test.failed)\n{\n let sourceActor = this.effect.sourceActor;\n if (sourceActor)\n {\n this.script.scriptMessage(await this.actor.applyBasicDamage(sourceActor.system.characteristics.wp.bonus, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}))\n }\n}","u3olS2p7Ls1JXfAH":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"mutatephys\", {}, \"Tzeentch\"));","u5dNZ0s3lWfL8KFb":"return args.fields.charging","u6CYMSZADrfXd48Q":"args.fields.modifier += 20;","uACa6u4JLNMRgFlr":"const talents = await Promise.all([\"Assaut féroce\", \"Pied marin\"].map(game.wfrp4e.utility.findTalent))\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","uAy4w7y8Uu9POF8C":"args.item.system.qualities.value.push({name : \"impact\"})","uLBDnWC3S0lRitbj":"let test = await this.actor.setupCharacteristic(\"int\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\n\nif (opposedResult?.winner == \"attacker\")\n{\n if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\n {\n this.actor.addCondition(\"unconscious\")\n await this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Reçoit un Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n else \n {\n await this.actor.addCondition(\"stunned\", 1 + opposedResult.differenceSL);\n }\n}\nelse \n{\n return false;\n}","uNYstk3eXmWamhzs":"args.actor.addCondition(\"blinded\")","uOHAsKlkFuIaAmjb":"args.actor.modifyWounds(1)","uSwkYENTOcnfRrqA":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) && args.weapon?.system?.attackType != \"melee\"","ucF4aiJ1gpDB333G":"if (args.test.options.catfall && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target) && !args.test.result.catfall)\n{\n args.test.result.other.push(`${this.effect.name}: Dommages de chutes réduit de ${Number(args.test.result.SL) + 1} mètres`)\n args.test.result.catfall = true; // Prevent duplicate messages\n}","ugL5IBB6R2yWyMWd":"if (args.totalWoundLoss > 0)\n{\n let apply = await Dialog.confirm({title : this.effect.name, content : `

Appliquer les dégats de ${this.effect.name}? L'attaquant doit avoir utilisé ses mains nues ou une arme de mêlée faite de métal.`})\n if (apply)\n {\n \n let damage = 5 + this.actor.characteristics.wp.bonus;\n \n let loc = args.opposedTest.attackerTest.weapon?.system.usesHands[0] || \"rArm\";\n \n let APatLoc = args.opposedTest.attacker.system.status.armour[loc];\n \n let metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\n \n let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\n \n damage -= (APused + args.opposedTest.attacker.system.characteristics.t.bonus)\n \n let msg = await args.opposedTest.attacker.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\n msg += ` (${metalAP} PA métalliques ignorés sur ${game.wfrp4e.config.locations[loc]})`\n this.script.scriptMessage(msg)\n }\n}","upfK6GM33qZCZjll":"return args.item?.name != \"Musicien (Luth)\"","uwdQvZtzy2HVeEzx":"if (args.totalWoundLoss > 0)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData());\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\n \n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\n await test.roll();\n if (test.failed)\n {\n this.script.scriptMessage(\"\" + args.actor.name + \" subit un @Table[critbody]{Blessure Critique} au torse\", {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n }\n })\n}\n","ux3jaLpAUhZ5YqA6":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\") && args.item?.name != game.i18n.localize(\"NAME.Cool\")","v00nVCRKqqRvY28t":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\", 3)\n}\n","v4CCxVaVGf9i8U7X":"let cured = await Dialog.wait({\n title : this.effect.name,\n content : \"

Entrez le nombre de Poisons/Maladies soignés

\",\n buttons : {\n confirm : {\n label : \"Confirmer\",\n callback : (dlg) => {\n let input = dlg.find(\"input\");\n value = parseInt(input[0].value);\n return value;\n }\n }\n }\n})\n\n\nlet damage = 0;\n\nlet rolls = new Array(cured).fill(\"\").map(i => `max(0, 1d10 - ${this.actor.system.characteristics.fel.bonus})`)\n\nlet test = new Roll(`${rolls.join(\" + \")}`);\nawait test.roll();\ntest.toMessage({speaker : {alias : this.actor.name}, flavor : this.effect.name});\nthis.script.scriptMessage(await this.actor.applyBasicDamage(test.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true }))","v4ITTsSY9EvCbhZP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","v5xrDWcrTNFJkyQB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Projectiles (Arc)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Arc long\",\n },\n {\n type : \"ammunition\",\n name : \"Flèche\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `

\n Ajouter l'ption?\n

\n
    \n
  1. Ranged (Bow) +10 and a Longbow with 12 Arrows
  2. \n
\n `,\n buttons : {\n 1 : {\n label : \"Oui\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"Non\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","v6LIG7EwWYALxCpP":"return !this.effect.getFlag(\"wfrp4e\", \"trained\")?.includes(\"entertain\") || (!args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Play\")))","vFUVWZ1l8wpTjLcx":"if (!this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))\n return\n\nlet caster = this.effect.sourceActor;\nif (caster) \n{\n let wp = caster.system.characteristics.wp\n if (this.actor.system.characteristics.wp.value >= wp.value)\n {\n this.script.scriptNotification(\"La cible a une Force Mentale supérieure, aucun effet\")\n return\n }\n this.actor.applyBasicDamage(wp.bonus, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL })\n}","vJQRBxDfPwHens0a":"if (args.totalWoundLoss > 0) \n{\n args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\n await test.roll();\n if (test.failed) \n {\n await args.actor.addCondition(\"poisoned\")\n this.script.scriptMessage(await args.actor.applyBasicDamage(3, {suppressMsg : true, damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL }))\n }\n })\n}","vM2BPwYhHQaBAt2C":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.KII1gWnxIZ8HzmU5\");\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","vNp9wgdSvnNEjZyS":"args.fields.slBonus -= 2; ","vPG4rV640aSzKzxe":"return !this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","vS2D9QUslR7ZtXXm":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nif (test.failed)\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData())\n\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\n}","vSDMygIT9nNvEGWG":"// Each time the blade is used, the GM should secretly roll a d10.\n// On a 1, its poison has run dry, \n// and the next time it is employed it will shatter.\n\nif (Math.ceil(CONFIG.Dice.randomUniform() * 10) == 1) {\n this.item.setFlag(\"wfrp4e\", \"brittle\", true)\n ChatMessage.create({\n content: `\n ${this.item.name} n'a plus de Poison. Il se brisera à sa prochaine utilisation.`, \n whisper: ChatMessage.getWhisperRecipients(\"GM\"),\n blind: true\n })\n}\n","vY3xeTTL3ghPrJpN":"this.actor.addCondition(\"entangled\");","vZ5HCrhY8e4R1TrG":"let eye = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\nlet nose = await fromUuid(\"Compendium.wfrp4e-core.items.SpPRZZRHxly7uo2G\")\nthis.actor.createEmbeddedDocuments(\"Item\", [eye, nose]);","vc4bELo0cWYoILfB":"let choice = await ItemDialog.create(this.actor.itemTypes.disease, 1, \"Choisissez une Maladie à soigner (doit avoir été contracté naturellement)\")\n\nthis.script.scriptMessage(`Guérison de ${choice[0]?.name}`);\nchoice[0].delete()","vc8eVKtyjtOGvWlK":"if (!this.actor.hasCondition(\"entangled\"))\n{\n this.effect.delete();\n}","vcM0IgsYVmfWrlO3":"fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\").then(item => {\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\n})","vgfs0DXvF5iKrz1M":"return args.characteristic != \"ag\" || this.item.getFlag(\"wfrp4e\", \"passed\")","vj3zArmX27vCxYJW":"return ![\"NAME.Perception\", \"NAME.Navigation\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","vjyTKcNrJzX4XWnS":"let SL = parseInt(this.effect.sourceTest.result.SL)\nif (SL < 0)\n SL = 0\nthis.actor.addCondition(\"fatigued\", 1 + SL)","vuzRRj5d9XdNYx3o":"let broken = this.actor.hasCondition(\"broken\")\nif (broken)\n{\n broken.delete();\n this.script.scriptNotification(\"Etat Brisé supprimé\")\n}","vvVhAqreedtmOR9b":"args.totalWoundLoss = Math.max(0, args.totalWoundLoss - 1)\nargs.modifiers.other.push({label : this.effect.name, value : -1)","vvdo1NxjmGVkmFCT":"await this.actor.addCondition(\"stunned\");\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\nawait test.roll();\nif (test.failed)\n{\n\tawait this.actor.addCondition(\"prone\")\n\tawait this.actor.addCondition(\"stunned\")\n}\n \nlet location = this.item.system.location.key;\n\nif (location)\n{\n let dropped = this.item.system.weaponsAtLocation;\n\n if (dropped.length)\n {\n this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(\", \")}!`)\n for(let weapon of dropped)\n {\n await weapon.system.toggleEquip();\n }\n }\n}","vzMxIDjRlQSxXtCW":"// Remove the miscast if doubles rolled and succeeded\nif(args.test.succeeded && args.test.result.minormis && args.test.result.roll % 11 == 0)\n{\n delete args.test.result.minormis\n}\n// Decrement the major miscast to minor miscast\nelse if(args.test.succeeded && args.test.result.majormis && args.test.result.roll % 11 == 0)\n{\n delete args.test.result.majormis\n args.test.result.minormis = game.i18n.localize(\"ROLL.MinorMis\")\n}","w3r54pKZQKaH2Yer":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nlet data = item.toObject();\nlet slOver = this.effect.sourceTest.result.slOver;\nlet overcast = this.effect.sourceTest.result.overcast\nslOver -= ((overcast.total - overcast.available) * 2) // If they used an overcast, subtract 2 SL for each one\nlet added = Math.floor(slOver / 3) || 0\ndata.system.specification.value = 1 + added; // For each +3 SL, add 1 specification\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","w4JKuTECFmu3YmTR":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\"))","w4zubIHP0XgMXsFe":"return !args.options.terror && !args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","w7K0lbxQKJ2tsc6f":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\nlet data = item.toObject();\ndata.system.specification.value = 60\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","wAETU6aTRr9d4oCU":"args.fields.slBonus++;","wAntJhgb8Og5vJXh":"args.options.staunchBleeding = true;","wS6OIR3QN4mOUHn0":"if (args.totalWoundLoss > args.actor.characteristics.t.bonus)\n{\n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\")).then(async test => {\n await test.roll()\n if (test.failed) {\n let disease = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\n disease = disease.toObject()\n disease.system.duration.active = true\n args.actor.createEmbeddedDocuments(\"Item\", [disease])\n }\n })\n}","wUlYLBT59Efys5aS":"args.actor.addCondition(\"prone\");","wbM7tpw4TxvadcWm":"let items = this.effect.itemTargets;\nlet msg = \"\";\nfor(let item of items)\n{\n if (item.system.properties.qualities.durable)\n {\n await item.update({\"system.qualities.value\" : []});\n msg += `

${item.name} per toutes ses Qualités

`\n }\n else \n {\n msg += `

${item.name} tombe en poussière!

` \n await item.update({name : item.name + \" (Poussières)\"})\n }\n}\nif(msg)\n{\n this.script.scriptMessage(msg);\n}","whUSkaR1yem21bXp":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 6,\n \"int\" : -5,\n \"wp\" : 0,\n \"fel\" : 10\n}\nlet skills = [\"Corps à corps (Base)\", \"Pistage\"]\nlet skillAdvancements = [8, 7]\nlet talents = [\"Charge Berserk\", \"Frappe précise\", \"Frappe blessante\"]\nlet traits = [\"Vol (8)\", \"Rage\", \"Essaim\", \"Pisteur\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`Could not find ${spell}`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","wsqNM4NHnwaAAQym":" args.applyAP = false;\n\n this.script.scriptNotification(\"Ce test ne s'applique seulement qu'aux criminels. Fermez cette fenêtre si ce n'est pas le cas.\");\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => \n {\n await test.roll();\n if (test.failed)\n {\n args.actor.addCondition(\"unconscious\");\n }\n });","wyTCozh9qGTx6yK0":"if (args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\n{\n\targs.abort = true;\n\tthis.script.scriptNotification(\"N'a pas besoin de faire de test de Peur ou de Terreur\");\n}","wzkxiKjxVEeNS1di":"let roll = await new Roll(\"1d10\").roll();\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\n\nawait this.actor.addCondition(\"deafened\", 3)\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty: \"average\" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"Gain a Broken Condition\", success : \"Avoided Broken Condition\"}})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"broken\")\n}","x2RLUUNB7BiIDYCP":"\n let difficulty = \"\"\n if (this.effect.name.includes(\"Modéré\"))\n difficulty = \"easy\"\n else if (this.effect.name.includes(\"Sévère\"))\n difficulty = \"average\"\n else\n difficulty = \"veasy\"\n \n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" dies from Blight\"}, fields: {difficulty}, skipTargets: true, appendTitle : \" - Blight\"})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"dead\");\n }\n ","x76tKw4L8dX00ikE":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\nlet data = item.toObject();\nsetProperty(data, \"flags.wfrp4e.breath\", \"fire\")\ndata.system.specification.value = 5\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","x8XK2fzzXCnSwfjt":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"))\nawait test.roll();\n\nif (test.succeeded)\n{\n\tthis.actor.removeCondition(\"prone\");\n}","x9G6Du5EWV6byf4C":"if (parseInt(this.effect.sourceTest.result.SL) >= 3)\n{\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 2)\n}\nelse \n{\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\n}","x9iKFYYc4Ocy8PTS":"let item = this.effect.getCreatedItems()?.[0];\nChatMessage.create({content : \"La grâce est au delà du style\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({\n \"nobles\" : \"Nobles\",\n \"guilders\" : \"Maitres de Guildes\",\n \"servants\" : \"Serviteurs\"\n}), 1, \"Choisissez un groupes\")\n\nlet name = choice[0]?.name\n\nif (!name)\n{\n return;\n}\n\nif (item)\n{\n item.update({\n name : item.name.split(\"(\")[0] + ` (${name})`, \n \"system.tests.value\" : item.system.tests.value.split(\"(\")[0] + ` (${name}`\n })\n}\nelse \n{\n item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\");\n let data = item.toObject();\n data.name += ` (${name})`\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\n}","xBpLQa7yBPczDMY8":" let scythe = (await fromUuid(\"Compendium.wfrp4e-core.items.CXg7XOFJwu4LZ9LM\")).toObject();\n scythe.name = \"Scythe of Shyish\";\n scythe.system.damage.value = \"WPB + 3\"\n scythe.system.equipped = true;\n scythe.img = this.effect.icon;\n scythe.system.qualities.value.push({name : \"magical\"})\n this.actor.createEmbeddedDocuments(\"Item\", [scythe], {fromEffect : this.effect.id})","xIRU2SaqLeWmqGDI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\")\nlet data = item.toObject();\ndata.name += \" (Disease)\"\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xL4S0H1RP8hhXW7c":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xneBqGOs1QS7kfUr\")\nlet data = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xLKAuD6yzwjAL6tJ":"return !args.weapon || args.weapon?.system.properties?.qualities.shield || !this.item.system.usesLocation(args.weapon)","xMhhVol8Is3DJ3gb":"if (this.effect.sourceTest.succeeded)\n{\n let blinded = 1 + this.effect.sourceTest.result.overcast.usage.other.count\n this.actor.addCondition(\"blinded\", blinded)\n}","xPDMpOvC1ZBVxrNg":"args.fields.modifier += 10;","xPwa3NftkpMBc2AO":"return ![\"ws\", \"s\", \"ag\"].includes(args.characteristic)","xQ3xR2Wf0wHFa76H":"return [\"ws\", \"bs\", \"fel\", \"dex\"].includes(args.characteristic) || args.weapon","xQnoRTHotZKrwPrx":"return args.type == \"cast\" && args.item?.system.lore?.value == \"shadow\"","xRTmMwNfdirjsi8X":"this.actor.addCondition(\"ablaze\");\n\nthis.actor.applyBasicDamage(this.effect.sourceTest.result.damage)","xRd6oA1QWLVpfoBm":"if (!this.actor.has(\"Vision Nocturne\"))\n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\");\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}","xS2su09zcza9du09":"if ([\"Mineure\", \"Modérée\", \"Majeure\"].includes(this.item.system.specification.value))\n{\n\treturn\n}\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({minor : \"Mineure\", moderate : \"Modérée\", major : \"Majeure\"}, this.item.img), 1, \"Choisissez la sévérite de la corruption\");\n\nthis.item.updateSource({\"system.specification.value\" : choice[0]?.name || \"\"})","xUpKYT7BZCSmAfUy":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[0].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Quantité insuffisante!\", \"error\")\n}","xYTkj8jhSVOSoLbC":"this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] = true;","xcy5GOUSZ0meIejZ":"if (args.test.isFumble)\n{\n args.test.result.other.push(\"@Table[warp-grinder-fumble]\")\n}","xgdhf0wlNP2cHIQx":"await this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","xgplXZMs459X7XXM":"// Apply changes when the mask is worn\n\nif (args.equipped) { \n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \n this.script.scriptMessage(`${this.actor.name} porte ${this.item.name}.
\n Il subit -20 à tout ses tests pour résister aux maladies.
\n Si il porte le masque pendant plus d'une heure ou bénéficie de l'un de ses effets, il est exposé à une @Corruption[moderate]{Corruption Modérée}.`,\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \n}\n\n// Notify of lingering effects when mask is removed\nelse if (!args.equipped)\n{\n await this.item.effects.contents[0].delete();\n await this.item.update({name : this.item.name += \" (Used)\"})\n this.script.scriptMessage(`${this.item.name} porté par ${this.actor.name} a été enlevé et a perdu ses propriétés. Cependant, les effets perdurent pendant [[1d10+4]] jours, après quoi ils devront être supprimés manuellement.`, \n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\n )\n \n}\n","xklncIMwQIespDxS":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"vhard\"}});\nawait test.roll();\ngame.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData())\n\nif (test.failed)\n{\n this.actor.addCondition(\"unconscious\");\n}","xnHobI9HojObLHMp":"args.applyTB = false;\nargs.applyAP = false;","xobGBJbgFjQCrwvq":"let roll;\nif (this.actor.has(game.i18n.localize(\"NAME.Daemonic\")) || this.actor.has(game.i18n.localize(\"NAME.Undead\")) || [\"Gobelin\", \"Orc\", \"Mort-vivant\"].includes(this.actor.system.details.species.value))\n{\n roll = await new Roll(`1d10 + ${this.effect.sourceTest.result.overcast.usage.other.current}`).roll()\n}\nelse \n{\n roll = await new Roll(`1d10`).roll()\n}\n\nroll.toMessage(this.script.getChatData())\nawait this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true})\n\nif (this.actor.has(\"Mort-vivant\") || args.actor.has(\"Démoniaque\"))\n{\n this.actor.addCondition(\"ablaze\")\n}","xpgXWoK2zDnG1uiF":"let stunned = args.actor.hasCondition(\"stunned\")\nif (stunned)\n setProperty(stunned, \"flags.wfrp4e.scriptData\", getProperty(stunned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet poisoned= args.actor.hasCondition(\"poisoned\")\nif (poisoned)\n setProperty(poisoned, \"flags.wfrp4e.scriptData\", getProperty(poisoned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet deafened = args.actor.hasCondition(\"deafened\")\nif (deafened)\n setProperty(deafened, \"flags.wfrp4e.scriptData\", getProperty(deafened, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet entangled = args.actor.hasCondition(\"entangled\")\nif (entangled)\n setProperty(entangled, \"flags.wfrp4e.scriptData\", getProperty(entangled, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet fatigued = args.actor.hasCondition(\"fatigued\")\nif (fatigued)\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet blinded = args.actor.hasCondition(\"blinded\")\nif (blinded)\n setProperty(blinded, \"flags.wfrp4e.scriptData\", getProperty(blinded, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet broken = args.actor.hasCondition(\"broken\")\nif (broken)\n setProperty(broken, \"flags.wfrp4e.scriptData\", getProperty(broken, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n\nlet prone= args.actor.hasCondition(\"prone\")\nif (prone)\n setProperty(prone, \"flags.wfrp4e.scriptData\", getProperty(prone, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","xq3RANOtmPhy77ne":"args.update({texture : {tint : \"#FFBF00\"}});","xqWxV9w5ezBQdJkZ":"return args.options.corruption;","xvGxwv7X0Vq3vNqb":"args.fields.modifier -= 10;","xvH4PKJasHcehOZz":"return args.skill?.name == `${game.i18n.localize(\"NAME.Lore\")} (${this.item.parenthesesText})`","y3agVFVBR8tVqWyx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\nawait test.roll();","yAL0YwZWVm8o1nxa":"if (this.actor.hasCondition(\"dead\") && !this.actor.gardenOfCorpses)\n{\n this.script.scriptMessage(\"[[3d10]] @UUID[Compendium.wfrp4e-core.actors.T79RqnDOAQLn3I1s]{zombies} sortent des décombres.\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n this.actor.gardenOfCorpses = true;\n // local storage is sufficient to prevent multiple messages\n}","yCgH3N9AurIiAv0i":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"(Sens)\"))\n{\n let tests = this.item.system.tests.value\n let name = this.item.name\n\n // If name already specifies, make sure tests value reflects that\n if (name.includes(\"(\"))\n {\n let sense = name.split(\"(\")[1].split(\")\")[0]\n tests = `${tests.split(\"(\")[0].trim()} (${sense})`;\n }\n else // If no sense specified, provide dialog choice\n {\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\n taste : \"Goût\",\n sight : \"Vue\",\n smell : \"Odorat\",\n hearing : \"Ouie\",\n touch : \"Toucher\"\n }, this.item.img), 1, \"Choisir un sens\");\n if (choice[0])\n {\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\n tests = `${tests.split(\"(\")[0].trim()} (${choice[0].name})`\n }\n }\n\n this.item.updateSource({name, \"system.tests.value\" : tests})\n}","yDvxF9llUYwJg0sE":"if (getProperty(args.data, \"system.loaded.value\") == true)\n{\n let repeaterValue = Math.ceil(CONFIG.Dice.randomUniform() * 10);\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value);\n let repeater = qualities.find(i => i.name == \"repeater\")\n if (repeater)\n {\n repeater.value = repeaterValue\n }\n else \n {\n qualities.push({name : \"repeater\", value : repeaterValue})\n }\n setProperty(args.data, \"system.loaded.amt\", repeaterValue)\n this.item.update({\"system.qualities.value\" : qualities});\n this.script.scriptNotification(\"Repeater \" + repeaterValue);\n}\nelse if (getProperty(args.data, \"system.loaded.value\") == false)\n{\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value).filter(i => i.name != \"repeater\");\n this.item.update({\"system.qualities.value\" : qualities});\n}","yFMvxecXAZ6T2O0S":"if (args.totalWoundLoss >= 1)\n{\n let roll = await new Roll(\"1d10\").roll();\n await roll.toMessage(this.script.getChatData());\n if (roll.total == 9)\n {\n this.script.scriptMessage(`Deux @UUID[Compendium.wfrp4e-eis.actors.cLOGeMqUty61nYB9]{Horreurs bleus de Tzeentch} sortent du corps de ${this.actor.name}, le tuant au passage.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }\n}","yIGItnshXI4W46cp":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\");","yMMzZ7daCqRlGT3N":"let item = args.opposedTest.attackerTest.item;\nif (!item.isMagical && (item.type == \"weapon\" || item.type == \"trait\"))\n{\n args.modifiers.other.push({label : this.effect.name, details : \"Suppression de la valeur de dommages\", value : -1 * (args.totalWoundLoss - args.opposedTest.result.differenceSL)})\n}\n","yPxYRObUiqAIhlNB":"this.actor.system.status.encumbrance.max += 1","yRRzSKlcN3L7rEEe":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Play\"));","yTmRoUstxHMso91c":"if (args.item.name == \"Résistance à la Magie\" && args.item.type == \"trait\")\n{\n args.item.system.specification.value = Number(args.item.system.specification.value) + 1\n}","yXUPiWuQ5o0JBY4i":"return args.skill?.name == game.i18n.localize(\"Endurance\") || args.characteristic == \"int\"","yatUu0cd7iKs50rq":"return args.skill?.name != game.i18n.localize(\"NAME.Track\");","ybxDG2ezvRx02LYx":"return !args.options.corruption","ynNCBAYwJFkTiXV1":"this.actor.system.status.addArmour(4, {source : this.effect})","ynV7tz0OdCwlsQp6":"let msg = \"\"\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\nmsg += `

${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}

`\n\nthis.script.scriptMessage(msg);","ynoHNXXCGRS6fTqF":"let msg = \"\"\n\nlet i_gain = (await new Roll(\"1d10\").roll()).total\n\nif (args.actor.characteristics.i.value <= 0)\n{\n i_gain += (await new Roll(\"2d10\").roll()).total\n}\n\nmsg = `${this.actor.prototypeToken.name} gagne ${i_gain} en Initiative`\n\nlet newValue = i_gain + args.actor.characteristics.i.modifier\n\nthis.actor.update({\"system.characteristics.i.modifier\" : newValue})\n\n\nlet hitloc = await game.wfrp4e.tables.rollTable(\"hitloc\")\n\nlet value = hitloc.result\nlet desc = hitloc.description\n\nthis.effect.updateSource({\"flags.wfrp4e.location\" : value})\n\nmsg += ` as eyes push out of their ${desc}`\n\nthis.script.scriptMessage(msg)","yzN7ZNlgCiSVJqsU":"let sourceItem = this.effect.sourceItem;\n\nif (sourceItem)\n{\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[1].uuid]})\n\tthis.script.scriptNotification(\"Appliqué après les effets\");\n}","z5HfNUrHy5MS3K7a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.scriptMessage(\"Reçoit un Point de Corruption\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","z926Cl2vxUfyLY0V":"if (![\"rArm\", \"lArm\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\n\treturn true\n\nreturn [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","z9NEbIUBsKMaTuCz":"if (args.opposedTest.result.hitloc && args.opposedTest.result.hitloc.value == \"head\") \n{\n args.actor.addCondition(\"entangled\")\n}","zA6TDttpwMSMl7D8":"// An imbiber must take a Consume Alcohol Test.\nthis.actor.setupSkill(game.i18n.localize(\"NAME.ConsumeAlcohol\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\n await test.roll()\n // If they succeed, \n // as a result of whatever potential futures they glimpse, \n // they can spend a Fortune Point within the next hour to reverse the dice of any failed Test.\n if (test.succeeded) {\n this.script.scriptMessage(`En raison des futurs potentiels entrevus, ${this.actor.prototypeToken.name} peut dépenser un Point de Chance durant la prochaine heure pour inverser le résultat d'un test échoué.`, \n {\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \n blind: true \n }) \n }\n})","zBHTIBU8OlYj1YIO":"args.fields.modifier += this.effect.sourceActor?.system.characteristics.wp.value;","zFYCaGR0wbFWjl4T":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\");","zK38Rl5t9zbFi4Se":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"bleeding\", 1);\n this.script.scriptNotification(\"Ajout d'Hemorragique\")\n}","zR4WAjzXHTZuiu5G":"let actor = this.actor;\nlet effect = this.effect;\nlet bleedingAmt;\nlet bleedingRoll;\nlet msg = \"\"\n\nlet damage = effect.conditionValue;\nlet scriptArgs = { msg, damage };\nawait Promise.all(actor.runScripts(\"preApplyCondition\", { effect, data: scriptArgs }))\nmsg = scriptArgs.msg;\ndamage = scriptArgs.damage;\nmsg += await actor.applyBasicDamage(damage, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne: false, suppressMsg: true })\n\nif (actor.status.wounds.value == 0 && !actor.hasCondition(\"unconscious\")) {\n await actor.addCondition(\"unconscious\")\n msg += \"
\" + game.i18n.format(\"BleedUnc\", { name: actor.prototypeToken.name })\n}\n\nif (actor.hasCondition(\"unconscious\")) {\n bleedingAmt = effect.conditionValue;\n bleedingRoll = (await new Roll(\"1d100\").roll()).total;\n if (bleedingRoll <= bleedingAmt * 10) {\n msg += \"
\" + game.i18n.format(\"BleedFail\", { name: actor.prototypeToken.name }) + \" (\" + game.i18n.localize(\"Rolled\") + \" \" + bleedingRoll + \")\";\n await actor.addCondition(\"dead\")\n }\n else if (bleedingRoll % 11 == 0) {\n msg += \"
\" + game.i18n.format(\"BleedCrit\", { name: actor.prototypeToken.name }) + \" (\" + game.i18n.localize(\"Rolled\") + bleedingRoll + \")\"\n await actor.removeCondition(\"bleeding\")\n }\n else {\n msg += \"
\" + game.i18n.localize(\"BleedRoll\") + \": \" + bleedingRoll;\n }\n}\n\nawait Promise.all(actor.runScripts(\"applyCondition\", { effect, data: { bleedingRoll } }))\nif (args.suppressMessage) {\n let messageData = game.wfrp4e.utility.chatDataSetup(msg);\n messageData.speaker = { alias: this.effect.name }\n messageData.flavor = this.effect.name;\n return messageData\n}\nelse {\n return this.script.scriptMessage(msg)\n}\n","zUv9e0A3OEXWY9Mv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\nlet data = item.toObject();\ndata.system.specification.value = 9 - this.actor.system.characteristics.s.bonus\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","zY4ZjY7uyKIKMYmX":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"fleshy-curse\"))\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\nawait test.roll();\nif (test.succeeded)\n{\n this.effect.delete()\n}","zadppy7FEbXvgUON":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 5\n }\n let skills = [\"Perception\", \"Escamotage\", \"Discrétion (Urbaine)\"]\n let skillAdvancements = [10, 10, 10]\n let talents = [\"Criminel\", \"Etiquette (Criminels)\"]\n let trappings = [\"Corde, 10 mètres\", \"Outils de crochetage\", \"Masque\"]\n let items = []\n \n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","zi8Z3NlwVj3IfgAW":"if (this.item.system.quantity.value)\n{\n\tthis.item.system.reduceQuantity();\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\n\tactor.applyEffect({effectData : [this.item.effects.contents[3].convertToApplied()]})\n}\nelse\n{\n\tthis.script.scriptNotification(\"Quantité insuffisante!\", \"error\")\n}","ziG9H5Kdb7xC3dFE":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","zk44dFEGkylB7kW6":" let modifier; let target = args.data.targets[0]\n if (target.actor.details.size.value == \"tiny\")\n modifier = 30\n if (target.actor.details.size.value == \"ltl\")\n modifier = 20\n if (target.actor.details.size.value == \"sml\")\n modifier = 10\n\t\n args.fields.modifier += (modifier || 0); // Offset size modifier ","zphxI8VSWbNQCMBy":"args.size = \"lrg\"","zqShIJnrRReGgP94":"let {added, removed} = this.effect.getFlag(\"wfrp4e\", \"propertiesChanged\");\n\nfor(let property of (added || []))\n{\n let hasValue = game.wfrp4e.config.propertyHasValue[property];\n if (!args.item.system.qualities.value.find(i => i.name == property))\n {\n args.item.system.qualities.value.push({name : property, value : (hasValue ? 2 : null)})\n }\n}\n\nfor(let property of (removed || []))\n{\n args.item.system.flaws.value = args.item.system.flaws.value.filter(i => i.name != property)\n}","zsiV6XEHlCNGLLPl":"return args.skill?.name == game.i18n.localize(\"NAME.SetTrap\");","zsoTVkHe4nHY1M52":"this.script.scriptMessage(await this.actor.applyBasicDamage(10 + parseInt(this.effect.sourceTest.result.SL), {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))","zzk2uRSFjFHB5kjw":"\nlet roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\nif (args.test.isFumble && roll == 1 && !args.test.result.misfire) {\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Résultat 1)\"\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\n}\nelse if (args.test.isFumble && roll != 1)\n args.test.result.other.push(\"Misfire Roll: \" + roll)"}); } \ No newline at end of file