Exemplo n.º 1
0
void Client::ResetAA() {
	SendClearAA();
	RefundAA();

	memset(&m_pp.aa_array[0], 0, sizeof(AA_Array) * MAX_PP_AA_ARRAY);

	int i = 0;
	for(auto &rank_value : aa_ranks) {
		auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(rank_value.first, rank_value.second.first);
		auto ability = ability_rank.first;
		auto rank = ability_rank.second;

		if(!rank) {
			continue;
		}

		m_pp.aa_array[i].AA = rank_value.first;
		m_pp.aa_array[i].value = rank_value.second.first;
		m_pp.aa_array[i].charges = rank_value.second.second;
		++i;
	}

	for(int i = 0; i < _maxLeaderAA; ++i)
		m_pp.leader_abilities.ranks[i] = 0;

	m_pp.group_leadership_points = 0;
	m_pp.raid_leadership_points = 0;
	m_pp.group_leadership_exp = 0;
	m_pp.raid_leadership_exp = 0;

	database.DeleteCharacterLeadershipAAs(CharacterID());
	// undefined for these clients
	if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
		Kick();
}
Exemplo n.º 2
0
void Client::ResetAA(){
	RefundAA();
	uint32 i;
	for (i = 0; i<MAX_PP_AA_ARRAY; i++){
		aa[i]->AA = 0;
		aa[i]->value = 0;
		m_pp.aa_array[MAX_PP_AA_ARRAY].AA = 0;
		m_pp.aa_array[MAX_PP_AA_ARRAY].value = 0;
	}

	std::map<uint32, uint8>::iterator itr;
	for (itr = aa_points.begin(); itr != aa_points.end(); ++itr)
		aa_points[itr->first] = 0;

	database.DeleteCharacterAAs(this->CharacterID());
	SaveAA();
	SendAATable();
	Kick();
}