本文整理汇总了C++中CNpc::GetObjectKind方法的典型用法代码示例。如果您正苦于以下问题:C++ CNpc::GetObjectKind方法的具体用法?C++ CNpc::GetObjectKind怎么用?C++ CNpc::GetObjectKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNpc
的用法示例。
在下文中一共展示了CNpc::GetObjectKind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cook_Syn
void cCookManager::Cook_Syn(void* pMsg)
{
WORD wResult = eCookError_None;
MSG_COOK_SYN* pmsg = (MSG_COOK_SYN*)pMsg;
CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(pmsg->dwObjectID);
if(pPlayer)
{
// 스피드핵 체크
if(0 < pPlayer->GetLastCookTime())
{
wResult=eCookError_InvaildState;
goto COOK_NACK;
}
// 요리도구확인
WORD wCookUtilLevel = CheckCookUtil(pPlayer);
if(!wCookUtilLevel)
{
wResult=eCookError_InvaildUtil;
goto COOK_NACK;
}
// 레시피확인
stRecipeInfo* pRecipe = GetRecipeInfo(pmsg->dwRecipeIdx);
if(!pRecipe)
{
wResult=eCookError_InvaildRecipe;
goto COOK_NACK;
}
// 요리도구-레시피 레벨확인
if(wCookUtilLevel<eCOOKLEVEL3 && wCookUtilLevel<COOKMGR->GetCookLevelFromRecipe(pRecipe->dwRecipeIdx))
{
wResult=eCookError_LowerUtil;
goto COOK_NACK;
}
// 모닥불확인
CNpc* pFire = (CNpc*)g_pUserTable->FindUser(pmsg->dwFireNpcIdx);
if(!pFire || eObjectKind_Npc!=pFire->GetObjectKind())
{
wResult=eCookError_InvaildFire;
goto COOK_NACK;
}
// 제작수량확인
if(pmsg->wMakeNum<1 || 99<pmsg->wMakeNum)
{
wResult=eCookError_InvaildMakeNum;
goto COOK_NACK;
}
// 거리제한
VECTOR3 vHeroPos, vPlacePos;
pPlayer->GetPosition(&vHeroPos) ;
pFire->GetPosition(&vPlacePos);
float fDistance = CalcDistanceXZ(&vHeroPos, &vPlacePos);
if(MAX_COOKING_DISTANCE < fDistance)
{
wResult = eCookError_OverDistance;
goto COOK_NACK;
}
CItemSlot* pInvenSlot = pPlayer->GetSlot(eItemTable_Inventory);
if(0 == ITEMMGR->GetTotalEmptySlotNum(pInvenSlot, pPlayer))
{
wResult = eCookError_InvenFull;
goto COOK_NACK;
}
// 요리재료확인 및 소모
if(!CheckIngredients(pPlayer, pRecipe, pmsg->wMakeNum))
{
wResult = eCookError_NeedIngredient;
goto COOK_NACK;
}
// 숙련도확인 및 증가
WORD wCookCount = pPlayer->GetCookCount();
WORD wAddPoint = 0;
if(pPlayer->GetCookLevel() == GetCookLevelFromRecipe(pRecipe->dwRecipeIdx))
{
WORD wExpertPointMin = (WORD)pRecipe->dwExpertPointMin;
WORD wExpertPointMax = (WORD)pRecipe->dwExpertPointMax;
if(pPlayer->GetCookCount() < wExpertPointMin)
{
wResult = eCookError_LowerExpertPoint;
goto COOK_NACK;
}
if(wExpertPointMax < wCookCount)
wAddPoint = 0;
else if(wExpertPointMax <= wCookCount+pmsg->wMakeNum)
wAddPoint = wExpertPointMax - wCookCount;
else
wAddPoint = pmsg->wMakeNum;
if(wCookCount+wAddPoint < COOKMGR->GetMaxCookCount(pPlayer->GetCookLevel()))
pPlayer->SetCookCount(wCookCount + wAddPoint);
//.........这里部分代码省略.........