execute store result bossbar boss_health value run data get entity @s Health
scoreboard players add @s[tag=!ravager_beast_roaring] mob_first_skill_counter 1
scoreboard players add @s[tag=!ravager_beast_charging] mob_second_skill_counter 1
execute if predicate kiwi2:chance_random_50 run scoreboard players add @s mob_third_skill_counter 1

execute if score @s mob_first_skill_counter matches 350 run tag @s add ravager_beast_charging
execute if score @s mob_first_skill_counter matches 350..399 run tp @s ~ ~ ~ facing entity @p[gamemode=survival] eyes
execute if score @s mob_first_skill_counter matches 350..399 if predicate kiwi2:chance_random_20 run playsound minecraft:entity.ravager.attack hostile @a[distance=..60] ~ ~ ~ 100 1.5
execute if score @s mob_first_skill_counter matches 350..399 if predicate kiwi2:chance_random_10 run particle angry_villager ~ ~4 ~ 2 0.2 2 1 5
execute if score @s mob_first_skill_counter matches 350..399 if predicate kiwi2:chance_random_10 run particle campfire_cosy_smoke ~ ~0.1 ~ 1.5 0 1.5 0.05 20
execute if score @s mob_first_skill_counter matches 400 if predicate kiwi2:chance_random_80 run playsound minecraft:entity.ravager.roar hostile @a[distance=..60] ~ ~ ~ 100 0.2
execute if score @s mob_first_skill_counter matches 400 if predicate kiwi2:chance_random_80 run playsound minecraft:entity.parrot.imitate.ravager hostile @a[distance=..60] ~ ~ ~ 100 0.5
execute if score @s mob_first_skill_counter matches 400 at @p[gamemode=survival] run summon armor_stand ^ ^ ^-1 {Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["ravager_beast_charge"]}
execute if score @s mob_first_skill_counter matches 400..420 if predicate kiwi2:chance_random_50 run playsound minecraft:entity.ravager.step hostile @a[distance=..60] ~ ~ ~ 100 0.9
execute if score @s mob_first_skill_counter matches 400..420 if predicate kiwi2:chance_random_20 run playsound minecraft:entity.generic.explode hostile @a[distance=..60] ~ ~ ~ 100 1.2
execute if score @s mob_first_skill_counter matches 400..420 if predicate kiwi2:chance_random_80 run particle explosion ~ ~ ~ 1.5 0 1.5 0.5 5
execute if score @s mob_first_skill_counter matches 400..420 run particle campfire_cosy_smoke ~ ~0.1 ~ 1.5 0 1.5 0.05 20
execute if score @s mob_first_skill_counter matches 400..420 as @e[distance=..5,tag=!ravager_beast,tag=!boss_check,type=!armor_stand] run tag @s add ravager_beast_charge_hit
execute if score @s mob_first_skill_counter matches 400..420 run tp @s ^ ^0.1 ^1 facing entity @e[tag=ravager_beast_charge,limit=1,sort=nearest] eyes
execute if score @s mob_first_skill_counter matches 420.. run kill @e[tag=ravager_beast_charge,limit=1,sort=nearest]
execute if score @s mob_first_skill_counter matches 420.. run tag @e[tag=ravager_beast_charge_hit] remove ravager_beast_charge_hit
execute if score @s mob_first_skill_counter matches 420.. run tag @e[tag=ravager_beast_thrown] remove ravager_beast_thrown
execute if score @s mob_first_skill_counter matches 420.. run tag @s remove ravager_beast_charging
execute if score @s mob_first_skill_counter matches 420.. run scoreboard players reset @s mob_first_skill_counter

execute as @e[tag=ravager_beast_charge_hit,tag=!ravager_beast_thrown] at @s run summon breeze_wind_charge ^ ^0.1 ^0.5 {Motion:[0.0,-1.0,0.0]}
execute as @e[tag=ravager_beast_charge_hit] run tag @s add ravager_beast_thrown

execute if score @s mob_second_skill_counter matches 230 run tag @s add ravager_beast_roaring
execute if score @s mob_second_skill_counter matches 230..260 run tp @s ~ ~ ~ facing entity @p[gamemode=survival]
execute if score @s mob_second_skill_counter matches 230..250 run title @a[distance=..20] actionbar {"text": "ROAR INCOMING", "color": "red", "bold": true}
execute if score @s mob_second_skill_counter matches 230 run playsound minecraft:entity.arrow.hit_player player @a[distance=..20] ~ ~ ~ 10 0
execute if score @s mob_second_skill_counter matches 230..233 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 0
execute if score @s mob_second_skill_counter matches 234..235 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 0.25
execute if score @s mob_second_skill_counter matches 236..238 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 0.5
execute if score @s mob_second_skill_counter matches 239..240 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 0.75
execute if score @s mob_second_skill_counter matches 241..243 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 1
execute if score @s mob_second_skill_counter matches 244..245 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 1.25
execute if score @s mob_second_skill_counter matches 246..248 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 1.5
execute if score @s mob_second_skill_counter matches 249..250 run playsound entity.wolf.growl player @a[distance=..30] ~ ~ ~ 1 1.75
execute if score @s mob_second_skill_counter matches 250 run playsound entity.ravager.roar hostile @a[distance=..50] ~ ~ ~ 10 0.5
execute if score @s mob_second_skill_counter matches 250 run playsound entity.ravager.attack hostile @a[distance=..50] ~ ~ ~ 10 0
execute if score @s mob_second_skill_counter matches 250 run playsound entity.ravager.celebrate hostile @a[distance=..50] ~ ~ ~ 10 0.75
execute if score @s mob_second_skill_counter matches 250 run playsound entity.generic.explode hostile @a[distance=..50] ~ ~ ~ 10 0.75
execute if score @s mob_second_skill_counter matches 250..260 run summon area_effect_cloud ~ ~ ~ {Particle:{type:"sweep_attack"},Radius:1f,RadiusPerTick:1.25f,Duration:8}
execute if score @s mob_second_skill_counter matches 250..260 run particle campfire_signal_smoke ~ ~ ~ 4 0 4 0.4 35
execute if score @s mob_second_skill_counter matches 250..260 as @a[distance=..12] run damage @s 1 kiwi2:ravager_beast_roar by @e[type=ravager,tag=wave_mob,tag=ravager_beast,limit=1,sort=nearest]
execute if score @s mob_second_skill_counter matches 260.. run tag @s remove ravager_beast_roaring
execute if score @s mob_second_skill_counter matches 260.. run scoreboard players reset @s mob_second_skill_counter

execute if score @s mob_third_skill_counter matches 800 run playsound minecraft:event.raid.horn master @a ~ ~ ~ 100000 0.75
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 3.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 3.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon pillager ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:crossbow"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 3.. run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 if score world MultiplayerScaling matches 5.. run summon vindicator ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],HandItems:[{id:"minecraft:iron_axe"},{}],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run summon evoker ~ ~ ~ {Tags:["ravager_beast_spawn","wave_mob"],DeathLootTable:""}
execute if score @s mob_third_skill_counter matches 800 run scoreboard players add @s mob_third_skill_counter 1
execute if score @s mob_third_skill_counter matches 802 run spreadplayers ~ ~ 1 20 false @e[tag=ravager_beast_spawn]
execute if score @s mob_third_skill_counter matches 802.. run scoreboard players reset @s mob_third_skill_counter