--mapscriptdata: --1 红石 --2 蓝石 --3 绿石 --4 黄石 --5 机关是否全开 --6 4亡灵均被杀死 --7 记录小女孩是第几次出现 --8 记录BOSS技能是否已经有变羊玩家 --9 记录真元被杀次数 --10 记录该副本内邪鬼王ID --11 记录该副本内的小队ID --12 记录单人进入副本该角色ID --梭� 觌彘:1535606,1535607,1535608,1535609 function I6010869_OnUse(MapID,InstanceID,TypeID,RoleID)--用XX之玉刷光柱 local IsPerfect = map.GetMapScriptData(MapID,InstanceID,1,5) if TypeID == 6010869 then map.MapCreateCreature(MapID,InstanceID,3075513,166,15278,215) map.SetMapScriptData(MapID,InstanceID,1,1,1) map.SetMapScriptData(MapID,InstanceID,1,5,IsPerfect+1) --标记为已开启 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 13202) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) elseif TypeID == 6010870 then map.MapCreateCreature(MapID,InstanceID,3075514,166,15272,314) map.SetMapScriptData(MapID,InstanceID,1,2,1) map.SetMapScriptData(MapID,InstanceID,1,5,IsPerfect+1) --标记为已开启 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 13203) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) elseif TypeID == 6010871 then map.MapCreateCreature(MapID,InstanceID,3075515,267,15262,315) map.SetMapScriptData(MapID,InstanceID,1,3,1) map.SetMapScriptData(MapID,InstanceID,1,5,IsPerfect+1) --标记为已开启 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 13204) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) elseif TypeID == 6010872 then map.MapCreateCreature(MapID,InstanceID,3075516,268,15262,214) map.SetMapScriptData(MapID,InstanceID,1,4,1) map.SetMapScriptData(MapID,InstanceID,1,5,IsPerfect+1) --标记为已开启 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 13205) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end local IsPerfect = map.GetMapScriptData(MapID,InstanceID,1,5) local a = map.GetMapScriptData(MapID,InstanceID,1,1) local b = map.GetMapScriptData(MapID,InstanceID,1,2) local c = map.GetMapScriptData(MapID,InstanceID,1,3) local d = map.GetMapScriptData(MapID,InstanceID,1,4) if a==1 and b==1 and c==1 and d ==1 and IsPerfect >= 4 then --若全开启神石则刷小女孩 map.MapCreateCreature(MapID,InstanceID,4910054,216,14068,264) map.SetMapScriptData(MapID,InstanceID,1,7,1) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 13219) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end end function I6010869_CanUse(MapID,InstanceID,TypeID,RoleID) --不在机关范围内无法开启神石 local x,y,z=unit.GetPosition(MapID,InstanceID,RoleID) local bRet, bIgnore = 0, false local a = map.GetMapScriptData(MapID,InstanceID,1,1) local b = map.GetMapScriptData(MapID,InstanceID,1,2) local c = map.GetMapScriptData(MapID,InstanceID,1,3) local d = map.GetMapScriptData(MapID,InstanceID,1,4) if TypeID == 6010869 then if MapID ~= 3067630031 or x < 67 or z < 128 or x > 75 or z > 136 then bRet = 43 end if a == 1 then bRet = 43 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 13201) msg.DispatchRoleMsgEvent(RoleID, MsgID) end return bRet, bIgnore elseif TypeID == 6010870 then if MapID ~= 3067630031 or x < 64 or z < 389 or x > 72 or z > 397 then bRet = 43 end if b == 1 then bRet = 43 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 13201) msg.DispatchRoleMsgEvent(RoleID, MsgID) end return bRet, bIgnore elseif TypeID == 6010871 then if MapID ~= 3067630031 or x <369 or z < 399 or x > 377 or z > 407 then bRet = 43 end if c == 1 then bRet = 43 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 13201) msg.DispatchRoleMsgEvent(RoleID, MsgID) end return bRet, bIgnore elseif TypeID == 6010872 then if MapID ~= 3067630031 or x < 364 or z < 122 or x > 373 or z > 130 then bRet = 43 end if d == 1 then bRet = 43 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 13201) msg.DispatchRoleMsgEvent(RoleID, MsgID) end return bRet, bIgnore end return bRet,bIgnore end function I6010874_OnUse(MapID,InstanceID,TypeID,RoleID) --大门钥匙可开启4个大门区域内有效 local x,y,z=unit.GetPosition(MapID,InstanceID,RoleID) if x > 54 and z > 100 and x < 89 and z < 127 then map.OpenCloseDoor(MapID, InstanceID, 531, 1) elseif x > 354 and z > 76 and x < 384 and z < 103 then map.OpenCloseDoor(MapID, InstanceID, 530, 1) elseif x < 388 and z < 443 and x > 356 and z > 414 then map.OpenCloseDoor(MapID, InstanceID, 529, 1) elseif x < 86 and z < 428 and x > 51 and z > 402 then map.OpenCloseDoor(MapID, InstanceID, 528, 1) end end function I6010874_CanUse(MapID,InstanceID,TypeID,RoleID) --若不在规定区域内无法使用钥匙开门 local x,y,z=unit.GetPosition(MapID,InstanceID,RoleID) local bRet, bIgnore = 0, false if x > 54 and z > 100 and x < 89 and z < 127 then return bRet, bIgnore elseif x > 354 and z > 76 and x < 384 and z < 103 then return bRet,bIgnore elseif x < 388 and z < 443 and x > 356 and z > 414 then return bRet,bIgnore elseif x < 86 and z < 428 and x > 51 and z > 402 then return bRet,bIgnore else bRet = 43 end return bRet,bIgnore end function Cunmin_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local IsHave = cre.GetCreatureScriptData(MapID, InstanceID, TargetID, 1, 1) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) map.SetMapScriptData(MapID,InstanceID,1,11,TeamID) local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) if IsHave == 0 then --若没领取过BUFF则可领取 if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13206) --快救救我,我就快没命了! msg.AddMsgEvent(MsgID, 21, 4) -- 选项一 msg.AddMsgEvent(MsgID, 1, 13207) --如何攻破天井水脉 msg.AddMsgEvent(MsgID, 21, 5) -- 选项二 msg.AddMsgEvent(MsgID, 1, 13208) --解救村民 msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13210) msg.AddMsgEvent(MsgID, 21, 6) msg.AddMsgEvent(MsgID, 1, 13211) msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 5 then local IsHave = cre.GetCreatureScriptData(MapID, InstanceID, TargetID, 1, 1) if IsHave == 0 then local k = math.random(2) if TargetTypeID == 4910055 then buffid = 94563+k elseif TargetTypeID == 4910056 then buffid = 94565+k end if TeamID ~= nil and TeamID ~= 4294967295 then for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then local rolemapID, roleinstanceID = role.GetRoleMapID(Role[i]) if rolemapID == 3067630031 then unit.AddBuff(MapID,InstanceID,Role[i],buffid*100+1,Role[i]) --给小队玩家加增益BUFF end end end else unit.AddBuff(MapID,InstanceID,RoleID,buffid*100+1,RoleID) --若玩家无小队则自己加BUFF end cre.SetCreatureScriptData(MapID, InstanceID, TargetID, 1, 1, 1) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13212) msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 6 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13206) --快救救我,我就快没命了! msg.AddMsgEvent(MsgID, 21, 4) -- 选项一 msg.AddMsgEvent(MsgID, 1, 13207) --如何攻破天井水脉 msg.AddMsgEvent(MsgID, 21, 5) -- 选项二 msg.AddMsgEvent(MsgID, 1, 13208) --解救村民 msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) end else --若已领取过BUFF则只谢谢 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13209) msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) end end function DiushiNvhai_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) --小女孩的3个阶段对话 local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) local TalkedNum = map.GetMapScriptData(MapID,InstanceID,1,7) if TalkedNum == 1 then if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13213) --你们是谁?…… msg.AddMsgEvent(MsgID, 21, 4) -- 选项一 msg.AddMsgEvent(MsgID, 1, 13214) --净化她的心灵 msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then map.MapDeleteCreature(MapID,InstanceID,TargetID) map.MapCreateCreature(MapID,InstanceID,1535603,217,14181,313) map.MapCreateCreature(MapID,InstanceID,1535603,165,14181,264) map.MapCreateCreature(MapID,InstanceID,1535603,217,14181,215) map.MapCreateCreature(MapID,InstanceID,1535603,266,14181,264) end elseif TalkedNum == 2 then if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13215) --我知道那个一直在跟我说话的人在哪了……模样好可怕…… msg.AddMsgEvent(MsgID, 21, 4) -- 选项一 msg.AddMsgEvent(MsgID, 1, 13216) --前往异世界 msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then if TeamID ~= nil and TeamID ~= 4294967295 then for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then local rolemapID, roleinstanceID = role.GetRoleMapID(Role[i]) if rolemapID == 3067630031 then role.RoleGotoNewMap(MapID,InstanceID,Role[i],MapID,457,31,142) --小队整体传送至下面 end end end else role.RoleGotoNewMap(MapID,InstanceID,RoleID,MapID,457,31,142) --单人传送 end end elseif TalkedNum == 3 then if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 13217) --谢谢你们救了我,我好想回家…… msg.AddMsgEvent(MsgID, 21, 4) -- 选项一 msg.AddMsgEvent(MsgID, 1, 13218) --回家 msg.AddMsgEvent(MsgID, 24, TargetID) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then if TeamID ~= nil and TeamID ~= 4294967295 then for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then local rolemapID, roleinstanceID = role.GetRoleMapID(Role[i]) if rolemapID == 3067630031 then role.RoleGotoNewMap(MapID,InstanceID,Role[i],3017300687,1569,7757,246) --小队整体传送出副本 end end end else role.RoleGotoNewMap(MapID,InstanceID,RoleID,3017300687,1569,7757,246) end end end end function C1535603_OnDie(MapID, InstanceID, CreID, CreTypeID, RoleID) local CreDieNum = map.GetMapScriptData(MapID,InstanceID,1,6) CreDieNum = CreDieNum + 1 map.SetMapScriptData(MapID,InstanceID,1,6,CreDieNum) if CreDieNum >= 4 then map.SetMapScriptData(MapID,InstanceID,1,7,2) map.MapCreateCreature(MapID,InstanceID,4910054,216,14068,264) --4个亡灵死后刷小女孩 end end function C1535601_OnDie(MapID,InstanceID,CreID,CreTypeID,RoleID) map.SetMapScriptData(MapID,InstanceID,1,7,3) map.MapCreateCreature(MapID,InstanceID,4910054,456,15050,53) --BOSS死后刷小女孩 end function m53_LeaveMap(MapID, InstanceID, RoleID) --离开副本时候删除副本内所有相关道具。 for i = 6010869,6010874 do local k = role.GetRoleItemNum(RoleID,i) if k >= 1 then role.RemoveFromRole(MapID,InstanceID,RoleID,i,k,420) end end end function C5000201_Skill(MapID,InstanceID,SkillID,TargetID) map.SetMapScriptData(MapID,InstanceID,1,10,TargetID) local AllRole = map.GetMapAllRoleID(MapID, InstanceID) for u,v in pairs(AllRole) do if u ~= nil then unit.AddBuff(MapID, InstanceID, v, 9456001, v) end end --unit.AddBuff(MapID, InstanceID, TargetID, 9456101, TargetID) --unit.AddBuff(MapID, InstanceID, TargetID, 9456201, TargetID) zhenyuan1 = map.MapCreateCreature(MapID,InstanceID,1535602, 485, 15050,31 ) zhenyuan2 = map.MapCreateCreature(MapID,InstanceID,1535602, 429, 15050,32 ) zhenyuan3 = map.MapCreateCreature(MapID,InstanceID,1535602, 440, 15050,92 ) zhenyuan4 = map.MapCreateCreature(MapID,InstanceID,1535602, 478, 15050,93 ) zhenyuan5 = map.MapCreateCreature(MapID,InstanceID,1535602, 454, 15050,105 ) zhenyuan6 = map.MapCreateCreature(MapID,InstanceID,1535602, 442, 15050,141 ) zhenyuan7 = map.MapCreateCreature(MapID,InstanceID,1535602, 460, 15050,63 ) zhenyuan8 = map.MapCreateCreature(MapID,InstanceID,1535602, 438, 15050,109 ) zhenyuan9 = map.MapCreateCreature(MapID,InstanceID,1535602, 493, 15050,92 ) zhenyuan10 = map.MapCreateCreature(MapID,InstanceID,1535602, 462, 15050,84 ) zhenyuan11 = map.MapCreateCreature(MapID,InstanceID,1535602, 192, 15050,79 ) zhenyuan12 = map.MapCreateCreature(MapID,InstanceID,1535602, 225, 15050,86 ) zhenyuan13 = map.MapCreateCreature(MapID,InstanceID,1535602, 288, 15050,93 ) zhenyuan14 = map.MapCreateCreature(MapID,InstanceID,1535602, 370, 15050,33 ) zhenyuan15 = map.MapCreateCreature(MapID,InstanceID,1535602, 71, 15050,51 ) zhenyuan16 = map.MapCreateCreature(MapID,InstanceID,1535602, 68, 15050,476 ) zhenyuan17 = map.MapCreateCreature(MapID,InstanceID,1535602, 168, 15050,441 ) zhenyuan18 = map.MapCreateCreature(MapID,InstanceID,1535602, 215, 15050,440 ) zhenyuan19 = map.MapCreateCreature(MapID,InstanceID,1535602, 269, 15050,449 ) zhenyuan20 = map.MapCreateCreature(MapID,InstanceID,1535602, 373, 15050,478 ) end function C5000801_Skill(MapID,InstanceID,SkillID,TargetID) --假BOSS50%血刷小怪 map.MapCreateCreature(MapID,InstanceID,1535617,232,14068,263) map.MapCreateCreature(MapID,InstanceID,1535618,209,14068,278) map.MapCreateCreature(MapID,InstanceID,1535618,205,14068,246) end function C1535602_OnDie(MapID,InstanceID,CreID,CreTypeID,RoleID) local ZhenyuanDeadNum = map.GetMapScriptData(MapID,InstanceID,1,9) ZhenyuanDeadNum = ZhenyuanDeadNum + 1 map.SetMapScriptData(MapID,InstanceID,1,9,ZhenyuanDeadNum) local xieguiwang = map.GetMapScriptData(MapID,InstanceID,1,10) local AllRole = map.GetMapAllRoleID(MapID, InstanceID) if ZhenyuanDeadNum == 10 or ZhenyuanDeadNum == 20 or ZhenyuanDeadNum == 25 or ZhenyuanDeadNum == 30 or ZhenyuanDeadNum == 35 or ZhenyuanDeadNum == 40 or ZhenyuanDeadNum == 45 or ZhenyuanDeadNum == 50 then for u,v in pairs(AllRole) do if u ~= nil then unit.CancelBuff(MapID,InstanceID,v,9456001) end end end --unit.CancelBuff(MapID,InstanceID,xieguiwang,9456101) --unit.CancelBuff(MapID,InstanceID,xieguiwang,9456201) end function m53_EnterMap(MapID,InstanceID,RoleID) local IsHave = role.IsRoleHaveBuff(MapID, InstanceID,RoleID,99996) if IsHave == true then unit.CancelBuff(MapID, InstanceID,RoleID,9999601) end map.SetMapScriptData(MapID,InstanceID,1,12,RoleID) end function I6010873_OnUse(MapID,InstanceID,TypeID,RoleID) unit.CancelBuff(MapID,InstanceID,RoleID,9455901) end function I6010873_CanUse(MapID,InstanceID,TypeID,RoleID) local bRet, bIgnore = 0, false local IsHave = role.IsRoleHaveBuff(MapID, InstanceID,RoleID,94559) if IsHave == false then bRet = 32 end return bRet, bIgnore end function C1535601_LeaveCombat(MapID,InstanceID,CreID) if zhenyuan1 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan1) end if zhenyuan2 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan2) end if zhenyuan3 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan3) end if zhenyuan4 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan4) end if zhenyuan5 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan5) end if zhenyuan6 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan6) end if zhenyuan7 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan7) end if zhenyuan8 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan8) end if zhenyuan9 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan9) end if zhenyuan10 ~= nil then map.MapDeleteCreature(MapID,InstanceID,zhenyuan10) end map.SetMapScriptData(MapID,InstanceID,1,9,0) end aux.RegisterItemEvent(6010873, 1, "I6010873_OnUse") aux.RegisterItemEvent(6010873, 0, "I6010873_CanUse") aux.RegisterSkillEvent(5000801,1,"C5000801_Skill") aux.RegisterSkillEvent(5000201,1,"C5000201_Skill") aux.RegisterCreatureEvent(1535601,4,"C1535601_OnDie") aux.RegisterCreatureEvent(1535602,4,"C1535602_OnDie") aux.RegisterCreatureEvent(1535603,4,"C1535603_OnDie") aux.RegisterCreatureEvent(4910054, 7, "DiushiNvhai_OnTalk") aux.RegisterCreatureEvent(4910055, 7, "Cunmin_OnTalk") aux.RegisterCreatureEvent(4910056, 7, "Cunmin_OnTalk") aux.RegisterItemEvent(6010869, 1, "I6010869_OnUse") aux.RegisterItemEvent(6010870, 1, "I6010869_OnUse") aux.RegisterItemEvent(6010871, 1, "I6010869_OnUse") aux.RegisterItemEvent(6010872, 1, "I6010869_OnUse") aux.RegisterItemEvent(6010869, 0, "I6010869_CanUse") aux.RegisterItemEvent(6010870, 0, "I6010869_CanUse") aux.RegisterItemEvent(6010871, 0, "I6010869_CanUse") aux.RegisterItemEvent(6010872, 0, "I6010869_CanUse") aux.RegisterItemEvent(6010874, 1, "I6010874_OnUse") aux.RegisterItemEvent(6010874, 0, "I6010874_CanUse") aux.RegisterMapEvent("m53", 3, "m53_LeaveMap") aux.RegisterMapEvent("m53", 2, "m53_EnterMap") aux.RegisterCreatureEvent(1535601,3,"C1535601_LeaveCombat")