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; }
void Party::updateSharedExperience() { if (sharedExpActive) { bool result = canEnableSharedExperience(); if (result != sharedExpEnabled) { sharedExpEnabled = result; updateAllPartyIcons(); } } }
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; }