Page 1 of 3
You must be standing to cast a spell - /cast item broken
Posted: Mon Sep 19, 2005 12:59 pm
by horseshoecrabs
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,
Posted: Mon Sep 19, 2005 1:09 pm
by Lax
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
Posted: Mon Sep 19, 2005 1:58 pm
by SwiftyMUSE
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);
Posted: Mon Sep 19, 2005 2:23 pm
by horseshoecrabs
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!
Posted: Mon Sep 19, 2005 3:08 pm
by Lax
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>
Posted: Mon Sep 19, 2005 3:57 pm
by Veron
Lax,
I barely have enough money for my EQ account but your awesome!!! MQ makes me want to have your babies.
Posted: Mon Sep 19, 2005 5:03 pm
by JimJohnson
Think its spell_routines that is causing the issue with the /call cast. RH works fine for item clicking.
re: Jim
Posted: Mon Sep 19, 2005 5:06 pm
by Singing_Fool_29
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.
Posted: Mon Sep 19, 2005 5:12 pm
by SwiftyMUSE
I found an item clicky I can test with. Let me look at this code some more.
Posted: Mon Sep 19, 2005 6:21 pm
by Loonies
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...
Posted: Mon Sep 19, 2005 7:54 pm
by SwiftyMUSE
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);
Posted: Tue Sep 20, 2005 12:51 am
by horseshoecrabs
Is there a recommended patch program for this diff file? I only know the one for MAME...
Posted: Tue Sep 20, 2005 9:10 am
by oddball
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.
Re: Jim re: Loonies
Posted: Tue Sep 20, 2005 4:50 pm
by Singing_Fool_29
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.
Re: You must be standing to cast a spell - /cast item broken
Posted: Sat Jun 14, 2025 3:34 pm
by xyilla