Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1.  
  2. if CAddonEzPezBroGameMode == nil then
  3. CAddonEzPezBroGameMode = class({})
  4. end
  5. -- Задаем таблицу опыта
  6. XP_PER_LEVEL_TABLE = {
  7. 0,-- 1
  8. 200,-- 2
  9. 500,-- 3
  10. 900,-- 4
  11. 1400,-- 5
  12. 2000,-- 6
  13. 2600,-- 7
  14. 3200,-- 8
  15. 4400,-- 9
  16. 5400,-- 10
  17. 6000,-- 11
  18. 8200,-- 12
  19. 9000,-- 13
  20. 10400,-- 14
  21. 11900,-- 15
  22. 13500,-- 16
  23. 15200,-- 17
  24. 17000,-- 18
  25. 18900,-- 19
  26. 20900,-- 20
  27. 23000,-- 21
  28. 25200,-- 22
  29. 27500,-- 23
  30. 29900,-- 24
  31. 32400,-- 25
  32. 35000,-- 26
  33. 37700,-- 27
  34. 40500,-- 28
  35. 43400,-- 29
  36. 46400,-- 30
  37. 49500,-- 31
  38. 52700,-- 32
  39. 56000,-- 33
  40. 59400,-- 34
  41. 62900,-- 35
  42. 66500,-- 36
  43. 70200,-- 37
  44. 74000,-- 38
  45. 77900,-- 39
  46. 81900,-- 40
  47.  
  48. }
  49. function Activate()
  50. CAddonEzPezBroGameMode:InitGameMode()
  51. CAddonEzPezBroGameMode:OnEntityKilled( event )
  52. end
  53.  
  54. function CAddonEzPezBroGameMode:InitGameMode()
  55.  
  56. GameRules:GetGameModeEntity():SetUseCustomHeroLevels( true ) -- установка кастомной системы урвоней
  57. GameRules:GetGameModeEntity():SetCustomHeroMaxLevel( 40 ) -- максимальный уровень
  58. GameRules:GetGameModeEntity():SetCustomXPRequiredToReachNextLevel( XP_PER_LEVEL_TABLE ) -- указываем таблицу
  59.  
  60. ListenToGameEvent( "entity_killed", Dynamic_Wrap(CAddonEzPezBroGameMode, 'OnEntityKilled' ), self )
  61.  
  62.  
  63.  
  64. GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 4 )
  65. GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_BADGUYS, 4 )
  66. GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_CUSTOM_1, 4 )
  67. GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_CUSTOM_2, 4 )
  68.  
  69. end
  70.  
  71.  
  72. function CAddonEzPezBroGameMode:OnEntityKilled( event )
  73. local killedUnit = EntIndexToHScript( event.entindex_killed )
  74. local hero = EntIndexToHScript( event.entindex_attacker )
  75. if killedUnit == "npc_dota_creature_boss_invoker" then
  76. GameRules:SetGameWinner( KilledUnit:GetTeam() )
  77. end
  78. end
  79.  
  80. function CAddonEzPezBroGameMode:OnEntityKilled( event )
  81. local killedUnit = EntIndexToHScript( event.entindex_killed )
  82. local attacker = EntIndexToHScript( event.entindex_attacker )
  83. if killedUnit == "npc_dota_creature_boss_invoker" then
  84. GameRules:SetGameWinner( attacker:GetTeam() )
  85. end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement