More will come, Im still working on the merchantstuff...
NOTE! the cyan text is the section under which you paste the code, it doesnt mean you can paste it directly under that section, just a pointer to get you started, if you look in the section you will see lines that looks like the code you are going to insert, and you need to paste it under a similar line... also note that some lines might allready exist... just replace them, and you can replace the whole old memspell function in EQLib_Commands.cpp with this new one as well
ok here goes-> (DKAA will hang me for not learning the diff thing yet...)
in EQLib.h :
// ***************************************************************************
// EQ Addresses
// ***************************************************************************
Code: Select all
extern DWORD *EQADDR_SPELLBOOKWND;// EQ Functions
// *******************************************************
Code: Select all
extern fEQMemSpell cmdMemSpell;in EQLib_Commands.cpp :
// ***************************************************************************
// Function: MemSpell
// Description: Our '/MemSpell' command
// Usage: /MemSpell gem# "spell name"
// ***************************************************************************
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; [color=green]//Im gonna put in dememcode here instead of returning, be patient...[/color]
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;
}// ***************************************************************************
// Function: TakeControlOfCommandList
// Description: Creates custom command list with our commands
// Points help/parsing at our list
// ***************************************************************************
Code: Select all
{"/memspell", "MemSpell"},// EQ Address Initialization
Code: Select all
DWORD *EQADDR_SPELLBOOKWND;Code: Select all
fEQMemSpell cmdMemSpell = NULL;// Function: ParseINIFile
// Description: Parse INI file for memory locations
// ***************************************************************************
Code: Select all
GetPrivateProfileString("Function Locations","MemSpell","0",szBuffer,MAX_STRING,ClientINI); cmdMemSpell = (fEQMemSpell)strtoul(szBuffer,NULL,16);
GetPrivateProfileString("Class Locations","SpellBookWnd","0",szBuffer,MAX_STRING,ClientINI); EQADDR_SPELLBOOKWND = (DWORD *)strtoul(szBuffer,NULL,16);// ***************************************************************************
// Everquest function typedefs
// ***************************************************************************
Code: Select all
typedef VOID (__cdecl *fEQMemSpell)(DWORD,DWORD);// Exports
// ***************************************************************************
Code: Select all
extern "C" EQLIB_API VOID MemSpell (PSPAWNINFO, PCHAR);Code: Select all
[Function Locations]
MemSpell=004F626C
[Class Locations]
SpellBookWnd=005FE258 [edit] updated with new offsets for patch on july 10 2003

donations for this month's patches.

