Increase level of ability when unit enters region

Status
Not open for further replies.
Level 13
Joined
Feb 5, 2018
Messages
554
  • 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: 23
Level 13
Joined
Feb 5, 2018
Messages
554
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 72
Joined
Aug 10, 2018
Messages
7,648
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 13
Joined
Feb 5, 2018
Messages
554
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