function swap_to_item(keys, ItemName)
for i=0, 5, 1 do --Fill all empty slots in the player's inventory with "dummy" items.
local current_item = keys.caster:GetItemInSlot(i)
if current_item == nil then
keys.caster:AddItem(CreateItem("item_dummy", keys.caster, keys.caster))
end
end
keys.caster:RemoveItem(keys.ability)
keys.caster:AddItem(CreateItem(ItemName, keys.caster, keys.caster)) --This should be put into the same slot that the removed item was in.
for i=0, 5, 1 do --Remove all dummy items from the player's inventory.
local current_item = keys.caster:GetItemInSlot(i)
if current_item ~= nil then
if current_item:GetName() == "item_dummy_datadriven" then
keys.caster:RemoveItem(current_item)
end
end
end
end
function modifier_item_radiance_aura_on_interval_think(keys)
local damage_to_deal = keys.AuraDamagePerSecond * keys.AuraDamageInterval --This gives us the damage per interval.
ApplyDamage({victim = keys.target, attacker = keys.caster, damage = damage_to_deal, damage_type = DAMAGE_TYPE_MAGICAL,})
end
function item_radiance_on_spell_start(keys)
swap_to_item(keys, "item_radiance_inactive_datadriven")
end
function item_radiance_inactive_on_spell_start(keys)
swap_to_item(keys, "item_radiance")
end