Hey all This is a Rank System map that i made in jass.
That trigger give you the experience when you kill a unit. The experience is set very high 100 for each kill. You can change that in the variables the name of it is Xp_gained.
That part should be pasted in the Custom script part in your triggers
I have 23 ranks set in this you can add or remove ranks or you can change them to names that you want. Also you might want to change how much experience you need for each rank
those are set kinda high.
Any problems you can post it here or private message me
JASS:
function Trig_exp_gain_Actions takes nothing returns nothing
local integer array xp
local player p = GetOwningPlayer(GetKillingUnit())
local unit u = GetKillingUnit()
// These are the xp you need to get for each rank
set xp[1] = 0
set xp[2] = 500
set xp[3] = 1000
set xp[4] = 2000
set xp[5] = 4000
set xp[6] = 6000
set xp[7] = 8000
set xp[8] = 10000
set xp[9] = 20000
set xp[10] = 30000
set xp[11] = 40000
set xp[12] = 50000
set xp[13] = 60000
set xp[14] = 70000
set xp[15] = 80000
set xp[16] = 90000
set xp[17] = 100000
set xp[18] = 200000
set xp[19] = 300000
set xp[20] = 400000
set xp[21] = 500000
set xp[22] = 600000
set xp[23] = 700000
// you can go to the variables menu and change how much xp is gained for each kill
set udg_Experience[GetConvertedPlayerId(p)] = udg_Experience[GetConvertedPlayerId(p)] + udg_XP_gained
call ConditionalTriggerExecute(gg_trg_Update1)
if udg_Experience[GetConvertedPlayerId(p)] == xp[2] then
call SetUnitAbilityLevel(u, 'A00N', 2)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[3] then
call SetUnitAbilityLevel(u, 'A00N', 3)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[4] then
call SetUnitAbilityLevel(u, 'A00N', 4)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[5] then
call SetUnitAbilityLevel(u, 'A00N', 5)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[6] then
call SetUnitAbilityLevel(u, 'A00N', 6)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[7] then
call SetUnitAbilityLevel(u, 'A00N', 7)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[8] then
call SetUnitAbilityLevel(u, 'A00N', 8)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[9] then
call SetUnitAbilityLevel(u, 'A00N', 9)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[10] then
call SetUnitAbilityLevel(u, 'A00N', 10)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[11] then
call SetUnitAbilityLevel(u, 'A00N', 11)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[12] then
call SetUnitAbilityLevel(u, 'A00N', 12)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[13] then
call SetUnitAbilityLevel(u, 'A00N', 13)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[14] then
call SetUnitAbilityLevel(u, 'A00N', 14)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[15] then
call SetUnitAbilityLevel(u, 'A00N', 15)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[16] then
call SetUnitAbilityLevel(u, 'A00N', 16)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[17] then
call SetUnitAbilityLevel(u, 'A00N', 17)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[18] then
call SetUnitAbilityLevel(u, 'A00N', 18)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[19] then
call SetUnitAbilityLevel(u, 'A00N', 19)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[20] then
call SetUnitAbilityLevel(u, 'A00N', 20)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[21] then
call SetUnitAbilityLevel(u, 'A00N', 21)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[22] then
call SetUnitAbilityLevel(u, 'A00N', 22)
call gain_xp()
elseif udg_Experience[GetConvertedPlayerId(p)] == xp[23] then
call SetUnitAbilityLevel(u, 'A00N', 23)
call gain_xp()
call DisableTrigger( GetTriggeringTrigger() )
endif
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_exp_gain takes nothing returns nothing
set gg_trg_exp_gain = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_exp_gain, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_exp_gain, function Trig_exp_gain_Actions )
endfunction
That trigger give you the experience when you kill a unit. The experience is set very high 100 for each kill. You can change that in the variables the name of it is Xp_gained.
JASS:
function HeroRanks takes nothing returns nothing
local string array ranks
local string array rank_title
local player p = GetOwningPlayer(GetLastCreatedUnit())
local unit u = GetLastCreatedUnit()
// you can change the names of the ranks or remove ranks or you can add more if you want to
set ranks[1] = "Private"
set ranks[2] = "Private First Class"
set ranks[3] = "Specialist"
set ranks[4] = "Corporal"
set ranks[5] = "Sergeant"
set ranks[6] = "Staff Sergeant"
set ranks[7] = "Sergeant First Class"
set ranks[8] = "Master Sergeant"
set ranks[9] = "First Sergeant"
set ranks[10] = "Sergeant Major"
set ranks[11] = "Command Sergeant Major"
set ranks[12] = "Sergeant Major of the Army"
set ranks[13] = "Second Lieutenant"
set ranks[14] = "First Lieutenant"
set ranks[15] = "Captain"
set ranks[16] = "Major"
set ranks[17] = "Lieutenant Colonel"
set ranks[18] = "Colonel"
set ranks[19] = "Brigadier General"
set ranks[20] = "Major General"
set ranks[21] = "Lieutenant General"
set ranks[22] = "General"
set ranks[23] = "General of the Army"
// these are added to your name once you get to the next rank
set rank_title[1] = "PVT-"
set rank_title[2] = "PFC-"
set rank_title[3] = "SPC-"
set rank_title[4] = "CPL-"
set rank_title[5] = "SGT-"
set rank_title[6] = "SSG-"
set rank_title[7] = "SFC-"
set rank_title[8] = "MSG-"
set rank_title[9] = "1SG-"
set rank_title[10] = "SGM-"
set rank_title[11] = "CSM-"
set rank_title[12] = "SMA-"
set rank_title[13] = "2LT-"
set rank_title[14] = "1LT"
set rank_title[15] = "CPT-"
set rank_title[16] = "MAJ-"
set rank_title[17] = "LTC-"
set rank_title[18] = "COL-"
set rank_title[19] = "BG-"
set rank_title[20] = "MG-"
set rank_title[21] = "LTG-"
set rank_title[22] = "GEN-"
set rank_title[23] = "GA-"
if GetUnitAbilityLevel(u, 'A00N') == 1 then
call SetPlayerName( p, rank_title[1] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[1])
elseif GetUnitAbilityLevel(u, 'A00N') == 2 then
call SetPlayerName( p, rank_title[2] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[2])
elseif GetUnitAbilityLevel(u, 'A00N') == 3 then
call SetPlayerName( p, rank_title[3] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[3])
elseif GetUnitAbilityLevel(u, 'A00N') == 4 then
call SetPlayerName( p, rank_title[4] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[4])
elseif GetUnitAbilityLevel(u, 'A00N') == 5 then
call SetPlayerName( p, rank_title[5] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[5])
elseif GetUnitAbilityLevel(u, 'A00N') == 6 then
call SetPlayerName( p, rank_title[6] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[6])
elseif GetUnitAbilityLevel(u, 'A00N') == 7 then
call SetPlayerName( p, rank_title[7] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[7])
elseif GetUnitAbilityLevel(u, 'A00N') == 8 then
call SetPlayerName( p, rank_title[8] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[8])
elseif GetUnitAbilityLevel(u, 'A00N') == 9 then
call SetPlayerName( p, rank_title[9] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[9])
elseif GetUnitAbilityLevel(u, 'A00N') == 10 then
call SetPlayerName( p, rank_title[10] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[10])
elseif GetUnitAbilityLevel(u, 'A00N') == 11 then
call SetPlayerName( p, rank_title[11] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[11])
elseif GetUnitAbilityLevel(u, 'A00N') == 12 then
call SetPlayerName( p, rank_title[12] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[12])
elseif GetUnitAbilityLevel(u, 'A00N') == 13 then
call SetPlayerName( p, rank_title[13] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[13])
elseif GetUnitAbilityLevel(u, 'A00N') == 14 then
call SetPlayerName( p, rank_title[14] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[14])
elseif GetUnitAbilityLevel(u, 'A00N') == 15 then
call SetPlayerName( p, rank_title[15] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[15])
elseif GetUnitAbilityLevel(u, 'A00N') == 16 then
call SetPlayerName( p, rank_title[16] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[16])
elseif GetUnitAbilityLevel(u, 'A00N') == 17 then
call SetPlayerName( p, rank_title[17] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[17])
elseif GetUnitAbilityLevel(u, 'A00N') == 18 then
call SetPlayerName( p, rank_title[18] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[18])
elseif GetUnitAbilityLevel(u, 'A00N') == 19 then
call SetPlayerName( p, rank_title[19] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[19])
elseif GetUnitAbilityLevel(u, 'A00N') == 20 then
call SetPlayerName( p, rank_title[20] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[20])
elseif GetUnitAbilityLevel(u, 'A00N') == 21 then
call SetPlayerName( p, rank_title[21] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[21])
elseif GetUnitAbilityLevel(u, 'A00N') == 22 then
call SetPlayerName( p, rank_title[22] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[22])
elseif GetUnitAbilityLevel(u, 'A00N') == 23 then
call SetPlayerName( p, rank_title[23] + GetPlayerName(p))
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "Welcome " + ranks[23])
endif
set p = null
set u = null
endfunction
function gain_xp takes nothing returns nothing
local string array ranks
local string array rank_title
local player p = GetOwningPlayer(GetKillingUnit())
local unit u = GetKillingUnit()
set ranks[1] = "Private"
set ranks[2] = "Private First Class"
set ranks[3] = "Specialist"
set ranks[4] = "Corporal"
set ranks[5] = "Sergeant"
set ranks[6] = "Staff Sergeant"
set ranks[7] = "Sergeant First Class"
set ranks[8] = "Master Sergeant"
set ranks[9] = "First Sergeant"
set ranks[10] = "Sergeant Major"
set ranks[11] = "Command Sergeant Major"
set ranks[12] = "Sergeant Major of the Army"
set ranks[13] = "Second Lieutenant"
set ranks[14] = "First Lieutenant"
set ranks[15] = "Captain"
set ranks[16] = "Major"
set ranks[17] = "Lieutenant Colonel"
set ranks[18] = "Colonel"
set ranks[19] = "Brigadier General"
set ranks[20] = "Major General"
set ranks[21] = "Lieutenant General"
set ranks[22] = "General"
set ranks[23] = "General of the Army"
set rank_title[1] = "PVT-"
set rank_title[2] = "PFC-"
set rank_title[3] = "SPC-"
set rank_title[4] = "CPL-"
set rank_title[5] = "SGT-"
set rank_title[6] = "SSG-"
set rank_title[7] = "SFC-"
set rank_title[8] = "MSG-"
set rank_title[9] = "1SG-"
set rank_title[10] = "SGM-"
set rank_title[11] = "CSM-"
set rank_title[12] = "SMA-"
set rank_title[13] = "2LT-"
set rank_title[14] = "1LT"
set rank_title[15] = "CPT-"
set rank_title[16] = "MAJ-"
set rank_title[17] = "LTC-"
set rank_title[18] = "COL-"
set rank_title[19] = "BG-"
set rank_title[20] = "MG-"
set rank_title[21] = "LTG-"
set rank_title[22] = "GEN-"
set rank_title[23] = "GA-"
if GetUnitAbilityLevel(u, 'A00N') == 1 then
call SetPlayerName( p, rank_title[1] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[1])
elseif GetUnitAbilityLevel(u, 'A00N') == 2 then
call SetPlayerName( p, rank_title[2] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[2])
elseif GetUnitAbilityLevel(u, 'A00N') == 3 then
call SetPlayerName( p, rank_title[3] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[3])
elseif GetUnitAbilityLevel(u, 'A00N') == 4 then
call SetPlayerName( p, rank_title[4] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[4])
elseif GetUnitAbilityLevel(u, 'A00N') == 5 then
call SetPlayerName( p, rank_title[5] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[5])
elseif GetUnitAbilityLevel(u, 'A00N') == 6 then
call SetPlayerName( p, rank_title[6] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[6])
elseif GetUnitAbilityLevel(u, 'A00N') == 7 then
call SetPlayerName( p, rank_title[7] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[7])
elseif GetUnitAbilityLevel(u, 'A00N') == 8 then
call SetPlayerName( p, rank_title[8] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[8])
elseif GetUnitAbilityLevel(u, 'A00N') == 9 then
call SetPlayerName( p, rank_title[9] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[9])
elseif GetUnitAbilityLevel(u, 'A00N') == 10 then
call SetPlayerName( p, rank_title[10] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[10])
elseif GetUnitAbilityLevel(u, 'A00N') == 11 then
call SetPlayerName( p, rank_title[11] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to" + ranks[11])
elseif GetUnitAbilityLevel(u, 'A00N') == 12 then
call SetPlayerName( p, rank_title[12] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[12])
elseif GetUnitAbilityLevel(u, 'A00N') == 13 then
call SetPlayerName( p, rank_title[13] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[13])
elseif GetUnitAbilityLevel(u, 'A00N') == 14 then
call SetPlayerName( p, rank_title[14] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[14])
elseif GetUnitAbilityLevel(u, 'A00N') == 15 then
call SetPlayerName( p, rank_title[15] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[15])
elseif GetUnitAbilityLevel(u, 'A00N') == 16 then
call SetPlayerName( p, rank_title[16] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[16])
elseif GetUnitAbilityLevel(u, 'A00N') == 17 then
call SetPlayerName( p, rank_title[17] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[17])
elseif GetUnitAbilityLevel(u, 'A00N') == 18 then
call SetPlayerName( p, rank_title[18] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[18])
elseif GetUnitAbilityLevel(u, 'A00N') == 19 then
call SetPlayerName( p, rank_title[19] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[19])
elseif GetUnitAbilityLevel(u, 'A00N') == 20 then
call SetPlayerName( p, rank_title[20] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[20])
elseif GetUnitAbilityLevel(u, 'A00N') == 21 then
call SetPlayerName( p, rank_title[21] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[21])
elseif GetUnitAbilityLevel(u, 'A00N') == 22 then
call SetPlayerName( p, rank_title[22] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[22])
elseif GetUnitAbilityLevel(u, 'A00N') == 23 then
call SetPlayerName( p, rank_title[23] + udg_PlayerName[GetConvertedPlayerId(p)])
set udg_Player_Name[GetConvertedPlayerId(p)] = GetPlayerName(p)
call DisplayTimedTextToPlayer(p, 0, 0, 20.00, "You have been Promoted to " + ranks[23])
endif
set p = null
set u = null
endfunction
That part should be pasted in the Custom script part in your triggers
I have 23 ranks set in this you can add or remove ranks or you can change them to names that you want. Also you might want to change how much experience you need for each rank
those are set kinda high.
Any problems you can post it here or private message me