• 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.

Hero level up finding

Status
Not open for further replies.
Level 4
Joined
Aug 15, 2010
Messages
53
Hi, I have a little question.

How can I find Hero levels?
for example; Heroes sometimes rise to levels 2 or 3 instead of 1 when they gain more experience than necessary. But with trigger I can not determine this. For example, if the hero gets up every level I want to give 3 lumber, but if it goes up 2 levels it gives 3 again.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
You could record the last level of the hero...
Something of the sort of the following, but you'll have to index your heroes:
  • Events
    • Hero gains a level
  • Conditions
  • Actions
    • Set var_curretLevel = current level of triggering unit
    • Set var_levelDifference = var_currentLevel - var_HeroLastLevel[indexOfHero]
    • Set var_WoodToGive = var_LevelDifference * 3
    • Give var_WoodToGive to triggering player
    • Set var_HeroLastLevel[indexOfHero] = var_curretLevel
Edit: @Abovegame well, that was fast...
 
Last edited:
Status
Not open for further replies.
Top