Не работает Золото за тик, ПОМОГИТЕ, ПОЖАЛУЙСТА

Key

Пользователь
6 Сен 2021
23
0
Помогите пожалуйста, просто не работает прирост голды, уже какие только значения не ставил, куда только не вставлял этот голдпертик все равно ничего, просто на старте тысяча и все, как пофиксить? на форуме есть подобные ошибки, но ни одно решение не помогло
ниже сами Lua
--[[
Basic Barebones
]]

-- Required files to be visible from anywhere
require( 'timers' )
require( 'barebones' )
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 5 )
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_BADGUYS, 1 )

function Precache( context )
-- NOTE: IT IS RECOMMENDED TO USE A MINIMAL AMOUNT OF LUA PRECACHING, AND A MAXIMAL AMOUNT OF DATADRIVEN PRECACHING.
-- Precaching guide: https://moddota.com/forums/discussion/119/precache-fixing-and-avoiding-issues

--[[
This function is used to precache resources/units/items/abilities that will be needed
for sure in your game and that cannot or should not be precached asynchronously or
after the game loads.
See GameMode:postLoadPrecache() in barebones.lua for more information
]]

print("[BAREBONES] Performing pre-load precache")
PrecacheUnitByNameSync("example_unit_1", context)
-- Particles can be precached individually or by folder
-- It it likely that precaching a single particle system will precache all of its children, but this may not be guaranteed
PrecacheResource("particle", "particles/econ/generic/generic_aoe_explosion_sphere_1/generic_aoe_explosion_sphere_1.vpcf", context)
PrecacheResource("particle_folder", "particles/test_particle", context)

-- Models can also be precached by folder or individually
-- PrecacheModel should generally used over PrecacheResource for individual models
PrecacheResource("model_folder", "particles/heroes/antimage", context)
PrecacheResource("model", "particles/heroes/viper/viper.vmdl", context)
PrecacheModel("models/heroes/viper/viper.vmdl", context)

-- Sounds can precached here like anything else
PrecacheResource("soundfile", "soundevents/game_sounds_heroes/game_sounds_gyrocopter.vsndevts", context)
PrecacheResource("soundfile", "sounds/weapons/hero/rattletap/flare_fire.vsnd", context)

-- Entire items can be precached by name
-- Abilities can also be precached in this way despite the name
PrecacheItemByNameSync("example_ability", context)
PrecacheItemByNameSync("item_example_item", context)

-- Entire heroes (sound effects/voice/models/particles) can be precached with PrecacheUnitByNameSync
-- Custom units from npc_units_custom.txt can also have all of their abilities and precache{} blocks precached in this way
PrecacheUnitByNameSync("npc_dota_hero_ancient_apparition", context)
PrecacheUnitByNameSync("npc_dota_hero_enigma", context)
PrecacheUnitByNameSync("npc_dota_hero_arc_warden", context)
PrecacheUnitByNameSync("npc_dota_hero_ursa", context)
PrecacheUnitByNameSync("npc_dota_hero_techies", context)
PrecacheUnitByNameSync("npc_dota_hero_life_stealer", context)
PrecacheUnitByNameSync("npc_dota_hero_naga_siren", context)
PrecacheUnitByNameSync("npc_dota_hero_rattletrap", context)
end

-- Create the game mode when we activate
function Activate()
GameRules.GameMode = GameMode()
GameRules.GameMode:InitGameMode()
end
print ('[BAREBONES] barebones.lua' )
-- GameRules Variables
FORCE_PICKED_HERO = "npc_dota_hero_wisp"
ENABLE_HERO_RESPAWN = false -- Должны ли герои автоматически возродиться по таймеру или останутся мертвыми, пока не возродятся вручную
UNIVERSAL_SHOP_MODE = true -- Если в основном магазине есть предметы секретной лавки, а также обычные предметы
ALLOW_SAME_HERO_SELECTION = false -- Должны ли мы позволить людям выбирать одного и того же героя друг для друга

HERO_SELECTION_TIME = 30.0 -- Как долго мы должны позволять людям выбирать своего героя?
PRE_GAME_TIME = 5.0 -- Через какое время после того, как люди выберут своих героев, прозвучит рог и начнется игра?
POST_GAME_TIME = 60.0 -- Как долго мы должны позволять людям смотреть на табло, прежде чем сервер автоматически закроется?
TREE_REGROW_TIME = 30.0 -- Как долго должны возрождаться отдельные деревья после вырубки / уничтожения?

GOLD_PER_TICK = 1 -- Сколько золота игроки должны получать за тик?
GOLD_TICK_TIME = 1 -- Как долго мы должны ждать в секундах между золотыми тиками?
SCAN_COOLDOWN = 120.0 -- Кулдаун глифа

RECOMMENDED_BUILDS_DISABLED = true -- Должны ли мы отключить рекомендуемые сборки для героев (Примечание: я считаю, что в настоящее время это не работает)
CAMERA_DISTANCE_OVERRIDE = 1134.0 -- Как далеко мы должны позволить камере уйти? 1134 по умолчанию в Dota

MINIMAP_ICON_SIZE = 1 -- Какой размер иконок мы должны использовать для наших героев?
MINIMAP_CREEP_ICON_SIZE = 1 -- Какой размер значков использовать для крипов?
MINIMAP_RUNE_ICON_SIZE = 1 -- Какой размер значков использовать для рун?

RUNE_SPAWN_TIME = 120 -- Как долго в секундах мы должны ждать между появлением рун?
CUSTOM_BUYBACK_COST_ENABLED = false -- Следует ли нам использовать индивидуальную настройку стоимости обратного выкупа?
CUSTOM_BUYBACK_COOLDOWN_ENABLED = true -- Следует ли использовать индивидуальное время выкупа?
BUYBACK_ENABLED = false -- Должны ли мы позволять людям выкупать деньги после их смерти?

DISABLE_FOG_OF_WAR_ENTIRELY = false -- Должны ли мы полностью отключить туман войны для обеих команд?
FOG_WAR = true -- Включение или отключение невидимого тумана войны. При включении части карты, которую игрок никогда не видел, будут полностью скрыты туманом войны.
USE_STANDARD_HERO_GOLD_BOUNTY = false -- Стоит ли давать золото за убийства героев так же, как в Доте, или разрешить изменение этих значений?


SHOW_KILLS_ON_TOPBAR = false -- Должны ли мы отображать убийства только на верхней панели? (Нет отрицаний, самоубийств, убийств нейтралами) Требуется USE_CUSTOM_TOP_BAR_VALUES
ENABLE_TOWER_BACKDOOR_PROTECTION = false -- Should we enable backdoor protection for our towers?
REMOVE_ILLUSIONS_ON_DEATH = false -- Should we remove all illusions if the main hero dies?
DISABLE_GOLD_SOUNDS = false -- Should we disable the gold sound when players get gold?

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

USE_CUSTOM_HERO_LEVELS = true -- Should we allow heroes to have custom levels?
MAX_LEVEL = 30 -- What level should we let heroes get to?
USE_CUSTOM_XP_VALUES = true -- Should we use custom XP values to level up heroes, or the default Dota numbers?
XP_PER_LEVEL_TABLE = {}
XP_PER_LEVEL_TABLE[1] = 0
XP_PER_LEVEL_TABLE[2] = 120
XP_PER_LEVEL_TABLE[3] = 120
XP_PER_LEVEL_TABLE[4] = 120
XP_PER_LEVEL_TABLE[5] = 120
XP_PER_LEVEL_TABLE[6] = 120
XP_PER_LEVEL_TABLE[7] = 120
XP_PER_LEVEL_TABLE[8] = 120
XP_PER_LEVEL_TABLE[9] = 120
XP_PER_LEVEL_TABLE[10] = 180
XP_PER_LEVEL_TABLE[11] = 180
XP_PER_LEVEL_TABLE[12] = 180
XP_PER_LEVEL_TABLE[13] = 180
XP_PER_LEVEL_TABLE[14] = 180
XP_PER_LEVEL_TABLE[15] = 180
XP_PER_LEVEL_TABLE[16] = 180
XP_PER_LEVEL_TABLE[17] = 180
XP_PER_LEVEL_TABLE[18] = 180
XP_PER_LEVEL_TABLE[19] = 180
XP_PER_LEVEL_TABLE[20] = 240
XP_PER_LEVEL_TABLE[21] = 240
XP_PER_LEVEL_TABLE[22] = 240
XP_PER_LEVEL_TABLE[23] = 240
XP_PER_LEVEL_TABLE[24] = 240
XP_PER_LEVEL_TABLE[25] = 240
XP_PER_LEVEL_TABLE[26] = 240
XP_PER_LEVEL_TABLE[27] = 240
XP_PER_LEVEL_TABLE[28] = 240
XP_PER_LEVEL_TABLE[29] = 240
XP_PER_LEVEL_TABLE[30] = 240

-- Fill this table up with the required XP per level if you want to change it
for i=1,MAX_LEVEL do
local originalValue = XP_PER_LEVEL_TABLE
if i > 2 then
XP_PER_LEVEL_TABLE = XP_PER_LEVEL_TABLE + XP_PER_LEVEL_TABLE[i-1]
end
end

-- Generated from template
if GameMode == nil then
print ( '[BAREBONES] creating barebones game mode' )
GameMode = class({})
end

-- This function initializes the game mode and is called before anyone loads into the game
-- It can be used to pre-initialize any values/tables that will be needed later












function GameMode:InitGameMode()
GameMode = self
print('[BAREBONES] Starting to load Barebones gamemode...')

-- Setup rules
GameRules:SetHeroRespawnEnabled( ENABLE_HERO_RESPAWN )
GameRules:SetUseUniversalShopMode( UNIVERSAL_SHOP_MODE )
GameRules:SetSameHeroSelectionEnabled( ALLOW_SAME_HERO_SELECTION )
GameRules:SetHeroSelectionTime( HERO_SELECTION_TIME )
GameRules:SetPreGameTime( PRE_GAME_TIME)
GameRules:SetPostGameTime( POST_GAME_TIME )
GameRules:SetTreeRegrowTime( TREE_REGROW_TIME )
GameRules:SetUseCustomHeroXPValues ( USE_CUSTOM_XP_VALUES )
GameRules:SetGoldPerTick(GOLD_PER_TICK)
GameRules:SetGoldTickTime(GOLD_TICK_TIME)
GameRules:SetRuneSpawnTime(RUNE_SPAWN_TIME)
GameRules:SetUseBaseGoldBountyOnHeroes(USE_STANDARD_HERO_GOLD_BOUNTY)
GameRules:SetHeroMinimapIconScale( MINIMAP_ICON_SIZE )
GameRules:SetCreepMinimapIconScale( MINIMAP_CREEP_ICON_SIZE )
GameRules:SetRuneMinimapIconScale( MINIMAP_RUNE_ICON_SIZE )
print('[BAREBONES] GameRules set')

-- Listeners - Event Hooks
-- All of these events can potentially be fired by the game, though only the uncommented ones have had
-- Functions supplied for them.
ListenToGameEvent('dota_player_gained_level', Dynamic_Wrap(GameMode, 'OnPlayerLevelUp'), self)
ListenToGameEvent('dota_ability_channel_finished', Dynamic_Wrap(GameMode, 'OnAbilityChannelFinished'), self)
ListenToGameEvent('dota_player_learned_ability', Dynamic_Wrap(GameMode, 'OnPlayerLearnedAbility'), self)
ListenToGameEvent('entity_killed', Dynamic_Wrap(GameMode, 'OnEntityKilled'), self)
ListenToGameEvent('player_connect_full', Dynamic_Wrap(GameMode, 'OnConnectFull'), self)
ListenToGameEvent('player_disconnect', Dynamic_Wrap(GameMode, 'OnDisconnect'), self)
ListenToGameEvent('dota_item_purchased', Dynamic_Wrap(GameMode, 'OnItemPurchased'), self)
ListenToGameEvent('dota_item_picked_up', Dynamic_Wrap(GameMode, 'OnItemPickedUp'), self)
ListenToGameEvent('last_hit', Dynamic_Wrap(GameMode, 'OnLastHit'), self)
ListenToGameEvent('dota_non_player_used_ability', Dynamic_Wrap(GameMode, 'OnNonPlayerUsedAbility'), self)
ListenToGameEvent('player_changename', Dynamic_Wrap(GameMode, 'OnPlayerChangedName'), self)
ListenToGameEvent('dota_rune_activated_server', Dynamic_Wrap(GameMode, 'OnRuneActivated'), self)
ListenToGameEvent('dota_player_take_tower_damage', Dynamic_Wrap(GameMode, 'OnPlayerTakeTowerDamage'), self)
ListenToGameEvent('tree_cut', Dynamic_Wrap(GameMode, 'OnTreeCut'), self)
ListenToGameEvent('entity_hurt', Dynamic_Wrap(GameMode, 'OnEntityHurt'), self)
ListenToGameEvent('player_connect', Dynamic_Wrap(GameMode, 'PlayerConnect'), self)
ListenToGameEvent('dota_player_used_ability', Dynamic_Wrap(GameMode, 'OnAbilityUsed'), self)
ListenToGameEvent('game_rules_state_change', Dynamic_Wrap(GameMode, 'OnGameRulesStateChange'), self)
ListenToGameEvent('npc_spawned', Dynamic_Wrap(GameMode, 'OnNPCSpawned'), self)
ListenToGameEvent('dota_player_pick_hero', Dynamic_Wrap(GameMode, 'OnPlayerPickHero'), self)
ListenToGameEvent('dota_team_kill_credit', Dynamic_Wrap(GameMode, 'OnTeamKillCredit'), self)
ListenToGameEvent("player_reconnected", Dynamic_Wrap(GameMode, 'OnPlayerReconnect'), self)

-- Change random seed
local timeTxt = string.gsub(string.gsub(GetSystemTime(), ':', ''), '0','')
math.randomseed(tonumber(timeTxt))

-- Initialized tables for tracking state
self.vUserIds = {}
self.vSteamIds = {}
self.vBots = {}
self.vBroadcasters = {}

self.vPlayers = {}
self.vRadiant = {}
self.vDire = {}

self.nRadiantKills = 0
self.nDireKills = 0

self.bSeenWaitForPlayers = false

-- Commands can be registered for debugging purposes or as functions that can be called by the custom Scaleform UI
Convars:RegisterCommand( "command_example", Dynamic_Wrap(GameMode, 'ExampleConsoleCommand'), "A console command example", 0 )

print('[BAREBONES] Done loading Barebones gamemode!\n\n')
end

mode = nil

-- This function is called 1 to 2 times as the player connects initially but before they
-- have completely connected
function GameMode:playerConnect(keys)
print('[BAREBONES] PlayerConnect')
DeepPrintTable(keys)

if keys.bot == 1 then
-- This user is a Bot, so add it to the bots table
self.vBots[keys.userid] = 1
end
end

-- This function is called once when the player fully connects and becomes "Ready" during Loading
function GameMode:OnConnectFull(keys)
print ('[BAREBONES] OnConnectFull')
DeepPrintTable(keys)
GameMode:CaptureGameMode()

local entIndex = keys.index+1
-- The Player entity of the joining user
local ply = EntIndexToHScript(entIndex)

-- The Player ID of the joining player
local playerID = ply:GetPlayerID()

-- Update the user ID table with this user
self.vUserIds[keys.userid] = ply

-- Update the Steam ID table
self.vSteamIds[PlayerResource:GetSteamAccountID(playerID)] = ply

-- If the player is a broadcaster flag it in the Broadcasters table
if PlayerResource:IsBroadcaster(playerID) then
self.vBroadcasters[keys.userid] = 1
return
end
end

-- This function is called as the first player loads and sets up the GameMode parameters
function GameMode:CaptureGameMode()
if mode == nil then
-- Set GameMode parameters
mode = GameRules:GetGameModeEntity()
mode:SetRecommendedItemsDisabled( RECOMMENDED_BUILDS_DISABLED )
mode:SetCameraDistanceOverride( CAMERA_DISTANCE_OVERRIDE )
mode:SetCustomBuybackCostEnabled( CUSTOM_BUYBACK_COST_ENABLED )
mode:SetCustomBuybackCooldownEnabled( CUSTOM_BUYBACK_COOLDOWN_ENABLED )
mode:SetBuybackEnabled( BUYBACK_ENABLED )

mode:SetUseCustomHeroLevels ( USE_CUSTOM_HERO_LEVELS )
mode:SetCustomHeroMaxLevel ( MAX_LEVEL )
mode:SetCustomXPRequiredToReachNextLevel( XP_PER_LEVEL_TABLE )
mode:SetCustomScanCooldown( SCAN_COOLDOWN )
mode:SetHUDVisible(9, false)
mode:SetTopBarTeamValuesOverride( true ) --Эта строка разрешает редактирования значений
mode:SetTopBarTeamValuesVisible( false ) --Эта строка убирает их с панели

--mode:SetBotThinkingEnabled( USE_STANDARD_DOTA_BOT_THINKING )
mode:SetTowerBackdoorProtectionEnabled( ENABLE_TOWER_BACKDOOR_PROTECTION )

mode:SetFogOfWarDisabled(DISABLE_FOG_OF_WAR_ENTIRELY)
mode:SetGoldSoundDisabled( DISABLE_GOLD_SOUNDS )
mode:SetRemoveIllusionsOnDeath( REMOVE_ILLUSIONS_ON_DEATH )
mode:SetUnseenFogOfWarEnabled( FOG_WAR )

self:OnFirstPlayerLoaded()
end
end

-- This is an example console command
function GameMode:ExampleConsoleCommand()
print( '******* Example Console Command ***************' )
local cmdPlayer = Convars:GetCommandClient()
if cmdPlayer then
local playerID = cmdPlayer:GetPlayerID()
if playerID ~= nil and playerID ~= -1 then
-- Do something here for the player who called this command
PlayerResource:ReplaceHeroWith(playerID, "npc_dota_hero_viper", 1000, 1000)
end
end
print( '*********************************************' )
end

--[[
This function should be used to set up Async precache calls at the beginning of the game. The Precache() function
in addon_game_mode.lua used to and may still sometimes have issues with client's appropriately precaching stuff.
If this occurs it causes the client to never precache things configured in that block.
In this function, place all of your PrecacheItemByNameAsync and PrecacheUnitByNameAsync. These calls will be made
after all players have loaded in, but before they have selected their heroes. PrecacheItemByNameAsync can also
be used to precache dynamically-added datadriven abilities instead of items. PrecacheUnitByNameAsync will
precache the precache{} block statement of the unit and all precache{} block statements for every Ability#
defined on the unit.
This function should only be called once. If you want to/need to precache more items/abilities/units at a later
time, you can call the functions individually (for example if you want to precache units in a new wave of
holdout).
]]
function GameMode:postLoadPrecache()
print("[BAREBONES] Performing Post-Load precache")

end

--[[
This function is called once and only once as soon as the first player (almost certain to be the server in local lobbies) loads in.
It can be used to initialize state that isn't initializeable in InitGameMode() but needs to be done before everyone loads in.
]]
function GameMode:OnFirstPlayerLoaded()
print("[BAREBONES] First Player has loaded")
end

--[[
This function is called once and only once after all players have loaded into the game, right as the hero selection time begins.
It can be used to initialize non-hero player state or adjust the hero selection (i.e. force random etc)
]]
function GameMode:OnAllPlayersLoaded()
print("[BAREBONES] All Players have loaded into the game")
end

--[[
This function is called once and only once for every player when they spawn into the game for the first time. It is also called
if the player's hero is replaced with a new hero for any reason. This function is useful for initializing heroes, such as adding
levels, changing the starting gold, removing/adding abilities, adding physics, etc.
The hero parameter is the hero entity that just spawned in.
]]
function GameMode:OnHeroInGame(hero)
print("[BAREBONES] Hero spawned in game for first time -- " .. hero:GetUnitName())

-- Store a reference to the player handle inside this hero handle.
hero.player = PlayerResource:GetPlayer(hero:GetPlayerID())
-- Store the player's name inside this hero handle.
hero.playerName = PlayerResource:GetPlayerName(hero:GetPlayerID())
-- Store this hero handle in this table.
table.insert(self.vPlayers, hero)

-- This line for example will set the starting gold of every hero to 500 unreliable gold
hero:SetGold(1000, false)

-- These lines will create an item and add it to the player, effectively ensuring they start with the item
local item = CreateItem("item_example_item", hero, hero)
hero:AddItem(item)
end

--[[
This function is called once and only once when the game completely begins (about 0:00 on the clock). At this point,
gold will begin to go up in ticks if configured, creeps will spawn, towers will become damageable etc. This function
is useful for starting any game logic timers/thinkers, beginning the first round, etc.
]]
function GameMode:OnGameInProgress()
print("[BAREBONES] The game has officially begun")

Timers:CreateTimer(30, function() -- Start this timer 30 game-time seconds later
--print("This function is called 30 seconds after the game begins, and every 30 seconds thereafter")
return 30.0 -- Rerun this timer every 30 game-time seconds
end)
end

-- Cleanup a player when they leave
function GameMode:OnDisconnect(keys)
print('[BAREBONES] Player Disconnected ' .. tostring(keys.userid))
DeepPrintTable(keys)

local name = keys.name
local networkid = keys.networkid
local reason = keys.reason
local userid = keys.userid
end

-- The overall game state has changed
function GameMode:OnGameRulesStateChange(keys)
print("[BAREBONES] GameRules State Changed")
DeepPrintTable(keys)

local newState = GameRules:State_Get()
if newState == DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD then
self.bSeenWaitForPlayers = true
elseif newState == DOTA_GAMERULES_STATE_INIT then
Timers:RemoveTimer("alljointimer")
elseif newState == DOTA_GAMERULES_STATE_HERO_SELECTION then
local et = 6
if self.bSeenWaitForPlayers then
et = .01
end
Timers:CreateTimer("alljointimer", {
useGameTime = true,
endTime = et,
callback = function()
if PlayerResource:HaveAllPlayersJoined() then
GameMode:postLoadPrecache()
GameMode:OnAllPlayersLoaded()
return
end
return 1
end})
elseif newState == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
GameMode:OnGameInProgress()
end
end

-- An NPC has spawned somewhere in game. This includes heroes
function GameMode:OnNPCSpawned(keys)
print("[BAREBONES] NPC Spawned")
DeepPrintTable(keys)
local npc = EntIndexToHScript(keys.entindex)

if npc:IsRealHero() and npc.bFirstSpawned == nil then
npc.bFirstSpawned = true
GameMode:OnHeroInGame(npc)
end
end

-- An entity somewhere has been hurt. This event fires very often with many units so don't do too many expensive
-- operations here
function GameMode:OnEntityHurt(keys)
--print("[BAREBONES] Entity Hurt")
--DeepPrintTable(keys)
local entCause = EntIndexToHScript(keys.entindex_attacker)
local entVictim = EntIndexToHScript(keys.entindex_killed)
end

-- An item was picked up off the ground
function GameMode:OnItemPickedUp(keys)
print ( '[BAREBONES] OnItemPurchased' )
DeepPrintTable(keys)

local heroEntity = EntIndexToHScript(keys.HeroEntityIndex)
local itemEntity = EntIndexToHScript(keys.ItemEntityIndex)
local player = PlayerResource:GetPlayer(keys.PlayerID)
local itemname = keys.itemname
end

-- A player has reconnected to the game. This function can be used to repaint Player-based particles or change
-- state as necessary
function GameMode:OnPlayerReconnect(keys)
print ( '[BAREBONES] OnPlayerReconnect' )
DeepPrintTable(keys)
end

-- An item was purchased by a player
function GameMode:OnItemPurchased( keys )
print ( '[BAREBONES] OnItemPurchased' )
DeepPrintTable(keys)

-- The playerID of the hero who is buying something
local plyID = keys.PlayerID
if not plyID then return end

-- The name of the item purchased
local itemName = keys.itemname

-- The cost of the item purchased
local itemcost = keys.itemcost

end

-- An ability was used by a player
function GameMode:OnAbilityUsed(keys)
print('[BAREBONES] AbilityUsed')
DeepPrintTable(keys)

local player = EntIndexToHScript(keys.PlayerID)
local abilityname = keys.abilityname
end

-- A non-player entity (necro-book, chen creep, etc) used an ability
function GameMode:OnNonPlayerUsedAbility(keys)
print('[BAREBONES] OnNonPlayerUsedAbility')
DeepPrintTable(keys)

local abilityname= keys.abilityname
end

-- A player changed their name
function GameMode:OnPlayerChangedName(keys)
print('[BAREBONES] OnPlayerChangedName')
DeepPrintTable(keys)

local newName = keys.newname
local oldName = keys.oldName
end

-- A player leveled up an ability
function GameMode:OnPlayerLearnedAbility( keys)
print ('[BAREBONES] OnPlayerLearnedAbility')
DeepPrintTable(keys)

local player = EntIndexToHScript(keys.player)
local abilityname = keys.abilityname
end

-- A channelled ability finished by either completing or being interrupted
function GameMode:OnAbilityChannelFinished(keys)
print ('[BAREBONES] OnAbilityChannelFinished')
DeepPrintTable(keys)

local abilityname = keys.abilityname
local interrupted = keys.interrupted == 1
end

-- A player leveled up
function GameMode:OnPlayerLevelUp(keys)
print ('[BAREBONES] OnPlayerLevelUp')
DeepPrintTable(keys)

local player = EntIndexToHScript(keys.player)
local level = keys.level
end

-- A player last hit a creep, a tower, or a hero
function GameMode:OnLastHit(keys)
print ('[BAREBONES] OnLastHit')
DeepPrintTable(keys)

local isFirstBlood = keys.FirstBlood == 1
local isHeroKill = keys.HeroKill == 1
local isTowerKill = keys.TowerKill == 1
local player = PlayerResource:GetPlayer(keys.PlayerID)
end

-- A tree was cut down by tango, quelling blade, etc
function GameMode:OnTreeCut(keys)
print ('[BAREBONES] OnTreeCut')
DeepPrintTable(keys)

local treeX = keys.tree_x
local treeY = keys.tree_y
end

-- A rune was activated by a player
function GameMode:OnRuneActivated (keys)
print ('[BAREBONES] OnRuneActivated')
DeepPrintTable(keys)

local player = PlayerResource:GetPlayer(keys.PlayerID)
local rune = keys.rune

end

-- A player took damage from a tower
function GameMode:OnPlayerTakeTowerDamage(keys)
print ('[BAREBONES] OnPlayerTakeTowerDamage')
DeepPrintTable(keys)

local player = PlayerResource:GetPlayer(keys.PlayerID)
local damage = keys.damage
end

-- A player picked a hero
function GameMode:OnPlayerPickHero(keys)
print ('[BAREBONES] OnPlayerPickHero')
DeepPrintTable(keys)

local heroClass = keys.hero
local heroEntity = EntIndexToHScript(keys.heroindex)
local player = EntIndexToHScript(keys.player)
end

-- A player killed another player in a multi-team context
function GameMode:OnTeamKillCredit(keys)
print ('[BAREBONES] OnTeamKillCredit')
DeepPrintTable(keys)

local killerPlayer = PlayerResource:GetPlayer(keys.killer_userid)
local victimPlayer = PlayerResource:GetPlayer(keys.victim_userid)
local numKills = keys.herokills
local killerTeamNumber = keys.teamnumber
end

-- An entity died
function GameMode:OnEntityKilled( keys )
print( '[BAREBONES] OnEntityKilled Called' )
DeepPrintTable( keys )

-- The Unit that was Killed
local killedUnit = EntIndexToHScript( keys.entindex_killed )
-- The Killing entity
local killerEntity = nil

if keys.entindex_attacker ~= nil then
killerEntity = EntIndexToHScript( keys.entindex_attacker )
end

-- Put code here to handle when an entity gets killed
end
 
Реклама: