有安全地图设置
有保护等级设置游戏中点击图标【战】,然后对玩家点右键即可强行pk、或者强行加入玩家战斗开始对飞或协助(满5人队伍无法加入,4人以下都可以加入)(boss区设置安全地图,即可防止玩家接力刷boss)
不点【战】,输入/9亦可
注意:如果你使用转生系统的网页,建议修改网页。不要使用namecolor数据库列来作为转生依据,如果你的网页不含转生功能,请忽略。
lua/module/ng.lua末尾添加(代码中pkmap为保护地图编号、代码中pkdj为等级保护)
- NL.RegRightClickEvent(nil,"MyRightClickEvent");
- local xskg = 1;--血色系统开关 0为关 1为开--无需修改,由gm命令控制
- local pkdj = 20;--强行PK等级保护
-
- function MyRightClickEvent(CharIndex,TargetCharIndex)
- --local xskg = 1;--血色系统开关 0为关 1为开
- local pkname1 = Char.GetData(CharIndex,%对象_名字%)
- local pkname2 = Char.GetData(TargetCharIndex,%对象_名字%)
- --local zding = Char.GetBattleIndex(TargetCharIndex)
- --local zding = Battle.GetCurrentBattle(TargetCharIndex)
- local zding = Char.GetData(TargetCharIndex,%对象_战斗中%)
- local pkmap = Char.GetData(CharIndex,%对象_地图%)
- local hongming1 = Char.GetData(CharIndex,%对象_名色%)
- local hongming2 = Char.GetData(TargetCharIndex,%对象_名色%)
- local pkdj2 = Char.GetData(TargetCharIndex,%对象_等级%)
- local ptrs = Char.PartyNum(TargetCharIndex)
- --local pkcd1 = Char.GetData(CharIndex,%对象_CDK%);
- --local pkcd2 = Char.GetData(TargetCharIndex,%对象_CDK%);
- --local zding = Battle.GetCurrentBattle(TargetCharIndex)
- --NLG.Say(-1,-1,"debug"..zding.."试",5,1)
- --Char.GetData(CharIndex,%对象_对战开关%)
- --NLG.Say(CharIndex,-1,"调试数据:战斗状态="..zding..",队伍人数="..ptrs.."",5,1)--调试数据查看
- if xskg == 0 then
- NLG.Say(CharIndex,-1,"【血色系统】已被GM关闭,目前可能正在搞活动,请使用常规PK方式!",5,1)
- return 0;
- end
- if (Char.GetData(CharIndex,%对象_对战开关%) == 0) then
- NLG.Say(CharIndex,-1,"【血色系统】强行PK功能已关闭,请手动开启!",5,1)
- return 0;
- end
- if (Char.GetData(CharIndex,%对象_金币%) < 1000) then
- NLG.Say(CharIndex,-1,"【血色系统】强行PK需要收费1000魔币,你的钱不够!",5,1)
- return 0;
- end
- if pkmap == 60264 then
- NLG.Say(CharIndex,-1,"【血色系统】采集场为安全地图,无法强行PK!",5,1)
- NLG.Say(TargetCharIndex,-1,"【血色系统】"..pkname1.." 正在尝试对您下杀手,由于采集场为安全地图,逃过一劫!",0,1)
- return 0;
- elseif pkmap == 1401 or pkmap == 1400 then
- NLG.Say(CharIndex,-1,"【血色系统】当前地图为安全地图,无法强行PK!",5,1)
- NLG.Say(TargetCharIndex,-1,"【血色系统】"..pkname1.." 正在尝试对您下杀手,由于您处于安全地图,逃过一劫!",0,1)
- return 0;
- end
- if pkdj2 < pkdj then
- NLG.Say(CharIndex,-1,"【血色系统】您无法对低于"..pkdj.."级的玩家下手,真是禽兽不如!",5,1)
- NLG.Say(TargetCharIndex,-1,"【血色系统】禽兽玩家 "..pkname1.." 尝试对您下杀手,由于您低于"..pkdj.."级,受到系统保护,所以本次强行PK被系统拦截!",1,1)
- return 0;
- end
- if (zding > 0 and pkmap == 1401 or pkmap == 32724 or pkmap == 32732 or pkmap == 102) then
- NLG.Say(CharIndex,-1,"【血色系统】"..pkname2.." 正在竞技场战斗中,无法强行加入战斗对飞!",5,1)
- NLG.Say(TargetCharIndex,-1,"【血色系统】"..pkname1.." 正在尝试对您下杀手,由于您在竞技场战斗,所以暂时逃过一劫!",0,1)
- return 0;
- end
- if (zding > 0 and ptrs == 5) then
- NLG.Say(CharIndex,-1,"【血色系统】强行加入 "..pkname2.." 的战斗失败,因为ta的队伍人数已满!",0,2)
- NLG.Say(TargetCharIndex,-1,"【血色系统】"..pkname1.." 试图强行加入到你的战斗中,但你的队伍人数已满,所以逃过一劫!",0,2)
- return 0;
- end
- if zding > 0 then
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"【血色系统】你已经强行加入到了 "..pkname2.." 的战斗中,帮ta?还是飞ta?你看了办!",0,2)
- NLG.Say(CharIndex,-1,"因强行加入其他玩家的战斗!飞人意图极高,你成了大红名!",6,1)
- Char.SetData(CharIndex,%对象_名色%,6);
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- NLG.Say(TargetCharIndex,-1,"【血色系统】"..pkname1.." 强行加入到了你的战斗中,可能是要帮你?也可能是要飞你!",0,2)
- Battle.JoinBattle(TargetCharIndex,CharIndex)
- return 0;
- end
- if (hongming1 == 0 and hongming2 == 0) then
- NLG.Say(-1,-1,"【血色系统】[白名玩家]"..pkname1.." 戳了[白名玩家]"..pkname2.." 一下,开始强行PK!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- Char.SetData(CharIndex,%对象_名色%,2);
- NLG.Say(CharIndex,-1,"因强行与玩家PK,你由白名变成红名了!",2,1)
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 2 and hongming2 == 0) then
- NLG.Say(-1,-1,"【血色系统】[红名玩家]"..pkname1.." 戳了[白名玩家]"..pkname2.." 一下,开始强行PK!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- Char.SetData(CharIndex,%对象_名色%,6);
- NLG.Say(CharIndex,-1,"因再次强行与玩家PK,你由红名变成大红名了!",6,1)
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 6 and hongming2 == 0) then
- NLG.Say(-1,-1,"【血色系统】[大红名玩家]"..pkname1.." 戳了[白名玩家]"..pkname2.." 一下,开始强行PK!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"因多次强行与玩家PK,你的名字更加红了!",6,1)
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 2 and hongming2 == 2) then
- NLG.Say(-1,-1,"【血色系统】[红名玩家]"..pkname1.." 戳了[红名玩家]"..pkname2.." 一下,开始强行PK!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"因双方都是红名,所以你的红名不变!",2,1)
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 2 and hongming2 == 6) then
- NLG.Say(-1,-1,"【血色系统】[红名玩家]"..pkname1.." 戳了[大红名玩家]"..pkname2.." 一下,开始强行狙杀大红名!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"你的胆识够大,红名打大红名,所以你的红名不变!",2,1)
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 6 and hongming2 == 6) then
- NLG.Say(-1,-1,"【血色系统】[大红名玩家]"..pkname1.." 戳了[大红名玩家]"..pkname2.." 一下,开始强行狙杀大红名!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"大红名打大红名,红名将会更鲜艳!",2,1)
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 6 and hongming2 == 2) then
- NLG.Say(-1,-1,"【血色系统】[大红名玩家]"..pkname1.." 戳了[红名玩家]"..pkname2.." 一下,开始强行PK!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- Char.AddGold(CharIndex,-1000);
- NLG.Say(CharIndex,-1,"大红名打红名,所以你名字略微更红了!",6,1)
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 0 and hongming2 == 2) then
- NLG.Say(-1,-1,"【血色系统】[白名玩家]"..pkname1.." 戳了[红名玩家]"..pkname2.." 一下,开始强行狙杀红名!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- NLG.Say(CharIndex,-1,"白名玩家狙杀红名的人不会红名!",0,1)
- --Char.AddGold(CharIndex,-1000);
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- end
- if (hongming1 == 0 and hongming2 == 6) then
- NLG.Say(-1,-1,"【血色系统】[白名玩家]"..pkname1.." 戳了[大红名玩家]"..pkname2.." 一下,开始强行狙杀大红名!",6,1)
- NLG.SetAction(CharIndex,4)
- NLG.SetAction(TargetCharIndex,6)
- NLG.Say(CharIndex,-1,"白名玩家狙杀大红名的人不会红名!",0,1)
- --Char.AddGold(CharIndex,-1000);
- --Char.SetData(CharIndex,%对象_名色%,6);
- --NLG.SystemMessage(pkname2, "ptr: "..pkname1.." 戳了你一下,尝试强行PK!");
- local BattleIndex = Battle.PVP(CharIndex,TargetCharIndex)
- return 0;
- else
- NLG.Say(CharIndex,-1,"【血色系统】可能碰到bug了,请联系GM!",6,1)
- return 0;
- end
- --local xskg = nil
- local pkname1 = nil
- local pkname2 = nil
- local pkmap = nil
- local hongming1 = nil
- local hongming2 = nil
- --local pkdj = nil
- return 0;
- end
复制代码
lua/module/ng.lua(添加到内挂中,比如/5的内挂功能之后)(注意修改gm命令)
- if(msg == "/9" or msg == "、9") then
- --local xskg2 = 1--无需修改
- local xskg2 = Char.GetData(player,%对象_对战开关%)
- local pknames = Char.GetData(player,%对象_名字%)
- if xskg == 0 then
- NLG.SystemMessage(player,"【血色系统】GM暂时关闭了本功能,请使用常规PK方式!");
- elseif xskg2 == 1 then
- Char.SetData(player,%对象_对战开关%,0)
- NLG.SystemMessage(player,"【血色系统】强行PK功能关闭,右键将不会触发战斗,但别人依然可以狙击你!");
- --xskg2 = 0
- else
- Char.SetData(player,%对象_对战开关%,1)
- NLG.SystemMessage(player,"【血色系统】强行PK功能开启!");
- NLG.Say(-1,-1,"【血色系统】"..pknames.."开红啦!大家小心啊!",6,1)
- --xskg2 = 1
- end
- end
-
- --gm命令控制强行pk系统如下,nr为gm命令
- if (msg == "[nr pkoff]") then
- xskg = 0
- NLG.SystemMessage(-1,"【血色系统】GM关闭了强行PK系统!");
- end
- if (msg == "[nr pkon]") then
- xskg = 1
- NLG.SystemMessage(-1,"【血色系统】GM重新开启了强行PK系统!");
- end
- if (msg == "[nr pkdj+]") then
- pkdj = pkdj + 10
- NLG.SystemMessage(-1,"【血色系统】强行PK等级保护被GM修改为"..pkdj.."级!");
- end
- if (msg == "[nr pkdj-]") then
- pkdj = pkdj - 10
- NLG.SystemMessage(-1,"【血色系统】强行PK等级保护被GM修改为"..pkdj.."级!");
- end
复制代码
|