Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CUG:OnThink()
- --Reconnect heroes
- for _,hero in pairs( Entities:FindAllByClassname( "npc_dota_hero_wisp")) do
- if hero:GetPlayerOwnerID() == -1 then
- local id = hero:GetPlayerOwner():GetPlayerID()
- if id ~= -1 then
- print("Reconnecting hero for player " .. id)
- hero:SetControllableByPlayer(id, true)
- hero:SetPlayerID(id)
- end
- end
- end
- if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
- self.spawnZombieFodder()
- elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
- return nil
- end
- return 1
- end
- function CUG:OnPlayerConnectFull(keys)
- local player = PlayerInstanceFromIndex(keys.index + 1)
- print("Picking Wisp.")
- local hero = CreateHeroForPlayer('npc_dota_hero_wisp', player)
- local ability_1 = hero:FindAbilityByName("antimage_blink")
- local ability_2 = hero:FindAbilityByName("Towers1")
- local ability_3 = hero:FindAbilityByName("Towers2")
- local ability_4 = hero:FindAbilityByName("Barracks1")
- local ability_5 = hero:FindAbilityByName("Barracks2")
- local ability_6 = hero:FindAbilityByName("Invulnerable")
- ability_1:SetLevel(1)
- ability_2:SetLevel(1)
- ability_3:SetLevel(1)
- ability_4:SetLevel(1)
- ability_5:SetLevel(1)
- ability_6:SetLevel(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement