• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Loot channel

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,629
Solutions
34
Reaction score
337
this will help player use 0.3777 or 0.4
in monsters.cpp
change
C++:
    std::stringstream ss;
    ss << "Loot of " << nameDescription << ": " << corpse->getContentDescription() << ".";
    if(owner->getParty() && message > LOOTMSG_PLAYER)
        owner->getParty()->broadcastMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
    else if(message == LOOTMSG_PLAYER || message == LOOTMSG_BOTH)
        owner->sendTextMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
}

for
C++:
    std::stringstream ss;
    ss << "Loot of " << nameDescription << ": " << corpse->getContentDescription() << ".";
    if(owner->getParty())
    {
    owner->getParty()->broadcastPartyLoot(ss.str());
    }
    else
    {
    owner->sendChannelMessage("", ss.str(), SPEAK_CHANNEL_Y, uint16_t (12)); // 12 is number for loot channel
    }
}


and in party.cpp add
after
void Party::broadcastMessage(MessageClasses messageClass, const std::string& text, bool sendToInvitations/* = false*/)
add
C++:
 void Party::broadcastPartyLoot(const std::string& loot)
{

    PlayerVector::iterator it;
    leader->sendChannelMessage("", loot, SPEAK_CHANNEL_Y, 12); // 12 is number for loot channel
    if(!memberList.empty())
    {
        for(it = memberList.begin(); it != memberList.end(); ++it)
        (*it)-> sendChannelMessage("", loot, SPEAK_CHANNEL_Y, 12);
    }
}

and in party.h add
C++:
void broadcastPartyLoot(const std::string& loot);

same idea i saw for 1.3 source but i converted it for 0.777 or 0.4
 

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,991
Solutions
9
Reaction score
324
Location
Chile
i have never understood why the syntax between distro and tfs versions(0.4 1.1 1.3)
changes , could someone explain it pls?
 
OP
OP
Elgenady

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,629
Solutions
34
Reaction score
337
i have never understood why the syntax between distro and tfs versions(0.4 1.1 1.3)
changes , could someone explain it pls?
maybe some one can explain it better than me because i not good enough with 1.x
 

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,537
Solutions
260
Reaction score
4,526
i have never understood why the syntax between distro and tfs versions(0.4 1.1 1.3)
changes , could someone explain it pls?

they were coded by different people in different time, people usually doesn't code everything in the same way, that is why there are differences
 

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
548
Solutions
32
Reaction score
296
Location
Poland
GitHub
AscuasFunkeln
i have never understood why the syntax between distro and tfs versions(0.4 1.1 1.3)
changes , could someone explain it pls?
And i never understood why peopole using outdated stuff and then living in shit and complain "that nothing work, looking for something that does exist etc"
 

Mr.Caffeine

Active Member
Joined
Nov 4, 2018
Messages
75
Reaction score
35
Just a tip, remember to set active = 0 otherwise players will be able to chat on the channel

XML:
<channel id="12" name="Loot" active="0"/>
 
OP
OP
Elgenady

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,629
Solutions
34
Reaction score
337
Just a tip, remember to set active = 0 otherwise players will be able to chat on the channel

XML:
<channel id="12" name="Loot" active="0"/>
yes
and add in lib/000-constant/CHANNEL_LOOT = 12
 

rexgandi

Banned User
Joined
Oct 22, 2011
Messages
190
Reaction score
9
what is full code?


give me link for otx 2 source and i will try to make it for u i don't try in this source before
Where you have full code, to loot channel?
I must change only party and monster cpp/h ? (Sry for my ENG)...
 

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
change SPEAK_CHANNEL_Y for MSG_CHANNEL_HIGHLIGHT or choose what u want in const.h
how i set what be the loot channel? on my server and on sources?
Post automatically merged:

dude its work awesome thanks!!!!!!!!
 
Last edited:

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,991
Solutions
9
Reaction score
324
Location
Chile
And i never understood why peopole using outdated stuff and then living in shit and complain "that nothing work, looking for something that does exist etc"
if that goes to me. i must tell you that i'm using tfs 1.3 lol
 

5lave Ots

Active Member
Joined
Oct 2, 2017
Messages
243
Solutions
1
Reaction score
40
Location
Ankrahmun
how to change the c++ syntax of that system to the new nekiro's downgraded to be used on 8.6? 1.3
 
OP
OP
Elgenady

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,629
Solutions
34
Reaction score
337
this for 1.3+
 
Top