shadow-over-bishkek001/resources/start_uni_exterior.lua
2026-07-19 21:38:22 +03:00

228 lines
6.6 KiB
Lua

print("Lua script loaded successfully!")
function callback_enter_location()
end
function callback_exit_location()
end
game_api.set_location_callbacks(
callback_enter_location,
callback_exit_location
)
function darklands_exit001_enter_callback()
if game_api.is_darklands() then
print("Lua script start_darklands_transition")
game_api.start_darklands_transition()
end
end
function on_container_clicked()
local player_container_aware = game_api.getIntValue("player_container_aware")
local player_has_coursework = game_api.getIntValue("player_has_coursework")
if (player_has_coursework == 1) then
game_api.start_dialogue("dialog_contaier003")
elseif player_container_aware == 1 then
game_api.start_dialogue("dialog_contaier002")
game_api.setIntValue("player_has_coursework", 1)
else
game_api.start_dialogue("dialog_contaier001")
end
game_api.player_stop()
end
function on_car_clicked()
game_api.start_dialogue("dialog_car001")
game_api.player_stop()
game_api.player_rotate_to(90.0)
end
function dialog_contaier002_get_coursework()
game_api.pickup_item("coursework")
game_api.quest_set_objective_completed("ghost_coursework", "ghost_coursework_find")
game_api.quest_set_objective_completed("ghost_coursework", "ghost_coursework_find")
end
function callback_enter_night()
game_api.start_dialogue("dialog_video001")
end
game_api.set_enter_night_callback(
callback_enter_night
)
function callback_exit_darklands()
game_api.start_cutscene("darklands_exit001")
print("Setting to day 1----")
game_api.setIntValue("day", 1)
game_api.set_dawn()
game_api.setIntValue("morning_player_can_leave", 1)
end
game_api.set_darklands_callbacks(
nil,
callback_exit_darklands
)
function callback_enter_night()
game_api.deactivate_interactive_object("car001")
game_api.deactivate_interactive_object("car001wheels")
game_api.switch_navigation(1)
end
game_api.set_enter_night_callback(
callback_enter_night
)
function callback_enter_location()
print("Enter location uni exterior")
local hp = game_api.getFloatValue("player_hp")
game_api.set_player_hp(hp)
game_api.set_teleport_active(0, false)
if (game_api.is_night()) then
game_api.deactivate_interactive_object("car001")
game_api.deactivate_interactive_object("car001wheels")
game_api.switch_navigation(1)
else
game_api.activate_interactive_object("car001")
game_api.activate_interactive_object("car001wheels")
game_api.switch_navigation(0)
end
end
function callback_exit_location()
print("Exit location uni exterior")
local hp = game_api.get_player_hp()
game_api.setFloatValue("player_hp", hp)
end
game_api.set_location_callbacks(
callback_enter_location,
callback_exit_location
)
game_api.set_trigger_zone_callbacks("darklands_exit001",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit002",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit003",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit004",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit005",
darklands_exit001_enter_callback,
nil
)
function taxi_zone001_enter_callback()
game_api.start_dialogue("dialog_taxi001")
game_api.set_trigger_zone_enabled(0, false)
end
function callback_call_taxi()
game_api.set_teleport_active(0, true)
game_api.set_trigger_zone_enabled(0, false)
end
game_api.set_call_taxi_callback(
callback_call_taxi
)
game_api.set_trigger_zone_callbacks("taxi_zone001",
taxi_zone001_enter_callback,
nil
)
function callback_aiperi_chat()
if (not game_api.is_night()) and (not game_api.is_dawn()) then
local aiperi_chat_opened = game_api.getIntValue("aiperi_chat_opened")
if aiperi_chat_opened == 0 then
game_api.setIntValue("aiperi_chat_opened", 1)
local aiperi_knife_aware = game_api.getIntValue("aiperi_knife_aware")
local aiperi_talked_after_knife = game_api.getIntValue("aiperi_talked_after_knife")
local player_hold_knife = game_api.getIntValue("player_hold_knife")
if (player_hold_knife==1) and (aiperi_talked_after_knife == 0) then
game_api.start_dialogue("dialog_chat_aiperi003")
game_api.setIntValue("aiperi_talked_after_knife", 1)
else
if aiperi_knife_aware == 0 then
local lection_is_over = game_api.getIntValue("lection_is_over")
if (lection_is_over == 1) then
game_api.start_dialogue("dialog_chat_aiperi002")
else
game_api.start_dialogue("dialog_chat_aiperi001")
end
end
end
end
--[[
local aiperi_chat_opened = game_api.getIntValue("aiperi_chat_opened")
local aiperi_knife_aware = game_api.getIntValue("aiperi_knife_aware")
local aiperi_talked_after_knife = game_api.getIntValue("aiperi_talked_after_knife")
local lection_is_over = game_api.getIntValue("lection_is_over")
local player_hold_knife = game_api.getIntValue("player_hold_knife")
local player_hold_key = game_api.getIntValue("player_hold_key")
if (player_hold_knife==1) and (aiperi_talked_after_knife == 0) then
game_api.start_dialogue("dialog_chat_aiperi003")
game_api.setIntValue("aiperi_talked_after_knife", 1)
else
print("dialogx- step 2")
if aiperi_chat_opened == 0 then
print("dialogx- step 3")
game_api.setIntValue("aiperi_chat_opened", 1)
if aiperi_knife_aware == 0 then
print("dialogx- step 4")
if (lection_is_over == 1) then
print("dialogx- step 5")
if (player_hold_key == 0) then
print("dialogx- step 6")
game_api.start_dialogue("dialog_chat_aiperi002")
end
else
game_api.start_dialogue("dialog_chat_aiperi001")
end
end
end
end]]
end
end
function callback_parents_chat()
local parents_chat_opened = game_api.getIntValue("parents_chat_opened")
if parents_chat_opened == 0 then
game_api.setIntValue("parents_chat_opened", 1)
game_api.start_dialogue("dialog_chat_parents001")
end
end
function callback_news_chat()
local news_chat_opened = game_api.getIntValue("news_chat_opened")
if news_chat_opened == 0 then
game_api.setIntValue("news_chat_opened", 1)
game_api.start_dialogue("dialog_chat_news001")
end
end
game_api.set_chat_callbacks(
callback_aiperi_chat,
callback_parents_chat,
callback_news_chat
)