DragonNest/Server/DNGameServer/MAAiCommand.cpp
2024-12-20 16:56:44 +08:00

48 lines
2.3 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


#include "stdafx.h"
#include "MAAiCommand.h"
#include "MAAiScript.h"
#include "DnBlow.h"
using namespace AICommand;
void MAAiCommand::MsgProc( MAAiScript* pAIScript, const UINT uiMsg, void* pParam )
{
switch( uiMsg )
{
case CMD_USESKILL:
{
SUseSkill* pUseSkill = static_cast<SUseSkill*>(pParam);
DnActorHandle hActor = pAIScript->GetActor();
if( hActor )
{
// 시킬 사용중이라면 강제로 종료시킨다.
hActor->ResetProcessSkill();
if( CDnSkill::UsingResult::Success == hActor->UseSkill( pUseSkill->iSkillIndex ) )
{
pAIScript->SetAIState( MAAiScript::AT_UseSkill );
}
}
break;
}
case CMD_REMOVEBLOW_BYSKILLINDEX:
{
SRemoveBlowBySkillIndex* pData = static_cast<SRemoveBlowBySkillIndex*>(pParam);
DnActorHandle hActor = pAIScript->GetActor();
if( hActor )
{
DNVector(DnBlowHandle) BlowList;
hActor->GetAllAppliedStateBlowBySkillID( pData->iSkillIndex, BlowList );
for( size_t i=0 ; i<BlowList.size() ; ++i )
{
DnBlowHandle hBlow = BlowList[i];
hActor->CmdRemoveStateEffect( hBlow->GetBlowIndex() );
}
}
break;
}
}
}