Page 1 of 1

/memspell 9 "gate"

Posted: Mon Sep 20, 2004 2:59 am
by s0rcier
look there is still some code that need to be upgraded for the 9th spell gem ... if i do this command, it does nothing ... if i try with gem 8 spell is loading fine!

s0rCieR

Posted: Mon Sep 20, 2004 3:20 am
by Cr4zyb4rd
8 still needs to be changed to a 9 in two places in MQ2Commands. I cited them in another post, but was told I don't know how zero-based arrays works so...

Posted: Mon Sep 20, 2004 3:28 am
by slimjim
MQ2Commands.cpp Memspell function

Code: Select all

// ***************************************************************************
// Function:    MemSpell
// Description: Our '/MemSpell' command
// Usage:       /MemSpell gem# "spell name"
// ***************************************************************************
SPELLFAVORITE MemSpellFavorite;
VOID MemSpell(PSPAWNINFO pChar, PCHAR szLine)
{
    if (!ppSpellBookWnd) return;
    DWORD Favorite = (DWORD)&MemSpellFavorite;
   CHAR szGem[MAX_STRING] = {0};
    DWORD sp;
   WORD Gem = -1;
   CHAR SpellName[MAX_STRING] = {0};
   PCHARINFO pCharInfo = NULL;
    if (!pSpellBookWnd) return;
   if (NULL == (pCharInfo = GetCharInfo())) return;

   GetArg(szGem,szLine,1);
   GetArg(SpellName,szLine,2);
   Gem = atoi(szGem);
   if (Gem<1 || Gem>9) return;
   Gem--;

   pCharInfo->SpellBook;
   PSPELL pSpell=0;
	for (DWORD N = 0 ; N < NUM_BOOK_SLOTS ; N++)
	if (PSPELL pTempSpell=GetSpellByID(pCharInfo->SpellBook[N]))
	{
		if (!stricmp(SpellName,pTempSpell->Name))
		{
			pSpell=pTempSpell;
			break;
		}
	}

    if (!pSpell) return;
    if (pSpell->Level[pChar->Class-1]>pChar->Level) return;

    ZeroMemory(&MemSpellFavorite,sizeof(MemSpellFavorite));
    strcpy(MemSpellFavorite.Name,"Mem a Spell");
    MemSpellFavorite.Byte_3e=1;
    for (sp=0;sp<9;sp++) MemSpellFavorite.SpellId[sp]=0xFFFFFFFF;
    MemSpellFavorite.SpellId[Gem] = pSpell->ID;
	pSpellBookWnd->MemorizeSet((int*)Favorite,9);
}
may want to change:

Code: Select all

pSpellBookWnd->MemorizeSet((int*)&pSpellSets[DoIndex],8);
to

Code: Select all

pSpellBookWnd->MemorizeSet((int*)&pSpellSets[DoIndex],9);
also. I dont know if this will crash for any reason if you dont have the 9th spell slot. Didn't get a chance to test that.

Posted: Mon Sep 20, 2004 3:40 am
by Amadeus
This fix looks good ....will test the last line.

I don't recall seeing this posted before or I would have put it in as well. It irritates me greatly that I had ALL of these fixed at one point and lost it during the transfer from beta to live on my MQ2 source. ...and, unfortunately for you all, I don't use spell gem stuff in anything I do ...so it's not high on my list of things to search for ...honestly, I always mean to go through and fix all of them but then forget until I read about it here on the messageboard again ..lol.

This week is just too hectic trying to level to 70.