- Joined
- Nov 9, 2006
- Messages
- 2,561
So does this system function like normal experience? If so, sounds very interesting.
For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)

Loop - Actions


Set VariableSet ExpSys_ExpToLevel[(Integer A)] = ((Integer A) x ExpSys_ExpInt)
Set VariableSet ExpSys_MaxLevel = 10
Set VariableSet ExpSys_ExpInt = 20
Set VariableSet ExpSys_Creep[1] = Bandit
Set VariableSet ExpSys_ExpGiven[1] = 8
ExpSys Variable Setup

Events


Map initialization

Conditions

Actions


-------- ----------------------------------------- --------


-------- Set Max Level For Heroes --------


-------- ----------------------------------------- --------


Set VariableSet ExpSys_MaxLevel = 10


Set VariableSet ExpSys_ExpInt = 20


-------- ------------------------------------------------------- --------


-------- Set Experience Required Per Level --------


-------- Current Level Multiplied by Variable --------


-------- ------------------------------------------------------- --------


For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)



Loop - Actions




Set VariableSet ExpSys_ExpToLevel[(Integer A)] = ((Integer A) x ExpSys_ExpInt)


-------- -------------------------------------------------- --------


-------- Set Units for Experience System --------


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[1] = Bandit


Set VariableSet ExpSys_ExpGiven[1] = 8


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[2] = No unit-type


Set VariableSet ExpSys_ExpGiven[2] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[3] = No unit-type


Set VariableSet ExpSys_ExpGiven[3] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[4] = No unit-type


Set VariableSet ExpSys_ExpGiven[4] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[5] = No unit-type


Set VariableSet ExpSys_ExpGiven[5] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[6] = No unit-type


Set VariableSet ExpSys_ExpGiven[6] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[7] = No unit-type


Set VariableSet ExpSys_ExpGiven[7] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[8] = No unit-type


Set VariableSet ExpSys_ExpGiven[8] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[9] = No unit-type


Set VariableSet ExpSys_ExpGiven[9] = 0


-------- -------------------------------------------------- --------


Set VariableSet ExpSys_Creep[10] = No unit-type


Set VariableSet ExpSys_ExpGiven[10] = 0


-------- -------------------------------------------------- --------
ExpSys Unit Killed

Events


Unit - A unit Dies

Conditions

Actions


-------- Sets TempUnits for the Actions --------


Set VariableSet ExpSys_TempUnit[1] = (Dying unit)


Set VariableSet ExpSys_TempUnit[2] = (Killing unit)


-------- Used in cases you would like to set messages to Triggering Player. --------


Set VariableSet ExpSys_TempGroup = (Player group((Owner of ExpSys_TempUnit[2])))


-------- Set PlayerNumber to Ensure Variables are Tied to Player --------


Set VariableSet ExpSys_PlayerNum = (Player number of (Owner of ExpSys_TempUnit[2]))


-------- Set Hero Level to a Variable to Use Later --------


Set VariableSet ExpSys_HeroLevel[ExpSys_PlayerNum] = (Hero level of ExpSys_TempUnit[2])


-------- Delete The Disable Experience Action --------


-------- Add it to your Hero Pick Trigger of your Map --------


Hero - Disable experience gain for ExpSys_TempUnit[2].


For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(ExpSys_TempUnit[2] is A Hero) Equal to True






ExpSys_HeroLevel[ExpSys_PlayerNum] Less than ExpSys_MaxLevel






(Unit-type of ExpSys_TempUnit[1]) Equal to ExpSys_Creep[(Integer A)]





Then - Actions






-------- Adds Unit Experience to Current Experience --------






Set VariableSet ExpSys_ExpCurrent[ExpSys_PlayerNum] = (ExpSys_ExpCurrent[ExpSys_PlayerNum] + ExpSys_ExpGiven[(Integer A)])






-------- --------------------------------------------------------------------- --------






-------- ---------- DELETE UPON IMPORTING ---------- --------






-------- ------ ONLY USED TO CONFIRM VARS ------ --------






-------- V ----------------------------- V ----------------------------- V --------






Game - Display to ExpSys_TempGroup the text: (Experience Gained: + ((String(ExpSys_ExpGiven[(Integer A)])) + Experience))






Game - Display to ExpSys_TempGroup the text: (Current Experience: + ((String(ExpSys_ExpCurrent[ExpSys_PlayerNum])) + Experience))






-------- If you Decide to use Messages or PlayerGroups --------






-------- Be sure that you Destroy the PlayerGroup Leak --------






Custom script: call DestroyForce(udg_ExpSys_TempGroup)






-------- ^ ----------------------------- ^ ----------------------------- ^ --------






-------- ---------- DELETE UPON IMPORTING ---------- --------






-------- ------ ONLY USED TO CONFIRM VARS ------ --------






-------- --------------------------------------------------------------------- --------





Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(ExpSys_TempUnit[2] is A Hero) Equal to True




ExpSys_HeroLevel[ExpSys_PlayerNum] Less than ExpSys_MaxLevel




ExpSys_ExpCurrent[ExpSys_PlayerNum] Greater than or equal to ExpSys_ExpToLevel[ExpSys_HeroLevel[ExpSys_PlayerNum]]



Then - Actions




-------- Sets Hero Level to [Hero Level + 1] --------




Hero - Set ExpSys_TempUnit[2] Hero-level to (ExpSys_HeroLevel[ExpSys_PlayerNum] + 1), Show level-up graphics




-------- Equation Used to Ensure Excess Experience is not Wasted --------




Set VariableSet ExpSys_ExpCurrent[ExpSys_PlayerNum] = (ExpSys_ExpCurrent[ExpSys_PlayerNum] - ExpSys_ExpToLevel[ExpSys_HeroLevel[ExpSys_PlayerNum]])



Else - Actions