x020191_g_scriptId=020191


x020191_g_BossId = 960101
x020191_g_BossPos = {59.41, 61.83, 1.81} -- x, z, f

x020191_g_CopySceneStage = 0
x020191_g_BossRoleBaseId = 1

x020191_g_Mission = 3059

function x020191_OnCopySceneOpen(scene)
	--print("x020191_OnCopySceneOpen------------------------------------------")
	SetCopySceneParam(scene, x020191_g_CopySceneStage, 0)
end

function x020191_OnObjEnter(scene, objId)
	if IsUser(objId) then
		local stage = GetCopySceneParam(scene, x020191_g_CopySceneStage)
		--print("stage:"..stage.."---------------------------------------------------------------")
		if stage == 0 then
			local role = GetMonsterRoleBaseIdByCombatPower(scene, objId, x020191_g_BossId)
			CreateMonster(scene, role, x020191_g_BossPos[3], x020191_g_BossPos[1], x020191_g_BossPos[2])
			SetCopySceneParam(scene, x020191_g_BossRoleBaseId, role)
			SetCopySceneParam(scene, x020191_g_CopySceneStage, 1)
		end
		SynCsStageData(scene, objId)
		AutoCombat(scene, objId, true)
	end
end

function x020191_OnObjDie( scene, objId, rolebaseId, killerId)
	local role = GetCopySceneParam(scene, x020191_g_BossRoleBaseId)
	if role == rolebaseId then
		RecordExp(scene, rolebaseId)
		--AcceptMission(scene, killerId, x020191_g_Mission)
		SetCopySceneSuccess(scene)
		ChangeJob7CopySceneEnd(scene, 1)
	end
end

function x020191_OnCopySceneTimeOut(scene)
	SetCopySceneFail(scene)
	ChangeJob7CopySceneEnd(scene, 0)
end