function shouhuditu4a_OnPlayerEnter(MapID, InstanceID, RoleID) unit.SetCamp(MapID, InstanceID, RoleID, 2) end aux.RegisterMapEvent("dmap4a",2, "shouhuditu4a_OnPlayerEnter") function baozang_OnPlayerLeave(MapID, InstanceID, TargetID) unit.SetCamp(MapID, InstanceID, TargetID, 0) end aux.RegisterMapEvent("dmap4a",3, "baozang_OnPlayerLeave") aux.RegisterMapEvent("dmap4a",25, "baozang_OnPlayerLeave") function baozangjidi_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID,101,207413) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.SetMonsterGenState(MapID, InstanceID, 3) end aux.RegisterCreatureEvent(1010010, 4, "baozangjidi_OnDie") aux.RegisterCreatureEvent(1086195, 4, "baozangjidi_OnDie") function baozangBOSS_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) if MapID == 2818701571 then local x = map.GetMapScriptData(MapID,InstanceID,1,1) if x == nil then x = 0 end x = x+1 map.SetMapScriptData(MapID,InstanceID,1,1,x) if x >= 2 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID,101,207415) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID,101,207414) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.SetMonsterGenState(MapID, InstanceID, 3) end local x1, y1, z1 = unit.GetPosition(MapID, InstanceID, RoleID) local guaiID = map.MapCreateCreature(MapID, InstanceID, 6040315, x1, y1, z1) for a = 1, 6 do cre.SetCreatureScriptData(MapID, InstanceID, guaiID, 1, a, 1) end end aux.RegisterCreatureEvent(1086050, 4, "baozangBOSS_OnDie") aux.RegisterCreatureEvent(1086020, 4, "baozangBOSS_OnDie")