force_choke: type: task definitions: target script: - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - flag player.force.statistics.cast_choke:++ - cast slow <[target]> duration: amplifier:3 hide_particles:true no_icon:true no_clear - cast slow duration: amplifier:1 hide_particles:true no_icon:true no_clear - narrate "did 1" - wait 0.25s # Prevent other force powers from being used when healing - foreach as:power: - define expiration - define old_cooldown ].second||0> - if <[old_cooldown]> > <[expiration]>: - foreach next - flag player.force.cooldown.<[power]> expire:<[expiration]> - itemcooldown ].material> duration:<[expiration]> - narrate "did me a lot" - define previous_target <[target]> - repeat : - define target ;range=;raysize=]||null> - narrate "target: <[target].name>" - narrate "previous: <[previous_target].name>" - narrate "target exists: <[target].exists>" - narrate "previous target exists: <[previous_target].exists>" - if (<[target].exists> && <[previous_target].exists>) && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - narrate "WTF" - if !<[target].exists>: - narrate "huh 1" - cast slow remove <[previous_target]> - define previous_target null - wait - repeat next - if <[target]> != <[previous_target]>: - narrate "huh 2" - cast slow remove <[previous_target]> - hurt <[target]> cause:Magic - narrate "defining previous" - define previous_target <[target]> - else if <[target]> == null && <[previous_target]> == null: - cast slow remove - foreach as:power: - if !]>: - foreach next # if the old cooldown > new expiration, dont change anything. If it's less or equal, set it to 0 - if <[old_cooldown]> <= <[expiration]>: - flag player.force.cooldown.<[power]> expire:0 - itemcooldown ].material> duration:0 - stop - wait