[Solved] Ability with Trigger Issue

Status
Not open for further replies.
Level 8
Joined
Jun 26, 2019
Messages
318
I am trying to make a custom ability to be only controlled by trigger to increasing the damage of unit every time this unit destroyed a structure. Let's say, there's 6 demon gates need to be destroyed, each demon gate will increase 5 damage bonus to all units, when one of units destroyed one demon gate, all units get increased 5 damage bouns to all units, like upgrade Iron Forged Sword to Footmen, and after destroyed 6 demon gates, that would be 5 + 6 = 30, right? How do I make trigger to do this? Thanks.
 
Level 8
Joined
Jun 26, 2019
Messages
318
So. Nobody knows anything about this one? Let me explain clearly in pictures.

6 towers. When a footman with machine gun destroyed one tower, I want a special ability or upgrade with trigger to automatically increase 5 damage base bonus to this footman and all units of the team too, after destroyed one tower, and there are 5 towers more to go, after destroyed 5 towers, total of damage base bonus is 30, like upgraded Iron Forged Sword or Trueshot Aura. How can I do this in trigger with "Unit Dies" event and "Unit is dead equal to true" condition?

upload_2019-12-15_0-16-27.png


upload_2019-12-15_0-4-43.png



upload_2019-12-15_0-11-55.png


upload_2019-12-15_0-14-52.png
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,268
A unit enters map -> Put your conditions here to check if the unit should gain bonus damage -> Add entering unit to SomeUnitGroup.

A unit dies -> Dying unit-type equal to Demon Gate -> Pick every unit in "SomeUnitGroup" and add "+5 damage" ability to picked unit.

SomeUnitGroup = Unit Group that contains all of the eligible units
+5 damage = Item ability like Claws of Attack's ability
 
Level 42
Joined
Feb 27, 2007
Messages
5,265
No need to do anything like what Uncle suggested, it can be simpler. Make an upgrade that works like Iron Forged Swords. Give all units that should get this bonus damage this upgrade but don't make it purchasable from any building. Any time a demon gate dies increase the level of the upgrade.
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit type of (Triggering Unit)) equal to Demon Gate
  • Actions
    • Player - Set level of DEMON_DAMAGE for Player 2 (Blue) to ((Level of DEMON_DAMGE for Player 2 (Blue)) + 1)
 
Level 9
Joined
Jul 30, 2018
Messages
445
Please, don't post multiple times in a row. Edit your old post.

And yes, it depends which one you use: either add the unit an ability that increases damage or use upgrades. But the examples you posted should work.
 
Level 8
Joined
Jun 26, 2019
Messages
318
Okay, I got it now. But, the problem is... this Trueshot Aura ability can only increase up to 10... I want more than 10... what kind of ability that can increase your damage base to more than 10? Like 50, 100, 150, etc?

For upgrades, I don't know how to do it in the way I just did on ability. How do I do it for upgrade? :/
 
Level 42
Joined
Feb 27, 2007
Messages
5,265
I just guessed as to the wording. I was close but it wasn't 100% what the game shows. Calm down. Yes it is the current research level action... for fuck's sake use your brain.

There's no limit on the damage bonus of Trueshot Aura. It's a % bonus. If you want a flat bonus use Command Aura.
 
Level 9
Joined
Jul 30, 2018
Messages
445
A better way is to make a custom ability based on the Item Damage Bonus. Then give it multiple levels, each with different damage bonuses. Level 1: 0 dmg, Level 2: +5 dmg, Level 3: +10 dmg, Level 4: +15 dmg, etc. Then in the trigger increase the level just like you increased the level of Trueshot Aura.
 
Level 8
Joined
Jun 26, 2019
Messages
318
upload_2019-12-15_3-22-10.png


upload_2019-12-15_3-22-33.png


I tested this and it worked out beautiful. One and same trigger won't work because it don't have arithmetic. So I had to create 2 triggers with different object ID for Item Damage Bonus to work like arithmetic, and it worked. Now I have to make 6 Item Damage Bonus abilities with same number of 15 damage bonus increase, but different object ID on each. :)
 
Level 8
Joined
Jun 26, 2019
Messages
318
I guess I have to do upgrade or ability aura. I don't know how to do it on either that that works like the way I just created with Item Damage Bonus. The trueshot aura can only increase up to 10. I dont know what ability that can increase damage base more than 10. I like upgrade, but how do I do it with upgrade like I just did with Item Damage Bonus? Wait. Is it command aura? I am gonna try this one.
 
Level 42
Joined
Feb 27, 2007
Messages
5,265
Crap... I have one more problem... while all the units that are in the game before destroyed towers still got the item damage bonus, but when creating new units out of barracks, they still dont get damage bonus........................
Seriously use your brain. You're only giving the damage bonus to units that exist when the towers are destroyed. This is why I told you to use an upgrade, because it will apply to all units regardless of when they enter the map.
 
Level 9
Joined
Jul 30, 2018
Messages
445
It isn’t really that hard... Just look around and check how the default upgrades work.

1. Make an upgrade that gives bonus damage and make each level increase the damage more.

2. Add the upgrade to ”Upgrades Used” field on the Object Editor to all the units you want to have the damage bonus.

3. Make a trigger with event: A unit dies. Condition: (Unit-type of (Triggering Unit)) equal to Demon Gate. Actions: Player - Set Current Research level of (Your Upgrade) to (Current Research level of (Your Upgrade) for (Owner of (Killing Unit)) + 1) for (Owner of (Killing Unit))
 
Last edited:
Status
Not open for further replies.
Top