/* ------------------------------------------------ // 发送领取繁殖坐骑消息 参数1 nNpcSeverID ------------------------------------------------ */ INT Mount::RequestGainMatingMount(LuaPlus::LuaState* state) { LuaStack args(state); if (!(args[2].IsInteger())) { KLThrow("Mount::RequestGainMatingMount[2] param parameter error"); } INT nNpcSeverID = args[2].GetInteger(); // npc有效 tObject* pObj = CObjectManager::GetMe()->FindServerObject(nNpcSeverID); if (pObj) { /// 发送领取繁殖坐骑消息 CGManipulatePet Msg; Msg.SetCharObjID(nNpcSeverID); Msg.SetManipulateType( MANIPULATE_HORSE_MATING_RETRIEVE ); CNetManager::GetMe()->SendPacket(&Msg); } return 0; }
/* ------------------------------------------------ // 发送打开繁殖界面消息 参数1 MountIndex ------------------------------------------------ */ INT Mount::RequestTogleMatingPage(LuaPlus::LuaState* state) { LuaStack args(state); if (!(args[2].IsInteger())) { KLThrow("Mount::RequestTogleMatingPage[2] param parameter error"); } INT nNpcSeverID = args[2].GetInteger(); tObject* pObj = CObjectManager::GetMe()->FindServerObject(nNpcSeverID); if (pObj) { // 发送打开界面消息 CGManipulatePet Msg; Msg.SetCharObjID(nNpcSeverID); Msg.SetManipulateType( MANIPULATE_HORSE_OPEN_MATING_UI ); CNetManager::GetMe()->SendPacket(&Msg); } else { CEventSystem::GetMe()->PushEvent(GE_NEW_DEBUGMESSAGE, "目标距离太远"); } return 0; }
/* ------------------------------------------------ // 发送确认或取消交配消息 参数1 MountIndex 参数2 nOK 确认或取消 参数3 nNpcSeverID ------------------------------------------------ */ INT Mount::RequestMating(LuaPlus::LuaState* state) { LuaStack args(state); if (!(args[2].IsInteger())) { KLThrow("Mount::RequestMyMountMatingLocked[2] param parameter error"); } INT nMountIndex = args[2].GetInteger(); if (!(args[3].IsInteger())) { KLThrow("Mount::RequestMating[3] param parameter error"); } INT nOK = args[3].GetInteger(); if (!(args[4].IsInteger())) { KLThrow("Mount::RequestMating[4] param parameter error"); } INT nNpcSeverID = args[4].GetInteger(); if (TRUE == nOK) { // 发送确认消息 SDATA_PET* pPet = CDataPool::GetMe()->Pet_GetPet(nMountIndex); if (pPet && FALSE == pPet->m_GUID.IsNull()) { CGManipulatePet Msg; Msg.SetGUID( pPet->m_GUID ); Msg.SetCharObjID(nNpcSeverID); Msg.SetManipulateType( MANIPULATE_HORSE_MATING_CONFIRM ); CNetManager::GetMe()->SendPacket(&Msg); } } else { // 发送取消消息 CGManipulatePet Msg; Msg.SetManipulateType( MANIPULATE_HORSE_MATING_CANCEL ); CNetManager::GetMe()->SendPacket(&Msg); } return 0; }
/* ------------------------------------------------ // 请求目标骑宠属性 ------------------------------------------------ */ INT Mount::TargetMountAttrRequest(LuaPlus::LuaState* state) { tObject* pObj = CObjectManager::GetMe()->GetMainTarget(); if (pObj && g_theKernel.IsKindOf(pObj->GetClass(), GETCLASS(CObject_PlayerOther))) { CObject_PlayerOther* pOtherPlayer = (CObject_PlayerOther*)pObj; if (0 < pOtherPlayer->GetCharacterData()->Get_MountID()) { // 发送 请求目标骑宠属性消息 CGManipulatePet Msg; Msg.SetObjID(pOtherPlayer->GetServerID()); Msg.SetCharObjID(CObjectManager::GetMe()->GetMySelf()->GetServerID()); Msg.SetManipulateType(MANIPULATE_ASKOTHERPETINFO); CNetManager::GetMe()->SendPacket(&Msg); } } return 0; }