#Game: Liberty City Stories
#Author: Team CLEO & Freakler
#Version: 1.0
#Category: Pedestrians
#Date: 2022-02-12
#Description: Spawn a Bodyguard NPC with M4 helping you out.


0007: 21@ = 280 //Weapon ID: M4 
0007: 22@ = 68  //Ped ID: hitman 



024C: request_model 21@ //weapon
0390: load_all_models_now

020D: generate_random_float_in_range -3.0 3.0 store_to 5@ //left right of player
020D: generate_random_float_in_range 2.0 5.0 store_to 6@ //in front of player
01FA: get_player_char $PLAYER_CHAR store_to 1@
04C9: get_offset_from_char_in_world_coords 1@ offset 5@ 6@ 0.0 store_to 5@ 6@ 7@

//037B: create_random_char 5@ 6@ 7@ store_to 0@
024C: request_model 22@ //ped
0390: load_all_models_now
009A: create_char 22 model 22@ at 5@ 6@ 7@ store_to 0@

01CA: dont_remove_char 0@
01E4: tie_char 0@ to_player $PLAYER_CHAR
031E: set_char 0@ running 1
04FA: set_char_as_player_friend 0@ player $PLAYER_CHAR on 1
056D: set_char_never_targetted 0@ to 1
0541: set_char_in_players_group_can_fight 0@ can_fight 1
044B: set_char_suffers_critical_hits 0@ enable 0
0296: set_char_heed_threats 0@ flag 1          
02E7: set_char_accuracy 0@ to 100
0630: set_char_max_health 0@ to 2000
0228: set_char_health 0@ to 2000
01B7: give_weapon_to_char 0@ weapon 26 ammo 9999

024E: release_model 21@

004E: terminate_this_script