• 🏆 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!

Increase level of ability when unit enters region

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
  • All bonus
    • Events
      • Unit - A unit enters EastCreepSpawn <gen>
      • Unit - A unit enters NorthCreepSpawn <gen>
      • Unit - A unit enters SouthCreepSpawn <gen>
      • Unit - A unit enters WestCreepsSpawn <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • -------- Difficuly_i is an integer --------
      • -------- That counts the level of diffculty --------
      • -------- Set creep damage --------
      • Unit - Add Difficulty Attack Bonus (-10/-5/+-0/+10/+20/30 to (Triggering unit)
      • Unit - Set level of Difficulty Attack Bonus (-10/-5/+-0/+10/+20/30 for (Triggering unit) to Difficulty_i
      • -------- Set creep hp --------
      • -------- It increreases the level correctly --------
      • -------- But the bonus remains at -100 --------
      • Unit - Add Difficulty Life Bonus (-100/-50/0/+100/+200/+300) to (Triggering unit)
      • Unit - Set level of Difficulty Life Bonus (-100/-50/0/+100/+200/+300) for (Triggering unit) to Difficulty_i
      • Game - Display to (All players) the text: (String((Level of Difficulty Life Bonus (-100/-50/0/+100/+200/+300) for (Triggering unit))))
Hello again. This has some weird interaction, because it does increase the level of ability Difficulty Life Bonus, but the life bonus remains at -100. I attached a picture of object editor data.

And the Difficulty Damage Bonus works as should.
 

Attachments

  • Image2.png
    Image2.png
    38 KB · Views: 19
Level 39
Joined
Feb 27, 2007
Messages
5,011
A quirk about the health bonuses is that if you remove the ability it will remove the amount of health it should have added for that level (even though it only added level 1’s health and nothing else). This is how BonusMod worked.
 
Level 12
Joined
Feb 5, 2018
Messages
521
It's fine for me thought. I'm not going to remove the ability. I just add the ability once. Made 12 different health bonus abilities and now the trigger runs as should. :)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Not sure if it applies here, but I just learned about this like a week ago. You can "refresh" an item ability by increasing it's level and then decreasing it.
Example:
  • Unit - Set level of Your Item Ability for (Triggering unit) to 2
  • Unit - Set level of Your Item Ability for (Triggering unit) to 1
And here's an example using a Set Ability Integer action. Without the "refresh" this trigger wouldn't work.
  • Increase Item Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test
    • Actions
      • Set i = (i + 1)
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Damage Bonus )'s Integer Level Field: Attack Bonus ('Iatt') of Level: 0 to i
      • Unit - Set level of Damage Bonus for (Triggering unit) to 2
      • Unit - Set level of Damage Bonus for (Triggering unit) to 1
In this case the level 1 and 2 of the Damage Bonus ability is set to add 0 damage in the Object Editor.

Edit:
@Pyrogasm
Yeah, the life bonus ability doesn't work. I guess it can't have more than 1 level, shame.
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
I just hard triggered it like this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Difficulty_i Equal to 0
    • Then - Actions
      • Unit - Add Difficulty Life Bonus (Level1/-100) to (Triggering unit)
    • Else - Actions
And so on
 
Status
Not open for further replies.
Top