pSpell->Level something not right

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

pSpell->Level something not right

Post by weapon » Wed Apr 28, 2004 12:19 am

I want to mem a spell in a plugin so I'm trying to use the MQ2Utilities.cpp to do so.

Code: Select all

PSPELL pSpell = GetSpellByName("Levitation");
Returns the spell pointer fine but if you

Code: Select all

					sprintf(szOutput,"GetSpellByNameLevel: %i",pSpell->Level[GetCharInfo()->pSpawn->Class-1]);
					WriteChatColor(szOutput,USERCOLOR_DEFAULT);

Code: Select all

pSpell->Level[GetCharInfo()->pSpawn->Class-1]
is returning 255 for levitation. For Remove Greater Curse it works fine. I can't figure out what the problem is something todo with

Code: Select all

pSpell = &(*((PSPELLMGR)pSpellMgr)->Spells[dwSpellID]);
or the offset for spell manager

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 28, 2004 12:30 am

I believe there is multiple spells called "Levitation"
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

Post by weapon » Wed Apr 28, 2004 12:35 am

/em wants what lax smokes

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Wed Apr 28, 2004 12:38 am

Lax is right... there are 2 different ones.

One uses a component, the other one doesn't.

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

Post by weapon » Wed Apr 28, 2004 12:44 am

So what list is this looping through?

Code: Select all

    for (DWORD dwSpellID = 0; dwSpellID < TOTAL_SPELL_COUNT; dwSpellID++) {
        pSpell = &(*((PSPELLMGR)pSpellMgr)->Spells[dwSpellID]);
the spells_en.txt file? I don't see another Levitation spell or is the Spells structure loaded from somewhere else?

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 28, 2004 12:46 am

http://lucy.allakhazam.com/spelllist.ht ... levitation

http://lucy.allakhazam.com/spell.html?i ... ource=Live
http://lucy.allakhazam.com/spell.html?i ... ource=Live

The one that is not a regular spell is #970 and the first one that ${Spell[Levitation]} finds.

You can use ${Spell[2894]} instead to get the one you want

What it's looping through is the list of spells, which is in fact loaded directly from spells_us.txt, and into the spell manager.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

Post by weapon » Wed Apr 28, 2004 12:53 am

Got it ... I added

Code: Select all

					if (pSpell->Level[GetCharInfo()->pSpawn->Class-1] < 66 ) {
						return pSpell;
					}
And it forces the loop to land on the spell I care about. Thanks guys