📄 cpcitem1.cpp
字号:
// cPcItem1.cpp: implementation of the cPcItem class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Wox2head.h"
#include "cPcItem1.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cPcItem::cPcItem()
{
def_item = new item_st;
}
cPcItem::~cPcItem()
{
delete def_item;
}
void cPcItem::Trashing(int s, int slot)
{
int slot = slots-1;
//07:0 1 0 1F 0 6 0 6 C FFFFFF8A FFFFFFC0 2 0 0 0
char temp2[256];
char temp3[256];
int encs = 0;
if(chr[Gs->acc[s]].ItemBag[slot][1] == 0)
{
Cw->SendMiniText(s,"酒捞袍捞 绝嚼聪促");
} else
{
//10:1 1 0 3 0
//1 1 0 3 0
CAct->Act(s,SITDOWN);
temp2[0] = slot%256+1;
temp2[1] = 1;
temp2[2] = 0;
temp2[3] = 3;
temp2[4] = 0;
//0 5 D3 95 4 0 32 0 0
//0 1 0 1F 0 6 0 6 C FFFFFF8A FFFFFFC0 2 0 0 0
temp3[0] = 0;
temp3[1] = 1;
temp3[2] = chr[Gs->acc[s]].backx>>8;
temp3[3] = (chr[Gs->acc[s]].backx%256);
temp3[4] = chr[Gs->acc[s]].backy>>8;
temp3[5] = (chr[Gs->acc[s]].backy%256);
//老访锅龋(酒捞袍竿啊柳芭)
temp3[6] = lit(item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial,1);
temp3[7] = lit(item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial,2);
temp3[8] = lit(item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial,3);
temp3[9] = lit(item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial,4);
temp3[10] = (0xC0+(item[chr[Gs->acc[s]].ItemBag[slot][0]].pict>>8))%256;
temp3[11] = item[chr[Gs->acc[s]].ItemBag[slot][0]].pict%256;
temp3[12] = 0;
temp3[13] = 0;
temp3[14] = 0;
memcpy((void *)&titem[item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial],(void *)&item[chr[Gs->acc[s]].ItemBag[slot][0]],sizeof(struct item_st));
if(!(m[mapnumber[chr[Gs->acc[s]].lastmap ] ][map[mapnumber[chr[Gs->acc[s]].lastmap]].map_y * chr[Gs->acc[s]].backy + chr[Gs->acc[s]].backx] == 0))
{
Cw->worldtrash++;
m[mapnumber[chr[Gs->acc[s]].lastmap ] ][map[mapnumber[chr[Gs->acc[s]].lastmap]].map_y * chr[Gs->acc[s]].backy + chr[Gs->acc[s]].backx] = (unsigned short)Cw->worldtrash;
}
int trss = m[mapnumber[chr[Gs->acc[s]].lastmap ] ][map[mapnumber[chr[Gs->acc[s]].lastmap]].map_y * chr[Gs->acc[s]].backy + chr[Gs->acc[s]].backx];
Cw->trashcount[trss]++;
Cw->trashes[trss][Cw->trashcount[trss]] = titem[item[chr[Gs->acc[s]].ItemBag[slot][0]].itemserial].itemserial;
int i =0;
for(i = 0;i < Gs->now;i++)
{
if(chr[Gs->acc[i]].lastmap == chr[Gs->acc[s]].lastmap)
{
if(Cw->inr(Gs->acc[i],Gs->acc[s]))
{
encs = Xc->Enc_Pack(i,temp,8,0x1A,3);
send(Gs->client[i],Encrypted_Messages[i],encs,0);
encs = Xc->Enc_Pack(i,temp3,15,0x07,3);
send(Gs->client[i],Encrypted_Messages[i],encs,0);
}
}
}
if((chr[Gs->acc[s]].ItemBag[slot][1] > 1) || (chr[Gs->acc[s]].ItemBag[slot][1] < 0))
{
chr[Gs->acc[s]].ItemBag[slot][1]--;
GetItem(s,slot);
} else
{
chr[Gs->acc[s]].ItemBag[slot][0] = 0;
chr[Gs->acc[s]].ItemBag[slot][1]--;
encs =Xc->Enc_Pack(s,temp2,5,0x10,3);
send(Gs->client[s],Encrypted_Messages[s],encs,0);
}
}
}
void cPcItem::PickUp(int s)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -