• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Demon oak not working!

tommy91

Member
Joined
Oct 27, 2010
Messages
269
Solutions
1
Reaction score
21
Location
Sweden
Here is the error message i get! I am trying to figure out what is wrong but i cant seem to get it right.

Please help!

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/demon oak quest/demonOak.lua:onUse
data/actions/scripts/demon oak quest/demonOak.lua:100: attempt to index local 'p
layer' (a number value)
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/demon oak quest/demonOak.lua:100: in function <data
/actions/scripts/demon oak quest/demonOak.lua:93>
 
Code:
local config = {
    demonOakIds = {8288, 8289, 8290, 8291},
    sounds = {
        'MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?',
        'CURSE YOU!',
        'RISE, MINIONS, RISE FROM THE DEAD!!!!',
        'AHHHH! YOUR BLOOD MAKES ME STRONG!',
        'GET THE BONES, HELLHOUND! GET THEM!!',
        'GET THERE WHERE I CAN REACH YOU!!!',
        'ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!',
        'YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!',
        'ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!'
    },
    bonebeastChance = 90,
    bonebeastCount = 4,
    waves = 10,
    questArea = {
        fromPosition = {x = 32706, y = 32345, z = 7},
        toPosition = {x = 32725, y = 32357, z = 7}
    },
    summonPositions = {
        {x = 32714, y = 32348, z = 7},
        {x = 32712, y = 32349, z = 7},
        {x = 32711, y = 32351, z = 7},
        {x = 32713, y = 32354, z = 7},
        {x = 32716, y = 32354, z = 7},
        {x = 32719, y = 32354, z = 7},
        {x = 32721, y = 32351, z = 7},
        {x = 32719, y = 32348, z = 7}
    },
    summons = {
        [8288] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8289] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8290] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8291] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        }
    },
    storages = {
        [8288] = Storage.DemonOak.AxeBlowsBird,
        [8289] = Storage.DemonOak.AxeBlowsLeft,
        [8290] = Storage.DemonOak.AxeBlowsRight,
        [8291] = Storage.DemonOak.AxeBlowsFace
    }
}

local function getRandomSummonPosition()
    return config.summonPositions[math.random(#config.summonPositions)]
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not isInArray(config.demonOakIds, target.itemid) then
        return true
    end

    local totalProgress = 0
    for k,v in pairs(config.storages) do
        totalProgress = totalProgress + math.max(0, player:getStorageValue(v))
    end

    local spectators, hasMonsters = Game.getSpectators(DEMON_OAK_POSITION, false, false, 9, 9, 6, 6), false
    for i = 1, #spectators do
        if spectators[i]:isMonster() then
            hasMonsters = true
            break
        end
    end

    local isDefeated = totalProgress == (#config.demonOakIds * (config.waves + 1))
    if (config.killAllBeforeCut or isDefeated)
            and hasMonsters then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to kill all monsters first.')
        return true
    end

    if isDefeated then
        player:teleportTo(DEMON_OAK_KICK_POSITION)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tell Oldrak about your great victory against the demon oak.')
        player:setStorageValue(Storage.DemonOak.Done, 1)
        player:setStorageValue(Storage.DemonOak.Progress, 3)
        return true
    end

    local cStorage = config.storages[target.itemid]
    local progress = math.max(player:getStorageValue(cStorage), 1)
    if progress >= config.waves + 1 then
        toPosition:sendMagicEffect(CONST_ME_POFF)
        return true
    end

    local isLastCut = totalProgress == (#config.demonOakIds * (config.waves + 1) - 1)
    local summons = config.summons[target.itemid]
    if summons and summons[progress] then
        -- Summon a single demon on the last hit
        if isLastCut then
            Game.createMonster('Demon', getRandomSummonPosition(), false, true)

        -- Summon normal monsters otherwise
        else
            for i = 1, #summons[progress] do
                Game.createMonster(summons[progress][i], getRandomSummonPosition(), false, true)
            end
        end

    -- if it is not the 5th or 10th there is only a chance to summon bonebeasts
    elseif math.random(100) >= config.bonebeastChance then
        for i = 1, config.bonebeastCount do
            Game.createMonster('Bonebeast', getRandomSummonPosition(), false, true)
        end
    end

    player:say(isLastCut and 'HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!' or config.sounds[math.random(#config.sounds)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
    toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
    player:setStorageValue(cStorage, progress + 1)
    player:say('-krrrrak-', TALKTYPE_MONSTER_YELL, false, player, toPosition)
    doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -170, -210, CONST_ME_BIGPLANTS)
    return true
end
 
Code:
local config = {
demonOakIds = {8288, 8289, 8290, 8291},
sounds = {
'MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?',
'CURSE YOU!',
'RISE, MINIONS, RISE FROM THE DEAD!!!!',
'AHHHH! YOUR BLOOD MAKES ME STRONG!',
'GET THE BONES, HELLHOUND! GET THEM!!',
'GET THERE WHERE I CAN REACH YOU!!!',
'ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!',
'YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!',
'ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!'
},
bonebeastChance = 90,
bonebeastCount = 4,
waves = 10,
questArea = {
fromPosition = {x = 32706, y = 32345, z = 7},
toPosition = {x = 32725, y = 32357, z = 7}
},
summonPositions = {
{x = 32714, y = 32348, z = 7},
{x = 32712, y = 32349, z = 7},
{x = 32711, y = 32351, z = 7},
{x = 32713, y = 32354, z = 7},
{x = 32716, y = 32354, z = 7},
{x = 32719, y = 32354, z = 7},
{x = 32721, y = 32351, z = 7},
{x = 32719, y = 32348, z = 7}
},
summons = {
[8288] = {
[1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
[2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
[3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
[4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
[5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
[6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
[7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
[8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
[9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
[10] = {'Demon', 'Demon', 'Demon', 'Demon'},
},
[8289] = {
[1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
[2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
[3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
[4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
[5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
[6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
[7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
[8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
[9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
[10] = {'Demon', 'Demon', 'Demon', 'Demon'},
},
[8290] = {
[1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
[2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
[3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
[4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
[5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
[6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
[7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
[8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
[9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
[10] = {'Demon', 'Demon', 'Demon', 'Demon'},
},
[8291] = {
[1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
[2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
[3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
[4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
[5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
[6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
[7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
[8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
[9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
[10] = {'Demon', 'Demon', 'Demon', 'Demon'},
},
storages = {
[8288] = Storage.DemonOak.AxeBlowsBird,
[8289] = Storage.DemonOak.AxeBlowsLeft,
[8290] = Storage.DemonOak.AxeBlowsRight,
[8291] = Storage.DemonOak.AxeBlowsFace
},

local function getRandomSummonPosition()
return config.summonPositions[math.random(#config.summonPositions)]
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not isInArray(config.demonOakIds, target.itemid) then
return true
end

local totalProgress = 0
for k,v in pairs(config.storages) do
totalProgress = totalProgress + math.max(0, player:getStorageValue(v))
end

local spectators, hasMonsters = Game.getSpectators(DEMON_OAK_POSITION, false, false, 9, 9, 6, 6), false
for i = 1, #spectators do
if spectators[i]:isMonster() then
hasMonsters = true
break
end
end

local isDefeated = totalProgress == (#config.demonOakIds * (config.waves + 1))
if (config.killAllBeforeCut or isDefeated)
and hasMonsters then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to kill all monsters first.')
return true
end

if isDefeated then
player:teleportTo(DEMON_OAK_KICK_POSITION)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tell Oldrak about your great victory against the demon oak.')
player:setStorageValue(Storage.DemonOak.Done, 1)
player:setStorageValue(Storage.DemonOak.Progress, 3)
return true
end

local cStorage = config.storages[target.itemid]
local progress = math.max(player:getStorageValue(cStorage), 1)
if progress >= config.waves + 1 then
toPosition:sendMagicEffect(CONST_ME_POFF)
return true
end

local isLastCut = totalProgress == (#config.demonOakIds * (config.waves + 1) - 1)
local summons = config.summons[target.itemid]
if summons and summons[progress] then
-- Summon a single demon on the last hit
if isLastCut then
Game.createMonster('Demon', getRandomSummonPosition(), false, true)

-- Summon normal monsters otherwise
else
for i = 1, #summons[progress] do
Game.createMonster(summons[progress][i], getRandomSummonPosition(), false, true)
end
end

-- if it is not the 5th or 10th there is only a chance to summon bonebeasts
elseif math.random(100) >= config.bonebeastChance then
for i = 1, config.bonebeastCount do
Game.createMonster('Bonebeast', getRandomSummonPosition(), false, true)
end
end

player:say(isLastCut and 'HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!' or config.sounds[math.random(#config.sounds)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
player:setStorageValue(cStorage, progress + 1)
player:say('-krrrrak-', TALKTYPE_MONSTER_YELL, false, player, toPosition)
doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -170, -210, CONST_ME_BIGPLANTS)
return true
end

Try now?
 
Seems like you have an older TFS version where cid is passed instead of a player object.

Try this:
PHP:
local config = {
    demonOakIds = {8288, 8289, 8290, 8291},
    sounds = {
        'MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?',
        'CURSE YOU!',
        'RISE, MINIONS, RISE FROM THE DEAD!!!!',
        'AHHHH! YOUR BLOOD MAKES ME STRONG!',
        'GET THE BONES, HELLHOUND! GET THEM!!',
        'GET THERE WHERE I CAN REACH YOU!!!',
        'ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!',
        'YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!',
        'ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!'
    },
    bonebeastChance = 90,
    bonebeastCount = 4,
    waves = 10,
    questArea = {
        fromPosition = {x = 32706, y = 32345, z = 7},
        toPosition = {x = 32725, y = 32357, z = 7}
    },
    summonPositions = {
        {x = 32714, y = 32348, z = 7},
        {x = 32712, y = 32349, z = 7},
        {x = 32711, y = 32351, z = 7},
        {x = 32713, y = 32354, z = 7},
        {x = 32716, y = 32354, z = 7},
        {x = 32719, y = 32354, z = 7},
        {x = 32721, y = 32351, z = 7},
        {x = 32719, y = 32348, z = 7}
    },
    summons = {
        [8288] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8289] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8290] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        },
        [8291] = {
            [1] = {'Dark Torturer', 'Betrayed Wraith', 'Blightwalker', 'Blightwalker'},
            [2] = {'Hand of Cursed Fate', 'Betrayed Wraith', 'Demon', 'Giant Spider'},
            [3] = {'Grim Reaper', 'Nightmare', 'Diabolic Imp', 'Defiler'},
            [4] = {'Destroyer', 'Nightmare', 'Demon', 'Demon'},
            [5] = {'Fury', 'Undead Dragon', 'Defiler', 'Destroyer'},
            [6] = {'Ghastly Dragon', 'Betrayed Wraith', 'Lich', 'Dark Torturer'},
            [7] = {'Juggernaut', 'Braindeath', 'Braindeath', 'Braindeath'},
            [8] = {'Hand of Cursed Fate', 'Hellfire Fighter', 'Defiler', 'Nightmare'},
            [9] = {'Grim Reaper', 'Betrayed Wraith', 'Blightwalker', 'Dark Torturer'},
            [10] = {'Demon', 'Demon', 'Demon', 'Demon'}
        }
    },
    storages = {
        [8288] = Storage.DemonOak.AxeBlowsBird,
        [8289] = Storage.DemonOak.AxeBlowsLeft,
        [8290] = Storage.DemonOak.AxeBlowsRight,
        [8291] = Storage.DemonOak.AxeBlowsFace
    }
}

local function getRandomSummonPosition()
    return config.summonPositions[math.random(#config.summonPositions)]
end

function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
    local player = Player(cid)
    if not isInArray(config.demonOakIds, target.itemid) then
        return true
    end

    local totalProgress = 0
    for k,v in pairs(config.storages) do
        totalProgress = totalProgress + math.max(0, player:getStorageValue(v))
    end

    local spectators, hasMonsters = Game.getSpectators(DEMON_OAK_POSITION, false, false, 9, 9, 6, 6), false
    for i = 1, #spectators do
        if spectators[i]:isMonster() then
            hasMonsters = true
            break
        end
    end

    local isDefeated = totalProgress == (#config.demonOakIds * (config.waves + 1))
    if (config.killAllBeforeCut or isDefeated)
            and hasMonsters then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to kill all monsters first.')
        return true
    end

    if isDefeated then
        player:teleportTo(DEMON_OAK_KICK_POSITION)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tell Oldrak about your great victory against the demon oak.')
        player:setStorageValue(Storage.DemonOak.Done, 1)
        player:setStorageValue(Storage.DemonOak.Progress, 3)
        return true
    end

    local cStorage = config.storages[target.itemid]
    local progress = math.max(player:getStorageValue(cStorage), 1)
    if progress >= config.waves + 1 then
        toPosition:sendMagicEffect(CONST_ME_POFF)
        return true
    end

    local isLastCut = totalProgress == (#config.demonOakIds * (config.waves + 1) - 1)
    local summons = config.summons[target.itemid]
    if summons and summons[progress] then
        -- Summon a single demon on the last hit
        if isLastCut then
            Game.createMonster('Demon', getRandomSummonPosition(), false, true)

        -- Summon normal monsters otherwise
        else
            for i = 1, #summons[progress] do
                Game.createMonster(summons[progress][i], getRandomSummonPosition(), false, true)
            end
        end

    -- if it is not the 5th or 10th there is only a chance to summon bonebeasts
    elseif math.random(100) >= config.bonebeastChance then
        for i = 1, config.bonebeastCount do
            Game.createMonster('Bonebeast', getRandomSummonPosition(), false, true)
        end
    end

    player:say(isLastCut and 'HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!' or config.sounds[math.random(#config.sounds)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
    toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
    player:setStorageValue(cStorage, progress + 1)
    player:say('-krrrrak-', TALKTYPE_MONSTER_YELL, false, player, toPosition)
    doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -170, -210, CONST_ME_BIGPLANTS)
    return true
end
 
Now this is the rest of the errors we get Deep,
There is also alot of creatures missing and npcs missing again.


Code:
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown key value: skillMagic
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
>> Loading script systems
[Warning - Actions::registerEvent] Duplicate registered item with id: 8300
[Warning - Actions::registerEvent] Duplicate registered item with id: 8299 in fr
omid: 8298, toid: 8299
[Warning - Actions::registerEvent] Duplicate registered item with id: 18516
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 308
8 in fromuid: 3088, touid: 3090
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 308
9 in fromuid: 3088, touid: 3090
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 309
0 in fromuid: 3088, touid: 3090
>> Loading monsters
>> Loading outfits
>> Checking world type... NO-PVP
>> Loading map
[Warning - IOMap::loadMap] This map needs an updated items.otb.
> Map size: 48422x47676.

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/others/cleanHouse.lua:onStartup
data/globalevents/scripts/others/cleanHouse.lua:12: attempt to index a nil value

stack traceback:
  [C]: in function '__index'
  data/globalevents/scripts/others/cleanHouse.lua:12: in function <data/gl
obalevents/scripts/others/cleanHouse.lua:3>
 
Now this is the rest of the errors we get Deep,
There is also alot of creatures missing and npcs missing again.


Code:
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown key value: skillMagic
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
>> Loading script systems
[Warning - Actions::registerEvent] Duplicate registered item with id: 8300
[Warning - Actions::registerEvent] Duplicate registered item with id: 8299 in fr
omid: 8298, toid: 8299
[Warning - Actions::registerEvent] Duplicate registered item with id: 18516
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 308
8 in fromuid: 3088, touid: 3090
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 308
9 in fromuid: 3088, touid: 3090
[Warning - Actions::registerEvent] Duplicate registered item with unique id: 309
0 in fromuid: 3088, touid: 3090
>> Loading monsters
>> Loading outfits
>> Checking world type... NO-PVP
>> Loading map
[Warning - IOMap::loadMap] This map needs an updated items.otb.
> Map size: 48422x47676.

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/others/cleanHouse.lua:onStartup
data/globalevents/scripts/others/cleanHouse.lua:12: attempt to index a nil value

stack traceback:
  [C]: in function '__index'
  data/globalevents/scripts/others/cleanHouse.lua:12: in function <data/gl
obalevents/scripts/others/cleanHouse.lua:3>
Did you fix demon oak?
Btw. these errors aren't changing anything, I don't know about this cleanhouse.lua error though.
 
Code:
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed
[Warning - Items::parseItemNode] Unknown slotType: one-handed

search for any item in items.xml: ctr + f "one-handed" delete the line there...There is no need to put one-handed. If its not two-handed it doesn't need anything to specify one handed. So just delete
Code:
<attribute key="SLOT_TYPE" value="one-handed"/>
or something close to that.

Same goes for the skillMagic
 
Here is the cleanhouse

Code:
local days = 20 -- Se ele estiver 20 dias sem logar, ele perde a house

function onStartup()
    local resultId = db.storeQuery("SELECT `owner`,`id` FROM `houses`;")

    if resultId then
        repeat
            local aux = db.storeQuery("SELECT `lastlogin` FROM `players` WHERE `id` = ".. result.getDataString(resultId, "owner") .. ";")

            if aux then
                if result.getDataInt(aux, "lastlogin") < os.time() - (days * 86400) then
                    House(result.getDataInt(resultId, "id")):setOwnerGuid(-1)
                end
            end

        until not result.next(resultId)
    end
    saveServer()

    return true
end
 
Back
Top