shroomheadofmarbles
New member
- Joined
- Apr 5, 2005
- RedCents
- 0¢
MQ2SetClicky uber plugin needs struct update
#include "../MQ2Plugin.h"
PreSetup("MQ2SetClicky");
VOID SetCursorSpell (PSPAWNINFO, PCHAR);
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2SetClicky");
AddCommand("/setspell",SetCursorSpell);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2SetClicky");
RemoveCommand("/setspell");
}
VOID SetCursorSpell(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR Arg1[MAX_STRING] = {0};
CHAR Arg2[MAX_STRING] = {0};
if (!pChar->pCharInfo->Cursor) {
WriteChatColor("Please have an item on the cursor to use this command.",USERCOLOR_DEFAULT);
return;
}
GetArg(Arg1,szLine,1);
GetArg(Arg2,szLine,2);
if (Arg1[0]==0) {
WriteChatColor("Usage: /setcursorspell <spellname>");
return;
}
PSPELLLIST pSpell = GetSpellByName(Arg1);
if (!pSpell) {
WriteChatColor("Unknown spell.",USERCOLOR_DEFAULT);
return;
}
SetItemWornEffect(pChar->pCharInfo->Cursor->Item,pSpell->ID);
if (Arg2[0]!=0) pChar->pCharInfo->Cursor->Item->Level = atoi(Arg2);
}
BOOL DoesCharHaveSpellItem(PSPAWNINFO pChar, DWORD SpellID)
{
DWORD i;
if (!pChar) return FALSE;
if (!pChar->pCharInfo) return FALSE;
for (i=0;i<22;i++) {
if (!pChar->pCharInfo->InventoryArray) continue;
if (!pChar->pCharInfo->InventoryArray->Item) continue;
if (pChar->pCharInfo->InventoryArray->Item->SpellId == SpellID) return TRUE;
}
return FALSE;
}
--------------------------------------------------------
(399): error C2039: 'Level' : is not a member of 'EQData::_ITEMINFO'
(410): error C2039: 'SpellId' : is not a member of 'EQData::_ITEMINFO'
(393): error C2065: 'pSpell' : undeclared identifier
(393): error C2065: 'PSPELLLIST' : undeclared identifier
(398): error C2227: left of '->ID' must point to class/struct/union
(394): error C3861: 'pSpell': identifier not found, even with argument-dependent lookup
(398): error C3861: 'pSpell': identifier not found, even with argument-dependent lookup
(398): error C3861: 'SetItemWornEffect': identifier not found, even with argument-dependent lookup
#include "../MQ2Plugin.h"
PreSetup("MQ2SetClicky");
VOID SetCursorSpell (PSPAWNINFO, PCHAR);
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2SetClicky");
AddCommand("/setspell",SetCursorSpell);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2SetClicky");
RemoveCommand("/setspell");
}
VOID SetCursorSpell(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR Arg1[MAX_STRING] = {0};
CHAR Arg2[MAX_STRING] = {0};
if (!pChar->pCharInfo->Cursor) {
WriteChatColor("Please have an item on the cursor to use this command.",USERCOLOR_DEFAULT);
return;
}
GetArg(Arg1,szLine,1);
GetArg(Arg2,szLine,2);
if (Arg1[0]==0) {
WriteChatColor("Usage: /setcursorspell <spellname>");
return;
}
PSPELLLIST pSpell = GetSpellByName(Arg1);
if (!pSpell) {
WriteChatColor("Unknown spell.",USERCOLOR_DEFAULT);
return;
}
SetItemWornEffect(pChar->pCharInfo->Cursor->Item,pSpell->ID);
if (Arg2[0]!=0) pChar->pCharInfo->Cursor->Item->Level = atoi(Arg2);
}
BOOL DoesCharHaveSpellItem(PSPAWNINFO pChar, DWORD SpellID)
{
DWORD i;
if (!pChar) return FALSE;
if (!pChar->pCharInfo) return FALSE;
for (i=0;i<22;i++) {
if (!pChar->pCharInfo->InventoryArray) continue;
if (!pChar->pCharInfo->InventoryArray->Item) continue;
if (pChar->pCharInfo->InventoryArray->Item->SpellId == SpellID) return TRUE;
}
return FALSE;
}
--------------------------------------------------------
(399): error C2039: 'Level' : is not a member of 'EQData::_ITEMINFO'
(410): error C2039: 'SpellId' : is not a member of 'EQData::_ITEMINFO'
(393): error C2065: 'pSpell' : undeclared identifier
(393): error C2065: 'PSPELLLIST' : undeclared identifier
(398): error C2227: left of '->ID' must point to class/struct/union
(394): error C3861: 'pSpell': identifier not found, even with argument-dependent lookup
(398): error C3861: 'pSpell': identifier not found, even with argument-dependent lookup
(398): error C3861: 'SetItemWornEffect': identifier not found, even with argument-dependent lookup
Last edited: