--------------------------------- ----- Written by Darryl123 ------ --------------------------------- ------------------------- ----- Miscellaneous ----- ------------------------- local bread_ini = ini_file( "drx\\drx_ql_locations.ltx" ) -- Check if achievements can be unlocked. function can_unlock() return (db.actor and db.actor.afterFirstUpdate) end -- Returns how many achievements are available. function get_achievements_available() local available = 14 -- 'Duga Free' and 'Wishful Thinking'. if (has_alife_info("story_mode_disabled")) then available = available - 2 end return available end -------------------- ----- Functors ----- -------------------- -- "achievement" function achievement_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_achievement")) then return true end -- Unlock the achievement. if (achievement_requirements()) then achievement_rewards() return true end end -- Completionist. function completionist_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_completionist")) then return true end -- Unlock the achievement. if (completionist_requirements()) then completionist_rewards() return true end end -- Down to Earth. function down_to_earth_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_down_to_earth")) then return true end -- Unlock the achievement. if (down_to_earth_requirements()) then down_to_earth_rewards() return true end end -- Duga Free. function duga_free_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_duga_free")) then return true end -- Unlock the achievement. if (duga_free_requirements()) then duga_free_rewards() return true end end -- Geologist. function geologist_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_geologist")) then return true end -- Unlock the achievement. if (geologist_requirements()) then geologist_rewards() return true end end -- Heavy Pockets. function heavy_pockets_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_heavy_pockets")) then return true end -- Unlock the achievement. if (heavy_pockets_requirements()) then heavy_pockets_rewards() return true end end -- Infopreneur. function infopreneur_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_infopreneur")) then return true end -- Unlock the achievement. if (infopreneur_requirements()) then infopreneur_rewards() return true end end -- Mechanized Warfare. function mechanized_warfare_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_mechanized_warfare")) then return true end -- Unlock the achievement. if (mechanized_warfare_requirements()) then mechanized_warfare_rewards() return true end end -- Patriarch. function patriarch_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_patriarch")) then return true end -- Unlock the achievement. if (patriarch_requirements()) then patriarch_rewards() return true end end -- Radiotherapy. function radiotherapy_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_radiotherapy")) then return true end -- Unlock the achievement. if (radiotherapy_requirements()) then radiotherapy_rewards() return true end end -- Rag and Bone. function rag_and_bone_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_rag_and_bone")) then return true end -- Unlock the achievement. if (rag_and_bone_requirements()) then rag_and_bone_rewards() return true end end -- Silver or Lead. function silver_or_lead_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_silver_or_lead")) then return true end -- Unlock the achievement. if (silver_or_lead_requirements()) then silver_or_lead_rewards() return true end end -- Svin. function food_eaten_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_food_eaten")) then return true end -- Unlock the achievement. if (food_eaten_requirements()) then food_eaten_rewards() return true end end -- Tourist. function tourist_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_tourist")) then return true end -- Unlock the achievement. if (has_alife_info("achieved_tourist_delay")) then tourist_rewards() return true end -- A second infoportion delays the achievement. -- Without this it often unlocks during level transition. if (tourist_requirements()) then db.actor:give_info_portion("achieved_tourist_delay") return true end end -- Well Dressed. function well_dressed_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_well_dressed")) then return true end -- Unlock the achievement. if (well_dressed_requirements()) then well_dressed_rewards() return true end end -- Wishful Thinking. function wishful_thinking_functor() -- Check if it can be unlocked. if (not can_unlock()) then return false end -- Check if it is already unlocked. if (has_alife_info("achieved_wishful_thinking")) then return true end -- Unlock the achievement. if (wishful_thinking_requirements()) then wishful_thinking_rewards() return true end end ------------------------ ----- Requirements ----- ------------------------ -- Completionist. -- Requires all other achievements to be unlocked. -- Exception to 'Duga Free' if story mode is disabled. -- Exception to 'Wishful Thinking' if story mode is disabled. function completionist_requirements() return ( (has_alife_info("achieved_duga_free") or has_alife_info("story_mode_disabled")) and (has_alife_info("achieved_down_to_earth")) and (has_alife_info("achieved_geologist")) and (has_alife_info("achieved_heavy_pockets")) and (has_alife_info("achieved_infopreneur")) and (has_alife_info("achieved_mechanized_warfare")) and (has_alife_info("achieved_patriarch")) and (has_alife_info("achieved_radiotherapy")) and (has_alife_info("achieved_rag_and_bone")) and (has_alife_info("achieved_silver_or_lead")) and (has_alife_info("achieved_food_eaten")) and (has_alife_info("achieved_tourist")) and (has_alife_info("achieved_well_dressed")) and (has_alife_info("achieved_wishful_thinking") or has_alife_info("story_mode_disabled")) ) end -- "achievement" -- Requires having all "bread" in inventory. function achievement_requirements() local bread_amount = ( bread_ini:r_float_ex( "sus_bread_properties", "bread_amount" ) ) return xr_conditions.actor_has_item(db.actor, nil, {"moon_cotz_sus_bread"}) and xr_conditions.actor_has_item_count(db.actor, nil, {"moon_cotz_sus_bread", bread_amount}) end -- Down to Earth. -- Requires 3 helicopters killed, or just one with an RPG-7. function down_to_earth_requirements() return ( (xr_statistic.actor_statistic.heli_kills >= 3) or (xr_statistic.actor_statistic.heli_rocket_kills >= 1) ) end -- Duga Free. -- Requires story mode, and that the Miracle Machine and Brain Scorcher are disabled. function duga_free_requirements() return ( not (has_alife_info("story_mode_disabled")) and (has_alife_info("yan_labx16_switcher_primary_off")) and (has_alife_info("bar_deactivate_radar_done")) ) end -- Geologist. -- Requires 50 artefacts be detected by the player. function geologist_requirements() return ( (xr_statistic.actor_statistic.artefacts_detected >= 50) ) end -- Heavy Pockets. -- Requires player to possess 1,000,000 RU. function heavy_pockets_requirements() return ( (db.actor:money() >= 1000000) ) end -- Infopreneur. -- Requires player to deliver 50 PDAs. function infopreneur_requirements() return ( (xr_statistic.actor_statistic.pdas_delivered >= 50) ) end -- Mechanized Warfare. -- Requires a mechanic to own all tools. function mechanized_warfare_requirements() return ( (has_alife_info("agr_smart_terrain_1_6_army_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("bar_visitors_stalker_mechanic_upgrade_tier_3")) or (has_alife_info("cit_killers_merc_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("val_smart_terrain_7_3_bandit_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("esc_smart_terrain_5_7_loner_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("jup_b217_stalker_tech_upgrade_tier_3")) or (has_alife_info("mar_base_stalker_tech_upgrade_tier_3")) or (has_alife_info("mil_smart_terrain_7_7_freedom_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("pri_monolith_monolith_mechanic_stalker_upgrade_tier_3")) or (has_alife_info("zat_a2_stalker_mechanic_upgrade_tier_3")) ) end -- Patriarch. -- Requires rank of 'Legend' be reached. function patriarch_requirements() return ( (db.actor:character_rank() >= 14000) ) end -- Radiotherapy. -- Requires 25 emissions and 25 psi-storms to be survived. function radiotherapy_requirements() return ( (xr_statistic.actor_statistic.surges >= 25) and (xr_statistic.actor_statistic.storms >= 25) ) end -- Rag and Bone. -- Requires 100 stashes be found and looted. function rag_and_bone_requirements() return ( (xr_statistic.actor_statistic.stashes_found >= 100) ) end -- Silver or Lead. -- Requires player to kill 500 stalkers or have 50 surrender to you. function silver_or_lead_requirements() return ( (xr_statistic.actor_statistic.killed_stalkers >= 500) or (xr_statistic.actor_statistic.enemies_surrendered >= 50) ) end -- Svin. -- Requires player to eat 175 food. function food_eaten_requirements() return (xr_statistic.actor_statistic.food_eaten >= 175) end -- Tourist. -- Requires player to visit all levels. function tourist_requirements() return ( (xr_statistic.actor_visited_all_levels()) ) end -- Well Dressed. -- Requires player to kill 500 mutants or field dress 250 mutant parts. function well_dressed_requirements() return ( (xr_statistic.actor_statistic.killed_monsters >= 500) or (xr_statistic.actor_statistic.field_dressings >= 250) ) end -- Wishful Thinking. -- Requires story mode, and for the player to destroy the Wish Granter. function wishful_thinking_requirements() return ( not (has_alife_info("story_mode_disabled")) and (has_alife_info("sar2_monolith_end")) ) end ------------------- ----- Rewards ----- ------------------- -- Completionist. -- Reputation and rank point increase. function completionist_rewards() db.actor:give_info_portion("achieved_completionist") news_manager.send_tip(db.actor, "st_achievement_10_unlock", nil, "completionist", nil, nil) xr_statistic.inc_achievement("completionist") end -- "achievement" -- Award the Mjolnir armor. function achievement_rewards() local bread_amount = ( bread_ini:r_float_ex( "sus_bread_properties", "bread_amount" ) ) db.actor:give_info_portion("achieved_achievement") news_manager.send_tip(db.actor, "st_achievement_17_unlock", nil, "achievement", nil, nil) xr_effects.give_actor( db.actor, nil, {"halo_outfit"} ) xr_effects.remove_item( db.actor, nil, {"moon_cotz_sus_bread", bread_amount} ) xr_statistic.inc_achievement("achievement") end -- Down to Earth. -- Weaker helicopters are respawned. -- Reputation and rank point increase. function down_to_earth_rewards() db.actor:give_info_portion("achieved_down_to_earth") news_manager.send_tip(db.actor, "st_achievement_12_unlock", nil, "down_to_earth", nil, nil) xr_statistic.inc_achievement("down_to_earth") end -- Duga Free. -- Yantar & Radar psi-fields disabled. -- Reputation and rank point increase. function duga_free_rewards() db.actor:give_info_portion("achieved_duga_free") news_manager.send_tip(db.actor, "st_achievement_4_unlock", nil, "duga_free", nil, nil) xr_statistic.inc_achievement("duga_free") end -- Geologist. -- Increased spawn chance of artefacts. -- Reputation and rank point increase. function geologist_rewards() db.actor:give_info_portion("achieved_geologist") news_manager.send_tip(db.actor, "st_achievement_13_unlock", nil, "geologist", nil, nil) xr_statistic.inc_achievement("geologist") end -- Heavy Pockets. -- Traders sell cheaper and rarer goods. -- Reputation and rank point increase. function heavy_pockets_rewards() db.actor:give_info_portion("achieved_heavy_pockets") news_manager.send_tip(db.actor, "st_achievement_1_unlock", nil, "heavy_pockets", nil, nil) xr_statistic.inc_achievement("heavy_pockets") end -- Infopreneur. -- Money received for delivering PDAs increased. -- Reputation and rank point increase. function infopreneur_rewards() db.actor:give_info_portion("achieved_infopreneur") news_manager.send_tip(db.actor, "st_achievement_3_unlock", nil, "infopreneur", nil, nil) xr_statistic.inc_achievement("infopreneur") end -- Mechanized Warfare. -- A mechanic can now fully upgrade equipment. -- Reputation and rank point increase. function mechanized_warfare_rewards() db.actor:give_info_portion("achieved_mechanized_warfare") news_manager.send_tip(db.actor, "st_achievement_7_unlock", nil, "mechanized_warfare", nil, nil) xr_statistic.inc_achievement("mechanized_warfare") end -- Patriarch. -- Larger sized squads can be recruited. -- Reputation and rank point increase. function patriarch_rewards() db.actor:give_info_portion("achieved_patriarch") news_manager.send_tip(db.actor, "st_achievement_14_unlock", nil, "patriarch", nil, nil) xr_statistic.inc_achievement("patriarch") end -- Radiotherapy. -- 25% chance of surviving emissions and psi-vortices. -- Reputation and rank point increase. function radiotherapy_rewards() db.actor:give_info_portion("achieved_radiotherapy") news_manager.send_tip(db.actor, "st_achievement_2_unlock", nil, "radiotherapy", nil, nil) xr_statistic.inc_achievement("radiotherapy") end -- Rag and Bone. -- Random chance of better loot in task reward stashes. -- Reputation and rank point increase. function rag_and_bone_rewards() db.actor:give_info_portion("achieved_rag_and_bone") news_manager.send_tip(db.actor, "st_achievement_9_unlock", nil, "rag_and_bone", nil, nil) xr_statistic.inc_achievement("rag_and_bone") end -- Silver or Lead. -- 33% chance of a second stash from surrendering stalkers. -- Reputation and rank point increase. function silver_or_lead_rewards() db.actor:give_info_portion("achieved_silver_or_lead") news_manager.send_tip(db.actor, "st_achievement_6_unlock", nil, "silver_or_lead", nil, nil) xr_statistic.inc_achievement("silver_or_lead") end -- Svin. function food_eaten_rewards() db.actor:give_info_portion("achieved_food_eaten") news_manager.send_tip(db.actor, "st_achievement_16_unlock", nil, "food_eaten", nil, nil) xr_statistic.inc_achievement("food_eaten") end -- Tourist. -- 4 "Curious stashes" are revealed. -- Reputation and rank point increase. function tourist_rewards() local bonus1 local t1 = {"commander_outfit", "cs_exo_outfit", "monolith_exo_outfit", "merc_exo_outfit", "military_exo_outfit", "svoboda_exo_outfit", "bandit_exo_outfit", "dolg_exo_outfit"} bonus1 = {t1[math.random(#t1)]} local bonus2 local t2 = {"af_dragon_eye", "af_monolith", "af_black", "af_vaselisk", "af_geliy", "af_agimlet", "af_atom", "af_wish", "af_izumrud"} bonus2 = {t2[math.random(#t2)]} local bonus3 local t3 = {"wpn_ak12", "wpn_g36_nimble", "wpn_groza_nimble", "wpn_fn2000_nimble", "wpn_mdr_drum", "wpn_sig550_luckygun", "wpn_sig550_sniper", "wpn_ak74u_snag", "wpn_val_nimble", "wpn_vintorez_nimble", "wpn_protecta_nimble", "wpn_spas12_nimble", "wpn_usas12", "wpn_saiga12m", "wpn_wincheaster1300_trapper", "wpn_vector", "wpn_awm", "wpn_svd_nimble", "wpn_svu_nimble", "wpn_sv98m", "wpn_wa2000", "wpn_g28", "wpn_rg-6", "wpn_pkm_zulus", "wpn_gauss_comp"} bonus3 = {t3[math.random(#t3)]} local bonus4 local t4 = {"itm_repairkit_tier_3", "equ_tourist_pack", "detector_scientific"} bonus4 = {t4[math.random(#t4)]} coc_treasure_manager.create_random_stash(nil, "st_curious_stash", bonus1) coc_treasure_manager.create_random_stash(nil, "st_curious_stash", bonus2) coc_treasure_manager.create_random_stash(nil, "st_curious_stash", bonus3) coc_treasure_manager.create_random_stash(nil, "st_curious_stash", bonus4) db.actor:disable_info_portion("achieved_tourist_delay") db.actor:give_info_portion("achieved_tourist") news_manager.send_tip(db.actor, "st_achievement_8_unlock", nil, "tourist", nil, nil) xr_statistic.inc_achievement("tourist") end -- Well Dressed. -- 20% chance of extra parts when field dressing mutants. -- Reputation and rank point increase. function well_dressed_rewards() db.actor:give_info_portion("achieved_well_dressed") news_manager.send_tip(db.actor, "st_achievement_5_unlock", nil, "well_dressed", nil, nil) xr_statistic.inc_achievement("well_dressed") end -- Wishful Thinking. -- Reputation and rank point increase. function wishful_thinking_rewards() xr_statistic.inc_actor_rank(2500) xr_statistic.inc_actor_reputation(500) db.actor:give_info_portion("achieved_wishful_thinking") news_manager.send_tip(db.actor, "st_achievement_11_unlock", nil, "wishful_thinking", nil, nil) xr_statistic.inc_achievement("wishful_thinking") end