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

📄 dispack.pas

📁 网络游戏神迹脱机外挂PASCAL源码
💻 PAS
字号:
unit DisPack;
{---------无影开发小组敬告:-------------------}
{        外挂研究无罪,开放源码有理!           }
{ 希望以此献给各位想研究外挂的朋友一窥外挂之容 }
{    本代码只供研究之用,不得用于非法用途      }
interface
uses Windows,Dialogs,Sysutils,GameCode,SendPack,WorkThread,
     PackStruct,UnitState,LoopAttack,wgFace,Move;

var
GameWindow:HWND;//游戏窗口句柄

procedure DisPacketRecv(buf:PChar;Len:Integer);
procedure DisPacketSend(buf:PChar;Len:Integer);
procedure SendPriMessage(PlayerName:String);

implementation
procedure DisPacketSend(buf:PChar;Len:Integer);
var
WCmd:string;
TLen:Integer;
Text:array[0..5000] of char;
//PB:^PackHeaderB;
begin
WCmd:='0000';
TLen:=DecodeA(@buf[2],@Text[0],Len-2);
WCmd:=StrToASCII(@Text[4],2);

if WCmd='EE03' then       //使用物品
  DisItmUsePack(@Text[0]);

if WCmd='E803' then        //丢弃物品
  DisItmUsePack(@Text[0]);
//DBGOut('WCmd=%s',[WCmd]);
end;

procedure DisPacketRecv(buf:PChar;Len:Integer);
var
WCmd:string;
TLen:Integer;
Text:array[0..5000] of char;
Data:array[0..5000] of char;//Char*中的内容;
name:string;
begin
WCmd:='0000';
if buf[0]='#' then
  begin
  TLen:=DecodeA(@buf[1],@Text[0],Len-1);
  WCmd:=StrToASCII(@Text[4],2);
  CopyChar(@Data[0],@Text[12],Tlen-12);
  end;

if buf[1]='+' then
  DisGorFPack(@buf[0],CharPos.X,CharPos.Y);

if WCmd='0E00' then //怪物攻击时候做出的反应
  if PopForm.CBAutoAtk.Checked=true then
    if (LADisPack1(@Text)=1) then
      begin
      MoveStop;
      SetTFlag(2);
      end;

if WCmd='2200' then //怪物死亡时候做出的反应
  if LADisPack2(@Text)=1 then
     begin
     StopAtk;
     TagMstId:=0;
       if PopForm.CBGoRound.Checked=true then
         begin
         PatrolLast:=true;
         SetTFlag(3);
         DBGOut('Go no Patrol',[]);
         end;
     end;

if WCmd='C900' then  //登陆时候物品解析
  DisItemPack(@Text[0]);

if WCmd='3500' then
  begin
  DisHpMpPack(@Text[0]);//hp,mp确定
  if PopForm.CBAutoAddMp.Checked=true then
    begin
    if CharMp<MpMinAdd then
    //UseItem(MpAddPotion);
    PressKey($32,GameWindow);
    end;
  end;

if WCmd='3300' then  //登陆时候人物位置和id解析
  DisLngPosPack(@Text[0]);

if WCmd='3500' then
  DisHpMpPack(@Text[0]);

if WCmd='0B00' then  //怪物移动时候的包
  begin
  MovDisPack(@Text[0]);
  end;

if WCmd='1F00' then   //人物掉血包
  if PopForm.CBAutoAddHp.Checked=true then
    begin
    DisHpDownPack(@Text[0]);
    if CharHp<HpMinAdd  then
    //UseItem(HpAddPotion);
      PressKey($31,GameWindow);
    end;

if WCmd='C800' then   //取得物品包
   DisItmGetPack(@Text[0]);

if WCmd='0A00' then  //怪物出现包
   DisMstAprPack(@Text[0]);

if WCmd='1E00' then  //怪物消失包
   DisMstDspPack(@Text[0]);
//DBGOut('WCmd=%s',[WCmd]);

if (WCmd='2800') and wgFace.PopForm.Check82.Checked then  //公众聊天信息包
  wgFace.PopForm.ChatHistory.Lines.Add(Data);
if (WCmd='6700') then //私聊包到达
  begin
  if wgFace.PopForm.Check80.Checked then //记录私聊信息
    wgFace.PopForm.ChatHistory.Lines.Add(Data);
  if wgFace.PopForm.Check65.Checked then  //自动回复私聊
    begin
    name:=DisPriChatPack(Text);
    //DBGOut(name,[]);
    SendPriMessage(name);
    end;
  end;
if (WCmd='6400') and wgFace.PopForm.Check81.Checked then  //喊话屏道
  wgFace.PopForm.ChatHistory.Lines.Add(Data);
end;


procedure SendPriMessage(PlayerName:String);
var
  PAutoReply:TChatPack;
  Str:string;
begin
DBGOut('处理聊天内容数据',[]);
    PAutoReply.Header.dwFlag:=0;
    PAutoReply.Header.wcmd:=$0BD6;
    PAutoReply.Header.w1:=0;
    PAutoReply.Header.w2:=0;
    PAutoReply.Header.w3:=0;
    Str:='/'+PlayerName+' '+wgFace.PopForm.eAutoReply.Text;//自动回复的内容
    //DBGOut(Str,[]);
    CopyChar(PAutoReply.ChatData,@Str[1],length(Str));
    SendMyPack(PChar(@PAutoReply),length(Str)+12);//发送聊天信息包
end;
end.

⌨️ 快捷键说明

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