function onThink(creature, interval)
if(creature:isPlayer()) then
local target = creature:getTarget()
if(target and creature:getStorageValue(7608) == 2) then
local cooldown = math.max(0, creature:getStorageValue(23157))
if(cooldown >= 5000) then
creature:setStorageValue(23157, cooldown - 5000)
local targetPos = target:getPosition()
if(creature:getPosition():isSightClear(targetPos)) then
local level = creature:getLevel()
Position(targetPos.x - 6, targetPos.y - 5, targetPos.z):sendDistanceEffect(targetPos, 34)
doTargetCombatHealth(creature, target, COMBAT_FIREDAMAGE, -(level * 1.5 * 0.7), -(level * 2 * 0.8), CONST_ME_FIREAREA)
end
else
creature:setStorageValue(23157, cooldown + interval)
end
end
end
return true
end
local check_interval = 10 -- Edit this
local check_clock = os.clock()
if (os.clock() - check_clock) > check_interval then
-- whole code
end
function minMax(l, m, v, a)
if isInArray({1, 2}, v) then
return -((l / 5) + (m * 1.4) + 8), -((l / 5) + (m * 2.2) + 14)
elseif v == 3 then
return -((l / 5) + m * 2), -((l / 5) + m * 5)
end
return -((l / 5) + (m * a * 0.01) + 1), -((l / 5) + (m * a * 0.03) + 6)
end
local voc = {
[1] = { -- sorc
spellname = "passive spell", --TODO think for proper names
combatDamage = COMBAT_DEATHDAMAGE,
CombatEffect = CONST_ME_MORTAREA,
distEffect = CONST_ANI_DEATH
},
[2] = { -- druid
spellname = "passive spell",
combatDamage = COMBAT_ICEDAMAGE,
CombatEffect = CONST_ME_ICEAREA,
distEffect = CONST_ANI_ICE
},
[3] = { -- pally
spellname = "passive spell",
combatDamage = COMBAT_PHYSICALDAMAGE,
CombatEffect = CONST_ME_HITAREA,
distEffect = CONST_ANI_THROWINGSTAR
},
[4] = { -- knight
spellname = "passive spell",
combatDamage = COMBAT_PHYSICALDAMAGE,
CombatEffect = CONST_ME_DRAWBLOOD,
distEffect = CONST_ANI_LARGEROCK
},
}
local weaponTypes = {
[0] = { 0, 0 }, -- fist
{ 1, 2 }, -- Sword
{ 2, 1 }, -- Club
{ 3, 3 }, -- Axe
{ 4, 5 }, -- Shield
{ 5, 4 }, -- Distance
{ 6, 0 } -- 6 is rod / wands, 0 is for fists..
}
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/passive.lua:onThink
data/creaturescripts/scripts/passive.lua:87: attempt to call global 'getItemAttribute' (a nil value)
stack traceback:
[C]: in function 'getItemAttribute'
data/creaturescripts/scripts/passive.lua:87: in function <data/creaturescripts/scripts/passive.lua:48>