OBJ_DATA ye1_suitcase1
OBJ_DATA ye1_suitcase2
OBJ_DATA ye1_bonus
counter got_ye1 = 0
counter got_ye2 = 0
counter delivered_ye1 = 0

FORWARD clean_up_yellow_phone1:


yellow_phone1:
SET failed_yellow_phone1 = 0
SET flag_on_mission = 1
SET flag_on_yellow_mission = 1


ye1_suitcase1 = CREATE_OBJ ( 33.5 , 125.5 , 6.0 ) 0 briefcase END
ye1_suitcase2 = CREATE_OBJ ( 139.5 , 12.5 , 4.0 ) 0 briefcase END

DISPLAY_BRIEF ( 3769 )
POINT_ARROW_AT ( blaow , ye1_suitcase1 )

WHILE_EXEC ( delivered_ye1 = 0 )

IF ( LOCATE_CHARACTER_ON_FOOT ( p1 , 33.5 , 125.5 , 6.0 , 0.5 , 0.5  ) )
set got_ye1 = 1
DELETE_ITEM ( ye1_suitcase1 )
DISPLAY_BRIEF ( 3769 )
endif


if ( got_ye1 = 1 )
POINT_ARROW_AT ( blaow , ye1_suitcase2 )

IF ( LOCATE_CHARACTER_ON_FOOT ( p1 , 139.5 , 12.5 , 4.0 , 0.5 , 0.5  ) )
set got_ye1 = 2
set got_ye2 = 1
DELETE_ITEM ( ye1_suitcase2 )
DISPLAY_BRIEF ( 3769 )
endif
endif

if ( got_ye2 = 1 )
POINT_ARROW_AT ( blaow , 236.5 , 232.5 , 2.0 )

IF ( LOCATE_CHARACTER_ON_FOOT ( p1 , 236.5 , 232.5 , 2.0 , 0.5 , 0.5  ) )
set delivered_ye1 = 1
set got_ye2 = 2

endif
endif
endwhile


IF ( ( passed_yellow_phone1 = 0 )
AND ( delivered_ye1 = 1 ) )  
	DISPLAY_BRIEF ( 3537 ) 
	SET passed_yellow_phone1	= 1
	++ counter_all_missions_passed
	DISPLAY_MESSAGE ( 3100 ) 
        remove_arrow ( blaow )
	ADD_SCORE ( p1 , 40000 )
	ADD_MULTIPLIER ( p1 , 1 ) 
ye1_bonus = CREATE_OBJ ( 236.0 , 231.5 , 2.0 ) 0 COLLECT_08 99 END
	CHANGE_GANG_CHAR_RESPECT_AND_UPDATE ( gng3 , p1 , 1 )
	CLEAR_WANTED_LEVEL ( p1 )
	SET_PHONE_DEAD ( yellow_phone1 ) 
	DISABLE_THREAD_TRIGGER ( thr_yellow_phone1 )
	RETURN
ENDIF

clean_up_yellow_phone1:


IF ( passed_yellow_phone1 = 1 )
		++ flag_yellow_missions_passed
		++ flag_all_missions_passed
                REMOVE_ARROW ( blaow )
		IF ( flag_yellow_missions_passed = 7 )
			DISPLAY_BRIEF ( 3673 ) 
			DISPLAY_MESSAGE ( 3672 ) 
		ENDIF
	ENDIF

	IF ( failed_yellow_phone1 = 1 )
		++ flag_yellow_missions_failed
		++ flag_all_missions_failed
                REMOVE_ARROW ( blaow )
		CHANGE_GANG_CHAR_RESPECT_AND_UPDATE ( gng3 , p1 , -1 ) 
		CLEAR_WANTED_LEVEL ( p1 )
//		CLEAR_ALL_BRIEFS ( )
	ENDIF

	IF ( CHECK_DEATHARREST_EXECUTED ( ) )
		++ flag_yellow_missions_failed
		++ flag_all_missions_failed
                REMOVE_ARROW ( blaow )
		CHANGE_GANG_CHAR_RESPECT_AND_UPDATE ( gng3 , p1 , -1 ) 
		CLEAR_WANTED_LEVEL ( p1 )
	ENDIF

	MISSION_HAS_FINISHED ( )

	SET flag_on_mission	= 0
	SET flag_on_yellow_mission = 0
	
	RETURN


MISSIONSTART
GOSUB yellow_phone1:
GOSUB clean_up_yellow_phone1:
MISSIONEND

