Changes to Spell handling...
Posted: Thu Apr 24, 2003 6:00 pm
Greetings Constructs,
There were some changes to the way the spell list is handled. To get spell functions working again make the following changes.
In MQ.h add the following before the _SPELLLIST struct:
In EQLib.cpp replace the following functions:
Change the line in MemSpell from:
to
End of line...
There were some changes to the way the spell list is handled. To get spell functions working again make the following changes.
In MQ.h add the following before the _SPELLLIST struct:
Code: Select all
#define SPELLLIST_STARTOFFSET 0x24
#define TOTAL_SPELL_COUNT 0x0FA0 // # of spells in gameCode: Select all
PCHAR GetSpellByID(DWORD dwSpellID) {
PCHAR szUnknown = "Unknown Spell";
PSPELLLIST pSpell = NULL;
if (EQADDR_SPELLS != NULL) {
PSPELLLIST *pList = (PSPELLLIST*)(((DWORD)*EQADDR_SPELLS) + SPELLLIST_STARTOFFSET);
pSpell = pList[dwSpellID];
if (pSpell != NULL) {
if (pSpell->Name != NULL) {
return pSpell->Name;
}
}
}
return szUnknown;
}Code: Select all
PSPELLLIST GetSpellByName(PCHAR szName) {
PSPELLLIST pSpell = NULL;
if (EQADDR_SPELLS != NULL) {
PSPELLLIST *pList = (PSPELLLIST*)(((DWORD)*EQADDR_SPELLS) + SPELLLIST_STARTOFFSET);
for (DWORD dwSpellID = 0; dwSpellID < TOTAL_SPELL_COUNT; dwSpellID++) {
pSpell = pList[dwSpellID];
if ((pSpell->ID > 0) && (pSpell->ID < TOTAL_SPELL_COUNT)) {
if (pSpell->Name != NULL) {
if (!strnicmp(szName, pSpell->Name, strlen(szName))) {
return pSpell;
}
}
}
}
}
return NULL;
}Code: Select all
PSPELLLIST *pList = *EQADDR_SPELLS;Code: Select all
PSPELLLIST *pList = (PSPELLLIST*)(((DWORD)*EQADDR_SPELLS) + SPELLLIST_STARTOFFSET);