Page 2 of 2

Posted: Wed Jul 09, 2003 5:08 am
by BlueSkies
Actually, /loadspells mems spells previously saved in a favorites list, while /memspell loads a single spell to a single gem.

Similar, but not the same. I'd like to see both of these functions added to the CVS.

/loadspells and /memspell

Posted: Wed Jul 09, 2003 6:26 am
by grimjack
BlueSkies wrote:Actually, /loadspells mems spells previously saved in a favorites list, while /memspell loads a single spell to a single gem.

Similar, but not the same. I'd like to see both of these functions added to the CVS.
While what you say is true, I don't think that you understand the question. What plaz posted in the other thread was for /loadspells. What he posted here was for /memspell. He found a way to use the function, that is used when loading a spell favorite list, to load single spells. So yes both of these functions do the same thing. Plazmic's does not have a problem with spell unmeming and uses less offsets.


If I read it right. Plazmics code:

Code: Select all

SPELLFAVORITE MemSpellFavorite;
VOID MemSpell(PSPAWNINFO pChar, PCHAR szLine)
{
   if (!EQADDR_SPELLBOOKWND || !cmdLoadSpells) return;
   DWORD Favorite = (DWORD)&MemSpellFavorite;
   CHAR szGem[MAX_STRING] = {0};
   DWORD sp;
   WORD Gem = -1;
   CHAR SpellName[MAX_STRING] = {0};
   PCHARINFO pCharInfo = NULL;
   DWORD SpellBookWnd = *EQADDR_SPELLBOOKWND;
   if (!SpellBookWnd) return;
   if (NULL == (pCharInfo = GetCharInfo())) return;

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

   PSPELLLIST pSpell = GetSpellByName(SpellName);
   if (!pSpell) return;
   if (pSpell->Level[pChar->Class-1]>pChar->Level) return;

   ZeroMemory(&MemSpellFavorite,sizeof(MemSpellFavorite));
   strcpy(MemSpellFavorite.Name,"Mem a Spell");
   MemSpellFavorite.Byte_3A=1;
   for (sp=0;sp<8;sp++) MemSpellFavorite.SpellId[sp]=0xFFFFFFFF;
   MemSpellFavorite.SpellId[Gem] = pSpell->ID;

   __asm {
      push ecx;
      mov ecx, dword ptr [SpellBookWnd];
      push 8;
      push dword ptr [Favorite];
      call dword ptr [cmdLoadSpells];
      pop ecx;
   }
}
would replace this part of Eqmules code for /memspell:

Code: Select all

VOID MemSpell(PSPAWNINFO pChar, PCHAR szLine)
{
   bRunNextCommand = FALSE;
   DWORD SpellBookWnd = *EQADDR_SPELLBOOKWND;
   CHAR szBuffer[MAX_STRING] = {0};
   CHAR szGem[MAX_STRING] = {0};
   WORD Gem = -1;
   CHAR SpellName[MAX_STRING] = {0};
   PCHARINFO pCharInfo = NULL;
   DWORD ID,GEMSLOT;

   if (!SpellBookWnd || !cmdMemSpell) return;
   if (NULL == (pCharInfo = GetCharInfo())) return;

   GetArg(szGem,szLine,1);
   GetArg(SpellName,szLine,2);
   Gem = atoi(szGem);
   if (Gem<1 || Gem>8) return;
   Gem--;
   if (pCharInfo->MemorizedSpells[Gem]!=0xFFFFFFFF) return; //Im gonna put in dememcode here instead of returning, be patient...
   
   PSPELLLIST pSpell = GetSpellByName(SpellName);
   if (!pSpell) {
      sprintf(szBuffer,"Unable to find Spell '%s'",SpellName);
      WriteChatBuffer(szBuffer,CONCOLOR_RED);
      return;
   }
   if (pSpell->Level[pChar->Class-1]>pChar->Level) {
      sprintf(szBuffer,"You need to be level '%d' to memorize that spell ",pSpell->Level[pChar->Class-1]);
      WriteChatBuffer(szBuffer,CONCOLOR_RED);
      return;
   }
   ID = (DWORD)pSpell->ID;
   GEMSLOT = (DWORD)Gem;
   sprintf(szBuffer,"Memorizing spell '%d' in slot '%x' ",pSpell->ID, GEMSLOT+1);
    WriteChatBuffer(szBuffer,USERCOLOR_DEFAULT);
   
   __asm {
    push ecx;
    mov ecx, dword ptr [SpellBookWnd];
    push GEMSLOT;
    push ID;
    call dword ptr [cmdMemSpell];
    pop ecx;
   }
   return;   
}
And you would no longer require these offsets for /memspell:
[Function Locations]
MemSpell=004468C2

Edit: Removed eronious information.

You would only require the offsets that are needed for his /loadspells.
Please correct me if I'm wrong.

Thanks
GrimJack

Re: /loadspells and /memspell

Posted: Wed Jul 09, 2003 7:14 am
by EqMule
grimjack wrote: And you would no longer require these offsets for /memspell:
[Function Locations]
MemSpell=004468C2

[Class Locations]
SpellBookWnd=005E545C

You would only require the offset that is needed for his /loadspells.
Please correct me if I'm wrong.

Thanks
GrimJack
I better start by correcting you then lol
see this line for example?

Code: Select all

if (!EQADDR_SPELLBOOKWND || !cmdLoadSpells) return;

EQADDR_SPELLBOOKWND=SpellBookWnd (005E545C)
cmdLoadSpells=LoadSpells (004466EB)

But yes we could loose one of the offsets, the memspell one...

now uhm, as I have stated before, my coding skills cant be compared to Plaz, and all I do is done based on his work, so if he posts a function it will have precidence over mine... he is also the one with cvs access...

But realise this, his loadspells function is a NEW feature for mq... my memspell function is a FIX of an OLD feature, it will be a very long time before I will attempt to add features to mq, I have problems as it is fixing what is broken lol.

Anyway Plaz, if you read this, how about going over a couple of the broken functions and paste code here for them or pm it to me and Ill make a nice post that DKAA can cvs :)

Re: /loadspells and /memspell

Posted: Wed Jul 09, 2003 7:59 am
by grimjack
EqMule00 wrote:now uhm, as I have stated before, my coding skills cant be compared to Plaz, and all I do is done based on his work, so if he posts a function it will have precidence over mine... he is also the one with cvs access...
I was not comparing your coding with anyones. I was just atempting to answer wassups question. He asked if what you posted and what plaz posted did the same thing. It was an atempt to explain that they acomplished the same thing and also explain the differences.

Anyhow, thanks for clearing up what offsets where still needed.

Thanks
GrimJack

Posted: Wed Jul 09, 2003 8:08 am
by Kint
great work

Posted: Wed Jul 09, 2003 2:34 pm
by BlueSkies
Ah yes, you're right Grim. They do perform the same basic function, using two different methods to achieve it.

offsets for this function after 11 july 2003 patch

Posted: Thu Jul 10, 2003 9:14 am
by EqMule

Code: Select all

[Function Locations]
MemSpell=004F633F
LoadSpells=004F6216

[Memory Locations]
SpellFavorites=007117D4

[Class Locations]
SpellBookWnd=005FE258

awesome!

Posted: Thu Aug 07, 2003 10:30 am
by Bones
Awesome work on this!! This will be by far one of my favorite commands.. Last night I spent some time setting up socials to allow me to mem spells almost instantly.. this is GREAT!!! I will make life much easier for buffing on raids. :)

I do have a question though... I found that not all spells will work with this command.. I CANNOT get it to memorize the lvl 63 enchanter spell Insanity. I checked, double checked, and rechecked the spellling and it just wouldn't memorize it. It will memorize one of my other nukes.. but not this one.

Also I had it work with "greater Fetter" for a while.. then it quit working... then after I had a success with another spell.. greater fetter started working again... strange..

Any ideas about getting Insanity to work? Is it somehow tied to a different name?

THanks for the awesome work.. it's MUCH appreciated!

Bones