• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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