Spell Gem 10 not available to MemSpell/CastSpell commands

Moderator: MacroQuest Developers

spanners
a lesser mummy
a lesser mummy
Posts: 56
Joined: Wed Jul 04, 2007 3:02 pm

Spell Gem 10 not available to MemSpell/CastSpell commands

Post by spanners » Sun Sep 07, 2008 1:02 am

In the current build, the command MemSpell and CastSpell will not mem/cast if the spell is for/in Gem 10. The following patch can be applied to ISXEQCommands.cpp to enable gem 10.

Code: Select all

--- MQ2-20080906_Orig/MQ2Main/ISXEQ/ISXEQCommands.cpp   2007-11-28 23:18:28.000000000 -0600
+++ MQ2-20080906/MQ2Main/ISXEQ/ISXEQCommands.cpp        2008-09-07 00:10:18.654000000 -0500
@@ -529,7 +529,7 @@
    //   CHAR szArg2[MAX_STRING] = {0};
    if (!stricmp(argv[1],"list")) {
       WriteChatColor("Spells:",USERCOLOR_DEFAULT);
-      for (Index=0;Index<9;Index++) {
+      for (Index=0;Index<NUM_SPELL_GEMS;Index++) {
          if (GetCharInfo2()->MemorizedSpells[Index]==0xFFFFFFFF) {
             WriteChatf("%d. <Empty>",Index+1);
          } else {
@@ -566,7 +566,7 @@
          return 0;
       }
    }
-   for (Index=0;Index<9;Index++) {
+   for (Index=0;Index<NUM_SPELL_GEMS;Index++) {
       if (GetCharInfo2()->MemorizedSpells[Index]!=0xFFFFFFFF) {
          PCHAR SpellName = GetSpellNameByID(GetCharInfo2()->MemorizedSpells[Index]);
          if (!stricmp(argv[1],SpellName)) {
@@ -607,7 +607,7 @@
    if (NULL == (pCharInfo = GetCharInfo())) return -1;

    Gem = atoi(argv[1]);
-   if (Gem<1 || Gem>9) return -1;
+   if (Gem<1 || Gem>NUM_SPELL_GEMS) return -1;
    Gem--;

    GetCharInfo2()->SpellBook;
@@ -628,9 +628,9 @@
     ZeroMemory(&MemSpellFavorite,sizeof(MemSpellFavorite));
     strcpy(MemSpellFavorite.Name,"Mem a Spell");
     MemSpellFavorite.inuse=1;
-    for (sp=0;sp<9;sp++) MemSpellFavorite.SpellId[sp]=0xFFFFFFFF;
+    for (sp=0;sp<NUM_SPELL_GEMS;sp++) MemSpellFavorite.SpellId[sp]=0xFFFFFFFF;
     MemSpellFavorite.SpellId[Gem] = pSpell->ID;
-   pSpellBookWnd->MemorizeSet((int*)Favorite,9);
+   pSpellBookWnd->MemorizeSet((int*)Favorite,NUM_SPELL_GEMS);
    return 0;
 }
spanners

spanners
a lesser mummy
a lesser mummy
Posts: 56
Joined: Wed Jul 04, 2007 3:02 pm

Post by spanners » Sat Apr 11, 2009 10:34 am

Could this fix please be included in the main Zip ? I am having to apply this patch to get access to all 10 spell gems every release.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Sat Apr 11, 2009 6:46 pm

In the next zip.

spanners
a lesser mummy
a lesser mummy
Posts: 56
Joined: Wed Jul 04, 2007 3:02 pm

Post by spanners » Sat Apr 11, 2009 8:15 pm

Thanks, much appreciated.

xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 8:28 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 8:29 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 9:05 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 9:07 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 9:12 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 9:15 am


xyilla
naggy
naggy
Posts: 27391
Joined: Sun Feb 23, 2025 5:36 am

Re: Spell Gem 10 not available to MemSpell/CastSpell commands

Post by xyilla » Sun Aug 31, 2025 9:17 am