Power Shield

TzalDadok

New Member
Reaction score
2
I can't add a specific unit event in the trigger. The only possibility is if I select a unit from the map.
 

TzalDadok

New Member
Reaction score
2
Thanks for all the help. Finnally is working :D

Thanks KaerfNomekop, GFreak45 and all others.

This is how is working (I know is not the best way to do it, but i'll leave it like this :p):

Trigger:
  • Power Shield
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Shield
    • Actions
      • Set PowerShield_Caster = (Casting unit)
      • Set PowerShield_Target = (Target unit of ability being cast)
      • Unit - Create 1 Dummy for Player 1 (Red) at (Position of PowerShield_Target) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror
      • Unit - Remove (Last created unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Power Shield for PowerShield_Caster) Equal to 1
        • Then - Actions
          • Set PowerShield_ShieldLife = 200.00
          • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 15.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PowerShield_TakesDamageEvent Equal to False
            • Then - Actions
              • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
              • Set PowerShield_TakesDamageEvent = True
            • Else - Actions
              • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Power Shield for PowerShield_Caster) Equal to 2
            • Then - Actions
              • Set PowerShield_ShieldLife = 300.00
              • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 20.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PowerShield_TakesDamageEvent Equal to False
                • Then - Actions
                  • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                  • Set PowerShield_TakesDamageEvent = True
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Power Shield for PowerShield_Caster) Equal to 3
                • Then - Actions
                  • Set PowerShield_ShieldLife = 400.00
                  • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 25.00 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PowerShield_TakesDamageEvent Equal to False
                    • Then - Actions
                      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                      • Set PowerShield_TakesDamageEvent = True
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Set PowerShield_ShieldLife = 500.00
                  • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 30.00 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PowerShield_TakesDamageEvent Equal to False
                    • Then - Actions
                      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                      • Set PowerShield_TakesDamageEvent = True
                    • Else - Actions
                      • Do nothing


Trigger:
  • Power Shield Activate
    • Events
    • Conditions
      • (PowerShield_Target has buff Power Shield ) Equal to True
    • Actions
      • Unit - Set life of PowerShield_Target to ((Life of PowerShield_Target) + (Damage taken))
      • Set PowerShield_ShieldLife = (PowerShield_ShieldLife - (Damage taken))


Trigger:
  • Power Shield DeActivate 1
    • Events
      • Game - PowerShield_ShieldLife becomes Less than or equal to 0.00
    • Conditions
    • Actions
      • Unit - Remove Power Shield buff from PowerShield_Target


Trigger:
  • Power Shield DeActivate 2
    • Events
      • Time - PowerShield_Timer expires
    • Conditions
    • Actions
      • Unit - Remove Power Shield buff from PowerShield_Target
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
does a max of 1 unit at a time get this ability?
and np :)

Trigger:
  • Power Shield
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Shield
    • Actions
      • Set PowerShield_Caster = (Casting unit)
      • Set PowerShield_Target = (Target unit of ability being cast)
      • Unit - Create 1 Dummy for Player 1 (Red) at (Position of PowerShield_Target) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror
      • Unit - Remove (Last created unit) from the game
      • Set PowerShield_ShieldLife = 100.00 + (100.0 x Real(Level of ability cast for triggering unit)
      • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in (10.0 + (5.0 x Real(Level of ability cast for triggering unit) seconds


Trigger:
  • Add Damage Event
    • Events
      • A unit learns an ability
    • Conditions
      • Ability learned is equal to (your ability)
    • Actions
      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)


thats how i would do it, MUCH smaller and it only adds the event once no matter what
(for first trigger that is)
 

TzalDadok

New Member
Reaction score
2
Are you telling me that those two triggers are the same that all mine? I can't find the "A unit learns an ability" event.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
its under hero or something like that, and those 2 should be a replacement for the large first trigger
instead of doing 5x for level 4, 4x for level 3 and all that, it just adds the level of the ability x something to each
for the Real(level of ability) stuff, thats an integer to real conversion
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you would need a unit index, basically a system that assigns an unused integer to every unit that enters the map, so that it can be referenced in variable indexes using that integer, basically doing Variable[Unit], or assigning IDs to every unit, that way you can use that to check if that unit has it added already, but mine would do it i think, if you have the unit learns an ability event, because they should only learn it once, right?
 

vypur85

Hibernate
Reaction score
803
This seems like a targeted ability, I believe.

There's a crude workaround though. Using Berserk.

Code:
    Power Shield
        Events
            [B]Unit - A unit Starts the effect of an ability[/B]
        Conditions
            (Ability being cast) Equal to Power Shield
        Actions
            Set PowerShield_Caster = [B](Triggering unit)[/B]
            Set PowerShield_Target = (Target unit of ability being cast)
            Unit - Add Berserk to PowerShield_Target
            Unit - Set level of Berserk PowerShield_Target to level of Berserk of PowerShield_Caster
            Unit - Order PowerShield_Target to cast Berserk
            Unit - Remove Berserk from PowerShield_Target

You will need to set the 'Damage taken' field in Berserk to a negative value to allow the damage to be absorbed.
One flaw is that this will stop the targeted unit's current order.

As for your problem for event stacking, store the units into unit groups to prevent multiple stacking.
For example,
Code:
Condition
 YourUnit is in SomeUnitGroup Equal to False <-- [I]A boolean[/I]
Then - actions
 Unit group - Add YourUnit to SomeUnitGroup
 Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top