/memspell 9 "gate"

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

s0rcier
a grimling bloodguard
a grimling bloodguard
Posts: 876
Joined: Mon Aug 02, 2004 10:49 pm

/memspell 9 "gate"

Post by s0rcier » Mon Sep 20, 2004 2:59 am

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

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Mon Sep 20, 2004 3:20 am

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...

slimjim
a ghoul
a ghoul
Posts: 94
Joined: Thu Oct 17, 2002 4:05 pm

Post by slimjim » Mon Sep 20, 2004 3:28 am

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.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Mon Sep 20, 2004 3:40 am

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.