Program Mir2;
procedure P100;
begin
exit;
end;
procedure _CallMain;
var
iTime:integer;
Switch:string;
begin
if This_Player.GetS(110,1) < 1 then Switch := '关'
else Switch := '开';
if This_Player.GetS(111,1) < 1 then iTime := 0
else iTime := This_Player.GetS(111,1);
This_NPC.NpcDialog(This_Player,
'设置自动修复时间 <'+ inttostr(iTime) +'/@SetTime>^<['+Switch+']/@SetLoop>|'+
'{cmd}<关闭界面/@exit>');
end;
procedure LoopNow_2;
var
k:integer;
begin
if This_Player.GetS(110,1) > 0 then
begin
for k := 0 to 16 do
begin
This_Player.RepairBodyEquip(k);
end;
This_Player.PlayerNotice('自动修复成功',1);
This_Player.CallOutex(This_Npc, This_Player.GetS(111,1), 'LoopNow_1');
end
else
This_Player.PlayerNotice('自动修复已关闭',0);
exit;
end;
procedure LoopNow_1;
var
k:integer;
begin
if This_Player.GetS(110,1) > 0 then
begin
for k := 0 to 16 do
begin
This_Player.RepairBodyEquip(k);
end;
This_Player.PlayerNotice('自动修复成功',1);
This_Player.CallOutex(This_Npc, This_Player.GetS(111,1), 'LoopNow_2');
end
else
This_Player.PlayerNotice('自动修复已关闭',0);
exit;
end;
procedure _SetLoop;
begin
if This_Player.GetS(111,1) < 1 then
begin
This_NPC.InputDialog(This_Player,'请先设置自动修复时间',1,100);
exit;
end;
if This_Player.GetS(110,1) < 1 then
begin
This_Player.SetS(110,1,1);
This_Player.PlayerNotice('自动修复已开启',2);
This_Player.CallOutex(This_Npc, This_Player.GetS(111,1), 'LoopNow_1');
_CallMain;
end
else
This_Player.SetS(110,1,0);
_CallMain;
end;
procedure P101;
var
Inum:integer;
begin
Inum := StrToIntDef(This_NPC.InputStr,-1);
if (Inum > 0) and (Inum < 65535) then
begin
if This_Player.GetS(111,1) < 1 then
begin
This_Player.SetS(111,1,Inum);
_CallMain;
end;
end
else
This_NPC.InputDialog(This_Player,'请输入1-65535之间的数字',1,100);
exit;
end;
procedure _SetTime;
begin
This_NPC.InputDialog(This_Player,'请输入时间',0,101);
end;
begin
_CallMain;
end.