Added New Mods and Profiles Folders

This is a complete rebuild of the modpack, with all new mods and updates for 1.5.3 of Anomaly.
This commit is contained in:
2025-01-14 05:07:53 -05:00
parent 85c665b107
commit 376b4b9689
21217 changed files with 546254 additions and 0 deletions
@@ -0,0 +1,890 @@
--====================< Credits >====================--
-- Many thanks to two anonymous contributors, ravenascendant, and dan6642 for coding help.
-- Many thanks to Australian cunt#3627, RitualColt#7912, cubed#8023, shiyon, piscesblau, and ALostArchitect#9240 for writing help.
-- Many thanks to izperehoda, sasanito95., CV514#7004, and njaal for the Russian translation.
-- Many thanks to jinxovarrio, d.santi, and Spooky Usuala#2706 for the Spanish translation.
-- Many thanks to ishmaeel for their generous decision to allow their code to be re-used.
-- Many thanks to realdealflexseal for playtesting and ideas.
-- Many thanks to Abhishek Kumar and hookenz on stackoverflow for useful snippets of code.
-- Without them this would not have been possible.
--====================< Settings >====================--
local show_time
local show_time_long
local beep_before
local beep_after
--local name_state
--local name_rgb
local msg_state
--local clr_name
local clr_msg
local anomaly_state
local anomaly_timer
local clear_state
local campfire_state
local wpm
local npc_death_state
local npc_death_comment_state
local emission_state
local enemy_state
local headshot_state
local level_state
local level_chance
local npc_health_state
local player_death_state
local psistorm_state
local jammed_state
local reload_state
local reload_chance
local random_state
local random_chance
local safe_area_state
local safe_area_chance
function load_settings()
show_time = chatter_mcm.get_config("show_time")
show_time_long = chatter_mcm.get_config("show_time_long")
show_time = show_time*1000
show_time_long = show_time_long*1000
beep_before = chatter_mcm.get_config("beep_before")
beep_after = chatter_mcm.get_config("beep_after")
msg_state = chatter_mcm.get_config("msg_state")
if msg_state then
clr_msg = "%c[" .. chatter_mcm.get_config("msg_argb") .. "]"
else
clr_msg = ""
end
anomaly_state = chatter_mcm.get_config("anomaly_state")
anomaly_timer = chatter_mcm.get_config("anomaly_timer")
anomaly_timer = anomaly_timer*1000
clear_state = chatter_mcm.get_config("clear_state")
campfire_state = chatter_mcm.get_config("campfire_state")
wpm = chatter_mcm.get_config("wpm")
npc_death_state = chatter_mcm.get_config("npc_death_state")
npc_death_comment_state = chatter_mcm.get_config("npc_death_comment_state")
emission_state = chatter_mcm.get_config("emission_state")
enemy_state = chatter_mcm.get_config("enemy_state")
headshot_state = chatter_mcm.get_config("headshot_state")
level_state = chatter_mcm.get_config("level_state")
level_chance = chatter_mcm.get_config("level_chance")
npc_health_state = chatter_mcm.get_config("npc_health_state")
player_death_state = chatter_mcm.get_config("player_death_state")
psistorm_state = chatter_mcm.get_config("psistorm_state")
jammed_state = chatter_mcm.get_config("jammed_state")
reload_state = chatter_mcm.get_config("reload_state")
reload_chance = chatter_mcm.get_config("reload_chance")
random_state = chatter_mcm.get_config("random_state")
random_chance = chatter_mcm.get_config("random_chance")
safe_area_state = chatter_mcm.get_config("safe_area_state")
safe_area_chance = chatter_mcm.get_config("safe_area_chance")
end
--====================< Definitions >====================--
local number = {
["part_2"] = 10,
["actor_on_before_death"] = 10,
["anomaly_part_1"] = 5,
["anomaly_part_2"] = 5,
["campfire"] = 10,
["clear"] = 5,
["companion_death"] = 5,
["headshot"] = 5,
["near_death"] = 30,
["npc_on_death"] = 10,
["psi_storm"] = 10,
["random"] = 25,
["safe_area"] = 25,
["emission"] = 10,
["weapon_jammed"] = 5,
["weapon_reload"] = 5,
}
local campfire_radius = 5
local campfire_radius_far = 20
local max_delay = 420000
local max_timer = 120000
local min_delay = 240000
local min_timer = 60000
local n = 1
local base_radius = 50
local neutral_bases = true
local safe_area_timer = 30
local bonus_bases = {}
bonus_bases.pri_monolith = {monolith = true}
bonus_bases.pri_a18_smart_terrain = {killer = true}
-- companion_attitude ={
-- ["army"] = "tactical",
-- ["bandit"] = "casual",
-- ["csky"] = "casual",
-- ["dolg"] = "tactical",
-- ["ecolog"] = "tactical",
-- ["freedom"] = "casual",
-- ["greh"] = "cult",
-- ["isg"] = "tactical",
-- ["killer"] = "tactical",
-- ["monolith"] = "cult",
-- ["renegade"] = "casual",
-- ["stalker"] = "casual",
-- }
local level_responses = {
["l03_agroprom"] = {name = "agroprom" , number = 5},
["l03u_agr_underground"] = {name = "agroprom_underground" , number = 5},
["l07_military"] = {name = "army_warehouses" , number = 5},
["l12_stancia_2"] = {name = "chernobyl_npp_north" , number = 5},
["l12_stancia"] = {name = "chernobyl_npp_south" , number = 5},
["l01_escape"] = {name = "cordon" , number = 5},
["l04_darkvalley"] = {name = "dark_valley" , number = 5},
["k01_darkscape"] = {name = "darkscape" , number = 5},
["l09_deadcity"] = {name = "dead_city" , number = 5},
["l11_hospital"] = {name = "deserted_hospital" , number = 5},
["l02_garbage"] = {name = "garbage" , number = 5},
["l13_generators"] = {name = "generators" , number = 5},
["k00_marsh"] = {name = "great_swamp" , number = 5},
["jupiter"] = {name = "jupiter" , number = 5},
["jupiter_underground"] = {name = "jupiter_underground" , number = 5},
["l08u_brainlab"] = {name = "lab_x-16" , number = 5},
["l04u_labx18"] = {name = "lab_x-18" , number = 5},
["l10u_bunker"] = {name = "lab_x-19" , number = 5},
["labx8"] = {name = "lab_x-8" , number = 5},
["l10_limansk"] = {name = "limansk" , number = 5},
["y04_pole"] = {name = "meadow" , number = 5},
["l12u_control_monolith"] = {name = "monolith_control_center" , number = 5},
["l13u_warlab"] = {name = "monolith_war_lab" , number = 5},
["pripyat"] = {name = "pripyat_outskirts" , number = 5},
["l11_pripyat"] = {name = "pripyat" , number = 5},
["l10_radar"] = {name = "radar" , number = 5},
["l10_red_forest"] = {name = "red_forest" , number = 5},
["l05_bar"] = {name = "rostok" , number = 5},
["l12u_sarcofag"] = {name = "sarcophagus" , number = 5},
["k02_trucks_cemetery"] = {name = "truck_cemetery" , number = 5},
["l06_rostok"] = {name = "wild_territory" , number = 5},
["l08_yantar"] = {name = "yantar" , number = 5},
["zaton"] = {name = "zaton" , number = 5},
}
local mutant_responses = {
bloodsucker = 5,
boar = 5,
burer = 5,
cat = 5,
chimera = 5,
controller = 5,
dog = 5,
flesh = 5,
fracture = 5,
gigant = 5,
karlik = 5,
lurker = 5,
poltergeist = 5,
pseudodog = 5,
psy_dog = 5,
pyrogeist = 5,
psysucker = 5,
snork = 5,
tushkano = 5,
zombi = 5,
mutant = 1, --default case
}
local stalker_responses = {
army = 6,
bandit = 5,
csky = 5,
dolg = 5,
ecolog = 5,
freedom = 5,
greh = 5,
isg = 5,
killer = 5,
monolith = 5,
renegade = 5,
stalker = 5,
zombied = 5,
}
local stalker_table = {
"army",
"bandit",
"csky",
"c_sky",
"clearsky",
"clear_sky",
"dolg",
"duty",
"ecolog",
"freedom",
"greh",
"isg",
"killer",
"loner",
"military",
"monolith",
"merc",
"renegade",
"sin",
"stalker",
"zombied",
}
local word_table = {}
local person_table = {}
person_table[1] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2 }
person_table[2] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2, [5] = 1 }
person_table[3] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2 }
person_table[4] = { [1] = 1, [2] = 2, [3] = 3, [4] = 2, [5] = 3 }
person_table[5] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2 }
person_table[6] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2, [5] = 1 }
person_table[7] = { [1] = 1, [2] = 1, [3] = 2, [4] = 1, [5] = 2 }
person_table[8] = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 2, [7] = 1 }
person_table[9] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2, [5] = 1, [6] = 2 }
person_table[10] = { [1] = 1, [2] = 2, [3] = 1, [4] = 2, [5] = 1, [6] = 2, [7] = 1, [8] = 2, [9] = 1, [10] = 2, [11] = 1, [12] = 2 }
local cooldowns = {}
local enemy_table = {}
local near_campfire_table = {}
local npc_toggle = {}
local squad_table = {}
local time_table = {}
local FirstTime_safe_area = true
local level_change = false
--====================< Function Alias >====================--
gt = game.translate_string
function beep_func()
xr_sound.set_sound_play(AC_ID, "pda_tips")
return true
end
function cooldown(key, duration, obj)
local current_time = time_global()
if obj and obj:id() then
key = key .. obj:id()
end
if not cooldowns[key] or current_time - cooldowns[key] > duration then
cooldowns[key] = current_time + duration
return true
end
return false
end
function count(base, pattern)
return select(2, string.gsub(base, pattern, ""))
end
function dump(o)
if type(o) == 'table' then
s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
function enough_people()
local condition = false
if (campfire_random == 3 and near_campfire_table[2] and near_campfire_table[3]) or (campfire_random ~= 3 and near_campfire_table[2]) then
condition = true
end
return condition
end
function get_random_companion()
local companion_table = axr_companions.list_actor_squad_by_id()
return level.object_by_id(companion_table[math.random(#companion_table)])
end
function get_time_table()
for a = 1, number["campfire"] do
word_table[a] = {}
time_table[a] = {}
word_table[a][1] = 0
time_table[a][1] = 0
for b = 2, #person_table[a] do
c = b - 1
word_table[a][b] = count(gt("st_darkasleif_campfire_".. a .. "_" .. c), " ") + 1
time_table[a][b] = (60*word_table[a][b])/(wpm)
end
end
end
function in_combat()
area_clear = true
level.iterate_nearest(db.actor:position(), 50, iterate_func_clear)
return not area_clear
end
function iterate_func_clear(obj)
if stored_id ~= obj:id() and obj:id() ~= 0 and is_enemy(obj, db.actor, true) then
area_clear = false
end
end
function is_enemy(obj, who, memory)
-- If obj exists
if not obj then
return false
end
-- If obj and who are the same
if obj:id() == who:id() then
return false
end
-- If obj is a crow
if (obj:clsid() == clsid.crow) then
return false
end
-- If obj is not a mutant or stalker
if not IsMonster(obj) and not IsStalker(obj) then
return false
end
-- If obj is dead
if not obj:alive() then
return false
end
if IsStalker(obj) and ((who:id() == 0) or (who:id() == AC_ID)) then
local relation = relation_registry.community_relation(character_community(obj), gameplay_disguise.get_default_comm())
local goodwill = relation_registry.community_goodwill(character_community(obj), db.actor:id())
-- If faction is not enemy and not fighting with actor
if not game_relations.is_factions_enemies(obj:character_community(), character_community(db.actor):sub(7)) and not xr_combat_ignore.fighting_with_actor_npcs[obj:id()] then
return false
end
-- If obj is companion and not pissed off
if obj:has_info("npcx_is_companion") and not xr_combat_ignore.fighting_with_actor_npcs[obj:id()] then
return false
end
-- if not gameplay_disguise.is_actor_disguised() and relation + goodwill >= 0 and not xr_combat_ignore.fighting_with_actor_npcs[obj:id()] then
-- return false
-- end
-- If player bribe is in effect
if xr_bribe.at_peace(character_community(obj), gameplay_disguise.get_default_comm(), obj:position():distance_to(db.actor:position())) and not xr_combat_ignore.fighting_with_actor_npcs[obj:id()] then
return false
end
-- If "Rostok Under Duty Control" installed
if gameplay_peace_zone and level.name() == "l05_bar" and character_community(db.actor):sub(7) == "army" and (character_community(obj) == "csky" or character_community(obj) == "stalker") and not xr_combat_ignore.fighting_with_actor_npcs[obj:id()] then
return false
end
-- If obj has forgotten who
if memory then
local tg = time_global()
local time_in_memory = tg - obj:memory_time(who)
if (time_in_memory < 0) then
if (time_in_memory < -120000) or (time_in_memory < -60000) then
return false
end
else
if (time_in_memory > 120000) or (time_in_memory > 60000) then
return false
end
end
end
end
if IsStalker(obj) then
if npc_surrendered(obj) then
return false
end
end
return true
end
function iterate_function_campfire(obj)
if IsStalker(obj) and (obj.alive and obj:alive()) and sr_camp.get_current_camp(obj:position()) and obj:id() ~= 0 and not obj:has_info("npcx_is_companion") then
near_campfire_table[#near_campfire_table + 1] = obj:id()
end
end
function level_func()
local level_name = level.name()
if level_name and level_responses[level_name] then
send_tip_random(gt("st_darkasleif_level_transition_" .. level_responses[level_name].name .. math.random(level_responses[level_name].number)), show_time_long)
end
return true
end
function msg_func(num)
if not bind_campfire.get_nearby_campfire(campfire_radius_far, true) or not bind_campfire.get_nearby_campfire(campfire_radius_far, true):is_on() then
return true
end
for i = 1, #near_campfire_table do
local obj = near_campfire_table[i]
if not (obj.alive and obj:alive()) then
table.remove(near_campfire_table, i)
end
end
if not enough_people() then
return true
end
local person = person_table[campfire_random][num]
if not near_campfire_table[person] then
local msg = utils_xml.get_color("white") .. gt("st_darkasleif_campfire_".. campfire_random .. "_" .. num)
news_manager.send_tip(db.actor, msg, msg_delay, nil, show_time_long*1000)
else
local obj = level.object_by_id(near_campfire_table[person])
send_tip(gt("st_darkasleif_campfire_".. campfire_random .. "_" .. num), obj, show_time_long)
end
new_num = num + 1
if new_num and campfire_random and new_num<=#person_table[campfire_random] and time_table[campfire_random][new_num] then
CreateTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_" .. new_num, time_table[campfire_random][new_num], msg_func, new_num)
end
return true
end
function send_tip(msg, sender, showtime)
if beep_before then
xr_sound.set_sound_play(AC_ID, "pda_tips")
end
local actor = db.actor
local news_caption = sender:character_name()
local news_text = clr_msg .. msg
local texture = sender:character_icon()
actor:give_game_news(news_caption, news_text, texture, 0, showtime, 0)
if beep_after then
CreateTimeEvent("CC", "Beeping" .. time_global(), showtime/1000, beep_func)
end
end
function send_tip_random(msg, showtime)
local rnd_companion = get_random_companion()
if rnd_companion and rnd_companion:id() ~= 0 then
send_tip(msg, rnd_companion, showtime)
end
end
function shuffle(a)
if type(o) == 'table' then
if #a == 1 then
return
elseif #a == 2 then
if math.random(2) == 1 then
a[1], a[2] = a[2], a[1]
end
elseif #a >= 3 then
for i = #a, 2, -1 do
local j = math.random(i)
a[i], a[j] = a[j], a[i]
end
end
else
return tostring(o)
end
end
function sound_pda()
xr_sound.set_sound_play(AC_ID, "pda_tips")
return true
end
function npc_surrendered(npc)
local st = db.storage[npc:id()]
return st and st.victim_surrender and st.victim_surrender >= 0 and st.victim_surrender < 65534 or false
end
--====================< Actions >====================--
function actor_on_before_death()
if not player_death_state then
return
end
send_tip_random(gt("st_darkasleif_companion_player_death" .. math.random(number["actor_on_before_death"])), show_time)
end
function actor_on_feeling_anomaly(obj)
if not anomaly_state then
return
end
local anomaly_type
local anomaly_strength
local message
local sec = obj:section()
if not cooldown("Anomaly", anomaly_timer) then
return
end
if string.find(sec, "electric") then
anomaly_type = "electric"
elseif string.find(sec, "chemical") then
anomaly_type = "chemical"
elseif string.find(sec, "thermal") then
anomaly_type = "thermal"
elseif string.find(sec, "gravitational") then
anomaly_type = "gravitational"
else
printf("Anomaly Unable to be Identified")
printf("Anomaly Section: %s", obj:section())
printf("Anomaly Name: %s", obj:name())
end
if string.find(sec, "strong") then
anomaly_strength = "strong"
elseif string.find(sec, "normal") then
anomaly_strength = "normal"
elseif string.find(sec, "weak") then
anomaly_strength = "weak"
end
if anomaly_type and anomaly_strength then
message = gt("st_darkasleif_actor_on_feeling_anomaly_" .. anomaly_type .. math.random(number["anomaly_part_1"])) .. " " .. gt("st_darkasleif_actor_on_feeling_anomaly_" .. anomaly_strength .. math.random(number["anomaly_part_2"]))
elseif anomaly_type then
message = gt("st_darkasleif_actor_on_feeling_anomaly_" .. anomaly_type .. math.random(number["anomaly_part_1"]))
end
if message then
send_tip_random(message, show_time)
end
end
function actor_on_first_update()
level_change = true
end
function actor_on_interaction(typ, obj, name)
if (typ == "anomalies") and (name == "psi_storm_start") and psistorm_state then
send_tip_random(gt("st_darkasleif_on_before_psi_storm" .. math.random(number["psi_storm"])), show_time)
elseif (typ == "anomalies") and (name == "emission_start") and emission_state then
send_tip_random(gt("st_darkasleif_on_before_surge" .. math.random(number["emission"])), show_time)
end
end
function actor_on_update()
if not campfire_state and not random_state and not safe_area_state then
return
end
n = n + 1
if n ~= 100 then
return
end
n = 1
if random_state and math.random(10000*random_chance) == 1 and not in_combat() then
send_tip_random(gt("st_darkasleif_random" .. math.random(number["random"])), show_time)
end
local tg = time_global()
if not tg_previous then
tg_previous = tg
end
get_time_table()
if not bind_campfire.get_nearby_campfire(campfire_radius_far, true) or not bind_campfire.get_nearby_campfire(campfire_radius_far, true):is_on() then
if campfire_random and new_num then
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_" .. new_num)
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_1")
elseif campfire_random then
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_1")
end
timer = nil
near_campfire_table = {}
return
elseif not bind_campfire.get_nearby_campfire(campfire_radius, true) or not bind_campfire.get_nearby_campfire(campfire_radius, true):is_on() then
timer = nil
near_campfire_table = {}
return
end
if in_combat() then
if campfire_random and new_num then
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_" .. new_num)
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_1")
elseif campfire_random then
RemoveTimeEvent("CC" .. campfire_random, "Campfire_" .. campfire_random .. "_1")
end
timer = nil
near_campfire_table = {}
return
end
if delay and (tg <= delay) then
return
end
delay = nil
if not timer then
timer = tg + math.random(min_timer,max_timer)
elseif tg >= timer then
campfire_obj = bind_campfire.get_nearby_campfire(campfire_radius, false)
level.iterate_nearest(campfire_obj:position(), 3, iterate_function_campfire)
shuffle(near_campfire_table)
campfire_random = math.random(number["campfire"])
if (last_tale ~= campfire_random) and enough_people() and bind_campfire.get_nearby_campfire(campfire_radius_far, true) and bind_campfire.get_nearby_campfire(campfire_radius_far, true):is_on() and new_num and campfire_random and new_num<=#person_table[campfire_random] and time_table[campfire_random][1] then
CreateTimeEvent("CC" .. 1, "Campfire_" .. campfire_random .. "_" .. 1, 0, msg_func, 1)
last_tale = campfire_random
end
timer = nil
delay = tg + math.random(min_delay,max_delay)
end
end
function actor_on_weapon_jammed()
if not jammed_state then
return
end
send_tip_random(gt("st_darkasleif_jammed" .. math.random(number["weapon_jammed"])), show_time)
end
function actor_on_weapon_reload()
if not reload_state or not (math.random(100) <= reload_chance) or not in_combat() then
return
end
send_tip_random(gt("st_darkasleif_reload" .. math.random(number["weapon_reload"])), show_time)
end
function monster_on_death_callback(obj)
id = obj:id()
stored_id = obj:id()
if enemy_table[id] then
table.remove(enemy_table, id)
npc_was_enemy = true
else
npc_was_enemy = false
end
if clear_state and npc_was_enemy and not in_combat() and area_clear then
send_tip_random(gt("st_darkasleif_clear" .. math.random(number["clear"])), show_time)
end
end
function npc_on_before_hit(npc,shit,bone_id,flags)
if (bone_id <= 14) or (bone_id >= 19) then
return
end
npc_stored = npc
end
function npc_on_death_callback(obj)
local id = obj:id()
stored_id = obj:id()
if enemy_table[id] then
table.remove(enemy_table, id)
npc_was_enemy = true
else
npc_was_enemy = false
end
if not npc_death_state and not npc_death_comment_state and not clear_state then
return
end
if npc_death_state and obj:has_info("npcx_is_companion") then
send_tip(gt("st_darkasleif_npc_on_death_callback" .. math.random(number["npc_on_death"])), obj, show_time)
if npc_toggle[id] then
table.remove(npc_toggle, id)
end
end
if npc_death_comment_state and obj:has_info("npcx_is_companion") then
send_tip_random(gt("st_darkasleif_companion_death" .. math.random(number["companion_death"])), show_time)
end
if clear_state and npc_was_enemy and not in_combat() then
send_tip_random(gt("st_darkasleif_clear" .. math.random(number["clear"])), show_time)
end
end
function npc_on_hit_callback(npc,amount,local_direction,who,bone_index)
if not npc_stored or not who:has_info("npcx_is_companion") or (who:id() == 0) then
return
end
send_tip(gt("st_darkasleif_headshot" .. math.random(number["headshot"])), who, show_time)
npc_stored = nil
end
function npc_on_update(npc)
if not npc_health_state or not npc:has_info("npcx_is_companion") or npc:id() == 0 then
return
end
local id = npc:id()
local health = npc.health
if health < 0.3 and not npc_toggle[id] then
send_tip(gt("st_darkasleif_near_death" .. math.random(number["near_death"])), npc, show_time)
npc_toggle[id] = true
elseif health >= 0.5 and npc_toggle[id] then
npc_toggle[id] = false
end
end
function on_enemy_eval(obj, enemy)
local id = enemy:id()
if not enemy_state or enemy_table[id] or not obj:has_info("npcx_is_companion") or not is_enemy(enemy, db.actor, false) then
return
end
enemy_table[id] = true
local squad_enemy = get_object_squad(enemy)
if squad_enemy then
local squad_id = squad_enemy.id
if squad_table[squad_id] then
return
else
squad_table[squad_id] = enemy:position()
end
squad_count = 0
for k in squad_enemy:squad_members() do
local se_obj = k.object or k.id and sim:object(k.id)
if se_obj.position:distance_to(squad_table[squad_id]) < 25 then
squad_count = squad_count + 1
end
end
end
local message
if IsStalker(enemy) then
local faction = enemy:character_community()
if not stalker_responses[faction] then
return
end
message = gt("st_darkasleif_short_".. faction .. math.random(stalker_responses[faction]))
elseif IsMonster(enemy) then
local sec = enemy:section()
name = "mutant"
if string.find(sec, "pseudodog") then
name = "pseudodog"
elseif string.find(sec, "psy_dog") then
name = "psy_dog"
elseif string.find(sec, "zat_b18_dog_little") then
return
elseif string.find(sec, "dog") then
name = "dog"
elseif string.find(sec, "polter") then
name = "poltergeist"
elseif string.find(sec, "pyro") then
name = "pyrogeist"
else
for key, _ in pairs(mutant_responses) do
if string.find(sec, key) then
name = key
break
end
end
end
if not mutant_responses[name] then
return
end
if name == "mutant" then
for _, val in pairs(stalker_table) do
if string.find(sec, val) then
return
end
end
end
message = gt("st_darkasleif_short_" .. name .. math.random(mutant_responses[name]))
if name == "mutant" then
printf("Enemy Unable to be Identified")
printf("Enemy Section: %s", obj:section())
printf("Enemy Name: %s", obj:name())
end
end
if not message then
return
end
if squad_enemy and squad_count > 1 then
message = message .. " " .. gt("st_darkasleif_multiple"..math.random(number["part_2"]))
end
if message then
send_tip(message, obj, show_time)
end
end
function on_key_press()
if level_change then
level_change = false
local level_name = level.name()
if not level_state or not level_name or not (math.random(100) <= level_chance) then
return
end
CreateTimeEvent("CC", "Printing Level Response", 3, level_func)
end
end
--====================< Callbacks >====================--
function on_game_start()
RegisterScriptCallback("actor_on_before_death", actor_on_before_death)
RegisterScriptCallback("actor_on_feeling_anomaly", actor_on_feeling_anomaly)
RegisterScriptCallback("actor_on_first_update", actor_on_first_update)
RegisterScriptCallback("actor_on_interaction", actor_on_interaction)
RegisterScriptCallback("actor_on_update", actor_on_update)
RegisterScriptCallback("actor_on_weapon_jammed", actor_on_weapon_jammed)
RegisterScriptCallback("actor_on_weapon_reload", actor_on_weapon_reload)
RegisterScriptCallback("monster_on_death_callback", monster_on_death_callback)
RegisterScriptCallback("npc_on_before_hit", npc_on_before_hit)
RegisterScriptCallback("npc_on_death_callback", npc_on_death_callback)
RegisterScriptCallback("npc_on_hit_callback", npc_on_hit_callback)
RegisterScriptCallback("npc_on_update", npc_on_update)
RegisterScriptCallback("on_enemy_eval", on_enemy_eval)
RegisterScriptCallback("on_game_load", load_settings)
RegisterScriptCallback("on_key_press", on_key_press)
RegisterScriptCallback("on_option_change", load_settings)
end
@@ -0,0 +1,80 @@
function on_mcm_load()
op = { id= "chatter",sh=true ,gr={
{id = "title", type= "slide", link= "ui_options_slider_player", text="ui_mcm_chatter_title", size= {512,50}, spacing= 20},
{id = "desc1", type = "desc", text = "ui_mcm_chatter_desc1"},
{id = "show_time", type = "track", val = 2, min=1, max=60, step=1, def = 5},
{id = "show_time_long", type = "track", val = 2, min=1, max=60, step=1, def = 15},
{id = "beep_before", type = "check", val = 1, def=true},
{id = "beep_after", type = "check", val = 1, def=false},
{id = "msg_state", type = "check", val = 1, def = false},
{id = "msg_argb", type = "input", val = 0, def = "255,255,255,255"--[[, precondition = { function() return get_config("msg_state") end }--]]},
{id = "divider", type = "line"},
{id = "desc2", type = "desc", text = "ui_mcm_chatter_desc2"},
{id = "anomaly_state", type = "check", val = 1, def=true},
{id = "anomaly_timer", type = "track", val = 2, min=10, max=1200, step=10, def = 60--[[, precondition = { function() return get_config("anomaly_state") end }--]]},
{id = "clear_state", type = "check", val = 1, def=true},
{id = "campfire_state", type = "check", val = 1, def=true},
{id = "wpm", type = "track", val = 2, min=50, max=300, step=5, def = 150--[[, precondition = { function() return get_config("campfire_state") end }--]]},
{id = "npc_death_state", type = "check", val = 1, def=true},
{id = "npc_death_comment_state", type = "check", val = 1, def=true},
{id = "emission_state", type = "check", val = 1, def=true},
{id = "enemy_state", type = "check", val = 1, def=true},
{id = "headshot_state", type = "check", val = 1, def=true},
{id = "level_state", type = "check", val = 1, def=true},
{id = "level_chance", type = "track", val = 2, min=1, max=100, step=1, def = 5--[[, precondition = { function() return get_config("level_state") end }--]]},
{id = "npc_health_state", type = "check", val = 1, def=true},
{id = "player_death_state", type = "check", val = 1, def=true},
{id = "psistorm_state", type = "check", val = 1, def=true},
{id = "jammed_state", type = "check", val = 1, def=true},
{id = "reload_state", type = "check", val = 1, def=true},
{id = "reload_chance", type = "track", val = 2, min=1, max=100, step=1, def = 5--[[, precondition = { function() return get_config("reload_state") end }--]]},
{id = "random_state", type = "check", val = 1, def=true},
{id = "random_chance", type = "track", val = 2, min=0.1, max=10, step=0.1, def = 1--[[, precondition = { function() return get_config("random_state") end }--]]},
{id = "safe_area_state", type = "check", val = 1, def=true},
{id = "safe_area_chance", type = "track", val = 2, min=1, max=100, step=1, def = 5--[[, precondition = { function() return get_config("safe_area_state") end }--]]},
}
}
return op
end
-- If you don't use MCM, change your defaults from here.
local defaults = {
["show_time"] = 5,
["show_time_long"] = 15,
["beep_before"] = true,
["beep_after"] = false,
["msg_state"] = false,
["msg_argb"] = "255,255,255,255",
["anomaly_state"] = true,
["anomaly_timer"] = 60,
["campfire_state"] = true,
["wpm"] = 150,
["clear_state"] = true,
["npc_death_state"] = true,
["npc_death_comment_state"] = true,
["emission_state"] = true,
["enemy_state"] = true,
["headshot_state"] = true,
["level_state"] = true,
["level_chance"] = 5,
["npc_health_state"] = true,
["player_death_state"] = true,
["psistorm_state"] = true,
["jammed_state"] = true,
["reload_state"] = true,
["reload_chance"] = 5,
["random_state"] = true,
["random_chance"] = 1,
["safe_area_state"] = true,
["safe_area_chance"] = 5,
}
function get_config(key)
if ui_mcm then return ui_mcm.get("chatter/"..key) else return defaults[key] end
end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,598 @@
-- ============================================================
--
-- dialogs_axr_companion.script
-- CoC 1.4.21 - DoctorX Questlines 1.20
--
-- Modified by: DoctorX
-- Last revised: December 21, 2016
--
-- ============================================================
--Scripting Dialog Made Easy
local saved_dialog
function add_dialog(p_id,id,phrase_id,cond,act)
if not ( saved_dialog ) then
return
end
local phrase = saved_dialog:AddPhrase(phrase_id,tostring(id),tostring(p_id),-10000)
if not ( phrase ) then
return
end
--printf("phrase_id = %s",phrase_id)
local phrase_script = phrase:GetPhraseScript()
if ( cond ) then
if ( type(cond) == "table" ) then
for key, value in pairs(cond) do
if (utils_data.findfunction(value,_G)) then
phrase_script:AddPrecondition(value)
--table.insert(cond_list,value)
else
printe("!ERROR dialog_manager | No such function exists '%s'",value)
end
end
else
if (utils_data.findfunction(cond,_G)) then
phrase_script:AddPrecondition(cond)
--table.insert(cond_list,value)
else
printe("!ERROR dialog_manager | No such function exists '%s'",cond)
end
end
end
if ( act ) then
if ( type(act) == "table" ) then
for key, value in pairs(act) do
if (utils_data.findfunction(value,_G)) then
phrase_script:AddAction(value)
else
printe("!ERROR dialog_manager | No such function exists '%s'",value)
end
end
else
if (utils_data.findfunction(act,_G)) then
phrase_script:AddAction(act)
else
printe("!ERROR dialog_manager | No such function exists '%s'",act)
end
end
end
return phrase_script
end
function set_actor_dialogs(npc, ini, name, dialog_section)
if dialog_section == nil then return end
local actor_dialogs_string = ini:r_string_ex(dialog_section,"id") or ""
if actor_dialogs_string ~= nil then
db.storage[npc:id()].actor_dialogs = parse_names(actor_dialogs_string)
end
local actor_disable = ini:r_string_ex(dialog_section,"disable") or ""
if actor_disable ~= nil then
db.storage[npc:id()].actor_disable = parse_names(actor_disable)
end
end
function dm_init_is_actor_companion(dialog)
saved_dialog = dialog
------MAIN [ DIALOG INITATION ] --
add_dialog("",0,"axr_phrase_actor_give_command","dialogs_axr_companion.is_actor_companion")
add_dialog(0,1,"axr_phrase_companion_ask_for_command")
------MAIN [ SWAP ItEMS ] (666+)
add_dialog(1,666,"st_companion_inv_show_gui",nil,"axr_companions.start_trade")
add_dialog(1,667,"st_companion_inv_take_all_my_items","axr_companions.can_handle_all_items","axr_companions.give_all_to_companion")
add_dialog(667,6671,"st_companion_inv_take_all_my_items_response_accept_" .. tostring(math.random(1,50)))
add_dialog(1,668,"st_companion_inv_take_all_my_items_dummy","axr_companions.can_not_handle_all_items")
add_dialog(668,6681,"st_companion_inv_take_all_my_items_response_refuse_" .. tostring(math.random(1,50)))
add_dialog(1,669,"st_companion_inv_give_me_back_all_items","axr_companions.is_assigned_companion","axr_companions.take_all_from_companion")
add_dialog(669,6691,"st_companion_inv_give_me_back_all_items_response")
------MAIN [ FOLLOW/WAIT ] (10+)
add_dialog(1,10,"axr_phrase_actor_give_command_follow","dialogs_axr_companion.companion_is_not_following","dialogs_axr_companion.set_companion_to_follow_state")
add_dialog(1,11,"axr_phrase_actor_give_command_wait","dialogs_axr_companion.companion_not_waiting","dialogs_axr_companion.set_companion_to_wait_state")
------MAIN [ COMBAT ] (20+)
add_dialog(1,20,"axr_phrase_actor_give_command_combat")
add_dialog(20,21,"axr_phrase_companion_acknowledge_3")
-- sub-menu
--[[
add_dialog(21,22,"axr_phrase_actor_give_command_combat_type_camper","dialogs_axr_companion.companion_combat_type_not_camper","dialogs_axr_companion.set_companion_combat_type_camper")
add_dialog(21,23,"axr_phrase_actor_give_command_combat_type_monolith","dialogs_axr_companion.companion_combat_type_not_monolith","dialogs_axr_companion.set_companion_combat_type_monolith")
add_dialog(21,24,"axr_phrase_actor_give_command_combat_type_default","dialogs_axr_companion.companion_combat_type_not_default","dialogs_axr_companion.set_companion_combat_type_default")
--]]
add_dialog(21,25,"axr_phrase_actor_give_command_ignore_combat","dialogs_axr_companion.companion_is_not_ignoring_combat","dialogs_axr_companion.set_companion_to_ignore_combat_state")
add_dialog(21,26,"axr_phrase_actor_give_command_dont_ignore_combat","dialogs_axr_companion.companion_is_ignoring_combat","dialogs_axr_companion.set_companion_to_attack_state")
add_dialog(21,27,"axr_phrase_actor_give_command_ignore_combat_but_help_actor","dialogs_axr_companion.companion_is_not_ignoring_combat","dialogs_axr_companion.set_companion_to_attack_only_actor_combat_enemy_state")
------MAIN [ Find-Cover ] (30+)
--add_dialog(1,30,"axr_phrase_actor_give_command_hide_in_cover","dialogs_axr_companion.companion_not_hiding_in_cover","dialogs_axr_companion.set_companion_hide_in_cover")
------MAIN [ DISTANCE ] (40+)
add_dialog(1,40,"axr_phrase_actor_give_command_stay_close","dialogs_axr_companion.companion_distance_far","dialogs_axr_companion.switch_companion_distance")
add_dialog(1,41,"axr_phrase_actor_give_command_keep_distance","dialogs_axr_companion.companion_distance_near","dialogs_axr_companion.switch_companion_distance")
------MAIN [ STEALTH ] (50+)
add_dialog(1,50,"axr_phrase_actor_give_command_stealth","dialogs_axr_companion.companion_not_stealthy","dialogs_axr_companion.set_companion_to_stealth_substate")
add_dialog(1,51,"axr_phrase_actor_give_command_stop_stealth","dialogs_axr_companion.companion_is_stealthy","dialogs_axr_companion.set_companion_to_default_substate")
------MAIN [ Looting ] (55+)
add_dialog(1,55,"axr_phrase_actor_give_command_gather_items","dialogs_axr_companion.companion_gather_items_disabled","dialogs_axr_companion.switch_companion_gather_items")
add_dialog(1,56,"axr_phrase_actor_give_command_gather_items_stop","dialogs_axr_companion.companion_gather_items_enabled","dialogs_axr_companion.switch_companion_gather_items")
add_dialog(1,57,"axr_phrase_actor_give_command_loot_corpses","dialogs_axr_companion.companion_loot_corpses_disabled","dialogs_axr_companion.switch_companion_loot_corpses")
add_dialog(1,58,"axr_phrase_actor_give_command_loot_corpses_stop","dialogs_axr_companion.companion_loot_corpses_enabled","dialogs_axr_companion.switch_companion_loot_corpses")
------MAIN [ PATROL ] (55+)
--add_dialog(1,55,"axr_phrase_actor_give_command_patrol_menu")
--add_dialog(55,56,"axr_phrase_companion_acknowledge_2")
-- sub-menu
--add_dialog(56,57,"axr_phrase_actor_give_command_stop_patrol","dialogs_axr_companion.companion_is_patrolling","dialogs_axr_companion.switch_companion_patrol_mode")
--add_dialog(56,58,"axr_phrase_actor_give_command_start_patrol",{"dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_has_waypoint"},"dialogs_axr_companion.switch_companion_patrol_mode")
--add_dialog(56,59,"axr_phrase_actor_give_command_patrol_add_waypoints","dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_add_waypoints")
--add_dialog(56,60,"axr_phrase_actor_give_command_patrol_remove_waypoints",{"dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_has_waypoint"},{"dialogs_axr_companion.companion_remove_waypoints","dialogs_axr_companion.switch_companion_patrol_mode"})
------MAIN [ COMPANION REMOVE ] (100+)
--add_dialog(1,100,"axr_phrase_actor_give_command_leave")
--add_dialog(100,101,"axr_phrase_companion_are_you_sure")
-- sub-menu
--add_dialog(101,102,"axr_phrase_actor_give_command_leave",nil,"dialogs_axr_companion.remove_companions_from_squad")
------{{Submenu --> exit}} (900+)
add_dialog(1,900,"axr_phrase_actor_give_command_nevermind")
add_dialog(21,901,"axr_phrase_actor_give_command_nevermind")
--add_dialog(56,902,"axr_phrase_actor_give_command_nevermind")
--add_dialog(101,903,"axr_phrase_actor_give_command_nevermind")
end
--[[
<dialog id="dm_companion_stealth">
<precondition>dialogs_axr_companion.is_actor_companion</precondition>
<phrase_list>
<phrase id="0">
<text>axr_phrase_actor_give_command_stealth</text>
<precondition>dialogs_axr_companion.companion_not_stealthy</precondition>
<action>dialogs_axr_companion.set_companion_to_stealth_substate</action>
</phrase>
<phrase id="1">
<text>axr_phrase_actor_give_command_stop_stealth</text>
<precondition>dialogs_axr_companion.companion_is_stealthy</precondition>
<action>dialogs_axr_companion.set_companion_to_default_substate</action>
</phrase>
</phrase_list>
</dialog>
--]]
function dm_init_companion_patrol(dialog)
saved_dialog = dialog
add_dialog("",0,"axr_phrase_actor_give_command_patrol_menu")
add_dialog(0,1,"axr_phrase_companion_acknowledge_2")
add_dialog(1,2,"axr_phrase_actor_give_command_stop_patrol","dialogs_axr_companion.companion_is_patrolling","dialogs_axr_companion.switch_companion_patrol_mode")
add_dialog(1,3,"axr_phrase_actor_give_command_start_patrol",{"dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_has_waypoint"},"dialogs_axr_companion.switch_companion_patrol_mode")
add_dialog(1,4,"axr_phrase_actor_give_command_patrol_add_waypoints","dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_add_waypoints")
add_dialog(1,5,"axr_phrase_actor_give_command_patrol_remove_waypoints",{"dialogs_axr_companion.companion_not_patrolling","dialogs_axr_companion.companion_has_waypoint"},{"dialogs_axr_companion.companion_remove_waypoints"})
add_dialog(1,6,"axr_phrase_actor_give_command_nevermind")
end
--[[
function dm_actor_become_companion_guide_precond(actor, npc)
if not (axr_companions) then return false end
if not (axr_companions.Enabled) then return false end
local squad = get_object_squad(npc)
if squad ~= nil and squad:commander_id() ~= npc:id() then
return false
end
if npc:character_community() == "bandit" then
return false
end
if npc:character_community() == "army" then
return false
end
local npc_squad = get_object_squad(npc)
if (npc_squad.current_action and npc_squad.current_action == 1) then
return false
end
return is_not_actor_companion(actor,npc)
end
-------------------------------------------
function squad_action_description_for_chasing(actor,npc)
local target_obj = alife_object(target_id)
return "dm_" .. "stalker" .."_chasing_squad_"..alife_character_community(target_obj) --npc:character_community()
end
function squad_action_description_for_travelling(actor,npc)
local target_obj = alife_object(target_id)
local smart_name = target_obj:name()
local travel_class = travel_manager.get_travel_class()
local desc = travel_class.smart_to_stringtables[smart_name]
if desc == nil then
printf("wrong smart name [%s] in travel_manager.ltx", tostring(smart_name))
end
return desc
end
function precond_squad_target_is_squad(actor,npc)
local target_obj = alife_object(target_id)
local target_clsid = target_obj:clsid()
return target_clsid == clsid.online_offline_group_s
end
function precond_squad_target_is_smart(actor,npc)
local target_obj = alife_object(target_id)
local target_clsid = target_obj:clsid()
return target_clsid == clsid.smart_terrain
end
--]]
--[[
Become Companion Dialog Preconditions
--]]
function is_non_story(actor,npc)
local squad = get_object_squad(npc)
if not (squad) then
return false
end
if (get_object_story_id(squad.id)) then
return false
end
return true
end
function is_room_in_actor_squad(actor,npc)
local max_size = axr_companions.max_actor_squad_size + (game_achievements.has_achievement("patriarch") and 2 or 0)
if (axr_companions.get_companion_count() + utils_obj.get_squad_count(npc) <= max_size) then
return true
end
return false
end
function is_module_enabled(actor,npc)
return axr_companions and axr_companions.Enabled or false
end
function is_actor_friend(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
local squad = get_object_squad(npc)
if not (squad) then
return false
end
if not (axr_companions.allow_simulation_squads_as_companions) then
return false
end
if not (axr_companions.allow_only_friends_as_companions) then
return true
end
return npc:relation(db.actor) == game_object.friend
end
function set_squad_relation_by_chance(npc,actor)
local chance = math.floor(random_number(1,10)+0.5)
if ( chance < 3 ) then
--axr_hostile_relations.set_squad_relation(npc,actor,game_object.enemy)
end
end
function is_squad_count_greater(first_speaker,second_speaker)
local count = utils_obj.get_squad_count(first_speaker)
if ( count == nil or ( count and count <= 1 )) then
return false
end
return true
end
function is_squad_count_one(first_speaker,second_speaker)
local count = utils_obj.get_squad_count(first_speaker)
if ( count and count > 1 ) then
return false
end
return true
end
function become_actor_companion(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
local squad = get_object_squad(npc)
if not (squad) then
return
end
axr_companions.companion_squads[squad.id] = squad
SIMBOARD:assign_squad_to_smart(squad, nil)
for k in squad:squad_members() do
local member = db.storage[k.id] and db.storage[k.id].object
if ( member and member:alive() ) then
axr_companions.add_to_actor_squad(member)
end
end
end
-- ////////////////////////////////////////////////////////////////////////////////////////////////
--
-- is_hostage_task_giver function
--
-- ------------------------------------------------------------------------------------------------
--
-- Description:
-- - Determines if the current NPC is a simulation hostage task giver
--
-- Usage:
-- is_hostage_task_giver( )
--
-- Parameters:
-- none
--
-- Return value (type: bool):
-- Returns true if the NPC is a current simulation hostage task giver, false otherwise
--
-- ------------------------------------------------------------------------------------------------
-- Modified by DoctorX
-- for DoctorX Questlines 1.6
-- Last modified October 13, 2016
-- ------------------------------------------------------------------------------------------------
-- Determine if current NPC is sim hostage giver:
function is_hostage_task_giver( a, b )
-- Determine if current NPC is sim hostage task giver:
local npc = dialogs.who_is_npc( a, b )
local se_obj = npc and alife( ):object( npc:id( ) )
local giver_id = se_obj and (se_obj.group_id ~= 65535 and se_obj.group_id or se_obj.id)
if ( load_var( db.actor, ("drx_sl_hostage_giver_" .. giver_id), false ) ) then
return true
end
return false
end
-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function is_not_hostage_task_giver(a,b)
return not is_hostage_task_giver(a,b)
end
--[[
Companion Dialog Preconditions
--]]
function is_actor_companion(actor,npc)
return npc:has_info("npcx_is_companion")
end
function is_not_actor_companion(actor,npc)
return npc:has_info("npcx_is_companion") ~= true
end
function can_dismiss_companion(actor,npc)
return npc:has_info("npcx_beh_cannot_dismiss") ~= true
end
function companion_is_stealthy(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_substate_stealth")
end
function companion_not_stealthy(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_substate_stealth") == false
end
function companion_is_not_ignoring_combat(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_ignore_combat") == false
end
function companion_is_ignoring_combat(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_ignore_combat")
end
function companion_is_not_following(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_wait")
end
function companion_not_waiting(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_wait") == false
end
function companion_distance_far(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_distance_far")
end
function companion_distance_near(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_distance_far") == false
end
function companion_using_cover(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_hide_in_cover") == true
end
function companion_not_using_cover(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_hide_in_cover") ~= true
end
function companion_combat_type_not_camper(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_combat_tactics_camper") == false
end
function companion_combat_type_not_monolith(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_combat_tactics_monolith") == false
end
function companion_combat_type_not_default(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
if ( npc:has_info("npcx_beh_combat_tactics_monolith") or npc:has_info("npcx_beh_combat_tactics_camper") ) then
return true
end
end
function companion_not_patrolling(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_patrol_mode") == false
end
function companion_is_patrolling(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_patrol_mode")
end
function companion_has_waypoint(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return se_load_var(npc:id(),npc:name(),"pathpoint2") ~= nil--load_var(npc,"pathpoint2") ~= nil
end
function companion_gather_items_enabled(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_gather_items")
end
function companion_gather_items_disabled(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_gather_items") == false
end
function companion_loot_corpses_enabled(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_loot_corpses")
end
function companion_loot_corpses_disabled(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
return npc:has_info("npcx_beh_loot_corpses") == false
end
--[[
Companion Dialog Actions
--]]
function set_companion_to_stealth_substate(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_stealth_substate)
end
function set_companion_to_default_substate(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_default_substate)
end
function set_companion_to_wait_state(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_wait_state)
end
function set_companion_to_follow_state(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_follow_state)
end
function set_companion_to_attack_state(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_attack_state)
end
function set_companion_to_ignore_combat_state(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_ignore_combat_state)
end
function set_companion_to_attack_only_actor_combat_enemy_state(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_to_attack_only_actor_combat_enemy_state)
end
function switch_companion_distance(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.switch_companion_distance)
end
function remove_companions_from_squad(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.remove_from_actor_squad)
end
function set_companion_hide_in_cover(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_hide_in_cover)
end
function set_companion_combat_type_camper(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_combat_type_camper)
end
function set_companion_combat_type_monolith(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_combat_type_monolith)
end
function set_companion_combat_type_default(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.set_companion_combat_type_default)
end
function switch_companion_patrol_mode(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.switch_companion_patrol_mode)
--axr_companions.switch_companion_patrol_mode(npc)
end
function companion_add_waypoints(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
--utils_obj.execute_script_on_squad(npc,axr_companions.companion_add_waypoints)
axr_companions.companion_add_waypoints(npc)
end
function companion_remove_waypoints(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
--utils_obj.execute_script_on_squad(npc,axr_companions.companion_remove_waypoints)
axr_companions.companion_remove_waypoints(npc)
end
function switch_companion_gather_items(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.switch_companion_gather_items)
end
function switch_companion_loot_corpses(actor,npc)
local npc = dialogs.who_is_npc(actor,npc)
utils_obj.execute_script_on_squad(npc,axr_companions.switch_companion_loot_corpses)
end
function st_companion_talk_anecdote(a,b)
local str = game.translate_string("st_phrase_companion_talk_" .. math.random(1,128))
return str
end
function st_companion_talk_fact(a,b)
local str = game.translate_string("st_phrase_companion_fact_" .. math.random(1,196))
return str
end
File diff suppressed because it is too large Load Diff