You must be standing to cast a spell - /cast item broken

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

horseshoecrabs
a ghoul
a ghoul
Posts: 89
Joined: Fri Jun 10, 2005 6:35 pm

You must be standing to cast a spell - /cast item broken

Post by horseshoecrabs » Mon Sep 19, 2005 12:59 pm

Hi,

After the new version of MQ today (9-19), I am getting the error "You must be standing to cast a spell" whenever I attempt to use the "/cast item" command. This is when trying to use the concussion.mac posted in the Macro Depot and has otherwise been working perfectly up until today.

Could this be a bug? I didn't see any changes in the release notes that would explain this behavior.
Temporary(?) workaround is posted in the wiki:

http://www.macroquest2.com/wiki/index.php//cast

Thanks,

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 » Mon Sep 19, 2005 1:09 pm

It probably is a bug, and thank you for being the first person in a long time to actually take the effort to follow the simple instructions for asking for help. <3
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Mon Sep 19, 2005 1:58 pm

I dont have a clicky item to try this on, however, try the following fix and see if it fixes the code. Search for the /cast command and look for the area that does the /cast item within the command.

BTW, my guess is that anything that is using the inventory array and using item directly is going to be broken. The contents structure was changed to add 0xc bytes at the beginning and the code did not take into account that the iteminfo structure might not start at the beginning of the contents structure.

Please report back if it works and we can get this into the code base.

MQCommands.cpp

From:

Code: Select all

		  //pCharData->CastSpell(10,0,(EQ_Item**)item,0,slot,-1,0,0);
To:

Code: Select all

	      PCONTENTS contents=*(PCONTENTS*)item;
	      PITEMINFO Item=(PITEMINFO)contents->Item;
		  pCharData->CastSpell(10,0,(EQ_Item**)Item,0,slot,-1,0,0);

horseshoecrabs
a ghoul
a ghoul
Posts: 89
Joined: Fri Jun 10, 2005 6:35 pm

Post by horseshoecrabs » Mon Sep 19, 2005 2:23 pm

I made the change as instructed, recompiled and still get the same error about needing to stand to cast.

Disclaimer: I don't consider myself to be competent when it comes to code or compiling so my feedback on this matter may not be worth very much. Can somebody else please check it out? Just try casting your horse, your epic staff, whatever.

I need to go dig some trenches in my backyard to finish up my wife's drip system. I'll check back later and do anything you may suggest. :)

Cheers!

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 » Mon Sep 19, 2005 3:08 pm

I need to go dig some trenches in my backyard to finish up my wife's drip system.
I have no idea what this means, but it sounds really funny.

Oh and I just read in Bathroom Reader that horseshoe crabs are more closely related to spiders and scorpions than crabs. Just thought I'd bring that up since I just read that and your name is horseshoecrabs ;)
</useless>
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Veron
decaying skeleton
decaying skeleton
Posts: 2
Joined: Tue Sep 06, 2005 4:28 pm

Post by Veron » Mon Sep 19, 2005 3:57 pm

Lax,

I barely have enough money for my EQ account but your awesome!!! MQ makes me want to have your babies.

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Mon Sep 19, 2005 5:03 pm

Think its spell_routines that is causing the issue with the /call cast. RH works fine for item clicking.

Singing_Fool_29
a lesser mummy
a lesser mummy
Posts: 35
Joined: Fri Aug 26, 2005 7:23 am
Location: NY
Contact:

re: Jim

Post by Singing_Fool_29 » Mon Sep 19, 2005 5:06 pm

Really?

I tried typing /cast item "itemname" directly into the MQ2 console.

Needless to say, I got the same message.

I'll look at the RH code again and see what that code does to cast items. Not quite sure what you are talking about.
Loathing work while working requires twice the effort of work.

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Mon Sep 19, 2005 5:12 pm

I found an item clicky I can test with. Let me look at this code some more.

Loonies
a ghoul
a ghoul
Posts: 87
Joined: Wed May 04, 2005 4:53 pm

Post by Loonies » Mon Sep 19, 2005 6:21 pm

If not mistaken RH uses /itemnotify rightmouseup for clickies, which also requires that EQ instance to be front most app or stalls.

/cast item "itemname" will work on background EQ instances and doesnt require the inventory window to pop open...

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Mon Sep 19, 2005 7:54 pm

Fixed... to be included in next zip.

Here it is:

Code: Select all

--- D:\MQ2-0919\MQ2Main\MQ2Commands.cpp	Sun Sep 18 23:02:46 2005
+++ D:\MQ2\MQ2Main\MQ2Commands.cpp	Mon Sep 19 18:42:48 2005
@@ -377,7 +377,8 @@
@@ -1981,14 +1982,14 @@
          if (GetCharInfo2()->InventoryArray[i])
             if (!_stricmp(szArg2,GetCharInfo2()->InventoryArray[i]->Item->Name)) { 
             DebugSpew("cast test slot %d = %s address is %x",i,GetCharInfo2()->InventoryArray[i]->Item->Name,&(GetCharInfo2()->InventoryArray[i])); 
             item = (DWORD)&GetCharInfo2()->InventoryArray[i];
                slot = (DWORD)i;
                FOUND = TRUE;
                break;
             }
       }
       if (FOUND) {
-		  pCharData->CastSpell(10,0,(EQ_Item**)item,0,slot,-1,0,0);
+		  pCharData1->CastSpell(10,0,(EQ_Item**)item,0,slot,-1,0,0);
          return;
       }
    }

Code: Select all

--- D:\MQ2-0919\MQ2Main\EQClasses.cpp	Sun Sep 18 04:39:08 2005
+++ D:\MQ2\MQ2Main\EQClasses.cpp	Mon Sep 19 18:22:15 2005
@@ -4240,7 +4240,7 @@
 FUNCTION_AT_ADDRESS(void  EQ_Character::SetEffectId(unsigned char,unsigned int),EQ_Character__SetEffectId);
 #endif
 #ifdef EQ_Character__CastSpell
-FUNCTION_AT_ADDRESS(unsigned char EQ_Character::CastSpell(unsigned char,int,class EQ_Item * *,int,int slot,int,int,int),EQ_Character__CastSpell); 
+FUNCTION_AT_ADDRESS(unsigned char EQ_Character1::CastSpell(unsigned char,int,class EQ_Item * *,int,int slot,int,int,int),EQ_Character__CastSpell); 
 #endif
 #ifdef EQ_Character__GetBardInstrumentMod
 FUNCTION_AT_ADDRESS(int  EQ_Character::GetBardInstrumentMod(int),EQ_Character__GetBardInstrumentMod);

Code: Select all

--- D:\MQ2-0919\MQ2Main\EQClasses.h	Mon Sep 19 15:50:11 2005
+++ D:\MQ2\MQ2Main\EQClasses.h	Mon Sep 19 18:22:16 2005
@@ -5339,6 +5339,7 @@
 EQLIB_OBJECT int EQ_Character1::Max_Mana(void);
 EQLIB_OBJECT int EQ_Character1::Max_Endurance(void); // lax 4-25-2004
 EQLIB_OBJECT int EQ_Character1::Cur_HP(int);
+EQLIB_OBJECT unsigned char EQ_Character1::CastSpell(unsigned char,int,class EQ_Item * *,int,int slot,int,int,int); 
 };
 
 class EQ_Character
@@ -5443,7 +5444,7 @@
 EQLIB_OBJECT unsigned char EQ_Character::CanSecondaryAttack(class EQPlayer *);
 EQLIB_OBJECT unsigned char EQ_Character::CanWorship(int,int,unsigned char);
 EQLIB_OBJECT unsigned char EQ_Character::CastingRequirementsMet(int);
-EQLIB_OBJECT unsigned char EQ_Character::CastSpell(unsigned char,int,class EQ_Item * *,int,int slot,int,int,int); 
+//EQLIB_OBJECT unsigned char EQ_Character::CastSpell(unsigned char,int,class EQ_Item * *,int,int slot,int,int,int); 
 EQLIB_OBJECT unsigned char EQ_Character::CheckClass(int,int);
 EQLIB_OBJECT unsigned char EQ_Character::CityCanStart(int,int,int,int);
 EQLIB_OBJECT unsigned char EQ_Character::ClassMin(int,int,unsigned char);

horseshoecrabs
a ghoul
a ghoul
Posts: 89
Joined: Fri Jun 10, 2005 6:35 pm

Post by horseshoecrabs » Tue Sep 20, 2005 12:51 am

Is there a recommended patch program for this diff file? I only know the one for MAME...

oddball
orc pawn
orc pawn
Posts: 14
Joined: Sat May 29, 2004 6:21 pm

Post by oddball » Tue Sep 20, 2005 9:10 am

horseshoecrabs wrote:Is there a recommended patch program for this diff file? I only know the one for MAME...
The program you want is patch.

You can find it here
You can find some guidance for how to use patch here, about halfway down the page.

Singing_Fool_29
a lesser mummy
a lesser mummy
Posts: 35
Joined: Fri Aug 26, 2005 7:23 am
Location: NY
Contact:

Re: Jim re: Loonies

Post by Singing_Fool_29 » Tue Sep 20, 2005 4:50 pm

For the record I took Jerle's code for notifying right/left clicks on buffs.

It works wonders, thanks Jim.

Loonies, item notify apparently does not have to be in the forefront. It still works even if the EQ window isn't up front. At least mine does anyways.
Loathing work while working requires twice the effort of work.

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

Re: You must be standing to cast a spell - /cast item broken

Post by xyilla » Sat Jun 14, 2025 3:34 pm