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

📄 datamanage.pas

📁 这是千年外挂的源代码
💻 PAS
字号:
unit datamanage;

interface

uses
  SysUtils,windows,               
  Dialogs, gamecode, packstruct;

//procedure collectgoods ( buf:pchar );      //单击拾取物品
procedure showdropgoods( buf:pchar );      //显示掉落物品
procedure eatmedication( buf:pchar );      //自动吃药  三功 元气 年龄显示
procedure gaingoods    ( buf:pchar );      //物品栏增删物品
procedure speak        ( buf:pchar );
procedure say          ( buf:pchar );      //发言显示
procedure zhanghaocon  ( buf:pchar );      //帐号连接
procedure queren       ( buf:pchar );      //发送确认
procedure zhitiao      ( buf:pchar );      //接收纸条信息
procedure happly       ( buf:pchar );      //显示大喊部分
procedure showmop      ( buf:pchar );      //显示怪物
procedure addwugong    ( buf:pchar );      //普通武功列表
procedure usegongfu    ( buf:pchar );      //使用得武功
procedure useitem      ( buf:pchar );       //使用物品 
procedure changemap    ( buf:pchar );       //地图改变信息
procedure attack       ( buf:pchar );       //NPC攻击状态
procedure npcdie       ( buf:pchar );       //npc死亡
procedure basicskill   ( buf:pchar );       //基本武功显示;
procedure twogest      ( buf:pchar );       //二层武功
procedure palmwind     ( buf:pchar );       //掌风栏;
procedure threegest    ( buf:pchar );       //三层武功
procedure tackattrib   ( buf:pchar );     //真气 浩然等属性
procedure disgoods     ( buf:pchar );      //地图物品消失
procedure techgoods    ( buf:pchar );       //技能框里得物品
procedure balk         ( buf:pchar );       //障碍
procedure balkdis      ( buf:pchar );       //障碍消失
procedure manstate     ( buf:pchar );       //人物状态?
procedure equip        ( buf:pchar );      //人物装备
procedure realgas      ( buf:pchar );      //人物真气值
procedure trademenu    ( buf:pchar );       //交易菜单里东西
procedure gestglass    ( buf:pchar );         //人物镜子
procedure selfxy       ( buf:pchar );      //战斗时人物移动的坐标
procedure monsterlife  ( buf:pchar );       //怪物的血值
procedure selfmovexy   ( buf:pchar );       //障碍回复
procedure ipreset      ( buf:pchar );        //IP重新设定
procedure gonggaolan   ( buf:pchar );        //公告栏
procedure makeskill    ( buf:pchar );         //技能类别

var numbertest:integer;
    goods1,goods2,goods3:string;goods31:string;goods31x,goods31y:string;
    queren1,renwu,zhitia,happly1:string; monstertw:string;
    monster:string;goods4,goods41:string; goods42:integer;goodsset:string;
    sendbuf1:string;gongfu:string;  gongfulevel:string;
    usegongfu1:string;item1:string;
    AGENOW,YUANQI,NEIGONG,WAIGONG,WUGONG,LIFE:STRING;
    mapdata:string; makex,makey:string;
    npcattack:string;personack:string;
    npcdie1:string; gongfu1:integer;
    basicskillnum:integer;basic1:string;basiclevel:string;
    twogestnum:integer; twogestskill:string; twogestlevel:string;
    palmwindnum:integer; palmwindskill:string;  palmwindlevel:string;
    threegestnum:integer; threegestskill:string; threegestlevel:string; haoran:integer;
    disgoods1:string; techgoodsnum:integer;techgoodsname:string;  techgoodslevel:string;
    balkname:string; balknum:string; balksite:string;//障碍标识
    balkdis1:string;
    equipnum:integer;
    equipdata:string;
    realgasnum:string;jinengzhi:integer;
    trademenustr:string;
    gestglassname:string;
    selfname:string;  selfx,selfy:integer;  //战斗时移动的坐标
    monstername:string;monster1:string; monsterlife1:string; //怪物的血值显示
    ipresetaddr:string;ipresetport:integer;
    makeskillstr:string;

implementation

procedure queren      ( buf:pchar );       //确认人物
begin
   queren1:='';
   queren1:=trim(getchars(chartoascii(@buf[15],200)));//string(@buf[15]);
   numbertest:=2;
end;

procedure zhanghaocon  ( buf:pchar );// 帐号连接信息
begin
   renwu:='';
   renwu:=trim(getchars(chartoascii(@buf[13],200)));//string(@buf[13]);
   numbertest:=3;
end;

procedure speak( buf:pchar );     //大喊
begin
   goods1:='';
   goods1:=trim(getchars(chartoascii(@buf[17],500)));//string(@buf[17]);
//   goods1:=copy(goods1,0,80);
   numbertest:=4;
end;

procedure eatmedication( buf:pchar );        //三功 年龄显示
begin
    numbertest:=5;
    agenow:='';yuanqi:='';neigong:='';waigong:='';wugong:='';life:='';
    AGENOW  :=inttostr(HexToInt(copy(chartoascii(@buf[0],2),3,2)+copy(chartoascii(@buf[0],2),1,2)));
    YUANQI  :=inttostr(HexToInt(copy(chartoascii(@buf[2],4),7,2)+copy(chartoascii(@buf[2],4),5,2)+copy(chartoascii(@buf[2],4),3,2)+copy(chartoascii(@buf[2],4),1,2)))+'/'+inttostr(HexaToDecimal(copy(chartoascii(@buf[6],4),7,2)+copy(chartoascii(@buf[6],4),5,2)+copy(chartoascii(@buf[6],4),3,2)+copy(chartoascii(@buf[6],4),1,2)));      //当前元气
    NEIGONG :=inttostr(HexToInt(copy(chartoascii(@buf[10],2),3,2)+copy(chartoascii(@buf[10],2),1,2)))+'/'+inttostr(HexaToDecimal(copy(chartoascii(@buf[12],2),3,2)+copy(chartoascii(@buf[12],2),1,2)));      //当前内功
    WAIGONG :=inttostr(HexToInt(copy(chartoascii(@buf[14],2),3,2)+copy(chartoascii(@buf[14],2),1,2)))+'/'+inttostr(HexaToDecimal(copy(chartoascii(@buf[16],2),3,2)+copy(chartoascii(@buf[16],2),1,2)));    //当前外功
    WUGONG  :=inttostr(HexToInt(copy(chartoascii(@buf[18],2),3,2)+copy(chartoascii(@buf[18],2),1,2)))+'/'+inttostr(HexaToDecimal(copy(chartoascii(@buf[20],2),3,2)+copy(chartoascii(@buf[20],2),1,2)));    //当前武功
    LIFE    :=inttostr(HexToInt(copy(chartoascii(@buf[22],2),3,2)+copy(chartoascii(@buf[22],2),1,2)))+'/'+inttostr(HexaToDecimal(copy(chartoascii(@buf[24],2),3,2)+copy(chartoascii(@buf[24],2),1,2)));   //当前活力
end;

procedure gaingoods ( buf:pchar );//物品栏增删物品
var numstr:string;
begin
  numbertest:=6;
  goods4:='';
  goods41:='';
// goods42:='';
  goods42:=HexToInt(chartoascii(@buf[11],1));
  if ord(buf[12]) <> $00 then                   //因为物品栏里物品移动时会发两个包.去掉一个
  begin
  goods4 :=chartoascii(@buf[12],18);
  goods4 :=getchars(goods4);
  goods4:=trim(goods4);
 // goods4 :=inttostr(goods42)+':'+goods4;
  goods41:=chartoascii(@buf[31],4);
  numstr:=copy(goods41,7,2)+copy(goods41,5,2)+copy(goods41,3,2)+copy(goods41,1,2);
  goods41:=inttostr(HexToInt(numstr));
  end;
end;

procedure addwugong  ( buf:pchar );       //武功栏显示
var gongfu2:string;
begin
   numbertest:=7;
   gongfu:='';
   gongfu:=getchars(chartoascii(@buf[14],18));                                    //string(@buf[14]);
   gongfu:=trim(gongfu);
   gongfu2:=chartoascii(@buf[11],1);
   gongfu1:=HexaToDecimal(gongfu2);
   gongfulevel:=chartoascii(@buf[33],2);
   gongfulevel:=inttostr(HexToInt(copy(gongfulevel,3,2)+copy(gongfulevel,1,2)));
  // gongfu:=inttostr(gongfu1)+':'+gongfu+':'+gongfulevel;
end;

procedure equip        ( buf:pchar );         //zhuangbei ?
begin
    numbertest:=8;
    equipnum:=HexToInt(chartoascii(@buf[11],1));
    equipdata:=trim(getchars(chartoascii(@buf[11],18)));
end;


procedure changemap    ( buf:pchar );//地图变换
var makexy1:string;
begin
//   mapdata:='';
//  makex:='';
//   makey:='';
   mapdata:=getchars(chartoascii(@buf[11],20));
   makexy1:=chartoascii(@buf[53],4);
   makex:=inttostr(HexToInt(copy(makexy1,3,2)+copy(makexy1,1,2)));
   makey:=inttostr(HexToInt(copy(makexy1,7,2)+copy(makexy1,5,2)));
   numbertest:=9;
end;

procedure showmop  ( buf:pchar );        //显示怪物

begin
//   monster:='';
   monster:=getchars(chartoascii(@buf[74],26));//string(@buf[74]);
   monster:=trim(monster);
   monstertw:=trim(getchars(chartoascii(@buf[15],20)));
   monster1:=chartoascii(@buf[11],4);
 //  monster:=monster+':'+monster1;
   numbertest:=10;
end;

procedure npcdie  ( buf:pchar );        //怪物死亡
begin
//   npcdie1:='';
   npcdie1:=chartoascii(@buf[11],4);
   numbertest:=11;
end;

procedure say( buf:pchar );            //说话
begin
//   goods2:='';
   goods2:=trim(getchars(chartoascii(@buf[18],500)));  //string(@buf[18]);
   numbertest:=12;
end;

//战斗时人物移动产生的坐标
procedure selfxy       ( buf:pchar );
var selftest:string;
begin
  numbertest:=15;
    selfname:=chartoascii(@buf[11],4);
    selftest:=chartoascii(@buf[17],4);
       selfx:=HexToInt(copy(selftest,3,2)+copy(selftest,1,2));
       selfy:=HexToInt(copy(selftest,7,2)+copy(selftest,5,2));
end;

//人物遇到障碍弹回得坐标
procedure selfmovexy   ( buf:pchar );
var selftest:string;
begin
  numbertest:=16;
    selftest:=chartoascii(@buf[17],4);
       selfx:=HexToInt(copy(selftest,3,2)+copy(selftest,1,2));
       selfy:=HexToInt(copy(selftest,7,2)+copy(selftest,5,2));
end;

procedure manstate      ( buf:pchar );
begin
  numbertest:=18;
//   人物状态处理 暂无数据
end;

procedure attack  ( buf:pchar );     //Npc攻击状态;
begin
//   npcattack:='';

  if ord(buf[15])=$1F    then
     begin
      npcattack:=chartoascii(@buf[11],4);//+'MONSTER攻击中';
      numbertest:=22;
     end;  
 // if ord(buf[15])=$21   then
 //     npcattack:=chartoascii(@buf[11],4)+'人物攻击中';
end;

procedure tackattrib  ( buf:pchar );                 //人物附加属性 如浩然等   技能值
begin
     numbertest:=23;
      jinengzhi:=HexToInt(copy(chartoascii(@buf[17],2),3,2)+copy(chartoascii(@buf[17],2),1,2));  //技能值
         haoran:=HexToInt(copy(chartoascii(@buf[31],2),3,2)+copy(chartoascii(@buf[31],2),1,2)); //浩然值
end;

procedure monsterlife  ( buf:pchar );
var monsterfangxiang:string;
begin
   numbertest:=27;
  monstername:=chartoascii(@buf[11],4);
  monsterfangxiang:=chartoascii(@buf[15],1);
  monsterlife1:=inttostr(HexToInt(chartoascii(@buf[16],1)));
end;

procedure showdropgoods ( buf:pchar );        //显示掉落物品
begin
//   goods3:='';
   goods3:=getchars(chartoascii(@buf[15],18)); //string(@buf[15]);
   goods3:=trim(goods3);
   goods31:= chartoascii(@buf[11],4);
   goods31x:=inttostr(HexToInt(copy(chartoascii(@buf[34],2),3,2)+copy(chartoascii(@buf[34],2),1,2)));
   goods31y:=inttostr(HexToInt(copy(chartoascii(@buf[36],2),3,2)+copy(chartoascii(@buf[36],2),1,2)));
   goodsset:=chartoascii(@buf[40],2);
   numbertest:=28;
end;


procedure disgoods     ( buf:pchar );//物品消失
begin
//    disgoods1:='';
   numbertest:=30;
    disgoods1:=chartoascii(@buf[11],4);
end;

procedure usegongfu  ( buf:pchar );                 //使用得武功
begin
   numbertest:=32;
//   usegongfu1:='';
   usegongfu1:=trim(getchars(chartoascii(@buf[13],200)));//string(@buf[13]);
end;

procedure basicskill  ( buf:pchar );          //基础武功
var gongfu2:string;
begin
   numbertest:=34;
//   basic1:='';
   basicskillnum:=0;
   basic1:=getchars(chartoascii(@buf[14],18));
   basic1:=trim(basic1);
   gongfu2:=chartoascii(@buf[11],1);
   basicskillnum:=HexToInt(gongfu2);
   basiclevel:=chartoascii(@buf[33],2);
   basiclevel:=inttostr(HexToInt(copy(basiclevel,3,2)+copy(basiclevel,1,2)));
 //  basic1:=inttostr(basicskillnum)+':'+basic1+':'+gongfulevel;
end;

procedure balk  ( buf:pchar );          //障碍
begin
   numbertest:=47;
   balknum :=chartoascii(@buf[11],4);
   balkname:=trim(getchars(chartoascii(@buf[15],18)));
   balksite:=inttostr(HexToInt(copy(chartoascii(@buf[34],2),3,2)+copy(chartoascii(@buf[34],2),1,2)))+':'+inttostr(HexaToDecimal(copy(chartoascii(@buf[36],2),3,2)+copy(chartoascii(@buf[36],2),1,2)))

end;

procedure balkdis     ( buf:pchar );//物品消失
begin
 //   balkdis1:='';
  numbertest:=48;
    balkdis1:=chartoascii(@buf[11],4);
end;

procedure gonggaolan   ( buf:pchar );
begin
  numbertest:=50
end;

procedure happly  ( buf:pchar );      //公告类
begin
  // zhitia:=copy(string(@buf[11]),1,17);
 //   happly1:='';
    happly1:=trim(getchars(chartoascii(@buf[15],500)));//string(@buf[15]);
 numbertest:=54;
end;

procedure twogest  ( buf:pchar );             //2层

begin
  numbertest:=61;
  twogestnum:=HexToInt(chartoascii(@buf[11],1));       //2层得位置
twogestskill:=trim(getchars(chartoascii(@buf[14],18)));     //2层武功名字;
twogestlevel:=chartoascii(@buf[33],2);
twogestlevel:=inttostr(HexToInt(copy(twogestlevel,3,2)+copy(twogestlevel,1,2)));//2层武功级别
//twogestskill:=inttostr(twogestnum)+':'+twogestskill+':'+twogestlevel;
end;

procedure gestglass    ( buf:pchar );
begin
   numbertest:=62;
   gestglassname:=trim(getchars(chartoascii(@buf[11],8)));

end;
//交易菜单
procedure trademenu  ( buf:pchar );
begin
     numbertest:=67;
   trademenustr:=trim(getchars(chartoascii(@buf[17],500)));
end;

//技能类别
procedure makeskill  ( buf:pchar );
begin
    numbertest:=68;
  makeskillstr:=trim(getchars(chartoascii(@buf[12],8)));
end;
procedure techgoods  ( buf:pchar ); //技能里物品
begin
    numbertest:=70;
  techgoodsnum:=HexToInt(chartoascii(@buf[11],1));
 techgoodsname:=trim(getchars(chartoascii(@buf[12],18)));
 techgoodslevel:=inttostr(HexToInt(copy(chartoascii(@buf[31],4),7,2)+copy(chartoascii(@buf[31],4),5,2)+copy(chartoascii(@buf[31],4),3,2)+copy(chartoascii(@buf[31],4),1,2)));

end;


procedure palmwind  ( buf:pchar );               //掌风s

begin
     numbertest:=76;
    palmwindnum:=HexToInt(chartoascii(@buf[11],1));       //掌风得位置
  palmwindskill:=trim(getchars(chartoascii(@buf[14],18)));     //掌风武功名字;
  palmwindlevel:=chartoascii(@buf[33],2);
  palmwindlevel:=inttostr(HexToInt(copy(palmwindlevel,3,2)+copy(palmwindlevel,1,2)));//掌风武功级别
//  palmwindskill:=inttostr(palmwindnum)+':'+palmwindskill+':'+palmwindlevel;
end;

procedure zhitiao  ( buf:pchar );                           //纸条
begin
//   zhitia:='';
  // zhitia:=copy(string(@buf[11]),1,17);
   zhitia:=trim(getchars(chartoascii(@buf[32],500)));//string(@buf[32]);
   numbertest:=83;
end;

procedure useitem  ( buf:pchar );               //使用了某物品
begin
   numbertest:=84;
   item1:=trim(getchars(chartoascii(@buf[13],100)));//string(@buf[13]);
end;

procedure threegest  ( buf:pchar );               //三层

begin
      numbertest:=86;
    threegestnum:=HexToInt(chartoascii(@buf[11],1));       //3层得位置
  threegestskill:=trim(getchars(chartoascii(@buf[14],18)));     //3层武功名字;
  threegestlevel:=chartoascii(@buf[33],2);
  threegestlevel:=inttostr(HexToInt(copy(threegestlevel,3,2)+copy(threegestlevel,1,2)));//3层武功级别
//  threegestskill:=inttostr(threegestnum)+':'+threegestskill+':'+threegestlevel;
end;

procedure realgas   ( buf:pchar );
begin
  numbertest:=87;
  realgasnum:=inttostr(HexToInt(copy(chartoascii(@buf[15],2),3,2)+copy(chartoascii(@buf[15],2),1,2))) ;

end;

procedure ipreset  ( buf:pchar );
begin
  numbertest:=253;
  ipresetaddr:=trim(getchars(chartoascii(@buf[11],15)));
  ipresetport:=HexToInt(copy(chartoascii(@buf[30],2),3,2)+copy(chartoascii(@buf[30],2),1,2))
end;

end.

⌨️ 快捷键说明

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