Dota 2 Workshop Tools/Scripting/API/CDOTABaseGameMode.SetCustomXPRequiredToReachNextLevel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (clean up, added deadend tag)
 
Line 1: Line 1:
{{Dead end|date=January 2024}}
{{Note | This page is automatically generated.  Any changes may be overwritten}}
{{Note | This page is automatically generated.  Any changes may be overwritten}}
[[Category:Dota2Function]]
[[Category:CDOTABaseGameMode]]


== Function Description ==
== Function Description ==


''' void SetCustomXPRequiredToReachNextLevel(handle ''hTable'') '''
''' void SetCustomXPRequiredToReachNextLevel(handle ''hTable'') '''


''Allows definition of a ''table'' of hero XP values.''
''Allows definition of a ''table'' of hero XP values.''


== Parameters ==
== Parameters ==
Line 22: Line 19:
| No Description Set
| No Description Set
|}
|}


== Examples ==
== Examples ==
Line 60: Line 56:
end
end
</source>
</source>
[[Category:Dota2Function]]
[[Category:CDOTABaseGameMode]]

Latest revision as of 09:02, 21 January 2024

Dead End - Icon.png
This article has no Wikipedia icon links to other VDC articles. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
Note.pngNote: This page is automatically generated. Any changes may be overwritten

Function Description

void SetCustomXPRequiredToReachNextLevel(handle hTable)

Allows definition of a table of hero XP values.

Parameters

Type Name Description
handle hTable No Description Set

Examples

The following example demonstrates the SetCustomXPRequiredToReachNextLevel function inside addon_game_mode.lua

function CAddonTemplateGameMode:InitGameMode()
  local mode = GameRules:GetGameModeEntity()
  XP_PER_LEVEL_TABLE = {
        0, -- 1
      200, -- 2
      500, -- 3
      900, -- 4
     1400, -- 5
     2000, -- 6
     2640, -- 7
     3300, -- 8
     3980, -- 9
     4680, -- 10
     5400, -- 11
     6140, -- 12
     7340, -- 13
     8565, -- 14
     9815, -- 15
    11090, -- 16
    12390, -- 17
    13715, -- 18
    15115, -- 19
    16605, -- 20
    18205, -- 21
    20105, -- 22
    22305, -- 23
    24805, -- 24
    27500  -- 25
  }
  mode:SetCustomXPRequiredToReachNextLevel(XP_PER_LEVEL_TABLE)
end