示例#1
0
bool Party::setSharedExperience(Player* player, bool _sharedExpActive)
{
	if (!player || leader != player) {
		return false;
	}

	if (sharedExpActive == _sharedExpActive) {
		return true;
	}

	sharedExpActive = _sharedExpActive;

	if (sharedExpActive) {
		sharedExpEnabled = canEnableSharedExperience();

		if (sharedExpEnabled) {
			leader->sendTextMessage(MESSAGE_INFO_DESCR, "Shared Experience is now active.");
		} else {
			leader->sendTextMessage(MESSAGE_INFO_DESCR, "Shared Experience has been activated, but some members of your party are inactive.");
		}
	} else {
		leader->sendTextMessage(MESSAGE_INFO_DESCR, "Shared Experience has been deactivated.");
	}

	updateAllPartyIcons();
	return true;
}
示例#2
0
void Party::updateSharedExperience()
{
	if (sharedExpActive) {
		bool result = canEnableSharedExperience();
		if (result != sharedExpEnabled) {
			sharedExpEnabled = result;
			updateAllPartyIcons();
		}
	}
}
示例#3
0
文件: party.cpp 项目: Fir3element/035
bool Party::setSharedExperience(Player* player, bool _sharedExpActive)
{
    if(!player || getLeader() != player)
        return false;

    if(sharedExpActive == _sharedExpActive)
        return true;

    sharedExpActive = _sharedExpActive;
    if(sharedExpActive)
    {
        sharedExpEnabled = canEnableSharedExperience();
        if(sharedExpEnabled)
            getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience is now active.");
        else
            getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience has been activated, but some members of your party are inactive.");
    }
    else
        getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience has been deactivated.");

    updateAllIcons();
    return true;
}