• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Stop experience gain if heros level is 2 above dying unit

Status
Not open for further replies.
Level 6
Joined
Aug 27, 2013
Messages
103
I am making rpg map, so to avoid leveling in weaker region, i want to force players to go in stronger regions. So i want example if my hero is level 4, than creeps with level 2 or less don't give experience to hero.

  • xp
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Dying unit)) Less or equal than ((Hero level of (Killing unit)) - 2)
        • Then - Actions
        • Else - Actions
I pictured something like this, but don't know how to deny xp gain
 
Last edited:
Level 14
Joined
Feb 7, 2020
Messages
387
The default XP constants are a bit limited. They typically require static constraints such as the creep XP gained table.

I would disable the default XP system entirely and add experience with your own formula, and include the 2 level exclusion into that trigger's logic.

This would also open up the options for you to add in boss-specific XP logic, etc.
 
Level 6
Joined
Aug 27, 2013
Messages
103
The default XP constants are a bit limited. They typically require static constraints such as the creep XP gained table.

I would disable the default XP system entirely and add experience with your own formula, and include the 2 level exclusion into that trigger's logic.

This would also open up the options for you to add in boss-specific XP logic, etc.
you mean like to make trigger for every level to add certain amount of xp, so i can limit it if hero level is higher
 
Level 14
Joined
Feb 7, 2020
Messages
387
you mean like to make trigger for every level to add certain amount of xp, so i can limit it if hero level is higher
Yep:

  • Add Hero XP
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set VariableSet temppoint = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of temppoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Picked unit)) Less than or equal to ((Level of (Triggering unit)) + 2)
                • Then - Actions
                  • Hero - Add (10 x (Level of (Triggering unit))) experience to (Picked unit), Show level-up graphics
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_temppoint)
 
Level 6
Joined
Aug 27, 2013
Messages
103
Yep:

  • Add Hero XP
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set VariableSet temppoint = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of temppoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Picked unit)) Less than or equal to ((Level of (Triggering unit)) + 2)
                • Then - Actions
                  • Hero - Add (10 x (Level of (Triggering unit))) experience to (Picked unit), Show level-up graphics
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_temppoint)
i will try this, thanks
 
Status
Not open for further replies.
Top