vladus2000
Active member
- Joined
- Dec 1, 2006
- RedCents
- 131¢
This plugin emulates a /itemtarget when you right click a ground spawn on the map. I noticed a few people were having issues with the Library Heist mission and /itemtarget, so I wrote this. Its pretty simple, I imagine its been done before, but here is my version.
Rich (BB code):
#include "../MQ2Plugin.h"
PreSetup("MQ2MapItemTarget");
PLUGIN_API VOID OnPulse(VOID)
{
if( gGameState != GAMESTATE_INGAME )
{
return;
}
if ( ( pGroundTarget == NULL && EnviroTarget.Name[ 0 ] ) ||
( pGroundTarget && EnviroTarget.Name[ 0 ] && pGroundTarget->DropID != EnviroTarget.Race ) )
{
PGROUNDITEM pItem = (PGROUNDITEM)pItemList;
while ( pItem )
{
if ( pItem->DropID == EnviroTarget.Race )
{
pGroundTarget = pItem;
WriteChatf( "Item '%s' targeted.", EnviroTarget.Name );
break;
}
pItem = pItem->pNext;
}
}
}
PLUGIN_API VOID OnRemoveGroundItem(PGROUNDITEM pGroundItem)
{
if ( pGroundItem == pGroundTarget )
{
pGroundTarget = NULL;
WriteChatf( "Item no longer targeted." );
}
}
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2MapItemTarget");
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2MapItemTarget");
}


I personally think its not as safe. I'd hate to be trying to target a mob in a public zone, accidentally right click a drop infront of a GM or something. Right click then running a command is not a big deal, and is a good error validation step. And thanks Z, I sometimes misinterpret posts, I tend to assume the worst unless other information available.