本文整理汇总了C++中Obj_Human::EquipChangePai方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj_Human::EquipChangePai方法的具体用法?C++ Obj_Human::EquipChangePai怎么用?C++ Obj_Human::EquipChangePai使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_Human
的用法示例。
在下文中一共展示了Obj_Human::EquipChangePai方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
}
pEquip2Item = pEquipContainer->GetItem((UINT)Equip2Point);
Assert(pEquip2Item != NULL);
if(pEquip2Item->IsEmpty())
{
Result = EQUIPEXCHANGEPAITTYPE_EQUIP_FAIL;
ResultPacket.SetResult(Result);
pGamePlayer->SendPacket(&ResultPacket);
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipExChangePaiTypeHandler Equip empyty, bagpos=%d", pPacket->GetPos2()) ;
return PACKET_EXE_CONTINUE;
}
Assert (pEquip2Item->GetItemClass() == ICLASS_EQUIP);
}
if(!(pEquip2Item->GetGUID() == pPacket->getItem2ID()))
{
Result = EQUIPEXCHANGEPAITTYPE_EQUIP_FAIL;
ResultPacket.SetResult(Result);
pGamePlayer->SendPacket(&ResultPacket);
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipExChangePaiTypeHandler guid error") ;
return PACKET_EXE_CONTINUE;
}
if ((!pEquip1Item->GetItemBind())||(!pEquip2Item->GetItemBind()))
{
Result = EQUIPEXCHANGEPAITTYPE_EQUIPBIND_FAIL;
ResultPacket.SetResult(Result);
pGamePlayer->SendPacket(&ResultPacket);
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipExChangePaiTypeHandler no Bind") ;
return PACKET_EXE_CONTINUE;
}
Result = (EQUIPEXCHANGEPAITTYPE_RESULT)pHuman->EquipChangePai(pEquip1Item, pEquip2Item, pPacket->getGemBagPos());
ResultPacket.SetResult(Result);
pGamePlayer->SendPacket(&ResultPacket);
//如果装备在身上
if(((pPacket->GetEquip1PosType() == ENUM_EQUIP_POINT)&&(Equip1Point != INVALID_ITEM_POS))
||((pPacket->GetEquip2PosType() == ENUM_EQUIP_POINT)&&(Equip2Point != INVALID_ITEM_POS)))
{
//设置装备版本
pHuman->SetEquipVer(pHuman->GetEquipVer()+1);
//刷新装备对人物的属性影响
pHuman->ItemEffectFlush();
//更新装备
UINT RetPart = 0;
GCDetailEquipList SelfMsg;
SelfMsg.setObjID( pHuman->GetID() );
if (pPacket->GetEquip1PosType() == ENUM_EQUIP_POINT)
{
pEquip1Item = HumanItemLogic::GetEquip(pHuman,(HUMAN_EQUIP)Equip1Point);
if(!pEquip1Item)
{
Assert(FALSE);
return PACKET_EXE_CONTINUE;
}
if(pEquip1Item->IsEmpty())
{
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipExChangePaiTypeHandler: Equip_Point =%d Fail", Equip1Point ) ;
return PACKET_EXE_CONTINUE;
}
pEquip1Item->SaveValueTo(SelfMsg.GetEquipData((HUMAN_EQUIP)Equip1Point));