NPC~脱机验证 传奇
超凡 2020-7-5

{

 let 战神引擎全系列课程, QQ群:*********** 

    beiZhu: 

}  

program mir2;

function printStr(Pstr:string;Pid:integer):string;

var  len, arrlen, index, temp_len, temp_index, i : integer;

str, temp_str : string;

strArr : array[1..100] of string;

begin

str := Pstr;

len := length(str);

index:=1;

for i:=1 to 100 do

begin

temp_str:= copy(str,index,len);

temp_len := length(temp_str);

temp_index := pos(',',temp_str);

if temp_index = 0 then

begin

strArr[i] := copy(temp_str,0,temp_len); 

arrlen:=i; break;

end 

else

strArr[i] := copy(temp_str,0,temp_index-1);

index := index + temp_index;

end

result:=strArr[Pid];

end;

procedure huishouDia;

var i, temp_px, temp_py, px, py, scolor : integer; temp_str, show_str:string; code : Boolean;

begin

if This_Player.GetV(17,26) >= 10 then

begin

This_Npc.NpcDialog(This_Player,'对不起,你错误次数达到10次,无法使用此功能');exit;

end

px:=This_Player.My_x;

py:=This_Player.My_y;

code:=false;

for i:=1 to 4 do

begin

scolor:=255;

if i = 1 then

temp_str:='A';

if i = 2 then

temp_str:='B';

if i = 3 then

temp_str:='C';

if i = 4 then

temp_str:='D';

temp_px:=random(500)+100;

temp_py:=random(500)+100;

if random(3) = 0 then

begin

if not(code) then 

begin

temp_px:=px;

temp_py:=py;

scolor:=222;

code:=true;

end

end

if i = 4 then

begin

if not(code) then 

begin

temp_px:=px;

temp_py:=py;

scolor:=222;

code:=true;

end

end

show_str:=show_str+'|<'+temp_str+'/fcolor='+inttostr(scolor)+'>:  <'+inttostr(temp_px)+' , '+inttostr(temp_py)+' /fcolor='+inttostr(scolor)+'>                                     <选择答案 '+temp_str+'/@huishouYz~'+inttostr(px)+','+inttostr(py)+','+inttostr(temp_px)+','+inttostr(temp_py)+'>';

show_str:=show_str+'|';

end

This_Npc.NpcDialog(This_Player,

'当前是啥 次数   qing shibai cishu '+inttostr(This_Player.GetV(17,26))+' chao guo 10 ci zuolao'+

'|你当前所在的坐标 '+inttostr(px)+' ,'+inttostr(py)+' 请选择<绿色答案/fcolor=222>|'+

show_str

);

end;

procedure _huishouYz(pstr:string);

var px , py , temp_px, temp_py : integer;

begin

px:=strtoint(printStr(pstr,1));

py:=strtoint(printStr(pstr,2));

temp_px:=strtoint(printStr(pstr,3));

temp_py:=strtoint(printStr(pstr,4));

if (px = temp_px) and (py = temp_py) then

begin

This_Npc.NpcDialog(This_Player,'验证成功,这里开始调用NPC功能');

//domain;

end

else

begin

This_Player.SetV(17,26,This_Player.GetV(17,26)+1);

if This_Player.GetV(17,26) >= 10 then

begin

This_Npc.NpcDialog(This_Player,'你已经累计失败10次~在这里要把你关进小黑屋了咯~');

//This_Player.RandomFlyTo('SD001');

//This_Player.PlayerNotice('shibaichaoguo10ci',2);

end

else

begin

This_Npc.NpcDialog(This_Player,'验证失败 shibai ci shu + 1');

end

end

end;

Begin

if This_Player.GetV(17,26) = -1 then

This_Player.SetV(17,26,0);

huishouDia; 

end.


最新回复 (1)
返回