Problem with Item.Spell on procing weapons

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

superslam
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat Jan 22, 2005 3:34 pm

Problem with Item.Spell on procing weapons

Post by superslam » Wed Mar 09, 2005 11:46 pm

Alright, I've been workin on merging the good parts of the zerker.mac and the good parts of the rh.mac into one macro, also removing some of the params, etc.

The problem that I'm having is getting one part of the rh code to work. It didn't work when I used RH, and I'd like to get it working to put it into my new macro.


This code happens at the beginning of a combat loop.

Code: Select all

   /if (${doSwitch} && ${wstype.Equal[Beneficial]}) {
     /varset itemspellname ${FindItem[${weapon1}].Spell}
     /if (${itemspellname.NotEqual[${Me.Buff[${itemspellname}]}]} && !${FindItem[${weapon1}].InvSlot.Name.Equal[mainhand]} && !${FindItem[${weapon1}].InvSlot.Name.Equal[offhand]}) {
       /if (${verbosity}>=1) /${channel} ** Beneficial proc-weapon swapping...
       /call Weapon_Swap "${weapon1}" "${weapon2}"
     }
   }
While running the macro, I did several echo commands, and everything seems to be in order, except it doesn't recognise ${weapon1}.spell.


Before any combat takes place:
/echo ${wstype} yields Beneficial
/echo ${doSwitch} yields TRUE
/echo ${weapon1} yields Ancient Prismatic Brawl Stick
/echo ${weapon2} yields Kerasian Axe of Ire
/echo ${itemspellname} yields None

After combat takes place:
/echo ${wstype} yields Beneficial
/echo ${doSwitch} yields TRUE
/echo ${weapon1} yields Ancient Prismatic Brawl Stick
/echo ${weapon2} yields Kerasian Axe of Ire
/echo ${itemspellname} yields NULL

It doesn't look like it sees a proc on the Ancient Prismatic Brawl Stick; therefore, it won't check my buffs to see if Avatar is absent, and thus it won't swap out the weapons.

Any clue on how to fix this one?
Last edited by superslam on Thu Mar 10, 2005 4:15 pm, edited 1 time in total.

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 Mar 09, 2005 11:56 pm

while I dont know the cause of your problem.. the proper way to state your issue would be "Problem with item.Spell" -- FindItem[${weapon1}] is irrelevant ;)

You need to make sure first of all that ${FindItem[${weapon1}]} isnt NULL. I suspect it is.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

superslam
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat Jan 22, 2005 3:34 pm

Post by superslam » Thu Mar 10, 2005 2:33 pm

/echo ${FindItem[${weapon1}]} yields Ancient Prismatic Brawl Stick
/echo ${FindItem[${weapon1}].Spell} yields NULL
/echo ${FindItem[${weapon1}].SpellType} yields NULL

/echo ${FindItem[Shrunken Goblin Skull Earring].Spell} yields Grim Aura

/echo ${FindItem[${weapon1}].EffectType} yields Combat

So, it's reading that there is an effect, but for some reason, I can't get it to tell me the name of the effect.

Clues?

*edit* I really hate to have this in the bug section, and it was an error on my part for it to be here anyway. I'm going to repost this in the MacroHelp section, after I read through the wiki stuff.

superslam
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat Jan 22, 2005 3:34 pm

Problem Posting to the MQ2::Macro::Help boards

Post by superslam » Thu Mar 10, 2005 5:00 pm

I made the login and changes to the Wiki site and posted the link. Actually, this was my post. What exactly is the script looking for to allow a user to post to the help forums?
http://www.macroquest2.com/wiki/index.p ... st2:Macros

The problem that I'm having is getting one part of the rh code to work. It didn't work when I used RH, and I'd like to get it working to put it into my new macro.

The code basically is supposed to check a weapon to see what the name of the spell it casts is, then check the character's buffs to see if it's currently on. If it's not, then the macro is supposed to equip the weapon.

It probably makes more sense in the code than I do while trying to explain it here.

The code that I posted happens at the beginning of a combat loop.

I also wasn't sure exactly how you wanted the posts on the wiki site to be formatted, so I hope that I didn't screw anything up with my submission.

I posted all of the code there, though I'd like to put it in the thread if that's alright with Lax or whichever Czar is overseeing this section right now.

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Thu Mar 10, 2005 9:07 pm

Um.... ok, the Wiki is for providing information, not asking for it. You want this forum. If this is really a bug though it belongs here. I'll test it if I have time.

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Thu Mar 10, 2005 9:30 pm

I did some testing and it does indeed not work. well, I'm a C++ noob, but

Code: Select all

case Spell: 
		if (Dest.Ptr=GetSpellByID(pItem->Item->[b]Clicky.SpellID[/b])) 
		{ 
			Dest.Type=pSpellType; 
			return true; 
		} 

+		if (Dest.Ptr=GetSpellByID(pItem->Item->Proc.SpellID))
+		{
+			Dest.Type=pSpellType;
+			return true;
+		}
		return false; 
	case EffectType:
		//0 Proc 
		//1 Clickable from inventory (any class) 
		//2 Worn effect (haste, cleave) 
		//3 Unknown 
		//4 Clickable must be worn 
		//5 Clickable from inventory (class restricted) 
		//6 Focus effect 
		//7 Memmable spell scroll 
      // This used to return an int type with a case statment, items could have 
      // only one effect. For backwards compatibility we return based on a hierarchy. 
      // A zero in any field indicates no effect (others will also be zero) 
      if (!pItem->Item->Clicky.SpellID) 
      { 
         return false; 
      } 
      else if (pItem->Item->Scroll.SpellID!=-1) 
      { 
         Dest.Ptr="Spell Scroll"; 
      } 
      else if (pItem->Item->Clicky.SpellID!=-1) 
      { 
         // code to detect must-be-worn etc here 
         switch (pItem->Item->Clicky.EffectType) 
         { 
         case 4: 
                Dest.Ptr="Click Worn"; 
            break; 
         case 1: 
         case 5: 
            Dest.Ptr="Click Inventory"; 
            break; 
         default: 
            Dest.Ptr="Click Unknown"; 
         } 
      } 
      else if (pItem->Item->Focus.SpellID!=-1 || pItem->Item->Worn.SpellID!=-1) 
      { 
         Dest.Ptr="Worn"; 
      } 
      else if (pItem->Item->[b]Proc.SpellID[/b]!=-1) 
      { 
         Dest.Ptr="Combat"; 
      } 
      else 
      { 
         return false; 
      } 
		Dest.Type=pStringType; 
		return true;
Spell will return NULL if it has a Proc.SpellID but not a Clicky.SpellID, correct?

[Edit] Whooo I made my first code correction. I added the lines indicated to the code above, and it now works! :) I guess the same thing will have to be done for scrolls and focii... I'll let someone else do that though, since it looks like that whole section could use work.

superslam
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat Jan 22, 2005 3:34 pm

Post by superslam » Fri Mar 11, 2005 11:53 am

Excellent, I'm glad to see that it's an actual bug, and not just coding errors on my part.

I will use a work around for my macro for now; when the fix is updated for the public, I will fix my macro to work with it. =)

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 » Fri Mar 11, 2005 5:49 pm

Fixed for the next zip. Also added the other 4 possible spells ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Problem with Item.Spell on procing weapons

Post by xyilla » Mon Jan 05, 2026 4:33 am