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

loot channel...

Status
Not open for further replies.

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
211
I see in some project a channel that have the loot of monsters, I think this interesting and I want to put in my server too...
well, have another script, I see the "reward system" new, know, the system that share the loot to who was in the battle against the boss, and the players can open the chest in adveturers island...


its all.
thanks
 
I don't really understand what you are asking. Also would help to know what server version
 
well seems tfs 1.1 or 1.2 .. the server is 10.77 I think, well, about my ask is for loot channel,
know, when you kill monsters the loot will appears in server log correct?
the channel will have all the loot from monsters, the loot will appears in a new channel
do you understand?
 
i never done scripts for channels, but if its not Client sided then maybe this will help:
sendChannelMessage(channelId, type, message)
Send all the loot drops trough this and see what happens.
 
It requires alot of work, so I doubt anyone will release it as of now, once more people start getting it they might.
There are "hacks" to make it work, but you don't get it to 100% :p
 
1. source edit to send message of loot to a custom channel is the best way.
2. it's possible via source edits and lua scripts since I've done it on 10.41, but as Wibben said you might not see that released for free for now.
 
this is a quick workaround I did for the first request, if that's what you really wanted
data/chatchannels/chatchannels.xml
Code:
<channel id="9" name="Loot" public="1" script="loot.lua" />
data/chatchannels/scripts/loot.lua
Code:
function onSpeak(player, type, message)
    return false
end
sources/const.h
below
Code:
#define CHANNEL_PARTY 0x01
add
Code:
#define CHANNEL_LOOT 0x09
sources/monsters.cpp
below the two instances of
Code:
if (owner->getParty()) {
    owner->getParty()->broadcastPartyLoot(ss.str());
} else {
    owner->sendTextMessage(MESSAGE_INFO_DESCR, ss.str());
}
add
Code:
owner->sendChannelMessage("", ss.str(), TALKTYPE_CHANNEL_Y, CHANNEL_LOOT);

it doesn't send loot msg to party members though
 
For the party members:
sources/party.cpp
Go to
Code:
void Party::broadcastPartyLoot(const std::string& loot)
{
    leader->sendTextMessage(MESSAGE_INFO_DESCR, loot);

    for (Player* member : memberList) {
        member->sendTextMessage(MESSAGE_INFO_DESCR, loot);
    }
}

Below
Code:
member->sendTextMessage(MESSAGE_INFO_DESCR, loot);

Add
Code:
member->sendChannelMessage("", loot, TALKTYPE_CHANNEL_Y, CHANNEL_LOOT);
 
server log basically becomes a pure loot channel if you turn off some console messages in the tibia client but yeah i could see this being nice for ppl who dont do that
 
For the OX server, what I did was add a 'Loot' channel that the user could open/close. If the channel was open, all loot messages would be sent to that channel and omitted from the server log (party loot messages included), if it was closed it acted normally and sent all loot messages to the server log. All done in the engine, no LUA scripts.
 
For the OX server, what I did was add a 'Loot' channel that the user could open/close. If the channel was open, all loot messages would be sent to that channel and omitted from the server log (party loot messages included), if it was closed it acted normally and sent all loot messages to the server log. All done in the engine, no LUA scripts.

+1. That's what we've done as well.
 
Now I'm compiling to test this.... I've made all steps that you mentioned and something more, in "monsters.cpp" have a verification about the stamina low, I put there too
the line
Code:
owner->sendChannelMessage("", ss.str(), TALKTYPE_CHANNEL_Y, CHANNEL_LOOT);

Now with the test what I can see...
the message of loot appears in server log (if I not open the loot channel)
else of this when I open the channel the message of loot will appears in server log and the loot channel.

Edit: I try to comment this line:
Code:
owner->sendTextMessage(MESSAGE_INFO_DESCR, ss.str());
just do see what happen, well, in the server log not have any message loot :) But, not have the broadcast "green" in screen...
 
Last edited by a moderator:
Don't modify the server log loot message function unless you know what you do or if you want to remove it.

These are the message classes (colors) for sendTextMessage:
Code:
MESSAGE_STATUS_CONSOLE_BLUE = 4, /*FIXME Blue message in the console*/
MESSAGE_STATUS_CONSOLE_RED = 13, /*Red message in the console*/
MESSAGE_STATUS_DEFAULT = 17, /*White message at the bottom of the game window and in the console*/
MESSAGE_STATUS_WARNING = 18, /*Red message in game window and in the console*/
MESSAGE_EVENT_ADVANCE = 19, /*White message in game window and in the console*/
MESSAGE_STATUS_SMALL = 21, /*White message at the bottom of the game window"*/
MESSAGE_INFO_DESCR = 22, /*Green message in game window and in the console*/
MESSAGE_DAMAGE_DEALT = 23,
MESSAGE_DAMAGE_RECEIVED = 24,
MESSAGE_HEALED = 25,
MESSAGE_EXPERIENCE = 26,
MESSAGE_DAMAGE_OTHERS = 27,
MESSAGE_HEALED_OTHERS = 28,
MESSAGE_EXPERIENCE_OTHERS = 29,
MESSAGE_EVENT_DEFAULT = 30, /*White message at the bottom of the game window and in the console*/
MESSAGE_EVENT_ORANGE = 36, /*Orange message in the console*/
MESSAGE_STATUS_CONSOLE_ORANGE = 37,  /*Orange message in the console*/

And sendChannelMessage
Code:
TALKTYPE_SAY = 1,
TALKTYPE_WHISPER = 2,
TALKTYPE_YELL = 3,
TALKTYPE_PRIVATE_FROM = 4,
TALKTYPE_PRIVATE_TO = 5,
TALKTYPE_CHANNEL_Y = 7,
TALKTYPE_CHANNEL_O = 8,
TALKTYPE_PRIVATE_NP = 10,
TALKTYPE_PRIVATE_PN = 12,
TALKTYPE_BROADCAST = 13,
TALKTYPE_CHANNEL_R1 = 14, //red - #c text
TALKTYPE_PRIVATE_RED_FROM = 15, //@name@text
TALKTYPE_PRIVATE_RED_TO = 16, //@name@text
TALKTYPE_MONSTER_SAY = 36,
TALKTYPE_MONSTER_YELL = 37,
TALKTYPE_CHANNEL_R2 = 0xFF, //#d

But you can't use some of them in your request or else you get debug.
 
There are the message classes (colors) for sendTextMessage:
Code:
MESSAGE_STATUS_CONSOLE_BLUE = 4, /*FIXME Blue message in the console*/
MESSAGE_STATUS_CONSOLE_RED = 13, /*Red message in the console*/
MESSAGE_STATUS_DEFAULT = 17, /*White message at the bottom of the game window and in the console*/
MESSAGE_STATUS_WARNING = 18, /*Red message in game window and in the console*/
MESSAGE_EVENT_ADVANCE = 19, /*White message in game window and in the console*/
MESSAGE_STATUS_SMALL = 21, /*White message at the bottom of the game window"*/
MESSAGE_INFO_DESCR = 22, /*Green message in game window and in the console*/
MESSAGE_DAMAGE_DEALT = 23,
MESSAGE_DAMAGE_RECEIVED = 24,
MESSAGE_HEALED = 25,
MESSAGE_EXPERIENCE = 26,
MESSAGE_DAMAGE_OTHERS = 27,
MESSAGE_HEALED_OTHERS = 28,
MESSAGE_EXPERIENCE_OTHERS = 29,
MESSAGE_EVENT_DEFAULT = 30, /*White message at the bottom of the game window and in the console*/
MESSAGE_EVENT_ORANGE = 36, /*Orange message in the console*/
MESSAGE_STATUS_CONSOLE_ORANGE = 37,  /*Orange message in the console*/

And sendChannelMessage
Code:
TALKTYPE_SAY = 1,
TALKTYPE_WHISPER = 2,
TALKTYPE_YELL = 3,
TALKTYPE_PRIVATE_FROM = 4,
TALKTYPE_PRIVATE_TO = 5,
TALKTYPE_CHANNEL_Y = 7,
TALKTYPE_CHANNEL_O = 8,
TALKTYPE_PRIVATE_NP = 10,
TALKTYPE_PRIVATE_PN = 12,
TALKTYPE_BROADCAST = 13,
TALKTYPE_CHANNEL_R1 = 14, //red - #c text
TALKTYPE_PRIVATE_RED_FROM = 15, //@name@text
TALKTYPE_PRIVATE_RED_TO = 16, //@name@text
TALKTYPE_MONSTER_SAY = 36,
TALKTYPE_MONSTER_YELL = 37,
TALKTYPE_CHANNEL_R2 = 0xFF, //#d

You can't use all of them in your request or else you get debug.
maybe do you not understand me....
what I try say:
when the "loot channel" is open the message of loot appears in server log and in the loot channel...
when the "loot channel" is closed just appears in server log... (not is a problem, but if the player want the channel, need to open he how open advertising and others)
I want to remove from server log the message of loot but I don't know how do it
 
Last edited:
Status
Not open for further replies.
Back
Top