View Single Post
  #34  
Old 07-09-2009, 04:12 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

BTW, thanks to some help from AndMetal while working on a solution for the AA issues in SoF, I was able to figure out a nice temporary work-around for handling SoF AAs until we have a final solution to handle them properly.

Basically, what it does now is it sends the Title and Description of the AAs according to what is set in the sof_next_skill field. In most cases, that info will match the skill ID of the AA. In the cases where we were previously getting the unknown DB string message in the AA window, we can now adjust the table to trick the client a bit to allow full functionality of all AAs. Since the issue was that many upgraded versions of AAs were removed in SoF and consolidated into the base version by raising the max that can be trained in them, we could no longer send the client the descriptions for those removed AAs. The work-around is to force it to send the client the information for the upgraded AAs, but send it with the Title and Description of the Base AA. An example is that it now sends Innate Strength 2 times instead of sending Innate Strength and Advanced Innate Strength. The result is that you will see 2 entries for Innate Strength in the AA window. You can tell which is which by looking at the requirements when you select the AA. The upgraded version will show the requirement to be trained in the base version for a certain amount. It will also normally show a higher level requirement and will remain greyed out until you meet the requirements to train the upgraded version. Essentially, it will work exactly like it does for us in Titanium, it just won't show the upgraded name and description of the AAs.

I have included some SQL changes with the update that should make the AA window look quite a bit better in SoF now as far as the ordering of the AAs and which tabs they are displayed on. I tried to get all of the AAs with Prereq_skills set properly, but it is possible I could have missed one or 2. It is really easy to fix that if you see any. You just look at the number it gives in the unknown DB string message and that number will correspond with the skill ID of the AA it is trying to show. Then, you just look at the prereq that is set for that AA in the altadv_vars table and copy that prereq_skill number into the sof_next_skill column for that AA. That should correct the problem. If it still doesn't show up correctly, you might have to look at the AA that is the prereq and see if it also has a prereq. If it does, you can try putting that AAs prereq into the sof_next_skill field of the AA you are seeing the error message for.

There is still a fair amount of work to be done to get AAs to display as they should in SoF, but this work-around should do for now. I think AndMetal and I were able to figure out what needs to be done and it probably isn't too extremely complicated. Basically, we just need a function that can add up the max_level of any AAs that need to be combined into a single one. It would have to send it to the client that way and would also have to be able to reverse what it did when the client purchases AAs that are combined so it knows where to disperse the points to in the player profile. Once that is working, I think the only other thing we might need to do is to have it send the upgraded versions of an AA immediately after it sends the base version and both of them need to use the same sequence number. I think the sequence number is how the client knows to stack multiple AA tables being sent to it into a single AA being displayed on the AA window. I am still not sure on how to handle the coding for all of this, but hopefully it can be done at some point.

Here is some code that AndMetal wrote that should be a good place to start as far as working on totaling the max_level of multiple AAs:
Code:
int Client::GetAAMaxLevel(SendAA_Struct* aa, int count = 1) {
	if (count >= 1000) //just in case we create an infinite loop somehow
		return 0;
	if (!aa) //need to make sure we have an aa to work with first
		return 0;

	int max_level = 0;
	if (this->GetClientVersion() < EQClientSoF) {
		max_level = aa->max_level;
	} else
		max_level = aa->max_level + GetAAMaxLevel(aas_send[aa->sof_next_skill], ++count); //may be able to replace 'aas_send[(aa->sof_next_skill)]' with 'zone.FindAA(aa->sof_next_skill)'

	return max_level;
}
I am unsure where the best place is to do that calculation, but I know the reverse would need to be done in the buyAA code.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 07-09-2009 at 12:14 PM..
Reply With Quote