Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

Laeuvasu said:just found the 7.2 download in main thread and now i do not CDT anymore. but instead of memming spells . all /memset setname does is clear all my spells from being memmed. Hoping that I don't get flamed for not wanting to spend 2 hours reading to search for an answer to my problem when i only get about 3 hours of play time a day. After a long day at work all I want to do is come home and play for a little while and then sleep.
is this working?
No it isn't. It hasn't been updated or posted in a couple of years
// MQ2InstantMem.cpp
//
// Commands:
// - /memspell <Spell Name> <Spell Gem> -- i.e. /memspell "Complete Heal" 1
// - /memset <Spell Set Name> -- i.e. /memset RaidBuffs
//
// Currently, /memset will unmem everything before attempting to mem new spells
// regardless if they are the correct spell already.
//
// /memspell will not check to see if the spell is already memmed in another gem
// before unmemming the target spell gem.
//
//
#include "../MQ2Plugin.h"
PreSetup("MQ2InstantMem");
#define OPCODE_MemorizeSpell 0x71BF // 12-08-2010
#define OPCODE_ChangeStandState 0x7B64 // 12-08-2010
//#define OPCODE_ForgetSpells 0x71BF // 12-08-2010
struct _MemorizeSpellPacket {
/*0000*/ unsigned int gem_slot;
/*0004*/ unsigned int spell_id;
/*0008*/ unsigned int memorize; // 0x01 unmem / 0x02 mem
/*0012*/ unsigned int unknown12;
} MemorizeSpellPacket; // 16 bytes
struct _StandStatePacket
{
/*0000*/ unsigned short ID;
/*0002*/ unsigned short unknown; // always 0x0e
/*0004*/ unsigned int state;
} StandState; // 8 Bytes
// struct _ForgetSpellsPacket {
// /*0000*/ unsigned int gem_slot0; // Gem 1
// /*0004*/ unsigned int gem_slot1; // Gem 2
// /*0008*/ unsigned int gem_slot2; // Gem 3
// /*0012*/ unsigned int gem_slot3; // Gem 4
// /*0016*/ unsigned int gem_slot4; // Gem 5
// /*0020*/ unsigned int gem_slot5; // Gem 6
// /*0024*/ unsigned int gem_slot6; // Gem 7
// /*0028*/ unsigned int gem_slot7; // Gem 8
// /*0032*/ unsigned int gem_slot8; // Gem 9
// /*0036*/ unsigned int gem_slot9; // Unused (Gem 10)
// } ForgetSpellsPacket; // 40 bytes
VOID MemorizeSpell( PSPAWNINFO pChar, PCHAR szLine )
{
char szSpellName[MAX_STRING] = {0};
char szGemSlot[MAX_STRING] = {0};
char szTemp[MAX_STRING] = {0};
unsigned int Gem;
PCHARINFO pCharInfo = 0;
pCharInfo = GetCharInfo();
// Verify that our parameters are correct.
if (szLine[0] == 0)
{
MacroError( "Usage: /memspell <spell name> <gem slot>\r\n" );
return;
}
// Parse out the arguments
GetArg(szSpellName,szLine,1);
GetArg(szGemSlot,szLine,2);
// Sanity checking on the gem slot.
Gem = (unsigned int)atoi(szGemSlot);
if (Gem<1 || Gem>9)
{
return;
}
Gem--;
// Determine the spell id of the spell that's currently in the gem slot.
if (PSPELL pSpell=GetSpellByID(GetCharInfo2()->MemorizedSpells[Gem]))
{
WriteChatf("spell = %s .", pSpell->Name );
// Construct and send the packet to memorize the spell.
ZeroMemory(&MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
MemorizeSpellPacket.gem_slot = Gem;
MemorizeSpellPacket.spell_id = pSpell->ID;
MemorizeSpellPacket.memorize = 0x2;
SendEQMessage(OPCODE_MemorizeSpell, &MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
}
BYTE orig_stand_state = pChar->StandState;
// Gotta be sitting in order to mem spells.
ZeroMemory(&StandState, sizeof(StandState));
StandState.ID = pChar->SpawnID;
StandState.unknown = 0x0e;
StandState.state = STANDSTATE_SIT;
SendEQMessage(OPCODE_ChangeStandState, &StandState, sizeof(StandState));
// Set this so that the client is up to date.
pChar->StandState = STANDSTATE_SIT;
GetCharInfo()->standstate = STANDSTATE_SIT;
// Look up the spell and send the mem packet.
PSPELL pNewSpell = GetSpellByName(szSpellName);
if(pNewSpell)
{
// Construct and send the packet to memorize the spell.
ZeroMemory(&MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
MemorizeSpellPacket.gem_slot = Gem;
MemorizeSpellPacket.spell_id = pNewSpell->ID;
MemorizeSpellPacket.memorize = 0x1;
SendEQMessage(OPCODE_MemorizeSpell, &MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
}
else
{
WriteChatf("Couldn't find spell %s .", szSpellName );
WriteChatColor(szTemp, CONCOLOR_GREEN);
}
// If we weren't sitting originally then return the char to their original standstate.
if( orig_stand_state != STANDSTATE_SIT )
{
// Construct and send the packet to sit your ass down.
ZeroMemory(&StandState, sizeof(StandState));
StandState.ID = pChar->SpawnID;
StandState.unknown = 0x0e;
StandState.state = orig_stand_state;
SendEQMessage(OPCODE_ChangeStandState, &StandState, sizeof(StandState));
// Set this so that the client is up to date.
pChar->StandState = orig_stand_state;
GetCharInfo()->standstate = orig_stand_state;
}
return;
}
VOID MemSet( PSPAWNINFO pChar, PCHAR szLine )
{
char szSpellSetName[MAX_STRING] = {0};
DWORD SpellSetIndex = -1;
// Verify that our parameters are correct.
if (szLine[0] == 0)
{
MacroError( "Usage: /memset <spell set name>\r\n" );
return;
}
// Parse out the arguments
GetArg( szSpellSetName, szLine, 1 );
// Look up the spell set.
for (DWORD i=0;i<10;i++)
{
if (!stricmp( pSpellSets.Name, szSpellSetName ))
SpellSetIndex = i;
}
// If we didn't find it then return error.
if (SpellSetIndex==-1)
{
MacroError("Unable to find spell set '%s'", szSpellSetName);
return;
}
// Gotta be sitting in order to mem spells.
BYTE orig_stand_state = pChar->StandState;
if( pChar->StandState != STANDSTATE_SIT )
{
// Construct and send the packet to sit your ass down.
ZeroMemory(&StandState, sizeof(StandState));
StandState.ID = pChar->SpawnID;
StandState.unknown = 0x0e;
StandState.state = STANDSTATE_SIT;
SendEQMessage(OPCODE_ChangeStandState, &StandState, sizeof(StandState));
// Set this so that the client is up to date.
pChar->StandState = STANDSTATE_SIT;
GetCharInfo()->standstate = STANDSTATE_SIT;
}
/* // Clear out all of our currently memorized spells.
ZeroMemory(&ForgetSpellsPacket, sizeof(ForgetSpellsPacket));
ForgetSpellsPacket.gem_slot0 = 0x0;
ForgetSpellsPacket.gem_slot1 = 0x1;
ForgetSpellsPacket.gem_slot2 = 0x2;
ForgetSpellsPacket.gem_slot3 = 0x3;
ForgetSpellsPacket.gem_slot4 = 0x4;
ForgetSpellsPacket.gem_slot5 = 0x5;
ForgetSpellsPacket.gem_slot6 = 0x6;
ForgetSpellsPacket.gem_slot7 = 0x7;
ForgetSpellsPacket.gem_slot8 = 0x8;
ForgetSpellsPacket.gem_slot9 = 0x9;
SendEQMessage(OPCODE_ForgetSpells, &ForgetSpellsPacket, sizeof(ForgetSpellsPacket));
*/
for ( int SpellIndex=8; SpellIndex>=0; SpellIndex--)
{
if( pSpellSets[SpellSetIndex].SpellId[SpellIndex] != 0xFFFFFFFF )
{
// Check to see if the spell gem already has something in it.
PSPELL pSpell = GetSpellByID( GetCharInfo2()->MemorizedSpells[SpellIndex] );
if( pSpell )
{
// If the spell gem already has something in it and it's not the
// spell we want then unmem it.
if ( pSpell->ID != pSpellSets[SpellSetIndex].SpellId[SpellIndex] )
{
// Determine the spell id of the spell that's currently in the gem slot.
CHAR szTemp[MAX_STRING] = {0};
WriteChatf("unmemming %s .", pSpell->Name );
// Construct and send the packet to unmemorize the spell.
ZeroMemory(&MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
MemorizeSpellPacket.gem_slot = (unsigned int)SpellIndex;
MemorizeSpellPacket.spell_id = pSpell->ID;
MemorizeSpellPacket.memorize = 0x2;
SendEQMessage(OPCODE_MemorizeSpell, &MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
} else
// If the spell gem has something in it and it IS the spell we
// want then skip to the next spell in the spell set.
if( pSpell->ID == pSpellSets[SpellSetIndex].SpellId[SpellIndex] )
{
continue;
}
}
// Construct and send the packet to memorize the spell.
ZeroMemory(&MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
MemorizeSpellPacket.gem_slot = (unsigned int)SpellIndex;
MemorizeSpellPacket.spell_id = pSpellSets[SpellSetIndex].SpellId[SpellIndex];
MemorizeSpellPacket.memorize = 0x1;
SendEQMessage(OPCODE_MemorizeSpell, &MemorizeSpellPacket, sizeof(MemorizeSpellPacket));
}
}
// If we weren't sitting originally then return the char to their original standstate.
if( orig_stand_state != STANDSTATE_SIT )
{
// Construct and send the packet to sit your ass down.
ZeroMemory(&StandState, sizeof(StandState));
StandState.ID = pChar->SpawnID;
StandState.unknown = 0x0e;
StandState.state = orig_stand_state;
SendEQMessage(OPCODE_ChangeStandState, &StandState, sizeof(StandState));
// Set this so that the client is up to date.
pChar->StandState = orig_stand_state;
GetCharInfo()->standstate = orig_stand_state;
}
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/memset",MemSet);
AddCommand("/memspell",MemorizeSpell);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/memset");
RemoveCommand("/memspell");
}
It compiles and loads ok but it doesn't mem or unload any spells. I am getting the correct spam from from it though. Its not crashing at all that's a good sign.
I am posting this for Alatyami and Siddin to look at hopefully they will be able to get it going.
