Large diffs are not rendered by default.

@@ -161,8 +161,9 @@ function SwitchToHeroPreview( heroName ) {
function SelectHero( heroName ) {

// Do nothing if this hero is not available for the player's team
var all_random_enabled = CustomNetTables.GetTableValue( "game_options", "all_random" );
var selected_panel = $("#PickList").FindChildTraverse(heroName)
if (selected_panel.BHasClass( "taken" )) {
if (selected_panel.BHasClass( "taken" ) || (all_random_enabled != null && all_random_enabled[1] == 1)) {
$('#PickHeroBtn').AddClass("disabled");
} else {
$('#PickHeroBtn').RemoveClass("disabled");
@@ -212,9 +213,11 @@ function UpdateAbilities(abilityList) {
function PickHero() {

// Send the pick to the server, if it is available
var selected_panel = $("#PickList").FindChildTraverse(selectedHero)
if (selected_panel.BHasClass( "taken" ) == false) {
GameEvents.SendCustomGameEventToServer( "hero_selected", { HeroName: selectedHero, HasRandomed: false} );
if ($("#PickHeroBtn").BHasClass( "disabled" ) == false) {
var selected_panel = $("#PickList").FindChildTraverse(selectedHero)
if (selected_panel.BHasClass( "taken" ) == false) {
GameEvents.SendCustomGameEventToServer( "hero_selected", { HeroName: selectedHero, HasRandomed: false} );
}
}
}

@@ -307,28 +310,78 @@ function PlayerReconnected(player_id, picked_heroes, player_picks, pick_state, r
/* Initialisation - runs when the element is created
=========================================================================*/
(function () {
// Set panel visibility
$('#PickList').style.visibility = 'visible';
$('#PostPickScreen').style.visibility = 'collapse';

///Load player elements
LoadPlayers();

// Show only map-specific elements
var parent_panel = $.GetContextPanel().GetParent().GetParent().GetParent().GetParent()
var map_info = Game.GetMapInfo();
// If this player is a spectator, just kill the whole pick screen
if ( Players.IsSpectator( Players.GetLocalPlayer() ) ) {
$('#Background').GetParent().DeleteAsync( 0.0 );

if (map_info.map_display_name == "imba_random_omg") {
parent_panel.FindChildTraverse("HeroSelectTextRandomOmg").style.visibility = "visible";
} else if (map_info.map_display_name == "imba_arena") {
parent_panel.FindChildTraverse("HeroSelectTextArenaMode").style.visibility = "visible";
// Else, do pick screen stuff
} else {
parent_panel.FindChildTraverse("HeroSelectTextAllPick").style.visibility = "visible";
}

// Hide the top scoreboard during the pick phase
parent_panel.FindChildTraverse("ScoreboardContainer").style.visibility = "collapse";
// Set panel visibility
$('#PickList').style.visibility = 'visible';
$('#PostPickScreen').style.visibility = 'collapse';

///Load player elements
LoadPlayers();

// Tell the server this player's UI was initialized
GameEvents.SendCustomGameEventToServer( "ui_initialized", {} );
// Show only map-specific elements
var parent_panel = $.GetContextPanel().GetParent().GetParent().GetParent().GetParent()
var map_info = Game.GetMapInfo();

if (map_info.map_display_name == "imba_random_omg") {
$('#HeroSelectText').text = $.Localize( '#imba_gamemode_name_random_omg' );
} else if (map_info.map_display_name == "imba_arena") {
$('#HeroSelectText').text = $.Localize( '#imba_gamemode_name_arena_mode' );
}

// Hide the top scoreboard during the pick phase
parent_panel.FindChildTraverse("ScoreboardContainer").style.visibility = "collapse";

// Update the game options display
var bounty_multiplier = CustomNetTables.GetTableValue("game_options", "bounty_multiplier");
var creep_power = CustomNetTables.GetTableValue("game_options", "creep_power");
var tower_power = CustomNetTables.GetTableValue("game_options", "tower_power");
var respawn_multiplier = CustomNetTables.GetTableValue("game_options", "respawn_multiplier");
var initial_gold = CustomNetTables.GetTableValue("game_options", "initial_gold");
var initial_level = CustomNetTables.GetTableValue("game_options", "initial_level");
var max_level = CustomNetTables.GetTableValue("game_options", "max_level");
var kills_to_end = CustomNetTables.GetTableValue("game_options", "kills_to_end");
$("#BountyMultiplierValue").text = bounty_multiplier[1] + "%";
$("#RespawnTimerValue").text = respawn_multiplier[1] + "%";
$("#InitialGoldValue").text = initial_gold[1];
$("#InitialLevelValue").text = initial_level[1];
$("#MaxLevelValue").text = max_level[1];

if (tower_power[1] == 0) {
$("#TowerPowerValue").text = $.Localize( '#imba_gamemode_settings_power_1' );
} else if (tower_power[1] == 1) {
$("#TowerPowerValue").text = $.Localize( '#imba_gamemode_settings_power_2' );
} else if (tower_power[1] == 2) {
$("#TowerPowerValue").text = $.Localize( '#imba_gamemode_settings_power_3' );
}

if (map_info.map_display_name == "imba_arena") {
$("#CreepPowerLabel").text = $.Localize( '#imba_gamemode_settings_kills_to_end' );
$("#CreepPowerValue").text = kills_to_end[1];
} else if (creep_power[1] == 1) {
$("#CreepPowerValue").text = $.Localize( '#imba_gamemode_settings_power_1' );
} else if (creep_power[1] == 2) {
$("#CreepPowerValue").text = $.Localize( '#imba_gamemode_settings_power_2' );
} else if (creep_power[1] == 3) {
$("#CreepPowerValue").text = $.Localize( '#imba_gamemode_settings_power_3' );
}

// If All Random is enabled, pick a random hero
var all_random_enabled = CustomNetTables.GetTableValue("game_options", "all_random" );
if (all_random_enabled != null && all_random_enabled[1] == 1) {
$("#PickHeroBtn").AddClass( "disabled" );
$("#RepickBtn").AddClass( "disabled" );
$('#HeroSelectText').text = $.Localize( '#imba_gamemode_name_all_random' );
$.Schedule(5, SelectRandomHero);
}

// Tell the server this player's UI was initialized
GameEvents.SendCustomGameEventToServer( "ui_initialized", {} );
}
})();

Large diffs are not rendered by default.

@@ -139,7 +139,7 @@
background-size: 320px 120px;
height: 55px;
width: 420px;
padding-top: 6px;
border-radius: 10px;
}

#EnterGameBtn.disabled, #EnterGameBtn.disabled:Hover {
@@ -152,6 +152,7 @@

#EnterGameBtn Label {
horizontal-align: center;
vertical-align: center;
color: #fff;
font-size: 36px;
font-family: "Radiance";
@@ -169,7 +170,7 @@
background-size: 320px 120px;
height: 55px;
width: 420px;
padding-top: 6px;
border-radius: 10px;
}

#RepickBtn.disabled, #RepickBtn.disabled:Hover {
@@ -182,6 +183,7 @@

#RepickBtn Label {
horizontal-align: center;
vertical-align: center;
color: #fff;
font-size: 36px;
font-family: "Radiance";
@@ -191,25 +193,26 @@
=================================================================*/
#RandomPickBtn {
horizontal-align: center;
margin-top: 4%;
margin-top: 15px;

box-shadow: fill #00000066 -4px -4px 8px 8px;
background-color: gradient( linear, 0% 0%, 0% 100%, from( #5AA15E ), to( #87d69533 ) );
background-image: url("s2r://panorama/images/backgrounds/background_play_button_large_2x_png.vtex");
background-size: 320px 120px;
height: 55px;
height: 42px;
width: 420px;
padding-top: 6px;
border-radius: 10px;
}

#RandomPickBtn:Hover {
background-color: gradient( linear, 0% 0%, 0% 100%, from( #6FDE75 ), to( #87d69533 ) );
}

#RandomPickBtn Label {
vertical-align: center;
horizontal-align: center;
color: #FFFFFF;
font-size: 36px;
font-size: 30px;
font-family: "Radiance";
}

@@ -279,45 +282,101 @@
=================================================================*/
#PickInfoPanel {
width: 100%;
height: 170px;
height: 220px;
horizontal-align: center;
vertical-align: middle;
flow-children: right;
padding-left: 50px;
padding-right: 50px;
padding-left: 30px;
padding-right: 30px;
}

.HeroSelectText {
horizontal-align: center;
font-size: 48px;
font-family: "Goudy Trajan Medium";
color: #fff;
visibility: collapse;
vertical-align: middle;
}

#PickTextPanel {
horizontal-align: left;
vertical-align: center;
flow-children: down;
}

#PickTimerPanel {
horizontal-align: center;
vertical-align: top;
flow-children: right;
}

#PickTimer {
width: 70px;
height: 70px;
width: 60px;
height: 60px;
border: 3px solid #fff;
border-radius: 35px;
border-radius: 30px;
margin: 0px 20px 0px 0px;
vertical-align: middle;
}

#TimerTxt {
width: 60px;
width: 50px;
text-align: center;
font-size: 44px;
font-size: 40px;
font-family: "Radiance";
color:#fff;
margin: 8px 0px 0px 2px;
margin: 4px 0px 0px 2px;
}

#GameOptionsPanelContainer {
width: 580px;
margin-top: 10px;
height: 140px;
horizontal-align: center;
vertical-align: bottom;
flow-children: right;
}

#GameOptionsPanel1 {
margin-top: 5px;
horizontal-align: left;
vertical-align: top;
flow-children: down;
}

#GameOptionsPanel2 {
margin-top: 5px;
horizontal-align: right;
vertical-align: top;
flow-children: down;
}

.GameModeLabelPanel {
width: 280px;
margin-right: 10px;
flow-children: right;
}

.GameModeLabel {
horizontal-align: left;
text-align: center;
font-size: 22px;
font-family: "Radiance";
color:#FFFFFF;
}

.GameModeLabelPanel2 {
width: 300px;
flow-children: down;
}

.GameModeValue {
horizontal-align: right;
margin-left: 3px;
text-align: center;
font-size: 22px;
font-family: "Radiance";
color:#FF7800;
}

.PickScreenTeamTitle {
@@ -352,7 +411,7 @@
=================================================================*/
#HeroDetailsPanel {
height: 100%;
horizontal-align: center;
horizontal-align: right;
vertical-align: center;
flow-children: right;
}
@@ -382,7 +441,7 @@
horizontal-align: right;
vertical-align: center;
flow-children: down;
margin-left: 30px;
margin-left: 10px;
visibility: collapse;
}

@@ -392,24 +451,26 @@
}

.PickedHeroAbility {
height: 80px;
width: 80px;
margin-left: 6px;
margin-right: 6px;
height: 68px;
width: 68px;
margin-left: 1px;
margin-right: 1px;
border-radius: 10px;
}

/* 'Confirm pick' button
=================================================================*/
#PickHeroBtn {
horizontal-align: center;
margin-top: 20px;
margin-top: 15px;

box-shadow: fill #00000066 -4px -4px 8px 8px;
background-color: gradient( linear, 0% 0%, 0% 100%, from( #5AA15E ), to( #87d69533 ) );
background-image: url("s2r://panorama/images/backgrounds/background_play_button_large_2x_png.vtex");
background-size: 320px 120px;
height: 50px;
height: 42px;
width: 420px;
border-radius: 10px;
}

#PickHeroBtn:Hover {
@@ -423,6 +484,6 @@
vertical-align: center;
horizontal-align: center;
color: #FFFFFF;
font-size: 36px;
font-size: 30px;
font-family: "Radiance";
}
@@ -11,7 +11,7 @@
"addonContent_Campaign" "0"
"addonDescription" "A modified version of Dota, where everything is insanely powerful."

"maps" "imba_standard imba_random_omg imba_custom imba_10v10"
"maps" "imba_standard imba_random_omg imba_custom imba_10v10 imba_arena"
"IsPlayable" "1"
"imba_standard"
{
@@ -32,4 +32,9 @@
{
"MaxPlayers" "20"
}

"imba_arena"
{
"MaxPlayers" "16"
}
}
Binary file not shown.
@@ -0,0 +1,8 @@
imba_arena
{
material materials/overviews/imba_arena.vmat
pos_x -4096
pos_y 4096
scale 8.000
}

@@ -1,7 +1,8 @@
"talents",
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->
{
custom_net_tables =
[
"talents",
"game_options"
]
}
@@ -183,10 +183,10 @@

"npc_dota_hero_disruptor"
{
"1" "imba_disruptor_thunder_strike"
"2" "imba_disruptor_glimpse"
"3" "imba_disruptor_kinetic_field"
"4" "imba_disruptor_static_storm"
"1" "disruptor_thunder_strike"
"2" "disruptor_glimpse"
"3" "disruptor_kinetic_field"
"4" "disruptor_static_storm"
}

"npc_dota_hero_doom_bringer"
@@ -1782,7 +1782,7 @@

"Properties"
{
"MODIFIER_PROPERTY_MAGICAL_RESISTANCE_ITEM_UNIQUE" "%magic_resistance"
"MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS" "%magic_resistance"
"MODIFIER_PROPERTY_HEALTH_REGEN_CONSTANT" "%health_regen"
}
}
@@ -16720,7 +16720,7 @@

"Properties"
{
"MODIFIER_PROPERTY_MAGICAL_RESISTANCE_ITEM_UNIQUE" "%magic_resist"
"MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS" "%magic_resist"
"MODIFIER_PROPERTY_MANA_REGEN_CONSTANT" "1.0" // this is hardcoded due to an obscure engine bug
}
}
@@ -18132,6 +18132,26 @@
"ItemKillable" "1"
}

//=================================================================================================================
// Bounty Rune (Arena Mode)
//=================================================================================================================
"item_imba_rune_bounty_arena"
{
// General
//-------------------------------------------------------------------------------------------------------------
"ID" "2222"
"BaseClass" "item_datadriven"
"Model" "models/props_gameplay/gold_bag.vmdl"

// Item Info
//-------------------------------------------------------------------------------------------------------------
"ItemCost" "0"
"ItemQuality" "artifact"
"ItemPurchasable" "0"
"ItemSellable" "0"
"ItemKillable" "1"
}

//=================================================================================================================
// Nightmare Shadow (haste rune)
//=================================================================================================================
@@ -18465,5 +18485,5 @@
}
}

//next free ID: 2222
//next free ID: 2223
}
@@ -0,0 +1,272 @@
"imba_arena_shops"
{
"consumables"
{
"item" "item_clarity"
"item" "item_faerie_fire"
"item" "item_imba_mango"
"item" "item_tango"
"item" "item_flask"
"item" "item_smoke_of_deceit"
"item" "item_tpscroll"
"item" "item_dust"
"item" "item_courier"
"item" "item_flying_courier"
"item" "item_ward_observer"
"item" "item_ward_sentry"
"item" "item_tome_of_knowledge"
"item" "item_bottle"
}

"attributes"
{
"item" "item_branches"
"item" "item_gauntlets"
"item" "item_slippers"
"item" "item_mantle"
"item" "item_circlet"
"item" "item_ring_of_protection"
"item" "item_belt_of_strength"
"item" "item_boots_of_elves"
"item" "item_robe"
"item" "item_ogre_axe"
"item" "item_blade_of_alacrity"
"item" "item_staff_of_wizardry"
"item" "item_gem"
"item" "item_imba_soul_of_truth"
}

"weapons_armor"
{
"item" "item_stout_shield"
"item" "item_quelling_blade"
"item" "item_infused_raindrop"
"item" "item_imba_poor_mans_shield"
"item" "item_imba_orb_of_venom"
"item" "item_blades_of_attack"
"item" "item_blight_stone"
"item" "item_chainmail"
"item" "item_quarterstaff"
"item" "item_helm_of_iron_will"
"item" "item_broadsword"
"item" "item_claymore"
"item" "item_javelin"
"item" "item_mithril_hammer"
}

"misc"
{
"item" "item_imba_magic_stick"
"item" "item_wind_lace"
"item" "item_sobi_mask"
"item" "item_ring_of_regen"
"item" "item_boots"
"item" "item_gloves"
"item" "item_cloak"
"item" "item_ring_of_health"
"item" "item_void_stone"
"item" "item_lifesteal"
"item" "item_shadow_amulet"
"item" "item_ghost"
"item" "item_imba_blink"
"item" "item_imba_blink_boots"
}

// Level 1 - Green Recipes
"basics"
{
"item" "item_imba_magic_wand"
"item" "item_imba_null_talisman"
"item" "item_imba_wraith_band"
"item" "item_imba_bracer"
"item" "item_soul_ring"
"item" "item_phase_boots"
"item" "item_power_treads"
"item" "item_oblivion_staff"
"item" "item_imba_pers"
"item" "item_imba_hand_of_midas"
"item" "item_imba_nether_wand"
"item" "item_travel_boots"
"item" "item_imba_moon_shard"
"item" "item_ultimate_scepter"
}

// Level 2 - Blue Recipes
"support"
{
"item" "item_iron_talon"
"item" "item_imba_ring_of_basilius"
"item" "item_headdress"
"item" "item_buckler"
"item" "item_urn_of_shadows"
"item" "item_tranquil_boots"
"item" "item_imba_ring_of_aquila"
"item" "item_medallion_of_courage"
"item" "item_imba_arcane_boots"
"item" "item_imba_ancient_janggo"
"item" "item_imba_mekansm"
"item" "item_imba_vladmir"
"item" "item_imba_pipe"
"item" "item_imba_guardian_greaves"
}

"magics"
{
"item" "item_imba_initiate_robe"
"item" "item_glimmer_cape"
"item" "item_imba_force_staff"
"item" "item_imba_aether_lens"
"item" "item_imba_veil_of_discord"
"item" "item_imba_necronomicon"
"item" "item_imba_dagon"
"item" "item_imba_cyclone"
"item" "item_rod_of_atos"
//"item" "item_imba_lotus_orb"
"item" "item_imba_orchid"
"item" "item_imba_ethereal_blade"
"item" "item_imba_refresher"
"item" "item_imba_sheepstick"
"item" "item_imba_octarine_core"
}

// Level 3 - Purple Recipes
"defense"
{
"item" "item_imba_hood_of_defiance"
"item" "item_imba_vanguard"
"item" "item_imba_blade_mail"
"item" "item_soul_booster"
"item" "item_imba_crimson_guard"
"item" "item_imba_black_king_bar"
"item" "item_hurricane_pike"
"item" "item_imba_shivas_guard"
"item" "item_imba_bloodstone"
"item" "item_imba_manta"
"item" "item_imba_sphere"
"item" "item_imba_assault"
"item" "item_imba_heart"
"item" "item_imba_greatwyrm_plate"
}

"weapons"
{
"item" "item_dragon_lance"
"item" "item_imba_lesser_crit"
"item" "item_imba_armlet"
"item" "item_imba_shadow_blade"
"item" "item_imba_basher"
"item" "item_imba_bfury"
"item" "item_imba_silver_edge"
"item" "item_imba_radiance"
"item" "item_imba_monkey_king_bar"
"item" "item_imba_greater_crit"
"item" "item_imba_butterfly"
"item" "item_imba_rapier"
"item" "item_abyssal_blade"
"item" "item_imba_starfury"
}

// Level 4 - Orange / Orb / Artifacts
"artifacts"
{
"item" "item_mask_of_madness"
"item" "item_helm_of_the_dominator"
"item" "item_imba_sange"
"item" "item_imba_yasha"
"item" "item_imba_azura"
"item" "item_imba_echo_sabre"
"item" "item_imba_maelstrom"
"item" "item_imba_diffusal_blade"
"item" "item_imba_desolator"
"item" "item_imba_heavens_halberd"
"item" "item_imba_skadi"
"item" "item_imba_mjollnir"
"item" "item_satanic"
"item" "item_imba_sange_and_azura_and_yasha"
}

"sideshop1"
{
"item" "item_imba_magic_stick"
"item" "item_stout_shield"
"item" "item_sobi_mask"
"item" "item_ring_of_regen"
"item" "item_imba_orb_of_venom"
"item" "item_boots"
"item" "item_cloak"
"item" "item_ring_of_health"
"item" "item_void_stone"
"item" "item_lifesteal"
"item" "item_helm_of_iron_will"
"item" "item_energy_booster"
}

"sideshop2"
{
"item" "item_slippers"
"item" "item_quelling_blade"
"item" "item_belt_of_strength"
"item" "item_boots_of_elves"
"item" "item_robe"
"item" "item_blades_of_attack"
"item" "item_gloves"
"item" "item_chainmail"
"item" "item_bottle"
"item" "item_quarterstaff"
"item" "item_vitality_booster"
"item" "item_broadsword"
"item" "item_blink"
}

"secretshop"
{
"item" "item_energy_booster"
"item" "item_vitality_booster"
"item" "item_point_booster"
"item" "item_platemail"
"item" "item_talisman_of_evasion"
"item" "item_hyperstone"
"item" "item_ultimate_orb"
"item" "item_demon_edge"
"item" "item_mystic_staff"
"item" "item_reaver"
"item" "item_eagle"
"item" "item_relic"
}

"pregame"
{
"item" "item_clarity"
"item" "item_faerie_fire"
"item" "item_imba_mango"
"item" "item_tango"
"item" "item_flask"
"item" "item_smoke_of_deceit"
"item" "item_tpscroll"
"item" "item_dust"
"item" "item_courier"
"item" "item_ward_observer"
"item" "item_ward_sentry"
"item" "item_bottle"
"item" "item_branches"
"item" "item_gauntlets"
"item" "item_slippers"
"item" "item_mantle"
"item" "item_circlet"
"item" "item_ring_of_protection"
"item" "item_stout_shield"
"item" "item_quelling_blade"
"item" "item_blight_stone"
"item" "item_imba_orb_of_venom"
"item" "item_wind_lace"
"item" "item_imba_magic_stick"
"item" "item_sobi_mask"
"item" "item_ring_of_regen"
"item" "item_boots"
"item" "item_gloves"
"item" "item_iron_talon"
"item" "item_cloak"
"item" "item_imba_magic_wand"
"item" "item_recipe_soul_ring"
}
}
@@ -1,4 +1,4 @@
"imba_all_pick_shops"
"imba_standard_shops"
{
"consumables"
{
@@ -610,6 +610,12 @@ function GameMode:OnTeamKillCredit(keys)
local victim_id = keys.victim_userid
local killer_team = keys.teamnumber

-------------------------------------------------------------------------------------------------
-- IMBA: Comeback gold logic
-------------------------------------------------------------------------------------------------

UpdateComebackBonus(1, killer_team)

-------------------------------------------------------------------------------------------------
-- IMBA: Deathstreak logic
-------------------------------------------------------------------------------------------------
@@ -961,7 +967,17 @@ function GameMode:OnTowerKill(keys)
EmitGlobalSound("powerup_02")
end
end


-------------------------------------------------------------------------------------------------
-- IMBA: Update comeback gold logic
-------------------------------------------------------------------------------------------------

local points = 1
if tower.tower_tier then
points = tower.tower_tier
end
local team = PlayerResource:GetTeam(keys.killer_userid)
UpdateComebackBonus(points, team)
end

-- This function is called whenever a player changes there custom team selection during Game Setup
@@ -54,14 +54,15 @@ function HeroSelection:Start()
HeroSelection.listener_abilities_requested = CustomGameEventManager:RegisterListener("pick_abilities_requested", HeroSelection.PickAbilitiesRequested )

-- Play relevant pick lines
if IMBA_PICK_MODE_ALL_PICK then
EmitGlobalSound("announcer_announcer_type_all_pick")
if IMBA_PICK_MODE_ALL_RANDOM then
EmitGlobalSound("announcer_announcer_type_all_random")
elseif IMBA_ABILITY_MODE_RANDOM_OMG then
EmitGlobalSound("announcer_announcer_type_random_draft")
elseif IMBA_PICK_MODE_ARENA_MODE then
EmitGlobalSound("announcer_announcer_type_death_match")
else
EmitGlobalSound("announcer_announcer_type_all_pick")
end
--EmitGlobalSound("announcer_announcer_type_all_random")

-- Block-pick heroes forbidden in certain modes
if IMBA_ABILITY_MODE_RANDOM_OMG then
@@ -117,9 +118,6 @@ function HeroSelection:Tick()
HeroSelection.TimeLeft = HeroSelection.TimeLeft - 1
if HeroSelection.TimeLeft < 0 then

-- Resolve votes
HeroSelection:SelectGameMode()

-- End picking phase
HeroSelection:EndPicking()
return nil
@@ -278,6 +276,11 @@ end
]]
function HeroSelection:HeroSelect( event )

-- If this is All Random and the player picked a hero manually, refuse it
if IMBA_PICK_MODE_ALL_RANDOM and (not event.HasRandomed) then
return nil
end

-- Check if this hero hasn't already been picked
if PlayerResource:GetTeam(event.PlayerID) == DOTA_TEAM_GOODGUYS then
for _, picked_hero in pairs(HeroSelection.radiantPicks) do
@@ -368,72 +371,6 @@ function HeroSelection:HeroRepicked( event )
EmitSoundOnClient("ui.pick_repick", PlayerResource:GetPlayer(player_id))
end

function HeroSelection:SelectGameMode()

-- Change settings if hyper mode is active.
if IMBA_HYPER_MODE_ON then

-- Change settings according to the current map
if GetMapName() == "imba_standard" then
END_GAME_ON_KILLS = false
CUSTOM_GOLD_BONUS = 75
CUSTOM_XP_BONUS = 75
CREEP_POWER_FACTOR = 2
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 100
HERO_INITIAL_GOLD = 1200
HERO_REPICK_GOLD = 1000
HERO_RANDOM_GOLD = 1500
HERO_STARTING_LEVEL = 1
MAX_LEVEL = 50
elseif GetMapName() == "imba_random_omg" then
END_GAME_ON_KILLS = false
CUSTOM_GOLD_BONUS = 75
CUSTOM_XP_BONUS = 75
CREEP_POWER_FACTOR = 2
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 100
HERO_INITIAL_GOLD = 1200
HERO_REPICK_GOLD = 1000
HERO_RANDOM_GOLD = 1500
HERO_STARTING_LEVEL = 1
MAX_LEVEL = 50
elseif GetMapName() == "imba_custom" then
END_GAME_ON_KILLS = false
CUSTOM_GOLD_BONUS = 300
CUSTOM_XP_BONUS = 300
CREEP_POWER_FACTOR = 3
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 2
HERO_RESPAWN_TIME_MULTIPLIER = 50
HERO_INITIAL_GOLD = 5000
HERO_REPICK_GOLD = 4000
HERO_RANDOM_GOLD = 6000
HERO_STARTING_LEVEL = 12
MAX_LEVEL = 100
elseif GetMapName() == "imba_10v10" then
END_GAME_ON_KILLS = false
CUSTOM_GOLD_BONUS = 125
CUSTOM_XP_BONUS = 125
CREEP_POWER_FACTOR = 2
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 2
HERO_RESPAWN_TIME_MULTIPLIER = 50
HERO_INITIAL_GOLD = 2000
HERO_REPICK_GOLD = 1600
HERO_RANDOM_GOLD = 2400
HERO_STARTING_LEVEL = 5
MAX_LEVEL = 60
end
end
end

--[[
EndPicking
The final function of hero selection which is called once the selection is done.
@@ -68,8 +68,22 @@ function GameMode:OnFirstPlayerLoaded()
-- IMBA: Roshan initialization
-------------------------------------------------------------------------------------------------

local roshan_spawn_loc = Entities:FindByName(nil, "roshan_spawn_point"):GetAbsOrigin()
local roshan = CreateUnitByName("npc_imba_roshan", roshan_spawn_loc, true, nil, nil, DOTA_TEAM_NEUTRALS)
if not GetMapName() == "imba_arena" then
local roshan_spawn_loc = Entities:FindByName(nil, "roshan_spawn_point"):GetAbsOrigin()
local roshan = CreateUnitByName("npc_imba_roshan", roshan_spawn_loc, true, nil, nil, DOTA_TEAM_NEUTRALS)
end

-------------------------------------------------------------------------------------------------
-- IMBA: Arena mode center vision
-------------------------------------------------------------------------------------------------
if GetMapName() == "imba_arena" then
local fow_viewer_a = Entities:FindByName(nil, "bounty_rune_location_dire_top"):GetAbsOrigin()
local fow_viewer_b = Entities:FindByName(nil, "bounty_rune_location_radiant_top"):GetAbsOrigin()
AddFOWViewer(DOTA_TEAM_GOODGUYS, fow_viewer_a, 650, 6000, true)
AddFOWViewer(DOTA_TEAM_GOODGUYS, fow_viewer_b, 550, 6000, true)
AddFOWViewer(DOTA_TEAM_BADGUYS, fow_viewer_a, 650, 6000, true)
AddFOWViewer(DOTA_TEAM_BADGUYS, fow_viewer_b, 550, 6000, true)
end

-------------------------------------------------------------------------------------------------
-- IMBA: Pre-pick forced hero selection
@@ -186,6 +200,12 @@ function GameMode:GoldFilter( keys )
keys.gold = keys.gold * (1 + CUSTOM_GOLD_BONUS * 0.01) * (1 + game_time * BOUNTY_RAMP_PER_SECOND * 0.01)
end

-- Comeback gold gain
local team = PlayerResource:GetTeam(keys.player_id_const)
if COMEBACK_BOUNTY_BONUS[team] > 0 then
keys.gold = keys.gold * (1 + COMEBACK_BOUNTY_BONUS[team])
end

-- Show gold earned message??
--if hero then
-- SendOverheadEventMessage(nil, OVERHEAD_ALERT_GOLD, hero, keys.gold, nil)
@@ -336,11 +356,11 @@ function GameMode:ItemAddedFilter( keys )
-- Rune pickup logic
-------------------------------------------------------------------------------------------------

if item_name == "item_imba_rune_bounty" or item_name == "item_imba_rune_double_damage" or item_name == "item_imba_rune_haste" or item_name == "item_imba_rune_regeneration" then
if item_name == "item_imba_rune_bounty" or item_name == "item_imba_rune_bounty_arena" or item_name == "item_imba_rune_double_damage" or item_name == "item_imba_rune_haste" or item_name == "item_imba_rune_regeneration" then

-- Only real heroes can pick up runes
--if unit:IsRealHero() then
if item_name == "item_imba_rune_bounty" then
if item_name == "item_imba_rune_bounty" or "item_imba_rune_bounty_arena" then
PickupBountyRune(item, unit)
return false
end
@@ -1041,7 +1061,7 @@ function GameMode:OnGameInProgress()
-------------------------------------------------------------------------------------------------

for _, wisp in pairs(IMBA_WISP_PICKERS_TABLE) do
wisp:Destroy()
UTIL_Remove(wisp)
end
IMBA_WISP_PICKERS_TABLE = nil

@@ -166,7 +166,8 @@ function OnSetGameMode( eventSourceIndex, args )
local player = PlayerResource:GetPlayer(player_id)
local is_host = GameRules:PlayerHasCustomGameHostPrivileges(player)
local mode_info = args.modes
local game_mode_imba = GameRules:GetGameModeEntity()
local game_mode_imba = GameRules:GetGameModeEntity()
local map_name = GetMapName()

-- If the player who sent the game options is not the host, do nothing
if not is_host then
@@ -184,198 +185,174 @@ function OnSetGameMode( eventSourceIndex, args )
end

-------------------------------------------------------------------------------------------------
-- IMBA: Pick mode selection
-- IMBA: Mode selection data setup
-------------------------------------------------------------------------------------------------

-- Retrieve information
-- All random setup
if tonumber(mode_info.all_random) == 1 then
IMBA_PICK_MODE_ALL_RANDOM = true
HERO_SELECTION_TIME = IMBA_ALL_RANDOM_HERO_SELECTION_TIME
CustomNetTables:SetTableValue("game_options", "all_random", {true})
print("All Random mode activated!")
end

-- Enable same hero mode
if tonumber(mode_info.allow_same_hero) == 1 then
GameRules:SetSameHeroSelectionEnabled(true)
print("Same-hero selection enabled!")
end

-- Pick wait time setup
if IMBA_ABILITY_MODE_RANDOM_OMG or IMBA_PICK_MODE_ALL_RANDOM then
GameRules:SetHeroSelectionTime( IMBA_ALL_RANDOM_HERO_SELECTION_TIME )
-- Tower upgrade setup
if tonumber(mode_info.tower_upgrades) == 1 then
TOWER_UPGRADE_MODE = true
CustomNetTables:SetTableValue("game_options", "tower_upgrades", {true})
print("Tower upgrades activated!")
end

-- Set game end on kills
if tonumber(mode_info.number_of_kills) > 0 then
-- Arena mode setup
if mode_info.kills_to_end and tonumber(mode_info.kills_to_end) > 0 and map_name == "imba_arena" then
END_GAME_ON_KILLS = true
KILLS_TO_END_GAME_FOR_TEAM = math.min(tonumber(mode_info.number_of_kills), 250)
KILLS_TO_END_GAME_FOR_TEAM = math.min(tonumber(mode_info.kills_to_end), 250)
CustomNetTables:SetTableValue("game_options", "kills_to_end", {mode_info.kills_to_end})
print("Game will end on "..KILLS_TO_END_GAME_FOR_TEAM.." kills!")
end

-------------------------------------------------------------------------------------------------
-- IMBA: Additional Random OMG setup
-------------------------------------------------------------------------------------------------

-- Detect amount of abilities/ultimates to learn each time
if mode_info.number_of_abilities == "3a2u" then
IMBA_RANDOM_OMG_NORMAL_ABILITY_COUNT = 3
IMBA_RANDOM_OMG_ULTIMATE_ABILITY_COUNT = 2
print("Random OMG: 3 abilities, 2 ultimates")
elseif mode_info.number_of_abilities == "4a1u" then
IMBA_RANDOM_OMG_NORMAL_ABILITY_COUNT = 4
IMBA_RANDOM_OMG_ULTIMATE_ABILITY_COUNT = 1
print("Random OMG: 4 abilities, 1 ultimates")
elseif mode_info.number_of_abilities == "4a2u" then
IMBA_RANDOM_OMG_NORMAL_ABILITY_COUNT = 4
IMBA_RANDOM_OMG_ULTIMATE_ABILITY_COUNT = 2
print("Random OMG: 5 abilities, 2 ultimates")
elseif mode_info.number_of_abilities == "5a1u" then
IMBA_RANDOM_OMG_NORMAL_ABILITY_COUNT = 5
IMBA_RANDOM_OMG_ULTIMATE_ABILITY_COUNT = 1
print("Random OMG: 5 abilities, 1 ultimates")
end

-------------------------------------------------------------------------------------------------
-- IMBA: Gold/bounties setup
-------------------------------------------------------------------------------------------------

-- Starting gold information
if mode_info.gold_start == "2000" then
HERO_INITIAL_GOLD = 2000 - MAP_INITIAL_GOLD
HERO_REPICK_GOLD_LOSS = -400
HERO_RANDOM_GOLD_BONUS = 300
elseif mode_info.gold_start == "6000" then
HERO_INITIAL_GOLD = 6000 - MAP_INITIAL_GOLD
HERO_REPICK_GOLD_LOSS = -900
HERO_RANDOM_GOLD_BONUS = 800
elseif mode_info.gold_start == "15000" then
HERO_INITIAL_GOLD = 15000 - MAP_INITIAL_GOLD
HERO_REPICK_GOLD_LOSS = -2400
HERO_RANDOM_GOLD_BONUS = 2300
end
print("hero starting gold: "..HERO_INITIAL_GOLD)

-- Gold bounties information
if tonumber(mode_info.gold_bounty) > 0 then
CUSTOM_GOLD_BONUS = math.min(tonumber(mode_info.gold_bounty), 300)
end
print("gold bounty increased by: "..CUSTOM_GOLD_BONUS)

-- XP bounties information
if tonumber(mode_info.xp_bounty) > 0 then
CUSTOM_XP_BONUS = math.min(tonumber(mode_info.xp_bounty), 300)
end
print("xp bounty increased by: "..CUSTOM_XP_BONUS)

-------------------------------------------------------------------------------------------------
-- IMBA: Creeps and buildings setup
-------------------------------------------------------------------------------------------------

-- Enable tower/ancient abilities
if tonumber(mode_info.tower_upgrades) == 1 then
TOWER_ABILITY_MODE = true
TOWER_UPGRADE_MODE = true
print("Upgradable tower abilities enabled!")
elseif tonumber(mode_info.tower_abilities) == 1 then
TOWER_ABILITY_MODE = true
print("Random tower abilities enabled!")
else
TOWER_ABILITY_MODE = false
end

-- Ancient Behemoth setup
if tonumber(mode_info.spawn_behemoths) == 0 then
SPAWN_ANCIENT_BEHEMOTHS = false
print("Ancient Behemoths deactivated!")
-- Bounty multiplier increase
if tostring(mode_info.bounty_multiplier) == "GoldExpOption2" then
if map_name == "imba_standard" or map_name == "imba_random_omg" then
CUSTOM_GOLD_BONUS = 75
CUSTOM_XP_BONUS = 75
elseif map_name == "imba_custom" then
CUSTOM_GOLD_BONUS = 300
CUSTOM_XP_BONUS = 300
elseif map_name == "imba_10v10" then
CUSTOM_GOLD_BONUS = 125
CUSTOM_XP_BONUS = 125
elseif map_name == "imba_arena" then
CUSTOM_GOLD_BONUS = 150
CUSTOM_XP_BONUS = 150
end
CustomNetTables:SetTableValue("game_options", "bounty_multiplier", {100 + CUSTOM_GOLD_BONUS})
end

-- Creep and tower power adjustment
CREEP_POWER_FACTOR = tonumber(mode_info.creep_power)
TOWER_POWER_FACTOR = tonumber(mode_info.tower_power)

-------------------------------------------------------------------------------------------------
-- IMBA: Hero levels and respawn setup
-------------------------------------------------------------------------------------------------

-- Enable higher starting level
if tonumber(mode_info.xp_start) then
HERO_STARTING_LEVEL = math.min(math.max(tonumber(mode_info.xp_start), 1), 25)
print("Heroes will start the game on level "..HERO_STARTING_LEVEL)
print("Bounty multipliers set to high")

-- Creep power increase
if tostring(mode_info.creep_power) == "CreepPowerOption2" then
if map_name == "imba_standard" or map_name == "imba_random_omg" then
CREEP_POWER_FACTOR = 2
elseif map_name == "imba_custom" then
CREEP_POWER_FACTOR = 3
elseif map_name == "imba_10v10" then
CREEP_POWER_FACTOR = 2
end
CustomNetTables:SetTableValue("game_options", "creep_power", {CREEP_POWER_FACTOR})
end

-- Set up level cap
if mode_info.level_cap then
MAX_LEVEL = math.min(math.max(tonumber(mode_info.level_cap), 25), 100)
print("Creep power set to high")

-- Tower power increase
if tostring(mode_info.tower_power) == "TowerPowerOption2" then
if map_name == "imba_standard" or map_name == "imba_random_omg" then
TOWER_POWER_FACTOR = 1
elseif map_name == "imba_custom" then
TOWER_POWER_FACTOR = 2
elseif map_name == "imba_10v10" then
TOWER_POWER_FACTOR = 2
end
CustomNetTables:SetTableValue("game_options", "tower_power", {TOWER_POWER_FACTOR})
end
print("Heroes can level up to level "..MAX_LEVEL)

-- Respawn time information
if mode_info.respawn == "respawn_half" then
HERO_RESPAWN_TIME_MULTIPLIER = 50
elseif mode_info.respawn == "respawn_zero" then
HERO_RESPAWN_TIME_MULTIPLIER = 0
print("Tower power set to high")

-- Respawn timer decrease
if tostring(mode_info.respawn_reduction) == "RespawnTimeOption2" then
if map_name == "imba_standard" or map_name == "imba_random_omg" then
HERO_RESPAWN_TIME_MULTIPLIER = 75
elseif map_name == "imba_custom" then
HERO_RESPAWN_TIME_MULTIPLIER = 50
elseif map_name == "imba_10v10" then
HERO_RESPAWN_TIME_MULTIPLIER = 50
end
CustomNetTables:SetTableValue("game_options", "respawn_multiplier", {100 - HERO_RESPAWN_TIME_MULTIPLIER})
end
print("respawn time multiplier: "..HERO_RESPAWN_TIME_MULTIPLIER)

-- Buyback cooldown information
if tonumber(mode_info.disable_buyback_cooldown) == 1 then
BUYBACK_COOLDOWN_ENABLED = false
print("buyback cooldown disabled")
print("Respawn timer reduction set to high")

-- Hero power increase
if tostring(mode_info.hero_power) == "InitialGoldExp2" then
if map_name == "imba_standard" or map_name == "imba_random_omg" then
HERO_INITIAL_GOLD = 1200
HERO_REPICK_GOLD = 1000
HERO_RANDOM_GOLD = 1500
HERO_STARTING_LEVEL = 1
MAX_LEVEL = 50
elseif map_name == "imba_custom" then
HERO_INITIAL_GOLD = 5000
HERO_REPICK_GOLD = 4000
HERO_RANDOM_GOLD = 6000
HERO_STARTING_LEVEL = 12
MAX_LEVEL = 100
elseif map_name == "imba_10v10" then
HERO_INITIAL_GOLD = 2000
HERO_REPICK_GOLD = 1600
HERO_RANDOM_GOLD = 2400
HERO_STARTING_LEVEL = 5
MAX_LEVEL = 60
elseif map_name == "imba_arena" then
HERO_INITIAL_GOLD = 2000
HERO_REPICK_GOLD = 1600
HERO_RANDOM_GOLD = 2400
HERO_STARTING_LEVEL = 5
MAX_LEVEL = 60
end
CustomNetTables:SetTableValue("game_options", "initial_gold", {HERO_INITIAL_GOLD})
CustomNetTables:SetTableValue("game_options", "initial_level", {HERO_STARTING_LEVEL})
CustomNetTables:SetTableValue("game_options", "max_level", {MAX_LEVEL})
end
print("Hero power set to high")

-- Set the game options as being chosen
GAME_OPTIONS_SET = true

-- Finish mode setup and start the game
--GameRules:FinishCustomGameSetup()

-------------------------------------------------------------------------------------------------
-- IMBA: Stat tracking stuff
-------------------------------------------------------------------------------------------------

-- Tracks if game options were customized or just left as default
statCollection:setFlags({game_options_set = GAME_OPTIONS_SET and 1 or 0})

-- Tracks the game mode
if IMBA_ABILITY_MODE_RANDOM_OMG then
statCollection:setFlags({game_mode = "Random_OMG"})
if IMBA_RANDOM_OMG_RANDOMIZE_SKILLS_ON_DEATH then
statCollection:setFlags({romg_mode = "ROMG_random_skills"})
else
statCollection:setFlags({romg_mode = "ROMG_fixed_skills"})
end
elseif IMBA_PICK_MODE_ALL_RANDOM then
statCollection:setFlags({game_mode = "All_Random"})
else
statCollection:setFlags({game_mode = "All_Pick"})
end

-- Tracks same-hero selection
statCollection:setFlags({same_hero = ALLOW_SAME_HERO_SELECTION and 1 or 0})

-- Tracks game objective
if END_GAME_ON_KILLS then
statCollection:setFlags({kills_to_end = KILLS_TO_END_GAME_FOR_TEAM})
else
statCollection:setFlags({kills_to_end = 0})
end

-- Tracks gold/experience options
statCollection:setFlags({gold_bonus = CUSTOM_GOLD_BONUS})
statCollection:setFlags({exp_bonus = CUSTOM_XP_BONUS})

-- Tracks respawn and buyback
statCollection:setFlags({respawn_mult = HERO_RESPAWN_TIME_MULTIPLIER})
statCollection:setFlags({buyback_mult = 100})

-- Track starting gold and levels
statCollection:setFlags({starting_gold = HERO_INITIAL_GOLD})
statCollection:setFlags({starting_exp = HERO_STARTING_LEVEL})

-- Tracks creep and tower power settings
statCollection:setFlags({creep_power = CREEP_POWER_FACTOR})
statCollection:setFlags({tower_power = TOWER_POWER_FACTOR})

-- Tracks structure abilities and upgrades
statCollection:setFlags({tower_abilities = TOWER_ABILITY_MODE and 1 or 0})
statCollection:setFlags({tower_upgrades = TOWER_UPGRADE_MODE and 1 or 0})
-- statCollection:setFlags({game_options_set = GAME_OPTIONS_SET and 1 or 0})

-- -- Tracks the game mode
-- if IMBA_ABILITY_MODE_RANDOM_OMG then
-- statCollection:setFlags({game_mode = "Random_OMG"})
-- if IMBA_RANDOM_OMG_RANDOMIZE_SKILLS_ON_DEATH then
-- statCollection:setFlags({romg_mode = "ROMG_random_skills"})
-- else
-- statCollection:setFlags({romg_mode = "ROMG_fixed_skills"})
-- end
-- elseif IMBA_PICK_MODE_ALL_RANDOM then
-- statCollection:setFlags({game_mode = "All_Random"})
-- else
-- statCollection:setFlags({game_mode = "All_Pick"})
-- end

-- -- Tracks same-hero selection
-- statCollection:setFlags({same_hero = ALLOW_SAME_HERO_SELECTION and 1 or 0})

-- -- Tracks game objective
-- if END_GAME_ON_KILLS then
-- statCollection:setFlags({kills_to_end = KILLS_TO_END_GAME_FOR_TEAM})
-- else
-- statCollection:setFlags({kills_to_end = 0})
-- end

-- -- Tracks gold/experience options
-- statCollection:setFlags({gold_bonus = CUSTOM_GOLD_BONUS})
-- statCollection:setFlags({exp_bonus = CUSTOM_XP_BONUS})

-- -- Tracks respawn and buyback
-- statCollection:setFlags({respawn_mult = HERO_RESPAWN_TIME_MULTIPLIER})
-- statCollection:setFlags({buyback_mult = 100})

-- -- Track starting gold and levels
-- statCollection:setFlags({starting_gold = HERO_INITIAL_GOLD})
-- statCollection:setFlags({starting_exp = HERO_STARTING_LEVEL})

-- -- Tracks creep and tower power settings
-- statCollection:setFlags({creep_power = CREEP_POWER_FACTOR})
-- statCollection:setFlags({tower_power = TOWER_POWER_FACTOR})

-- -- Tracks structure abilities and upgrades
-- statCollection:setFlags({tower_abilities = TOWER_ABILITY_MODE and 1 or 0})
-- statCollection:setFlags({tower_upgrades = TOWER_UPGRADE_MODE and 1 or 0})
end
@@ -1813,15 +1813,28 @@ function SpawnImbaRunes()
-- Spawn bounty runes
local game_time = GameRules:GetDOTATime(false, false)
for _, bounty_loc in pairs(bounty_rune_locations) do
local bounty_rune = CreateItem("item_imba_rune_bounty", nil, nil)
CreateItemOnPositionForLaunch(bounty_loc, bounty_rune)

-- Arena map randomization
local bounty_rune
if GetMapName() == "imba_arena" then
bounty_loc = bounty_loc + RandomVector(RandomInt(0, 175))
bounty_rune = CreateItem("item_imba_rune_bounty_arena", nil, nil)
else
bounty_rune = CreateItem("item_imba_rune_bounty", nil, nil)
end
CreateItemOnPositionForLaunch(bounty_loc, bounty_rune)

-- If these are the 00:00 runes, double their worth
if game_time < 1 then
bounty_rune.is_initial_bounty_rune = true
end
end

-- On arena mode, there's a 75% chance of doing nothing
if GetMapName() == "imba_arena" and RandomInt(1, 4) < 4 then
return nil
end

-- List of powerup rune types
local powerup_rune_types = {
"item_imba_rune_double_damage",
@@ -1943,3 +1956,26 @@ function CDOTABaseAbility:GetTalentSpecialValueFor(value)
end
return base
end

function UpdateComebackBonus(points, team)

-- Calculate both teams' networths
local team_networth = {}
team_networth[DOTA_TEAM_GOODGUYS] = 0
team_networth[DOTA_TEAM_BADGUYS] = 0
for player_id = 0, 19 do
if PlayerResource:IsImbaPlayer(player_id) and PlayerResource:GetConnectionState(player_id) <= 2 and (not PlayerResource:GetHasAbandonedDueToLongDisconnect(player_id)) then
team_networth[PlayerResource:GetTeam(player_id)] = team_networth[PlayerResource:GetTeam(player_id)] + PlayerResource:GetTotalEarnedGold(player_id)
end
end

-- Update teams' score
COMEBACK_BOUNTY_SCORE[team] = COMEBACK_BOUNTY_SCORE[team] + points

-- If one of the teams is eligible, apply the bonus
if (COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS] < COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS]) and (team_networth[DOTA_TEAM_GOODGUYS] < team_networth[DOTA_TEAM_BADGUYS]) then
COMEBACK_BOUNTY_BONUS[DOTA_TEAM_GOODGUYS] = (COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS] - COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS]) / ( COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS] + 60 - GameRules:GetDOTATime(false, false) / 60 )
elseif (COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS] < COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS]) and (team_networth[DOTA_TEAM_BADGUYS] < team_networth[DOTA_TEAM_GOODGUYS]) then
COMEBACK_BOUNTY_BONUS[DOTA_TEAM_BADGUYS] = (COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS] - COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS]) / ( COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS] + 60 - GameRules:GetDOTATime(false, false) / 60 )
end
end
@@ -19,6 +19,10 @@ function modifier_imba_prevent_actions_game_start:CheckState()
return state
end

function modifier_imba_prevent_actions_game_start:GetDuration()
return 60
end

function modifier_imba_prevent_actions_game_start:IsHidden()
return true
end
@@ -90,6 +90,13 @@ AEGIS_DURATION = 300 -- Aegis expiration timer (in seconds)

IMBA_DAMAGE_EFFECTS_DISTANCE_CUTOFF = 2500 -- Range at which most on-damage effects no longer trigger

COMEBACK_BOUNTY_SCORE = {} -- Extra comeback gold based on hero and tower kills
COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS] = 0
COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS] = 0
COMEBACK_BOUNTY_BONUS = {} -- Extra comeback gold based on hero and tower kills
COMEBACK_BOUNTY_BONUS[DOTA_TEAM_GOODGUYS] = 0
COMEBACK_BOUNTY_BONUS[DOTA_TEAM_BADGUYS] = 0

HERO_RESPAWN_TIME_PER_LEVEL = {} -- Hero respawn time per level
HERO_RESPAWN_TIME_PER_LEVEL[1] = 6
HERO_RESPAWN_TIME_PER_LEVEL[2] = 8
@@ -224,6 +231,11 @@ elseif GetMapName() == "imba_10v10" then
IMBA_PLAYERS_ON_GAME = 20
CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 10
CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 10
elseif GetMapName() == "imba_arena" then
IMBA_PICK_MODE_ALL_PICK = true
IMBA_PLAYERS_ON_GAME = 16
CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 8
CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 8
end

-------------------------------------------------------------------------------------------------
@@ -234,7 +246,7 @@ GAME_WINNER_TEAM = "none" -- Tracks game winner
GAME_ROSHAN_KILLS = 0 -- Tracks amount of Roshan kills

END_GAME_ON_KILLS = false -- Should the game end after a certain number of kills?
KILLS_TO_END_GAME_FOR_TEAM = 25 -- How many kills for a team should signify the end of the game?
KILLS_TO_END_GAME_FOR_TEAM = 40 -- How many kills for a team should signify the end of the game?

IMBA_WISP_PICKERS_TABLE = {} -- Stores the pick-dummy wisps

@@ -243,7 +255,7 @@ ALLOW_SAME_HERO_SELECTION = true -- Allows people to select the same h
IMBA_HYPER_MODE_ON = false -- Is Hyper mode activated?

IMBA_PICK_MODE_ALL_RANDOM = false -- Activates All Random mode when true
IMBA_ALL_RANDOM_HERO_SELECTION_TIME = 10.0 -- Time we need to wait before the game starts when all heroes are randomed
IMBA_ALL_RANDOM_HERO_SELECTION_TIME = 5.0 -- Time we need to wait before the game starts when all heroes are randomed

IMBA_RANDOM_OMG_NORMAL_ABILITY_COUNT = 5 -- Number of regular abilities in Random OMG mode
IMBA_RANDOM_OMG_ULTIMATE_ABILITY_COUNT = 1 -- Number of ultimate abilities in Random OMG mode
@@ -297,7 +309,6 @@ if GetMapName() == "imba_standard" then -- Standard map defaults
CUSTOM_GOLD_BONUS = 35
CUSTOM_XP_BONUS = 35
CREEP_POWER_FACTOR = 1
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = false
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 100
@@ -311,7 +322,6 @@ elseif GetMapName() == "imba_random_omg" then -- ROMG map defaults
CUSTOM_GOLD_BONUS = 35
CUSTOM_XP_BONUS = 35
CREEP_POWER_FACTOR = 1
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = false
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 100
@@ -320,12 +330,12 @@ elseif GetMapName() == "imba_random_omg" then -- ROMG map defaults
HERO_RANDOM_GOLD = 825
HERO_STARTING_LEVEL = 1
MAX_LEVEL = 40
IMBA_PICK_MODE_ALL_RANDOM = true
elseif GetMapName() == "imba_custom" then -- Custom map defaults
END_GAME_ON_KILLS = false
CUSTOM_GOLD_BONUS = 150
CUSTOM_XP_BONUS = 150
CREEP_POWER_FACTOR = 2
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 75
@@ -339,7 +349,6 @@ elseif GetMapName() == "imba_10v10" then -- 10v10 map defaults
CUSTOM_GOLD_BONUS = 60
CUSTOM_XP_BONUS = 60
CREEP_POWER_FACTOR = 1
SPAWN_ANCIENT_BEHEMOTHS = true
TOWER_UPGRADE_MODE = true
TOWER_POWER_FACTOR = 1
HERO_RESPAWN_TIME_MULTIPLIER = 75
@@ -348,8 +357,39 @@ elseif GetMapName() == "imba_10v10" then -- 10v10 map defaults
HERO_RANDOM_GOLD = 2400
HERO_STARTING_LEVEL = 5
MAX_LEVEL = 40
elseif GetMapName() == "imba_arena" then -- Arena map defaults
END_GAME_ON_KILLS = true
TOWER_ABILITY_MODE = false
TOWER_UPGRADE_MODE = false
SPAWN_ANCIENT_BEHEMOTHS = false
UNIVERSAL_SHOP_MODE = true
CUSTOM_GOLD_BONUS = 100
CUSTOM_XP_BONUS = 100
TOWER_POWER_FACTOR = 2
HERO_RESPAWN_TIME_MULTIPLIER = 50
HERO_INITIAL_GOLD = 1000
HERO_REPICK_GOLD = 750
HERO_RANDOM_GOLD = 1250
HERO_STARTING_LEVEL = 3
MAX_LEVEL = 40
RUNE_SPAWN_TIME = 15
FOUNTAIN_PERCENTAGE_MANA_REGEN = 15
FOUNTAIN_PERCENTAGE_HEALTH_REGEN = 15
PRE_GAME_TIME = 15.0 + HERO_SELECTION_TIME + 10.0
end

-- Update game mode net tables
CustomNetTables:SetTableValue("game_options", "all_random", {IMBA_PICK_MODE_ALL_RANDOM})
CustomNetTables:SetTableValue("game_options", "tower_upgrades", {TOWER_UPGRADE_MODE})
CustomNetTables:SetTableValue("game_options", "kills_to_end", {END_GAME_ON_KILLS})
CustomNetTables:SetTableValue("game_options", "bounty_multiplier", {100 + CUSTOM_GOLD_BONUS})
CustomNetTables:SetTableValue("game_options", "creep_power", {CREEP_POWER_FACTOR})
CustomNetTables:SetTableValue("game_options", "tower_power", {TOWER_POWER_FACTOR})
CustomNetTables:SetTableValue("game_options", "respawn_multiplier", {100 - HERO_RESPAWN_TIME_MULTIPLIER})
CustomNetTables:SetTableValue("game_options", "initial_gold", {HERO_INITIAL_GOLD})
CustomNetTables:SetTableValue("game_options", "initial_level", {HERO_STARTING_LEVEL})
CustomNetTables:SetTableValue("game_options", "max_level", {MAX_LEVEL})

-- XP per level table (only active if custom hero levels are enabled)
XP_PER_LEVEL_TABLE = {}