本文整理汇总了C++中LocalPlayer::IsAttacking方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalPlayer::IsAttacking方法的具体用法?C++ LocalPlayer::IsAttacking怎么用?C++ LocalPlayer::IsAttacking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalPlayer
的用法示例。
在下文中一共展示了LocalPlayer::IsAttacking方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartHack
DWORD WINAPI StartHack()
{
N3Engine *engine = N3Engine::GetInstance();
LocalPlayer *player = engine->GetLocalPlayer();
PlayField *playArea = PlayField::GetInstance();
std::vector<Entity*> EntityInArea;
MessageBox(NULL, "Here", "here", MB_OK);
__asm{
INT 3; //Pause game here and trigger an exception that OLLYDBG will stop at
}
/*
Things to do:
1.Check Health and Nano
1.1:Read Stats
1.2:Preform actions if needed
1.2.1:Determined if health/nano pod is in inventory
1.2.2:Determined if health is to be a spell or item base
2.Check if being attacked
3.Attack
*/
while (1)
{
EntityInArea = playArea->GetObjectsByDistance(NPC_PLAYER_PET, 25);
for (int i = 0; i < EntityInArea.size(); i++)
{
if (EntityInArea[i]->VerifyGoodEntity() == false)
continue;
if (NPC::IsNPC(EntityInArea[i]))
{
player->SetCurrentTarget(&EntityInArea[i]->GetIdentity());
engine->StartDefaultAttack(&EntityInArea[i]->GetIdentity());
while (EntityInArea[i]->VerifyGoodEntity() && player->IsAttacking())
{
if (player->IsTargetInWeaponRange((NPC*) EntityInArea[i]))
{
Sleep(3000);
}
else
{
FVector TargetLoc = EntityInArea[i]->GetTransformingClass()->GetPosition();
player->GetTransformingClass()->SetPosition(TargetLoc);
}
}
}
Sleep(5000); //Give the CPU a break in this infinite loop!
}
}
return true;
}