add to eqmain.h following the lines:
#include "ISXEQ\ISXEQUtilities.h"
#include "ISXEQ\ISXEQCommands.h"
Code: Select all
EQLIB_API VOID UseAbility(char *sAbility);
EQLIB_API VOID EzCommand(PCHAR Line);
EQLIB_API VOID UseRanged(int SpawnID);
Code: Select all
int CMD_EQExecute(int argc, char *argv[])
{
if (gGameState!=GAMESTATE_INGAME)
{
WriteChatf("Cannot execute EQ command, not in game!");
return 0;
}
if (argc<2)
{
WriteChatf("Syntax: %s <command>",argv[0]);
return 0;
}
char Line[8192]={0};
pISInterface->GetArgs(1,argc,argv,Line);
EzCommand(Line);
//((CCommandHook*)pEverQuest)->Trampoline((PSPAWNINFO)pLocalPlayer,Line);
return 0;
}
Code: Select all
void EzCommand(PCHAR Line) {
((CCommandHook*)pEverQuest)->Trampoline((PSPAWNINFO)pLocalPlayer,Line);
return;
}
Code: Select all
int CMD_do_ranged(int argc, char *argv[])
{
char szBuffer[MAX_STRING] = {0};
pISInterface->GetArgs(1,1,argv,szBuffer);
if (szBuffer) {
UseRanged(atoi(szBuffer));
} else if (pTarget) {
UseRanged(((PSPAWNINFO)pTarget)->SpawnID);
} else if (!pTarget) {
printf("No target for ranged attack");
return 0;
}
return 0;
}
Code: Select all
int CMD_DoAbility(int argc, char *argv[])
{
DWORD Index, DoIndex = 0xFFFFFFFF;
CHAR szBuffer[MAX_STRING] = {0};
if (!stricmp(argv[1],"list") || !stricmp(argv[1], "-list")) {
WriteChatColor("Abilities:",USERCOLOR_DEFAULT);
for (Index=4;Index<10;Index++) {
if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF) {
sprintf(szBuffer,"%d. <Empty>",Index-3);
} else if (szSkills[EQADDR_DOABILITYLIST[Index]]) {
sprintf(szBuffer,"%d. %s",Index-3,szSkills[EQADDR_DOABILITYLIST[Index]]);
} else {
sprintf(szBuffer,"%d. *Unknown%d",Index-3,EQADDR_DOABILITYLIST[Index]);
}
WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
}
WriteChatColor("Combat Skills:",USERCOLOR_DEFAULT);
for (Index=0;Index<4;Index++) {
if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF) {
sprintf(szBuffer,"%d. <Empty>",Index+7);
} else if (szSkills[EQADDR_DOABILITYLIST[Index]]) {
sprintf(szBuffer,"%d. %s",Index+7,szSkills[EQADDR_DOABILITYLIST[Index]]);
} else {
sprintf(szBuffer,"%d. *Unknown%d",Index+7,EQADDR_DOABILITYLIST[Index]);
}
WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
}
WriteChatColor("Combat Abiilities:",USERCOLOR_DEFAULT);
for (Index=10;Index<18;Index++) {
if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF) {
sprintf(szBuffer,"%d. <Empty>",Index+1);
} else if (EQADDR_DOABILITYLIST[Index] > 132) { // highest number we have defined so far
sprintf(szBuffer,"%d. *Unknown%d",Index+1,EQADDR_DOABILITYLIST[Index]);
} else if (szSkills[EQADDR_DOABILITYLIST[Index]]) {
sprintf(szBuffer,"%d. %s",Index+1,szSkills[EQADDR_DOABILITYLIST[Index]]);
} else {
sprintf(szBuffer,"%d. *Unknown%d",Index+1,EQADDR_DOABILITYLIST[Index]);
}
WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
}
return 0;
}
pISInterface->GetArgs(1,argc,argv,szBuffer);
UseAbility(szBuffer);
return 0;
}
add in to isxeqcommands
Code: Select all
void UseRanged(int SpawnID) {
EQPlayer *pRangedTarget=pTarget;
if (SpawnID)
{
pRangedTarget=GetSpawnByID(SpawnID);
if (!pRangedTarget)
{
printf("Invalid spawn ID. Use /ranged with no parameters, or with a spawn ID");
return;
}
}
if (!pRangedTarget)
{
printf("No target for ranged attack");
return;
}
if (gbRangedAttackReady)
{
pLocalPlayer->DoAttack(0x0B,0,pRangedTarget);
gbRangedAttackReady=0;
}
return;
}
...I think that is everything. I am assuming that these it could be the wrong way to go or not be optimized. Open to feedback. This is an attempt to seperate commands from functionality.
-Red