Warcraft III: MapsModelsSkinsIconsCode SnippetsSpellsToolsTutorialsChat @Discord

Author Topic: Custom XP System  (Read 11029 times)

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« on: June 21, 2013, 05:45:01 AM »
Daffa the Mage PRESENTS
CUSTOM XP SYSTEM

Documentation
this system is originally shown by Vladadamm in on of his tutorial at The Hive Workshop which can be found here
I ask his permission to made the system for sharing for people who can't understand his tutorial to still be capable to utilize the system, currently the system supports EXP Percentage Buff Modifiers and Denying Method.

TRIGGERS
Trigger: CXPS Config
    Events
        Map initialization
    Conditions
    Actions
        -------- ===================== --------
        -------- Make sure to follow the main step at Information before importing! --------
        -------- Check the Examples folder for some examples of usage --------
        -------- ===================== --------
        -------- Amount of Base XP from Unit and Hero kills --------
        Set CXPS_BaseHero = 300
        Set CXPS_BaseUnit = 25
        -------- Amount of Increment XP from Unit and Hero kills for each additional level of dying unit --------
        Set CXPS_IncrementHero = 50
        Set CXPS_IncrementUnit = 10
        -------- Max Levels of Units and Heroes (the highest value of level a unit or a hero ingame can have, the highest between both) --------
        Set CXPS_MaxLevelReachable = 25
        For each (Integer CXPS_Level) from 1 to CXPS_MaxLevelReachable, do (Actions)
            Loop - Actions
                Set CXPS_HeroGain[CXPS_Level] = ((CXPS_IncrementHero x CXPS_Level) + CXPS_BaseHero)
                Set CXPS_UnitGain[CXPS_Level] = ((CXPS_IncrementUnit x CXPS_Level) + CXPS_BaseUnit)
        -------- Radius of XP gained --------
        Set CXSP_Area = 1000.00
        -------- Distribution to Nearby Allied Heroes > you can add another if the number of total heroes a team can own more than 5 --------
        -------- Use [6], [7] and so on to represent the next values --------
        Set CXPS_Distribute[1] = 100
        Set CXPS_Distribute[2] = 85
        Set CXPS_Distribute[3] = 70
        Set CXPS_Distribute[4] = 55
        Set CXPS_Distribute[5] = 40
        -------- Denied Unit/Hero Percentage, use 100 if you don't use it --------
        Set CXPS_Deny = 10
        -------- Percentage EXP modifier buffs --------
        -------- Make sure you use correct array number, else it won't work properly. --------
        Set CXPS_PercentBuff[1] = Brilliance Aura
        Set CXPS_PercentBuff_Bonus[1] = 25
        -------- Set to the highest array number --------
        Set CXPS_PercentBuff_Int = 1
        -------- Exact EXP modifier buffs --------
        -------- Make sure you use correct array number, else it won't work properly. --------
        Set CXPS_ExactBuff[1] = Brilliance Aura
        Set CXPS_ExactBuff_Bonus[1] = 10
        -------- Set to the highest array number --------
        Set CXPS_ExactBuff_Int = 1
        -------- END CONFIGURABLES --------
Trigger: CXPS Run
    Events
        Unit - A unit Dies
    Conditions
    Actions
        -------- Don't touch these --------
        -------- Variables --------
        Set CXPS_Temp_Unit = (Triggering unit)
        Set CXPS_Temp_Point = (Position of CXPS_Temp_Unit)
        Set CXPS_Temp_Group = (Units within CXSP_Area of CXPS_Temp_Point matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
        -------- Initial Check --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in CXPS_Temp_Group) Equal to 0
            Then - Actions
                Custom script:   call DestroyGroup(udg_CXPS_Temp_Group)
                Custom script:   call RemoveLocation(udg_CXPS_Temp_Point)
                Skip remaining actions
            Else - Actions
        -------- Search EXP value gained --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (CXPS_Temp_Unit is A Hero) Equal to True
            Then - Actions
                Set CXPS_Temp_Int = ((CXPS_HeroGain[(Hero level of CXPS_Temp_Unit)] x CXPS_Distribute[(Number of units in CXPS_Temp_Group)]) / 100)
            Else - Actions
                Set CXPS_Temp_Int = ((CXPS_UnitGain[(Level of CXPS_Temp_Unit)] x CXPS_Distribute[(Number of units in CXPS_Temp_Group)]) / 100)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Killing unit) belongs to an ally of (Triggering player)) Equal to True
            Then - Actions
                Set CXPS_Temp_Int = ((CXPS_Temp_Int x CXPS_Deny) / 100)
            Else - Actions
        -------- Control EXP buffs that modifies EXP gained by percentage and exact values --------
        -------- And input the received EXP --------
        Unit Group - Pick every unit in CXPS_Temp_Group and do (Actions)
            Loop - Actions
                Set CXPS_Temp_Unit = (Picked unit)
                Hero - Add CXPS_Temp_Int experience to CXPS_Temp_Unit, Show level-up graphics
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of All buffs considered Magic or physical on (Picked unit) (Exclude expiration timers, Include auras)) Equal to 0
                    Then - Actions
                        For each (Integer CXPS_PercentBuff_Loop) from 1 to CXPS_PercentBuff_Int, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (CXPS_Temp_Unit has buff CXPS_PercentBuff[CXPS_PercentBuff_Loop]) Equal to True
                                    Then - Actions
                                        Set CXPS_Temp_Int = (CXPS_Temp_Int / CXPS_PercentBuff_Bonus[CXPS_ExactBuff_Loop])
                                        Hero - Add CXPS_Temp_Int experience to CXPS_Temp_Unit, Show level-up graphics
                                    Else - Actions
                        For each (Integer CXPS_ExactBuff_Loop) from 1 to CXPS_ExactBuff_Int, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (CXPS_Temp_Unit has buff CXPS_ExactBuff[CXPS_ExactBuff_Loop]) Equal to True
                                    Then - Actions
                                        Set CXPS_Temp_Int = CXPS_ExactBuff_Bonus[CXPS_ExactBuff_Loop]
                                        Hero - Add CXPS_Temp_Int experience to CXPS_Temp_Unit, Show level-up graphics
                                    Else - Actions
                    Else - Actions
        -------- Clean leaks --------
        Custom script:   call DestroyGroup(udg_CXPS_Temp_Group)
        Custom script:   call RemoveLocation(udg_CXPS_Temp_Point)

AUTHOR NOTES
I hope this system can be useful for many mappers that need custom XP System
if you have suggestions, please tell, but do it politely
if you think this system sucks, give a reason, because saying this system sucks without reason won't help me improve this system.
~Daffa the Mage

Credits
Vladadamm : for his Tutorial, please CREDIT him if you use this system as he contribute much of the basics from his tutorial.
Doomlord & Almia : for their help cleaning and optimizing the codes in some parts.

Changelogs
11 March 2015 : Fixed an error with Denying.
30 July 2013 : Update with new stuffs.
15 July 2013 : Uploaded.
« Last Edit: March 11, 2015, 05:05:33 AM by Naoto Shirogane »

  • Rookie - level 3
  • ***
  • Posts: 123
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 3
  • A FRENGERS
    • View Profile
Custom XP System
« Reply #1 on: June 21, 2013, 08:11:03 PM »
Humm cool, so usefull ;) ;), but this is jass section :/ :/

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« Reply #2 on: June 21, 2013, 11:23:33 PM »
I know, dunno why Moyack move it here :S
seems this is also a system room :P

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 978
  • WC3 Models: 5
  • WC3 Tutorials: 11
  • WC3 Tools: 10
  • WC3 Maps: 11
  • WC3 Skins: 6
  • WC3 Icons: 2
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Custom XP System
« Reply #3 on: June 22, 2013, 09:48:51 AM »
I know, dunno why Moyack move it here :S
seems this is also a system room :P
Because I'm planning moving this board to the top category and centralize all the submission that implies a map in one place. All the creative work (models, skins, icons) will be managed in the media section.


We can give you full hosting for your projects. Not only a forum, a complete page!!.

A custom altered melee map where you can play Naga and Demons. Featuring a nice additions in features and game style. Check it out!!
Save your important files fast and easy

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« Reply #4 on: June 23, 2013, 03:06:05 AM »
I see, thanks for the info moyack! ;D

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 978
  • WC3 Models: 5
  • WC3 Tutorials: 11
  • WC3 Tools: 10
  • WC3 Maps: 11
  • WC3 Skins: 6
  • WC3 Icons: 2
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Custom XP System
« Reply #5 on: July 02, 2013, 12:02:35 PM »
BTW, Approved. It does what it means to do.


We can give you full hosting for your projects. Not only a forum, a complete page!!.

A custom altered melee map where you can play Naga and Demons. Featuring a nice additions in features and game style. Check it out!!
Save your important files fast and easy

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« Reply #6 on: July 07, 2013, 08:31:04 AM »
Thanks, going to find a better image and polish it  :D

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« Reply #7 on: July 30, 2013, 05:10:21 AM »
updated, adding a new "buff support" to the system, also added Vladadamm, Doomlord and Almia to the Credits.

  • Yatogami Tohka
  • Lurker - level 2
  • **
  • Posts: 2
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 1
  • "I am Yatogami Tohka"
    • View Profile
    • www.Hiveworkshop.com
Custom XP System
« Reply #8 on: July 31, 2013, 09:57:12 AM »
Vladadamm, Doomlord and Almia also.. nevermind
good job Daffa, err.. i mean Tosen Kaname  :P

  • Killjoy!? Who's making this epithet!?
  • Recognized User
  • Rookie - level 1
  • *
  • Posts: 59
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • Reputation: 4
  • The Famous Detective Prince
    • View Profile
Custom XP System
« Reply #9 on: July 31, 2013, 04:27:33 PM »
@Divine
Thanks :)

 

New Hero Selection System for version 1.6!!!

Started by SonofJayBoard General Information

Replies: 3
Views: 5378
Last post July 01, 2013, 03:59:31 PM
by Chaosy
Advanced AI system (AKA AMAI 2)

Started by moyackBoard Jass Theory & Questions

Replies: 6
Views: 12420
Last post September 06, 2012, 09:54:35 PM
by moyack
[System] Simulate 3D Sound

Started by PurgeandfireBoard Codes & Snippets

Replies: 7
Views: 13438
Last post July 15, 2013, 12:36:35 AM
by Purgeandfire
Advanced Streak System v4.3.0.0

Started by Magtheridon96Board JASS and vJASS Spells and Systems

Replies: 2
Views: 6681
Last post June 25, 2013, 08:54:56 PM
by LembidiZ
[System] ElapsedGameTime

Started by Magtheridon96Board Codes & Snippets

Replies: 0
Views: 6002
Last post January 11, 2012, 01:30:59 PM
by Magtheridon96
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!