• 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!

TFS 1.X+ 10.98 issue regarding loading npc

ThatGuyPJ

New Member
Joined
May 24, 2020
Messages
24
Reaction score
1
hi there! ive started up my server and I got an issue with npcs, about half of them do not spawn and I cant summon them in either and most don't reply, apart from traders. none of the boat captains spawn either which is a pain.

Lua:
Lua Script Error: [Npc interface]
data/npc/lib/npc.lua
data/npc/lib/npcsystem/customModules.lua:3: attempt to index global 'Storage' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/npc/lib/npcsystem/customModules.lua:3: in main chunk
        [C]: in function 'dofile'
        data/npc/lib/npc.lua:3: in main chunk
[Warning - NpcScriptInterface::loadNpcLib] Can not load data/npc/lib/npc.lua

Lua Script Error: [Npc interface]
data/npc/scripts/Kasmir.lua
data/npc/scripts/Kasmir.lua:78: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Kasmir.lua:78: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Kasmir.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Gabel.lua
data/npc/scripts/Gabel.lua:87: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/Gabel.lua:87: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Gabel.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Malor.lua
data/npc/scripts/Malor.lua:99: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/Malor.lua:99: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Malor.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Edala.lua
data/npc/scripts/Edala.lua:44: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Edala.lua:44: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Edala.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Yaman.lua
data/npc/scripts/Yaman.lua:101: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/Yaman.lua:101: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Yaman.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Frodo.lua
data/npc/scripts/Frodo.lua:16: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Frodo.lua:16: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Frodo.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Frodo.lua
data/npc/scripts/Frodo.lua:16: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Frodo.lua:16: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Frodo.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Tristan.lua
data/npc/scripts/Tristan.lua:10: attempt to call method 'addSpellKeyword' (a nil value)
stack traceback:
        [C]: in function 'addSpellKeyword'
        data/npc/scripts/Tristan.lua:10: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Tristan.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Frodo.lua
data/npc/scripts/Frodo.lua:16: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Frodo.lua:16: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Frodo.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Frodo.lua
data/npc/scripts/Frodo.lua:16: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Frodo.lua:16: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Frodo.lua


Lua Script Error: [Npc interface]
data/npc/scripts/Blind Orc.lua
data/npc/scripts/Blind Orc.lua:30: attempt to call method 'addGreetKeyword' (a nil value)
stack traceback:
        [C]: in function 'addGreetKeyword'
        data/npc/scripts/Blind Orc.lua:30: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Blind Orc.lua

this is just the first few as posting the full errors is over 25000 characters, so im hoping it could be an easy fix that with correct all of the individual problems for all the npcs hopefully!

thanks in advance for any replies
 
@Kouki
of course, here is it
EDIT: also all the npcs show up in RME as mages all in white not sure if that's any help at all?

Lua:
-- Custom Modules, created to help us in this datapack
local travelDiscounts = {
    ['postman'] = {price = 10, storage = Storage.postman.Rank, value = 3},
    ['new frontier'] = {price = 50, storage = Storage.TheNewFrontier.Mission03, value = 1}
}

function StdModule.travelDiscount(player, discounts)
    local discountPrice, discount = 0
    if type(discounts) == 'string' then
        discount = travelDiscounts[discounts]
        if discount and player:getStorageValue(discount.storage) >= discount.value then
            return discount.price
        end
    else
        for i = 1, #discounts do
            discount = travelDiscounts[discounts[i]]
            if discount and player:getStorageValue(discount.storage) >= discount.value then
                discountPrice = discountPrice + discount.price
            end
        end
    end

    return discountPrice
end

function StdModule.kick(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.travel called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    npcHandler:releaseFocus(cid)
    npcHandler:say(parameters.text or "Off with you!", cid)

    local destination = parameters.destination
    if type(destination) == 'table' then
        destination = destination[math.random(#destination)]
    end

    Player(cid):teleportTo(destination, true)

    npcHandler:resetNpc(cid)
    return true
end

local GreetModule = {}
function GreetModule.greet(cid, message, keywords, parameters)
    if not parameters.npcHandler:isInRange(cid) then
        return true
    end

    if parameters.npcHandler:isFocused(cid) then
        return true
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:addFocus(cid)
    return true
end

function GreetModule.farewell(cid, message, keywords, parameters)
    if not parameters.npcHandler:isFocused(cid) then
        return false
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:resetNpc(cid)
    parameters.npcHandler:releaseFocus(cid)
    return true
end

-- Adds a keyword which acts as a greeting word
function KeywordHandler:addGreetKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.greet, parameters, condition, action)
end

-- Adds a keyword which acts as a farewell word
function KeywordHandler:addFarewellKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.farewell, parameters, condition, action)
end

-- Adds a keyword which acts as a spell word
function KeywordHandler:addSpellKeyword(keys, parameters)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault

    local npcHandler, spellName, price, vocationId = parameters.npcHandler, parameters.spellName, parameters.price, parameters.vocation
    local spellKeyword = self:addKeyword(keys, StdModule.say, {npcHandler = npcHandler, text = string.format("Do you want to learn the spell '%s' for %s?", spellName, price > 0 and price .. ' gold' or 'free')},
        function(player)
            local baseVocationId = player:getVocation():getBase():getId()
            if type(vocationId) == 'table' then
                return isInArray(vocationId, baseVocationId)
            else
                return vocationId == baseVocationId
            end
        end
    )

    spellKeyword:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, spellName = spellName, level = parameters.level, price = price})
    spellKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Maybe next time.', reset = true})
end

local hints = {
    [-1] = 'If you don\'t know the meaning of an icon on the right side, move the mouse cursor on it and wait a moment.',
    [0] = 'Send private messages to other players by right-clicking on the player or the player\'s name and select \'Message to ....\'. You can also open a \'private message channel\' and type in the name of the player.',
    [1] = 'Use the shortcuts \'SHIFT\' to look, \'CTRL\' for use and \'ALT\' for attack when clicking on an object or player.',
    [2] = 'If you already know where you want to go, click on the automap and your character will walk there automatically if the location is reachable and not too far away.',
    [3] = 'To open or close skills, battle or VIP list, click on the corresponding button to the right.',
    [4] = '\'Capacity\' restricts the amount of things you can carry with you. It raises with each level.',
    [5] = 'Always have a look on your health bar. If you see that you do not regenerate health points anymore, eat something.',
    [6] = 'Always eat as much food as possible. This way, you\'ll regenerate health points for a longer period of time.',
    [7] = 'After you have killed a monster, you have 10 seconds in which the corpse is not moveable and no one else but you can loot it.',
    [8] = 'Be careful when you approach three or more monsters because you only can block the attacks of two. In such a situation even a few rats can do severe damage or even kill you.',
    [9] = 'There are many ways to gather food. Many creatures drop food but you can also pick blueberries or bake your own bread. If you have a fishing rod and worms in your inventory, you can also try to catch a fish.',
    [10] = {'Baking bread is rather complex. First of all you need a scythe to harvest wheat. Then you use the wheat with a millstone to get flour. ...', 'This can be be used on water to get dough, which can be used on an oven to bake bread. Use milk instead of water to get cake dough.'},
    [11] = 'Dying hurts! Better run away than risk your life. You are going to lose experience and skill points when you die.',
    [12] = 'When you switch to \'Offensive Fighting\', you deal out more damage but you also get hurt more easily.',
    [13] = 'When you are on low health and need to run away from a monster, switch to \'Defensive Fighting\' and the monster will hit you less severely.',
    [14] = 'Many creatures try to run away from you. Select \'Chase Opponent\' to follow them.',
    [15] = 'The deeper you enter a dungeon, the more dangerous it will be. Approach every dungeon with utmost care or an unexpected creature might kill you. This will result in losing experience and skill points.',
    [16] = 'Due to the perspective, some objects in Tibia are not located at the spot they seem to appear (ladders, windows, lamps). Try clicking on the floor tile the object would lie on.',
    [17] = 'If you want to trade an item with another player, right-click on the item and select \'Trade with ...\', then click on the player with whom you want to trade.',
    [18] = 'Stairs, ladders and dungeon entrances are marked as yellow dots on the automap.',
    [19] = 'You can get food by killing animals or monsters. You can also pick blueberries or bake your own bread. If you are too lazy or own too much money, you can also buy food.',
    [20] = 'Quest containers can be recognised easily. They don\'t open up regularly but display a message \'You have found ....\'. They can only be opened once.',
    [21] = 'Better run away than risk to die. You\'ll lose experience and skill points each time you die.',
    [22] = 'You can form a party by right-clicking on a player and selecting \'Invite to Party\'. The party leader can also enable \'Shared Experience\' by right-clicking on him- or herself.',
    [23] = 'You can assign spells, the use of items, or random text to \'hotkeys\'. You find them under \'Options\'.',
    [24] = 'You can also follow other players. Just right-click on the player and select \'Follow\'.',
    [25] = 'You can found a party with your friends by right-clicking on a player and selecting \'Invite to Party\'. If you are invited to a party, right-click on yourself and select \'Join Party\'.',
    [26] = 'Only found parties with people you trust. You can attack people in your party without getting a skull. This is helpful for training your skills, but can be abused to kill people without having to fear negative consequences.',
    [27] = 'The leader of a party has the option to distribute gathered experience among all players in the party. If you are the leader, right-click on yourself and select \'Enable Shared Experience\'.',
    [28] = 'There is nothing more I can tell you. If you are still in need of some {hints}, I can repeat them for you.'
}

function StdModule.rookgaardHints(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.say called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    local hintId = player:getStorageValue(Storage.RookgaardHints)
    npcHandler:say(hints[hintId], cid)
    if hintId >= #hints then
        player:setStorageValue(Storage.RookgaardHints, -1)
    else
        player:setStorageValue(Storage.RookgaardHints, hintId + 1)
    end
    return true
end

-- VoiceModule
VoiceModule = {
    voices = nil,
    voiceCount = 0,
    lastVoice = 0,
    timeout = nil,
    chance = nil,
    npcHandler = nil
}

-- Creates a new instance of VoiceModule
function VoiceModule:new(voices, timeout, chance)
    local obj = {}
    setmetatable(obj, self)
    self.__index = self

    obj.voices = voices
    for i = 1, #obj.voices do
        local voice = obj.voices[i]
        if voice.yell then
            voice.yell = nil
            voice.talktype = TALKTYPE_YELL
        else
            voice.talktype = TALKTYPE_SAY
        end
    end

    obj.voiceCount = #voices
    obj.timeout = timeout or 10
    obj.chance = chance or 25
    return obj
end

function VoiceModule:init(handler)
    return true
end

function VoiceModule:callbackOnThink()
    if self.lastVoice < os.time() then
        self.lastVoice = os.time() + self.timeout
        if math.random(100) < self.chance  then
            local voice = self.voices[math.random(self.voiceCount)]
            Npc():say(voice.text, voice.talktype)
        end
    end
    return true
end
-- Custom Modules, created to help us in this datapack
local travelDiscounts = {
    ['postman'] = {price = 10, storage = Storage.postman.Rank, value = 3},
    ['new frontier'] = {price = 50, storage = Storage.TheNewFrontier.Mission03, value = 1}
}

function StdModule.travelDiscount(player, discounts)
    local discountPrice, discount = 0
    if type(discounts) == 'string' then
        discount = travelDiscounts[discounts]
        if discount and player:getStorageValue(discount.storage) >= discount.value then
            return discount.price
        end
    else
        for i = 1, #discounts do
            discount = travelDiscounts[discounts[i]]
            if discount and player:getStorageValue(discount.storage) >= discount.value then
                discountPrice = discountPrice + discount.price
            end
        end
    end

    return discountPrice
end

function StdModule.kick(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.travel called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    npcHandler:releaseFocus(cid)
    npcHandler:say(parameters.text or "Off with you!", cid)

    local destination = parameters.destination
    if type(destination) == 'table' then
        destination = destination[math.random(#destination)]
    end

    Player(cid):teleportTo(destination, true)

    npcHandler:resetNpc(cid)
    return true
end

local GreetModule = {}
function GreetModule.greet(cid, message, keywords, parameters)
    if not parameters.npcHandler:isInRange(cid) then
        return true
    end

    if parameters.npcHandler:isFocused(cid) then
        return true
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:addFocus(cid)
    return true
end

function GreetModule.farewell(cid, message, keywords, parameters)
    if not parameters.npcHandler:isFocused(cid) then
        return false
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:resetNpc(cid)
    parameters.npcHandler:releaseFocus(cid)
    return true
end

-- Adds a keyword which acts as a greeting word
function KeywordHandler:addGreetKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.greet, parameters, condition, action)
end

-- Adds a keyword which acts as a farewell word
function KeywordHandler:addFarewellKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.farewell, parameters, condition, action)
end

-- Adds a keyword which acts as a spell word
function KeywordHandler:addSpellKeyword(keys, parameters)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault

    local npcHandler, spellName, price, vocationId = parameters.npcHandler, parameters.spellName, parameters.price, parameters.vocation
    local spellKeyword = self:addKeyword(keys, StdModule.say, {npcHandler = npcHandler, text = string.format("Do you want to learn the spell '%s' for %s?", spellName, price > 0 and price .. ' gold' or 'free')},
        function(player)
            local baseVocationId = player:getVocation():getBase():getId()
            if type(vocationId) == 'table' then
                return isInArray(vocationId, baseVocationId)
            else
                return vocationId == baseVocationId
            end
        end
    )

    spellKeyword:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, spellName = spellName, level = parameters.level, price = price})
    spellKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Maybe next time.', reset = true})
end

local hints = {
    [-1] = 'If you don\'t know the meaning of an icon on the right side, move the mouse cursor on it and wait a moment.',
    [0] = 'Send private messages to other players by right-clicking on the player or the player\'s name and select \'Message to ....\'. You can also open a \'private message channel\' and type in the name of the player.',
    [1] = 'Use the shortcuts \'SHIFT\' to look, \'CTRL\' for use and \'ALT\' for attack when clicking on an object or player.',
    [2] = 'If you already know where you want to go, click on the automap and your character will walk there automatically if the location is reachable and not too far away.',
    [3] = 'To open or close skills, battle or VIP list, click on the corresponding button to the right.',
    [4] = '\'Capacity\' restricts the amount of things you can carry with you. It raises with each level.',
    [5] = 'Always have a look on your health bar. If you see that you do not regenerate health points anymore, eat something.',
    [6] = 'Always eat as much food as possible. This way, you\'ll regenerate health points for a longer period of time.',
    [7] = 'After you have killed a monster, you have 10 seconds in which the corpse is not moveable and no one else but you can loot it.',
    [8] = 'Be careful when you approach three or more monsters because you only can block the attacks of two. In such a situation even a few rats can do severe damage or even kill you.',
    [9] = 'There are many ways to gather food. Many creatures drop food but you can also pick blueberries or bake your own bread. If you have a fishing rod and worms in your inventory, you can also try to catch a fish.',
    [10] = {'Baking bread is rather complex. First of all you need a scythe to harvest wheat. Then you use the wheat with a millstone to get flour. ...', 'This can be be used on water to get dough, which can be used on an oven to bake bread. Use milk instead of water to get cake dough.'},
    [11] = 'Dying hurts! Better run away than risk your life. You are going to lose experience and skill points when you die.',
    [12] = 'When you switch to \'Offensive Fighting\', you deal out more damage but you also get hurt more easily.',
    [13] = 'When you are on low health and need to run away from a monster, switch to \'Defensive Fighting\' and the monster will hit you less severely.',
    [14] = 'Many creatures try to run away from you. Select \'Chase Opponent\' to follow them.',
    [15] = 'The deeper you enter a dungeon, the more dangerous it will be. Approach every dungeon with utmost care or an unexpected creature might kill you. This will result in losing experience and skill points.',
    [16] = 'Due to the perspective, some objects in Tibia are not located at the spot they seem to appear (ladders, windows, lamps). Try clicking on the floor tile the object would lie on.',
    [17] = 'If you want to trade an item with another player, right-click on the item and select \'Trade with ...\', then click on the player with whom you want to trade.',
    [18] = 'Stairs, ladders and dungeon entrances are marked as yellow dots on the automap.',
    [19] = 'You can get food by killing animals or monsters. You can also pick blueberries or bake your own bread. If you are too lazy or own too much money, you can also buy food.',
    [20] = 'Quest containers can be recognised easily. They don\'t open up regularly but display a message \'You have found ....\'. They can only be opened once.',
    [21] = 'Better run away than risk to die. You\'ll lose experience and skill points each time you die.',
    [22] = 'You can form a party by right-clicking on a player and selecting \'Invite to Party\'. The party leader can also enable \'Shared Experience\' by right-clicking on him- or herself.',
    [23] = 'You can assign spells, the use of items, or random text to \'hotkeys\'. You find them under \'Options\'.',
    [24] = 'You can also follow other players. Just right-click on the player and select \'Follow\'.',
    [25] = 'You can found a party with your friends by right-clicking on a player and selecting \'Invite to Party\'. If you are invited to a party, right-click on yourself and select \'Join Party\'.',
    [26] = 'Only found parties with people you trust. You can attack people in your party without getting a skull. This is helpful for training your skills, but can be abused to kill people without having to fear negative consequences.',
    [27] = 'The leader of a party has the option to distribute gathered experience among all players in the party. If you are the leader, right-click on yourself and select \'Enable Shared Experience\'.',
    [28] = 'There is nothing more I can tell you. If you are still in need of some {hints}, I can repeat them for you.'
}

function StdModule.rookgaardHints(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.say called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    local hintId = player:getStorageValue(Storage.RookgaardHints)
    npcHandler:say(hints[hintId], cid)
    if hintId >= #hints then
        player:setStorageValue(Storage.RookgaardHints, -1)
    else
        player:setStorageValue(Storage.RookgaardHints, hintId + 1)
    end
    return true
end

-- VoiceModule
VoiceModule = {
    voices = nil,
    voiceCount = 0,
    lastVoice = 0,
    timeout = nil,
    chance = nil,
    npcHandler = nil
}

-- Creates a new instance of VoiceModule
function VoiceModule:new(voices, timeout, chance)
    local obj = {}
    setmetatable(obj, self)
    self.__index = self

    obj.voices = voices
    for i = 1, #obj.voices do
        local voice = obj.voices[i]
        if voice.yell then
            voice.yell = nil
            voice.talktype = TALKTYPE_YELL
        else
            voice.talktype = TALKTYPE_SAY
        end
    end

    obj.voiceCount = #voices
    obj.timeout = timeout or 10
    obj.chance = chance or 25
    return obj
end

function VoiceModule:init(handler)
    return true
end

function VoiceModule:callbackOnThink()
    if self.lastVoice < os.time() then
        self.lastVoice = os.time() + self.timeout
        if math.random(100) < self.chance  then
            local voice = self.voices[math.random(self.voiceCount)]
            Npc():say(voice.text, voice.talktype)
        end
    end
    return true
end
 
this is all I can find that seems to be related to anything with storage in the files and it was in the core file but doesn't seema nything related to nps either :/

Lua:
PlayerStorageKeys = {
    annihilatorReward = 30015,
    promotion = 30018,
    delayLargeSeaShell = 30019,
    firstRod = 30020,
    delayWallMirror = 30021,
    madSheepSummon = 30023,
    crateUsable = 30024,
    afflictedOutfit = 30026,
    afflictedPlagueMask = 30027,
    afflictedPlagueBell = 30028,
    nailCaseUseCount = 30031,
    swampDigging = 30032,
    achievementsBase = 300000, -- range 300000 to 301000+ reserved for achievements
    achievementsCounter = 20000, -- range 20000 to 21000+ reserved for achievement progress
}

GlobalStorageKeys = {
}
 
if you don't have it in 051-storages.lua

Add on top:

Lua:
Storage = {
    Postman = {
        Rank = 60976,
    },

I don't know what storage it should be :/
 
added that to the top and the server wouldn't even start and added more errors too, ive ried to search for that 051-storages.lua but ive had no luck :/ seems like I don't even have it in any of the files :S

Edit: managed to get the npcs working again after downloading another data file yet mobs are messed up not dropping loot and cant use doors and ladders lmao.
 
Last edited:
for the doors
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/other/doors.lua:onUse
data/actions/scripts/other/doors.lua:47: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [C]: in function 'isInArray'
        data/actions/scripts/other/doors.lua:47: in function <data/actions/scripts/other/doors.lua:45>

and for the kills

Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/quests/their master's voice/ServantsKill.lua:onKill
...pts/scripts/quests/their master's voice/ServantsKill.lua:70: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [C]: in function 'isInArray'
        ...pts/scripts/quests/their master's voice/ServantsKill.lua:70: in function <...pts/scripts/quests/their master's voice/ServantsKill.lua:64>


and I think this is for when i try to use a ladder going up it
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:onUse
data/actions/scripts/other/teleport.lua:3: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [C]: in function 'isInArray'
        data/actions/scripts/other/teleport.lua:3: in function <data/actions/scripts/other/teleport.lua:2>

also found rope, pick and shovel holes do not work. im thinking of going back to where the npcs just don't talk and try to fix it that way as seems a lot less is broken from then compared to now :S
 
What's the server version? Tfs 1.2? Otx?

Try this:

teleport.lua
Lua:
local upFloorIds = {1386, 3678, 5543}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if isInArray(upFloorIds, item.itemid) then
        fromPosition:moveUpstairs()
    else
        fromPosition.z = fromPosition.z + 1
    end
    if player:isPzLocked() and Tile(fromPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_PLAYERISPZLOCKED))
        return true
    end
    player:teleportTo(fromPosition, false)
    return true
end

doors.lua:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 0) > -1 then
    setPlayerStorageValue(cid, 0, -1)
end

    if isInArray(questDoors, item.itemid) == TRUE then
        if getPlayerStorageValue(cid, item.actionid) ~= -1 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
        end
        return TRUE
    elseif isInArray(levelDoors, item.itemid) == TRUE then
        if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
        end
        return TRUE
    elseif isInArray(keys, item.itemid) == TRUE then
        if itemEx.actionid > 0 then
            if item.actionid == itemEx.actionid then
                if doors[itemEx.itemid] ~= nil then
                    doTransformItem(itemEx.uid, doors[itemEx.itemid])
                    return TRUE
                end
            end
            doPlayerSendCancel(cid, "The key does not match.")
            return TRUE
        end
        return FALSE
    elseif isInArray(horizontalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.y = newPosition.y + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif isInArray(verticalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.x = newPosition.x + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif doors[item.itemid] ~= nil then
        if item.actionid == 0 then
            doTransformItem(item.uid, doors[item.itemid])
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        end
        return TRUE
    end
    return FALSE
end
 
I have just tried that and I get a ungodly amount of errors some of which are weapon scripts, spell scrips(cant load and setCondition, unknown spell). createfunction errors. to one that occurs every 5or so second to do with WotE quest and spyHoles. monster scripts to do with setCondition. IncreaseItemID and DecreaseItemID, cant find numerous monsters. Although Npcs are working fine, doors and ladders still not working :/
EDIT: also mobs dont drop any loot.
 
Last edited:
Changed a few things and now im back to just the npc problem with the boat capatins not spawning and npc errors such as
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/Frodo.lua
data/npc/scripts/Frodo.lua:16: attempt to call method 'addAliasKeyword' (a nil value)
stack traceback:
        [C]: in function 'addAliasKeyword'
        data/npc/scripts/Frodo.lua:16: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Frodo.lua
and
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/Baa'leal.lua
data/npc/scripts/Baa'leal.lua:110: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/Baa'leal.lua:110: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Baa'leal.lua
and
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/Karith.lua
data/npc/scripts/Karith.lua:15: attempt to call method 'titleCase' (a nil value)
stack traceback:
        [C]: in function 'titleCase'
        data/npc/scripts/Karith.lua:15: in function 'addTravelKeyword'
        data/npc/scripts/Karith.lua:20: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Karith.lua
and the last type or npc error I get is
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/Tereban.lua
data/npc/scripts/Tereban.lua:12: attempt to index global 'Storage' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/npc/scripts/Tereban.lua:12: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: Tereban.lua

so in total 4 errors I have over some npcs im using the newest version on tfs 1.2 and on a map of rl10.77 now
 
Bring
Up
My
Post

hoping for any soloutions at all, tfs 1.2 map10.98 or 10.77 client is using 10.98 though so im guessing its that.
 
just add these back
@Kouki
of course, here is it
EDIT: also all the npcs show up in RME as mages all in white not sure if that's any help at all?

Lua:
-- Custom Modules, created to help us in this datapack
local travelDiscounts = {
    ['postman'] = {price = 10, storage = Storage.postman.Rank, value = 3},
    ['new frontier'] = {price = 50, storage = Storage.TheNewFrontier.Mission03, value = 1}
}

function StdModule.travelDiscount(player, discounts)
    local discountPrice, discount = 0
    if type(discounts) == 'string' then
        discount = travelDiscounts[discounts]
        if discount and player:getStorageValue(discount.storage) >= discount.value then
            return discount.price
        end
    else
        for i = 1, #discounts do
            discount = travelDiscounts[discounts[i]]
            if discount and player:getStorageValue(discount.storage) >= discount.value then
                discountPrice = discountPrice + discount.price
            end
        end
    end

    return discountPrice
end

function StdModule.kick(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.travel called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    npcHandler:releaseFocus(cid)
    npcHandler:say(parameters.text or "Off with you!", cid)

    local destination = parameters.destination
    if type(destination) == 'table' then
        destination = destination[math.random(#destination)]
    end

    Player(cid):teleportTo(destination, true)

    npcHandler:resetNpc(cid)
    return true
end

local GreetModule = {}
function GreetModule.greet(cid, message, keywords, parameters)
    if not parameters.npcHandler:isInRange(cid) then
        return true
    end

    if parameters.npcHandler:isFocused(cid) then
        return true
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:addFocus(cid)
    return true
end

function GreetModule.farewell(cid, message, keywords, parameters)
    if not parameters.npcHandler:isFocused(cid) then
        return false
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:resetNpc(cid)
    parameters.npcHandler:releaseFocus(cid)
    return true
end

-- Adds a keyword which acts as a greeting word
function KeywordHandler:addGreetKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.greet, parameters, condition, action)
end

-- Adds a keyword which acts as a farewell word
function KeywordHandler:addFarewellKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.farewell, parameters, condition, action)
end

-- Adds a keyword which acts as a spell word
function KeywordHandler:addSpellKeyword(keys, parameters)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault

    local npcHandler, spellName, price, vocationId = parameters.npcHandler, parameters.spellName, parameters.price, parameters.vocation
    local spellKeyword = self:addKeyword(keys, StdModule.say, {npcHandler = npcHandler, text = string.format("Do you want to learn the spell '%s' for %s?", spellName, price > 0 and price .. ' gold' or 'free')},
        function(player)
            local baseVocationId = player:getVocation():getBase():getId()
            if type(vocationId) == 'table' then
                return isInArray(vocationId, baseVocationId)
            else
                return vocationId == baseVocationId
            end
        end
    )

    spellKeyword:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, spellName = spellName, level = parameters.level, price = price})
    spellKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Maybe next time.', reset = true})
end

local hints = {
    [-1] = 'If you don\'t know the meaning of an icon on the right side, move the mouse cursor on it and wait a moment.',
    [0] = 'Send private messages to other players by right-clicking on the player or the player\'s name and select \'Message to ....\'. You can also open a \'private message channel\' and type in the name of the player.',
    [1] = 'Use the shortcuts \'SHIFT\' to look, \'CTRL\' for use and \'ALT\' for attack when clicking on an object or player.',
    [2] = 'If you already know where you want to go, click on the automap and your character will walk there automatically if the location is reachable and not too far away.',
    [3] = 'To open or close skills, battle or VIP list, click on the corresponding button to the right.',
    [4] = '\'Capacity\' restricts the amount of things you can carry with you. It raises with each level.',
    [5] = 'Always have a look on your health bar. If you see that you do not regenerate health points anymore, eat something.',
    [6] = 'Always eat as much food as possible. This way, you\'ll regenerate health points for a longer period of time.',
    [7] = 'After you have killed a monster, you have 10 seconds in which the corpse is not moveable and no one else but you can loot it.',
    [8] = 'Be careful when you approach three or more monsters because you only can block the attacks of two. In such a situation even a few rats can do severe damage or even kill you.',
    [9] = 'There are many ways to gather food. Many creatures drop food but you can also pick blueberries or bake your own bread. If you have a fishing rod and worms in your inventory, you can also try to catch a fish.',
    [10] = {'Baking bread is rather complex. First of all you need a scythe to harvest wheat. Then you use the wheat with a millstone to get flour. ...', 'This can be be used on water to get dough, which can be used on an oven to bake bread. Use milk instead of water to get cake dough.'},
    [11] = 'Dying hurts! Better run away than risk your life. You are going to lose experience and skill points when you die.',
    [12] = 'When you switch to \'Offensive Fighting\', you deal out more damage but you also get hurt more easily.',
    [13] = 'When you are on low health and need to run away from a monster, switch to \'Defensive Fighting\' and the monster will hit you less severely.',
    [14] = 'Many creatures try to run away from you. Select \'Chase Opponent\' to follow them.',
    [15] = 'The deeper you enter a dungeon, the more dangerous it will be. Approach every dungeon with utmost care or an unexpected creature might kill you. This will result in losing experience and skill points.',
    [16] = 'Due to the perspective, some objects in Tibia are not located at the spot they seem to appear (ladders, windows, lamps). Try clicking on the floor tile the object would lie on.',
    [17] = 'If you want to trade an item with another player, right-click on the item and select \'Trade with ...\', then click on the player with whom you want to trade.',
    [18] = 'Stairs, ladders and dungeon entrances are marked as yellow dots on the automap.',
    [19] = 'You can get food by killing animals or monsters. You can also pick blueberries or bake your own bread. If you are too lazy or own too much money, you can also buy food.',
    [20] = 'Quest containers can be recognised easily. They don\'t open up regularly but display a message \'You have found ....\'. They can only be opened once.',
    [21] = 'Better run away than risk to die. You\'ll lose experience and skill points each time you die.',
    [22] = 'You can form a party by right-clicking on a player and selecting \'Invite to Party\'. The party leader can also enable \'Shared Experience\' by right-clicking on him- or herself.',
    [23] = 'You can assign spells, the use of items, or random text to \'hotkeys\'. You find them under \'Options\'.',
    [24] = 'You can also follow other players. Just right-click on the player and select \'Follow\'.',
    [25] = 'You can found a party with your friends by right-clicking on a player and selecting \'Invite to Party\'. If you are invited to a party, right-click on yourself and select \'Join Party\'.',
    [26] = 'Only found parties with people you trust. You can attack people in your party without getting a skull. This is helpful for training your skills, but can be abused to kill people without having to fear negative consequences.',
    [27] = 'The leader of a party has the option to distribute gathered experience among all players in the party. If you are the leader, right-click on yourself and select \'Enable Shared Experience\'.',
    [28] = 'There is nothing more I can tell you. If you are still in need of some {hints}, I can repeat them for you.'
}

function StdModule.rookgaardHints(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.say called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    local hintId = player:getStorageValue(Storage.RookgaardHints)
    npcHandler:say(hints[hintId], cid)
    if hintId >= #hints then
        player:setStorageValue(Storage.RookgaardHints, -1)
    else
        player:setStorageValue(Storage.RookgaardHints, hintId + 1)
    end
    return true
end

-- VoiceModule
VoiceModule = {
    voices = nil,
    voiceCount = 0,
    lastVoice = 0,
    timeout = nil,
    chance = nil,
    npcHandler = nil
}

-- Creates a new instance of VoiceModule
function VoiceModule:new(voices, timeout, chance)
    local obj = {}
    setmetatable(obj, self)
    self.__index = self

    obj.voices = voices
    for i = 1, #obj.voices do
        local voice = obj.voices[i]
        if voice.yell then
            voice.yell = nil
            voice.talktype = TALKTYPE_YELL
        else
            voice.talktype = TALKTYPE_SAY
        end
    end

    obj.voiceCount = #voices
    obj.timeout = timeout or 10
    obj.chance = chance or 25
    return obj
end

function VoiceModule:init(handler)
    return true
end

function VoiceModule:callbackOnThink()
    if self.lastVoice < os.time() then
        self.lastVoice = os.time() + self.timeout
        if math.random(100) < self.chance  then
            local voice = self.voices[math.random(self.voiceCount)]
            Npc():say(voice.text, voice.talktype)
        end
    end
    return true
end
-- Custom Modules, created to help us in this datapack
local travelDiscounts = {
    ['postman'] = {price = 10, storage = Storage.postman.Rank, value = 3},
    ['new frontier'] = {price = 50, storage = Storage.TheNewFrontier.Mission03, value = 1}
}

function StdModule.travelDiscount(player, discounts)
    local discountPrice, discount = 0
    if type(discounts) == 'string' then
        discount = travelDiscounts[discounts]
        if discount and player:getStorageValue(discount.storage) >= discount.value then
            return discount.price
        end
    else
        for i = 1, #discounts do
            discount = travelDiscounts[discounts[i]]
            if discount and player:getStorageValue(discount.storage) >= discount.value then
                discountPrice = discountPrice + discount.price
            end
        end
    end

    return discountPrice
end

function StdModule.kick(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.travel called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    npcHandler:releaseFocus(cid)
    npcHandler:say(parameters.text or "Off with you!", cid)

    local destination = parameters.destination
    if type(destination) == 'table' then
        destination = destination[math.random(#destination)]
    end

    Player(cid):teleportTo(destination, true)

    npcHandler:resetNpc(cid)
    return true
end

local GreetModule = {}
function GreetModule.greet(cid, message, keywords, parameters)
    if not parameters.npcHandler:isInRange(cid) then
        return true
    end

    if parameters.npcHandler:isFocused(cid) then
        return true
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:addFocus(cid)
    return true
end

function GreetModule.farewell(cid, message, keywords, parameters)
    if not parameters.npcHandler:isFocused(cid) then
        return false
    end

    local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() }
    parameters.npcHandler:say(parameters.npcHandler:parseMessage(parameters.text, parseInfo), cid, true)
    parameters.npcHandler:resetNpc(cid)
    parameters.npcHandler:releaseFocus(cid)
    return true
end

-- Adds a keyword which acts as a greeting word
function KeywordHandler:addGreetKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.greet, parameters, condition, action)
end

-- Adds a keyword which acts as a farewell word
function KeywordHandler:addFarewellKeyword(keys, parameters, condition, action)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault
    return self:addKeyword(keys, GreetModule.farewell, parameters, condition, action)
end

-- Adds a keyword which acts as a spell word
function KeywordHandler:addSpellKeyword(keys, parameters)
    local keys = keys
    keys.callback = FocusModule.messageMatcherDefault

    local npcHandler, spellName, price, vocationId = parameters.npcHandler, parameters.spellName, parameters.price, parameters.vocation
    local spellKeyword = self:addKeyword(keys, StdModule.say, {npcHandler = npcHandler, text = string.format("Do you want to learn the spell '%s' for %s?", spellName, price > 0 and price .. ' gold' or 'free')},
        function(player)
            local baseVocationId = player:getVocation():getBase():getId()
            if type(vocationId) == 'table' then
                return isInArray(vocationId, baseVocationId)
            else
                return vocationId == baseVocationId
            end
        end
    )

    spellKeyword:addChildKeyword({'yes'}, StdModule.learnSpell, {npcHandler = npcHandler, spellName = spellName, level = parameters.level, price = price})
    spellKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Maybe next time.', reset = true})
end

local hints = {
    [-1] = 'If you don\'t know the meaning of an icon on the right side, move the mouse cursor on it and wait a moment.',
    [0] = 'Send private messages to other players by right-clicking on the player or the player\'s name and select \'Message to ....\'. You can also open a \'private message channel\' and type in the name of the player.',
    [1] = 'Use the shortcuts \'SHIFT\' to look, \'CTRL\' for use and \'ALT\' for attack when clicking on an object or player.',
    [2] = 'If you already know where you want to go, click on the automap and your character will walk there automatically if the location is reachable and not too far away.',
    [3] = 'To open or close skills, battle or VIP list, click on the corresponding button to the right.',
    [4] = '\'Capacity\' restricts the amount of things you can carry with you. It raises with each level.',
    [5] = 'Always have a look on your health bar. If you see that you do not regenerate health points anymore, eat something.',
    [6] = 'Always eat as much food as possible. This way, you\'ll regenerate health points for a longer period of time.',
    [7] = 'After you have killed a monster, you have 10 seconds in which the corpse is not moveable and no one else but you can loot it.',
    [8] = 'Be careful when you approach three or more monsters because you only can block the attacks of two. In such a situation even a few rats can do severe damage or even kill you.',
    [9] = 'There are many ways to gather food. Many creatures drop food but you can also pick blueberries or bake your own bread. If you have a fishing rod and worms in your inventory, you can also try to catch a fish.',
    [10] = {'Baking bread is rather complex. First of all you need a scythe to harvest wheat. Then you use the wheat with a millstone to get flour. ...', 'This can be be used on water to get dough, which can be used on an oven to bake bread. Use milk instead of water to get cake dough.'},
    [11] = 'Dying hurts! Better run away than risk your life. You are going to lose experience and skill points when you die.',
    [12] = 'When you switch to \'Offensive Fighting\', you deal out more damage but you also get hurt more easily.',
    [13] = 'When you are on low health and need to run away from a monster, switch to \'Defensive Fighting\' and the monster will hit you less severely.',
    [14] = 'Many creatures try to run away from you. Select \'Chase Opponent\' to follow them.',
    [15] = 'The deeper you enter a dungeon, the more dangerous it will be. Approach every dungeon with utmost care or an unexpected creature might kill you. This will result in losing experience and skill points.',
    [16] = 'Due to the perspective, some objects in Tibia are not located at the spot they seem to appear (ladders, windows, lamps). Try clicking on the floor tile the object would lie on.',
    [17] = 'If you want to trade an item with another player, right-click on the item and select \'Trade with ...\', then click on the player with whom you want to trade.',
    [18] = 'Stairs, ladders and dungeon entrances are marked as yellow dots on the automap.',
    [19] = 'You can get food by killing animals or monsters. You can also pick blueberries or bake your own bread. If you are too lazy or own too much money, you can also buy food.',
    [20] = 'Quest containers can be recognised easily. They don\'t open up regularly but display a message \'You have found ....\'. They can only be opened once.',
    [21] = 'Better run away than risk to die. You\'ll lose experience and skill points each time you die.',
    [22] = 'You can form a party by right-clicking on a player and selecting \'Invite to Party\'. The party leader can also enable \'Shared Experience\' by right-clicking on him- or herself.',
    [23] = 'You can assign spells, the use of items, or random text to \'hotkeys\'. You find them under \'Options\'.',
    [24] = 'You can also follow other players. Just right-click on the player and select \'Follow\'.',
    [25] = 'You can found a party with your friends by right-clicking on a player and selecting \'Invite to Party\'. If you are invited to a party, right-click on yourself and select \'Join Party\'.',
    [26] = 'Only found parties with people you trust. You can attack people in your party without getting a skull. This is helpful for training your skills, but can be abused to kill people without having to fear negative consequences.',
    [27] = 'The leader of a party has the option to distribute gathered experience among all players in the party. If you are the leader, right-click on yourself and select \'Enable Shared Experience\'.',
    [28] = 'There is nothing more I can tell you. If you are still in need of some {hints}, I can repeat them for you.'
}

function StdModule.rookgaardHints(cid, message, keywords, parameters, node)
    local npcHandler = parameters.npcHandler
    if npcHandler == nil then
        error("StdModule.say called without any npcHandler instance.")
    end

    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    local hintId = player:getStorageValue(Storage.RookgaardHints)
    npcHandler:say(hints[hintId], cid)
    if hintId >= #hints then
        player:setStorageValue(Storage.RookgaardHints, -1)
    else
        player:setStorageValue(Storage.RookgaardHints, hintId + 1)
    end
    return true
end

-- VoiceModule
VoiceModule = {
    voices = nil,
    voiceCount = 0,
    lastVoice = 0,
    timeout = nil,
    chance = nil,
    npcHandler = nil
}

-- Creates a new instance of VoiceModule
function VoiceModule:new(voices, timeout, chance)
    local obj = {}
    setmetatable(obj, self)
    self.__index = self

    obj.voices = voices
    for i = 1, #obj.voices do
        local voice = obj.voices[i]
        if voice.yell then
            voice.yell = nil
            voice.talktype = TALKTYPE_YELL
        else
            voice.talktype = TALKTYPE_SAY
        end
    end

    obj.voiceCount = #voices
    obj.timeout = timeout or 10
    obj.chance = chance or 25
    return obj
end

function VoiceModule:init(handler)
    return true
end

function VoiceModule:callbackOnThink()
    if self.lastVoice < os.time() then
        self.lastVoice = os.time() + self.timeout
        if math.random(100) < self.chance  then
            local voice = self.voices[math.random(self.voiceCount)]
            Npc():say(voice.text, voice.talktype)
        end
    end
    return true
end
 
seems I don't have customModules.lua anymore so I put it back in and it made no difference :/ had a modules.lua replaced it with the mentioned customModules.lua and all npc vanished. Restroed it back to how it was with just the old modules.lua so i have some of the npcs back working again.
 
Pretty sure this is your problem.

Code:
data/npc/lib/npcsystem/customModules.lua:3: attempt to index global 'Storage' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/npc/lib/npcsystem/customModules.lua:3: in main chunk
        [C]: in function 'dofile'
        data/npc/lib/npc.lua:3: in main chunk
[Warning - NpcScriptInterface::loadNpcLib] Can not load data/npc/lib/npc.lua

You should look through any global files (libs/global/ect.) If you don't have anything like Storage.postman.quest or w/e then you have to create that. You can use any storages. Just go through the npcs and create it all. Then your npcs will work just fine and everything else too.

What you need is the file used to create all the npcs. If you cant find it you have to make your own.
 
not too sure what ive been doing but managed to get most npcs working now, traders and ship captains although getting an error with travelcost but found a few threads about that already. The npcs that don't spawn I get a error like this when trying to summon them

Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/King Tibianus.lua
data/npc/scripts/King Tibianus.lua:98: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/King Tibianus.lua:98: in main chunk
        [C]: in function 'createNpc'
        data/talkactions/scripts/place_npc.lua:11: in function <data/talkactions/scripts/place_npc.lua:1>
[Warning - NpcScript::NpcScript] Can not load script: King Tibianus.lua
 
not too sure what ive been doing but managed to get most npcs working now, traders and ship captains although getting an error with travelcost but found a few threads about that already. The npcs that don't spawn I get a error like this when trying to summon them

Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/King Tibianus.lua
data/npc/scripts/King Tibianus.lua:98: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
        [C]: in function 'addGreetMessage'
        data/npc/scripts/King Tibianus.lua:98: in main chunk
        [C]: in function 'createNpc'
        data/talkactions/scripts/place_npc.lua:11: in function <data/talkactions/scripts/place_npc.lua:1>
[Warning - NpcScript::NpcScript] Can not load script: King Tibianus.lua

you found the solution ?
Lua:
method 'addGreetMessage' (a nil value)
 
Back
Top