⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datamanage.pas

📁 千年2的脱机源代码
💻 PAS
字号:
unit DataManage;

interface

uses  SysUtils, Windows;

procedure GameSetting();
procedure CollectGoods(buf: pchar);     //单击拾取物品
procedure ShowDropGoods(buf: pchar);    //显示掉落物品
procedure MyAttribute(buf: pchar);      //人物信息(如元所.内.外.武功..)
procedure DropGoodsDisappear(buf: pchar);//地图物品消失
procedure EatMedication();    //吃药
procedure GainGoods(buf: pchar);        //物品栏增删物品

implementation

uses GameCode, DllForm, PackStruct, GamePacket;

procedure CollectGoods(buf:Pchar);         //单击拾取物品
var
    packetC : ^TpacketC;
    SendPack : TpacketA;
begin
packetC := @buf[10];

SendPack.header.size := $17;
SendPack.header.num  := 0;
SendPack.header.Reserved := 0;
SendPack.header.len  := $0D;
SendPack.ctrl := $14;
SendPack.panel:= $03;
SendPack.id   := packetC.id;
SendPack.place:= $06;
SendPack.x    := packetC.x;
SendPack.y    := packetC.y;
SendPack.Reserved := 0;

SendMsg(@SendPack, sizeof(SendPack));
end;            

procedure ShowDropGoods(buf: Pchar);        //显示掉落物品
var
    packetC : ^TpacketC;
begin
packetC := @buf[10];
DllForm1.memoDrop.Lines.Add(string(packetC.name));
end;

procedure DropGoodsDisappear(buf: pchar);//地图物品消失
begin

end;

procedure GainGoods(buf: pchar);    //物品栏增删物品
var
    packetD : ^TpacketD;
    temp : string;
begin
packetD := @buf[10];
temp := IntToStr(packetD.place) + ':' + string(packetD.name);
temp := temp + ':' + IntToStr(packetD.num);
DllForm1.memoGain.Lines.Add(temp);
end;

procedure MyAttribute(buf: pchar);      //人物信息(如元所.内.外.武功..)
begin
CopyMemory(@myInfor, @buf[10], sizeof(TpacketB));
end;

procedure EatMedication();        //吃药     双击药品
var
    packetB : ^TpacketB;
    SendPack : TpacketA;
    Medication : word;

begin
packetB := @myInfor;

if packetB.huolNow <= StrToInt(DllForm1.EditHuo.Text) then   //活力
    Medication := HuoLMedication
else
if packetB.neigNow <= StrToInt(DllForm1.EditNei.Text) then   //内功
    Medication := NeiGMedication
else
if packetB.waigNow <= StrToInt(DllForm1.EditWai.Text) then   //外功
    Medication := WaiGMedication
else
if packetB.wugNow <= StrToInt(DllForm1.EditWu.Text) then    //武功
    Medication := WuGMedication
else
if packetB.yuanqNow <= StrToInt(DllForm1.EditYuan.Text) then  //元气
    Medication := YuanQMedication
else
    exit;

SendPack.header.size := $17;
SendPack.header.num  := 0;
SendPack.header.Reserved := 0;
SendPack.header.len  := $0D;
SendPack.ctrl := $15;
SendPack.panel:= $01;
SendPack.id   := 0;
SendPack.place:= Medication;
SendPack.x    := 0;
SendPack.y    := 0;
SendPack.Reserved := 0;

SendMsg(@SendPack, sizeof(SendPack));
end;

procedure GameSetting();
begin

end;        

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -