Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. function CUG:OnThink()
  2.      --Reconnect heroes
  3.     for _,hero in pairs( Entities:FindAllByClassname( "npc_dota_hero_wisp")) do
  4.         if hero:GetPlayerOwnerID() == -1 then
  5.             local id = hero:GetPlayerOwner():GetPlayerID()
  6.             if id ~= -1 then
  7.                 print("Reconnecting hero for player " .. id)
  8.                 hero:SetControllableByPlayer(id, true)
  9.                 hero:SetPlayerID(id)
  10.             end
  11.         end
  12.     end
  13.         if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
  14.         self.spawnZombieFodder()
  15.        
  16.         elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
  17.             return nil
  18.         end
  19.         return 1
  20. end
  21.  
  22. function CUG:OnPlayerConnectFull(keys)
  23.     local player = PlayerInstanceFromIndex(keys.index + 1)
  24.     print("Picking Wisp.")
  25.     local hero = CreateHeroForPlayer('npc_dota_hero_wisp', player)
  26.     local ability_1 = hero:FindAbilityByName("antimage_blink")
  27.     local ability_2 = hero:FindAbilityByName("Towers1")
  28.     local ability_3 = hero:FindAbilityByName("Towers2")
  29.     local ability_4 = hero:FindAbilityByName("Barracks1")
  30.     local ability_5 = hero:FindAbilityByName("Barracks2")
  31.     local ability_6 = hero:FindAbilityByName("Invulnerable")
  32.     ability_1:SetLevel(1)
  33.     ability_2:SetLevel(1)
  34.     ability_3:SetLevel(1)
  35.     ability_4:SetLevel(1)
  36.     ability_5:SetLevel(1)
  37.     ability_6:SetLevel(1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement