Tower get bonus damage when attacking the same target 5 times in a row (help)

Exoudar

New Member
Reaction score
2
Hello there, I managed to make my tower get bonus damage, speed and anything after attacking the same target 5 times, and if it change the target the bonus will be lost, Also if it attacks any target 3 times then start to another target it will have to build 5 attacks and not to continue from the 3 attacks.

What do I need?

the trigger I made is very complicated and needs a lot of times and actions.

Here's how I did it :

First I need to set my targets.

Trigger:
  • Setting Targets
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to Player 12 (Brown)
      • (Unit-type of (Attacking unit)) Equal to Sniper Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 0
        • Then - Actions
          • Set Sniper_Aim[1] = (Attacking unit)
          • Set Sniper_Target = 1
          • Set Sniper_Targ[1] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 1
          • (Attacking unit) Not equal to Sniper_Aim[1]
        • Then - Actions
          • Set Sniper_Aim[2] = (Attacking unit)
          • Set Sniper_Target = 2
          • Set Sniper_Targ[2] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 2
          • (Attacking unit) Not equal to Sniper_Aim[1]
          • (Attacking unit) Not equal to Sniper_Aim[2]
        • Then - Actions
          • Set Sniper_Aim[3] = (Attacking unit)
          • Set Sniper_Target = 3
          • Set Sniper_Targ[3] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 3
          • (Attacking unit) Not equal to Sniper_Aim[1]
          • (Attacking unit) Not equal to Sniper_Aim[2]
          • (Attacking unit) Not equal to Sniper_Aim[3]
        • Then - Actions
          • Set Sniper_Aim[4] = (Attacking unit)
          • Set Sniper_Target = 4
          • Set Sniper_Targ[4] = (Attacked unit)
        • Else - Actions



And then the trigger:

Trigger:
  • Carful Aim
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to Player 12 (Brown)
      • (Unit-type of (Attacking unit)) Equal to Sniper Tower
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to Sniper_Aim[(Integer A)]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Attacked unit) Equal to Sniper_Targ[(Integer A)]
                • Then - Actions
                  • Wait 0.40 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Attacking unit)) Less than or equal to 4
                    • Then - Actions
                      • Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
                    • Else - Actions
                • Else - Actions
                  • Unit - Set the custom value of (Attacking unit) to 0
                  • Unit - Remove Item Damage Bonus (+10) from (Attacking unit)
                  • Unit - Remove Carful Aiming (Sniper Tower) from (Attacking unit)
              • Wait 0.30 seconds
              • Set Sniper_Targ[(Integer A)] = (Attacked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Attacking unit)) Equal to 3
        • Then - Actions
          • Wait 0.40 seconds
          • Unit - Add Item Damage Bonus (+10) to (Attacking unit)
          • Unit - Add Carful Aiming (Sniper Tower) to (Attacking unit)
        • Else - Actions



My problem is with the first trigger (Setting targets), It requires a lot of actions, If the player need to make 10 towers, then I have to set 10 targets, and look how big it is with 4 targets only, now lets assume the player will make infinite towers :(


the second trigger is fine, please help with the first one.
 

Inflicted

Currently inactive
Reaction score
63
Good timing, I'm actually in the process of making a system/spell which is of the same effect called Empowered Strikes. Using Hashtables to make it MUI.

If I complete it, then I will make a demo map for you that is adjusted to work for only your type of unit.

Here is the link to my Thread: Empowered Strikes Hashtable In Process

Only difference is that my additional damage is dealt in magic damage, do you want it to be added and display the additional value (eg +100)?
That might actually be much easier. I can do that in like 20 minutes if that's what you want.


Okay i had time, so I did a quick version. I know it does not implement a GDD system, but for a simple usage, this is effective.

Trigger:
  • Create hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable


Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 5
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


+10 d p/l - Ability, Based off Item Damage Base.
Increases by 10 per level.

Easy to implement, copy from my map and adjust values.
Hope this helps.
 

Attachments

  • Tower Attack Spell.w3x
    8.8 KB · Views: 130

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
why dont you just base it off incinerate? its a simple ability that adds stacking damage every time the owning unit deals damage with an attack
 

Exoudar

New Member
Reaction score
2
Good timing, I'm actually in the process of making a system/spell which is of the same effect called Empowered Strikes. Using Hashtables to make it MUI.

If I complete it, then I will make a demo map for you that is adjusted to work for only your type of unit.

Here is the link to my Thread: Empowered Strikes Hashtable In Process

Only difference is that my additional damage is dealt in magic damage, do you want it to be added and display the additional value (eg +100)?
That might actually be much easier. I can do that in like 20 minutes if that's what you want.

Yes I want the tower to get something like +10 bonus damage, but only if it attacks the same target 5 times and the bonus will be removed if it change the target.

why dont you just base it off incinerate? its a simple ability that adds stacking damage every time the owning unit deals damage with an attack

Incinerate does add damage for each hit and not after 5 hits, also incinerate makes the target explode (or removed)
 

Inflicted

Currently inactive
Reaction score
63
kay, i adjusted the base to be 0.

Therefore now it has 6 levels.
0/10/20/30/40/50 bonus damage

@GFreak45 - he wants it to show the increase amount i think

Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 6
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


Try this demo map:
 

Attachments

  • Tower Attack Spell #2.w3x
    8.7 KB · Views: 122

Exoudar

New Member
Reaction score
2
kay, i adjusted the base to be 0.

Therefore now it has 6 levels.
0/10/20/30/40/50 bonus damage

@GFreak45 - he wants it to show the increase amount i think

Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 6
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


Try this demo map:

Sir, thank you so much, you saved me alot of time and work, THANK YOU :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top