Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

Custom XP System No New Posts Warcraft III Spells and Systems

Started by
Naoto Shirogane

0 Members and 1 Guest are viewing this topic.

Rating

Average Score - 4 / 5

« Created: February 02, 2018, 10:00:34 PM by moyack »

Custom XP System
on: June 21, 2013, 05:45:01 AM
Categories: System, GUI
Rating: 4
Warcraft III Spell resource
« Created: February 02, 2018, 10:00:16 PM by moyack »

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
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 --------
 
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: February 02, 2018, 10:00:16 PM by moyack »



Custom XP System
Reply #1 on: June 21, 2013, 08:11:03 PM

Humm cool, so usefull ;) ;), but this is jass section :/ :/



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



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.


Custom XP System
Reply #4 on: June 23, 2013, 03:06:05 AM

I see, thanks for the info moyack! ;D



Custom XP System
Reply #5 on: July 02, 2013, 12:02:35 PM

BTW, Approved. It does what it means to do.


Custom XP System
Reply #6 on: July 07, 2013, 08:31:04 AM

Thanks, going to find a better image and polish it  :D



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.



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



Custom XP System
Reply #9 on: July 31, 2013, 04:27:33 PM

@Divine
Thanks :)



Re: Custom XP System
Reply #10 on: March 11, 2015, 05:07:12 AM

Alright, found an issue with denying, I wrote 0 on the comment instead of 100, duh :/
I have plans for major overhaul for the whole code.



 

* Random Spells & Systems

Started by cohadar

Replies: 0
Views: 2097
Codes & Snippets

Started by ashujon

Replies: 0
Views: 3046
Warcraft III Spells and Systems

Started by azlier

Replies: 0
Views: 1852
Codes & Snippets

Started by Magtheridon96

Replies: 0
Views: 2078
Codes & Snippets

Started by moyack

Replies: 6
Views: 19095
Codes & Snippets
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...