Dota 2 Workshop Tools/Scripting/API/CDOTABaseGameMode.SetCustomXPRequiredToReachNextLevel: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
No edit summary |
||
Line 22: | Line 22: | ||
| No Description Set | | No Description Set | ||
|} | |} | ||
== Examples == | |||
The following example demonstrates the SetCustomXPRequiredToReachNextLevel function inside ''addon_game_mode.lua'' | |||
<source lang="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 | |||
</source> |
Revision as of 03:31, 3 January 2017

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