SkacikPL

Untitled

Jun 2nd, 2018
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.71 KB | None | 0 0
  1. local mod = get_mod("trueflight_tweaks")
  2. local NUM_PROJECTILES = 11
  3. local weapon_template = weapon_template or {}
  4. Weapons = Weapons or {}
  5.  
  6. weapon_template.actions = {
  7.     action_career = {
  8.         default = {
  9.             aim_time = 0,
  10.             default_zoom = "zoom_in_trueflight",
  11.             anim_end_event = "ability_finished",
  12.             kind = "true_flight_bow_aim",
  13.             hold_input = "action_career_hold",
  14.             weapon_action_hand = "left",
  15.             aim_sound_event = "Play_career_ability_waywatcher_start",
  16.             minimum_hold_time = 0.83,
  17.             uninterruptible = true,
  18.             anim_event = "waywatcher_trueflight_ability_charge",
  19.             anim_end_event_condition_func = function (unit, end_reason)
  20.                 return end_reason ~= "new_interupting_action"
  21.             end,
  22.             total_time = math.huge,
  23.             num_projectiles = NUM_PROJECTILES,
  24.             buffed_zoom_thresholds = {
  25.                 "zoom_in_trueflight",
  26.                 "zoom_in",
  27.                 "increased_zoom_in"
  28.             },
  29.             zoom_thresholds = {
  30.                 "zoom_in_trueflight",
  31.                 "zoom_in"
  32.             },
  33.             zoom_condition_function = function ()
  34.                 return true
  35.             end,
  36.             allowed_chain_actions = {
  37.                 {
  38.                     sub_action = "default",
  39.                     start_time = 0,
  40.                     action = "action_two",
  41.                     input = "action_two"
  42.                 },
  43.                 {
  44.                     sub_action = "default",
  45.                     start_time = 0,
  46.                     action = "action_career_release",
  47.                     input = "action_career_release"
  48.                 },
  49.                 {
  50.                     sub_action = "default",
  51.                     start_time = 0.83,
  52.                     action = "action_career_hold",
  53.                     input = "action_career_hold",
  54.                     end_time = math.huge
  55.                 }
  56.             }
  57.         }
  58.     },
  59.     action_career_hold = {
  60.         default = {
  61.             default_zoom = "zoom_in_trueflight",
  62.             anim_end_event = "ability_finished",
  63.             kind = "true_flight_bow_aim",
  64.             hold_input = "action_career_hold",
  65.             aim_time = 0,
  66.             uninterruptible = true,
  67.             anim_event = "waywatcher_trueflight_ability_hold",
  68.             weapon_action_hand = "left",
  69.             minimum_hold_time = 0,
  70.             anim_end_event_condition_func = function (unit, end_reason)
  71.                 return end_reason ~= "new_interupting_action"
  72.             end,
  73.             total_time = math.huge,
  74.             num_projectiles = NUM_PROJECTILES,
  75.             buffed_zoom_thresholds = {
  76.                 "zoom_in_trueflight",
  77.                 "zoom_in",
  78.                 "increased_zoom_in"
  79.             },
  80.             zoom_thresholds = {
  81.                 "zoom_in_trueflight",
  82.                 "zoom_in"
  83.             },
  84.             zoom_condition_function = function ()
  85.                 return true
  86.             end,
  87.             allowed_chain_actions = {
  88.                 {
  89.                     sub_action = "default",
  90.                     start_time = 0,
  91.                     action = "action_two",
  92.                     input = "action_two"
  93.                 },
  94.                 {
  95.                     sub_action = "default",
  96.                     start_time = 0,
  97.                     action = "action_career_release",
  98.                     input = "action_career_release",
  99.                     end_time = math.huge
  100.                 }
  101.             }
  102.         }
  103.     },
  104.     action_career_release = {
  105.         hold_charge = {
  106.             aim_time = 0,
  107.             anim_end_event = "ability_finished",
  108.             weapon_action_hand = "left",
  109.             kind = "chain_action_passthrough",
  110.             uninterruptible = true,
  111.             anim_event = "waywatcher_trueflight_ability_charge",
  112.             anim_end_event_condition_func = function (unit, end_reason)
  113.                 return end_reason ~= "new_interupting_action"
  114.             end,
  115.             total_time = math.huge,
  116.             allowed_chain_actions = {
  117.                 {
  118.                     sub_action = "default",
  119.                     start_time = 0,
  120.                     action = "action_two",
  121.                     input = "action_two"
  122.                 },
  123.                 {
  124.                     sub_action = "default",
  125.                     start_time = 0.83,
  126.                     action = "action_career_release",
  127.                     auto_chain = true
  128.                 }
  129.             }
  130.         },
  131.         default = {
  132.             speed = 6000,
  133.             ammo_usage = 0,
  134.             fire_sound_event = "player_combat_weapon_bow_fire_light_homing",
  135.             sphere_sweep_length = 50,
  136.             sphere_sweep_max_nr_of_results = 100,
  137.             sphere_sweep_dot_threshold = 0.75,
  138.             true_flight_template = "active_ability_kerillian_way_watcher",
  139.             weapon_action_hand = "left",
  140.             multi_projectile_spread = 0.1,
  141.             kind = "career_we_three",
  142.             charge_value = "light_attack",
  143.             aim_assist_ramp_decay_delay = 0.3,
  144.             anim_end_event = "ability_finished",
  145.             fire_time = 0.1,
  146.             single_target = true,
  147.             aim_assist_max_ramp_multiplier = 0.8,
  148.             aim_assist_ramp_multiplier = 0.4,
  149.             anim_event = "waywatcher_trueflight_ability_shoot",
  150.             apply_recoil = true,
  151.             extra_fire_sound_event = "Play_career_ability_waywatcher_shot",
  152.             hit_effect = "kerillian_ability_trueflight_arrow_impact",
  153.             sphere_sweep_radius = 2,
  154.             uninterruptible = true,
  155.             ignore_shield_hit = true,
  156.             total_time = 0.28,
  157.             anim_end_event_condition_func = function (unit, end_reason)
  158.                 return end_reason ~= "new_interupting_action"
  159.             end,
  160.             allowed_chain_actions = {},
  161.             num_projectiles = NUM_PROJECTILES,
  162.             projectile_info = Projectiles.kerillian_ability_true_flight,
  163.             impact_data = {
  164.                 max_bounces = 2,
  165.                 depth = 0.1,
  166.                 bounce_on_level_units = true,
  167.                 targets = 1,
  168.                 damage_profile = "arrow_sniper_trueflight",
  169.                 wall_nail = true,
  170.                 link = true,
  171.                 depth_offset = -0.6
  172.             },
  173.             alert_sound_range_fire = ALERT_SOUND_RANGE_FIRE,
  174.             alert_sound_range_hit = ALERT_SOUND_RANGE_HIT,
  175.             recoil_settings = {
  176.                 horizontal_climb = -0.5,
  177.                 restore_duration = 0.2,
  178.                 vertical_climb = -1.5,
  179.                 climb_duration = 0.1,
  180.                 climb_function = math.easeInCubic,
  181.                 restore_function = math.ease_out_quad
  182.             }
  183.         }
  184.     },
  185.     action_two = {
  186.         default = {
  187.             weapon_action_hand = "left",
  188.             anim_end_event = "ability_finished",
  189.             kind = "career_cancel",
  190.             total_time = 0,
  191.             anim_end_event_condition_func = function (unit, end_reason)
  192.                 return end_reason ~= "new_interupting_action"
  193.             end,
  194.             allowed_chain_actions = {}
  195.         }
  196.     },
  197.     action_inspect = ActionTemplates.action_inspect,
  198.     action_wield = ActionTemplates.wield,
  199.     action_career_skill = ActionTemplates.career_skill_dummy,
  200.     action_instant_grenade_throw = ActionTemplates.instant_equip_grenade,
  201.     action_instant_heal_self = ActionTemplates.instant_equip_and_heal_self,
  202.     action_instant_heal_other = ActionTemplates.instant_equip_and_heal_other,
  203.     action_instant_drink_potion = ActionTemplates.instant_equip_and_drink_potion,
  204.     action_instant_equip_tome = ActionTemplates.instant_equip_tome,
  205.     action_instant_equip_grimoire = ActionTemplates.instant_equip_grimoire,
  206.     action_instant_equip_grenade = ActionTemplates.instant_equip_grenade_only,
  207.     action_instant_equip_healing_draught = ActionTemplates.instant_equip_and_drink_healing_draught
  208. }
  209. weapon_template.ammo_data = {
  210.     ammo_immediately_available = true,
  211.     ammo_unit = "units/weapons/player/wpn_we_quiver_t1/wpn_we_tripple_arrow_t1",
  212.     ammo_per_reload = 1,
  213.     ammo_per_clip = 1,
  214.     ammo_hand = "left",
  215.     ammo_unit_3p = "units/weapons/player/wpn_we_quiver_t1/wpn_we_tripple_arrow_t1_3p",
  216.     reload_time = 0.4,
  217.     max_ammo = math.huge,
  218.     ammo_unit_attachment_node_linking = AttachmentNodeLinking.arrow_tripple
  219. }
  220. weapon_template.attack_meta_data = {
  221.     aim_at_node = "j_head",
  222.     charge_shot_delay = 0.1,
  223.     always_charge_before_firing = true,
  224.     charged_attack_action_name = "default",
  225.     can_charge_shot = true,
  226.     ignore_enemies_for_obstruction_charged = false,
  227.     base_action_name = "action_career_release",
  228.     aim_at_node_charged = "j_head",
  229.     ignore_allies_for_obstruction = true,
  230.     minimum_charge_time = 0.84,
  231.     ignore_allies_for_obstruction_charged = true,
  232.     charge_when_obstructed = true,
  233.     ignore_enemies_for_obstruction = false,
  234.     charge_against_armoured_enemy = true
  235. }
  236. weapon_template.default_spread_template = "longbow"
  237. weapon_template.slot_to_use = "slot_ranged"
  238. weapon_template.left_hand_unit = "units/weapons/player/wpn_we_bow_01_t1/wpn_we_bow_01_t1"
  239. weapon_template.display_unit = "units/weapons/weapon_display/display_bow"
  240. weapon_template.left_hand_attachment_node_linking = AttachmentNodeLinking.bow
  241. weapon_template.wield_anim = "to_longbow"
  242. weapon_template.wield_anim_no_ammo = "to_longbow_noammo"
  243. weapon_template.crosshair_style = "default"
  244. weapon_template.no_ammo_reload_event = "reload"
  245. weapon_template.buff_type = "RANGED"
  246. weapon_template.weapon_type = "LONGBOW_TRUEFLIGHT"
  247. weapon_template.dodge_count = 3
  248. weapon_template.buffs = {
  249.     change_dodge_distance = {
  250.         external_optional_multiplier = 1
  251.     },
  252.     change_dodge_speed = {
  253.         external_optional_multiplier = 1
  254.     }
  255. }
  256. weapon_template.aim_assist_settings = {
  257.     max_range = 50,
  258.     no_aim_input_multiplier = 0,
  259.     always_auto_aim = true,
  260.     base_multiplier = 0,
  261.     target_node = "j_neck",
  262.     effective_max_range = 30,
  263.     breed_scalars = {
  264.         skaven_storm_vermin = 1,
  265.         skaven_clan_rat = 1,
  266.         skaven_slave = 1
  267.     }
  268. }
  269. weapon_template.wwise_dep_left_hand = {
  270.     "wwise/bow"
  271. }
  272. weapon_template.compare_statistics = {
  273.     attacks = {
  274.         light_attack = {
  275.             speed = 0.6,
  276.             range = 0.6,
  277.             damage = 0.5,
  278.             targets = 0.2,
  279.             stagger = 0.4
  280.         },
  281.         heavy_attack = {
  282.             speed = 0.4,
  283.             range = 0.8,
  284.             damage = 0.75,
  285.             targets = 0.4,
  286.             stagger = 0.6
  287.         }
  288.     },
  289.     perks = {
  290.         light_attack = {
  291.             "head_shot",
  292.             "armor_penetration"
  293.         },
  294.         heavy_attack = {
  295.             "head_shot",
  296.             "armor_penetration"
  297.         }
  298.     }
  299. }
  300. local quality_settings = {
  301.     damage = {
  302.         1,
  303.         2,
  304.         3,
  305.         4
  306.     },
  307.     targets = {
  308.         1,
  309.         2,
  310.         3,
  311.         4
  312.     }
  313. }
  314.  
  315. --[[
  316.     Functions
  317. --]]
  318.  
  319.  
  320.  
  321. --[[
  322.     Hooks
  323. --]]
  324.  
  325. --mod:hook("", function (func, ...)
  326.  
  327.     -- Original function
  328.     --local result = func(...)
  329.     --return result
  330. --end)
  331.  
  332. --[[
  333.     Callback
  334. --]]
  335.  
  336. -- Call on every update to mods
  337. mod.update = function(dt)
  338.     return
  339. end
  340.  
  341. -- Call when all mods are being unloaded
  342. mod.on_unload = function(exit_game)
  343.     return
  344. end
  345.  
  346. -- Call when game state changes (e.g. StateLoading -> StateIngame)
  347. mod.on_game_state_changed = function(status, state)
  348.     return
  349. end
  350.  
  351. -- Call when setting is changed in mod settings
  352. mod.on_setting_changed = function(setting_name)
  353.     return
  354. end
  355.  
  356. -- Call when governing settings checkbox is unchecked
  357. mod.on_disabled = function(is_first_call)
  358.     mod:disable_all_hooks()
  359. end
  360.  
  361. -- Call when governing settings checkbox is checked
  362. mod.on_enabled = function(is_first_call)
  363.     table.create_copy(Weapons.kerillian_waywatcher_career_skill_weapon, weapon_template)
  364.     mod:enable_all_hooks()
  365. end
  366.  
  367.  
  368. --[[
  369.     Execution
  370. --]]
Advertisement
Add Comment
Please, Sign In to add comment