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

Fix/Patch Vip Add/Remove - exhaust!!!

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
New bug, new fix, enjoy!
game.cpp
Code:
bool Game::playerRequestAddVip(uint32_t playerId, const std::string& vipName)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;

	uint32_t guid;
	bool specialVip;
	
	std::string name = vipName;
	
	if(!IOLoginData::getInstance()->getGuidByNameEx(guid, specialVip, name))
	{
		player->sendTextMessage(MSG_STATUS_SMALL, "A player with that name does not exist.");
		return false;
	}

	if(specialVip && !player->hasFlag(PlayerFlag_SpecialVIP))
	{
		player->sendTextMessage(MSG_STATUS_SMALL, "You cannot add this player.");
		return false;
	}
	
	if(player->hasCondition(CONDITION_EXHAUST, 1))
	{
		player->sendTextMessage(MSG_STATUS_SMALL, "Please wait few seconds before adding new player to your vip list.");
		return false;
	}

	bool online = false;
	if(Player* target = getPlayerByName(name))
		online = player->canSeeCreature(target);
	if(Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 3000, 0, false, 1))
	player->addCondition(condition);
	return player->addVIP(guid, name, online);
}

bool Game::playerRequestRemoveVip(uint32_t playerId, uint32_t guid)
{
	Player* player = getPlayerByID(playerId);
	
	if(!player || player->isRemoved())
		return false;
		
	if(player->hasCondition(CONDITION_EXHAUST, 1))
	{
		player->sendTextMessage(MSG_STATUS_SMALL, "Please wait few seconds before deleting next player from your vip list.");
		return false;
	}
	
	if(Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 3000, 0, false, 1))
	player->addCondition(condition);
	player->removeVIP(guid);
	return true;
}
 
Last edited:
AWESOME!
Should be added to all versions of TFS in SVN, ASAP

Edit: There should be 20 seconds or more of this exhaust cuz normal players don't add more than 3 vips in 5h, but i'll edit it myself.
 
if you add player your vip.. and remove.. and add .. player no see in your vips list, and the message as I said above, that is already added.
 
Did that appear before you added this?
 
I see, going to check that later. :p
 
Back
Top