本文整理汇总了C++中CCrywolfUtil类的典型用法代码示例。如果您正苦于以下问题:C++ CCrywolfUtil类的具体用法?C++ CCrywolfUtil怎么用?C++ CCrywolfUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCrywolfUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NotifyCrywolfStatueAndAltarInfo
void CCrywolf::NotifyCrywolfStatueAndAltarInfo()
{
static DWORD dwTickCount = 0;
if ( (GetTickCount() - dwTickCount) < 2000 )
return;
dwTickCount = GetTickCount();
PMSG_ANS_CRYWOLF_STATUE_ALTAR_INFO pMsg;
PHeadSubSetB((LPBYTE)&pMsg, 0xBD, 0x02, sizeof(pMsg));
pMsg.iCrywolfStatueHP = g_CrywolfNPC_Statue.m_Shield.GetHPPercentage();
pMsg.btAltarState1 = g_CrywolfNPC_Altar.GetAltarRemainContractCount(205);
pMsg.btAltarState2 = g_CrywolfNPC_Altar.GetAltarRemainContractCount(206);
pMsg.btAltarState3 = g_CrywolfNPC_Altar.GetAltarRemainContractCount(207);
pMsg.btAltarState4 = g_CrywolfNPC_Altar.GetAltarRemainContractCount(208);
pMsg.btAltarState5 = g_CrywolfNPC_Altar.GetAltarRemainContractCount(209);
pMsg.btAltarState1 |= g_CrywolfNPC_Altar.GetAltarState(205) << 4;
pMsg.btAltarState2 |= g_CrywolfNPC_Altar.GetAltarState(206) << 4;
pMsg.btAltarState3 |= g_CrywolfNPC_Altar.GetAltarState(207) << 4;
pMsg.btAltarState4 |= g_CrywolfNPC_Altar.GetAltarState(208) << 4;
pMsg.btAltarState5 |= g_CrywolfNPC_Altar.GetAltarState(209) << 4;
UTIL.SendCrywolfUserAnyData((LPBYTE)&pMsg,sizeof(pMsg));
LogAdd("[ Crywolf ][Statue Info] Statue HP : %d",
pMsg.iCrywolfStatueHP);
for ( int iAltar = 205 ; iAltar <= 209 ; iAltar ++ )
{
int iUserIndex = g_CrywolfNPC_Altar.GetAltarUserIndex(iAltar);
if ( iUserIndex != -1 )
{
LogAdd("[ Crywolf ][Altar Info] Altar(%d) Contractor: [%s][%s] ",
iAltar, gObj[iUserIndex].AccountID, gObj[iUserIndex].Name);
}
}
}
示例2: ApplyElementMove
BOOL TMonsterAIElement::ApplyElementMove(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-이동");
KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-이동");
if ( lpObj->PathStartEnd )
return FALSE;
BOOL bFindXY = FALSE;
if ( pAIState->m_iTransitionType == 2 )
bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
else
bFindXY = MONSTER_UTIL.GetXYToPatrol(lpObj);
if ( bFindXY )
MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, 1);
return FALSE;
}
示例3: SetState_READY
void CCrywolf::SetState_READY()
{
UTIL.SendMapServerGroupMsg("The army of Balgass is marching towards Crywolf Fortress");
LogAdd( "[ Crywolf ] State (%d) -> READY", this->m_iCrywolfState);
this->SetCrywolfState(CRYWOLF_STATE_READY);
this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_READY);
this->SetOccupationState(2);
this->SetCrywolfCommonNPC(2);
this->SetCrywolfMapAttr(2);
this->RemoveCrywolfCommonMonster();
g_CrywolfNPC_Altar.SetAllAltarObjectIndex();
g_CrywolfNPC_Altar.SetAllAltarViewState(0x10000);
for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++)
{
TMonsterAIGroup::Init(this->m_iMonsterGroupNumberArray[n]);
}
this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
this->ResetAllUserMVPScore();
}
示例4: SetAltarValidContract
void CCrywolfAltar::SetAltarValidContract(int iAltarObjIndex, int iClass)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
if ( AltarInfo->GetAltarState() != 2 )
return;
if ( AltarInfo->m_dwValidContractTime < (int)GetTickCount() )
{
MsgOutput(AltarInfo->m_iUserIndex, lMsg.Get(MSGGET(12, 251)), iAltarNumber);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 252)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
CLog.LogAdd("[ Crywolf ][Altar Op.] [%s][%s] Set Valid Contract Altar[%d]",
gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
AltarInfo->SetAltarState(1);
memset(gObj[iAltarObjIndex].m_ViewSkillState,0, sizeof(gObj[iAltarObjIndex].m_ViewSkillState));
gObj[iAltarObjIndex].m_ViewSkillState[eVS_ALTAR_VALID_CONTRACT] = 1;
GCStateInfoSend(&gObj[iAltarObjIndex], 1, eVS_ALTAR_VALID_CONTRACT);
}
}
示例5: ApplyElementSpecialSommon
BOOL TMonsterAIElement::ApplyElementSpecialSommon(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-특수소환");
TMonsterAIGroupMember * pMemb = TMonsterAIGroup::FindGroupMemberToSommon(lpObj->m_Index, lpObj->m_iGroupNumber, lpObj->m_iGroupMemberGuid);
if ( pMemb )
{
LPOBJ lpTargetObj = &gObj[pMemb->m_iObjIndex];
if ( lpTargetObj->Live != 0 )
return FALSE;
TMonsterSkillUnit * lpSkillUnit = TMonsterSkillManager::FindMonsterSkillUnit(lpObj->m_Index, 30);
if ( lpSkillUnit )
{
lpSkillUnit->RunSkill(iIndex, lpTargetObj->m_Index);
}
}
return FALSE;
}
示例6: SetAltarValidContract
void CCrywolfAltar::SetAltarValidContract(int iAltarObjIndex, int iClass)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
if ( AltarInfo->GetAltarState() != 2 )
{
return;
}
if ( AltarInfo->m_dwValidContractTime < GetTickCount() )
{
MsgOutput(AltarInfo->m_iUserIndex, lMsg.Get(MSGGET(12, 251)), iAltarNumber);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 252)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
LogAddTD("[ Crywolf ][Altar Op.] [%s][%s] Set Valid Contract Altar[%d]", gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
AltarInfo->SetAltarState(1);
gObjAddBuffEffect(&gObj[iAltarObjIndex], AT_CW_ALTAR_STATUS, 0, 0, 0, 0, -10);
}
}
示例7: ApplyElementAttack
BOOL TMonsterAIElement::ApplyElementAttack(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-공격");
if ( TMonsterSkillManager::CheckMonsterSkill(lpObj->Class) )
{
BOOL bEnableAttack = TRUE;
if ( lpObj->TargetNumber < 0 )
{
lpObj->TargetNumber = -1;
lpObj->m_ActState.Emotion = 0;
lpObj->m_ActState.Attack = 0;
lpObj->m_ActState.Move = 0;
lpObj->NextActionTime = 1000;
return FALSE;
}
if ( !gObj[lpObj->TargetNumber].Live || gObj[lpObj->TargetNumber].Teleport )
bEnableAttack = FALSE;
if ( gObj[lpObj->TargetNumber].Connected <= PLAYER_LOGGED ||
gObj[lpObj->TargetNumber].CloseCount != -1 )
{
bEnableAttack = FALSE;
}
if ( !bEnableAttack )
{
lpObj->TargetNumber = -1;
lpObj->m_ActState.Emotion = 0;
lpObj->m_ActState.Attack = 0;
lpObj->m_ActState.Move = 0;
lpObj->NextActionTime = 1000;
return FALSE;
}
LPOBJ lpTargetObj = &gObj[lpObj->TargetNumber];
lpObj->Dir = GetPathPacketDirPos(lpTargetObj->X - lpObj->X, lpTargetObj->Y - lpObj->Y);
if ( (rand()%4) == 0 )
{
PMSG_ATTACK pAttackMsg;
pAttackMsg.AttackAction = 0x78;
pAttackMsg.DirDis = lpObj->Dir;
pAttackMsg.NumberH = SET_NUMBERH(lpObj->TargetNumber);
pAttackMsg.NumberL = SET_NUMBERL(lpObj->TargetNumber);
GCActionSend(lpObj, 0x78, lpObj->m_Index, 0);
gObjAttack(lpObj, &gObj[lpObj->TargetNumber], 0, 0, 0, 0, 0,0,0);
}
else
{
TMonsterSkillManager::UseMonsterSkill(lpObj->m_Index, lpObj->TargetNumber, 0, -1, 0);
}
lpObj->m_ActState.Attack = 0;
return FALSE;
}
else
{
if( lpObj->TargetNumber < 0 )
return FALSE;
LPOBJ lpTargetObj = &gObj[lpObj->TargetNumber];
lpObj->Dir = GetPathPacketDirPos(lpTargetObj->X - lpObj->X, lpTargetObj->Y - lpObj->Y);
PMSG_ATTACK pAttackMsg;
pAttackMsg.AttackAction = 0x78;
pAttackMsg.DirDis = lpObj->Dir;
pAttackMsg.NumberH = SET_NUMBERH(lpObj->TargetNumber);
pAttackMsg.NumberL = SET_NUMBERL(lpObj->TargetNumber);
CGAttack((PMSG_ATTACK *)&pAttackMsg, lpObj->m_Index);
GCActionSend(lpObj, 0x78, lpObj->m_Index, lpTargetObj->m_Index);
gObjAttack(lpObj, &gObj[lpObj->TargetNumber], 0, 0, 0, 0, 0,0,0);
return FALSE;
}
}
示例8: ApplyElementMoveTarget
BOOL TMonsterAIElement::ApplyElementMoveTarget(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-MoveTarget");
#if (__CUSTOM__ == 0)
KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-타겟이동");
#endif
if ( lpObj->PathStartEnd )
return FALSE;
if ( lpObj->X == this->m_iX &&
lpObj->Y == this->m_iY )
{
this->ApplyElementMove(iIndex, iTargetIndex, pAIState);
return FALSE;
}
BOOL bFindXY = TRUE;
int iTargetX = this->m_iX;
int iTargetY = this->m_iY;
int iTargetDistance = (int)sqrt(double(((lpObj->X - iTargetX)*(lpObj->X - iTargetX))+ ((lpObj->Y - iTargetY)*(lpObj->Y - iTargetY))));
if ( TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_bDataLoad )
{
if ( iTargetDistance > 10 )
{
int iMinCost = 1000000;
int iMidX = -1;
int iMidY = -1;
int iSpotNum = -1;
for ( int i=0;i<MAX_MONSTER_AI_MOVE_PATH;i++)
{
TMonsterAIMovePathInfo & PathInfo = TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_MovePathInfo[i];
float fDistX = (float)(lpObj->X - PathInfo.m_iPathX);
float fDistY = (float)(lpObj->Y - PathInfo.m_iPathY);
int iPathSpotDist = (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );
if ( iPathSpotDist < 20 )
{
fDistX = (float)(iTargetX - PathInfo.m_iPathX);
fDistY = (float)(iTargetY - PathInfo.m_iPathY);
int iMidDist = (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );
if ( iMinCost > iMidDist )
{
if ( iMidDist )
{
iMinCost = iMidDist;
iMidX = PathInfo.m_iPathX;
iMidY = PathInfo.m_iPathY;
iSpotNum = i;
}
}
}
}
if ( iMinCost != 1000000 )
{
iTargetX = iMidX;
iTargetY = iMidY;
}
}
}
if ( bFindXY )
{
if ( MONSTER_UTIL.FindPathToMoveMonster(lpObj, iTargetX, iTargetY, 7, FALSE) )
lpObj->PathStartEnd = 1;
else
lpObj->PathStartEnd = 0;
}
return FALSE;
}