<commit_before>local OVALE, Ovale = ...
local OvaleScripts = Ovale.OvaleScripts

do
	local name = "icyveins_demonhunter_vengeance"
	local desc = "[7.0] Icy-Veins: DemonHunter Vengeance"
	local code = [[
Include(ovale_common)
Include(ovale_trinkets_mop)
Include(ovale_trinkets_wod)
Include(ovale_demonhunter_spells)

AddCheckBox(opt_interrupt L(interrupt) default specialization=vengeance)
AddCheckBox(opt_melee_range L(not_in_melee_range) specialization=vengeance)

AddFunction VengeancePlayDefensively
{
	CheckBoxOn(opt_demonhunter_vengeance_defensive) or HealthPercent() <= 35 or IncomingDamage(5) >= MaxHealth() * 0.5
}

AddFunction VengeancePlayOffensively
{
	not VengeancePlayDefensively()
}

AddFunction VengeanceHealMe
{
	if (HealthPercent() < 70) Spell(fel_devastation)
	if (HealthPercent() < 70) Spell(soul_cleave)
	if (IncomingDamage(5) >= MaxHealth() * 0.5) Spell(soul_cleave)
}

AddFunction VengeanceDefaultShortCDActions
{
	if ((VengeancePlayOffensively() and (BuffExpires(demon_spikes) or not Talent(razor_spikes_talent))) or (VengeancePlayDefensively())) Spell(soul_barrier)
	
	if ((VengeancePlayDefensively() and (BuffExpires(demon_spikes_buff) or not HasArtifactTrait(defensive_spikes))) or VengeancePlayOffensively())
	{
		if (Charges(demon_spikes) == 0 and PainDeficit() >= 60) Spell(demonic_infusion)
		#if (Charges(demon_spikes) >= 1 and (VengeancePlayOffensively() and Talent(razor_spikes_talent) and Pain() < 80)) Spell(demon_spikes text=pool)
		if (Charges(demon_spikes) >= 1 and not (VengeancePlayOffensively() and Talent(razor_spikes_talent) and Pain() < 80)) Spell(demon_spikes)
	}
	
	if (CheckBoxOn(opt_melee_range) and not target.InRange(shear))
	{
		if (target.InRange(felblade)) Spell(felblade)
		if (target.Distance(less 30) or (target.Distance(less 40) and Talent(abyssal_strike_talent))) Spell(infernal_strike)
		Texture(misc_arrowlup help=L(not_in_melee_range))
	}
}

AddFunction VengeanceDefaultMainActions
{
	VengeanceHealMe()
	
	# Razor spikes are up
	if (VengeancePlayOffensively() and Talent(razor_spikes_talent) and not BuffExpires(demon_spikes_buff))
	{
		Spell(fracture)
		Spell(soul_cleave)
		Spell(shear)
	}
	
	# Fiery demise
	if (VengeancePlayOffensively() and SpellCooldown(soul_carver) <= 6.5 and (not Talent(fel_devastation_talent) or (SpellCooldown(fel_devastation) <= 4 and Pain() >= 30)) and target.TimeToDie() >= 8) Spell(fiery_brand)
	if (VengeancePlayOffensively() and not target.BuffExpires(fiery_demise_debuff))
	{
		Spell(soul_carver)
		Spell(fel_devastation)
		Spell(fel_eruption)
		if (PainDeficit() > 20) Spell(felblade)
	}
	
	# Regular rotation
	if (VengeancePlayDefensively()) Spell(soul_carver)
	if ((VengeancePlayOffensively() and not HasArtifactTrait(fiery_demise))) Spell(fel_devastation)
	if (Pain() >= 80 and not Talent(fracture_talent)) Spell(soul_cleave)
	if (PainDeficit() > 10) Spell(immolation_aura)
	if (PainDeficit() > 20) Spell(felblade)
	Spell(fel_eruption)
	if (BuffStacks(soul_fragments) >= 1 and target.DebuffExpires(frailty_debuff)) Spell(spirit_bomb)
	if (PainDeficit() > 17 and not BuffExpires(blade_turning_buff)) Spell(shear)
	if (Pain() >= 60 and not Talent(razor_spikes_talent)) Spell(fracture)
	if (not SigilCharging(flame) and target.DebuffRemaining(sigil_of_flame_debuff) <= 2-Talent(quickened_sigils_talent))
	{
		if (Talent(flame_crash_talent) and (SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike))) Spell(infernal_strike text=crash)
		Spell(sigil_of_flame)
	}
	if (not Talent(flame_crash_talent) and SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike)) Spell(infernal_strike)
	Spell(shear)
}

AddFunction VengeanceDefaultAoEActions
{
	VengeanceHealMe()
	
	if (VengeancePlayOffensively() and Talent(razor_spikes_talent) and not BuffExpires(demon_spikes_buff)) Spell(soul_cleave)
	if (BuffStacks(soul_fragments) <= 2) Spell(soul_carver)
	if (VengeancePlayOffensively()) Spell(fel_devastation)
	if (Pain() >= 80) Spell(soul_cleave)
	if (Talent(burning_alive_talent) and target.TimeToDie() >= 8) Spell(fiery_brand)
	if (PainDeficit() >= 20) Spell(immolation_aura)
	if (BuffStacks(soul_fragments) >= 1 and target.DebuffExpires(frailty_debuff)) Spell(spirit_bomb)
	if (PainDeficit() >= 20) Spell(felblade)
	if (PainDeficit() >= 17 and BuffPresent(blade_turning_buff)) Spell(shear)
	if (not SigilCharging(flame) and target.DebuffRemaining(sigil_of_flame_debuff) <= 2-Talent(quickened_sigils_talent))
	{
		if (Talent(flame_crash_talent) and (SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike))) Spell(infernal_strike)
		Spell(sigil_of_flame)
	}
	Spell(fel_eruption)
	Spell(shear)
}

AddFunction VengeanceDefaultCdActions
{
	VengeanceInterruptActions()
	if IncomingDamage(1.5 magic=1) > 0 Spell(empower_wards)
	Spell(fiery_brand)
	Item(Trinket0Slot usable=1)<commit_msg>infernal strike tweeks for AOE<commit_after>local OVALE, Ovale = ...
local OvaleScripts = Ovale.OvaleScripts

do
	local name = "icyveins_demonhunter_vengeance"
	local desc = "[7.0] Icy-Veins: DemonHunter Vengeance"
	local code = [[
Include(ovale_common)
Include(ovale_trinkets_mop)
Include(ovale_trinkets_wod)
Include(ovale_demonhunter_spells)

AddCheckBox(opt_interrupt L(interrupt) default specialization=vengeance)
AddCheckBox(opt_melee_range L(not_in_melee_range) specialization=vengeance)

AddFunction VengeancePlayDefensively
{
	CheckBoxOn(opt_demonhunter_vengeance_defensive) or HealthPercent() <= 35 or IncomingDamage(5) >= MaxHealth() * 0.5
}

AddFunction VengeancePlayOffensively
{
	not VengeancePlayDefensively()
}

AddFunction VengeanceHealMe
{
	if (HealthPercent() < 70) Spell(fel_devastation)
	if (HealthPercent() < 70) Spell(soul_cleave)
	if (IncomingDamage(5) >= MaxHealth() * 0.5) Spell(soul_cleave)
}

AddFunction VengeanceDefaultShortCDActions
{
	if ((VengeancePlayOffensively() and (BuffExpires(demon_spikes) or not Talent(razor_spikes_talent))) or (VengeancePlayDefensively())) Spell(soul_barrier)
	
	if ((VengeancePlayDefensively() and (BuffExpires(demon_spikes_buff) or not HasArtifactTrait(defensive_spikes))) or VengeancePlayOffensively())
	{
		if (Charges(demon_spikes) == 0 and PainDeficit() >= 60) Spell(demonic_infusion)
		#if (Charges(demon_spikes) >= 1 and (VengeancePlayOffensively() and Talent(razor_spikes_talent) and Pain() < 80)) Spell(demon_spikes text=pool)
		if (Charges(demon_spikes) >= 1 and not (VengeancePlayOffensively() and Talent(razor_spikes_talent) and Pain() < 80)) Spell(demon_spikes)
	}
	
	if (CheckBoxOn(opt_melee_range) and not target.InRange(shear))
	{
		if (target.InRange(felblade)) Spell(felblade)
		if (target.Distance(less 30) or (target.Distance(less 40) and Talent(abyssal_strike_talent))) Spell(infernal_strike)
		Texture(misc_arrowlup help=L(not_in_melee_range))
	}
}

AddFunction VengeanceDefaultMainActions
{
	VengeanceHealMe()
	
	# Razor spikes are up
	if (VengeancePlayOffensively() and Talent(razor_spikes_talent) and not BuffExpires(demon_spikes_buff))
	{
		Spell(fracture)
		Spell(soul_cleave)
		Spell(shear)
	}
	
	# Fiery demise
	if (VengeancePlayOffensively() and SpellCooldown(soul_carver) <= 6.5 and (not Talent(fel_devastation_talent) or (SpellCooldown(fel_devastation) <= 4 and Pain() >= 30)) and target.TimeToDie() >= 8) Spell(fiery_brand)
	if (VengeancePlayOffensively() and not target.BuffExpires(fiery_demise_debuff))
	{
		Spell(soul_carver)
		Spell(fel_devastation)
		Spell(fel_eruption)
		if (PainDeficit() > 20) Spell(felblade)
	}
	
	# Regular rotation
	if (VengeancePlayDefensively()) Spell(soul_carver)
	if ((VengeancePlayOffensively() and not HasArtifactTrait(fiery_demise))) Spell(fel_devastation)
	if (Pain() >= 80 and not Talent(fracture_talent)) Spell(soul_cleave)
	if (PainDeficit() > 10) Spell(immolation_aura)
	if (PainDeficit() > 20) Spell(felblade)
	Spell(fel_eruption)
	if (BuffStacks(soul_fragments) >= 1 and target.DebuffExpires(frailty_debuff)) Spell(spirit_bomb)
	if (PainDeficit() > 17 and not BuffExpires(blade_turning_buff)) Spell(shear)
	if (Pain() >= 60 and not Talent(razor_spikes_talent)) Spell(fracture)
	if (not SigilCharging(flame) and target.DebuffRemaining(sigil_of_flame_debuff) <= 2-Talent(quickened_sigils_talent))
	{
		if (Talent(flame_crash_talent) and (SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike))) Spell(infernal_strike text=crash)
		Spell(sigil_of_flame)
	}
	if (not Talent(flame_crash_talent) and SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike)) Spell(infernal_strike)
	Spell(shear)
}

AddFunction VengeanceDefaultAoEActions
{
	VengeanceHealMe()
	
	if (VengeancePlayOffensively() and Talent(razor_spikes_talent) and not BuffExpires(demon_spikes_buff)) Spell(soul_cleave)
	if (BuffStacks(soul_fragments) <= 2) Spell(soul_carver)
	if (VengeancePlayOffensively()) Spell(fel_devastation)
	if (Pain() >= 80) Spell(soul_cleave)
	if (Talent(burning_alive_talent) and target.TimeToDie() >= 8) Spell(fiery_brand)
	if (PainDeficit() >= 20) Spell(immolation_aura)
	if (BuffStacks(soul_fragments) >= 1 and target.DebuffExpires(frailty_debuff)) Spell(spirit_bomb)
	if (PainDeficit() >= 20) Spell(felblade)
	if (PainDeficit() >= 17 and BuffPresent(blade_turning_buff)) Spell(shear)
	if (not SigilCharging(flame) and target.DebuffRemaining(sigil_of_flame_debuff) <= 2-Talent(quickened_sigils_talent))
	{
		if (Talent(flame_crash_talent) and (SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike))) Spell(infernal_strike text=crash)
		Spell(sigil_of_flame)
	}
	Spell(fel_eruption)
	if (not Talent(flame_crash_talent) and SpellCharges(infernal_strike) >= SpellMaxCharges(infernal_strike)) Spell(infernal_strike)
	Spell(shear)
}

AddFunction VengeanceDefaultCdActions
{
	VengeanceInterruptActions()
	if IncomingDamage(1.5 magic=1) > 0 Spell(empower_wards)
	Spell(fiery_brand)
	Item(Trinket0Slot usable=1)
{'fraction_non_alphanumeric': 0.11075819672131147, 'fraction_numerical': 0.01331967213114754, 'mean_word_length': 8.096924510717614, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '494096', 'n_tokens_mistral': 4140, 'n_tokens_neox': 3831, 'n_words': 653}