战神引擎自动回收NPC代码 分享了
战神引擎自动回收脚本,可以自己设置一下多久回收。我这里设置了白银会员才可以开启回收,假如不需要的话直接去掉
if (This_Player.GetV(68,1) = 1) or (This_Player.GetV(68,1) = 2) or (This_Player.GetV(68,1) = 3) or (This_Player.GetV(68,1) = 4) then |
这一段就好了
PROGRAM Mir2; Const RECSEC = 30; //自动回收时间间隔,目前设置的30秒一次 Const CHGNEEDYB = 0; Const ONNEEDYB = 0; Const WQPRICE = 0; Const wpname = '回收宝箱'; 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:='强化雷霆项链,强化雷霆护腕,强化雷霆战戒,强化雷霆战盔,强化雷霆腰带, 强化雷霆战靴,强化烈焰项链,强化烈焰护腕,强化烈焰魔戒,强化烈焰魔盔,强化烈焰腰带, 强化烈焰魔靴,强化光芒项链,强化光芒护腕,强化光芒道戒,强化光芒道盔,强化光芒腰带,强化光芒道靴'; 5 : result:='预言头盔(战),预言头盔(法),预言头盔(道),誓言腰带(战),誓言腰带(法),誓言腰带(道), 传说魔靴(战),传说魔靴(法),传说魔靴(道),战神头盔,圣魔头盔,真魂头盔,战神圣靴,圣魔魔靴,真魂道靴, 战神腰带,圣魔腰带,真魂腰带,真魂戒指,真魂手镯,战神项链,战神手镯,圣魔项链,真魂项链,战神戒指,圣魔戒指,圣魔手镯'; 6 : result:='星王战盔,星王法冠,星王道盔,星王项链(战),星王项链(法),星王项链(道),星王护腕(战), 星王护腕(法),星王护腕(道),星王战戒,星王法戒,星王道戒,星王腰带(战),星王腰带(法),星王腰带(道), 星王战靴,星王法靴,星王道靴'; 7 : result:='狂雷战盔,狂雷项链,狂雷护腕,狂雷战戒,狂雷腰带,狂雷战靴,逆火魔盔,逆火项链,逆火护腕, 逆火魔戒,逆火腰带,逆火魔靴,通云道盔,通云项链,通云护腕,通云道戒,通云腰带,通云道靴'; 8 : result:='王者战盔,王者魔盔,王者道盔,王者项链(战),王者项链(法),王者项链(道),王者护腕(战), 王者护腕(法),王者护腕(道),王者战戒,王者魔戒,王者道戒,王者腰带(战),王者腰带(法),王者腰带(道), 王者战靴,王者魔靴,王者道靴'; 9 : result:='怒斩,龙牙,逍遥扇,天之怒斩,天之龙牙,天之逍遥扇,天魔神甲,圣战宝甲,法神披风,霓裳羽衣,天尊道袍,天师长袍'; 10 : result:='烈焰魔衣(男),烈焰魔衣(女),雷霆战甲(男),雷霆战甲(女),光芒道袍(男),光芒道袍(女),屠龙,霸者之刃, 嗜魂法杖,天之烈焰衣(男),天之烈焰衣(女),天之雷霆甲(男),天之雷霆甲(女),天之光芒袍(男),天之光芒袍(女),天之屠龙, 天之霸者之刃,天之嗜魂法杖'; 11 : result:='开天,镇天,玄天,凤天魔甲,凰天魔衣'; 12 : result:='黄金屠龙,紫金嗜魂法杖,赤金逍遥扇,黄金战甲(男),黄金战甲(女),黄金魔衣(男),黄金魔衣(女),黄金道袍(男), 黄金道袍(女)'; 13 : result:='星王战甲,星王战衣,星王魔甲,星王魔衣,星王道甲,星王道衣,星王战刃,星王法刃,星王道刃'; 14 : result:='星王战盔,星王法冠,星王道盔,星王项链(战),星王项链(法),星王项链(道),星王护腕(战),星王护腕(法), 星王护腕(道),星王战戒,星王法戒,星王道戒,星王腰带(战),星王腰带(法),星王腰带(道),星王战靴,星王法靴,星王道靴'; end; end; function getZYBNum(Zlv : integer) : integer; begin case Zlv of 1 : result := 1; 2 : result := 3; 3 : result := 5; //5 4 : result := 11; //10 5 : result := 55; //50 6 : result := 110; //100 错误 7 : result := 550; //500 8 : result := 1100; //1000 9 : result := 55; //50 10 : result := 220; //200 不提示 11 : result := 1100; //1000 12 : result := 3300; //3000 13 : result := 8800; //8000 不提示 14 : result := 110; //星王 end; end; function getZYBNum2(Zlv : integer) : integer; begin case Zlv of 1 : result := 1; 2 : result := 3; 3 : result := 6; //5 4 : result := 12; //10 5 : result := 60; //50 6 : result := 120; //100 错误 7 : result := 600; //500 8 : result := 1200; //1000 9 : result := 60; //50 10 : result := 240; //200 11 : result := 1200; //1000 12 : result := 3600; //3000 13 : result := 9600; //8000 14 : result := 120; //星王 end; end; function getZYBNum3(Zlv : integer) : integer; begin case Zlv of 1 : result := 1; 2 : result := 4; 3 : result := 7; //5 4 : result := 13; //10 5 : result := 65; //50 6 : result := 130; //100 错误 7 : result := 650; //500 8 : result := 1300; //1000 9 : result := 65; //50 10 : result := 260; //200 11 : result := 1300; //1000 12 : result := 3900; //3000 13 : result := 10400; //8000 14 : result := 130; //星王 end; end; function getZYBNum4(Zlv : integer) : integer; begin case Zlv of 1 : result := 2; 2 : result := 5; 3 : result := 8; //5 4 : result := 15; //10 5 : result := 75; //50 6 : result := 150; //100 错误 7 : result := 750; //500 8 : result := 1500; //1000 9 : result := 75; //50 10 : result := 300; //200 11 : result := 1500; //1000 12 : result := 4500; //3000 13 : result := 12000; //8000 14 : result := 150; //星王 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, // '自动回收<每30秒>回收1次背包内物品|'+ '<重要提示> <首次使用务必点击此处,否则后果自负/@funchg~13>|'+
'<装备名字 回收模式 当前状态 调整状态/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>|'+ '星王级装备^<'+itemstr[14]+'>^'+recstr[14]+'^<[开关]/@funcon~14>|'+ '狂雷级装备^<'+itemstr[7]+'>^'+recstr[7]+'^<[开关]/@funcon~7>|'+ '王者级装备^<'+itemstr[8]+'>^'+recstr[8]+'^<[开关]/@funcon~8>|'+
'怒斩衣武器^<'+itemstr[9]+'>^'+recstr[9]+'^<[开关]/@funcon~9>|'+ '屠龙衣武器^<'+itemstr[10]+'>^'+recstr[10]+'^<[开关]/@funcon~10>|'+ '开天衣武器^<'+itemstr[11]+'>^'+recstr[11]+'^<[开关]/@funcon~11>|'+ '黄金衣武器^<'+itemstr[12]+'>^'+recstr[12]+'^<[开关]/@funcon~12>|'+ '星王衣武器^<'+itemstr[13]+'>^'+recstr[13]+'^<[开关]/@funcon~13>|'+ '<注意:><1.下线需重启开关 2.建议单个开启与关闭/c=242>|'+ '<价格查询/@chaxun>^<全部开启/@f001>^<全部关闭/@f002>|' ); end; procedure _chaxun; begin This_NPC.NpcDialog(This_Player, '|<祖玛系列:/c=red>^每件1元宝'+ '|<赤月系列:/c=red>^每件3元宝'+ '|<雷霆系列:/c=red>^每件5元宝'+ '|<强化系列:/c=red>^每件10元宝'+ '|<战神系列:/c=red>^每件50元宝'+ '|<星王系列:/c=red>^每件100元宝'+ '|<狂雷系列:/c=red>^每件500元宝'+ '|<王者系列:/c=red>^每件1000元宝'+ '|<怒斩武器衣服:/c=red>^每件50元宝'+ '|<屠龙武器衣服:/c=red>^每件200元宝'+ '|<开天武器衣服:/c=red>^每件1000元宝'+ '|<黄金武器衣服:/c=red>^每件3000元宝'+ '|<星王武器衣服:/c=red>^每件8000元宝'+ // '|<王者武器衣服:/c=red>每件8000元宝'+ '|<【特别提示】:刺影装备手动回收元宝与传奇币!/c=250>' ); end; procedure _f001; begin if (This_Player.GetV(68,1) = 1) or (This_Player.GetV(68,1) = 2) or (This_Player.GetV(68,1) = 3) or (This_Player.GetV(68,1) = 4) then begin This_Player.SetS(46,1,1); This_Player.SetS(46,2,1); This_Player.SetS(46,3,1); This_Player.SetS(46,4,1); This_Player.SetS(46,5,1); //This_Player.SetS(46,6,1); This_Player.SetS(46,7,1); This_Player.SetS(46,8,1); This_Player.SetS(46,9,1); This_Player.SetS(46,10,1); This_Player.SetS(46,11,1); This_Player.SetS(46,12,1); This_Player.SetS(46,13,1); This_Player.SetS(46,14,1); This_Player.PlayerNotice('全部开启成功,此功能不可与单个开启与关闭混用。',2); domain; This_Player.SetS(120,1,1); This_Player.SetS(112,1,RECSEC); This_Player.CallOutex(This_Npc, This_Player.GetS(112,1), 'LoopNow_11'); end else begin This_Player.PlayerNotice('需要白银会员才能开启本功能!',0); end; end; procedure _f002; begin if (This_Player.GetV(68,1) = 1) or (This_Player.GetV(68,1) = 2) or (This_Player.GetV(68,1) = 3) or (This_Player.GetV(68,1) = 4) then begin This_Player.SetS(46,1,0); This_Player.SetS(46,2,0); This_Player.SetS(46,3,0); This_Player.SetS(46,4,0); This_Player.SetS(46,5,0); //This_Player.SetS(46,6,0); This_Player.SetS(46,7,0); This_Player.SetS(46,8,0); This_Player.SetS(46,9,0); This_Player.SetS(46,10,0); This_Player.SetS(46,11,0); This_Player.SetS(46,12,0); This_Player.SetS(46,13,0); This_Player.SetS(46,14,0); This_Player.PlayerNotice('全部关闭成功,此功能不可与单个开启与关闭混用。',2); This_Player.SetS(120,1,0); This_Player.SetS(112,1,0); domain; end else begin This_Player.PlayerNotice('需要白银会员才能开启本功能!',0); end; end; procedure _funcon(onstr:string); var onnum:integer; begin //if This_Player.GetBagItemCount(wpname) >= 1 then //if This_Player.GetV(88,88) >= 30 then if (This_Player.GetV(68,1) = 1) or (This_Player.GetV(68,1) = 2) or (This_Player.GetV(68,1) = 3) or (This_Player.GetV(68,1) = 4) then 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,RECSEC); This_Player.SetS(112,1,RECSEC); 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 else begin //This_Player.PlayerNotice('需要有回收宝箱才能开启本功能!',0); //This_Player.PlayerNotice('需要充值满30元才能开启本功能!',0); This_Player.PlayerNotice('需要白银会员才能开启本功能!',0); 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,itemNum2,itemNum3,itemNum4,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) and (This_Player.GetV(68,1) = 1) then begin itemtype := itemtype * getZYBNum(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('白银赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 2) then begin itemtype := itemtype * getZYBNum2(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('黄金赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 3) then begin itemtype := itemtype * getZYBNum3(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('至尊赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 4) then begin itemtype := itemtype * getZYBNum4(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('王者赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end; end; end; 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,itemNum2,itemNum3,itemNum4,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) and (This_Player.GetV(68,1) = 1) then begin itemtype := itemtype * getZYBNum(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('白银赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 2) then begin itemtype := itemtype * getZYBNum2(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('黄金赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 3) then begin itemtype := itemtype * getZYBNum3(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('至尊赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end else begin if (This_Player.GetS(47,kd) < 1) and (This_Player.GetS(46,kd) = 1) and (itemtype > 0) and (This_Player.GetV(68,1) = 4) then begin itemtype := itemtype * getZYBNum4(kd); This_Player.ScriptRequestAddYBNum(itemtype); itemtype:=0; ServerSay('王者赞助【' + This_Player.Name + '】使用自动回收装备获得大量元宝' , 70); end; end; end; 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. |