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

Lua Damage and Loot Log

helmut7414

New Member
Joined
Mar 3, 2012
Messages
19
Solutions
1
Reaction score
4
Hello Otlanders,

I have a question if someone could help me to add a Loot Channel and a Damage Log for TFS 1.5 , I am useing this engine.
I have already tryed this one here but this does not work, the monster is dieing but does not generate loot until I refresh my screen.
Damage Log is not that important but would be nice.

It would be nice if someone could help me out because I am out of ideas how to solve the problem.
 
Solution
chatchannels xml
Lua:
<channel id="9" name="Loot" public="1" script="loot.lua" />

loot.lua in chatchannels
Lua:
function onSpeak(player, type, message)
    local playerAccountType = player:getAccountType()
    if playerAccountType == ACCOUNT_TYPE_NORMAL then
        player:sendCancelMessage("You can not speak here.")
        return false
    end
    return type
end

in scripts/eventcallbacks/monster
open default_onDropLoot.lua
and change this line:
Lua:
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
to
Lua:
player:sendChannelMessage("", text, TALKTYPE_CHANNEL_O, 9)

about the damage thing
you need to edit source if im not wrong
correct me if im wrong
chatchannels xml
Lua:
<channel id="9" name="Loot" public="1" script="loot.lua" />

loot.lua in chatchannels
Lua:
function onSpeak(player, type, message)
    local playerAccountType = player:getAccountType()
    if playerAccountType == ACCOUNT_TYPE_NORMAL then
        player:sendCancelMessage("You can not speak here.")
        return false
    end
    return type
end

in scripts/eventcallbacks/monster
open default_onDropLoot.lua
and change this line:
Lua:
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
to
Lua:
player:sendChannelMessage("", text, TALKTYPE_CHANNEL_O, 9)

about the damage thing
you need to edit source if im not wrong
correct me if im wrong
 
Solution
Its working, on the 8.6 branch of this Engine, is there any possibility that I could work also for 7.72?
Because if I use this on the 7.72 branch its say´s in OTClient that this is an unknown message type.
 
Its working, on the 8.6 branch of this Engine, is there any possibility that I could work also for 7.72?
Because if I use this on the 7.72 branch its say´s in OTClient that this is an unknown message type.
check ur sources about known message type and change it :D
 
I have tryed all these
C++:
enum SpeakClasses : uint8_t {
    TALKTYPE_SAY = 1,
    TALKTYPE_WHISPER = 2,
    TALKTYPE_YELL = 3,
    TALKTYPE_PRIVATE = 4,
    TALKTYPE_CHANNEL_Y = 5,
    TALKTYPE_RVR_CHANNEL = 6,
    TALKTYPE_RVR_ANSWER = 7,
    TALKTYPE_RVR_CONTINUE = 8,
    TALKTYPE_BROADCAST = 9,
    TALKTYPE_CHANNEL_R1 = 10, //red - #c text
    TALKTYPE_PRIVATE_RED = 11, //@name@text
    TALKTYPE_CHANNEL_O = 12, //@name@text
    TALKTYPE_CHANNEL_R2 = 14, //#d
    TALKTYPE_MONSTER_SAY = 17,
    TALKTYPE_MONSTER_YELL = 17,
};

and I am getting in OTClient this error
ERROR: ProtocolGame parse message exception (56 bytes unread, last opcode is 170, prev opcode is 106): unknown message mode 0

I think its not working :/
Post automatically merged:

I have tested now the chatchannels/scripts/help.lua with the "!mute " command and looked if this is going to show in channel
Even this isn´t going to show up
 
Last edited:
chatchannels xml
Lua:
<channel id="9" name="Loot" public="1" script="loot.lua" />

loot.lua in chatchannels
Lua:
function onSpeak(player, type, message)
    local playerAccountType = player:getAccountType()
    if playerAccountType == ACCOUNT_TYPE_NORMAL then
        player:sendCancelMessage("You can not speak here.")
        return false
    end
    return type
end

in scripts/eventcallbacks/monster
open default_onDropLoot.lua
and change this line:
Lua:
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
to
Lua:
player:sendChannelMessage("", text, TALKTYPE_CHANNEL_O, 9)

about the damage thing
you need to edit source if im not wrong
correct me if im wrong
is there anyway to do it with tfs 1.2?
thanks
 
where should i check where the damage message are being sent? i would like to have a damage log channel just for that
 
Back
Top