• 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+ A few mistakes ProtocolGame parse

Ciosny

Member
Joined
Aug 16, 2024
Messages
116
Solutions
1
Reaction score
15
TFS 1.4.2 OTCv8 10.98 Tibia,
Hi, I've noticed that I have a few errors with ProtocolGame parse that I'm not entirely sure how to solve.

I'd appreciate any tips on how to deal with these errors :)

1)
ERROR: ProtocolGame parse message exception (22582 bytes, 0 unread, last opcode is 0x32 (50), prev opcode is 0x32 (50)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)ERROR: ProtocolGame parse message exception (46 bytes, 34 unread, last opcode is 0x32 (50), prev opcode is 0xffffffff (-1)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)

2)
ERROR: ProtocolGame parse message exception (1758 bytes, 5 unread, last opcode is 0xd1 (209), prev opcode is 0xaa (170)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)

ProtocolGame parse message exception (1758 bytes, 5 unread, last opcode is 0xd1 (209), prev opcode is 0xaa (170), proto: 1098): InputMessage eof reacheddc 06 31 7f c5 c4 d6 06 1e 83 2e 7d b5 7a 07 05 83 2e 7d b6 7a 07 05 83 2f 7d b6 7a 07 05 83 30 7d b6 7a 07 05 83 2e 7d b7 7a 07 05 83 2f 7d b7 7a 07 05 83 30 7d b7 7a 07 05 83 2e 7d b8 7a 07 05 83 2f 7d b8 7a 07 05 83 2e 7d b9 7a 07 05 83 29 7d ba 7a 07 05 83 2a 7d ba 7a 07 05 83 2b 7d ba 7a 07 05 83 2c 7d ba 7a 07 05 83 2d 7d ba 7a 07 05 83 2e 7d ba 7a 07 05 83 2f 7d ba 7a 07 05 83 30 7d ba 7a 07 05 83 31 7d ba 7a 07 05 83 32 7d ba 7a 07 05 83 33 7d ba 7a 07 05 83 2a 7d bb 7a 07 05 83 2c 7d bb 7a 07 05 83 2d 7d bb 7a 07 05 83 2e 7d bb 7a 07 05 83 2f 7d bb 7a 07 05 83 32 7d bb 7a 07 05 83 2b 7d bc 7a 07 05 83 2c 7d bc 7a 07 05 83 2d 7d bc 7a 07 05 83 2e 7d bc 7a 07 05 83 30 7d bc 7a 07 05 83 2b 7d bd 7a 07 05 83 2c 7d bd 7a 07 05 83 2d 7d bd 7a 07 05 83 2e 7d bd 7a 07 05 83 2f 7d bd 7a 07 05 83 31 7d bd 7a 07 05 83 2c 7d be 7a 07 05 83 2d 7d be 7a 07 05 83 2e 7d be 7a 07 05 83 2f 7d be 7a 07 05 83 2e 7d bf 7a 07 05 6c 2e 7d b6 7a 07 01 33 48 0b 00 00 00 00 6a 2e 7d b6 7a 07 01 49 0b ff 05 01 00 2d 00 00 00 00 33 49 0b 00 00 00 00 83 2e 7d b6 7a 07 01 b4 17 2e 7d b6 7a 07 31 01 00 00 b4 00 00 00 00 00 3f 00 41 20 62 61 72 62 61 72 69 61 6e 20 62 6c 6f 6f 64 77 61 6c 6b 65 72 20 6c 6f 73 65 73 20 33 30 35 20 68 69 74 70 6f 69 6e 74 73 20 64 75 65 20 74 6f 20 79 6f 75 72 20 61 74 74 61 63 6b 2e 8c d2 87 00 40 00 6c 2e 7d ba 7a 07 01 33 48 0b 00 00 00 00 6a 2e 7d ba 7a 07 01 49 0b ff 05 01 00 2d 00 00 00 00 33 49 0b 00 00 00 00 83 2e 7d ba 7a 07 01 b4 17 2e 7d ba 7a 07 91 00 00 00 b4 00 00 00 00 00 3e 00 41 20 62 61 72 62 61 72 69 61 6e 20 62 72 75 74 65 74 61 6d 65 72 20 6c 6f 73 65 73 20 31 34 35 20 68 69 74 70 6f 69 6e 74 73 20 64 75 65 20 74 6f 20 79 6f 75 72 20 61 74 74 61 63 6b 2e 8c de 87 00 40 00 a0 73 00 73 00 ff ff ff ff ff ff ff ff 28 26 06 01 00 00 00 00 67 00 00 64 00 00 00 00 00 00 00 64 00 f7 03 f7 03 65 64 00 64 d8 09 e2 04 00 00 d0 02 00 00 00 aa 3e 10 00 00 05 00 57 69 6c 6b 75 67 00 01 2e 7d ba 7a 07 12 00 65 78 65 76 6f 20 67 72 61 6e 20 6d 61 73 20 76 69 73 6c 2e 7d b6 7a 07 01 6a 2e 7d b6 7a 07 01 46 0b ff 05 01 00 2d 00 00 00 00 33 46 0b 00 00 00 00 6a 2e 7d b6 7a 07 03 6f 00 ff 01 00 0a 00 00 00 00 33 6f 00 00 00 00 00 33 d7 0b 00 00 00 00 33 fe 0d 00 00 00 00 33 c5 0c 00 00 00 00 33 18 0d 00 00 00 00 33 c2 0c 00 00 00 00 33 1e 0d 00 00 00 00 b4 16 ac 00 4c 6f 6f 74 20 6f 66 20 61 20 62 61 72 62 61 72 69 61 6e 20 62 6c 6f 6f 64 77 61 6c 6b 65 72 3a 20 7b 61 20 63 68 61 69 6e 20 61 72 6d 6f 72 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 62 61 74 74 6c 65 20 61 78 65 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 61 20 63 68 61 69 6e 20 68 65 6c 6d 65 74 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 68 61 6c 62 65 72 64 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 68 61 6d 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 38 20 67 6f 6c 64 20 63 6f 69 6e 73 2c 20 23 41 42 41 42 41 42 7d aa 00 00 00 00 00 00 00 00 08 09 00 ac 00 4c 6f 6f 74 20 6f 66 20 61 20 62 61 72 62 61 72 69 61 6e 20 62 6c 6f 6f 64 77 61 6c 6b 65 72 3a 20 7b 61 20 63 68 61 69 6e 20 61 72 6d 6f 72 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 62 61 74 74 6c 65 20 61 78 65 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 61 20 63 68 61 69 6e 20 68 65 6c 6d 65 74 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 68 61 6c 62 65 72 64 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 68 61 6d 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 38 20 67 6f 6c 64 20 63 6f 69 6e 73 2c 20 23 41 42 41 42 41 42 7d d1 15 00 42 61 72 62 61 72 69 61 6e 20 42 6c 6f 6f 64 77 61 6c 6b 65 72 ff 00 72 84 84 84 00 06 d7 0b ff 08 00 00 09 00 67 6f 6c 64 20 63 6f 69 6e fe 0d ff 01 00 00 03 00 68 61 6d c5 0c ff 00 00 07 00 68 61 6c 62 65 72 64 18 0d ff 00 00 0c 00 63 68 61 69 6e 20 68 65 6c 6d 65 74 c2 0c ff 00 00 0a 00 62 61 74 74 6c 65 20 61 78 65 1e 0d ff 00 00 0b 00 63 68 61 69 6e 20 61 72 6d 6f 72 6c 2e 7d b6 7a 07 02 33 1f 03 00 00 00 00 6b 2e 7d b6 7a 07 00 c2 19 ff 01 00 0a 00 00 00 00 33 c2 19 00 00 00 00 6c 2e 7d ba 7a 07 01 33 49 0b 00 00 00 00 6a 2e 7d ba 7a 07 01 46 0b ff 05 01 00 2d 00 00 00 00 33 46 0b 00 00 00 00 6a 2e 7d ba 7a 07 04 c1 17 ff 01 00 0a 00 00 00 00 33 c1 17 00 00 00 00 33 d7 0b 00 00 00 00 33 0d 0e 00 00 00 00 33 1e 0d 00 00 00 00 33 af 1c 00 00 00 00 33 08 0b 00 00 00 00 b4 16 7b 00 4c 6f 6f 74 20 6f 66 20 61 20 62 61 72 62 61 72 69 61 6e 20 62 72 75 74 65 74 61 6d 65 72 3a 20 7b 61 20 62 6f 6f 6b 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 61 20 63 68 61 69 6e 20 61 72 6d 6f 72 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 63 6f 72 6e 63 6f 62 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 31 34 20 67 6f 6c 64 20 63 6f 69 6e 73 2c 20 23 41 42 41 42 41 42 7d aa 00 00 00 00 00 00 00 00 08 09 00 7b 00 4c 6f 6f 74 20 6f 66 20 61 20 62 61 72 62 61 72 69 61 6e 20 62 72 75 74 65 74 61 6d 65 72 3a 20 7b 61 20 62 6f 6f 6b 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 61 20 63 68 61 69 6e 20 61 72 6d 6f 72 2c 20 23 46 46 46 46 46 46 7d 2c 20 7b 61 20 63 6f 72 6e 63 6f 62 2c 20 23 41 42 41 42 41 42 7d 2c 20 7b 31 34 20 67 6f 6c 64 20 63 6f 69 6e 73 2c 20 23 41 42 41 42 41 42 7d d1 14 00 42 61 72 62 61 72 69 61 6e 20 42 72 75 74 65 74 61 6d 65 72 08 01 4e 74 5f 79 00 05 d7 0b ff 0e 00 00 09 00 67 6f 6c 64 20 63 6f 69 6e 0d 0e ff 01 00 00 07 00 63 6f 72 6e 63 6f 62 1e 0d ff 00 00 0b 00 63 68 61 69 6e 20 61 72 6d 6f 72 00 08 0b ff 00 00 04 00 62 6f 6f 6b 6c 2e 7d ba 7a 07 02

3)
ERROR: could not get creatureat: [C++]: ?parseCreatureType@ProtocolGame@@AAEXABV?$shared_object_ptr@VInputMessage@@@stdext@@@Z

4)
ERROR: ProtocolGame parse message exception (46 bytes, 34 unread, last opcode is 0x32 (50), prev opcode is 0xffffffff (-1)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
ProtocolGame parse message exception (46 bytes, 34 unread, last opcode is 0x32 (50), prev opcode is 0xffffffff (-1), proto: 1098): InputMessage eof reached2c 00 6b 14 77 98 26 00 32 66 32 66 20 00 7b 22 64 61 74 61 22 3a 34 34 37 35 30 2c 22 61 63 74 69 6f 6e 22 3a 22 70 6f 69 6e 74 73 22 7d

5)
And the problem is that after killing a monster while standing on it I suddenly can't move, and its graphics "follow me":

Video


Thank you for any help! :)
 
Solution
It seems the error was related to the function "onDropLoot." When I added it and tried to kill the monsters, I got errors just like you showed in the video. I had to remove it, and after killing the monsters, everything worked normally. Then I added it back in the correct way, and it worked perfectly 100%. After some time, I decided to completely remove the killer tracker system. So, you should review this part, like Unknown Soldier explained it, right?

I had it done like this in monster.lua all the time so there must be a bug in player.lua.

data>events>scripts>monster.lua:


LUA:
function Monster:onDropLoot(corpse)
    if...
I̶ ̶a̶s̶s̶u̶m̶e̶ ̶y̶o̶u̶ ̶i̶n̶s̶t̶a̶l̶l̶e̶d̶ ̶x̶a̶m̶p̶p̶/̶u̶n̶i̶f̶o̶r̶m̶,̶
̶s̶e̶t̶ ̶a̶a̶c̶,̶ ̶d̶a̶t̶a̶b̶a̶s̶e̶,̶ ̶c̶o̶n̶f̶i̶g̶.̶

If this is too much for you, let me know, we can set this remotly, through teamviewer, anydesk.


Green button.
Code > download

Unpack, make new folder in data, called things, and another new folder inside things, called 1098, copy original tibia.spr, tibia.dat, from tibia client 1098, probably also tibia.otfi, to the folder 1098.

Start otclient.
Switch in the otclient, to 1098.
Type your logins, in the IP window, type 127.0.0.1
Login to the game.
 
Last edited:
I assume you installed xampp/uniform,
set aac, database, config.

If this is too much for you, let me know, we can set this remotly, through teamviewer, anydesk.


Green button.
Code > download

Unpack, make new folder in data, called things, and another new folder inside things, called 1098, copy original tibia.spr, tibia.dat, from tibia client 1098, probably also tibia.otfi, to the folder 1098.

Start otclient.
Switch in the otclient, to 1098.
Type your logins, in the IP window, type 127.0.0.1
Login to the game.
This explanation has nothing to do with the error in the topic.

Hi, I've noticed that I have a few errors with ProtocolGame parse that I'm not entirely sure how to solve.
The 0xD1 bytes I found seem to be related to this:Exp/Kill/Drop Tracker Module [OTCV8] [TFS 1.4.2] (https://otland.net/threads/exp-kill-drop-tracker-module-otcv8-tfs-1-4-2.288906/). Please verify the scripts carefully. If you did add them, you should review everything, as it might have been added incorrectly or something like that.
 
Last edited:
This explanation has nothing to do with the error in the topic.


The 0xD1 bytes I found seem to be related to this:Exp/Kill/Drop Tracker Module [OTCV8] [TFS 1.4.2] (https://otland.net/threads/exp-kill-drop-tracker-module-otcv8-tfs-1-4-2.288906/). Please verify the scripts carefully. If you did add them, you should review everything, as it might have been added incorrectly or something like that.
Yes, I added Exp/Kill/Drop module to my server. I will review the whole topic carefully :)

Thank you
 
This explanation has nothing to do with the error in the topic.


The 0xD1 bytes I found seem to be related to this:Exp/Kill/Drop Tracker Module [OTCV8] [TFS 1.4.2] (https://otland.net/threads/exp-kill-drop-tracker-module-otcv8-tfs-1-4-2.288906/). Please verify the scripts carefully. If you did add them, you should review everything, as it might have been added incorrectly or something like that.
Yes, here is the error you mentioned. I don't have a few things so I have to review everything carefully from the commit he gave and additional things. This is probably causing the 0xD1 errors

lib/core/player.lua:

LUA:
local foodCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)

function Player.feed(self, food)
    local condition = self:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
    if condition then
        condition:setTicks(condition:getTicks() + (food * 1000))
    else
        local vocation = self:getVocation()
        if not vocation then
            return nil
        end

        foodCondition:setTicks(food * 1000)
        foodCondition:setParameter(CONDITION_PARAM_HEALTHGAIN, vocation:getHealthGainAmount())
        foodCondition:setParameter(CONDITION_PARAM_HEALTHTICKS, vocation:getHealthGainTicks() * 1000)
        foodCondition:setParameter(CONDITION_PARAM_MANAGAIN, vocation:getManaGainAmount())
        foodCondition:setParameter(CONDITION_PARAM_MANATICKS, vocation:getManaGainTicks() * 1000)

        self:addCondition(foodCondition)
    end
    return true
end

function Player.getClosestFreePosition(self, position, extended)
    if self:getGroup():getAccess() and self:getAccountType() >= ACCOUNT_TYPE_GOD then
        return position
    end
    return Creature.getClosestFreePosition(self, position, extended)
end

function Player.getDepotItems(self, depotId)
    return self:getDepotChest(depotId, true):getItemHoldingCount()
end

function Player.hasFlag(self, flag)
    return self:getGroup():hasFlag(flag)
end

function Player.getLossPercent(self)
    local blessings = 0
    local lossPercent = {
        [0] = 100,
        [1] = 70,
        [2] = 45,
        [3] = 25,
        [4] = 10,
        [5] = 0
    }

    for i = 1, 5 do
        if self:hasBlessing(i) then
            blessings = blessings + 1
        end
    end
    return lossPercent[blessings]
end

function Player.getPremiumTime(self)
    return math.max(0, self:getPremiumEndsAt() - os.time())
end

function Player.setPremiumTime(self, seconds)
    self:setPremiumEndsAt(os.time() + seconds)
    return true
end

function Player.addPremiumTime(self, seconds)
    self:setPremiumTime(self:getPremiumTime() + seconds)
    return true
end

function Player.removePremiumTime(self, seconds)
    local currentTime = self:getPremiumTime()
    if currentTime < seconds then
        return false
    end

    self:setPremiumTime(currentTime - seconds)
    return true
end

function Player.getPremiumDays(self)
    return math.floor(self:getPremiumTime() / 86400)
end

function Player.addPremiumDays(self, days)
    return self:addPremiumTime(days * 86400)
end

function Player.removePremiumDays(self, days)
    return self:removePremiumTime(days * 86400)
end

function Player.isPremium(self)
    return self:getPremiumTime() > 0 or configManager.getBoolean(configKeys.FREE_PREMIUM) or self:hasFlag(PlayerFlag_IsAlwaysPremium)
end

function Player.sendCancelMessage(self, message)
    if type(message) == "number" then
        message = Game.getReturnMessage(message)
    end
    return self:sendTextMessage(MESSAGE_STATUS_SMALL, message)
end

function Player.isUsingOtClient(self)
    return self:getClient().os >= CLIENTOS_OTCLIENT_LINUX
end

function Player.sendExtendedOpcode(self, opcode, buffer)
    if not self:isUsingOtClient() then
        return false
    end

    local networkMessage = NetworkMessage()
    networkMessage:addByte(0x32)
    networkMessage:addByte(opcode)
    networkMessage:addString(buffer)
    networkMessage:sendToPlayer(self)
    networkMessage:delete()
    return true
end

APPLY_SKILL_MULTIPLIER = true
local addSkillTriesFunc = Player.addSkillTries
function Player.addSkillTries(...)
    APPLY_SKILL_MULTIPLIER = false
    local ret = addSkillTriesFunc(...)
    APPLY_SKILL_MULTIPLIER = true
    return ret
end

local addManaSpentFunc = Player.addManaSpent
function Player.addManaSpent(...)
    APPLY_SKILL_MULTIPLIER = false
    local ret = addManaSpentFunc(...)
    APPLY_SKILL_MULTIPLIER = true
    return ret
end

-- Always pass the number through the isValidMoney function first before using the transferMoneyTo
function Player.transferMoneyTo(self, target, amount)
    if not target then
        return false
    end

    -- See if you can afford this transfer
    local balance = self:getBankBalance()
    if amount > balance then
        return false
    end

    -- See if player is online
    local targetPlayer = Player(target.guid)
    if targetPlayer then
        targetPlayer:setBankBalance(targetPlayer:getBankBalance() + amount)
    else
        db.query("UPDATE `players` SET `balance` = `balance` + " .. amount .. " WHERE `id` = '" .. target.guid .. "'")
    end

    self:setBankBalance(self:getBankBalance() - amount)
    return true
end

function Player.canCarryMoney(self, amount)
    -- Anyone can carry as much imaginary money as they desire
    if amount == 0 then
        return true
    end

    -- The 3 below loops will populate these local variables
    local totalWeight = 0
    local inventorySlots = 0

    -- Add crystal coins to totalWeight and inventorySlots
    local type_crystal = ItemType(ITEM_CRYSTAL_COIN)
    local crystalCoins = math.floor(amount / 10000)
    if crystalCoins > 0 then
        amount = amount - (crystalCoins * 10000)
        while crystalCoins > 0 do
            local count = math.min(100, crystalCoins)
            totalWeight = totalWeight + type_crystal:getWeight(count)
            crystalCoins = crystalCoins - count
            inventorySlots = inventorySlots + 1
        end
    end

    -- Add platinum coins to totalWeight and inventorySlots
    local type_platinum = ItemType(ITEM_PLATINUM_COIN)
    local platinumCoins = math.floor(amount / 100)
    if platinumCoins > 0 then
        amount = amount - (platinumCoins * 100)
        while platinumCoins > 0 do
            local count = math.min(100, platinumCoins)
            totalWeight = totalWeight + type_platinum:getWeight(count)
            platinumCoins = platinumCoins - count
            inventorySlots = inventorySlots + 1
        end
    end

    -- Add gold coins to totalWeight and inventorySlots
    local type_gold = ItemType(ITEM_GOLD_COIN)
    if amount > 0 then
        while amount > 0 do
            local count = math.min(100, amount)
            totalWeight = totalWeight + type_gold:getWeight(count)
            amount = amount - count
            inventorySlots = inventorySlots + 1
        end
    end

    -- If player don't have enough capacity to carry this money
    if self:getFreeCapacity() < totalWeight then
        return false
    end

    -- If player don't have enough available inventory slots to carry this money
    local backpack = self:getSlotItem(CONST_SLOT_BACKPACK)
    if not backpack or backpack:getEmptySlots(true) < inventorySlots then
        return false
    end
    return true
end

function Player.withdrawMoney(self, amount)
    local balance = self:getBankBalance()
    if amount > balance or not self:addMoney(amount) then
        return false
    end

    self:setBankBalance(balance - amount)
    return true
end

function Player.depositMoney(self, amount)
    if not self:removeMoney(amount) then
        return false
    end

    self:setBankBalance(self:getBankBalance() + amount)
    return true
end

function Player.removeTotalMoney(self, amount)
    local moneyCount = self:getMoney()
    local bankCount = self:getBankBalance()
    if amount <= moneyCount then
        self:removeMoney(amount)
        return true
    elseif amount <= (moneyCount + bankCount) then
        if moneyCount ~= 0 then
            self:removeMoney(moneyCount)
            local remains = amount - moneyCount
            self:setBankBalance(bankCount - remains)
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("Paid %d from inventory and %d gold from bank account. Your account balance is now %d gold."):format(moneyCount, amount - moneyCount, self:getBankBalance()))
            return true
        else
            self:setBankBalance(bankCount - amount)
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("Paid %d gold from bank account. Your account balance is now %d gold."):format(amount, self:getBankBalance()))
            return true
        end
    end
    return false
end

function Player.addLevel(self, amount, round)
    round = round or false
    local level, amount = self:getLevel(), amount or 1
    if amount > 0 then
        return self:addExperience(Game.getExperienceForLevel(level + amount) - (round and self:getExperience() or Game.getExperienceForLevel(level)))
    else
        return self:removeExperience(((round and self:getExperience() or Game.getExperienceForLevel(level)) - Game.getExperienceForLevel(level + amount)))
    end
end

function Player.addMagicLevel(self, value)
    local currentMagLevel = self:getBaseMagicLevel()
    local sum = 0

    if value > 0 then
        while value > 0 do
            sum = sum + self:getVocation():getRequiredManaSpent(currentMagLevel + value)
            value = value - 1
        end

        return self:addManaSpent(sum - self:getManaSpent())
    else
        value = math.min(currentMagLevel, math.abs(value))
        while value > 0 do
            sum = sum + self:getVocation():getRequiredManaSpent(currentMagLevel - value + 1)
            value = value - 1
        end

        return self:removeManaSpent(sum + self:getManaSpent())
    end
end

function Player.addSkillLevel(self, skillId, value)
    local currentSkillLevel = self:getSkillLevel(skillId)
    local sum = 0

    if value > 0 then
        while value > 0 do
            sum = sum + self:getVocation():getRequiredSkillTries(skillId, currentSkillLevel + value)
            value = value - 1
        end

        return self:addSkillTries(skillId, sum - self:getSkillTries(skillId))
    else
        value = math.min(currentSkillLevel, math.abs(value))
        while value > 0 do
            sum = sum + self:getVocation():getRequiredSkillTries(skillId, currentSkillLevel - value + 1)
            value = value - 1
        end

        return self:removeSkillTries(skillId, sum + self:getSkillTries(skillId), true)
    end
end

function Player.addSkill(self, skillId, value, round)
    if skillId == SKILL_LEVEL then
        return self:addLevel(value, round or false)
    elseif skillId == SKILL_MAGLEVEL then
        return self:addMagicLevel(value)
    end
    return self:addSkillLevel(skillId, value)
end

function Player.getWeaponType(self)
    local weapon = self:getSlotItem(CONST_SLOT_LEFT)
    if weapon then
        return weapon:getType():getWeaponType()
    end
    return WEAPON_NONE
end

function Player.updateKillTracker(self, monster, corpse)
    local monsterType = monster:getType()
    if not monsterType then
        return false
    end
   
    local monsterOutfit = monsterType:getOutfit()

    local networkMessage = NetworkMessage()
    networkMessage:addByte(0xD1)
    networkMessage:addString(monster:getName())
    networkMessage:addU16(monsterOutfit.lookType or 19)
    networkMessage:addByte(monsterOutfit.lookHead)
    networkMessage:addByte(monsterOutfit.lookBody)
    networkMessage:addByte(monsterOutfit.lookLegs)
    networkMessage:addByte(monsterOutfit.lookFeet)
    networkMessage:addByte(monsterOutfit.lookAddons)
    networkMessage:addByte(corpse:getSize())

    for i = corpse:getSize() - 1, 0, -1 do
        local item = corpse:getItem(i)
        if item:isContainer() then
            networkMessage:addByte(item:getSize())
            for j = item:getSize() - 1, 0, -1 do
                local containerItem = item:getItem(j)
                networkMessage:addItem(containerItem)
                networkMessage:addString(containerItem:getName()) --- ADD THIS
            end
        else
            networkMessage:addItem(item)
            networkMessage:addString(item:getName()) --- ADD THIS
        end
    end

    if self:getParty() then
        networkMessage:sendToPlayer(self:getParty():getLeader())
        local membersList = self:getParty():getMembers()
        for i = 1, #membersList do
            local player = membersList[i]
            if player then
                networkMessage:sendToPlayer(player)
            end
        end
        networkMessage:delete()
        return true
    end

    networkMessage:sendToPlayer(self)
    networkMessage:delete()
    return true
end
 
It seems the error was related to the function "onDropLoot." When I added it and tried to kill the monsters, I got errors just like you showed in the video. I had to remove it, and after killing the monsters, everything worked normally. Then I added it back in the correct way, and it worked perfectly 100%. After some time, I decided to completely remove the killer tracker system. So, you should review this part, like Unknown Soldier explained it, right?

 
It seems the error was related to the function "onDropLoot." When I added it and tried to kill the monsters, I got errors just like you showed in the video. I had to remove it, and after killing the monsters, everything worked normally. Then I added it back in the correct way, and it worked perfectly 100%. After some time, I decided to completely remove the killer tracker system. So, you should review this part, like Unknown Soldier explained it, right?

I had it done like this in monster.lua all the time so there must be a bug in player.lua.

data>events>scripts>monster.lua:


LUA:
function Monster:onDropLoot(corpse)
    if hasEventCallback(EVENT_CALLBACK_ONDROPLOOT) then
        EventCallback(EVENT_CALLBACK_ONDROPLOOT, self, corpse)
    end

    local player = Player(corpse:getCorpseOwner())
    if player then
        player:updateKillTracker(self, corpse)
    end
end

function Monster:onSpawn(position, startup, artificial)
    if hasEventCallback(EVENT_CALLBACK_ONSPAWN) then
        return EventCallback(EVENT_CALLBACK_ONSPAWN, self, position, startup, artificial)
    else
        return true
    end
end

function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if creature:isMonster() then
        local boost = bossBoosts[creature:getId()]
        if boost and os.time() < boost.endTime then
            local multiplier = 1 + (config.baseDamageBoost * boost.stacks)
            primaryDamage = primaryDamage * multiplier
            secondaryDamage = secondaryDamage * multiplier
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end



okey thanks ! :) I changed my "function Player.updateKillTracker(self, monster, corpse)" and I don't get the error with "ghost" and 0xD1.

I have now only:

1) (when i buy something in store)
ERROR: ProtocolGame parse message exception (46 bytes, 34 unread, last opcode is 0x32 (50), prev opcode is 0xffffffff (-1)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
ProtocolGame parse message exception (46 bytes, 34 unread, last opcode is 0x32 (50), prev opcode is 0xffffffff (-1), proto: 1098): InputMessage eof reached2c 00 6b 14 77 98 26 00 32 66 32 66 20 00 7b 22 64 61 74 61 22 3a 34 34 37 35 30 2c 22 61 63 74 69 6f 6e 22 3a 22 70 6f 69 6e 74 73 22 7d
2) (other i think)
ERROR: ProtocolGame parse message exception (22582 bytes, 0 unread, last opcode is 0x32 (50), prev opcode is 0x32 (50)): InputMessage eof reachedPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
3) (I had this only one time. Idk what it is):
ERROR: could not get creatureat: [C++]: ?parseCreatureType@ProtocolGame@@AAEXABV?$shared_object_ptr@VInputMessage@@@stdext@@@Z
 
Last edited:
Solution
Maybe it's a problem with a large store like in the topic now one, which they solve if the error pops up during the purchase?


But I don't know that much :D Let the smarter ones speak up

btw. I had this problem once but I don't remember how I solved it:/
ERROR: could not get creatureat: [C++]: ?parseCreatureType@ProtocolGame@@AAEXABV?$shared_object_ptr@VInputMessage@@@stdext@@@Z
 
Back
Top