test_lua = class({})
LinkLuaModifier( "modifier_test", "lua_abilities/_test/modifier_test_attack_new", LUA_MODIFIER_MOTION_NONE )

function test_lua:OnSpellStart()
	local caster = self:GetCaster()

	-- add modifier
	caster:AddNewModifier(
		caster, -- player source
		self, -- ability source
		"modifier_test", -- modifier name
		{ duration = 5 } -- kv
	)

end

--[[
Modifier Property trigger order:

-- Client Loop (not selecting current unit)
	MODIFIER_PROPERTY_INCOMING_PHYSICAL_DAMAGE_CONSTANT,
	MODIFIER_PROPERTY_INCOMING_SPELL_DAMAGE_CONSTANT,
	MODIFIER_PROPERTY_INCOMING_DAMAGE_CONSTANT,

-- Client Loop (selecting current unit)
	MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE,
	MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS,
	MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE,
	MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE_ACTIVE,
	MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE,
	MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION,
	MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS,
	MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PHYSICAL,

-- Server loop (also client loop)
	MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE,
	MODIFIER_PROPERTY_BASEDAMAGEOUTGOING_PERCENTAGE,
	MODIFIER_PROPERTY_BASEDAMAGEOUTGOING_PERCENTAGE_UNIQUE,
	MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE,
	MODIFIER_PROPERTY_DAMAGEOUTGOING_PERCENTAGE,
	MODIFIER_PROPERTY_DAMAGEOUTGOING_PERCENTAGE_ILLUSION,

-- Two-script attack
	attack
		attacked

	[VScript] MODIFIER_EVENT_ON_ATTACK_START
	[VScript] MODIFIER_EVENT_ON_ATTACK_RECORD
	[VScript] MODIFIER_PROPERTY_OVERRIDE_ATTACK_DAMAGE
		[VScript] MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE_TARGET
	[VScript] MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE_POST_CRIT
		[VScript] MODIFIER_PROPERTY_PREATTACK_TARGET_CRITICALSTRIKE
	[VScript] MODIFIER_PROPERTY_PREATTACK_CRITICALSTRIKE
	[VScript] MODIFIER_PROPERTY_PRE_ATTACK

	[VScript] MODIFIER_EVENT_ON_ATTACK

	[VScript] MODIFIER_PROPERTY_PROCATTACK_BONUS_DAMAGE_PHYSICAL
	[VScript] MODIFIER_PROPERTY_PROCATTACK_BONUS_DAMAGE_MAGICAL
	[VScript] MODIFIER_PROPERTY_PROCATTACK_BONUS_DAMAGE_PURE
	[VScript] MODIFIER_PROPERTY_PROCATTACK_FEEDBACK

	[VScript] MODIFIER_EVENT_ON_ATTACK_LANDED
	[VScript] MODIFIER_PROPERTY_TOTALDAMAGEOUTGOING_PERCENTAGE

		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK
		[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK_SPECIAL

		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PHYSICAL
		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_MAGICAL
		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PURE
		[VScript] MODIFIER_PROPERTY_AVOID_DAMAGE

		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE_ACTIVE

		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS

		[VScript] MODIFIER_PROPERTY_INCOMING_PHYSICAL_DAMAGE_PERCENTAGE
		[VScript] MODIFIER_PROPERTY_INCOMING_PHYSICAL_DAMAGE_CONSTANT
		[VScript] MODIFIER_PROPERTY_INCOMING_DAMAGE_CONSTANT
		[VScript] MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE

		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK

	[VScript] MODIFIER_EVENT_ON_DAMAGE_CALCULATED
	[VScript] MODIFIER_EVENT_ON_ATTACKED
	[VScript] MODIFIER_EVENT_ON_TAKEDAMAGE_KILLCREDIT
	[VScript] MODIFIER_EVENT_ON_TAKEDAMAGE
	[VScript] MODIFIER_EVENT_ON_ATTACK_RECORD_DESTROY

-- two-script ability damage
	dealing damage
		dealt damage

		[VScript] MODIFIER_PROPERTY_AVOID_SPELL

	[VScript] MODIFIER_PROPERTY_TOTALDAMAGEOUTGOING_PERCENTAGE
	[VScript] MODIFIER_PROPERTY_SPELL_AMPLIFY_PERCENTAGE
	[VScript] MODIFIER_PROPERTY_SPELL_AMPLIFY_PERCENTAGE_UNIQUE
		
		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
		[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK
		[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK_SPECIAL
		[VScript] MODIFIER_PROPERTY_MAGICAL_CONSTANT_BLOCK

		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PHYSICAL
		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_MAGICAL
		[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PURE
		[VScript] MODIFIER_PROPERTY_AVOID_DAMAGE

		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE
		[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE_ACTIVE
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
		[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS

		[VScript] MODIFIER_PROPERTY_INCOMING_SPELL_DAMAGE_CONSTANT
		[VScript] MODIFIER_PROPERTY_INCOMING_DAMAGE_CONSTANT
		[VScript] MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE

		[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK

	[VScript] MODIFIER_EVENT_ON_TAKEDAMAGE_KILLCREDIT
	[VScript] MODIFIER_EVENT_ON_TAKEDAMAGE
	[VScript] MODIFIER_EVENT_ON_ATTACK_RECORD_DESTROY

-- Casting ability
	[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
	[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
	[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR
	[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK
	[VScript] MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK_SPECIAL
	[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PHYSICAL
	[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_MAGICAL
	[VScript] MODIFIER_PROPERTY_ABSOLUTE_NO_DAMAGE_PURE
	[VScript] MODIFIER_PROPERTY_AVOID_DAMAGE
	[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
	[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BASE_PERCENTAGE
	[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS
	[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE
	[VScript] MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS_UNIQUE_ACTIVE
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DECREPIFY_UNIQUE
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_DIRECT_MODIFICATION
	[VScript] MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS
	[VScript] MODIFIER_PROPERTY_TOTAL_CONSTANT_BLOCK
	[VScript] MODIFIER_EVENT_ON_TAKEDAMAGE_KILLCREDIT
	[VScript] MODIFIER_EVENT_ON_ATTACK_RECORD_DESTROY
]]