📄 network.cpp
字号:
packet.u.client_item_drop.item.attr[1] = attr[1];
packet.u.client_item_drop.item.attr[2] = attr[2];
packet.u.client_item_drop.item.attr[3] = attr[3];
packet.u.client_item_drop.item.attr[4] = attr[4];
packet.u.client_item_drop.item.attr[5] = attr[5];
packet.u.client_item_drop.x = x;
packet.u.client_item_drop.y = y;
}
packet.h.header.size = sizeof( t_client_item_drop );
QueuePacket( &packet, 1 );
}
void SendTakeItem( int item_id ) // 0109
{
t_packet packet;
packet.h.header.type = CMD_ITEM_TAKE;
{
packet.u.client_item_take.item_id = item_id;
}
packet.h.header.size = sizeof( t_client_item_take );
QueuePacket( &packet, 1 );
}
// Client -> Server
// Item狼 Animation惑怕甫 官槽促.
void SendItemStatus( int item_id, unsigned int attr[6] )
{
t_packet packet;
packet.h.header.type = CMD_ITEM_STATUS;
{
packet.u.client_item_status.item_id = item_id;
packet.u.client_item_status.attr[0] = attr[0];
packet.u.client_item_status.attr[1] = attr[1];
packet.u.client_item_status.attr[2] = attr[2];
packet.u.client_item_status.attr[3] = attr[3];
packet.u.client_item_status.attr[4] = attr[4];
packet.u.client_item_status.attr[5] = attr[5];
}
packet.h.header.size = sizeof( t_client_item_status );
QueuePacket( &packet, 1 );
}
// Server -> Client
// Item狼 Animation惑怕甫 官槽促.
void RecvChangeItemStatus( int item_id, unsigned int attr[6] )
{
LPITEMGROUND i = FindItemList( item_id );
if( i == NULL ) return;
i->attr[1] = attr[1];
i->Anitype = (BYTE )attr[1];
connections.receive=1;
}
extern cHorseRider g_HorseRider; // LTS HORSERIDER
extern void SetDragonLordWarArmor(t_server_change_equip *p,LPCHARACTER ch); // LTS DRAGONLORD
void RecvChangeEquip( t_server_change_equip *p )
{
LPCHARACTER ch = ReturnCharacterPoint( p->server_id );
if( ch == NULL ) return;
#ifdef LIGHT_VERSION_
//021030 YGI------------------------
if( !ch->sprno ) // 咯磊
{
if( p->equip[AT_ARMOR])
{
if( ch->lv < 50 )
p->equip[AT_ARMOR] = 96;
else
p->equip[AT_ARMOR] = 31;
}
if( p->equip[AT_HELMET] )
p->equip[AT_HELMET] = 53;
}
else // 巢磊
{
if( p->equip[AT_ARMOR])
{
if( ch->lv < 50 )
p->equip[AT_ARMOR] = 96;
else
p->equip[AT_ARMOR] = 7;
}
if( p->equip[AT_HELMET] )
p->equip[AT_HELMET] = 44;
}
//--------------------------------
p->equip[AT_WEAPON] = g_pLightVersion->GetLightVersionWeapon( ch->sprno?1:0, p->equip[AT_WEAPON] );
p->equip[AT_SHIELD] = g_pLightVersion->GetLightVersionWeapon( ch->sprno?1:0, p->equip[AT_SHIELD] );
#else
if (g_FightMapStart)
{ //< CSD-TW-030618
CArenaTeam* pTeam = g_pArenaManager->GetMemberTeam(p->server_id);
if (pTeam != NULL)
{
const int nTeam = pTeam->GetTeamNumber();
p->equip[AT_ARMOR] = fight_map_acc_num[nTeam];
p->equip[AT_HELMET] = 1;
}
} //> CSD-TW-030618
if( ch->IsCounselor() ) // 霸烙郴 档快固
{
p->equip[AT_ARMOR] = 114; // 魂鸥渴阑 涝腮促.
p->equip[AT_HELMET] = 1; // 酒公巴档 救嘛阑锭
}
if (g_bWarBegin) SetWarArmor(p,ch); // 010904 LTS //傈里吝捞搁
if (g_LocalWarBegin) SetLocalWarArmor(p,ch); // LTS LOCALWAR
if (ch->DragonLordWarTeam>0) SetDragonLordWarArmor(p,ch); // LTS DRAGONLORD
#endif
if( ch->accessory[0] != p->equip[0] )
{
FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[0] );
FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[0]+1 );
// 011030 KHS JJING
FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[0]+200 );
FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[0]+201 );
}
//< soto-030314
#ifndef LIGHT_VERSION_
// 1殿牢 瘤虐固 辨靛老版快绰 辨靛渴阑 涝囚具隆~
if(g_CGuardianGuild.Is1StGuild(ch->GetGuildCode()) && !g_FightMapStart && !ch->JoinLocalWar && !(ch->DragonLordWarTeam > 0) && !isNationWarfieldServer())
{ //< CSD-030324
ch->accessory[0] = GUILD_WEAR01;
LoadHeroClothAccessoryDataOne( ch->sprno, GUILD_WEAR01 );
LoadHeroClothAccessoryDataOne( ch->sprno, GUILD_WEAR01+1);
} //> CSD-030324
else
#endif
{
ch->accessory[0] = p->equip[0];
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[0] );
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[0]+1);
}
// 011030 KHS JJING
ch->jjing = p->jjing;
if( p->jjing >= 5 )
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[0]+200);
if( p->jjing >= 9 )
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[0]+201);
#ifndef LIGHT_VERSION_
// 1殿牢 瘤虐固 辨靛老版快绰 辨靛渴阑 涝囚具隆~
if(g_CGuardianGuild.Is1StGuild(ch->GetGuildCode()) && !g_FightMapStart && !ch->JoinLocalWar && !(ch->DragonLordWarTeam > 0) && !isNationWarfieldServer())
{ //< CSD-030324
if( ch->accessory[1] != GUILD_WEAR01 )FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[1] );
ch->accessory[1] = GUILD_WEAR01;
LoadHeroClothAccessoryDataOne( ch->sprno, GUILD_WEAR01 );
} //> CSD-030324
else
#endif
{
if( ch->accessory[1] != p->equip[1] )FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[1] );
ch->accessory[1] = p->equip[1];
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[1] );
}
//> soto-030314
//< CSD-031001
if (ch->accessory[2] != p->equip[2])
{
FreeHeroClothAccessoryDataOne(ch->sprno, ch->accessory[2]);
}
ch->accessory[2] = p->equip[2];
const WORD idWeaponItem = p->idWeaponItem;
if (idWeaponItem/1000 == 6)
{ //< CSD-031101
CItem_Weapon* pWeapon = static_cast<CItem_Weapon*>(ItemUnit(idWeaponItem));
if (pWeapon != NULL)
{
const int nEffect = pWeapon->effect;
if (nEffect > 0)
{
LoadHeroClothAccessoryDataOne(ch->sprno, nEffect);
}
switch (ch->sprno)
{
case 0: LoadHeroClothAccessoryDataOne(ch->sprno, pWeapon->shape_woman); break;
case 1: LoadHeroClothAccessoryDataOne(ch->sprno, pWeapon->shape_man); break;
}
}
}
ch->idWeaponItem = idWeaponItem;
//> CSD-031001
if( ch->accessory[3] != p->equip[3] )FreeHeroClothAccessoryDataOne( ch->sprno, ch->accessory[3] );
ch->accessory[3] = p->equip[3];
LoadHeroClothAccessoryDataOne( ch->sprno, p->equip[3] );
#ifndef LIGHT_VERSION_
// 011018 KHS 噶肚
if( ch->mantle != p->mantle ) FreeHeroClothAccessoryDataOne( ch->sprno, GetItemAttr2( ch->sprno, ch->mantle, ITEMSHOW ) );
ch->mantle = p->mantle;
ch->mantlecolor = GetItemAttr( ch->mantle, ITEM_COLOR);
LoadHeroClothAccessoryDataOne( ch->sprno, GetItemAttr2( ch->sprno, p->mantle, ITEMSHOW ) );
ch->HorseNo=p->Horse[0]; // LTS HORSERIDER
ch->RiderNo=p->Horse[1]; // LTS HORSERIDER
ch->HorseGrade=p->Horse[2]; // LTS HORSERIDER
ch->RiderGrade=p->Horse[3]; // LTS HORSERIDER
g_HorseRider.LoadHorseData(ch); // LTS HORSERIDER
#endif
SettingBasicActionSub( ch );
if (p->ChairNum)
{
if (Hero == ch)
{ //< CSD-020311
SendModifyPosition(ch);
} //> CSD-020311
ch->nCurrentAction=17;
ch->nCurrentFrame=0;
ch->ChairNum=p->ChairNum;
if (ch==Hero) // LTS SITDOWN // 011214 LTS
{
AddCurrentStatusMessage( 255,255,0,lan->OutputMessage(0,342));
SetBattlePeace( PEACE_MODE );
}
}
else
{
ch->nCurrentAction=0;
ch->nCurrentFrame=0;
}
connections.receive=1;
}
void SendChangeEquip( LPCHARACTER ch )
{
t_packet p;
BYTE *equip = p.u.client_change_equip.equip;
int *acc = ch->accessory;
p.h.header.type = CMD_CHANGE_EQUIP;
{
equip[0]= acc[0];
equip[1]= acc[1];
equip[2]= acc[2];
equip[3]= acc[3];
}
p.h.header.size = sizeof( t_client_change_equip );
QueuePacket( &p, 1 );
// Animation minrange, maxrange, animation... ###0929
connections.receive=1;
}
extern void SetDragonLordWarArmor(t_server_user_add *c); // LTS DRAGONLORD
//-----------------------------------------------------------------------------
void RecvUserAdd( t_server_user_add *c )
{
GPCHARINFO gpCharInfo ={0,}; // 1014 YGI
LPCHARACTER ch = FindCharacter( &g_CharacterList, c->server_id );
if( ch != NULL )
{ //JustMsg( "乐绰单 肚吭绢..." );
DeleteCharacter( &g_CharacterList, ch );
}
if( c->spr_no > 1 ) gpCharInfo.type = SPRITETYPE_MONSTER;
else gpCharInfo.type = SPRITETYPE_CHARACTER;
gpCharInfo.id = c->server_id;
gpCharInfo.sprno = c->spr_no;
gpCharInfo.mutant = 0;
gpCharInfo.position.x = c->x * TILE_SIZE + 16;
gpCharInfo.position.y = c->y * TILE_SIZE + 16;
gpCharInfo.direction = (DIRECTION)(rand()%8);//
gpCharInfo.nCurrentAction = ACTION_NONE;
gpCharInfo.basicAction = ACTION_NONE;
gpCharInfo.basicWalk = ACTION_BASIC_WALK;
gpCharInfo.animationType = ANIMATION_TYPE_WOMAN;
switch( c->bAlive )
{
case 1 : gpCharInfo.hp = 1000; break; // ALIVE_
case 2 : gpCharInfo.hp = 0; break; // DEAD_
case 3 : gpCharInfo.hp = 0; break;
default :
_asm int 3;
Error( "Garbage Data.....Error Code : -5 " );
break;
}
// gpCharInfo.hp = c->hp;
gpCharInfo.mp = 100;
gpCharInfo.sp = 100;
gpCharInfo.hpmax = 100;
gpCharInfo.mpmax = 100;
gpCharInfo.spmax = 100;
gpCharInfo.spell = c->spell;
gpCharInfo.face = c->face;
gpCharInfo.sex = c->spr_no;
gpCharInfo.idWeaponItem = c->idWeaponItem; // CSD-031007
#ifdef LIGHT_VERSION_ // 021008 YGI
//021030 YGI
if( !c->spr_no ) // 咯磊
{
if( c->lv < 50 )
c->equip0 = 96;
else
c->equip0 = 31;
c->equip1 = 53;
}
else // 巢磊
{
if( c->lv < 50 )
c->equip0 = 96;
else
c->equip0 = 7;
c->equip1 = 44;
}
//-----------------------------
c->equip2 = g_pLightVersion->GetLightVersionWeapon( c->spr_no?1:0, c->equip2 );
c->equip3 = g_pLightVersion->GetLightVersionWeapon( c->spr_no?1:0, c->equip3 );
#else
if (g_FightMapStart)
{ //< CSD-TW-030618
if (Hero != NULL)
{
CArenaTeam* pTeam = g_pArenaManager->GetMemberTeam(c->server_id);
if (pTeam != NULL)
{
const int nTeam = pTeam->GetTeamNumber();
c->equip0 = fight_map_acc_num[nTeam];
c->equip1 = 1;
}
}
} //> CSD-TW-030618
if( c->counselor )
{
c->equip0 = 114;
c->equip1 = 1;
}
if (g_bWarBegin) SetWarArmor(c); // 010915 LTS
if (g_LocalWarBegin) SetLocalWarArmor(c); // LTS LOCALWAR
if (c->DragonLordWarTeam>0) SetDragonLordWarArmor(c); // LTS DRAGONLORD
#endif
gpCharInfo.accessory[0] = c->equip0;
if( c->equip0 != 0 )
{
//< soto-030313
#ifndef LIGHT_VERSION_
if(g_CGuardianGuild.Is1StGuild(c->guild_code)&& !g_FightMapStart && !c->JoinLocalWar && !(c->DragonLordWarTeam > 0) && !isNationWarfieldServer())
{
gpCharInfo.accessory[0] = GUILD_WEAR01;
LoadHeroClothAccessoryDataOne( c->spr_no, GUILD_WEAR01 );
LoadHeroClothAccessoryDataOne( c->spr_no, GUILD_WEAR01 +1); // 卖
}
else
#endif
{
LoadHeroClothAccessoryDataOne( c->spr_no, c->equip0 );
LoadHeroClothAccessoryDataOne( c->spr_no, c->equip0+1 );
}
}
#ifndef LIGHT_VERSION_
if(g_CGuardianGuild.Is1StGuild(c->guild_code)&& !g_FightMapStart && !c->JoinLocalWar && !(c->DragonLordWarTeam > 0) && !isNationWarfieldServer())
{
gpCharInfo.accessory[1] = GUILD_WEAR01;
LoadHeroClothAccessoryDataOne( c->spr_no, GUILD_WEAR01 );
}
else
#endif
{
gpCharInfo.accessory[1] = c->equip1;
LoadHeroClothAccessoryDataOne( c->spr_no, c->equip1 );
}
//> soto-030313
gpCharInfo.accessory[2] = c->equip2;
LoadHeroClothAccessoryDataOne( c->spr_no, c->equip2 );
gpCharInfo.accessory[3] = c->equip3;
LoadHeroClothAccessoryDataOne( c->spr_no, c->equip3 );
// 011018 KHS 噶肚
gpCharInfo.mantle = c->mantle;
LoadHeroClothAccessoryDataOne( c->spr_no, GetItemAttr2( c->spr_no, c->mantle, ITEMSHOW ) );
// 011030 KHS JJING
gpCharInfo.jjing = c->jjing;
if( c->jjing >= 5 ) LoadHeroClothAccessoryDataOne( c->spr_no, c->equip0+200);
if( c->jjing >= 9 ) LoadHeroClothAccessoryDataOne( c->spr_no, c->equip0+201);
gpCharInfo.bodyr = (BYTE )c->body_r << 3;
gpCharInfo.bodyg = (BYTE )c->body_g << 3;
gpCharInfo.bodyb = (BYTE )c->body_b << 3;
gpCharInfo.clothr = (BYTE )c->cloth_r << 3;
gpCharInfo.clothg = (BYTE )c->cloth_g << 3;
gpCharInfo.clothb = (BYTE )c->cloth_b << 3;
memcpy( gpCharInfo.name, c->name, c->namelen );
gpCharInfo.peacests = c->peacests;
gpCharInfo.viewtype = c->viewtype;
// 1004 YGI ----------------------------------------
gpCharInfo.name_status.nation = c->nation;
gpCharInfo.name_status.guild_master = c->guild_master;
gpCharInfo.name_status.king = c->king;
gpCharInfo.guild_code = c->guild_code; // CSD-030324
gpCharInfo.name_status.counselor = c->counselor;
gpCharInfo.name_status.reporter = c->reporter;
gpCharInfo.nk3 = c->nk3;
gpCharInfo.nk4 = c->nk4;
gpCharInfo.nk6 = c->nk6;
gpCharInfo.lv = c->lv; // 0807 YGI
gpCharInfo.class_type = c->class_type; // 0807 YGI
//_____________________________________________________ // 010904 LTS // 010915 LTS
gpCharInfo.NWCharacter.isCommander=c->isCommander; //惫啊傈 包访 菩哦
gpCharInfo.NWCharacter.isSquadLeader=c->isSquadLeader; // LTS CHAR
gpCharInfo.NWCharacter.SquadNo=c->SquadNo;
gpCharInfo.NWCharacter.YL_JoinNation=c->YL_JoinNation;
//_____________________________________________________ // 010904 LTS*/
gpCharInfo.JoinLocalWar = c->JoinLocalWar; // LTS LOCALWAR
gpCharInfo.ChairNum = c->ChairNum; // LTS SITDOWN BUG
gpCharInfo.HorseNo = c->HorseNo; // LTS HORSERIDER
gpCharInfo.RiderNo = c->RiderNo; // LTS HORSERIDER
gpCharInfo.HorseGrade = c->HorseGrade; // LTS HORSERIDER
gpCharInfo.RiderGrade = c->RiderGrade; // LTS HORSERIDER
gpCharInfo.DragonLordWarTeam = c->DragonLordWarTeam; // LTS DRAGONLORD
if (c->ChairNum) gpCharInfo.nCurrentAction=17;
gpCharInfo.nDualCls = c->nDualCls;
gpCharInfo.nClsStep = c->nClsStep;
gpCharInfo.nAttr = 0;
gpCharInfo.nRace = HUMAN; // CSD-030422
if ( !AddCharacter( &g_CharacterList, g_CharacterList.lpLast, &gpCharInfo ) )//?? soto
{
JustMsg( "Other User LogIn Error..." );
}
connections.receive=1;
}
//-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -