function I6010866_OnUse(MapID,InstanceID,TypeID,RoleID) --使用钥匙后刷出10个魔王 local Pos= {} Pos[1] = {x=126,y=129,z=60} Pos[2] = {x=153,y=143,z=94} Pos[3] = {x=160,y=249,z=125} Pos[4] = {x=128,y=391,z=142} Pos[5] = {x=121,y=391,z=173} Pos[6] = {x=184,y=310,z=148} Pos[7] = {x=148,y=114,z=68} Pos[8] = {x=145,y=141,z=105} Pos[9] = {x=142,y=106,z=199} Pos[10] ={x=196,y=151,z=192} if TypeID == 6010866 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550401,Pos[i].x,Pos[i].y,Pos[i].z) end elseif TypeID == 6010867 then for k = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550402,Pos[k].x,Pos[k].y,Pos[k].z) end elseif TypeID == 6010868 then for u = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550403,Pos[u].x,Pos[u].y,Pos[u].z) end end end function I6010866_CanUse(MapID, InstanceID, TypeID, RoleID) --不在M51内则无法使用该道具 local bRet, bIgnore = 0, false if MapID ~= 3067630543 then bRet = 47 end return bRet,bIgnore end function C1550401_OnDie(MapID, InstanceID, CreID, CreTypeID, RoleID) local QingMowang = map.GetMapScriptData(MapID,InstanceID,1,1) local BaiMowang = map.GetMapScriptData(MapID,InstanceID,1,2) local JinMowang = map.GetMapScriptData(MapID,InstanceID,1,3) local FirstKill = role.GetRoleScriptData(RoleID,1,RoleDataType["Baiyaota_FirstKill"]) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) local level = role.GetRoleLevel(MapID,InstanceID,RoleID) local index = math.random(100) if CreTypeID == 1550401 then map.SetMapScriptData(MapID,InstanceID,1,1,QingMowang+1) if FirstKill == 0 then role.SetRoleScriptData(RoleID,1,RoleDataType["Baiyaota_FirstKill"],1) if level >= 100 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) elseif level >= 80 and index <= 60 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) elseif level >= 70 and index <= 40 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) elseif level >= 60 and index <= 20 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) elseif level >= 50 and index <= 10 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) end end local QingMowang = map.GetMapScriptData(MapID,InstanceID,1,1) if QingMowang%10 == 0 and QingMowang ~= 0 then local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if index >= 70 then if TeamID ~= nil and TeamID ~= 4294967295 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then role.AddRoleItem(MapID,InstanceID,Role[i],6010819,1,-1,8,420) --30个怪后给道具入背包 end end else role.AddRoleItem(MapID,InstanceID,RoleID,6010819,1,-1,8,420) end end end if QingMowang%10 == 0 and QingMowang ~= 0 then if index >= 80 then map.MapCreateCreature(MapID,InstanceID,1550404,152,424,162) --50个怪后刷魔尊 end end elseif CreTypeID == 1550402 then map.SetMapScriptData(MapID,InstanceID,1,2,BaiMowang+1) if FirstKill == 0 then role.SetRoleScriptData(RoleID,1,RoleDataType["Baiyaota_FirstKill"],1) if level >= 100 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) elseif level >= 80 and index <= 60 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) elseif level >= 70 and index <= 40 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) elseif level >= 60 and index <= 20 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) elseif level >= 50 and index <= 10 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) end end local BaiMowang = map.GetMapScriptData(MapID,InstanceID,1,2) if BaiMowang%10 == 0 and BaiMowang ~= 0 then local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if index >= 70 then if TeamID ~= nil and TeamID ~= 4294967295 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then role.AddRoleItem(MapID,InstanceID,Role[i],6010820,1,-1,8,420) --30个怪后给道具入背包 end end else role.AddRoleItem(MapID,InstanceID,RoleID,6010820,1,-1,8,420) end end end if BaiMowang%10 == 0 and BaiMowang ~= 0 then if index >= 80 then map.MapCreateCreature(MapID,InstanceID,1550405,152,424,162) --50个怪后刷魔尊 end end elseif CreTypeID == 1550403 then map.SetMapScriptData(MapID,InstanceID,1,3,JinMowang+1) if FirstKill == 0 then role.SetRoleScriptData(RoleID,1,RoleDataType["Baiyaota_FirstKill"],1) if level >= 100 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) elseif level >= 80 and index <= 60 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) elseif level >= 70 and index <= 40 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) elseif level >= 60 and index <= 20 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) elseif level >= 50 and index <= 10 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) end end local JinMowang = map.GetMapScriptData(MapID,InstanceID,1,3) if JinMowang%10 == 0 and JinMowang ~= 0 then local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if index >= 70 then if TeamID ~= nil and TeamID ~= 4294967295 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i = 1,6 do if Role[i] and Role[i]~= 4294967295 then role.AddRoleItem(MapID,InstanceID,Role[i],6010821,1,-1,8,420) --30个怪后给道具入背包 end end else role.AddRoleItem(MapID,InstanceID,RoleID,6010821,1,-1,8,420) end end end if JinMowang%10 == 0 and JinMowang ~= 0 then if index >= 80 then map.MapCreateCreature(MapID,InstanceID,1550406,152,424,162) --50个怪后刷魔尊 end end end end aux.RegisterItemEvent(6010866, 0, "I6010866_CanUse") aux.RegisterItemEvent(6010867, 0, "I6010866_CanUse") aux.RegisterItemEvent(6010868, 0, "I6010866_CanUse") aux.RegisterItemEvent(6010866, 1, "I6010866_OnUse") aux.RegisterItemEvent(6010867, 1, "I6010866_OnUse") aux.RegisterItemEvent(6010868, 1, "I6010866_OnUse") aux.RegisterCreatureEvent(1550401,4,"C1550401_OnDie") aux.RegisterCreatureEvent(1550402,4,"C1550401_OnDie") aux.RegisterCreatureEvent(1550403,4,"C1550401_OnDie") aux.RegisterItemEvent(6020301, 0, "I6020301_CanUse") aux.RegisterItemEvent(6020301, 1, "I6020301_OnUse") aux.RegisterItemEvent(6020302, 0, "I6020301_CanUse") aux.RegisterItemEvent(6020302, 1, "I6020301_OnUse") aux.RegisterItemEvent(6020303, 0, "I6020301_CanUse") aux.RegisterItemEvent(6020303, 1, "I6020301_OnUse") function I6020301_OnUse(MapID,InstanceID,TypeID,RoleID) local Pos= {} Pos[1] = {x=126,y=129,z=60} Pos[2] = {x=153,y=143,z=94} Pos[3] = {x=160,y=249,z=125} Pos[4] = {x=128,y=391,z=142} Pos[5] = {x=121,y=391,z=173} Pos[6] = {x=184,y=310,z=148} Pos[7] = {x=148,y=114,z=68} Pos[8] = {x=145,y=141,z=105} Pos[9] = {x=142,y=106,z=199} Pos[10] ={x=196,y=151,z=192} if TypeID == 6020301 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550407,Pos[i].x,Pos[i].y,Pos[i].z) end elseif TypeID == 6020302 then for k = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550408,Pos[k].x,Pos[k].y,Pos[k].z) end elseif TypeID == 6020303 then for u = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550409,Pos[u].x,Pos[u].y,Pos[u].z) end end end function I6020301_CanUse(MapID,InstanceID,TypeID,RoleID) if MapID ~= 3067630543 then return 47,false end return 0,false end function I6020304_OnUse(MapID,InstanceID,TypeID,RoleID) local Pos= {} Pos[1] = {x=126,y=129,z=60} Pos[2] = {x=153,y=143,z=94} Pos[3] = {x=160,y=249,z=125} Pos[4] = {x=128,y=391,z=142} Pos[5] = {x=121,y=391,z=173} Pos[6] = {x=184,y=310,z=148} Pos[7] = {x=148,y=114,z=68} Pos[8] = {x=145,y=141,z=105} Pos[9] = {x=142,y=106,z=199} Pos[10] ={x=196,y=151,z=192} local rolelevel = role.GetRoleLevel(MapID,InstanceID,RoleID) if rolelevel >= 110 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550414,Pos[i].x,Pos[i].y,Pos[i].z) end elseif rolelevel >= 90 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550413,Pos[i].x,Pos[i].y,Pos[i].z) end elseif rolelevel >= 70 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550412,Pos[i].x,Pos[i].y,Pos[i].z) end elseif rolelevel >= 50 then for i = 1,10 do map.MapCreateCreature(MapID,InstanceID,1550411,Pos[i].x,Pos[i].y,Pos[i].z) end end end function I6020304_CanUse(MapID,InstanceID,TypeID,RoleID) if MapID ~= 3067630543 then return 47,false end return 0,false end aux.RegisterItemEvent(6020304, 0, "I6020304_CanUse") aux.RegisterItemEvent(6020304, 1, "I6020304_OnUse")