/MEMSPELL FIXED!

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Wed Jul 09, 2003 5:08 am

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.
Live your dreams! Blue Skies everyone

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

/loadspells and /memspell

Post by grimjack » Wed Jul 09, 2003 6:26 am

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
Last edited by grimjack on Thu Jul 10, 2003 1:03 am, edited 2 times in total.
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: /loadspells and /memspell

Post by EqMule » Wed Jul 09, 2003 7:14 am

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 :)
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Re: /loadspells and /memspell

Post by grimjack » Wed Jul 09, 2003 7:59 am

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
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
Kint
a hill giant
a hill giant
Posts: 208
Joined: Thu Mar 13, 2003 3:36 am

Post by Kint » Wed Jul 09, 2003 8:08 am

great work

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Wed Jul 09, 2003 2:34 pm

Ah yes, you're right Grim. They do perform the same basic function, using two different methods to achieve it.
Live your dreams! Blue Skies everyone

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

offsets for this function after 11 july 2003 patch

Post by EqMule » Thu Jul 10, 2003 9:14 am

Code: Select all

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

[Memory Locations]
SpellFavorites=007117D4

[Class Locations]
SpellBookWnd=005FE258
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

Bones
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 07, 2002 5:37 pm

awesome!

Post by Bones » Thu Aug 07, 2003 10:30 am

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