[trigger=Armor System Event]Armor System Event
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Check Armor
Actions
Trigger - Turn on Armor System Core <gen>
-------- Set Restoring Value --------
Set Unit = (Target unit of ability being cast)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Size of inventory for (Target unit of ability being cast)) Greater than or equal to 1
Then - Actions
Hero - Create Increases Hp + 1000 and give it to (Target unit of ability being cast)
Else - Actions
Unit - Add Inventory Custom to (Target unit of ability being cast)
Hero - Create Increases Hp + 1000 and give it to (Target unit of ability being cast)
Unit - Remove Inventory Custom from (Target unit of ability being cast)
Set Real[5] = (Percentage life of (Target unit of ability being cast))
Unit - Set life of (Target unit of ability being cast) to 100.00%
Unit - Cause Unit to damage Unit, dealing 50.00 damage of attack type Chaos and damage type Normal
Set Integer = 0
[/trigger]
[trigger=Armor System Core]Armor System Core
Events
Conditions
Actions
Trigger - Turn off (This trigger)
-------- Set Damage Taken for heal --------
Set Real[1] = (Damage taken)
-------- Get unit real reduction (In %) --------
Set Real[2] = ((2.00 x (50.00 - (Damage taken))) / 100.00)
-------- Get unit Armor --------
Set Real[3] = ((Real[2] / (1.00 - Real[2])) / 0.06)
-------- Start Timer that will heal unit (Couse damage that unit have take) --------
Countdown Timer - Start Timer as a One-shot timer that will expire in 0.00 seconds
Set Real[4] = (Real[2] x 100.00)
[/trigger]
[trigger=Armor System Restore]Armor System Restore
Events
Time - Armor_Timer expires
Conditions
Actions
-------- Heal Unit --------
Unit - Set life of Armor_Unit[1] to Armor_Real[5]%
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Size of inventory for Armor_Unit[1]) Greater than or equal to 1
Then - Actions
Hero - Create Increases Hp - 1000 and give it to Armor_Unit[1]
Else - Actions
Unit - Add Inventory Custom to Armor_Unit[1]
Hero - Create Increases Hp - 1000 and give it to Armor_Unit[1]
Unit - Remove Inventory Custom from Armor_Unit[1]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Armor_Spell_ID Equal to 0
Then - Actions
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: (|cffFFCC00Unit Armor |r: + (String(Armor_Real[3])))
Game - Display to (All players) the text: (|cffFFCC00Unit Reduction |r: + (String(Armor_Real[4])))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Armor_Spell_ID Equal to 1
Then - Actions
Countdown Timer - Start Armor_Timer_2 as a One-shot timer that will expire in 0.00 seconds
Else - Actions
[/trigger]
Example :
[trigger=Shield Bash Init]Shield Bash Init
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Shield Bash
Actions
Trigger - Turn on Armor System Core <gen>
-------- Set All Informations --------
Set Armor_Unit[1] = (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Size of inventory for (Triggering unit)) Greater than or equal to 1
Then - Actions
Hero - Create Increases Hp + 1000 and give it to (Triggering unit)
Else - Actions
Unit - Add Inventory Custom to (Triggering unit)
Hero - Create Increases Hp + 1000 and give it to (Triggering unit)
Unit - Remove Inventory Custom from (Triggering unit)
Set Armor_Real[5] = (Percentage life of (Triggering unit))
Unit - Set life of (Triggering unit) to 100.00%
Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 50.00 damage of attack type Chaos and damage type Normal
Set Armor_Spell_ID = 1
Set Armor_Unit[2] = (Target unit of ability being cast)
[/trigger]
[trigger=Shield Bash Effect]Shield Bash Effect
Events
Time - Armor_Timer_2 expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of Armor_Unit[2]) Greater than (2.00 x Armor_Real[3])
Then - Actions
-------- Direct remove Hp --------
Unit - Set life of Armor_Unit[2] to ((Life of Armor_Unit[2]) - (Armor_Real[3] x 2.00))
Else - Actions
-------- Kill unit --------
Unit - Cause Armor_Unit[1] to damage Armor_Unit[2], dealing 9999999.00 damage of attack type Spells and damage type Normal
Floating Text - Create floating text that reads (String((Integer((2.00 x Armor_Real[3]))))) above Armor_Unit[2] with Z offset 30.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
[/trigger]