BUG: $char(book,spellname)
Posted: Fri Nov 07, 2003 2:44 pm
If a spell is towards the back of the spellbook (on page 49/50 for sure), $char(book,spellname) returns null. If I move the spell to page 1, it returns the correct value.
Need to talk about MacroQuest to other MacroQuest users?
https://mq64.org/phpBB3/
Code: Select all
if (Gem==0 && szArg[0]!='0') {
if (szArg[0]=='"') szArg++;
DWORD sp;
for (sp=0;sp<[color=red]512[/color];sp++) {
if (pCharInfo->SpellBook[sp] != 0xFFFFFFFF) {
PCHAR SpellName = GetSpellByID(pCharInfo->SpellBook[sp]);
if (!strnicmp(szArg,SpellName,strlen(SpellName))) {
itoa(sp+1,szTemp,10);
}
}
}
} else {
if (Gem>0 && Gem<[color=red]512[/color]) {
if (pCharInfo->SpellBook[Gem-1] != 0xFFFFFFFF) {
Code: Select all
#turbo
Sub Main
/declare i local
/mqlog clear
/for i 1 to 512
/if "$char(book,@i)"=="NULL" /goto :End
/mqlog "$spell("$char(book,@i)",id) , $char(book,@i) , $spell("$char(book,@i)",level)"
:End
/next i
/return
Code: Select all
if (Gem==0 && szArg[0]!='0') {
if (szArg[0]=='"') szArg++;
DWORD sp;
for (sp=0;sp<[color=red]250[/color];sp++) {
if (pCharInfo->SpellBook[sp] != 0xFFFFFFFF) {
PCHAR SpellName = GetSpellByID(pCharInfo->SpellBook[sp]);
if (!strnicmp(szArg,SpellName,strlen(SpellName))) {
itoa(sp+1,szTemp,10);
}
}
}
} else {
if (Gem>0 && Gem<[color=red]251[/color]) {
if (pCharInfo->SpellBook[Gem-1] != 0xFFFFFFFF) {
strcpy(szTemp,GetSpellByID(pCharInfo->SpellBook[Gem-1]));
} else {
strcpy(szTemp,"NULL");
}
} else {
strcpy(szTemp,"NULL");
}
}