View Single Post
  #10  
Old 09-23-2008, 09:37 AM
spoon
Sarnak
 
Join Date: Aug 2007
Posts: 34
Default

Thanks AndMetal, good catch. I managed to add some columns in my spreadsheet throwing everything off. And I don't know what I was thinking with the OPRezzAnswer bit. I obviously didn't have enough coffee yesterday. Wish I could go back and edit/delete those old posts.

Quote:
Anyways, as long as you change the code to check if spells.effectdescnum == 82, it should be fine. The only thing I'm not sure about is the best way to pull the spell data using ra->spellid.
You could add to spdat.h something like:
Code:
int GetSpellEffectDescNum(int16 spell_id);
and to spdat.cpp
Code:
int GetSpellEffectDescNum(int16 spell_id)
{
	if( (spell_id > 0) && (spell_id < SPDAT_RECORDS) ){
		return spells[spell_id].effectdescnum;
	} else {
		return -1;
	}
}

and then just use that in the client_process.cpp. However, if I were to rewrite this chunk of code, I would make a SpellFactory, which would have a method "getSpellById( int16 spell_id)" and have that return an instance of a class Spell. The class Spell would have accessor methods for things like GetEffectDescNum(). The laundry list of "IsWhatever(int spell_id)" is getting out of control.
Reply With Quote