Reduce damage [Trigger]

Ulla_t

Member
Reaction score
1
tutorial for reduce damage taken with a trigger? Or help?

-Thanks

Skill1
Events
Conditions
Actions
Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (0.03 x (Damage taken)))%

Trigger:
  • Lava
    • Events
    • Unit - A unit Is attacked
    • Conditions
    • ((Attacked unit) has buff Magma ) Equal to True
    • Actions
    • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))


i Know its pretty simple, but nothing is happening.
The healing part of the trigger looks a little wierd, its supposed to be healed in %, so i decieded, just healing 100% to see if it works, but it doesent, so i need some helpp.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
The event A unit Is attacked fires before the launching of the attack, so there's no damage done yet. Use a damage detection system to detect the moment an attack deals damage, and reduce it from there.

Also, try to use the edit button when making continuous posts. Too many replies by the same person make a thread look messy.
 

nLike

Member
Reaction score
1
Click on that damage detection system kaerfnomek posted and read that thread. You need damage system in order to do this.
 

nLike

Member
Reaction score
1
Trigger:
  • Ogre script
    • Events
    • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • GDD_DamagedUnit Equal to Centaur
    • Actions
    • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + (GDD_Damage x 0.30))


Centaur = Your unit

0.30 = 30% of the damage taken is healed back (the damage is reduced)
 

Ulla_t

Member
Reaction score
1
Trigger:
  • GDD Variable Creator
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set GDD_Event = 0.00
      • Set GDD_Damage = 0.00
      • Set GDD_DamagedUnit = No unit
      • Set GDD_DamageSource = No unit
      • Set GDD_TriggerArray[0] = (This trigger)
      • Set GDD__Integers[0] = 0
      • Set GDD__UnitArray[0] = No unit
      • Set GDD__LeftMapGroup = GDD__LeftMapGroup
 

Ulla_t

Member
Reaction score
1
Trigger:
  • Lava
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • ((Attacked unit) has buff Magma ) Equal to True
    • Actions
      • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
 

nLike

Member
Reaction score
1
Ok. Let's try like this. What kind of spell you had in mind? A spell that once casted on a unit it will reduce damage?

Write the skill you wanted to make and we will start from there.

P.S. You can't use Attacked Unit in this Event. Event for that is A unit is attacked. You have to use GDD_DamageSource or GDD_DamagedUnit.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Trigger:
  • Damage Reduction
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Magma ) Equal to True
    • Actions
      • Custom script: local unit DamagedUnit = udg_GDD_DamagedUnit
      • Custom script: set udg_TempUnit = DamagedUnit
      • Unit - Add Life Bonus (GDD) to TempUnit
      • Unit - Set life of TempUnit to ((Life of TempUnit) + GDD_Damage)
      • Wait 0.00 seconds
      • Custom script: set udg_TempUnit = DamagedUnit
      • Unit - Remove Life Bonus (GDD) from TempUnit
      • Custom script: set DamagedUnit = null

Life Bonus (GDD) is based off Item Life Bonus, and increases the unit's health by 10,000. This should prevent the unit from dying if the damage is higher than its maximum life.

Adding health immediately after the event runs seems to be too early for the damage to have been reduced from the unit's health. Adding a Life Bonus and removing it after the wait gets rid of this problem.
 
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