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

Guild Leaders Channel (9.X and 8.6)

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,947
Solutions
34
Reaction score
1,584
Location
Sweden
Guild Leaders Channel

-ghr].png

This channel is especially for Guild Leaders, where they could chat with each other about upcoming battles et cetera. It has been tested on latest revision, (protocol 9.70 r5893).

Good to know
- Only Guild Leaders will be able to enter the channel.
- It will show their Guild Name next to their own so others can see which guild they're representing.

I'll use channel ID 10, so if that ID is taken already then change to another one!

channels.xml
XML:
<channel id="10" name="Guild Leaders"/>

chat.cpp

Find bool ChatChannel::talk and replace it or compare it with this one.

9.X
[cpp]bool ChatChannel::talk(Player* player, MessageClasses type, const std::string& text, uint32_t statementId)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendCreatureChannelSay(player, type, text, m_id, statementId);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/cpp]

8.6
[CPP]bool ChatChannel::talk(Player* player, SpeakClasses type, const std::string& text, uint32_t _time/* = 0*/)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendToChannel(player, type, text, m_id, _time);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/CPP]
Replace this
[cpp]player->getVocationId())))[/cpp]
with this
[cpp]player->getVocationId())) || (channelId == 10 && !(player->getGuildLevel() == GUILDLEVEL_LEADER)))[/cpp]

Enjoy!
 
Last edited:
I love it, great idea.
I also had a awesome idea, but I forgot it ffs-.-
 
I would say 9.X in current state, but for which protocol do you want it for?
 
8.6 version.

[CPP]bool ChatChannel::talk(Player* player, SpeakClasses type, const std::string& text, uint32_t _time/* = 0*/)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendToChannel(player, type, text, m_id, _time);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/CPP]
 
Last edited:
It should be working for 0.3.6pl1 aswell.
 
Available for non-premium users now :p
 
Seems like you didn't followed the whole "tutorial". The channel is only visible for Leaders.

Just tested it 30 seconds ago. :p
 
That's what I did a few minutes myself and it worked as it should. This makes channel 10 only available for Leaders.
Code:
player->getVocationId())) [COLOR=#ff0000]|| (channelId == 10 && !(player->getGuildLevel() == GUILDLEVEL_LEADER)))[/COLOR]
 
This channel is especially for Guild Leaders, where they could chat with each other about upcoming battles et cetera.

Wait, what? These "trade team" do not have any TeamSpeak or Ventrilo or Skype? o_O

Btw, if this trade team, do not have.. seems legit.
 
Last edited:
Wait, what? These "trade team" do not have any TeamSpeak or Ventrilo or Skype? o_O

Why would you even bring that up? Sure they have these applications available on their computers.

It's a simple channel where you could find other Guild Leaders and arrange battles. Only Guild leaders are able to open this channel anyway.
 
Why would you even bring that up? Sure they have these applications available on their computers.

It's a simple channel where you could find other Guild Leaders and arrange battles. Only Guild leaders are able to open this channel anyway.

So, this is great, but and how about the Vice-leaders? They can't arrange battles with this simple channel? That is unfair
 
It can always be added :p

&& !(player->getGuildLevel() == GUILDLEVEL_VICE)
 
Back
Top