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

Compiling Frag decrease time

Zakie

Bunkerz Owner
Joined
May 14, 2008
Messages
171
Reaction score
1
Hello,

I want to change the time to decrease a frag. I tried it with Complining but it isn't working. When i start it up then the OT crash after 2 minutes.

I was wondering since a lot people are asking for it that someone can compiling the TFS 0.3.6pl1 so that you can change it in config. Many people would like it!


Yours,
Zakie
 
Frags are now stored as in real Tibia (frags today, last week and last month). You may have to revert to TFS 0.3.5's frag system or modify the current one in some way.

Maybe I can help you? How many hours do you want for the frags to decrease?
 
Well i want that it decrease one frag each hour. But isn't it possible to make something in config? like:
decreasefragtime: TIME

Would be nice ;D

Yours,
Zakie
 
it isn't possible anymore due to changes in frag system.
iologindata.cpp:1596
Code:
	query << " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " << (_time - 3 * 3600);
player.cpp:3950-4007
Code:
bool Player::addUnjustifiedKill(const Player* attacked)
{
	if(g_game.getWorldType() == WORLD_TYPE_PVP_ENFORCED || attacked == this || hasFlag(
		PlayerFlag_NotGainInFight) || hasCustomFlag(PlayerCustomFlag_NotGainSkull))
		return false;

	if(client)
	{
		char buffer[90];
		sprintf(buffer, "Warning! The murder of %s was not justified.",
			attacked->getName().c_str());
		client->sendTextMessage(MSG_STATUS_WARNING, buffer);
	}

	time_t now = time(NULL), today = (now - 3 * 3600);
	std::vector<time_t> dateList;
	IOLoginData::getInstance()->getUnjustifiedDates(guid, dateList, now);

	dateList.push_back(now);
	uint32_t tc = 0;
	for(std::vector<time_t>::iterator it = dateList.begin(); it != dateList.end(); ++it)
	{
		if((*it) > today)
			tc++;
	}

	uint32_t d = g_config.getNumber(ConfigManager::RED_DAILY_LIMIT);
	if(skull < SKULL_RED && (d > 0 && tc >= d))
		setSkullEnd(now + g_config.getNumber(ConfigManager::RED_SKULL_LENGTH), false, SKULL_RED);

	if(!g_config.getBool(ConfigManager::USE_BLACK_SKULL))
	{
		d += g_config.getNumber(ConfigManager::BAN_DAILY_LIMIT);
		if(d <= 0 || tc < d)
			return true;

		if(!IOBan::getInstance()->addAccountBanishment(accountId, (now + g_config.getNumber(
			ConfigManager::KILLS_BAN_LENGTH)), 20, ACTION_BANISHMENT, "Unjustified player killing.", 0, guid))
			return true;

		sendTextMessage(MSG_INFO_DESCR, "You have been banished.");
		g_game.addMagicEffect(getPosition(), MAGIC_EFFECT_WRAPS_GREEN);
		Scheduler::getInstance().addEvent(createSchedulerTask(1000, boost::bind(
			&Game::kickPlayer, &g_game, getID(), false)));
	}
	else
	{
		d += g_config.getNumber(ConfigManager::BLACK_DAILY_LIMIT);
		if(skull < SKULL_BLACK && (d > 0 && tc >= d))
		{
			setSkullEnd(now + g_config.getNumber(ConfigManager::BLACK_SKULL_LENGTH), false, SKULL_BLACK);
			setAttackedCreature(NULL);
			destroySummons();
		}
	}

	return true;
}
keep in mind that you still have to modify the !frags talkaction
 
Last edited:
Well I tested it finaly :D Had no time to test it. But it seems to be it's not working correctly. I killed someone 3 hours ago and the frag didn't got removed :/
Can you help me again :D
 
Well I tested it finaly :D Had no time to test it. But it seems to be it's not working correctly. I killed someone 3 hours ago and the frag didn't got removed :/
Can you help me again :D
how did you check if the player still has any frags?
 
Back
Top