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

Windows Create Guild

SonekaBR

New Member
Joined
Nov 8, 2008
Messages
127
Reaction score
0
What i do if the command !createguild don't work, can i do something for it work?


Doing the guild in the table "Guilds" in sqlitestudio on database don't make difference too.

Problem in Avesta 7.6
 
It is very likely that this command just is not available in the sources.
The best solution is to manage guild on the website.
 
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.
 
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.

Mare~ I didn't found the talkaction.cpp on Avesta, i'm searching here but at this moment nothing... I've tryied the easy way add just one line, but nothing too.

If i found the talkaction maybe it can be fixed

More one time tnx Mare~

SOLVED I found one way in sqlitestudio to do guilds on avesta!!

- - - Updated - - -

If im right, you wanna set two guild names? because your saying that you wanna log in with 1/1 and 2/2.

Yeah! but i'm trying this cuz in the last Avesta we have a War mode that if get one team u will not hit your own team 100% just 20% of the damage, cool isn't it? =D
 
Last edited:
Back
Top