Hey again SonekaBR!
Okay so sn3ejk is correct, the command does not exist in the sources for Avesta.
The latest version of Avesta has a few functions for guilds, but nothing for the management thereof.
What this means for us is we either have to use a web ACC to manage guilds (I understand that you don't want to do this), or add support for in game guild management.
HOWEVER.
1.) I don't think that will be as simple as just adding in a new line of code, but I will look into it.
2.) I don't know why you need it. If you are using accounts like 1/1, 2/2 etc. I am assuming all the characters on 1/1 are going to be in the same guild and that will be unchangeable. Same for 2/2 and so on.
What this means for you is we should be able to create the guilds and manage them manually in the database.
You mentioned that you tried creating it manually in sqlitestudio, any idea what did not work about it? Can I please have the sqlite file?
EDIT:
extract of talkaction.cpp from a version of TFS with guild management support
Code:
bool TalkAction::guildJoin(Creature* creature, const std::string&, const std::string& param)
{
Player* player = creature->getPlayer();
if(!player || !g_config.getBool(ConfigManager::INGAME_GUILD_MANAGEMENT))
return false;
std::string param_ = param;
trimString(param_);
if(!player->getGuildId())
{
uint32_t guildId;
if(IOGuild::getInstance()->getGuildId(guildId, param_))
{
if(player->isGuildInvited(guildId))
{
IOGuild::getInstance()->joinGuild(player, guildId);
player->sendTextMessage(MSG_INFO_DESCR, "You have joined the guild.");
char buffer[80];
sprintf(buffer, "%s has joined the guild.", player->getName().c_str());
if(ChatChannel* guildChannel = g_chat.getChannel(player, 0x00))
guildChannel->talk(player, SPEAK_CHANNEL_RA, buffer);
}
else
player->sendCancel("You are not invited to that guild.");
}
else
player->sendCancel("There's no guild with that name.");
}
else
player->sendCancel("You are already in a guild.");
return true;
}
bool TalkAction::guildCreate(Creature* creature, const std::string&, const std::string& param)
{
Player* player = creature->getPlayer();
if(!player || !g_config.getBool(ConfigManager::INGAME_GUILD_MANAGEMENT))
return false;
if(player->getGuildId())
{
player->sendCancel("You are already in a guild.");
return true;
}
std::string param_ = param;
trimString(param_);
if(!isValidName(param_))
{
player->sendCancel("That guild name contains illegal characters, please choose another name.");
return true;
}
uint32_t minLength = g_config.getNumber(ConfigManager::MIN_GUILDNAME),
maxLength = g_config.getNumber(ConfigManager::MAX_GUILDNAME);
if(param_.length() < minLength)
{
player->sendCancel("That guild name is too short, please select a longer name.");
return true;
}
if(param_.length() > maxLength)
{
player->sendCancel("That guild name is too long, please select a shorter name.");
return true;
}
uint32_t guildId;
if(IOGuild::getInstance()->getGuildId(guildId, param_))
{
player->sendCancel("There is already a guild with that name.");
return true;
}
const uint32_t levelToFormGuild = g_config.getNumber(ConfigManager::LEVEL_TO_FORM_GUILD);
if(player->getLevel() < levelToFormGuild)
{
std::stringstream stream;
stream << "You have to be at least Level " << levelToFormGuild << " to form a guild.";
player->sendCancel(stream.str().c_str());
return true;
}
const int32_t premiumDays = g_config.getNumber(ConfigManager::GUILD_PREMIUM_DAYS);
if(player->getPremiumDays() < premiumDays && !g_config.getBool(ConfigManager::FREE_PREMIUM))
{
std::stringstream stream;
stream << "You need to have at least " << premiumDays << " premium days to form a guild.";
player->sendCancel(stream.str().c_str());
return true;
}
player->setGuildName(param_);
IOGuild::getInstance()->createGuild(player);
std::stringstream stream;
stream << "You have formed guild \"" << param.c_str() << "\"!";
player->sendTextMessage(MSG_INFO_DESCR, stream.str().c_str());
return true;
}
Essentially we would need to add the above into the talkaction.cpp of your version of Avesta, and recompile.
There will very likely be more to it than that though. I am not a programmer, I just learn what I need to when I need to!
I hope this answers your questions more fully though.