• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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
104
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 15
Joined
Feb 7, 2020
Messages
398
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
104
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 15
Joined
Feb 7, 2020
Messages
398
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
104
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