Page 1 of 1

TS classes not showing up correctly on items

Posted: Sat Jun 17, 2017 3:55 am
by Ememjr
some Tradeskill items like one below is not showing classes properly, it should be listing the 9 TS classes and not those 4 Adv classes, the DB shows 0 for adv and 15288 for tradeskill_classes
ts item.JPG
i found in the items.cpp where this is handled but i cant seem to figure out the reason its failing, this is happening on both DoV and Live client

Code: Select all

if(generic_info.adventure_classes > 0 || generic_info.tradeskill_classes > 0 || item_level_overrides.size() > 0){
		//int64 classes = 0;
		int16 tmp_level = 0;
		map<int8, int16> adv_class_levels;
		map<int8, int16> tradeskill_class_levels;
		map<int8, int16>::iterator itr;
		int64 tmpVal = 0;
		int8 temp = ASSASSIN;
		// AoD + clients with beastlords
		if (packet->GetVersion() >= 1142)
			temp += 2;

		// Chaneler class, get a more accurate version
		if (packet->GetVersion() >= 60000)
			temp += 2;

		for(int32 i=0;i<=temp;i++){
			tmpVal = (int64)pow(2.0, (double)i);
			if((generic_info.adventure_classes & tmpVal)){
				//classes += 2 << (i - 1);
				classes += tmpVal;
				tmp_level = GetOverrideLevel(i, 255);
				if(tmp_level == 0)
					adv_class_levels[i] = generic_info.adventure_default_level;
				else
					adv_class_levels[i] = tmp_level;
			}
			if(tmpVal == 0) {
				if (packet->GetVersion() >= 60000)
					classes = 576379072454289112;
				else if (packet->GetVersion() >= 57048)
					classes = 6281081087704;
				else if (packet->GetVersion() >= 1142)
					classes = 144095080877876952;
				else
					classes = 36024082983773912;
			}
		}
		for(int i=ALCHEMIST - ARTISAN ;i>=0;i--){
			tmpVal = 2 << i;
			tmpVal = (int64)pow(2.0, (double)i);
			if((generic_info.tradeskill_classes & tmpVal)){
				classes += 2 << (i+ARTISAN-1);
				tmp_level = GetOverrideLevel(i, 255);
				if(tmp_level == 0)
					tradeskill_class_levels[i] = generic_info.tradeskill_default_level;
				else
					tradeskill_class_levels[i] = tmp_level;
			}
		}

Re: TS classes not showing up correctly on items

Posted: Wed Jun 21, 2017 4:41 am
by Ememjr