Page 1 of 6

SpellReady

Posted: Fri Dec 03, 2004 6:43 pm
by Bretttido
While not a huge bug, I think the SpellReady code should be changed a bit so SpellReady[] returns true when Gems are fading back in from the disabled state. Its pretty simple to do, just change the state check from spellstate==0 to spellstate!=1.

MQ2Main/MQ2DataTypes.cpp: Line 1988

Code: Select all

case SpellReady:
		if (pCastSpellWnd && Index[0])
		{
			if (IsNumber(Index))
			{
				// numeric
				unsigned long nGem=atoi(Index)-1;
				if (nGem<9)
				{
					if (!((PEQCASTSPELLWINDOW)pCastSpellWnd)->SpellSlots[nGem])
						Dest.DWord=0;
					else
						Dest.DWord = (((PEQCASTSPELLWINDOW)pCastSpellWnd)->SpellSlots[nGem]->spellstate!=1);
					Dest.Type=pBoolType;
					return true;
				}
			}
			else
			{
				for (unsigned long nGem=0 ; nGem < 9 ; nGem++)
				{
					if (PSPELL pSpell=GetSpellByID(pChar->MemorizedSpells[nGem]))
					{
						if (!stricmp(Index,pSpell->Name))
						{
							if (!((PEQCASTSPELLWINDOW)pCastSpellWnd)->SpellSlots[nGem])
								Dest.DWord=0;
							else
								Dest.DWord = (((PEQCASTSPELLWINDOW)pCastSpellWnd)->SpellSlots[nGem]->spellstate!=1);
							Dest.Type=pBoolType;
							return true;
						}
					}
				}
			}
		}
		return false;

Posted: Fri Dec 10, 2004 12:03 pm
by frabtik
Have you tested this extensively? Sounds like a huge bug to me, lots of times I find myself casting by hand still when time is critical. Anyway I will definately be testing this out soon and thanks in advance if this is what I been looking for.

Posted: Mon Dec 20, 2004 1:14 am
by Bretttido
I've been using this for the past month. And it works flawlessly... and getting heals off a second quicker has saved me many-o-deaths im sure.

Posted: Mon Dec 20, 2004 8:32 am
by Cr4zyb4rd
*bump*

Looks rock-solid to me.

Posted: Tue Dec 21, 2004 8:29 pm
by Rusty~
If i still played I would be really excited about this :P That "bug" in spell ready is the sole reason i wrote spell_routines.inc that used timers instead to determine if spells were ready... which is kind of sloppy!

Posted: Fri Dec 24, 2004 3:00 pm
by Amadeus
Added to zip. Thanks.

Re: SpellReady

Posted: Thu Mar 06, 2025 10:56 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 10:57 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 10:58 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 10:59 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 11:37 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 11:38 am
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 12:15 pm
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 12:16 pm
by xyilla

Re: SpellReady

Posted: Thu Mar 06, 2025 12:17 pm
by xyilla