--[[
m07.lua
SR3 Mission Script
DATE: 6/15/10
AUTHOR: Albert McDaniel & Nick Heilmann
]]--
M07_status = {
player_vehicle_type = VT_NONE,
player_for_convo = LOCAL_PLAYER,
reached_goal = false,
interrogation_in_progress = false,
club_owner_grabbed = false,
num_enemies_alive = 0,
outside_casino_reached = false,
inside_casino_reached = false,
convo_is_playing = false,
temp_weapon_local = "",
temp_weapon_remote = "",
phonecall_finished = false,
casino_brutes_dead = 0,
}
M07_timed_lines = {
bdsm = {
situation = "m07_bdsm_club_domes",
situation2 = "m07_bdsm_club_subs",
delay = 10.0,
callback = "m07_bdsm_detect_cb",
timer = INVALID_THREAD_HANDLE
},
deckers = {
situation = "m07_attack",
delay = 10.0,
callback = "m07_decker_attack_cb",
timer = INVALID_THREAD_HANDLE
}
}
M07_CTE_free_kinzie = {
name = "M07_FREE_KINZIE",
CTE_NPC_NAV = {
host = "Nav Barge CTE Local",
remote = "Nav Barge CTE Remote",
shaundi = "Nav Barge CTE Shaundi",
pierce = "Nav Barge CTE Pierce",
},
}
M07_navpoint = {
cp_starts = {
start = {
player_local = "Nav Player Local Start CP",
player_remote = "Nav Player Remote Start CP",
},
barge = {
player_local = "Nav Player Local Barge CP",
player_remote = "Nav Player Remote Barge CP",
pierce = "Nav Player Pierce Barge CP",
},
bdsm = {
player_local = "Nav Player Local BDSM CP",
player_remote = "Nav Player Remote BDSM CP",
},
pony_cart = {
player_local = "Nav Player Local Pony Cart CP",
player_remote = "Nav Player Remote Pony Cart CP",
},
casino = {
player_local = "Nav Player Local Casino CP",
player_remote = "Nav Player Remote Casino CP",
},
brute = {
player_local = "Nav Player Local Brute CP",
player_remote = "Nav Player Remote Brute CP",
},
defense = {
player_local = "Nav Player Local Defense CP",
player_remote = "Nav Player Remote Defense CP",
angel = "Nav Angel Defense CP",
oleg = "Nav Oleg Defense CP",
pierce = "Nav Pierce Defense CP",
zimos = "Nav Zimos Defense CP",
},
},
mission_end_navs = { "Mission End Nav Local", "Mission End Nav Remote"},
kinzie_leash = "Nav Kinzie Leash",
pony_cart_start = "Nav pony cart start",
zimos_car_tp = "Nav Zimos Car",
angel_defense_location_1 = "Nav Angel Defense 001",
angel_defense_location_2 = "Nav Angel Defense 002",
pierce_defense_location = "Nav Pierce Defense",
zimos_defense_location = "Nav Zimos Defense",
casino_arriving_1 = "Nav Arriving Dest 001",
casino_arriving_2 = "Nav Arriving Dest 002",
casino_arriving_3 = "Nav Arriving Dest 003",
casino_door = "Nav Casino Door",
casino_entry_1 = "Nav Casino Entry 001",
casino_entry_2 = "Nav Casino Entry 002",
casino_stairs = "Nav Casino Stairs",
casino_balcony_e_1 = "Nav Casino Balcony E 001",
casino_balcony_e_2 = "Nav Casino Balcony E 002",
casino_balcony_e_3 = "Nav Casino Balcony E 003",
casino_balcony_n = "Nav Casino Balcony N",
casino_balcony_s = "Nav Casino Balcony S",
casino_balcony_w = "Nav Casino Balcony W",
}
M07_scripted_path = {
barge_boat_patrol = { "BBP Path 001", "BBP Path 002", "BBP Path 003" },
barge_deck_patrol = "BDP Path",
pony_cart_path = "Pony Cart Path",
}
M07_spawn_region = {
casino_front_1 = "SR Casino Front 001",
casino_front_2 = "SR Casino Front 002",
casino_front_n = "SR Casino Front N", -- Currently unused
casino_front_s = "SR Casino Front S", -- Currently unused
casino_rear_n = "SR Casino Rear N",
casino_rear_s = "SR Casino Rear S",
casino_stairs_e = "SR Casino Stairs E", -- Currently unused
casino_stairs_w = "SR Casino Stairs W", -- Currently unused
casino_upper_front_n = "SR Casino Upper Front N",
casino_upper_front_s = "SR Casino Upper Front S",
casino_upper_rear_n = "SR Casino Upper Rear N",
}
M07_trigger = {
barge_dock = "Trigger Barge Dock",
barge_jetskis = "Trigger Release Jetskis",
barge_enemies01 = "Barge_Trigger 001",
barge_enemies02 = "Barge_Trigger 002",
barge_wheelhouse = "Trigger Barge Wheelhouse",
kinzie_tied_up = "Trigger Untie Kinzie",
bdsm_club = "Trigger BDSM Club",
bdsm_traffic = { "Trigger BDSM Traffic 001", "Trigger BDSM Traffic 002", "Trigger BDSM Traffic 003", "Trigger BDSM Traffic 004" },
bdsm_action_nodes = "Trigger BDSM Action Nodes",
club_owner = "Trigger Club Owner",
club_owner_interrogate = "Trigger grab club owner",
pony_stairs = "Trigger Pony Stairs",
pony_stairs_two = "Trigger Pony Stairs Two",
pony_barn = "Trigger Pony Barn",
pony_carts = "Trigger Pony Carts",
outside_casino = "Trigger Outside Casino",
inside_casino = "Trigger Inside Casino",
casino_lobby = "Trigger Casino Lobby",
mgr_breadcrumb = "Trigger Mgr Breadcrumb",
bdsm_interrogate = {
[1] = { "Trigger BDSM Int 001", "Trigger BDSM Int 012" },
[2] = { "Trigger BDSM Int 003", "Trigger BDSM Int 005", "Trigger BDSM Int 010" },
},
}
M07_mover = {
door_bdsm_front = "BDSM Front Door",
door_bdsm_locked01 = "BDSM Locked Door 01",
door_bdsm_locked02 = "BDSM Locked Door 02",
door_bdsm_locked03 = "BDSM Locked Door 03",
door_bdsm_owner = "Door BDSM Owner",
door_bdsm_hall_stair_open = "Door BDSM Hall Stair Open",
door_bdsm_hall_stairs = "Door BDSM Hall Stairs",
door_bdsm_office_stairs = "Door BDSM Office Stairs",
door_casino = "Door Casino",
door_pony = "Barn Door",
door_pony_exit = "Pony Door",
upper_bdsm_doors = { "BDSM upper door 001", "BDSM upper door 002", "BDSM upper door 003", "BDSM upper door 004", "BDSM upper door 005" },
}
M07_group = {
pierce = {
name = "GRP Pierce",
chars = { "Pierce" },
},
kinzie = {
name = "GRP Kinzie",
chars = { "Kinzie" },
},
zimos = {
name = "GRP Zimos",
chars = { "Zimos" },
},
oleg = {
name = "GRP Oleg",
chars = { "Oleg" },
},
angel = {
name = "GRP Angel",
chars = { "Angel" },
},
shaundi = {
name = "GRP Shaundi",
chars = { "Shaundi" },
},
boat_to_barge = {
name = "GRP Boat To Barge",
vehicles = { "Veh Boat To Barge", "Veh Start" },
},
bbp_guards = {
name = "GRP BBP Guards",
chars = {
{ "BBP 001", "BBP 002" },
{ "BBP 003", "BBP 004" },
{ "BBP 005", "BBP 006" },
},
vehicles = { "BBP Veh 001", "BBP Veh 002", "BBP Veh 003" },
},
bbp_riders = {
chars = { "BBP 001", "BBP 002", "BBP 003", "BBP 004", "BBP 005", "BBP 006" },
},
bdp_guards = {
name = "GRP BDP Guards",
chars = { "BDP 001", "BDP 002", "BDP 003", "BDP 004" },
},
bds_guards = {
name = "GRP BDS Guards",
chars = { "BDS 001", "BDS 002", "BDS 003", "BDS 004", "BDS 005", "BDS 006", "BDS 007", "BDS 008", "BDS 009", "BDS 010",
"BDS 011", "BDS 012", "BDS 013", "BDS 014", "BDS 015", "BDS 016", "BDS 017", "BDS 018", "BDS 019", "BDS 020", }
},
barge1 = {
members = { "BDS 003", "BDS 006", "BDS 002", "BDS 005" },
navpoints = { "Barge_Nav 001", "Barge_Nav 002", "Barge_Nav 003", "Barge_Nav 004" }
},
barge2 = {
members = { "BDS 001", "BDS 007", "BDS 014", "BDS 010" },
navpoints = { "Barge_Nav 005", "Barge_Nav 006", "Barge_Nav 007", "Barge_Nav 008" }
},
barge3 = {
members = { "BDS 017", "BDS 011", "BDS 019", "BDS 020", "BDS 018" },
navpoints = { "Barge_Nav 009", "Barge_Nav 013", "Barge_Nav 011", "Barge_Nav 012", "Barge_Nav 010" }
},
barge_cp_player_veh = {
name = "GRP Barge CP",
vehicles = { "Veh Barge CP" },
},
bdsm_ambient = {
name = "GRP BDSM Ambient",
members = { "BDSM Gimp 006", "BDSM Gimp 001", "BDSM Gimp 002",
"BDSM Gimp 003", "BDSM Gimp 004", "BDSM Gimp 005",
"BDSM Gimp 011", "BDSM Gimp 016", "BDSM Gimp 017",
"Ho 001", "Ho 002", "Ho 003", "Ho 004",
"Cage Dancer 001", "Cage Dancer 002", "Cage Dancer 005", "Cage Dancer 007",
"BDSM Prostitute 002", "BDSM Prostitute 003", "BDSM Prostitute 005", },
nodes = { "Drinker", "Dancer", "Drinker",
"Smoker", "Dancer", "Drinker",
"Dancer", "Dancer", "Drinker",
"Drinker", "Drinker", "Dancer", "Dancer",
"CageDancer", "CageDancer", "CageDancer", "CageDancer",
"Drinker", "Dancer", "Dancer", },
doms = {"Ho 001", "Ho 002", "Ho 003", "Ho 004"},
subsm = {"BDSM Gimp 001", "BDSM Gimp 002", "BDSM Gimp 005",
"BDSM Gimp 003", "BDSM Gimp 004", "BDSM Gimp 017", },
subsf = {"BDSM Gimp 011", "BDSM Gimp 016", },
},
bdsm_gimps = {
name = "GRP BDSM Gimps",
members = { "BDSM Gimp 001", "BDSM Gimp 001"},
},
bdsm_goons = {
name = "GRP BDSM Goons",
},
bdsm_patrons = {
name = "GRP BDSM Patrons",
chars = {
[1] = { "BDSM Patron 001", "BDSM Patron 012" },
[2] = { "BDSM Patron 003", "BDSM Patron 005", "BDSM Patron 010" },
},
},
bdsm_prostitutes = {
name = "GRP BDSM Prostitutes",
members = {"BDSM Prostitute 001", "BDSM Prostitute 002", "BDSM Prostitute 003", "BDSM Prostitute 004",
"BDSM Prostitute 005", "BDSM Prostitute 006", "BDSM Prostitute 009", "BDSM Prostitute 011" }
},
bdsm_cage_dancers = {
name = "GRP BDSM Cage Dancers",
members = { "Cage Dancer 001", "Cage Dancer 002", "Cage Dancer 005", "Cage Dancer 007" },
},
bdsm_rooms = {
floors = {
[1] = {
{
node_type = {"BDSM_KissFeet", "BDSM_KissMyFeet"},
members = { "BDSM Patron 001", "BDSM Prostitute 001"},
triggers = { "Trigger BDSM Int 001" },
num_patrons = 1,
patrons_alive = { true },
alive = true,
},
{
node_type = {"BDSM_Whipped", "BDSM_Whipper"},
members = { "BDSM Patron 012", "BDSM Prostitute 011"},
triggers = { "Trigger BDSM Int 012" },
num_patrons = 1,
patrons_alive = { true },
alive = true,
},
},
[2] = {
{
node_type = {"BDSM_KissFeet", "BDSM_KissMyFeet"},
members = { "BDSM Patron 003", "BDSM Prostitute 004"},
triggers = { "Trigger BDSM Int 003" },
num_patrons = 1,
patrons_alive = { true },
alive = true,
},
{
node_type = {"BDSM_Whipped", "BDSM_Whipper"},
members = { "BDSM Patron 005", "BDSM Prostitute 006"},
triggers = { "Trigger BDSM Int 005" },
num_patrons = 1,
patrons_alive = { true },
alive = true,
},
{
node_type = {"BDSM_Whipped", "BDSM_Whipper"},
members = { "BDSM Patron 010", "BDSM Prostitute 009"},
triggers = { "Trigger BDSM Int 010" },
num_patrons = 1,
patrons_alive = { true },
alive = true,
},
},
},
},
club_owner = {
name = "GRP Club Owner",
chars = { "Club Owner" },
},
pony_cart = {
name = "GRP Pony Cart Zimos",
vehicles = { "Veh Pony Cart Zimos" },
},
pony_cart_enemies = {
name = "GRP Pony Cart Enemies",
chars = {
{ "Pony Cart Enemy 001", "Pony Cart Enemy 002" },
{ "Pony Cart Enemy 003", "Pony Cart Enemy 004" },
{ "Pony Cart Enemy 005", "Pony Cart Enemy 006" },
},
vehicles = { "Veh Pony Cart Enemy 001", "Veh Pony Cart Enemy 002", "Veh Pony Cart Enemy 003" },
},
pony_cart_drivers = {
name = "GRP Pony Cart Drivers",
chars = { "Pony Cart Driver 001", "Pony Cart Driver 002", "Pony Cart Driver 003" },
},
casino_vehicle = {
name = "GRP Casino CP",
vehicles = { "Veh Casino CP" },
},
luchadores_outside = {
name = "GRP Luchadores Outside",
chars = { "Luch Out 001", "Luch Out 002", "Luch Out 003", "Luch Out 004", "Luch Out 005", "Luch Out 006", "Luch Out 007", "Luch Out 008",
"Luch Out 009", "Luch Out 010", "Luch Out 011", "Luch Out 012" },
brute = "Luch Out Brute",
},
outside_cover_vehicles = {
name = "GRP Outside Cover Vehicles",
vehicles = { "Luch Cover Veh 001", "Luch Cover Veh 002", "Luch Cover Veh 003", "Luch Cover Veh 004", "Angel Cover Veh" },
},
luchadores_arriving = {
name = "GRP Arriving",
chars = { "Luch Arriving 001" },
vehicles = { "Veh Arriving 001" },
},
balcony_enemies = {
name = "GRP Balcony Enemies",
chars = { "m07_luch_balcony 001", "m07_luch_balcony 002", "m07_luch_balcony 003", "m07_luch_balcony 004", "m07_luch_balcony 005", "m07_luch_balcony 006",
"m07_luch_balcony 007", "m07_luch_balcony 008", "m07_luch_balcony 009", "m07_luch_balcony 010", "m07_luch_balcony 011" },
},
grenadier = {
name = "GRP Grenadier",
chars = { "Grenadier", "Luch Soldier 001", "Luch Soldier 002", "Luch Soldier 003" },
vehicles = { "Veh Grenadier" },
},
brute_melee = {
name = "GRP Brute",
chars = { "Cas Def Brute" },
},
brute_flamer_1 = {
name = "GRP Brute Flamer 001",
chars = { "Cas Def Brute Flamer 001" },
},
brute_flamer_2 = {
name = "GRP Brute Flamer 002",
chars = { "Cas Def Brute Flamer 002" },
},
brute_minigun = {
name = "GRP Brute Minigun",
chars = { "Cas Def Brute Minigun" },
},
cte_npc = {
name = "GRP CTE Untie Kinzie",
chars = {
CTE_Pierce = "CTE_Pierce_NPC",
CTE_Shaundi = "CTE_Shaundi_NPC",
CTE_Kinzie = "CTE_Kinzie_NPC",
}
},
}
M07_spawn_group = {
wave_a = { name = "GRP Wave A" },
wave_b = { name = "GRP Wave B" },
wave_c = { name = "GRP Wave C" },
wave_d = { name = "GRP Wave D" },
brute_minigun = M07_group.brute_minigun,
brute_flamer_1 = M07_group.brute_flamer_1,
brute_flamer_2 = M07_group.brute_flamer_2,
grenadier = M07_group.grenadier,
}
M07_char = {
pierce = M07_group.pierce.chars[1],
kinzie = M07_group.kinzie.chars[1],
zimos = M07_group.zimos.chars[1],
oleg = M07_group.oleg.chars[1],
angel = M07_group.angel.chars[1],
shaundi = M07_group.shaundi.chars[1],
club_owner = M07_group.club_owner.chars[1],
brute_melee = M07_group.brute_melee.chars[1],
brute_flamer_1 = M07_group.brute_flamer_1.chars[1],
brute_flamer_2 = M07_group.brute_flamer_2.chars[1],
brute_minigun = M07_group.brute_minigun.chars[1],
grenadier = M07_group.grenadier.chars[1],
}
M07_text = {
reach_barge = "M07_OBJ_REACH_BARGE",
find_kinzie = "M07_OBJ_FIND_KINZIE",
untie_kinzie = "M07_OBJ_UNTIE_KINZIE",
go_to_club = "M07_OBJ_GO_TO_CLUB",
interrogate_patron = "M07_OBJ_INTERROGATE_PATRONS",
find_owner = "M07_OBJ_FIND_OWNER",
grab_owner = "M07_OBJ_GRAB_OWNER",
go_to_zimos = "M07_OBJ_GO_TO_ZIMOS",
fight_off_morningstar = "M07_OBJ_KILL_MORNINGSTAR",
find_angel = "M07_OBJ_FIND_ANGEL",
kill_luchadores = "M07_OBJ_KILL_LUCHADORES",
protect_angel = "M07_OBJ_PROTECT_ANGEL",
failure_death = {
[M07_char.oleg] = "m07_failure_oleg_died",
[M07_char.zimos] = "m07_failure_zimos_died",
[M07_char.angel] = "m07_failure_angel_died",
[M07_char.pierce] = "m07_failure_pierce_died",
[M07_char.kinzie] = "m07_failure_kinzie_died",
[M07_char.shaundi] = "m07_failure_shaundi_died",
[M07_char.club_owner] = "m07_failure_club_owner_died",
},
}
M07_lines = {
pierce_casino_fight = "M07_Casino_Fight_01",
angel_casino_fight = "M07_Casino_Fight_02",
oleg_casino_fight = "M07_Casino_Fight_03",--
angel_casino_fight2 = "M07_Casino_Fight_04",
notice_brute = "M07_Notice_Brute_01",
--played by oleg, zimos, angel
going_upstairs = "M07_Go_Upstairs",
--angel
flamethrowers = "M07_Flamer_Brute_01",--
--zimos, angel, oleg
need_help = "M07_Need_Help",--
--player
mission_end = "M07_Mission_End",--
}
M07_convo = {
-- Player, Pierce, Shaundi
mission_start = {--
name = "m07_convo_1",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Shaundi, Pierce
encounter_deckers = {--
name = "M07_Encounter_Deckers",
handle = INVALID_CONVERSATION_HANDLE,
},
kinzie_door = {
name = "M07_Open_Door_To_Kinzie",
handle = INVALID_CONVERSATION_HANDLE,
kinzie_persona_name = "Kinzie",
kinzie_persona_id = INVALID_PERSONA_HANDLE,
},
-- Player, Kinzie, Shaundi, Pierce
untie_kinzie = {--no, commented out, odd possibly in CTE?
name = "M07_Untie_Kinzie",
handle = INVALID_CONVERSATION_HANDLE,
kinzie_persona_name = "Kinzie",
kinzie_persona_id = INVALID_PERSONA_HANDLE,
},
--Player, Kinzie
kinzie_thanks = {--
name = "M07_Kinzie_Call_Say_Thanks",
handle = INVALID_CONVERSATION_HANDLE,
kinzie_persona_name = "Kinzie",
kinzie_persona_id = INVALID_PERSONA_HANDLE,
},
-- Player, Pierce
drive_bdsm = {--
name = "M07_Drive_To_BDSM_Club",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Pierce
enter_bdsm = {--
name = "m07_convo_3",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Interrogation
int_1_2 = {--
name = "m07_convo_6",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Interrogation
int_2_2 = {--
name = "M07_Interrogate_Upstairs_2",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Interrogation
interrogate = {--
name = "m07_convo_4",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Pierce
pony_barn = {--
name = "M07_Head_To_Pony_Barn",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Pierce
pony_2 = {--
name = "M07_Pony_Cart_Chase_2",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Zimos
rescue_zimos = {--
name = "M07_Rescue_Zimos",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Kinzie (cell)
kinzie_call = {--
name = "m07_convo_13",
handle = INVALID_CONVERSATION_HANDLE,
kinzie_persona_name = "Kinzie",
kinzie_persona_id = INVALID_PERSONA_HANDLE,
},
-- Player, Pierce, Zimos
mount_rescue = {--
name = "M07_Take_Zimos_To_Casino",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Kinzie (cell)
kinzie_nag = {--
name = "m07_convo_17",
handle = INVALID_CONVERSATION_HANDLE,
kinzie_persona_name = "Kinzie",
kinzie_persona_id = INVALID_PERSONA_HANDLE,
},
-- Player, Zimos, Oleg
oleg_arrives = {--
name = "M07_Exterior_Brute_Dead",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Oleg, Zimos, angel, player
first_wave = {--
name = "m07_convo_14",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Oleg, Brute
brute_grapple = {--
name = "m07_convo_18",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Oleg, Zimos
zimos_bitch = {--
name = "m07_convo_16",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Zimos
brute_minigun = {--
name = "m07_convo_22",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Zimos
pickup_minigun = {--
name = "m07_convo_20",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Angel (end)
brutes_dead = {--
name = "m07_Brutes_Dead",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Kinzie
kinzie_development = {
name = "m07_convo_10",
handle = INVALID_CONVERSATION_HANDLE,
},
-- Player, Angel (development)
angel_talk = {--
name = "m07_convo_12",
handle = INVALID_CONVERSATION_HANDLE,
},
}
M07_thread = {
zimos_pony_cart = INVALID_THREAD_HANDLE,
nodes = INVALID_THREAD_HANDLE,
luchadores_arriving_1 = INVALID_THREAD_HANDLE,
luchadores_arriving_2 = INVALID_THREAD_HANDLE,
luchadores_arriving_3 = INVALID_THREAD_HANDLE,
kinzie_nag = INVALID_THREAD_HANDLE,
angel_flee = INVALID_THREAD_HANDLE,
brute_attack = INVALID_THREAD_HANDLE,
delay_thread = INVALID_THREAD_HANDLE,
patrol = {
[1] = INVALID_THREAD_HANDLE,
[2] = INVALID_THREAD_HANDLE,
[3] = INVALID_THREAD_HANDLE,
},
carts = {
[1] = INVALID_THREAD_HANDLE,
[2] = INVALID_THREAD_HANDLE,
[3] = INVALID_THREAD_HANDLE,
},
}
M07_checkpoint = {
start = MISSION_START_CHECKPOINT, -- defined in ug_lib.lua
barge = "barge",
zimos_part_one = "zimos part 1",
zimos_part_two = "zimos part 2",
angel = "angel",
brute = "brute",
defense = "defense",
}
M07_cutscene = {
mission_intro = "07_In",
zimos_pre_pony_cart = "07_Z01",
zimos_post_pony_cart = "07_Z02",
angel_mid_checkpoint = "07_Z03",
mission_outro = "07_out",
}
--------------------------------------------------------------------------------------------------
--[[********************]]--
--[[ ]]--
--[[ Standard functions ]]--
--[[ ]]--
--[[********************]]--
-- This is the primary entry point for the mission, and is responsible for starting up the mission
-- at the specified checkpoint.
-- CALLED FROM CODE
--
-- m07_checkpoint: (string) The checkpoint the mission should begin at
-- is_restart: (bool) TRUE if the mission is restarting, FALSE otherwise
--
function m07_start(m07_checkpoint, is_restart)
-- Debug override
--m07_checkpoint = M07_checkpoint.zimos_part_two
-- Check if this mission starting from the beginning
if (m07_checkpoint == M07_checkpoint.start) then
if (not is_restart) then
-- First time playing mission
-- TODO: Play an intro cutscene
if (M07_cutscene.mission_intro ~= "") then
cutscene_play(M07_cutscene.mission_intro, nil, {M07_navpoint.cp_starts.start.player_local, M07_navpoint.cp_starts.start.player_remote}, false)
else
bink_play("07_In_v2")
-- BD: I added this because the mission is automatically started after mission 06 and
-- the mission was not teleporting the players properly when played in sequence
teleport_coop(M07_navpoint.cp_starts.start.player_local, M07_navpoint.cp_starts.start.player_remote, true)
end
else
teleport_coop(M07_navpoint.cp_starts.start.player_local, M07_navpoint.cp_starts.start.player_remote, true)
end
fade_out(0)
end
-- Disable traffic around the BDSM (must be done before the area loads to avoid existing cars)
for i,trigger in pairs(M07_trigger.bdsm_traffic) do
traffic_disable_lanes(trigger, true)
end
-- Handle mission initialization for the current checkpoint
m07_initialize(m07_checkpoint)
-- Run the mission from the current checkpoint
m07_run(m07_checkpoint)
end
-- This is the primary function responsible for running the entire mission from start to finish.
--
-- first_checkpoint: (string) The first checkpoint to begin running the mission at
--
function m07_run(first_checkpoint)
local current_checkpoint = first_checkpoint
-- Run the mission from the beginning
if (current_checkpoint == M07_checkpoint.start) then
m07_get_to_the_barge()
m07_rescue_kinzie()
-- Now move on to the next checkpoint
current_checkpoint = M07_checkpoint.barge
mission_set_checkpoint(M07_checkpoint.barge, true)
end
if (current_checkpoint == M07_checkpoint.barge) then
m07_get_to_bdsm()
-- Now move on to the next checkpoint
current_checkpoint = M07_checkpoint.zimos_part_one
mission_set_checkpoint(M07_checkpoint.zimos_part_one, true)
end
if (current_checkpoint == M07_checkpoint.zimos_part_one) then
m07_zimos_part_one_run()
-- Now move on to the next checkpoint
current_checkpoint = M07_checkpoint.zimos_part_two
mission_set_checkpoint(M07_checkpoint.zimos_part_two, true)
end
if (current_checkpoint == M07_checkpoint.zimos_part_two) then
m07_zimos_part_two_run()
-- Now move on to the next checkpoint
current_checkpoint = M07_checkpoint.angel
mission_set_checkpoint(M07_checkpoint.angel, true)
end
if (current_checkpoint == M07_checkpoint.angel) then
m07_angel_part_one_find_angel()
current_checkpoint = M07_checkpoint.brute
mission_set_checkpoint(M07_checkpoint.brute, true)
end
if (current_checkpoint == M07_checkpoint.brute) then
m07_angel_defeat_luchadores()
m07_angel_mid_checkpoint_cutscene()
current_checkpoint = M07_checkpoint.defense
mission_set_checkpoint(M07_checkpoint.defense, true)
end
if (current_checkpoint == M07_checkpoint.defense) then
m07_angel_part_two_casino_defense()
end
-- Call mission success
if (M07_cutscene.mission_outro ~= "") then
mission_end_success("m07", M07_cutscene.mission_outro, M07_navpoint.mission_end_navs)
else
-- TODO: Remove this when there's a cutscene
bink_play("07_Out_v3")
mission_end_success("m07")
end
end
-- This is the primary function responsible for cleaning up the entire mission
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++)
--
function m07_cleanup()
notoriety_force_no_spawn("luchadores", false)
notoriety_force_no_spawn("deckers", false)
notoriety_force_no_spawn("morningstar", false)
notoriety_force_no_spawn("police", false)
notoriety_force_no_spawn("stag", false)
notoriety_set_can_decay(true)
-- crib access is now allowed
crib_disable_interface( false )
set_ped_density(1.00)
mission_waypoint_remove()
cleanup_threads(M07_thread)
m07_cleanup_triggers(M07_trigger)
cleanup_callbacks({ M07_char, LOCAL_PLAYER, REMOTE_PLAYER, M07_group.luchadores_outside.brute, M07_group.luchadores_outside.chars, M07_group.pony_cart_enemies.chars,
M07_group.bbp_riders.chars, M07_group.bdp_guards.chars, M07_group.bds_guards.chars, M07_group.bdsm_ambient.members, M07_group.bdsm_gimps.members})
cleanup_spawn_regions(M07_spawn_region)
cleanup_spawn_groups(M07_spawn_group)
cleanup_groups(M07_group)
cleanup_conversations(M07_convo)
--cleanup the rooms
for i,floor_rooms in pairs (M07_group.bdsm_rooms.floors) do
for j,room in pairs(floor_rooms) do
for k,npc in pairs(room.members) do
on_death("", npc)
on_character_grabbed("", npc)
end
end
end
-- Restore traffic around the BDSM
for i,trigger in pairs(M07_trigger.bdsm_traffic) do
traffic_disable_lanes(trigger, false)
end
--kill phonecalls
audio_remove_mission_cellphone(M07_convo.kinzie_nag.name)
audio_remove_mission_cellphone(M07_convo.kinzie_call.name)
audio_remove_mission_cellphone(M07_convo.kinzie_thanks.name)
-- Unload personas
if (M07_convo.kinzie_call.kinzie_persona_id ~= INVALID_PERSONA_HANDLE) then
audio_persona_remove_2d(M07_convo.kinzie_call.kinzie_persona_id)
M07_convo.kinzie_call.kinzie_persona_id = INVALID_PERSONA_HANDLE
end
persona_clear_global_situation_override()
-- Re-enable controls
player_controls_enable(LOCAL_PLAYER)
set_player_can_enter_exit_vehicles(LOCAL_PLAYER, true)
if (coop_is_active()) then
player_controls_enable(REMOTE_PLAYER)
set_player_can_enter_exit_vehicles(REMOTE_PLAYER, true)
end
if (M07_status.temp_weapon_local ~= "") then
inv_weapon_remove_temporary(LOCAL_PLAYER, M07_status.temp_weapon_local)
end
if (M07_status.temp_weapon_remote ~= "") then
inv_weapon_remove_temporary(REMOTE_PLAYER, M07_status.temp_weapon_remote)
end
inv_weapon_disable_all_slots(false)
for i,npc_group in pairs(M07_group.pony_cart_enemies.chars) do
on_death("", M07_group.pony_cart_drivers.chars[i])
end
--make sure to clear the don't set on fire flag
character_set_never_catch_fire(LOCAL_PLAYER, false)
if (coop_is_active()) then
character_set_never_catch_fire(REMOTE_PLAYER, false)
end
-- Remove the barge zone swaps
city_zone_swap("barge", DISABLE)
-- city_zone_swap("is2", DISABLE)
end
-- Called when the mission has ended with success
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function m07_success()
--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]--
end
--------------------------------------------------------------------------------------------------
--[[*****************]]--
--[[ ]]--
--[[ Local functions ]]--
--[[ ]]--
--[[*****************]]--
-- Initialize the mission for the specified checkpoint
--
-- checkpoint: Checkpoint to initialize the mission to
--
function m07_initialize(checkpoint)
-- Make sure the screen is completly faded out
mission_start_fade_out(0.0)
-- Set the mission author
set_mission_author("Albert McDaniel")
-- Ensure the requisite zones are swapped in
city_zone_swap("barge", true)
-- city_zone_swap("is2", true) -- this is the mega brothel zone swap
-- Force notoriety off; the mission will handle spawning
notoriety_force_no_spawn("luchadores", true)
notoriety_force_no_spawn("deckers", true)
notoriety_force_no_spawn("morningstar", true)
notoriety_force_no_spawn("police", true)
notoriety_force_no_spawn("stag", true)
notoriety_set_can_decay(false)
-- crib access is not allowed
crib_disable_interface( true )
-- Checkpoint specific initialization
m07_initialize_checkpoint(checkpoint)
-- Start fading in
mission_start_fade_in()
end
--------------------------------------------------------------------------------------------------
--[[*********************************]]--
--[[ ]]--
--[[ m03_initialize Helper Functions ]]--
--[[ ]]--
--[[*********************************]]--
-- Checkpoint specific initialization
--
-- checkpoint: The checkpoint to be initialized
--
function m07_initialize_checkpoint(checkpoint)
if (checkpoint == M07_checkpoint.start) then
-- Teleport the players first to ensure correct party adding in coop
--teleport_coop(M07_navpoint.cp_starts.start.player_local, M07_navpoint.cp_starts.start.player_remote, true)
group_create(M07_group.shaundi.name, true)
on_death("m07_homie_death_fail_cb", M07_char.shaundi)
group_create(M07_group.pierce.name, true)
on_death("m07_homie_death_fail_cb", M07_char.pierce)
-- Add everyone to the party
party_add(M07_char.pierce, LOCAL_PLAYER)
if (coop_is_active()) then
party_add(M07_char.shaundi, REMOTE_PLAYER)
else
party_add(M07_char.shaundi, LOCAL_PLAYER)
end
follower_set_can_abandon(M07_char.shaundi, true)
follower_set_can_abandon(M07_char.pierce, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.shaundi)
on_dismiss("m07_failure_dismissed_cb", M07_char.pierce)
-- Spawn the first objective before the fade-in
m07_spawn_barge()
elseif (checkpoint == M07_checkpoint.barge) then
group_create(M07_group.pierce.name, true)
on_death("m07_homie_death_fail_cb", M07_char.pierce)
party_add(M07_char.pierce, LOCAL_PLAYER)
follower_set_can_abandon(M07_char.pierce, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.pierce)
teleport_coop(M07_navpoint.cp_starts.barge.player_local, M07_navpoint.cp_starts.barge.player_remote, true)
teleport(M07_char.pierce, M07_navpoint.cp_starts.barge.pierce, true)
elseif (checkpoint == M07_checkpoint.zimos_part_one) then
change_mission_enemy_team("Morningstar")
set_ped_density(0.01)
group_create(M07_group.pierce.name, true)
on_death("m07_homie_death_fail_cb", M07_char.pierce)
party_add(M07_char.pierce, LOCAL_PLAYER)
follower_set_can_abandon(M07_char.pierce, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.pierce)
teleport_coop(M07_navpoint.cp_starts.bdsm.player_local, M07_navpoint.cp_starts.bdsm.player_remote, true)
-- Go ahead and spawn the guard gimps; the rest can wait until you arrive
group_create(M07_group.bdsm_gimps.name, true)
for i,char in pairs(M07_group.bdsm_gimps.members) do
on_detection(M07_timed_lines.bdsm.callback, char)
end
elseif (checkpoint == M07_checkpoint.zimos_part_two) then
change_mission_enemy_team("Morningstar")
group_create(M07_group.pierce.name, true)
on_death("m07_homie_death_fail_cb", M07_char.pierce)
party_add(M07_char.pierce, LOCAL_PLAYER)
follower_set_can_abandon(M07_char.pierce, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.pierce)
-- Move everybody up to the pony carts
teleport_coop(M07_navpoint.cp_starts.pony_cart.player_local, M07_navpoint.cp_starts.pony_cart.player_remote, true)
-- Create Zimos after the teleport so the vehicle streams in fully
group_create(M07_group.zimos.name, true)
npc_suppress_persona(M07_char.zimos, true)
turn_invulnerable(M07_char.zimos)
on_death("m07_homie_death_fail_cb", M07_char.zimos)
group_create(M07_group.pony_cart.name, true)
vehicle_enter_teleport(M07_char.zimos, M07_group.pony_cart.vehicles[1], 0, true)
vehicle_suppress_npc_exit(M07_group.pony_cart.vehicles[1])
set_ignore_ai_flag(M07_char.zimos, true)
-- Get ready for the pony cart chase
m07_setup_pony_carts()
elseif (checkpoint == M07_checkpoint.angel) then
teleport_coop(M07_navpoint.cp_starts.casino.player_local, M07_navpoint.cp_starts.casino.player_remote, true)
change_mission_enemy_team("Luchadores")
group_create(M07_group.zimos.name, true)
on_death("m07_homie_death_fail_cb", M07_char.zimos)
on_incapacitated("m07_homie_dbno_cb", M07_char.zimos)
-- Add everyone to the player's party
party_add(M07_char.zimos, LOCAL_PLAYER)
follower_set_can_abandon(M07_char.zimos, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.zimos)
teleport (M07_char.zimos, M07_navpoint.zimos_car_tp)
group_create(M07_group.casino_vehicle.name, true)
vehicle_set_team(M07_group.casino_vehicle.vehicles[1], "Playas")
elseif (checkpoint == M07_checkpoint.brute) then
teleport_coop(M07_navpoint.cp_starts.brute.player_local, M07_navpoint.cp_starts.brute.player_remote, true)
change_mission_enemy_team("Luchadores")
group_create(M07_group.zimos.name, true)
on_death("m07_homie_death_fail_cb", M07_char.zimos)
on_incapacitated("m07_homie_dbno_cb", M07_char.zimos)
-- Add everyone to the player's party
party_add(M07_char.zimos, LOCAL_PLAYER)
follower_set_can_abandon(M07_char.zimos, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.zimos)
-- Spawn the casino exterior enemies
m07_angel_setup_casino_exterior()
elseif (checkpoint == M07_checkpoint.defense) then
teleport_coop(M07_navpoint.cp_starts.defense.player_local, M07_navpoint.cp_starts.defense.player_remote, true)
change_mission_enemy_team("Luchadores")
group_create(M07_group.zimos.name, true)
on_death("m07_homie_death_fail_cb", M07_char.zimos)
on_incapacitated("m07_homie_dbno_cb", M07_char.zimos)
group_create(M07_group.angel.name, true)
on_death("m07_homie_death_fail_cb", M07_char.angel)
on_incapacitated("m07_homie_dbno_cb", M07_char.angel)
group_create(M07_group.oleg.name, true)
on_death("m07_homie_death_fail_cb", M07_char.oleg)
on_incapacitated("m07_homie_dbno_cb", M07_char.oleg)
-- Add everyone to the player's party
if (coop_is_active()) then
party_add(M07_char.zimos, M07_char.angel, LOCAL_PLAYER)
party_add(M07_char.oleg, REMOTE_PLAYER)
else
party_add(M07_char.zimos, M07_char.oleg, M07_char.angel, LOCAL_PLAYER)
end
follower_set_can_abandon(M07_char.zimos, true)
follower_set_can_abandon(M07_char.angel, true)
follower_set_can_abandon(M07_char.oleg, true)
on_dismiss("m07_failure_dismissed_cb", M07_char.zimos)
on_dismiss("m07_failure_dismissed_cb", M07_char.angel)
on_dismiss("m07_failure_dismissed_cb", M07_char.oleg)
-- Leave followers in separate locations; do not follow the player around
follower_make_independent(M07_char.oleg, true)
follower_make_independent(M07_char.angel, true)
--follower_make_independent(M07_char.pierce, true) -- POC2: Remove Pierce
follower_make_independent(M07_char.zimos, true)
--teleport(M07_char.pierce, M07_navpoint.cp_starts.defense.pierce, true) -- POC2: Remove Pierce
teleport(M07_char.zimos, M07_navpoint.cp_starts.defense.zimos, true)
teleport(M07_char.angel, M07_navpoint.cp_starts.defense.angel, true)
teleport(M07_char.oleg, M07_navpoint.cp_starts.defense.oleg, true)
end
end
--------------------------------------------------------------------------------------------------
--[[**************************]]--
--[[ ]]--
--[[ m07_run Helper Functions ]]--
--[[ ]]--
--[[**************************]]--
---------------------------------
--[[ ]]--
--[[ 1ST CHECKPOINT (KINZIE) ]]--
--[[ ]]--
-- Kinzie is on a barge, player needs to find a boat or helicopter and get to the barge.
--
function m07_spawn_barge()
-- Force team to Deckers
mission_set_enemy_team("Deckers")
-- Spawn the enemies
group_create(M07_group.bdp_guards.name, true)
group_create(M07_group.bds_guards.name, true)
-- Put the guards on a patrol
group_create(M07_group.bbp_guards.name, true)
for i,npc_group in pairs(M07_group.bbp_guards.chars) do
vehicle_enter_group_teleport(npc_group, M07_group.bbp_guards.vehicles[i])
-- Send the boats on a patrol around the barge
vehicle_speed_override(M07_group.bbp_guards.vehicles[i], 20)
M07_thread.patrol[i] = thread_new("m07_vehicle_path_thread", M07_group.bbp_guards.vehicles[i], M07_scripted_path.barge_boat_patrol[i])
end
--setup attack callbacks
for i,char in pairs(M07_group.bds_guards.chars) do
on_attack_performed(M07_timed_lines.deckers.callback, char)
end
for i,char in pairs(M07_group.bbp_riders.chars) do
on_attack_performed(M07_timed_lines.deckers.callback, char)
end
for i,char in pairs(M07_group.bdp_guards.chars) do
on_attack_performed(M07_timed_lines.deckers.callback, char)
end
-- Spawn Kinzie
group_create(M07_group.kinzie.name, true)
set_ignore_ai_flag(M07_char.kinzie, true)
character_allow_ragdoll(M07_char.kinzie, false)
character_set_immune_to_explosion_vomit(M07_char.kinzie, true)
inv_item_remove_all(M07_char.kinzie)
set_dont_attack_me_on_sight_flag(M07_char.kinzie, true)
npc_leash_to_nav(M07_char.kinzie, M07_navpoint.kinzie_leash, 0)
on_death("m07_homie_death_fail_cb", M07_char.kinzie)
-- Spawn a boat to get to the barge
group_create(M07_group.boat_to_barge.name, true)
vehicle_set_team(M07_group.boat_to_barge.vehicles[1], "Playas")
vehicle_set_team(M07_group.boat_to_barge.vehicles[2], "Playas")
end
-- Kinzie is on a barge, player needs to find a boat or helicopter and get to the barge.
--
function m07_get_to_the_barge()
-- Start the conversation so the objective can update in the middle of it
M07_convo.mission_start.handle = audio_conversation_load(M07_convo.mission_start.name)
audio_conversation_play(M07_convo.mission_start.handle)
delay(2)
-- Tell the player to get to the barge
objective_text(0, M07_text.reach_barge, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
-- Mark the provided boat
marker_add(M07_group.boat_to_barge.vehicles[1], MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
mission_waypoint_add(M07_group.boat_to_barge.vehicles[1])
-- Wait for the player to get in any boat or helicopter, or to get within 100m of the barge
M07_status.player_vehicle_type = get_char_vehicle_type(LOCAL_PLAYER)
on_vehicle_enter("m07_player_entered_vehicle_cb", LOCAL_PLAYER)
if (coop_is_active()) then
on_vehicle_enter("m07_player_entered_vehicle_cb", REMOTE_PLAYER)
end
while ((M07_status.player_vehicle_type ~= VT_WATERCRAFT) and (M07_status.player_vehicle_type ~= VT_HELICOPTER) and (M07_status.player_vehicle_type ~= VT_AIRPLANE) and (get_dist_closest_player_to_object(M07_trigger.barge_dock) > 100)) do
thread_yield()
end
on_vehicle_enter("", LOCAL_PLAYER)
if (coop_is_active()) then
on_vehicle_enter("", REMOTE_PLAYER)
end
mission_waypoint_remove()
marker_remove(M07_group.boat_to_barge.vehicles[1], SYNC_ALL)
-- Set the barge as the next marked destination and wait for the player to reach it
M07_status.reached_goal = false
mission_waypoint_add(M07_trigger.barge_dock)
trigger_enable(M07_trigger.barge_dock, true)
marker_add_trigger(M07_trigger.barge_dock, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_goal_cb", M07_trigger.barge_dock)
trigger_enable(M07_trigger.barge_jetskis, true)
on_trigger("m07_release_jetskis", M07_trigger.barge_jetskis)
while (not M07_status.reached_goal) do
thread_yield()
end
mission_waypoint_remove()
objective_text_clear(0)
end
function m07_release_jetskis()
trigger_enable(M07_trigger.barge_jetskis, false)
for i,thr in pairs(M07_thread.patrol) do
thread_kill(M07_thread.patrol[i])
M07_thread.patrol[i] = INVALID_THREAD_HANDLE
end
end
-- Kinzie is in the wheelhouse, player needs to go there and untie Kinzie.
--
function m07_rescue_kinzie()
-- Tell the player to get to Kinzie
objective_text(0, M07_text.find_kinzie, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
M07_status.reached_goal = false
trigger_enable(M07_trigger.barge_wheelhouse, true)
marker_add_trigger(M07_trigger.barge_wheelhouse, MINIMAP_ICON_LOCATION, "", OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_wheelhouse", M07_trigger.barge_wheelhouse)
-- Provoke the Deckers to attack
notoriety_set("deckers", 3)
while not character_is_ready(M07_char.kinzie) do
thread_yield()
end
set_animation_state(M07_char.kinzie, "Hostage Idle")
npc_suppress_persona(M07_char.kinzie, true)
character_prevent_flinching(M07_char.kinzie, true)
character_prevent_bumping(M07_char.kinzie, true)
-- This door no longer exists, not sure why we had it but if it comes back and we need it, it will be here
-- Unlock the door
-- door_lock(M07_mover.door_barge, false)
delay(5)
for i, guard in pairs(M07_group.barge1.members) do
ai_do_scripted_move(guard, M07_group.barge1.navpoints[i])
delay(1)
end
trigger_enable(M07_trigger.barge_enemies01, true)
on_trigger("m07_barge_enemies01", M07_trigger.barge_enemies01)
trigger_enable(M07_trigger.barge_enemies02, true)
on_trigger("m07_barge_enemies02", M07_trigger.barge_enemies02)
-- Point out the Deckers
M07_convo.encounter_deckers.handle = audio_conversation_load(M07_convo.encounter_deckers.name)
audio_conversation_wait_for_end(M07_convo.mission_start.handle)
M07_convo.mission_start.handle = INVALID_CONVERSATION_HANDLE
audio_conversation_play(M07_convo.encounter_deckers.handle)
-- More door stuff
-- while (not door_is_open(M07_mover.door_barge)) do
-- thread_yield()
-- end
-- Added this since we no longer have a door
audio_conversation_wait_for_end(M07_convo.encounter_deckers.handle)
while (not M07_status.reached_goal) do
thread_yield()
end
trigger_enable(M07_trigger.barge_wheelhouse, false)
marker_remove_trigger(M07_trigger.barge_wheelhouse, SYNC_ALL)
objective_text_clear(0)
-- Pre-load the untie conversation
M07_convo.kinzie_door.handle = audio_conversation_load_player(M07_convo.kinzie_door.name, M07_status.player_for_convo)
audio_conversation_play(M07_convo.kinzie_door.handle)
-- Now that Kinzie has been found, tell the player to untie her
objective_text(0, M07_text.untie_kinzie, nil, nil, SYNC_ALL, OI_ASSET_USE)
marker_add(M07_char.kinzie, MINIMAP_ICON_USE, OI_ASSET_USE, OI_FLAGS_LOCATION, SYNC_ALL)
M07_status.reached_goal = false
trigger_enable(M07_trigger.kinzie_tied_up, true)
on_trigger("m07_kinzie_untie_cb", M07_trigger.kinzie_tied_up)
while (not M07_status.reached_goal) do
thread_yield()
end
-- Clean up the objective
clear_animation_state(M07_char.kinzie)
notoriety_set("deckers", 0)
--Fade to black to hide the behind the scenes teleports
fade_out(0.5)
fade_out_block()
--Set up cutscene aspect ratio and widescreen bars
cutscene_in()
-- Dismiss Shaundi, she's staying on the barge with Kinzie
npc_leash_to_nav(M07_char.shaundi, M07_CTE_free_kinzie.CTE_NPC_NAV.shaundi, 3)
party_dismiss(M07_char.shaundi)
party_dismiss(M07_char.pierce)
-- Hide existing Homies
character_hide( M07_char.pierce )
group_destroy(M07_group.shaundi.name)
group_destroy(M07_group.kinzie.name)
group_create( M07_group.cte_npc.name, true )
inv_item_remove_all( M07_group.cte_npc.chars.CTE_Kinzie )
-- End the patrols
for i,thr in pairs(M07_thread.patrol) do
thread_kill(M07_thread.patrol[i])
M07_thread.patrol[i] = INVALID_THREAD_HANDLE
end
-- Release the script groups
release_to_world(M07_group.bdp_guards.name, true)
release_to_world(M07_group.bds_guards.name, true)
release_to_world(M07_group.bbp_guards.name, true)
-- Start the untie Kinzie conversation
audio_conversation_wait_for_end(M07_convo.encounter_deckers.handle)
M07_convo.encounter_deckers.handle = INVALID_CONVERSATION_HANDLE
-- Any downed homies can die during CTEs, so revive them here if they're staying in the player's party.
if human_is_downed(M07_char.pierce) then
npc_revive(M07_char.pierce)
end
-- Play CTE
cutscene_play(M07_CTE_free_kinzie.name, nil, {M07_navpoint.cp_starts.barge.player_local, M07_navpoint.cp_starts.barge.player_remote}, false)
group_destroy( M07_group.cte_npc.name )
party_add(M07_char.pierce, LOCAL_PLAYER)
character_show( M07_char.pierce )
teleport(M07_char.pierce, M07_navpoint.cp_starts.barge.pierce, true)
cutscene_out()
fade_in( 1.5 )
fade_in_block()
-- Play the entire untie Kinzie conversation before continuing
--audio_conversation_wait_for_end(M07_convo.untie_kinzie.handle)
M07_convo.untie_kinzie.handle = INVALID_CONVERSATION_HANDLE
end
--------------------------------------
--[[ ]]--
--[[ 2ND CHECKPOINT (GET TO BDSM) ]]--
--[[ ]]--
-- Send the player to the BDSM Club
function m07_get_to_bdsm()
-- Change the default mission enemy to Morningstar so they'll randomize properly
change_mission_enemy_team("Morningstar")
mission_set_enemy_team("Morningstar")
-- Provide a car
group_create(M07_group.barge_cp_player_veh.name, true)
vehicle_set_team(M07_group.barge_cp_player_veh.vehicles[1], "Playas")
-- Go ahead and spawn the guard gimps; the rest can wait until you arrive
group_create(M07_group.bdsm_gimps.name, true)
for i,char in pairs(M07_group.bdsm_gimps.members) do
on_detection(M07_timed_lines.bdsm.callback, char)
end
-- Tell the player to go to the BDSM club
objective_text(0, M07_text.go_to_club, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
M07_status.reached_goal = false
mission_waypoint_add(M07_trigger.bdsm_club)
trigger_enable(M07_trigger.bdsm_club, true)
marker_add_trigger(M07_trigger.bdsm_club, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_goal_cb", M07_trigger.bdsm_club)
M07_convo.kinzie_thanks.kinzie_persona_id = audio_persona_load_2d(M07_convo.kinzie_thanks.kinzie_persona_name)
--Kinzie calls to say thanks
delay(5)
M07_status.phonecall_finished = false
audio_play_for_mission_cellphone(M07_convo.kinzie_thanks.name, true, true, "", "m07_finish_phonecall")
while (M07_status.phonecall_finished == false) do
thread_yield()
end
audio_persona_remove_2d(M07_convo.kinzie_thanks.kinzie_persona_id)
M07_convo.kinzie_thanks.kinzie_persona_id = INVALID_PERSONA_HANDLE
-- Talk about the BDSM
delay(6)
M07_convo.drive_bdsm.handle = audio_conversation_load(M07_convo.drive_bdsm.name)
audio_conversation_play(M07_convo.drive_bdsm.handle)
-- Wait for them to arrive
while (not M07_status.reached_goal) do
thread_yield()
end
mission_waypoint_remove()
objective_text_clear(0)
end
-----------------------------------------
--[[ ]]--
--[[ 3RD CHECKPOINT (ZIMOS PART ONE) ]]--
--[[ ]]--
-- Sets up a player and a victim for an interrogation in the BDSM club.
--
function m07_setup_player_and_victim_for_interrogation(player, victim)
-- Player
turn_invulnerable(player, false)
character_prevent_explosion_fling(player, true)
character_allow_ragdoll(player, false)
character_prevent_flinching(player, true)
character_prevent_bumping(player, true)
character_set_never_catch_fire(player, true)
player_movement_disable(player)
player_actions_disable(player)
-- Victim
turn_invulnerable(victim, false)
character_prevent_explosion_fling(victim, true)
character_allow_ragdoll(victim, false)
character_prevent_flinching(victim, true)
character_prevent_bumping(victim, true)
character_set_never_catch_fire(victim, true)
end
-- Cleans up anything we did in m07_setup_player_and_victim_for_interrogation.
--
function m07_cleanup_player_and_victim_for_interrogation(player, victim)
-- Player
turn_vulnerable(player)
character_prevent_explosion_fling(player, false)
character_allow_ragdoll(player, true)
character_prevent_flinching(player, false)
character_prevent_bumping(player, false)
character_set_never_catch_fire(player, false)
player_movement_enable(player)
player_actions_enable(player)
-- Victim
turn_vulnerable(victim)
character_prevent_explosion_fling(victim, false)
character_allow_ragdoll(victim, true)
character_prevent_flinching(victim, false)
character_prevent_bumping(victim, false)
character_set_never_catch_fire(victim, false)
end
-- Spawn all the people in and around the BDSM club
--
function m07_spawn_bdsm()
-- Force team to Morningstar
mission_set_enemy_team("Morningstar")
mission_set_enemy_team("Morningstar")
group_create(M07_group.bdsm_patrons.name, true)
group_create(M07_group.bdsm_prostitutes.name, true)
-- Lock the unneeded area off
door_lock( M07_mover.door_bdsm_locked01, true)
door_lock( M07_mover.door_bdsm_locked02, true)
door_lock( M07_mover.door_bdsm_locked03, true)
group_create(M07_group.bdsm_cage_dancers.name, false)
group_create(M07_group.bdsm_ambient.name, false)
for i,char in pairs(M07_group.bdsm_ambient.members) do
on_detection(M07_timed_lines.bdsm.callback, char)
end
for i, dom in pairs(M07_group.bdsm_ambient.doms) do
character_set_persona(dom, "TOUGH_WF")
end
for i, sub in pairs(M07_group.bdsm_ambient.subsm) do
character_set_persona(sub, "ELDERLY_WM")
end
for i, sub in pairs(M07_group.bdsm_ambient.subsf) do
character_set_persona(sub, "ELDERLY_WF")
end
M07_thread.nodes = thread_new("m07_force_action_nodes")
group_create(M07_group.bdsm_goons.name, true)
group_create(M07_group.club_owner.name, true)
character_set_only_player_grabs(M07_char.club_owner, true)
character_set_only_scripted_grabs(M07_char.club_owner, true)
set_dont_attack_me_on_sight_flag(M07_char.club_owner, true) -- Prevent homies from attacking
character_prevent_flinching(M07_char.club_owner, true)
character_prevent_bumping(M07_char.club_owner, true)
on_death("m07_homie_death_fail_cb", M07_char.club_owner)
persona_override_persona_start(M07_char.club_owner, "Interrogation")
set_suppress_synced_melee_attacks_flag(M07_char.club_owner, true)
-- We'll start these guys on patrols, put them in positions, playing animations, etc.
-- But for now, let's just move on and get the rest of the scripting done
-- Make them invulnerable until they are grabbed
for i,npc_floor in pairs(M07_group.bdsm_patrons.chars) do
for j,npc in pairs(npc_floor) do
character_set_only_player_grabs(npc, true)
--character_set_only_scripted_grabs(npc, true)
persona_override_persona_start(npc, "Interrogation")
set_suppress_synced_melee_attacks_flag(npc, true)
end
end
--put patrons in action nodes
trigger_enable(M07_trigger.bdsm_action_nodes, true)
on_trigger("m07_bdsm_action_nodes_setup", M07_trigger.bdsm_action_nodes)
on_trigger_exit("m07_bdsm_action_nodes_setup", M07_trigger.bdsm_action_nodes)
-- Only mark the first floor
for j,npc in pairs(M07_group.bdsm_patrons.chars[1]) do
marker_add(npc, MINIMAP_ICON_USE, OI_ASSET_USE)
character_set_only_scripted_grabs(npc, true)
--on_character_grabbed("m07_bdsm_interrogate_cb", npc)
end
for j,trig in pairs(M07_trigger.bdsm_interrogate[1]) do
trigger_enable(trig, true)
on_trigger("m07_bdsm_interrogate_cb", trig)
end
end
-- First part of Zimos BDSM Club
--
function m07_zimos_part_one_run()
-- Load the mission NPCs
m07_spawn_bdsm()
persona_set_global_situation_override(PS_OVERRIDE_MISSION07)
ai_set_action_delay(M07_char.pierce, "throw grenade", 9999)
notoriety_set("morningstar", 3)
zscene_prep(M07_cutscene.zimos_pre_pony_cart)
-- Play the BDSM entry conversation
M07_convo.enter_bdsm.handle = audio_conversation_load(M07_convo.enter_bdsm.name)
audio_conversation_wait_for_end(M07_convo.drive_bdsm.handle)
M07_convo.drive_bdsm.handle = INVALID_CONVERSATION_HANDLE
audio_conversation_play(M07_convo.enter_bdsm.handle)
-- Tell the player to find the club owner
objective_text(0, M07_text.interrogate_patron, nil, nil, SYNC_ALL, OI_ASSET_USE)
on_trigger("m07_reached_goal_cb", M07_trigger.club_owner)
M07_status.reached_goal = false
while (not M07_status.reached_goal) do
if (character_is_ready(M07_char.club_owner)) then
if not check_animation_state(M07_char.club_owner, "cower stand") then
set_animation_state(M07_char.club_owner, "cower stand")
end
end
thread_yield()
end
-- Mark the owner
marker_add(M07_char.club_owner, MINIMAP_ICON_USE, OI_ASSET_USE)
-- Unlock the door
door_lock(M07_mover.door_bdsm_owner, false)
audio_conversation_wait_for_end(M07_convo.enter_bdsm.handle)
M07_convo.enter_bdsm.handle = INVALID_CONVERSATION_HANDLE
-- If we found the club owner, there's no need to interrogate anyone else
cleanup_callbacks(M07_group.bdsm_patrons.chars)
marker_remove(M07_group.bdsm_patrons.chars)
objective_text_clear(0)
-- Tell the player to grab the club owner
objective_text(0, M07_text.grab_owner, nil, nil, SYNC_ALL, OI_ASSET_USE)
M07_status.club_owner_grabbed = false
while (not M07_status.club_owner_grabbed) do
thread_yield()
end
-- Re-enable controls
player_controls_enable(LOCAL_PLAYER)
if (coop_is_active()) then
player_controls_enable(REMOTE_PLAYER)
end
-- Once we've learned where Zimos is, we don't care about the club owner anymore
on_death("", M07_char.club_owner)
-- Stop the action node thread
thread_kill(M07_thread.nodes)
persona_override_persona_stop(M07_char.club_owner)
-- Spawn Zimos
group_create(M07_group.zimos.name, true)
turn_invulnerable(M07_char.zimos)
npc_suppress_persona(M07_char.zimos, true)
on_death("m07_homie_death_fail_cb", M07_char.zimos)
group_create(M07_group.pony_cart.name, true)
vehicle_enter_teleport(M07_char.zimos, M07_group.pony_cart.vehicles[1], 0)
vehicle_suppress_npc_exit(M07_group.pony_cart.vehicles[1])
set_ignore_ai_flag(M07_char.zimos, true)
-- Unlock the stair doors and open the one by the player
door_lock(M07_mover.door_bdsm_hall_stairs, false)
door_lock(M07_mover.door_bdsm_office_stairs, false)
door_open(M07_mover.door_bdsm_office_stairs)
-- Tell the player to find Zimos
objective_text(0, M07_text.go_to_zimos, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
-- BD: Added this here to try to brute force this
marker_remove(M07_char.club_owner)
-- Wait for the player to enter the stairs
M07_status.reached_goal = false
trigger_enable(M07_trigger.pony_stairs, true)
on_trigger("m07_reached_goal_cb", M07_trigger.pony_stairs)
marker_add_trigger(M07_trigger.pony_stairs, MINIMAP_ICON_LOCATION, "", OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
while (not M07_status.reached_goal) do
thread_yield()
end
door_open(M07_mover.door_bdsm_hall_stair_open)
-- Wait for the player to get near the pony barn door
M07_status.reached_goal = false
trigger_enable(M07_trigger.pony_stairs_two, true)
on_trigger("m07_reached_goal_cb", M07_trigger.pony_stairs_two)
marker_add_trigger(M07_trigger.pony_stairs_two, MINIMAP_ICON_LOCATION, "", OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
while (not M07_status.reached_goal) do
thread_yield()
end
door_open(M07_mover.door_bdsm_hall_stairs)
-- door_open(M07_mover.door_pony) ADD THIS BACK IN WHEN ITS POSSIBLE TO GET THE BDSM_SM LAYER FILE
-- Mark the barn entry as a waypoint
M07_status.reached_goal = false
trigger_enable(M07_trigger.pony_barn, true)
marker_add_trigger(M07_trigger.pony_barn, MINIMAP_ICON_LOCATION, "", OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_goal_cb", M07_trigger.pony_barn)
while (not M07_status.reached_goal) do
thread_yield()
end
-- Remark about the pony barn
M07_convo.pony_barn.handle = audio_conversation_load(M07_convo.pony_barn.name)
audio_conversation_play(M07_convo.pony_barn.handle)
-- Mark Zimos' location
M07_status.reached_goal = false
trigger_enable(M07_trigger.pony_carts, true)
marker_add_trigger(M07_trigger.pony_carts, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_goal_cb", M07_trigger.pony_carts)
while (not M07_status.reached_goal) do
thread_yield()
end
objective_text_clear(0)
audio_conversation_end(M07_convo.pony_barn.handle)
M07_convo.pony_barn.handle = INVALID_CONVERSATION_HANDLE
persona_clear_global_situation_override()
if (M07_cutscene.zimos_pre_pony_cart ~= "") then
cutscene_play(M07_cutscene.zimos_pre_pony_cart, nil, {M07_navpoint.cp_starts.pony_cart.player_local, M07_navpoint.cp_starts.pony_cart.player_remote})
-- Cleanup all the stuff spawned for the inside portion of the BDSM club
cleanup_groups({ M07_group.bdsm_prostitutes, M07_group.bdsm_cage_dancers, M07_group.bdsm_gimps, M07_group.bdsm_goons, M07_group.bdsm_patrons, M07_group.club_owner, M07_group.barge_cp_player_veh })
-- Get ready for the pony cart chase
m07_setup_pony_carts()
else
-- TODO: Remove this once there is a real cutscene
fade_out(0.5)
fade_out_block()
-- Cleanup all the stuff spawned for the inside portion of the BDSM club
cleanup_groups({ M07_group.bdsm_prostitutes, M07_group.bdsm_cage_dancers, M07_group.bdsm_gimps, M07_group.bdsm_goons, M07_group.bdsm_patrons, M07_group.club_owner, M07_group.barge_cp_player_veh })
-- Move everybody up to the pony carts (before the bink so it has time to stream vehicles)
teleport_coop(M07_navpoint.cp_starts.pony_cart.player_local, M07_navpoint.cp_starts.pony_cart.player_remote, true)
--bink_play("07_z01")
-- Get ready for the pony cart chase
m07_setup_pony_carts()
fade_in(0.5)
fade_in_block()
end
end
------------------------------------------
--[[ ]]--
--[[ 4th CHECKPOINT (ZIMOS PONY CART) ]]--
--[[ ]]--
-- Spawn the enemy carts and put everyone in place for the chase
function m07_setup_pony_carts()
-- Give the player infinite rifle ammo
M07_status.temp_weapon_local = inv_item_in_slot(LOCAL_PLAYER, "rifle")
if (M07_status.temp_weapon_local == "none") then
M07_status.temp_weapon_local = "Rifle-Gang"
end
inv_weapon_add_temporary(LOCAL_PLAYER, M07_status.temp_weapon_local, 1, true, true, false, true)
mesh_mover_hide(M07_mover.door_pony_exit)
-- Put either the coop player or Pierce in the second seat
if (coop_is_active()) then
-- Give the player infinite rifle ammo
M07_status.temp_weapon_remote = inv_item_in_slot(REMOTE_PLAYER, "rifle")
if (M07_status.temp_weapon_remote == "none") then
M07_status.temp_weapon_remote = "Rifle-Gang"
end
inv_weapon_add_temporary(REMOTE_PLAYER, M07_status.temp_weapon_remote, 1, true, true, false, true)
-- Put them in the pony cart
while not vehicle_enter_teleport(REMOTE_PLAYER, M07_group.pony_cart.vehicles[1], 2) do
thread_yield()
end
set_player_can_enter_exit_vehicles(REMOTE_PLAYER, false)
-- Disable Pierce
follower_set_can_abandon(M07_char.pierce, false)
character_hide(M07_char.pierce)
else
-- Put Pierce in the pony cart
inv_item_equip(WEAPON_SLOT_RIFLE, M07_char.pierce)
vehicle_enter_teleport(M07_char.pierce, M07_group.pony_cart.vehicles[1], 2)
end
inv_weapon_disable_all_but_this_slot(WEAPON_SLOT_RIFLE)
-- Put the player in the pony cart (this must come second so Pierce doesn't block the co-op player)
while not vehicle_enter_teleport(LOCAL_PLAYER, M07_group.pony_cart.vehicles[1], 1) do
thread_yield()
end
set_player_can_enter_exit_vehicles(LOCAL_PLAYER, false)
-- Set Zimos to be unjackable
set_unjackable_flag(M07_group.pony_cart.vehicles[1], true)
-- Spawn pony cart enemies
group_create(M07_group.pony_cart_enemies.name, true)
group_create(M07_group.pony_cart_drivers.name, true)
M07_status.num_enemies_alive = 0
for i,npc_group in pairs(M07_group.pony_cart_enemies.chars) do
-- Put the driver in the first seat and track their death
vehicle_enter_teleport(M07_group.pony_cart_drivers.chars[i], M07_group.pony_cart_enemies.vehicles[i], 0)
on_death("m07_driver_killed_cb", M07_group.pony_cart_drivers.chars[i])
-- Put the enemies in the remaining seats and track their deaths
for j,npc in pairs(npc_group) do
if (character_exists(npc) and not character_is_dead(npc)) then
-- Put them in the vehicle
set_ignore_ai_flag(npc, true) -- Prevent shooting for a short time
vehicle_enter_teleport(npc, M07_group.pony_cart_enemies.vehicles[i], j)
on_death("m07_pony_enemy_killed_cb", npc)
marker_add(npc, MINIMAP_ICON_KILL, OI_ASSET_KILL)
M07_status.num_enemies_alive = M07_status.num_enemies_alive + 1
ai_set_action_delay(npc, "throw grenade", 9999)
end
end
vehicle_suppress_npc_exit(M07_group.pony_cart_enemies.vehicles[i])
end
end
-- Second part Zimos section, PONY CART
--
function m07_zimos_part_two_run()
set_ped_density(1.00)
-- can't be downed during ride, if you die, you fail the mission
set_players_can_be_downed(LOCAL_PLAYER, false)
if (coop_is_active() == true) then
set_players_can_be_downed(REMOTE_PLAYER, false)
end
-- lock the carts down before we send them along their way
for i, vehicle in pairs(M07_group.pony_cart_enemies.vehicles) do
vehicle_disable_chase(vehicle, true)
vehicle_disable_flee(vehicle, true)
end
-- Tell Zimos to start driving
set_ignore_ai_flag(M07_char.zimos, false)
vehicle_speed_override(M07_group.pony_cart.vehicles[1], 10)
M07_thread.zimos_pony_cart = thread_new("m07_vehicle_path_thread", M07_group.pony_cart.vehicles[1], M07_scripted_path.pony_cart_path)
turn_vulnerable(M07_char.zimos)
zscene_prep(M07_cutscene.zimos_post_pony_cart)
-- Allow shooting after a short delay
for i,npc_group in pairs(M07_group.pony_cart_enemies.chars) do
-- Start the cart on its way
M07_thread.patrol[i] = thread_new("m07_pony_chase_thread", M07_group.pony_cart_enemies.vehicles[i], npc_group, i)
M07_thread.carts[i] = thread_new("m07_pony_cart_alive_thread", M07_group.pony_cart_enemies.vehicles[i], npc_group)
delay(0.5)
end
-- Tell the player to kill the chasers
objective_text(0, M07_text.fight_off_morningstar, nil, nil, SYNC_ALL, OI_ASSET_KILL)
while (M07_status.num_enemies_alive > 3) do
thread_yield()
end
-- Remark after half the guys have died
M07_convo.pony_2.handle = audio_conversation_load(M07_convo.pony_2.name)
audio_conversation_play(M07_convo.pony_2.handle)
-- Wait for the rest to die
while (M07_status.num_enemies_alive > 0) do
thread_yield()
end
objective_text_clear(0)
inv_weapon_disable_all_slots(false)
-- can't be downed during ride, if you die, you fail the mission
set_players_can_be_downed(LOCAL_PLAYER, true)
if (coop_is_active() == true) then
set_players_can_be_downed(REMOTE_PLAYER, true)
end
--clear zimos's thread
thread_kill(M07_thread.zimos_pony_cart)
M07_thread.zimos_pony_cart = INVALID_THREAD_HANDLE
-- End the patrols
for i,thr in pairs(M07_thread.patrol) do
thread_kill(M07_thread.patrol[i])
M07_thread.patrol[i] = INVALID_THREAD_HANDLE
end
for i, thr in pairs(M07_thread.carts) do
if (M07_thread.carts[i] ~= INVALID_THREAD_HANDLE) then
thread_kill(M07_thread.carts[i])
M07_thread.carts[i] = INVALID_THREAD_HANDLE
end
end
-- Remove the death callbacks from the remaining drivers
for i,npc in pairs(M07_group.pony_cart_drivers.chars) do
if (character_exists(npc) and not character_is_dead(npc)) then
on_death("", npc)
end
end
audio_conversation_end(M07_convo.pony_2.handle)
M07_convo.pony_2.handle = INVALID_CONVERSATION_HANDLE
delay(1.5)
-- Play a z-scene
if (M07_cutscene.zimos_post_pony_cart ~= "") then
cutscene_play(M07_cutscene.zimos_post_pony_cart, nil, {M07_navpoint.cp_starts.casino.player_local, M07_navpoint.cp_starts.casino.player_remote})
else
-- TODO: Remove this once there is a real cutscene
fade_out(0.5)
fade_out_block()
end
-- Restore the players to normal
set_player_can_enter_exit_vehicles(LOCAL_PLAYER, true)
inv_weapon_remove_temporary(LOCAL_PLAYER, M07_status.temp_weapon_local)
if (coop_is_active()) then
set_player_can_enter_exit_vehicles(REMOTE_PLAYER, true)
inv_weapon_remove_temporary(REMOTE_PLAYER, M07_status.temp_weapon_remote)
end
notoriety_set("morningstar", 0)
-- Add Zimos as a homie
party_dismiss(M07_char.pierce)
party_add(M07_char.zimos, LOCAL_PLAYER)
npc_suppress_persona(M07_char.zimos, false)
teleport (M07_char.zimos, M07_navpoint.zimos_car_tp)
-- Cleanup the pony carts
cleanup_groups({ M07_group.pony_cart, M07_group.pony_cart_enemies, M07_group.pony_cart_drivers })
-- Spawn a car and move everybody there
group_create(M07_group.casino_vehicle.name, true)
vehicle_set_team(M07_group.casino_vehicle.vehicles[1], "Playas")
if (M07_cutscene.zimos_post_pony_cart == "") then
--bink_play("07_z02")
teleport_coop(M07_navpoint.cp_starts.casino.player_local, M07_navpoint.cp_starts.casino.player_remote, true)
fade_in(0.5)
fade_in_block()
end
end
---------------------------------------
--[[ ]]--
--[[ 5TH CHECKPOINT (ANGEL CASINO) ]]--
--[[ ]]--
-- Helper function to create enemies outside the casino
function m07_angel_setup_casino_exterior()
-- Change the default mission enemy to Luchadores so they'll randomize properly
change_mission_enemy_team("Luchadores")
-- Force team to Luchadores
mission_set_enemy_team("Luchadores")
-- Go ahead and create the NPCs so they are visible as the player drives up
group_create(M07_group.luchadores_outside.name, true)
group_create(M07_group.outside_cover_vehicles.name, true)
group_create(M07_group.luchadores_arriving.name, true)
vehicle_infinite_mass(M07_group.luchadores_arriving.vehicles[1], true) -- Don't let other cars disrupt this one
vehicle_enter_teleport(M07_group.luchadores_arriving.chars[1], M07_group.luchadores_arriving.vehicles[1])
vehicle_enter_teleport(M07_group.luchadores_outside.chars[1], M07_group.outside_cover_vehicles.vehicles[1])
vehicle_enter_teleport(M07_group.luchadores_outside.chars[2], M07_group.outside_cover_vehicles.vehicles[1], 1)
vehicle_enter_teleport(M07_group.luchadores_outside.chars[3], M07_group.outside_cover_vehicles.vehicles[1], 2)
--vehicle_enter_teleport(M07_group.luchadores_outside.chars[13], M07_group.outside_cover_vehicles.vehicles[1], 5)
-- Spawn Angel and set him as invulnerable for this portion of the mission
group_create(M07_group.angel.name, true)
npc_suppress_persona(M07_char.angel, true)
turn_invulnerable(M07_char.angel)
on_death("m07_homie_death_fail_cb", M07_char.angel)
on_incapacitated("m07_homie_dbno_cb", M07_char.angel)
-- Spawn Oleg, but hide him until needed (this is to avoid load delays)
group_create_hidden(M07_group.oleg.name)
-- Keep them from killing each other before the player gets there
set_ignore_ai_flag(M07_char.angel, true)
for i,luch in pairs(M07_group.luchadores_outside.chars) do
set_ignore_ai_flag(luch, true)
end
set_ignore_ai_flag(M07_group.luchadores_outside.brute, true)
set_ignore_ai_flag(M07_group.luchadores_arriving.chars[1], true)
end
-- First part of Angel's casino checkpoint where the player finds Angel out in front
-- of the casino, fighting off attacking Luchadores.
--
function m07_angel_part_one_find_angel()
-- Load the Kinzie call conversation
M07_convo.kinzie_call.kinzie_persona_id = audio_persona_load_2d(M07_convo.kinzie_call.kinzie_persona_name)
--M07_convo.kinzie_call.handle = audio_conversation_load(M07_convo.kinzie_call.name)
on_death("", M07_char.pierce)
-- Start the Kinzie phone call
M07_status.phonecall_finished = false
audio_play_for_mission_cellphone(M07_convo.kinzie_call.name, true, true, "", "m07_finish_phonecall")
while (M07_status.phonecall_finished == false) do
thread_yield()
end
-- Set the new objective
M07_status.outside_casino_reached = false
objective_text(0, M07_text.find_angel, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
trigger_enable(M07_trigger.outside_casino, true)
on_trigger("m07_outside_casino_reached_cb", M07_trigger.outside_casino)
delay(2)
--zimos thanks the player
M07_convo.rescue_zimos.handle = audio_conversation_load(M07_convo.rescue_zimos.name)
audio_conversation_play(M07_convo.rescue_zimos.handle)
-- Spawn the enemies
m07_angel_setup_casino_exterior()
-- Add a waypoint and marker to Angel
mission_waypoint_add(M07_char.angel)
marker_add(M07_char.angel, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
-- Make sure the conversation is finished and play another
M07_convo.mount_rescue.handle = audio_conversation_load(M07_convo.mount_rescue.name)
audio_conversation_wait_for_end(M07_convo.rescue_zimos.handle)
M07_convo.rescue_zimos.handle = INVALID_CONVERSATION_HANDLE
audio_persona_remove_2d(M07_convo.kinzie_call.kinzie_persona_id)
M07_convo.kinzie_call.kinzie_persona_id = INVALID_PERSONA_HANDLE
delay(4)
audio_conversation_play(M07_convo.mount_rescue.handle)
--make sure that conversation is done and play the newsclip
audio_conversation_wait_for_end(M07_convo.mount_rescue.handle)
M07_convo.mount_rescue.handle = INVALID_CONVERSATION_HANDLE
delay(5)
if is_syn_tower_destroyed() then
radio_newsbreak("M06_Building_Gone")
else
radio_newsbreak("M06_Building_Stay")
end
-- Wait for the player to get to the outside of the casino
while (not M07_status.outside_casino_reached) do
thread_yield()
end
-- Remove the waypoint and mini-map icon from Angel
mission_waypoint_remove()
marker_remove(M07_char.angel)
objective_text_clear(0)
end
------------------------------------------
--[[ ]]--
--[[ 6TH CHECKPOINT (LUCHADORE FIGHT) ]]--
--[[ ]]--
-- Fight off attacking Luchadores.
--
function m07_angel_defeat_luchadores()
-- Set up the attacking Luchadores
set_ignore_ai_flag(M07_char.angel, false)
notoriety_set("luchadores", 3)
for i,luch in pairs(M07_group.luchadores_outside.chars) do
-- Make them attack Angel at first
set_ignore_ai_flag(luch, false)
ai_add_enemy_target(luch, M07_char.angel, ATTACK_NOW)
--ai_add_enemy_target(luch, CLOSEST_PLAYER, ATTACK_ON_SIGHT)
end
-- Set up separate threads to tell the arriving vehicles where to go, then explode one of them
M07_thread.luchadores_arriving_1 = thread_new("m07_luchadores_arriving_1_thread")
M07_thread.luchadores_arriving_2 = thread_new("m07_luchadores_arriving_2_thread")
M07_thread.luchadores_arriving_3 = thread_new("m07_luchadores_arriving_3_thread")
-- Set the new objective to killing all the Luchadores
objective_text(0, M07_text.kill_luchadores, nil, nil, SYNC_ALL, OI_ASSET_KILL)
M07_status.num_enemies_alive = 0
for i,npc in pairs(M07_group.luchadores_outside.chars) do
if not character_is_dead(npc) then
on_death("m07_enemy_killed_cb", npc)
marker_add(npc, MINIMAP_ICON_KILL, OI_ASSET_KILL)
M07_status.num_enemies_alive = M07_status.num_enemies_alive + 1
end
end
-- Include the brute
if not character_is_dead(M07_group.luchadores_outside.brute) then
on_death("m07_enemy_killed_cb", M07_group.luchadores_outside.brute)
marker_add(M07_group.luchadores_outside.brute, MINIMAP_ICON_KILL, OI_ASSET_KILL_FULL, OI_FLAG_STICKY + OI_FLAG_DISPLAY_DISTANCE)
M07_status.num_enemies_alive = M07_status.num_enemies_alive + 1
end
zscene_prep(M07_cutscene.angel_mid_checkpoint)
-- Wait until the brute is dead
while (not character_is_dead(M07_group.luchadores_outside.brute)) do
thread_yield()
end
-- Once the brute has died, play a victory line (SP ADDED 11/7/10 for POC 2)
delay(2)
audio_play_persona_line(LOCAL_PLAYER, "M07_Exterior_Brute_Dead_01")
delay(1.5) -- Allow it to play out then wait a few seconds before playing the Zimos Bitch conversation
M07_convo.zimos_bitch.handle = audio_conversation_load(M07_convo.zimos_bitch.name)
delay(1)
-- Play the Zimos bitch conversation
audio_conversation_play(M07_convo.zimos_bitch.handle)
audio_conversation_wait_for_end(M07_convo.zimos_bitch.handle)
M07_convo.zimos_bitch.handle = INVALID_CONVERSATION_HANDLE
-- Wait until most are dead, then send in Oleg
while (M07_status.num_enemies_alive > 5) do
thread_yield()
end
-- Set up a separate thread to send Angel into the casino
M07_thread.angel_flee = thread_new("m07_angel_flee_thread")
-- Reveal Oleg, set him as invulnerable for this portion of the mission, and add him to the player's party
while (not(group_create_check_done(M07_group.oleg.name))) do
thread_yield()
end
group_show(M07_group.oleg.name)
turn_invulnerable(M07_char.oleg)
on_death("m07_homie_death_fail_cb", M07_char.oleg)
on_incapacitated("m07_homie_dbno_cb", M07_char.oleg)
if (coop_is_active()) then
party_add(M07_char.oleg, REMOTE_PLAYER)
else
party_add(M07_char.oleg, LOCAL_PLAYER)
end
-- Load the Oleg arrival conversation, wait for him to arrive, the play it
--M07_convo.oleg_arrives.handle = audio_conversation_load(M07_convo.oleg_arrives.name)
delay(4)
audio_play_persona_line(LOCAL_PLAYER, "M07_Exterior_Brute_Dead_03")
delay(4)
audio_play_persona_line(M07_char.oleg, "M07_Exterior_Brute_Dead_04")
--audio_conversation_play(M07_convo.oleg_arrives.handle)
--audio_conversation_wait_for_end(M07_convo.oleg_arrives.handle)
--M07_convo.oleg_arrives.handle = INVALID_CONVERSATION_HANDLE
delay(2)
-- Wait until all luchadores are dead
while (M07_status.num_enemies_alive > 0) do
thread_yield()
end
objective_text_clear(0)
-- Once all luchadores are dead, tell the player to get into the casino
delay(1)
audio_play_persona_line(LOCAL_PLAYER, "M07_Exterior_Brute_Dead_05")
M07_status.inside_casino_reached = false
objective_text(0, M07_text.find_angel, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
trigger_enable(M07_trigger.inside_casino, true)
on_trigger("m07_inside_casino_reached_cb", M07_trigger.inside_casino)
trigger_enable(M07_trigger.casino_lobby, true)
marker_add_trigger(M07_trigger.casino_lobby, MINIMAP_ICON_LOCATION, "", OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_inside_casino_reached_cb", M07_trigger.casino_lobby)
-- Set up a separate thread for Kinzie to nag the player if he doesn't enter the casino
M07_thread.kinzie_nag = thread_new("m07_kinzie_nag_thread")
while (not M07_status.inside_casino_reached) do
thread_yield()
end
objective_text_clear(0)
-- Stop Kinzie's call, if active
audio_remove_mission_cellphone(M07_convo.kinzie_nag.name)
--audio_conversation_end(M07_convo.kinzie_nag.handle)
--M07_convo.kinzie_nag.handle = INVALID_CONVERSATION_HANDLE
audio_persona_remove_2d(M07_convo.kinzie_nag.kinzie_persona_id)
M07_convo.kinzie_nag.kinzie_persona_id = INVALID_PERSONA_HANDLE
-- Stop the created threads
thread_kill(M07_thread.luchadores_arriving_1)
M07_thread.luchadores_arriving_1 = INVALID_THREAD_HANDLE
thread_kill(M07_thread.luchadores_arriving_2)
M07_thread.luchadores_arriving_2 = INVALID_THREAD_HANDLE
thread_kill(M07_thread.luchadores_arriving_3)
M07_thread.luchadores_arriving_3 = INVALID_THREAD_HANDLE
thread_kill(M07_thread.angel_flee)
M07_thread.angel_flee = INVALID_THREAD_HANDLE
thread_kill(M07_thread.kinzie_nag)
M07_thread.kinzie_nag = INVALID_THREAD_HANDLE
-- Re-enable Angel's AI for the next sequence
turn_vulnerable(M07_char.angel)
set_ignore_ai_flag(M07_char.angel, false)
-- Clear any unfinished commands
ai_clear_scripted_action(M07_char.angel)
ai_clear_scripted_action(M07_char.oleg)
end
-- Cutscene that occurs between parts one and two of Angel's casino checkpoint
--
function m07_angel_mid_checkpoint_cutscene()
-- Start the cutscene
if (M07_cutscene.angel_mid_checkpoint ~= "") then
cutscene_play(M07_cutscene.angel_mid_checkpoint, nil, {M07_navpoint.cp_starts.defense.player_local, M07_navpoint.cp_starts.defense.player_remote})
else
-- TODO: Remove this once there is a real cutscene
bink_play("07_Z03")
fade_out(0.5)
fade_out_block()
end
-- Add Angel to the player's party
party_add(M07_char.angel, LOCAL_PLAYER)
npc_suppress_persona(M07_char.angel, false)
-- Prevent Oleg from doing anything until the enemies spawn
set_ignore_ai_flag(M07_char.oleg, true)
-- Leave followers in separate locations; do not follow the player around
follower_make_independent(M07_char.oleg, true)
follower_make_independent(M07_char.angel, true)
--follower_make_independent(M07_char.pierce, true) -- POC2: Remove Pierce
follower_make_independent(M07_char.zimos, true)
-- Teleport everybody to the right place for the cutscene
if (M07_cutscene.angel_mid_checkpoint == "") then
teleport_coop(M07_navpoint.cp_starts.defense.player_local, M07_navpoint.cp_starts.defense.player_remote, true)
end
--teleport(M07_char.pierce, M07_navpoint.cp_starts.defense.pierce) -- POC2: Remove Pierce
teleport(M07_char.zimos, M07_navpoint.cp_starts.defense.zimos)
teleport(M07_char.angel, M07_navpoint.cp_starts.defense.angel)
teleport(M07_char.oleg, M07_navpoint.cp_starts.defense.oleg)
-- Cleanup the people and vehicles outside
cleanup_groups({ M07_group.luchadores_outside, M07_group.outside_cover_vehicles })
-- TODO: Remove this once there is a real cutscene
if (M07_cutscene.angel_mid_checkpoint == "") then
fade_in(0.5)
fade_in_block()
end
end
---------------------------------------
--[[ ]]--
--[[ 7TH CHECKPOINT (ANGEL CASINO) ]]--
--[[ ]]--
-- Second part of Angel's casino checkpoint where the good guys are inside the casino fending
-- off hordes of bad guys. Brutes are introduced here.
--
function m07_angel_part_two_casino_defense()
-- Leave followers in separate locations; do not follow the player around
ai_set_personality(M07_char.angel, "gang defensive")
--ai_set_personality(M07_char.pierce, "gang defensive") -- POC2: Remove Pierce
ai_set_personality(M07_char.zimos, "gang defensive")
ai_do_scripted_move(M07_char.angel, M07_navpoint.angel_defense_location_1)
--ai_do_scripted_move(M07_char.pierce, M07_navpoint.pierce_defense_location) -- POC2: Remove Pierce
--ai_do_scripted_move(M07_char.zimos, M07_navpoint.zimos_defense_location)
npc_leash_to_nav(M07_char.angel, M07_navpoint.angel_defense_location_1, 15)
--npc_leash_to_nav(M07_char.pierce, M07_navpoint.pierce_defense_location, 3) -- POC2: Remove Pierce
npc_leash_to_nav(M07_char.zimos, M07_navpoint.cp_starts.defense.zimos, 15)
-- TODO: This is just a temp hack to make sure Oleg doesn't lose in brute-vs-brute
set_max_hit_points(M07_char.oleg, 99999, true)
-- Set the next objective
objective_text(0, M07_text.protect_angel, nil, nil, SYNC_ALL, OI_ASSET_DEFEND)
marker_add(M07_char.angel, MINIMAP_ICON_PROTECT_ACQUIRE, OI_ASSET_DEFEND)
--==== WAVE 1 ====--
-- Force the first group of enemies to come through the front door
spawn_region_enable(M07_spawn_region.casino_front_1, true)
spawn_region_enable(M07_spawn_region.casino_front_2, true)
-- Spawn the brute behind the luchadores and have him walk in-view for dramatic effect
group_create(M07_group.brute_melee.name, true)
-- Set up a separate thread to move the brute into view and send Oleg after him
M07_thread.brute_attack = thread_new("m07_melee_brute_thread")
zscene_prep(M07_cutscene.mission_outro)
-- Start with only 2 groups; we can ramp up later
delay(3)
continuous_spawn_start(M07_spawn_group.wave_a.name)
continuous_spawn_start(M07_spawn_group.wave_b.name)
-- Once the first wave has spawned, enable the rest of the forward spawn regions; the "front" is the front
delay(8.0)
continuous_spawn_start(M07_spawn_group.wave_c.name)
-- Wait until the brute has been disposed of
while not character_is_dead(M07_char.brute_melee) do
thread_yield()
end
-- Stop the brute attack thread
thread_kill(M07_thread.brute_attack)
M07_thread.brute_attack = INVALID_THREAD_HANDLE
-- Re-enable Oleg's actions, just to be safe
ai_set_action_delay(M07_char.oleg, "ALL", 0) -- Allow all actions now
-- Disable continuous spawns and wait a short time to provide a breather
continuous_spawn_stop(M07_spawn_group.wave_a.name)
continuous_spawn_stop(M07_spawn_group.wave_b.name)
continuous_spawn_stop(M07_spawn_group.wave_c.name)
spawn_region_enable(M07_spawn_region.casino_front_1, false)
spawn_region_enable(M07_spawn_region.casino_front_2, false)
-- Load the Angel intro conversation
--audio_conversation_wait_for_end(M07_convo.brute_grapple.handle)
--M07_convo.brute_grapple.handle = INVALID_CONVERSATION_HANDLE
--M07_convo.angel_talk.handle = audio_conversation_load(M07_convo.angel_talk.name)
-- Give the player enough time to clear the area out
--delay(4.0)
-- Play the Angel intro conversation
--audio_conversation_play(M07_convo.angel_talk.handle)
--delay(26)
--==== WAVE 2 ====--
-- Load the next conversation
M07_convo.pickup_minigun.handle = audio_conversation_load(M07_convo.pickup_minigun.name)
-- Restrict Oleg to the ground floor
npc_leash_to_nav(M07_char.oleg, M07_navpoint.cp_starts.defense.oleg, 18)
-- Shift the front to the North side and the second floor
spawn_region_enable(M07_spawn_region.casino_upper_front_n, true)
spawn_region_enable(M07_spawn_region.casino_upper_front_s, true)
--spawn_region_enable(M07_spawn_region.casino_upper_rear_n, true)
-- Force the first group of enemies to come through the front door
spawn_region_enable(M07_spawn_region.casino_front_1, true)
spawn_region_enable(M07_spawn_region.casino_front_2, true)
-- This time the players could be anywhere, so flag two possible spawn regions for the minigun brute
-- NOTE: Since there's only two, they can both still be blocked, but eventually the luchadores will cause a player to revive a homie or fail, unblocking that region
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_DEFAULT)
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_DEFAULT)
-- Spawn the minigun brute upstairs and have him walk to the balcony for dramatic effect
continuous_spawn_start(M07_spawn_group.brute_minigun.name, 1, 0, "", SRF_1)
while not character_exists(M07_char.brute_minigun) do
thread_yield()
end
M07_status.casino_brutes_dead = 0
on_death("m07_brute_killed_cb", M07_char.brute_minigun) -- Since this is a continuous spawn NPC, we need to catch their death specifically to remove the marker
-- Set up a separate thread to move the brute and homies around the second floor
M07_thread.brute_attack = thread_new("m07_minigun_brute_thread")
--audio_conversation_wait_for_end(M07_convo.angel_talk.handle)
--M07_convo.angel_talk.handle = INVALID_CONVERSATION_HANDLE
-- Wait until the brute has been disposed of
while (M07_status.casino_brutes_dead < 1) do
thread_yield()
end
-- Stop the brute attack thread
thread_kill(M07_thread.brute_attack)
M07_thread.brute_attack = INVALID_THREAD_HANDLE
-- Send Oleg back downstairs
npc_leash_remove(M07_char.oleg)
ai_do_scripted_move(M07_char.oleg, M07_navpoint.cp_starts.defense.oleg, true, true)
-- Disable continuous spawns and wait a short time to provide a breather
continuous_spawn_stop(M07_spawn_group.wave_a.name)
continuous_spawn_stop(M07_spawn_group.wave_b.name)
--continuous_spawn_stop(M07_spawn_group.wave_c.name)
continuous_spawn_stop(M07_spawn_group.brute_minigun.name)
spawn_region_enable(M07_spawn_region.casino_upper_front_n, false)
spawn_region_enable(M07_spawn_region.casino_upper_front_s, false)
--spawn_region_enable(M07_spawn_region.casino_upper_rear_n, false)
spawn_region_enable(M07_spawn_region.casino_front_1, false)
spawn_region_enable(M07_spawn_region.casino_front_2, false)
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_DEFAULT)
spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_DEFAULT)
-- Inform the player of the gun
delay(1)
audio_conversation_play(M07_convo.pickup_minigun.handle)
audio_conversation_wait_for_end(M07_convo.pickup_minigun.handle)
M07_convo.pickup_minigun.handle = INVALID_CONVERSATION_HANDLE
delay(4)
--==== WAVE 3 ====--
-- Shift the front to the rear of the casino
spawn_region_enable(M07_spawn_region.casino_rear_n, true)
spawn_region_enable(M07_spawn_region.casino_rear_s, true)
spawn_region_enable(M07_spawn_region.casino_upper_rear_n, true)
-- Spawn the rest of the luchadores
--continuous_spawn_start(M07_spawn_group.wave_a.name)
--continuous_spawn_start(M07_spawn_group.wave_b.name)
--continuous_spawn_start(M07_spawn_group.wave_c.name)
-- This time the players could be anywhere, so flag multiple possible spawn regions for each flamer brute
-- NOTE: Since there's only two, they can both still be blocked, but eventually the luchadores will cause a player to revive a homie or fail, unblocking that region
spawn_region_toggle_filter(M07_spawn_region.casino_rear_n, SRF_2) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_rear_s, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
-- Spawn one flamer brute downstairs in the rear and have him walk to the ring for dramatic effect
continuous_spawn_start(M07_spawn_group.brute_flamer_1.name, 1, 0, "", SRF_2)
while not character_exists(M07_char.brute_flamer_1) do
thread_yield()
end
marker_add(M07_char.brute_flamer_1, MINIMAP_ICON_KILL, OI_ASSET_KILL_FULL, OI_FLAG_STICKY + OI_FLAG_DISPLAY_DISTANCE, SYNC_ALL)
on_death("m07_brute_killed_cb", M07_char.brute_flamer_1) -- Since this is a continuous spawn NPC, we need to catch their death specifically to remove the marker
ai_add_enemy_target(M07_char.brute_flamer_1, CLOSEST_PLAYER, ATTACK_NOW) -- Send him immediately after the player
-- Spawn another flamer brute downstairs in the rear and have him chase Oleg
continuous_spawn_start(M07_spawn_group.brute_flamer_2.name, 1, 0, "", SRF_3)
while not character_exists(M07_char.brute_flamer_2) do
thread_yield()
end
marker_add(M07_char.brute_flamer_2, MINIMAP_ICON_KILL, OI_ASSET_KILL_FULL, OI_FLAG_STICKY + OI_FLAG_DISPLAY_DISTANCE, SYNC_ALL)
on_death("m07_brute_killed_cb", M07_char.brute_flamer_2) -- Since this is a continuous spawn NPC, we need to catch their death specifically to remove the marker
ai_add_enemy_target(M07_char.brute_flamer_2, M07_char.oleg, ATTACK_NOW_NEVER_LOSE, true) -- Send him immediately after Oleg
-- Announce the flamer brutes
delay(2)
audio_play_persona_line(M07_char.angel, "M07_Flamer_Brute_01")
-- Load the Angel end conversation
--M07_convo.brutes_dead.handle = audio_conversation_load(M07_convo.brutes_dead.name)
-- Wait until both brutes have been disposed of
while (M07_status.casino_brutes_dead < 3) do
thread_yield()
end
-- Once both flamer brutes are dead, play a victory line (SP ADDED 11/7/10 for POC 2)
delay(1)
audio_play_persona_line(LOCAL_PLAYER, "M07_Mission_End")
delay(3) -- Wait a few seconds and allow it to play out before fading
-- Play the Angel end conversation
--delay(3)
--audio_conversation_play(M07_convo.brutes_dead.handle)
--audio_conversation_wait_for_end(M07_convo.brutes_dead.handle)
--M07_convo.brutes_dead.handle = INVALID_CONVERSATION_HANDLE
-- Reset spawn regions filters; mission clean-up will turn everything else off correctly
spawn_region_toggle_filter(M07_spawn_region.casino_rear_n, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
spawn_region_toggle_filter(M07_spawn_region.casino_rear_s, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
marker_remove(M07_char.angel)
objective_text_clear(0)
-- Clear out notoriety for the Luchadores
notoriety_set("luchadores", 0)
end
--------------------------------------------------------------------------------------------------
--[[************************************]]--
--[[ ]]--
--[[ Miscellaneous m07 Helper Functions ]]--
--[[ ]]--
--[[************************************]]--
-------------------------
--[[ ]]--
--[[ Cleanup Helpers ]]--
--[[ ]]--
-- Cleanup all the triggers
--
function m07_cleanup_triggers(trigger_table)
for i,trigger in pairs(trigger_table) do
if (type(trigger) == "string") then
m07_clear_trigger(trigger)
elseif (type(trigger) == "table") then
m07_cleanup_triggers(trigger)
end
end
end
-----------------------
--[[ ]]--
--[[ Other Helpers ]]--
--[[ ]]--
-- Disable trigger
--
-- trigger: (string) Name of the trigger
--
function m07_clear_trigger(trigger)
on_trigger("", trigger)
on_trigger_exit("", trigger)
trigger_enable(trigger, false)
marker_remove_trigger(trigger, SYNC_ALL)
end
--------------------------------------------------------------------------------------------------
--[[********************]]--
--[[ ]]--
--[[ Callback functions ]]--
--[[ ]]--
--[[********************]]--
--[[ GENERAL CALLBACKS ]]--
-- Callback for finishing a phonecall
function m07_finish_phonecall()
M07_status.phonecall_finished = true
end
--attack callback
function m07_decker_attack_cb(name)
-- don't play this if we have done this recently
if (not thread_check_done(M07_timed_lines.deckers.timer)) then
return
end
-- start timer
M07_timed_lines.deckers.timer = thread_new("delay", M07_timed_lines.deckers.delay)
-- play situation
audio_play_persona_line(name, M07_timed_lines.deckers.situation)
end
--detect callback
function m07_bdsm_detect_cb(name)
-- don't play this if we have done this recently
if (not thread_check_done(M07_timed_lines.bdsm.timer)) then
return
end
-- start timer
M07_timed_lines.bdsm.timer = thread_new("delay", M07_timed_lines.bdsm.delay)
-- play situation
if(rand_int(1,2) == 1) then
audio_play_persona_line(name, M07_timed_lines.bdsm.situation)
else
audio_play_persona_line(name, M07_timed_lines.bdsm.situation2)
end
end
-- Callback for a homie dying
--
-- char: (string) name of the homie that died
--
function m07_homie_death_fail_cb(char)
on_death("", char)
mission_end_failure("m07", M07_text.failure_death[char])
end
-- Callback for a homie going DBNO
--
-- char: (string) name of the homie that went DBNO
--
function m07_homie_dbno_cb(char)
audio_play_persona_line(char, "M07_Need_Help")
end
function m07_failure_dismissed_cb()
mission_end_failure("m07", "m06_failure_homie_dismissed")
end
-- Callback for when the player reaches the next goal
--
function m07_reached_goal_cb(char, trigger)
m07_clear_trigger(trigger)
M07_status.reached_goal = true
end
function m07_reached_wheelhouse(char, trigger)
if char == LOCAL_PLAYER or char == REMOTE_PLAYER then
M07_status.player_for_convo = char
end
M07_status.reached_goal = true
end
function m07_barge_enemies01()
trigger_enable(M07_trigger.barge_enemies01, false)
for i, guard in pairs(M07_group.barge2.members) do
ai_do_scripted_move(guard, M07_group.barge2.navpoints[i])
delay(1)
end
end
function m07_barge_enemies02()
trigger_enable(M07_trigger.barge_enemies02, false)
for i, guard in pairs(M07_group.barge3.members) do
ai_do_scripted_move(guard, M07_group.barge3.navpoints[i])
delay(2)
end
end
function m07_kinzie_untie_cb(char, trigger)
--play the untie animation
m07_clear_trigger(trigger)
objective_text_clear(0)
marker_remove(M07_char.kinzie)
clear_animation_state(M07_char.kinzie)
action_play_synced(char, M07_char.kinzie, "Hostage Release")
--clear_animation_state(M07_char.kinzie)
--play conversation
M07_thread.delay_thread = thread_new("delay", 15.0)
while audio_conversation_playing(M07_convo.kinzie_door.handle) and thread_check_done(M07_thread.delay_thread) == false do
thread_yield()
end
audio_conversation_end(M07_convo.kinzie_door.handle)
thread_kill(M07_thread.delay_thread)
M07_thread.delay_thread = INVALID_THREAD_HANDLE
M07_convo.untie_kinzie.handle = audio_conversation_load_direct(M07_convo.untie_kinzie.name)
audio_conversation_play(M07_convo.untie_kinzie.handle)
-- We've seen this conversation fail to play and hang the script a couple times...
-- so failsafe this sucka.
M07_thread.delay_thread = thread_new("delay", 15.0)
while audio_conversation_playing(M07_convo.untie_kinzie.handle) and thread_check_done(M07_thread.delay_thread) == false do
thread_yield()
end
audio_conversation_end(M07_convo.untie_kinzie.handle)
thread_kill(M07_thread.delay_thread)
M07_thread.delay_thread = INVALID_THREAD_HANDLE
M07_status.reached_goal = true
end
--[[ BARGE (MISSION START) ]]--
-- Callback for the player entering a vehicle (possibly a boat...helicopter works, too)
--
-- char: (string) name of the character that entered a vehicle
--
function m07_player_entered_vehicle_cb(char)
M07_status.player_vehicle_type = get_char_vehicle_type(char)
end
--[[ BDSM CLUB ]]--
-- Callback for the player grabbing a patron in the BDSM club to interrogate him
--
function m07_bdsm_interrogate_cb(char, trigger)
-- Find the index of the trigger that was activated, and the floor it is on
local bdsm_floor = 0
-- Don't let the player start an interrogation while in a vehicle...
-- They can drive a motorcycle into the club.
if character_is_in_vehicle(char) then
return
end
-- One at a time!
if M07_status.interrogation_in_progress == true then
return
end
M07_status.interrogation_in_progress = true
local victim = ""
for i,patrons_by_floor in pairs(M07_trigger.bdsm_interrogate) do
for j,trig in pairs(patrons_by_floor) do
if (trig == trigger) then
-- Grab the associated patron
victim = M07_group.bdsm_patrons.chars[i][j]
-- Store the floor number for use in a moment
bdsm_floor = i
break
end
end
if (bdsm_floor ~= 0) then
break
end
end
if (bdsm_floor == 0) then
return
end
trigger_enable(trigger, false)
on_trigger("", trigger)
-- make this dude invulnerable
m07_setup_player_and_victim_for_interrogation(char, victim)
persona_override_persona_start(victim, "Interrogation")
if (bdsm_floor == 2) then
player_take_human_shield(char, victim)
end
----figure out which room this guy belonged to
for i,rooms_by_floor in pairs (M07_group.bdsm_rooms.floors) do
for j, room in pairs (rooms_by_floor) do
local correct_room = false
for k, npc in pairs (room.members) do
if (npc == victim) then
correct_room = true
end
end
if (correct_room == true) then
for k, npc in pairs (room.members) do
if (npc ~= victim) then
--make everyone else flee
set_ignore_ai_flag(npc, false)
flee(npc, char)
room.alive = false
end
end
end
end
end
-- Remove the triggers
for j,trig in pairs(M07_trigger.bdsm_interrogate[bdsm_floor]) do
trigger_enable(trig, false)
on_trigger("", trig)
end
-- Clean up this floor
for j,npc in pairs(M07_group.bdsm_patrons.chars[bdsm_floor]) do
marker_remove(npc)
on_character_grabbed("", npc)
set_ignore_ai_flag(npc, false)
end
if (bdsm_floor == 2) then
delay(1)
end
if (bdsm_floor == 1) then
set_script_animation_state(victim, "Interrogation Idle")
set_animation_state(victim, "Interrogation Idle")
M07_convo.int_1_2.handle = audio_conversation_load_player(M07_convo.int_1_2.name, char)
audio_conversation_play(M07_convo.int_1_2.handle)
action_play_synced(char, victim, "Club Owner Interrogation")
audio_conversation_wait_for_end(M07_convo.int_1_2.handle)
M07_convo.int_1_2.handle = INVALID_CONVERSATION_HANDLE
-- Mark the second floor
for j,npc in pairs(M07_group.bdsm_patrons.chars[2]) do
marker_add(npc, MINIMAP_ICON_USE, OI_ASSET_USE)
character_set_only_scripted_grabs(npc, true)
--on_character_grabbed("m07_bdsm_interrogate_cb", npc)
end
for j,trig in pairs(M07_trigger.bdsm_interrogate[2]) do
trigger_enable(trig, true)
on_trigger("m07_bdsm_interrogate_cb", trig)
end
for j,door in pairs(M07_mover.upper_bdsm_doors) do
door_lock(door, false)
end
else
action_play_synced_state(char, victim, "Gat Interrogation State")
action_play_synced(char, victim, "Gat Interrogation Entry")
M07_convo.int_2_2.handle = audio_conversation_load_player(M07_convo.int_2_2.name, char)
audio_conversation_play(M07_convo.int_2_2.handle)
audio_conversation_wait_for_end(M07_convo.int_2_2.handle)
M07_convo.int_2_2.handle = INVALID_CONVERSATION_HANDLE
-- Turn on the breadcrumb and wait for the player to reach it
objective_text(0, M07_text.find_owner, nil, nil, SYNC_ALL, OI_ASSET_LOCATION)
trigger_enable(M07_trigger.mgr_breadcrumb, true)
marker_add_trigger(M07_trigger.mgr_breadcrumb, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger("m07_reached_goal_cb", M07_trigger.mgr_breadcrumb)
M07_status.reached_goal = false
--setup the trigger for grabbing the club owner
trigger_enable(M07_trigger.club_owner_interrogate, true)
on_trigger("m07_bdsm_owner_interrogate_cb", M07_trigger.club_owner_interrogate)
end
-- Wait for the previous conversation to end
audio_conversation_wait_for_end(M07_convo.enter_bdsm.handle)
M07_convo.enter_bdsm.handle = INVALID_CONVERSATION_HANDLE
if (bdsm_floor == 2) then
action_play_synced_state(char, victim, "HS_Stand")
action_play_synced(char, victim, "Gat Interrogation Return")
action_stop_synced_state(char, true)
end
-- Clean up this floor
for j,npc in pairs(M07_group.bdsm_patrons.chars[bdsm_floor]) do
-- Make them vulnerable again
turn_vulnerable(npc)
character_prevent_explosion_fling(npc, false)
character_allow_ragdoll(npc, true)
character_set_only_player_grabs(npc, false)
persona_override_persona_stop(npc)
character_prevent_flinching(npc, false)
character_prevent_bumping(npc, false)
character_set_never_catch_fire(npc, false)
set_suppress_synced_melee_attacks_flag(npc, false)
npc_leash_remove(npc)
on_death("", npc)
end
--clean up the player who grabbed
m07_cleanup_player_and_victim_for_interrogation(char, victim)
M07_status.interrogation_in_progress = false
while (not M07_status.reached_goal) do
thread_yield()
end
end
function m07_tutorial_cb()
tutorial_start("human_shield", 0, true, true)
end
function m07_bdsm_owner_interrogate_cb(char, trigger)
-- Don't let the player start an interrogation while in a vehicle...
-- They can drive a motorcycle into the club.
if character_is_in_vehicle(char) then
return
end
-- One at a time!
if M07_status.interrogation_in_progress == true then
return
end
M07_status.interrogation_in_progress = true
trigger_enable(trigger, false)
on_trigger("", trigger)
marker_remove(M07_char.club_owner)
objective_text_clear(0)
m07_setup_player_and_victim_for_interrogation(char, M07_char.club_owner)
persona_override_persona_start(M07_char.club_owner, "Interrogation")
--put him in the interrogationstate
player_take_human_shield(char, M07_char.club_owner)
action_play_synced_state(char, M07_char.club_owner, "Gat Interrogation State")
action_play_synced(char, M07_char.club_owner, "Gat Interrogation Entry")
-- play conversation
M07_convo.interrogate.handle = audio_conversation_load_player(M07_convo.interrogate.name, char)
audio_conversation_play(M07_convo.interrogate.handle)
audio_conversation_wait_for_end(M07_convo.interrogate.handle)
M07_convo.interrogate.handle = INVALID_CONVERSATION_HANDLE
--cleanup
action_play_synced_state(char, M07_char.club_owner, "HS_Stand")
action_play_synced(char, M07_char.club_owner, "Gat Interrogation Return")
action_stop_synced_state(char, true)
m07_cleanup_player_and_victim_for_interrogation(char, M07_char.club_owner)
M07_status.club_owner_grabbed = true
M07_status.interrogation_in_progress = false
end
--callback for when a patron dies, don't ever re-activate his action node
function m07_patron_death_cb(victim)
on_death("", victim)
--on_character_grabbed("", victim)
--figure out which room this guy belonged to
for i,rooms_by_floor in pairs (M07_group.bdsm_rooms.floors) do
local found_alive = false
for j, room in pairs (rooms_by_floor) do
for k, npc in pairs (room.members) do
if (npc == victim) then
--mark my room as dead so i don't try and reactivate the action node
room.alive = false
if (k <= room.num_patrons) then
trigger_enable(room.triggers[k], false)
on_trigger("", room.triggers[k])
room.patrons_alive[k] = false
end
end
end
if (found_alive == false) then
for x, test_val in pairs (room.patrons_alive) do
if (test_val == true) then
found_alive = true
end
end
end
end
if (found_alive == false) then
--no one left to interrogate on this floor, we have failed the mission
mission_end_failure("m07", "m07_failure_patrons_died")
end
end
end
--setup the BDSM action nodes
function m07_bdsm_action_nodes_setup()
for i,floor_rooms in pairs (M07_group.bdsm_rooms.floors) do
for j,room in pairs(floor_rooms) do
if (room.alive == true) then
for k,npc in pairs(room.members) do
npc_use_closest_action_node_of_type(npc, room.node_type[k])
on_death("m07_patron_death_cb", npc)
set_ignore_ai_flag(npc, true)
end
end
end
end
delay(5)
thread_kill(M07_thread.nodes)
end
--[[ PONY CART ]]--
-- Callback for one of the Morningstar pony cart drivers being killed
--
-- char: (string) name of the guy that was killed
--
function m07_driver_killed_cb(npc)
on_death("", npc)
local veh = get_char_vehicle_name(npc)
if (veh ~= "") then
vehicle_detonate(veh)
end
end
-- Callback for one of the Morningstar pony cart riders being killed
--
-- char: (string) name of the guy that was killed
--
function m07_enemy_killed_cb(npc)
on_death("", npc)
marker_remove(npc)
M07_status.num_enemies_alive = M07_status.num_enemies_alive - 1
end
function m07_pony_enemy_killed_cb(npc)
on_death("", npc)
marker_remove(npc)
-- vehicle_exit(npc)
M07_status.num_enemies_alive = M07_status.num_enemies_alive - 1
end
--[[ ANGEL'S CASINO ]]--
-- Callback for reaching the outside of the casino in the first part of Angel's checkpoint
--
function m07_outside_casino_reached_cb()
--m07_clear_trigger(M07_trigger.outside_casino)
on_trigger("", M07_trigger.outside_casino)
trigger_enable(M07_trigger.outside_casino, false)
M07_status.outside_casino_reached = true
end
-- Callback for any continuous spawn created brute being killed
--
function m07_brute_killed_cb(npc)
on_death("", npc)
marker_remove(npc)
M07_status.casino_brutes_dead = M07_status.casino_brutes_dead + 1
end
-- Callback for reaching the inside of the casino in the first part of Angel's checkpoint
--
function m07_inside_casino_reached_cb()
m07_clear_trigger(M07_trigger.inside_casino)
m07_clear_trigger(M07_trigger.casino_lobby)
M07_status.inside_casino_reached = true
end
--------------------------------------------------------------------------------------------------
--[[******************]]--
--[[ ]]--
--[[ Thread functions ]]--
--[[ ]]--
--[[******************]]--
--[[ BARGE (MISSION START) ]]--
-- Tell a vehicle to follow a specified looping path
--
-- veh: (string) name of the vehicle to move
-- nav: (string) name of the path to move along
--
function m07_vehicle_path_thread(veh, path)
-- Force the vehicle to keep following the path
local driver = vehicle_get_driver(veh)
while ((driver ~= nil) and (not character_is_player(driver))) do
vehicle_pathfind_to(veh, path, true, false, true)
thread_yield()
driver = vehicle_get_driver(veh)
end
end
--[[ BDSM CLUB ]]--
-- Tell a pony cart to leave the gbarn then chase the player
--
-- veh: (string) name of the vehicle to move
--
function m07_pony_chase_thread(veh, npc_group, cart_num)
--vehicle_speed_override(veh, 15)
vehicle_pathfind_to(veh, M07_navpoint.pony_cart_start, true, false, true)
-- Enable shooting
for j,npc in pairs(npc_group) do
if (character_exists(npc) and not character_is_dead(npc)) then
set_ignore_ai_flag(npc, false)
end
end
-- Once out of the barn, chase the player
--vehicle_speed_cancel(veh)
vehicle_disable_chase(veh, false)
vehicle_disable_flee(veh, false)
vehicle_chase(veh, LOCAL_PLAYER, false, false)
end
function m07_force_action_nodes()
local j = 0
while j < 1 do
for i, npc in pairs(M07_group.bdsm_ambient.members) do
if not character_is_dead(npc) then
npc_use_closest_action_node_of_type(npc, M07_group.bdsm_ambient.nodes[i], 3)
end
end
delay(2)
end
--set cage dancers to ignore AI
for k, dancer in pairs(M07_group.bdsm_cage_dancers.members) do
if not character_is_dead(dancer) then
set_ignore_ai_flag(npc, true)
end
end
end
function m07_pony_cart_alive_thread(veh, passenger_group)
for i, npc in pairs(passenger_group) do
while not character_is_dead(npc) do
thread_yield()
end
end
--all characters in this veh are dead, stop the vehicle
vehicle_stop(veh)
end
--[[ PONY CART ]]--
--[[ ANGEL'S CASINO ]]--
-- Thread to process the exploding Luchadore vehicle arriving at the casino
--
function m07_luchadores_arriving_1_thread()
-- Tell the explody vehicle where to go
set_ignore_ai_flag(M07_group.luchadores_arriving.chars[1], false)
marker_add(M07_group.luchadores_arriving.chars[1], MINIMAP_ICON_KILL, OI_ASSET_KILL, OI_FLAGS_DEFAULT, SYNC_ALL)
vehicle_pathfind_to(M07_group.luchadores_arriving.vehicles[1], M07_navpoint.casino_arriving_1, true)
-- Once the vehicle reaches the end location, explode it
while not vehicle_pathfind_check_done(M07_group.luchadores_arriving.vehicles[1]) do
thread_yield()
end
marker_remove(M07_group.luchadores_arriving.chars[1])
vehicle_detonate(M07_group.luchadores_arriving.vehicles[1])
end
-- Thread to process the non-exploding Luchadore vehicle arriving at the casino
--
function m07_luchadores_arriving_2_thread()
-- Tell the non-explody arriving vehicle where to go
vehicle_pathfind_to(M07_group.outside_cover_vehicles.vehicles[1], M07_navpoint.casino_arriving_2, true, true)
-- Once the vehicle reaches the end location, everyone exit
while not vehicle_pathfind_check_done(M07_group.outside_cover_vehicles.vehicles[1]) do
thread_yield()
end
vehicle_exit(M07_group.luchadores_outside.chars[1])
vehicle_exit(M07_group.luchadores_outside.chars[2])
vehicle_exit(M07_group.luchadores_outside.chars[3])
--vehicle_exit(M07_group.luchadores_outside.brute)
-- Leash everyone to the area
for i,npc in pairs(M07_group.luchadores_outside.chars) do
if (character_exists(npc) and not character_is_dead(npc)) then
npc_leash_to_nav(npc, M07_navpoint.casino_arriving_2, 50)
end
end
end
-- Thread to process the brute arriving at the casino
--
function m07_luchadores_arriving_3_thread()
-- Tell the brute to go to the middle of the street
set_ignore_ai_flag(M07_group.luchadores_outside.brute, false)
ai_add_enemy_target(M07_group.luchadores_outside.brute, CLOSEST_PLAYER, ATTACK_NOW) -- Target the player
ai_do_scripted_move(M07_group.luchadores_outside.brute, M07_navpoint.casino_arriving_3, true, false)
-- Wait until the player is close
while (get_dist_closest_player_to_object(M07_group.luchadores_outside.brute) > 30) do
thread_yield()
end
-- Announce the brute
audio_conversation_wait_for_end(M07_convo.mount_rescue.handle)
delay(2)
audio_play_persona_line(M07_char.zimos, M07_lines.notice_brute)
end
-- Thread to process Angel fleeing into the casino
--
function m07_angel_flee_thread()
-- Change the Luchadores' target to the player
for i,luch in pairs(M07_group.luchadores_outside.chars) do
ai_add_enemy_target(luch, CLOSEST_PLAYER, ATTACK_NOW)
end
-- Send Angel to the casino door
npc_leash_remove(M07_char.angel)
ai_do_scripted_move(M07_char.angel, M07_navpoint.casino_door, true, false)
while (not ai_scripted_action_is_complete(M07_char.angel)) do
thread_yield()
end
npc_leash_to_nav(M07_char.angel, M07_navpoint.casino_door, 0)
-- Wait until the player is in streaming range of the casino entry interior
while (get_dist_closest_player_to_object(M07_navpoint.casino_entry_1) > 60) do
thread_yield()
end
-- Open the door
while (not door_is_open(M07_mover.door_casino)) do
door_open(M07_mover.door_casino)
thread_yield()
end
-- Send Angel into the casino entry
npc_leash_remove(M07_char.angel)
ai_do_scripted_move(M07_char.angel, M07_navpoint.casino_entry_1, true, false)
while (not ai_scripted_action_is_complete(M07_char.angel)) do
thread_yield()
end
npc_leash_to_nav(M07_char.angel, M07_navpoint.casino_entry_1, 0)
-- Wait until the player is in streaming range of the full casino interior
while (get_dist_closest_player_to_object(M07_navpoint.casino_entry_1) > 15) do
thread_yield()
end
-- Send Angel to the ring in the casino
npc_leash_remove(M07_char.angel)
ai_do_scripted_move(M07_char.angel, M07_navpoint.cp_starts.defense.angel, true, false)
while (not ai_scripted_action_is_complete(M07_char.angel)) do
thread_yield()
end
-- Once Angel reaches the end location, disable his AI to prevent him from wandering back into combat
set_ignore_ai_flag(M07_char.angel, true)
end
-- Thread to make Kinzie nag the player
--
function m07_kinzie_nag_thread()
-- Load the Kinzie nag conversation
M07_convo.kinzie_nag.kinzie_persona_id = audio_persona_load_2d(M07_convo.kinzie_nag.kinzie_persona_name)
--M07_convo.kinzie_nag.handle = audio_conversation_load(M07_convo.kinzie_nag.name)
delay(30)
-- Start the Kinzie phone call
M07_status.phonecall_finished = false
audio_play_for_mission_cellphone(M07_convo.kinzie_nag.name, true, true, "", "m07_finish_phonecall")
-- Make sure the conversation is finished
while (M07_status.phonecall_finished == false) do
thread_yield()
end
audio_persona_remove_2d(M07_convo.kinzie_nag.kinzie_persona_id)
M07_convo.kinzie_nag.kinzie_persona_id = INVALID_PERSONA_HANDLE
end
-- Thread to move the brute into view and send Oleg after him
--
function m07_melee_brute_thread()
-- Have Oleg ignore the enemies until the brute arrives
set_ignore_ai_flag(M07_char.oleg, false)
ai_set_action_delay(M07_char.oleg, "ALL", 60) -- Disallow all actions for 60 seconds
ai_set_action_delay(M07_char.oleg, "taunt", 4) -- Allow taunt in a few seconds
-- Have the brute walk to the top of the stairs for dramatic effect
set_never_turn_on_player(M07_char.brute_melee, true)
ai_set_action_delay(M07_char.brute_melee, "ALL", 30) -- Disallow all actions for 20 seconds
ai_set_action_delay(M07_char.brute_melee, "move scripted", 0) -- allow scripted move
ai_do_scripted_move(M07_char.brute_melee, M07_navpoint.casino_entry_1, false)
-- Load and play the first wave conversation
M07_convo.first_wave.handle = audio_conversation_load_direct(M07_convo.first_wave.name)
delay(6)
audio_conversation_play(M07_convo.first_wave.handle)
-- Wait for the brute to reach the center
while (ai_scripted_action_is_processing(M07_char.brute_melee)) do
thread_yield()
end
-- Grabbing a human shield in this room is ineffective
ai_set_action_delay(M07_char.brute_melee, "human shield grab", 30) -- Disallow grabbing human shields for 30 seconds
-- Send Oleg and the brute after each other
ai_add_enemy_target(M07_char.oleg, M07_char.brute_melee, ATTACK_NOW_NEVER_LOSE, true) -- Make enemy brute the priority target
ai_set_action_delay(M07_char.oleg, "move chase", 0) -- Allow chase now
ai_set_action_delay(M07_char.oleg, "brute bull rush", 0) -- Allow bull rush now
ai_set_action_delay(M07_char.oleg, "brute attack brute", 0) -- Allow brute on brute now
ai_add_enemy_target(M07_char.brute_melee, M07_char.oleg, ATTACK_NOW_NEVER_LOSE, true) -- Make Oleg the priority target
ai_set_action_delay(M07_char.brute_melee, "move chase", 0) -- Allow chase now
ai_set_action_delay(M07_char.brute_melee, "brute bull rush", 0) -- Allow bull rush now
ai_set_action_delay(M07_char.brute_melee, "brute attack brute", 0) -- Allow brute on brute now
-- Make sure the prior conversation is finished
audio_conversation_wait_for_end(M07_convo.first_wave.handle)
M07_convo.first_wave.handle = INVALID_CONVERSATION_HANDLE
M07_convo.brute_grapple.handle = audio_conversation_load_direct(M07_convo.brute_grapple.name)
-- Play the brute grapple conversation
delay(10)
audio_conversation_play(M07_convo.brute_grapple.handle)
audio_conversation_wait_for_end(M07_convo.brute_grapple.handle)
M07_convo.brute_grapple.handle = INVALID_CONVERSATION_HANDLE
end
-- Thread to move the brute and homies around the second floor
--
function m07_minigun_brute_thread()
character_prevent_flinching(M07_char.brute_minigun, true)
-- Load the brute call out
M07_convo.brute_minigun.handle = audio_conversation_load(M07_convo.brute_minigun.name)
-- Have the brute walk to the center of the balcony for dramatic effect
ai_do_scripted_move(M07_char.brute_minigun, M07_navpoint.casino_balcony_e_1, false, true)
npc_leash_to_nav(M07_char.brute_minigun, M07_navpoint.casino_balcony_e_1, 0)
-- After the brute has time to move into view, announce his presence
delay(12)
marker_add(M07_char.brute_minigun, MINIMAP_ICON_KILL, OI_ASSET_KILL_FULL, OI_FLAG_STICKY + OI_FLAG_DISPLAY_DISTANCE, SYNC_ALL)
audio_conversation_play(M07_convo.brute_minigun.handle)
audio_conversation_wait_for_end(M07_convo.brute_minigun.handle)
M07_convo.brute_minigun.handle = INVALID_CONVERSATION_HANDLE
-- Wait for the brute and to arrive at the balcony
while (not ai_scripted_action_is_complete(M07_char.brute_minigun)) do
thread_yield()
end
-- Have Oleg flee to the stairs
delay(2)
audio_play_persona_line(M07_char.oleg, "M07_Casino_Fight_03")
npc_leash_remove(M07_char.oleg)
ai_do_scripted_move(M07_char.oleg, M07_navpoint.casino_stairs, true, false) -- Keep Oleg from walking leisurely while firing
-- Spawn some more guys
group_create(M07_group.balcony_enemies.name, true)
-- Send them to their locations
ai_do_scripted_move(M07_group.balcony_enemies.chars[4], M07_navpoint.casino_balcony_e_3, true, true)
ai_do_scripted_move(M07_group.balcony_enemies.chars[6], M07_navpoint.casino_balcony_e_2, true, true)
-- Once Oleg reaches the stairs, send the brute downstairs
while (not ai_scripted_action_is_complete(M07_char.oleg)) do
thread_yield()
end
npc_leash_remove(M07_char.brute_minigun)
turn_invulnerable(M07_char.brute_minigun)
human_gravity_enable(M07_char.brute_minigun, false)
set_ignore_ai_flag(M07_char.brute_minigun, true)
teleport(M07_char.brute_minigun, M07_navpoint.casino_balcony_e_1)
action_play_non_blocking(M07_char.brute_minigun, "Balcony Drop", "Balcony Drop", true)
repeat
thread_yield()
until action_play_is_finished(M07_char.brute_minigun, 0.10)
audio_play_persona_line(M07_char.brute_minigun, "Brute_Charge")
repeat
thread_yield()
until action_play_is_finished(M07_char.brute_minigun, 0.56)
camera_shake_play("anim_shake_medium")
repeat
thread_yield()
until action_play_is_finished(M07_char.brute_minigun)
--wait for the land to finish
delay(1)
turn_vulnerable(M07_char.brute_minigun)
set_ignore_ai_flag(M07_char.brute_minigun, false)
human_gravity_enable(M07_char.brute_minigun, true)
character_prevent_flinching(M07_char.brute_minigun, false)
-- Resume spawning the luchadores
--continuous_spawn_start(M07_spawn_group.wave_a.name)
--continuous_spawn_start(M07_spawn_group.wave_b.name)
-- Have Oleg head upstairs
ai_do_scripted_move(M07_char.oleg, M07_navpoint.casino_balcony_n, true, false)
npc_leash_to_nav(M07_char.oleg, M07_navpoint.casino_balcony_n, 10) -- TODO: Make sure Oleg doesn't run off while waiting on the brute
end