10.77
TFS 1.2
So i have made this chest that goes away from existence after an X amount of time after first use.
(WORKS)
After that it starts an addEvent(WORKS) that will remove the chest(WORKS) and cast a spell upon its foes.(DOES NOT WORK!)
So far no good. This is what I've come to and it doesnt work at all..
Apprieciate all the help i can get
TFS 1.2
So i have made this chest that goes away from existence after an X amount of time after first use.
(WORKS)
After that it starts an addEvent(WORKS) that will remove the chest(WORKS) and cast a spell upon its foes.(DOES NOT WORK!)
So far no good. This is what I've come to and it doesnt work at all..
Code:
local closeEpicId = 18473
local openEpicId = 24376
local area = createCombatArea({
{1, 1, 1},
{1, 3, 1},
{1, 1, 1}
})
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
combat:setArea(area)
local function boom(player, toPos)
local item = Tile(toPos):getItemById(openEpicId)
if item then
toPos:sendMagicEffect(CONST_ME_FIREAREA)
item:remove()
combat:execute(player, item)
end
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
--local itemPos = item:getPosition()
if item:getId() == closeEpicId then
item:transform(openEpicId)
player:say("Detonation set to 5 seconds.", TALKTYPE_MONSTER_SAY, false, false, toPosition)
addEvent(boom, 5000, player:getId(), toPosition)
end
return true
end
Apprieciate all the help i can get