战神引擎自动回收脚本
超凡 2021-12-9

{-------------------------------------------------------
此脚本由【烈阳】编写,定制特色脚本请联系作者
请尊重每一个创作者,此条勿删,谢谢!
--------------------------------------------------------}
PROGRAM Mir2;
Const RECSEC = 50000;         //自动回收时间间隔,目前设置的2秒一次
Const CHGNEEDYB = 0;    //更换模式所需元宝数量
Const ONNEEDYB = 0;    //开启回收所需元宝数量
Const WQPRICE = 1;        //武器衣服倍率
procedure _Exit;
begin
  This_Npc.CloseDialog(This_Player);
end;
function EquipType(eqid:integer):String;
begin
    case eqid of
	1 : result := '绿色项链,骑士手镯,力量戒指,恶魔铃铛,龙之手镯,紫碧螺,灵魂项链,三眼手镯,泰坦戒指,黑铁头盔,裁决之杖,骨玉权杖,龙纹剑';
	2 : result := '圣战头盔,圣战手镯,圣战戒指,圣战项链,法神头盔,法神手镯,法神戒指,法神项链,天尊头盔,天尊手镯,天尊戒指,天尊项链';
	3 : result := '雷霆项链,雷霆护腕,雷霆战戒,烈焰项链,烈焰护腕,烈焰魔戒,光芒项链,光芒护腕,光芒道戒,圣龙盔,天龙盔,魔龙盔,雷霆战靴,烈焰魔靴,光芒道靴,雷霆腰带,烈焰腰带,光芒腰带,光芒道盔,烈焰魔盔,雷霆战盔';
	4 : result := '蒙面43号,蒙面44号,蒙面45号,强化雷霆项链,强化雷霆护腕,强化雷霆战戒,强化光芒项链,强化光芒护腕,强化光芒道戒,强化烈焰项链,强化烈焰护腕,强化烈焰魔戒,强化烈焰魔靴,强化烈焰腰带,强化光芒道靴,强化光芒腰带,强化雷霆战靴,强化雷霆腰带,强化光芒道盔,强化烈焰魔盔,强化雷霆战盔';
	5 : result := '真魂腰带,真魂道靴,圣魔腰带,圣魔魔靴,战神腰带,战神战靴,黄金头盔,战神项链,战神手镯,战神戒指,圣魔项链,圣魔手镯,圣魔戒指,真魂项链,真魂手镯,真魂戒指,预言头盔(战),预言头盔(法),预言头盔(道),誓言腰带(法),誓言腰带(道),誓言腰带(战),传说魔靴(法),传说魔靴(道),传说魔靴(战),雷霆战甲(男),雷霆战甲(女),烈焰魔衣(男),烈焰魔衣(女),光芒道袍(男),光芒道袍(女)';
	6 : result := '龙牙,怒斩,逍遥扇,天魔神甲,法神披风,天尊道袍,圣战宝甲,霓裳羽衣,天师长袍';	
	7 : result := '霸者之刃,嗜魂法杖,屠龙,雷霆战甲(男),雷霆战甲(女),烈焰魔衣(男),烈焰魔衣(女),光芒道袍(男),光芒道袍(女)';
	8 : result := '黄金屠龙,紫金嗜魂法杖,赤金逍遥扇';	
	9 : result := '开天,镇天,玄天,凤天魔甲,凰天魔衣';
	end;
end;
function getZYBNum(Zlv : integer) : integer;
begin
    case Zlv of
        1 : result := 2;
        2 : result := 10;
        3 : result := 30;
        4 : result := 100;  
        5 : result := 150;  		
        6 : result := 50; 
        7 : result := 200;
        8 : result := 3000;  
        9 : result := 5000; 	   
    end;
end;
   
   
 
   
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 domain;
var u,w,today:Integer;
recstr:array[1..80] of string;
itemstr:array[1..80] of string;
begin
     for u := 1 to 80 do
	 begin
	 if This_Player.GetS(46,u) < 1 then
	 begin
	 recstr[u]:='<[关闭]/fcolor=248>';
	 end else
	 recstr[u]:='<[开启]/fcolor=250>';
end;
     for w := 1 to 80 do
	 begin
	 if This_Player.GetS(47,w) < 1 then
	 begin
	 This_Player.SetS(47,w,0);
	 itemstr[w]:='[元宝]';
	 end;
	 if This_Player.GetS(47,w) = 1 then
	 begin
	 itemstr[w]:='[元宝]';
	 end;
	 if This_Player.GetS(47,w) = 2 then
	 begin
	 itemstr[w]:='[金刚石]';
	 end;
end;
     This_Npc.NpcDialog(This_Player,
   '自动回收<每10秒>回收1次背包内物品|'+   
   '<重要提示><首次使用务必点击此处,否则后果自负!/@funchg~6>|'+    
   '<装备名字   回收模式      当前状态      调整状态/fcolor=242>||'+
   '祖玛系列^<'+itemstr[1]+'>^'+recstr[1]+'^<[开关]/@funcon~1>|'+     
   '赤月装备^<'+itemstr[2]+'>^'+recstr[2]+'^<[开关]/@funcon~2>|'+
   '雷霆系列^<'+itemstr[3]+'>^'+recstr[3]+'^<[开关]/@funcon~3>|'+   
   '强化系列^<'+itemstr[4]+'>^'+recstr[4]+'^<[开关]/@funcon~4>|'+
   '战神系列^<'+itemstr[5]+'>^'+recstr[5]+'^<[开关]/@funcon~5>|'+ 
   '天魔怒斩^<'+itemstr[6]+'>^'+recstr[6]+'^<[开关]/@funcon~6>|'+    
   '42级剑甲^<'+itemstr[7]+'>^'+recstr[7]+'^<[开关]/@funcon~7>|'+  
   '黄金武器^<'+itemstr[8]+'>^'+recstr[8]+'^<[开关]/@funcon~8>|'+     
   '凤天开天^<'+itemstr[9]+'>^'+recstr[9]+'^<[开关]/@funcon~9>|'+        
   '<注意:小退或进入泡点地图后需重新开启开关/c=250>|' 
 );
  // end else
 //          This_Npc.NpcDialog(This_Player,
  //       '|自动回收功能<每日收费100龙城币,0点重置>,开启后就可以无忧无虑的挂机咯,并且回收奖励<是手动的双倍>哦!\'+
//		 '|{cmd}<我要开启/@kq> \'
//		 );
end;
procedure _funcon(onstr:string);
var onnum:integer;
begin
     onnum := StrToIntDef(onstr,0);
		   if This_Player.GetS(46,onnum) < 1 then
			  begin
			     This_Player.SetS(46,onnum,1);
		//		     This_Player.ScriptRequestSubYBNum(ONNEEDYB);
				         This_Player.PlayerNotice('开启成功。',2);
			                 domain; 
							 This_Player.SetS(120,1,1);
							 This_Player.SetS(112,1,30);
							 This_Player.CallOutex(This_Npc, This_Player.GetS(112,1), 'LoopNow_11');
	                end else 
					begin
		       This_Player.SetS(46,onnum,0);
	      This_Player.PlayerNotice('关闭成功。',2);
		  This_Player.SetS(120,1,0);
		  This_Player.SetS(112,1,0);
	 domain;
 end;
 
end;
procedure _funchg(chgstr:string);
var chgnum:integer;
begin
     chgnum := StrToIntDef(chgstr,0);
	 if This_Player.YBNum >= CHGNEEDYB then
        begin
		   if This_Player.GetS(47,chgnum) < 2 then
			  begin
			     This_Player.SetS(47,chgnum,1);
				  //   This_Player.ScriptRequestSubYBNum(CHGNEEDYB);
				  This_Player.PlayerNotice('您可以正常使用自动回收功能了,祝您游戏愉快!',2);
			      domain;
	end else begin
	    This_Player.SetS(47,chgnum,0);
	          This_Player.ScriptRequestSubYBNum(CHGNEEDYB);
         This_Player.PlayerNotice('更换成功!',2);
   domain;
end;
   end else begin
   This_Player.PlayerNotice('当前装备已开启自动回收!',0);
   end;
end;
 
procedure LoopNow_22;
var k:integer;
var rd,wd,kd,itemNum,itemtype:Integer;itemname,tempname : string;
begin
    if This_Player.GetS(120,1) > 0 then
	begin
        for k := 0 to 16 do
		begin
            This_Player.RepairBodyEquip(k);
		end;
		     rd:=0;wd:=0;kd:=0;itemNum:=0;itemtype:=0;itemname:='';tempname:='';
     for rd := 1 to 80 do
	 begin
	     if This_Player.GetS(46,rd) = 1 then
	     begin
	        kd:=rd;
		    for wd:=1 to 80 do
		    begin
			     if printStr(EquipType(kd),wd) = '' then
			     break;
			     itemname:=printStr(EquipType(kd),wd);
                 itemNum:=This_Player.GetBagItemCount(itemname);
				if itemNum > 0 then
					begin
					This_Player.Take(itemname, itemNum);
					itemtype := itemtype + itemNum;
					end;
				end;
        end;
	   
	 if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) then
	 begin
	    itemtype := itemtype * getZYBNum(kd);
	          This_Player.ScriptRequestAddYBNum(itemtype);
	                    itemtype:=0;
     end;
	 
	end;
		This_Player.CallOutex(This_Npc, This_Player.GetS(112,1), 'LoopNow_11');
	end
	else
	This_Player.PlayerNotice('自动回收已关闭',0);
	exit;
end;
procedure LoopNow_11;
var k:integer;
var rd,wd,kd,itemNum,itemtype:Integer;itemname,tempname : string;
begin
    if This_Player.GetS(120,1) > 0 then
	begin
	    for k := 0 to 16 do
		begin
            This_Player.RepairBodyEquip(k);
		end;
		     rd:=0;wd:=0;kd:=0;itemNum:=0;itemtype:=0;itemname:='';tempname:='';
     for rd := 1 to 80 do
	 begin
	     if This_Player.GetS(46,rd) = 1 then
	     begin
	        kd:=rd;
		    for wd:=1 to 80 do
		    begin
			     if printStr(EquipType(kd),wd) = '' then
			     break;
			     itemname:=printStr(EquipType(kd),wd);
                 itemNum:=This_Player.GetBagItemCount(itemname);
				if itemNum > 0 then
					begin
					This_Player.Take(itemname, itemNum);
					itemtype := itemtype + itemNum;
					end;
				end;
        end;
	   
	 if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) then
	 begin
	    itemtype := itemtype * getZYBNum(kd);
	          This_Player.ScriptRequestAddYBNum(itemtype);
	                    itemtype:=0;
     end;
	end;
		This_Player.CallOutex(This_Npc, This_Player.GetS(112,1), 'LoopNow_22');
	end
	else
	This_Player.PlayerNotice('自动回收已关闭',0);
	exit;
end;
begin
domain;
end.


最新回复 (0)
返回