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

Unhandled onTextMessage message mode 0:

popa45

Member
Joined
Oct 14, 2010
Messages
75
Reaction score
9
Location
Brazil
GitHub
vilelafred
tfs 1.5 772 downgrade

Im using this OTClient
Otclient Classic UI (https://otland.net/threads/otclient-classic-ui.279994/)
Post automatically merged:

fixed.

i added those line

Lua:
player:sendTextMessage(MESSAGE_INFO_DESCR, text)

Lua:
-- Rarity Animations
local rare_popup = true
local rare_effect = true
local rare_effect_id = 6

function Monster:onDropLoot(corpse)
    if configManager.getNumber(configKeys.RATE_LOOT) == 0 then
        return
    end

    local player = Player(corpse:getCorpseOwner())
    
    
-- Apply rarity chance to corpse contents and apply animation
if rollRarity(corpse) > 0 then -- If a rare item was rolled, play animation
        if rare_popup then
            local spectators = Game.getSpectators(corpse:getPosition(), false, true, 7, 7, 5, 5)
            for i = 1, #spectators do
                spectators[i]:say(rare_text, TALKTYPE_MONSTER_SAY, false, spectators[i], corpse:getPosition())
            end
        end
    if rare_effect then
        corpse:getPosition():sendMagicEffect(rare_effect_id)
    end
end

    local mType = self:getType()
    if not player or player:getStamina() > 840 then
        local monsterLoot = mType:getLoot()
        for i = 1, #monsterLoot do
            local item = corpse:createLootItem(monsterLoot[i])
            if not item then
                print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
            end
            rollRarity(corpse)
        end

        if player then
            local text = ("Loot of %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
            local party = player:getParty()
            if party then
                party:broadcastPartyLoot(text)
            else
           [B] player:sendTextMessage(MESSAGE_INFO_DESCR, text)[/B]
            end
        end
    else
        local text = ("Loot of %s: nothing (due to low stamina)"):format(mType:getNameDescription())
        local party = player:getParty()
        if party then
            party:broadcastPartyLoot(text)
        else
           [B] player:sendTextMessage(MESSAGE_INFO_DESCR, text)[/B]
        end
    end
end

function Monster:onSpawn(position, startup, artificial)
    self:registerEvent("rollHealth")
    self:registerEvent("rollMana")
    return true
end
 

Attachments

  • Captura de tela 2023-11-22 133723.png
    Captura de tela 2023-11-22 133723.png
    19.2 KB · Views: 8 · VirusTotal
Last edited:
Back
Top