游戏乐悠悠网游开发网

标题: 恋人系统 [打印本页]

作者: mythosdev    时间: 2015-9-22 10:39
标题: 恋人系统
需要准备的东西
1.干净的源码
2.文本编辑工具,WINDOWS自带的记事本即可还要在这里介绍下自己,shevechco,巨峰社区的管理员,以后可能会有人知道这个社区,现在估计没人知道这个社区,可惜你们看不到的。

希望有人提供我老飞的飞行器源码支持

如果你还不知道怎么编译源码的话请先学习下源码编译方面的知识!

有问题或者源码编译错误请回帖,我会直到帮一个人解决然后不再跟踪这个问题

还请管理员字数限制调整到1W,我这些文件编辑了两次,第一次字数限制了发布了,累死了,分了三段,注意1楼和2楼还有

请尊重劳动成果,用了希望你回个贴,如果有需要,希望有会员用老飞飞行器源码编辑跟我交换更多的功能!

1.   ../AccountServer/VersionCommon.h
找到


#if (_MSC_VER > 1200)
#define  __VS2003  // 哪颇老矾函版.net
#endif

在后面添加

#define __LIANREN //支持恋人系统 2  ../CACHESERVER/VersionCommon.h
找到
#if (_MSC_VER > 1200)
#define __VS2003 // 哪颇老矾函版.net
#endif在后面添加



#define __LIANREN //支持恋人系统
3 ../CERTIFIER/VersionCommon.h
找到
#if (_MSC_VER > 1200)
#define __VS2003 // 哪颇老矾函版.net
#endif
在后面添加
#define __LIANREN //支持恋人系统
4  ../CORESERVER/DPCacheSrvr.cpp
找到
void CDPCacheSrvr::SendSetPlayerName( u_long idPlayer, const char* lpszPlayer )
{
BEFORESENDSOLE( ar, PACKETTYPE_QUERYSETPLAYERNAME, DPID_ALLPLAYERS );
ar << idPlayer;
ar.WriteString( lpszPlayer );
SEND( ar, this, DPID_ALLPLAYERS );
}在后面添加
#ifdef __LIANREN
//玩家成为恋人了.
void CDPCacheSrvr::SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2)
{
BEFORESENDSOLE( ar, PACKETTYPE_PLAYERCOUPLED, DPID_ALLPLAYERS );
ar << idPlayer;
ar.WriteString( lpszPlayer );
ar << idPlayer2;
ar.WriteString(lpszPlayer2);
SEND( ar, this, DPID_ALLPLAYERS );
}
void CDPCacheSrvr::SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2)
{
BEFORESENDSOLE( ar, PACKETTYPE_PLAYERDECOUPLED, DPID_ALLPLAYERS );
ar << idPlayer;
ar.WriteString( lpszPlayer );
ar << idPlayer2;
ar.WriteString(lpszPlayer2);
SEND( ar, this, DPID_ALLPLAYERS );
}
#endif //__LIANREN5  ../CORESERVER/DPCacheSrvr.h
找到
void SendSetPlayerName( u_long idPlayer, const char* lpszPlayer );
void SendSnoop( const char* lpszString, CPlayer* pSnoop );
后面添加
#ifdef __LIANREN
void SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2);
void SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2);
#endif //__LIANREN6  ../CORESERVER/DPDatabaseClient.cpp
找到
CDPDatabaseClient::CDPDatabaseClient()
{
BEGIN_MSG;
ON_MSG( PACKETTYPE_PARTYNAME, OnPartyName );
ON_MSG( PACKETTYPE_GLOBAL_DATA, OnGlobalData );
ON_MSG( PACKETTYPE_INSERTTAG_RESULT, OnInsertTagResult );
ON_MSG( PACKETTYPE_DC_ADDVOTERESULT, OnAddVoteResult );
ON_MSG( PACKETTYPE_UPDATE_GUILD_RANKING_END, OnUpdateGuildRankFinish );
ON_MSG( PACKETTYPE_DEL_PLAYER, OnDelPlayer );
ON_MSG( PACKETTYPE_GUILD_MEMBERTIME, OnGuildMemberTime );
ON_MSG( PACKETTYPE_BUYING_INFO, OnBuyingInfo );
ON_MSG( PACKETTYPE_TC_LIST, OnTCList );
ON_MSG( PACKETTYPE_QUERYSETPLAYERNAME, OnSetPlayerName );后面添加
#ifdef __LIANREN
ON_MSG( PACKETTYPE_PLAYERCOUPLED, OnPlayerCoupled);
ON_MSG( PACKETTYPE_PLAYERDECOUPLED, OnPlayerDeCoupled);
#endif //__LIANREN找到
void CDPDatabaseClient::SendSnoopGuild( u_long idGuild, u_long idPlayer, const char* lpszChat )
{
BEFORESEND( ar, PACKETTYPE_SETSNOOPGUILD );
ar << idGuild << idPlayer;
ar.WriteString( lpszChat );
SEND( ar, this, DPID_SERVERPLAYER );
}在前面添加
#ifdef __LIANREN
void CDPDatabaseClient::OnPlayerCoupled( CAr & ar )
{
OutputDebugString( \"CORESERVER.EXE\tPACKETTYPE_PLAYERCOUPLED\" );
u_long idPlayer,idPlayer2;
char lpszPlayer[MAX_PLAYER] = { 0, };
char lpszPlayer2[MAX_PLAYER] = {0,};
ar >> idPlayer;
ar.ReadString( lpszPlayer, MAX_PLAYER );
ar >> idPlayer2;
ar.ReadString( lpszPlayer2, MAX_PLAYER );
g_DPCacheSrvr.SendPlayerCoupled(idPlayer,lpszPlayer,idPlayer2,lpszPlayer2);
}
void CDPDatabaseClient::OnPlayerDeCoupled( CAr & ar )
{
u_long idPlayer,idPlayer2;
char lpszPlayer[MAX_PLAYER] = { 0, };
char lpszPlayer2[MAX_PLAYER] = {0,};
ar >> idPlayer;
ar.ReadString( lpszPlayer, MAX_PLAYER );
ar >> idPlayer2;
ar.ReadString( lpszPlayer2, MAX_PLAYER );
g_DPCacheSrvr.SendPlayerDeCoupled(idPlayer,lpszPlayer,idPlayer2,lpszPlayer2);
}
#endif //__LIANREN7 还是上面的目录里面的DPDatabaseClient.h
找到
#if __VER >= 11 // __SYS_PLAYER_DATA
void OnUpdatePlayerData( CAr & ar );
#endif // __SYS_PLAYER_DATA上面添加
#ifdef __LIANREN
void OnPlayerCoupled( CAr & ar );
void OnPlayerDeCoupled( CAr & ar );
#endif // __LIANREN8 还是上面目录里面的VersionCommon.h
找到
#if (_MSC_VER > 1200)
#define __VS2003 // 哪颇老矾函版.net
#endif后面添加
#define __LIANREN //支持恋人系统9 ../DataBaseserver/couplehelper.cpp
找到
#include \"couplehelper.h\"
#include \"dptrans.h\"
#include \"definetext.h\"
#include \"post.h\"在后面添加
#ifdef __LIANREN
#include \"DPCoreSrvr.h\"
extern CDPCoreSrvr g_dpCoreSrvr;
#endif // __LIANREN找到
void CCoupleHelper::OnCouple( CAr & ar )
{
int nResult = 0;
u_long idProposer, idTarget;
ar >> idProposer >> idTarget;
election::OutputDebugString( \"\nT: CCoupleHelper.OnCouple: %d, %d\n\", idProposer, idTarget );
if( m_pMgr->GetCouple( idProposer ) )
nResult = TID_GAME_COUPLE_E06; // 目敲捞 酒囱 某腐磐父 啊瓷钦聪促.
if( nResult == 0 && m_pMgr->GetCouple( idTarget ) )
nResult = TID_GAME_COUPLE_E01; // 措惑捞 何利钦 钦聪促. 目敲捞 酒囱 捞己 某腐磐俊霸父 啊瓷钦聪促.
if( nResult == 0 && !m_pController->Couple( idProposer, idTarget ) )
nResult = TID_GAME_COUPLE_E10; // 单捞磐海捞胶 坷幅涝聪促.
if( nResult == 0 )
m_pMgr->Couple( idProposer, idTarget );在后面添加
#ifdef __LIANREN
if(nResult == 0)
{
LPCSTR szProposer = CPlayerDataCenter::GetInstance()->GetPlayerString(idProposer);
LPCSTR szTarget = CPlayerDataCenter::GetInstance()->GetPlayerString(idTarget);
g_dpCoreSrvr.SendPlayerCoupled(idProposer,szProposer,idTarget,szTarget);
}
#endif // __LIANREN找到
void CCoupleHelper::OnDecouple( CAr & ar )
{
int nResult = 0;
u_long idPlayer;
ar >> idPlayer;

election::OutputDebugString( \"\nT: CCoupleHelper.OnDecouple: %d\n\", idPlayer );

CCouple* pCouple = m_pMgr->GetCouple( idPlayer );
if( !pCouple )
nResult = TID_GAME_COUPLE_E05;
if( nResult == 0 && !m_pController->Decouple( idPlayer ) )
nResult = TID_GAME_COUPLE_E10; // 单捞磐海捞胶 坷幅涝聪促.
if( nResult == 0 && !m_pMgr->Decouple( idPlayer ) )
nResult = TID_GAME_COUPLE_E11;
在后面添加
#ifdef __LIANREN
if(nResult == 0)
{
u_long idPartner = pCouple->GetPartner(idPlayer);
LPCSTR szProposer = CPlayerDataCenter::GetInstance()->GetPlayerString(idPlayer);
LPCSTR szTarget = CPlayerDataCenter::GetInstance()->GetPlayerString(idPartner);
g_dpCoreSrvr.SendPlayerDeCoupled(idPlayer,szProposer,idPartner,szTarget);
}
#endif // __LIANREN
10 还是上面的目录里面DPCoreSrvr.cpp
找到
void CDPCoreSrvr::SendAddVoteResult( VOTE_INSERTED_INFO & info )
{
BEFORESEND( ar, PACKETTYPE_DC_ADDVOTERESULT );
ar << info;
SEND( ar, this, DPID_ALLPLAYERS );
}后面添加
#ifdef __LIANREN
void CDPCoreSrvr::SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2)
{
BEFORESEND( ar, PACKETTYPE_PLAYERCOUPLED );
ar << idPlayer;
ar.WriteString( lpszPlayer );
ar << idPlayer2;
ar.WriteString(lpszPlayer2);
SEND( ar, this, DPID_ALLPLAYERS );
}
void CDPCoreSrvr::SendPlayerDeCoupled(u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2)
{
BEFORESEND( ar, PACKETTYPE_PLAYERDECOUPLED );
ar << idPlayer;
ar.WriteString( lpszPlayer );
ar << idPlayer2;
ar.WriteString(lpszPlayer2);
SEND( ar, this, DPID_ALLPLAYERS );
}
#endif // __LIANREN11 还是上面的目录DPCoreSrvr.h
找到
#if __VER >= 11 // __SYS_PLAYER_DATA
void SendUpdatePlayerData( u_long idPlayer, PlayerData* pPlayerData );
#endif // __SYS_PLAYER_DATA
上面添加
#ifdef __LIANREN
void SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2);
void SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2);
#endif // __LIANREN



12 还是上面的目录VersionCommon.h
找到
#define __EVENT_1101 // 免媒 捞亥飘
下面添加
#define __LIANREN //支持恋人系统
13  ../LOGINSERVER/VersionCommon.h
找到
#define __CRC
#define __SO1014 // 家南 抗寇 贸府( 某浆, 牢刘, 肺弊牢 )
#define __PROTOCOL0910
#define __PROTOCOL1021
#define __VERIFYNETLIB
#define __DOS1101
#define __STL_0402 // stl
上面添加
#define __LIANREN //支持恋人系统
14 ../neuz/DPClient.cpp
找到
ON_MSG( PACKETTYPE_QUERYSETPLAYERNAME, OnSetPlayerName );
下面添加
#ifdef __LIANREN
ON_MSG( PACKETTYPE_PLAYERCOUPLED, OnPlayerCoupled );
ON_MSG( PACKETTYPE_PLAYERDECOUPLED, OnPlayerDeCoupled );
#endif // __LIANREN
找到
#if __VER >= 11 // __SYS_PLAYER_DATA
PlayerData pd;
pd.data.nJob = pPlayer->GetJob();
pd.data.nLevel = pPlayer->GetLevel();
pd.data.nSex = pPlayer->GetSex();
lstrcpy( pd.szPlayer, pPlayer->GetName() );
下面添加
#ifdef __LIANREN
pd.idCouple = pPlayer->GetCoupleId();//恋人id
lstrcpy( pd.szCouplePlayer, pPlayer->GetCoupleName() ); //恋人名字
#endif //__LIANREN
接着找,可能跟上面一样
#if __VER >= 11 // __SYS_PLAYER_DATA
PlayerData pd;
pd.data.nJob = pPlayer->GetJob();
pd.data.nLevel = pPlayer->GetLevel();
pd.data.nSex = pPlayer->GetSex();
lstrcpy( pd.szPlayer, pPlayer->GetName() );
下面添加
#ifdef __LIANREN
pd.idCouple = pPlayer->GetCoupleId();//恋人id
lstrcpy( pd.szCouplePlayer, pPlayer->GetCoupleName() ); //恋人名字
#endif //__LIANREN
找到
void CDPClient::SendDoEscape( void )
{
if( g_pPlayer )
{
CWorld* pWorld = g_pPlayer->GetWorld();
if( pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR )
{
g_WndMng.OpenMessageBoxUpper( prj.GetText(TID_GAME_GUILDCOMBAT_NO_OUTWAR) );
return;
}
SendHdr( PACKETTYPE_DO_ESCAPE );
}
}
在上面添加
#ifdef __LIANREN
void CDPClient::OnPlayerCoupled( CAr & ar )
{
u_long idPlayer,idPlayer2;
char lpszPlayer[MAX_PLAYER] = { 0, };
char lpszPlayer2[MAX_PLAYER] = { 0, };
ar >> idPlayer;
ar.ReadString( lpszPlayer, MAX_PLAYER );
ar >> idPlayer2;//恋人id
ar.ReadString(lpszPlayer2,MAX_PLAYER);//恋人名字
//Error(\"OnPlayerCoupled:ID:%d Name:%s,idCouple:%d NameCouple:%s\",idPlayer,lpszPlayer,idPlayer2,lpszPlayer2);
char lpOutputString[128] = { 0, };
sprintf( lpOutputString, \"NEUZ.EXE\\t// PAKCETTYPE_QUERYSETPLAYERNAME\\t// %d\\t// %s\", idPlayer, lpszPlayer );
OutputDebugString( lpOutputString );
CMover* pPlayer = prj.GetUserByID( idPlayer );
if( IsValidObj( (CObj*)pPlayer ) )
{
pPlayer->SetCoupleId(idPlayer2);//设置恋人id
pPlayer->SetCoupleName( lpszPlayer2 ); //设置恋人名称
}
CMover* pPlayer2 = prj.GetUserByID( idPlayer2 );
if( IsValidObj( (CObj*)pPlayer2 ) )
{
pPlayer2->SetCoupleId(idPlayer);//设置恋人id
pPlayer2->SetCoupleName( lpszPlayer ); //设置恋人名称
}
CString str;
str.Format(\"恭喜 %s 和 %s 成为恋人\",lpszPlayer,lpszPlayer2);
g_WndMng.PutString( str, NULL, prj.GetTextColor(TID_ADMIN_ANNOUNCE), CHATSTY_SYSTEM );
CWndWorld* pWndWorld = (CWndWorld*)g_WndMng.GetWndBase( APP_WORLD );
if( pWndWorld ){
g_Caption1.AddCaption( str,pWndWorld->m_pFontAPITitle , FALSE, D3DCOLOR_ARGB( 255, 255, 255, 153 ) );
}
}
void CDPClient::OnPlayerDeCoupled( CAr & ar )
{
u_long idPlayer,idPlayer2;
char lpszPlayer[MAX_PLAYER] = { 0, };
char lpszPlayer2[MAX_PLAYER] = { 0, };
ar >> idPlayer;
ar.ReadString( lpszPlayer, MAX_PLAYER );
ar >> idPlayer2;//恋人id
ar.ReadString(lpszPlayer2,MAX_PLAYER);//恋人名字
//Error(\"OnPlayerCoupled:ID:%d Name:%s,idCouple:%d NameCouple:%s\",idPlayer,lpszPlayer,idPlayer2,lpszPlayer2);
char lpOutputString[128] = { 0, };
CMover* pPlayer = prj.GetUserByID( idPlayer );
if( IsValidObj( (CObj*)pPlayer ) )
{
pPlayer->SetCoupleId((u_long)0xffffffff);//设置恋人id
pPlayer->SetCoupleName( \"\\0\" ); //设置恋人名称
}
CMover* pPlayer2 = prj.GetUserByID( idPlayer2 );
if( IsValidObj( (CObj*)pPlayer2 ) )
{
pPlayer2->SetCoupleId((u_long)0xffffffff);//设置恋人id
pPlayer2->SetCoupleName( \"\\0\" ); //设置恋人名称
}
}
#endif // __LIANREN
15 ../neuz/DPClient.h
找到
#if __VER >= 11 // __SYS_PLAYER_DATA
void OnUpdatePlayerData( CAr & ar );
#endif // __SYS_PLAYER_DATA
上面添加
#ifdef __LIANREN
void OnPlayerCoupled( CAr & ar );
void OnPlayerDeCoupled( CAr & ar );
#endif // __LIANREN
16 还是NEUZ目录  VersionCommon.h
找到
#if (_MSC_VER > 1200)
#define __VS2003 // 哪颇老矾函版.net
#endif
下面添加
#define __LIANREN //使用恋人系统
17   ..WORLDSERVER/couplehelper.cpp
找到
void CCoupleHelper::OnCoupleResult( CAr & ar )
{
u_long idProposer, idTarget;
int nResult;
ar >> idProposer >> idTarget >> nResult;
election::OutputDebugString( \"S: CCoupleHelper.OnCoupleResult: %d, %d, %d\", idProposer, idTarget, nResult );
CUser* pProposer = static_cast<CUser*>( prj.GetUserByID( idProposer ) );
CUser* pTarget = static_cast<CUser*>( prj.GetUserByID( idTarget ) );
if( nResult == 0 )
{
m_pMgr->Couple( idProposer, idTarget );
const char* pszProposer = CPlayerDataCenter::GetInstance()->GetPlayerString( idProposer );
const char* pszTarget = CPlayerDataCenter::GetInstance()->GetPlayerString( idTarget );
后面添加
#ifdef __LIANREN
//结婚成功更新下数据以便玩家都可以看到
if (pszProposer)
{
CUser* pUser = (CUser*)prj.GetUserByID( idProposer );
if (IsValidObj(pUser))
{
pUser->SetCoupleId(idTarget);
pUser->SetCoupleName(pszTarget);
}
//CPlayerDataCenter::GetInstance()
}
if (pszTarget)
{
CUser* pUser = (CUser*)prj.GetUserByID( idTarget );
if (IsValidObj(pUser))
{
pUser->SetCoupleId(idProposer);
pUser->SetCoupleName(pszProposer);
}
//CPlayerDataCenter::GetInstance()
}
#endif // __LIANREN
if( !pszProposer ) pszProposer = \"\";
if( !pszTarget ) pszTarget = \"\";
//结成情侣成功,需要通知每位玩家这2个人的信息.
if( IsValidObj( pProposer ) )
{
pProposer->AddCoupleResult( idTarget, pszTarget );
找到
void CCoupleHelper::OnDecoupleResult( CAr & ar )
{
u_long idPlayer;
int nResult;
ar >> idPlayer >> nResult;
election::OutputDebugString( \"S: CCoupleHelper.OnDecoupleResult: %d, %d\", idPlayer, nResult );
CUser* pUser = static_cast<CUser*>( prj.GetUserByID( idPlayer ) );
if( nResult == 0 )
{
CCouple* pCouple = m_pMgr->GetCouple( idPlayer );
ASSERT( pCouple );
if( !pCouple )
return;
CUser* pPartner = static_cast<CUser*>( prj.GetUserByID( pCouple->GetPartner( idPlayer ) ) );
m_pMgr->Decouple( idPlayer );
后面添加
#ifdef __LIANREN
//离婚成功更新下数据以便玩家都可以看到
//CUser* pUser1 = (CUser*)prj.GetUserByID( idPlayer );
if (IsValidObj(pUser))
{
pUser->SetCoupleId((u_long)0xffffffff);
pUser->SetCoupleName(\"\\0\");
}
//CPlayerDataCenter::GetInstance()
//CUser* pUser2 = (CUser*)prj.GetUserByID( pCouple->GetPartner( idPlayer ) );
if( IsValidObj( pPartner ) )
{
pPartner->SetCoupleId((u_long)0xffffffff);
pPartner->SetCoupleName(\"\\0\");
}
#endif // __LIANREN

作者: mythosdev    时间: 2015-9-22 10:43
最后一段
17 还是上面的目录VersionCommon.h
找到
#if (_MSC_VER > 1200)
#define __VS2003 // 哪颇老矾函版.net
#endif
后面添加
#define __LIANREN //是否使用恋人系统
18   .._common/Mover.cpp
找到
m_nRemainGP = 0;
m_nDefenseMin = 0;
m_nDefenseMax = 0;
m_nJob = -1;
memset( m_szName, 0, sizeof(TCHAR) );
下面添加
#ifdef __LIANREN
memset(m_szCoupleName,0,sizeof(m_szCoupleName));
#endif // __LIANREN
找到
m_dwAuthorization = AUTH_GENERAL;
m_idMarkingWorld = NULL_ID;
m_dwRegionAttr = 0;
m_dwOldRegionAttr = 0;
m_bPositiveX = m_bPositiveZ = false;
上面添加
#ifdef __LIANREN
m_idCouplePlayer = NULL_ID;
#endif // __LIANREN
找到
LPCTSTR CMover::GetName( BOOL bNickname )
{
if( !bNickname )
return (LPCTSTR)m_szName;
if( m_dwAuthorization >= AUTH_GAMEMASTER && ( GetIndex() == MI_CROWNIBLIS || GetIndex() == MI_CROWNSHADE || GetIndex() == MI_CROWNBUBBLE ) )
{
MoverProp* pMoverProp = GetProp();
if( pMoverProp )
return (LPCTSTR)pMoverProp->szName;
}
return (LPCTSTR)m_szName;
}
下面添加
#ifdef __LIANREN
LPCTSTR CMover::GetCoupleName()
{
return (LPCTSTR)m_szCoupleName;
}
u_long CMover::GetCoupleId()
{
return m_idCouplePlayer;
}
#endif // __LIANREN
19 还是上面的目录Mover.h
找到
public:
BOOL   m_bPlayer;     /// Player牢啊, 酒聪扼搁 NPC
u_long   m_idPlayer;     /// player狼 db锅龋, NPC绰 0xffffffff
下面添加
#ifdef __LIANREN
u_long m_idCouplePlayer; /// 恋人id
#endif //__LIANREN
找到
protected:
int m_nCount; /// 公滚啊 裹侩栏肺 静绰 鉴瞒利 墨款磐. 积己磊 寇浚 0栏肺 檬扁拳 窍瘤 富巴.
DWORD m_dwGold; /// 其衬
DWORD m_dwRideItemIdx; /// 厚青眉狼 酒捞袍 牢郸胶
CModelObject* m_pRide; /// 厚青眉 按眉 器牢磐
TCHAR m_szName[MAX_NAME]; /// 捞抚
下面添加
#ifdef __LIANREN
TCHAR m_szCoupleName[MAX_NAME]; /// 恋人的角色名
#endif //__LIANREN
找到
void SetHairColor( FLOAT r, FLOAT g, FLOAT b );
void SetHead( int nHead );
void SetSkinSet( int nSkinSet );
void SetName( const char* lpszName ) { lstrcpy( m_szName, lpszName ); }
LPCTSTR GetName( BOOL bNickname = FALSE ); // 按眉狼 捞抚 掘扁
下面添加
#ifdef __LIANREN
void SetCoupleName( const char* lpszCouplePlayer ) { lstrcpy( m_szCoupleName, lpszCouplePlayer ); }
LPCTSTR GetCoupleName(); // 获取恋人名字
void SetCoupleId(u_long idCoupler) {m_idCouplePlayer = idCoupler;}
u_long GetCoupleId();//获取恋人id
#endif //__LIANREN
20 还是上面一个目录MoverRender.cpp
找到
int nGaugeWidth = 80;
CPoint point( (LONG)( vOut.x - nGaugeWidth / 2 ), (LONG)( vOut.y - 3 ) );
CRect rect( point.x - 2, point.y - 2, point.x + nGaugeWidth + 2, point.y + 5 + 2);
上面添加
#ifdef __LIANREN
vOut.y -= 10;//增加了恋人位置
#endif //__LIANREN

找到
#if __VER >= 8 // __S8_PK
if( dwColor == prj.m_PKSetting.dwGeneralColor ) // 俏农祸捞唱 墨坷祸捞搁 官差瘤 臼霸 窍磊
#endif // __VER >= 8 // __S8_PK
if( g_Party.FindMember( m_idPlayer ) != -1 ) // 颇萍糕滚搁 祸彬 促福霸 钎矫.
dwColor = COLOR_PARTY;
if( bOtherColor )
dwColor = dwNewColor;
下面添加
#ifdef __LIANREN
//恋人代码
//pFont->DrawText( (FLOAT)( point.x ), (FLOAT)( point.y ), 0xffbc00bc, szStrCouple );
if ((int)m_idCouplePlayer > 0)
{
TCHAR szStrCouple[70];
sprintf( szStrCouple, _T(\"%s的恋人\"), m_szCoupleName );
point.x = (LONG)( vOut.x );
point.y = (LONG)( vOut.y );
MakeEven( point.x );
point.x -= pFont->GetTextExtent( szStrCouple ).cx / 2;
point.y -= 47;
point.x -= 3;
pFont->DrawText( (FLOAT)( point.x ), (FLOAT)( point.y ), 0xffa62fbd, szStrCouple );//0xffbc00bc
}
//恋人代码结束
#endif //__LIANREN
下面这一段会重复好几次,我加几次你就加几次,不能少,少的话恋人名字就和其他的称号挤在一起了!!!
找到
int nGaugeWidth = 80;
CPoint point( (int)( vOut.x - nGaugeWidth / 2 ), (int)( vOut.y - 3 ) );
CRect rect( point.x - 2, point.y - 2, point.x + nGaugeWidth + 2, point.y + 5 + 2);
上面添加
#ifdef __LIANREN
vOut.y -= 24 ; //hp框的起始y位置,原来是34,因为加了恋人所以要向上挪动恋人的高度+武器进度条的高度(大约14+8)
#endif //__LIANREN
找到
int nGaugeWidth = 80;
CPoint point( (int)( vOut.x - nGaugeWidth / 2 ), (int)( vOut.y - 3 ) );
CRect rect( point.x - 2, point.y - 2, point.x + nGaugeWidth + 2, point.y + 5 + 2);
上面添加
#ifdef __LIANREN
vOut.y -= 16;//采集进度框的起始y位置,原来是48,因为加了恋人所以要向上挪动恋人的高度(大约14)
#endif //__LIANREN
找到
int nGaugeWidth = 80;
CPoint point( (int)( vOut.x - nGaugeWidth / 2 ), (int)( vOut.y - 3 ) );
CRect rect( point.x - 2, point.y - 2, point.x + nGaugeWidth + 2, point.y + 5 + 2);
上面添加
#ifdef __LIANREN
vOut.y -= 16;//原来是48,因为加了恋人所以要向上挪动恋人的高度(大约14)
#endif //__LIANREN
21 还是这个目录MoverSkill.cpp
找到
#ifdef __WORLDSERVER
BOOL CMoverUseItemSexChange( int nFace )
{
下面添加
//检查是否有情侣
#ifdef __LIANREN
if ((int)m_idCouplePlayer > 0)
{
((CUser*)this)->AddText((LPCTSTR)\"请先解除情侣\");
return FALSE; //有情侣就不能变性
}
#endif // __LIANREN
22 还是这个目录ObjSerializeOpt.cpp
找到
ar.WriteString( m_szName );
ar << GetSex();
ar << (u_char)m_dwSkinSet;
ar << (u_char)m_dwHairMesh;
ar << m_dwHairColor;
ar << (u_char)m_dwHeadMesh;
ar << m_idPlayer;
下面添加
#ifdef __LIANREN
ar << m_idCouplePlayer;//恋人id
ar.WriteString(m_szCoupleName);//恋人名字
#endif //__LIANREN
找到
# if defined (__WORLDSERVER) || defined(__CLIENT)
SetHairColor( m_dwHairColor );
# endif // __WORLDSERVER //__CLIENT
ar >> m_idPlayer;
下面添加
#ifdef __LIANREN
ar >> m_idCouplePlayer;//恋人id
ar.ReadString(m_szCoupleName,32);//恋人名字
#endif //__LIANREN
23  ../_Database/DbManagerFun.cpp  这个文件可以查看到你在数据库里添加那些表和字段,你们自己可以研究下
找到
void CDbManager::GetBaseCharacter( CMover* pMover, CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus )
{
在下面添加(有人说数据库不支持恋人系统,要2000块一份,我这里本来不想提醒的,算了,大家都互相学习,我这个贴估计也是这个论坛的第一个改动这么多的源码功能,这里不用我说了吧,里面的字段加进到数据库就完美支持恋人系统的显示了,任何数据库都是一样的添加,在数据库里面直接添加几个字段就行,就这一笔就值2000块。)
#ifdef __LIANREN
pMover->m_idCouplePlayer = (u_long)qry->GetInt( \"m_idCouple\" );
qry->GetStr( \"m_szCoupleName\", pMover->m_szCoupleName );
//获取情侣
//WriteLog(\"DB_Join:idPlayer:%d,idCouple:%d,CoupleName:%s\",pMover->m_idPlayer,pMover->m_idCouplePlayer,pMover->m_szCoupleName);
#endif //__LIANREN
23  ../_Network/Objects/Obj.cpp
找到
#endif // __JEFF_9_20
m_dwReturnWorldID = 0;
m_idGuildCloak = 0;
memset( m_szName, 0, sizeof(m_szName) );
下面添加
#ifdef __LIANREN
memset( m_szCoupleName, 0, sizeof(m_szCoupleName) );
#endif //__LIANREN
找到
m_vMarkingPos = D3DXVECTOR3( 0, 0, 0 );
m_vReturnPos = D3DXVECTOR3( 0, 0, 0 );
m_dwType = OT_MOVER;
m_bPlayer = FALSE;
m_idPlayer = (u_long)0xffffffff;
下面添加
#ifdef __LIANREN
m_idCouplePlayer = (u_long)0xffffffff;
#endif //__LIANREN
24 还是上面的目录Obj.h
找到
TCHAR   m_szName[32];
下面添加
#ifdef __LIANREN
TCHAR m_szCoupleName[32]; /// 恋人的角色名
#endif //__LIANREN
找到
BOOL m_bPlayer;
u_long m_idPlayer;
下面添加
#ifdef __LIANREN
u_long m_idCouplePlayer; /// 恋人id
#endif //__LIANREN
作者: dianpula    时间: 2018-12-20 09:59
资源甚好,感谢楼主。。




欢迎光临 游戏乐悠悠网游开发网 (http://bbs.yxlyy.club/) Powered by Discuz! X3.2