Page 1 of 1

Spells: Examine / Info

Posted: Wed Dec 03, 2008 12:24 pm
by John Adams
LE, a while back the DB team decided we were going to use Tier 0 (zero) for those spells/arts that do not have tier progression - at least that's my memory of it. There is currently a problem with this plan in the server code for COMMAND_INFO, the 'else' that handles spell info:

Code: Select all

				else{
					sint32 spell_id = atol(sep->arg[1]);
					EQ2Packet* outapp = master_spell_list.GetSpellPacket(spell_id, 1, client, true);
					if(outapp)
						client->QueuePacket(outapp);
					else
						cout << "Unknown Spell ID: " << spell_id << endl;
				}
The second param hardcoded as a 1 is forcing it to look for Tier 1 of any spell in your Knowledge Book. Aside from this being a problem for those Tier 1 abilities, will this also screw up getting info on say a Tier 9 (Master II) spell?
Right now, I can work with Tier 1 only for testing. But I'd eventually like to support no-tier spells as tier 0, and allow Examine info for spells greater-than tier 1.
Thanks

Posted: Wed Dec 03, 2008 3:16 pm
by LethalEncounter
Yah I really need to fix it. I'll add it to my list. Thanks for the heads up!

Posted: Wed Dec 03, 2008 3:18 pm
by John Adams
Heh, I tried to fix it myself, but I cannot find spell_tier :) So I'll leave it for you, unless you want to tell me how to pull out spell_tier in the Commands.cpp.

Posted: Wed Dec 03, 2008 3:31 pm
by LethalEncounter
It isn't that easy. This particular command is from the client asking for the info of a scribed spell. I will need to get the player's spell that they have scribed and send that one instead of a generic one.

Re: Spells: Examine / Info

Posted: Tue Jan 27, 2009 11:15 am
by John Adams
Hmm, I forgot I fiddled with this, and it ended up on SVN (519). LE, could this hack be hurting anything?

Code: Select all

		case COMMAND_USEABILITY:{
			if(sep && sep->arg[0][0] && sep->IsNumber(0)){
				if(client->GetPlayer()->GetHP() == 0){
					client->SimpleMessage(CHANNEL_COLOR_RED,"You cannot do that right now.");
				}
				else{
					int32 spell_id = atoul(sep->arg[0]);
					int8 spell_tier = 0;
					if(sep->arg[1][0] && sep->IsNumber(1))
						spell_tier = atoi(sep->arg[1]);
					else
						spell_tier = client->GetPlayer()->GetSpellTier(spell_id);
					if (!spell_tier) spell_tier = 1;
					spellProcess.ProcessSpell(client->GetCurrentZone(), master_spell_list.GetSpell(spell_id, spell_tier), client->GetPlayer(), client->GetPlayer()->GetTarget());
				}
			}else{
				client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Usage:  /useability {spell_id} [spell_tier]");
			}
			break;
Specifically, "if (!spell_tier) spell_tier = 1;" -- all I did was allow no "tier" param, didn't take anything away. You can still /useability 1000 5 to launch a tier 5 spell.

Re: Spells: Examine / Info

Posted: Tue Jan 27, 2009 5:11 pm
by LethalEncounter
I don't see an issue with it as long as the ground spawns still work properly. That is handled separately and should be fine though.