Creep XP

ryerye1996

Cool Member
Reaction score
5
i can't figure out how to change the amount of XP given from a creep. I also need to change the XP given depending on the hero's lvl. for example: a creep gives 100% XP when the hero is the same lvl as the creep, but when the hero is a higher level, the creep only gives 80% of the total XP.
Help is greatly appreciatted :)
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
It might not be the best, but if all your creeps are of the same level, you can just set exp gain to lower every time your hero levels up. if its not, maybe u might wanna try...

Event-
A unit attacks
Condition- attacking unit is a hero AND creep is lower lvl
Action- set exp gain lower

Event-
A unit attacks
Condition- attacking unit is a hero AND creep is higher level
Action- set exp gain higher

As i said, this might not be the best.
 

WilliamPa

Active Member
Reaction score
51
Actually normal options already have this feature, when hero is higher lvl he gains less exp from lower level monsters. Also, every level hero needs more exp to level up.
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
I think what the TO wants is a way to decrease the xp gained per level difference.

For example you are level 3 and kill a level 3 monster, you get 100%; if you are level 3 and kill a level 2 monster, you get 90%, etc. ...

This is NOT possible via gameplay constants, as the creep reduction tables only reduces xp gained by ALL LEVEL creeps.


You need to trigger your experience system, which is a good idea anyways, since the ordinary xp system sucks (more players = less xp fucks up multiplayer games)


Basicly, set the creep reduction table to one single value: 0 and then add to heroes experience manually when a creep dies.
 

StRoNgFoE.

New Member
Reaction score
9
Hey buddy, I understand these topics can be quite frustrating so I will post a trigger of mine that I use, that when a creep dies, a hero gains a certain amount of experience depending on the creep.

Code:
Experience
    Events
        Unit - A unit owned by Player 12 (Brown) Dies
        Unit - A unit owned by Player 11 (Dark Green) Dies
        Unit - A unit owned by Player 10 (Light Blue) Dies
        Unit - A unit owned by Player 9 (Gray) Dies
        Unit - A unit owned by Player 8 (Pink) Dies
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        (Killing unit) Equal to (Learning Hero)
    Actions
        If ((Unit-type of (Dying unit)) Equal to Scout lvl 1) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 20), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Scout (|cff00a800Unlimited|r) lvl 1) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 20), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Engineer lvl 2) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 30), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Engineer (|cff00a800Unlimited|r) lvl 2) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 30), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Barbarian lvl 4) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 40), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Barbarian (|cff00a800Unlimited|r) lvl 4) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 40), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Baby Dragon lvl 5) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 50), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Baby Dragon (|cff00a800Unlimited|r)) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 50), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Stalker lvl 6) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 60), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Stalker (|cff00a800Unlimited|r) lvl 6) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 60), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Water Runner) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 70), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Water Runner (|cff00a800Unlimited)|r) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 70), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Kodo Overlord) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 80), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Kodo Overlord (|cff00a800Unlimited|r)) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 80), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Wolf Rider lvl 9) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 85), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Wolf Rider (|cff00a800Unlimited|r) lvl 9) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 85), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Hovercraft lvl 11) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 90), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Hovercraft (|cff00a800Unlimited|r) lvl 11) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 90), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Goblin Machine lvl 12) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 100), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Goblin Machine (|cff00a800Unlimited|r) lvl 12) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 100), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Frosty Reptile lvl 13) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 110), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Frosty Reptile (|cff00a800Unlimited|r) lvl 13) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 110), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Demonic Pet lvl 14) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 115), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Demonic Pet (|cff00a800Unlimited|r) lvl 14) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 115), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Matured Dragon lvl 15) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 120), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Matured Dragon (|cff00a800Unlimited|r) lvl 15) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 120), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Ice Shard Golem lvl 16) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 130), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Ice Shard Golem (|cff00a800Unlimited|r) lvl 16) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 130), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Eternal Spirit lvl 17) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 140), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Eternal Spirit lvl 17 (|cff00a800Unlimited|r)) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 140), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Supply Tank lvl 18) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 150), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Supply Tank (|cff00a800Unlimited|r) lvl 18) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 150), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Walking Corpse lvl 19) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 160), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Walking Corpse (|cff00a800Unlimited|r) lvl 19) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 160), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Totem Carrier lvl 21) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 170), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Totem Carrier (|cff00a800Unlimited|r) lvl 21) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 170), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Unholy Knight lvl 22) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 180), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Unholy Knight (|cff00a800Unlimited|r) lvl 22) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 180), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Crystal Mage lvl 23) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 190), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Crystal Mage (|cff00a800Unlimited|r) lvl 23) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 190), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Frozen Infernal lvl 24) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 200), Show level-up graphics) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Frozen Infernal (|cff00a800Unlimited|r) lvl 24) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 200), Show level-up graphics) else do (Do nothing)

To customize it for a specific hero level, create a Integer Variable and set it to the hero's level and do something similar to this:

Code:
Hero Level
    Events
        Unit - A unit owned by Player 8 (Pink) Dies
    Conditions
        (Killing unit) Equal to (Learning Hero)
    Actions
        Set HeroLevel = (Hero level of (Learning Hero))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroLevel Equal to 1
            Then - Actions
                If ((Unit-type of (Dying unit)) Equal to Scout lvl 1) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 20), Show level-up graphics) else do (Do nothing)
            Else - Actions
                Do nothing

Note: You will need several of the actions that I have listed for every hero level and creep that is killed, it can turn out to be an extremely long GUI Trigger.

If you use JASS, here is the JASS code:

JASS:
Hero Level
    Events
        Unit - A unit owned by Player 8 (Pink) Dies
    Conditions
        (Killing unit) Equal to (Learning Hero)
    Actions
        Set HeroLevel = (Hero level of (Learning Hero))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroLevel Equal to 1
            Then - Actions
                If ((Unit-type of (Dying unit)) Equal to Scout lvl 1) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 20), Show level-up graphics) else do (Do nothing)
            Else - Actions
                Do nothing



JASS:
Hero Level
    Events
        Unit - A unit owned by Player 8 (Pink) Dies
    Conditions
        (Killing unit) Equal to (Learning Hero)
    Actions
        Set HeroLevel = (Hero level of (Learning Hero))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroLevel Equal to 1
            Then - Actions
                If ((Unit-type of (Dying unit)) Equal to Scout lvl 1) then do (Hero - Set (Killing unit) experience to ((Hero experience of (Killing unit)) + 20), Show level-up graphics) else do (Do nothing)
            Else - Actions
                Do nothing




I hope that helped you, feel free to contact me personally if you have any more trouble :D
 

Lamby

New Member
Reaction score
6
I would suggest getting a formula that can work across the levels, here's an example of a basic system for this:
Trigger:
  • Experience
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) controller) Not equal to User
      • ((Owner of (Killing unit)) controller) Equal to User
      • Actions
        • Hero - Add ((Level of (Dying unit)) x 5) experience to (Killing unit), Show level-up graphics


You can add a reduction percentage by multiplying that by the percentage in decimal form (XY%=.XY) But that will require a lot more triggers, unless the reduction percentage is ((Hero Level-Creep Level)/100). Basically, there's no way I can think of to do it without a lot of triggering.

Also, strongfoe, you used gui tags on your jass triggers, or just forgot to actually put jass.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top