Attack bonus based on nearby enemy buff

Kahiera

Active Member
Reaction score
9
Trigger:
  • Earthquake War Stomp
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Earthquake
          • (Ability being cast) Equal to War Stomp
    • Actions
      • Set SA_Int = (Player number of (Owner of (Triggering unit)))
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Earthquake (TC)) Equal to True
                      • ((Picked unit) has buff Earthquake (TC)) Equal to True
                      • ((Picked unit) has buff War Stomp (TC)) Equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to SA_Units[SA_Int]
            • Else - Actions

Trigger:
  • Shock Absorber
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Shock Absorber
    • Actions
      • Set SA_Int = (Player number of (Owner of (Triggering unit)))
      • Set SA_Caster[SA_Int] = (Casting unit)
      • Unit - Add Disable to SA_Caster[SA_Int]
      • Unit - Set level of Shock Absorber (Buff) for SA_Caster[SA_Int] to (Number of units in SA_Units[SA_Int])
      • Wait (5.00 x (Real((Level of Shock Absorber for SA_Caster[SA_Int])))) seconds
      • Unit - Remove Disable from SA_Caster[SA_Int]

the first trigger is supposed to pick every unit effected by War Stomp or Earthquake and adds them to a unit group.
the second trigger is supposed to give +2 damage for each unit in the unit group (each level of "Shock Absorber (Buff)" gives +2 damage.

the problem is, the unit group doesn't add every unit it's supposed to... when there's no nearby units, my hero still gets +2 damage. and sometimes the math doesn't work right and i get +8 for 2 units.
can anyone shed some light onto me on how to fix this?
 

Rainther

I guess I should write something of value here...
Reaction score
61
Your Wait action might be the villain in some parts.
And a function such as this is really alot easier to make in Jass. GUI just confuses me.
 

Rainther

I guess I should write something of value here...
Reaction score
61
Are you having a sole ability and you set level on it to receive + damage?
lvl 1 - 2 dmg
lvl 2 - 4 dmg
etc.?
 

Kahiera

Active Member
Reaction score
9
what i want is an active, no target ability based on channel, that when casted, for every enemy unit, stunned by War Stomp or Earthquake, will give the casting hero +2 damage each for 5 seconds X level of the channel spell

1 unit - 2 damage
2 units - 4 damage
... - ...
30 units - 60 damage

(30 unit max)
 

Rainther

I guess I should write something of value here...
Reaction score
61
And how do you add the damage? Through the use of the ability Disable?
 

Kahiera

Active Member
Reaction score
9
yes... "Disable" is the name i assigned the spellbook that was disabled at map initialization that holds the damage bonus spell
 

Rainther

I guess I should write something of value here...
Reaction score
61
Clear the unit group after setting the ability level, even better just store the number of units in the group instead of the entire unit group. Are your use of all the If's are kinda overkill.
 

Kahiera

Active Member
Reaction score
9
but if jass would be easier, what would the whole trigger look like?
i have high blood sugar right now so i can't think straight... and i'm tired too sorry... :(
 

Rainther

I guess I should write something of value here...
Reaction score
61
Am occupied atm, so anyone else could gladly interfere.
 

TheCrystal

New Member
Reaction score
36
That does seem odd.
Dummyunits?
Use a Unit Group and do
Units in Playable Map Area matching (Owner of (Matching Unit) is an ally of (Owner of (Triggering Unit)) == False, which lowers one condition in the huge if.
 

TheCrystal

New Member
Reaction score
36
Put messages throughout both triggers to see specifically where it's messing up, just in case it's somehow messing up with the ability of +damage or it's adding too many units.
 

X.Terror.X

New Member
Reaction score
10
are all spells the same aeo?
then you just pick the aeo on casted point or on caster and put that too unit group
 

Kahiera

Active Member
Reaction score
9
no they're not all the same aoe... WS is 250 and Earthquake is 500/625/750 aoe

is anybody willing to try this from scratch? it's got me beat
 
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