• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Direct the damage to an specific unit.

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I'm want to make a spell that I have no knowledge of :ogre_hurrhurr:

The spell will summon a unit at the targeted location, the unit is untargetable, cannot move and attack, has 300 health (+ 200 health per level) and will last for 7 seconds (+ 1 second per level) that's the easy part and no need to trigger.

The part that I have no knowledge of is absorbing the damage. The summoned unit will absorb 10% (+ 10% per level) all damage dealt to allied heroes nearby 400 yards. When the summoned unit dies due to absorbing too much damage or expires, the summoned unit will explode. Deals damage equivalent to the amount of damage the summoned unit has taken + 50% of the hero's INT to enemies nearby 500 yards.

I need help creating this spell in GUI and is this spell even possible to make :vw_wtf:
 
Level 11
Joined
Dec 19, 2012
Messages
411
It definitely possible to make. Such spell would probably requires a DDS for accurate damage obtaining. The idea should be :

1. An allied hero get damaged
2. Obtain damage taken
3. Let dummy hp - damage taken
4. Here come 2 conditions : either dummy unit hp will > 0, or <=0, so

For the part hp <= 0 :
1. Set the allied hero hp = hp - (damage taken - initial life of dummy hp)
3. Explode the dummy and dealing damage to any unit inside range (damage amount i assume you know how to make it)

For the part hp > 0 :
1. Set allies hero hp = hp + damage taken

And 1 more condition - If dummy expired :
1. Set dummy hp lost = max hp of dummy - initial hp of dummy
2. Explode the dummy and dealing damage to nearby units
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
It definitely possible to make. Such spell would probably requires a DDS for accurate damage obtaining. The idea should be :

1. An allied hero get damaged
2. Obtain damage taken
3. Let dummy hp - damage taken
4. Here come 2 conditions : either dummy unit hp will > 0, or <=0, so

For the part hp <= 0 :
1. Set the allied hero hp = hp - (damage taken - initial life of dummy hp)
3. Explode the dummy and dealing damage to any unit inside range (damage amount i assume you know how to make it)

For the part hp > 0 :
1. Set allies hero hp = hp + damage taken

And 1 more condition - If dummy expired :
1. Set dummy hp lost = max hp of dummy - initial hp of dummy
2. Explode the dummy and dealing damage to nearby units

Thanks for replying, how can I obtain the damage?
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Sorry dude, I didn't indicated that I'm already using Bribes DDS. I forgot how to obtain the damage, but I remember it now and that will be DamageEventAmount. I'll be back here incase I need some more help, thanks man.

Edit: Okay here's what I've done and it doesn't work :ogre_hurrhurr: anyway I'm still trying to find out what's wrong. I just need some more help and guidance.

  • Emerald Core
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Summoned unit)) Equal to Emerald Core (Level 1)
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Create a dummy unit to represent this spell --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Location_1 = (Target point of ability being cast)
      • Unit - Create 1 Dummy Unit for (Triggering player) at Temp_Location_1 facing 0.00 degrees
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- The variable Integer represents this individual cast of the spell --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Unit = (Last created unit)
      • Set Temp_Integer_1 = (Custom value of Temp_Unit)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- This dummy will absorb the damage from allies --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Emerald_Dummy_Unit = (Summoned unit)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Spell_Caster[Temp_Integer_1] = (Summoning unit)
      • Set Temp_Stats = (Intelligence of Spell_Caster[Temp_Integer_1] (Include bonuses))
      • Set Spell_Value_1[Temp_Integer_1] = (0.50 x (Real(Temp_Stats)))
      • Set Spell_Radius[Temp_Integer_1] = 500.00
      • -------- ------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Emerald_Core_Group is empty) Equal to True
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------- --------
          • Trigger - Turn on Emeraldo Core Absorb <gen>
          • -------- ------------------------------------------------------------------------------------------------- --------
        • Else - Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Add the dummy to this spell's group so that it can be referenced over time --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Unit Group - Add Temp_Unit to Emerald_Core_Group
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Clean leaks of course --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_Temp_Location_1)
      • -------- ------------------------------------------------------------------------------------------------- --------
  • Emeraldo Core Absorb
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Emerald_Core_Group and do (Actions)
        • Loop - Actions
          • -------- ------------------------------------------------------------------------------------------------- --------
          • Set Temp_Unit = (Picked unit)
          • Set Temp_Integer_1 = (Custom value of Temp_Unit)
          • Set Temp_Player = (Owner of Temp_Unit)
          • Set Temp_Location_2 = (Position of Temp_Unit)
          • Custom script: set bj_wantDestroyGroup = true
          • -------- ------------------------------------------------------------------------------------------------- --------
          • Unit Group - Pick every unit in (Units within Spell_Radius[Temp_Integer_1] of Temp_Location_2) and do (Actions)
            • Loop - Actions
              • Set Temp_Target_1 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Target_1 belongs to an ally of Temp_Player) Equal to True
                  • (Temp_Target_1 is alive) Equal to True
                  • (Temp_Target_1 is A Hero) Equal to True
                  • (Temp_Target_1 is A structure) Equal to False
                • Then - Actions
                  • -------- ------------------------------------------------------------------------------------------------- --------
                  • Set DamageEventAmount = (DamageEventAmount - (0.10 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))
                  • Unit - Set life of Emerald_Dummy_Unit to ((Life of Emerald_Dummy_Unit) - (10.00 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))%
                  • -------- ------------------------------------------------------------------------------------------------- --------
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Emerald_Dummy_Unit is dead) Equal to True
            • Then - Actions
              • -------- ------------------------------------------------------------------------------------------------- --------
              • Custom script: set bj_wantDestroyGroup = true
              • -------- ------------------------------------------------------------------------------------------------- --------
              • Unit Group - Pick every unit in (Units within Spell_Radius[Temp_Integer_1] of Temp_Location_2) and do (Actions)
                • Loop - Actions
                  • Set Temp_Target_2 = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Temp_Target_2 belongs to an enemy of Temp_Player) Equal to True
                      • (Temp_Target_2 is alive) Equal to True
                      • (Temp_Target_2 is A structure) Equal to False
                    • Then - Actions
                      • -------- ------------------------------------------------------------------------------------------------- --------
                      • Unit - Cause Temp_Unit to damage Temp_Target_2, dealing (Spell_Value_1[Temp_Integer_1] + (Life of Emerald_Dummy_Unit)) damage of attack type Magic and damage type Normal
                      • -------- ------------------------------------------------------------------------------------------------- --------
                      • Special Effect - Create a special effect at Temp_Location_2 using war3mapImported\Nature'sFury.mdx
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect attached to the origin of Temp_Target_2 using war3mapImported\CenarionFury.mdx
                      • Special Effect - Destroy (Last created special effect)
                      • -------- ------------------------------------------------------------------------------------------------- --------
                      • Unit Group - Remove Temp_Unit from Emerald_Core_Group
                      • Unit - Remove Temp_Unit from the game
                      • -------- ------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Emerald_Core_Group is empty) Equal to True
                        • Then - Actions
                          • -------- ------------------------------------------------------------------------------------------------- --------
                          • -------- Turn off this trigger as it's currently doing nothing --------
                          • -------- ------------------------------------------------------------------------------------------------- --------
                          • Trigger - Turn off Beacon of Light Loop <gen>
                          • -------- ------------------------------------------------------------------------------------------------- --------
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Temp_Location_2)
Things I did on my trigger....

Emerald Core Trigger

- I used the event A unit spawns a summoned unit because I had 4 Emerald Core units that each differs from health according to their level. (this Emerald Core unit will absorb damage dealt from allies)

- I used a Dummy Unit to represent the spell and use it to deal damage (so even if the Spell_Caster dies, there's still a way to deal some damage?)
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
You're trying to set Temp_Location_1 to Target point of ability being cast but you're using the A unit Spawns a summoned unit event so it's co-ordinates are probably being set to (0,0).

That's all I've found so far but I haven't gone through you're code in any great detail.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
You're trying to set Temp_Location_1 to Target point of ability being cast but you're using the A unit Spawns a summoned unit event so it's co-ordinates are probably being set to (0,0).

That's all I've found so far but I haven't gone through you're code in any great detail.

Well the spell is based from Serpent Ward ability, that's why I put Target point of ability being cast.
 
Level 11
Joined
Dec 19, 2012
Messages
411
jonbon29 said:
Well the spell is based from Serpent Ward ability, that's why I put Target point of ability being cast.
But your event doesn't involved any "ability" event, so it not valid. You can try obtain the coordinate and check the coordinate value, it should display 0 (center of the map)

Your event should change to "A unit starts the effect of an ability"



And inside the Emerald Core Absorb trigger :
  • Unit Group - Pick every unit in (Units within Spell_Radius[Temp_Integer_1] of Temp_Location_2) and do (Actions)
    • Loop - Actions
      • Set Temp_Target_1 = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Temp_Target_1 belongs to an ally of Temp_Player) Equal to True
            • (Temp_Target_1 is alive) Equal to True
            • (Temp_Target_1 is A Hero) Equal to True
            • (Temp_Target_1 is A structure) Equal to False
          • Then - Actions
            • -------- ------------------------------------------------------------------------------------------------- --------
            • Set DamageEventAmount = (DamageEventAmount - (0.10 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))
            • Unit - Set life of Emerald_Dummy_Unit to ((Life of Emerald_Dummy_Unit) - (10.00 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))%
            • -------- ------------------------------------------------------------------------------------------------- --------
          • Else - Actions
What this group doing?
 
Level 8
Joined
Jan 28, 2016
Messages
486
Well the spell is based from Serpent Ward ability, that's why I put Target point of ability being cast.

That would work if you had your trigger like this:
  • Emerald Core Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Emerald Core
    • Actions
      • Set Temp_Location_1 = (Target point of ability being cast)
However in your case, you should be doing this:
  • Emerald Core Spawn
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Emerald Core (Level 1)
    • Actions
      • Set Temp_Location_1 = (Position of (Summoned unit))
But your event doesn't involved any "ability" event, so it not valid. You can try obtain the coordinate and check the coordinate value, it should display 0 (center of the map)

Your event should change to "A unit starts the effect of an ability"



And inside the Emerald Core Absorb trigger :
  • Unit Group - Pick every unit in (Units within Spell_Radius[Temp_Integer_1] of Temp_Location_2) and do (Actions)
    • Loop - Actions
      • Set Temp_Target_1 = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Temp_Target_1 belongs to an ally of Temp_Player) Equal to True
            • (Temp_Target_1 is alive) Equal to True
            • (Temp_Target_1 is A Hero) Equal to True
            • (Temp_Target_1 is A structure) Equal to False
          • Then - Actions
            • -------- ------------------------------------------------------------------------------------------------- --------
            • Set DamageEventAmount = (DamageEventAmount - (0.10 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))
            • Unit - Set life of Emerald_Dummy_Unit to ((Life of Emerald_Dummy_Unit) - (10.00 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))%
            • -------- ------------------------------------------------------------------------------------------------- --------
          • Else - Actions
What this group doing?

Beat me to it DD! The loop you pointed out is meant to reduce the damage taken by nearby allied Heroes by 10% and transfer it onto the summon.
 
Level 11
Joined
Dec 19, 2012
Messages
411
What he want is a unit take damage, all the damage that the unit taken will be taken by dummy unit. But that group looping is like "a unit take damage, pick every allied heroes in range and set the damage event amount to whatever number (which not even used) and dummy hp keep reducing each allied hero near"

And also he lack the action that recover allied heroe hp to original hp.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Ahh yeah, you're right. The other problem is that the first loop picks every Emerald Core so this would only work when the Core receives damage. Then the second loop would adjust the health of nearby allied heroes based on the damage dealt to the Core, which is partially opposite of what we want to happen.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
But your event doesn't involved any "ability" event, so it not valid. You can try obtain the coordinate and check the coordinate value, it should display 0 (center of the map)

Your event should change to "A unit starts the effect of an ability"



And inside the Emerald Core Absorb trigger :
  • Unit Group - Pick every unit in (Units within Spell_Radius[Temp_Integer_1] of Temp_Location_2) and do (Actions)
    • Loop - Actions
      • Set Temp_Target_1 = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Temp_Target_1 belongs to an ally of Temp_Player) Equal to True
            • (Temp_Target_1 is alive) Equal to True
            • (Temp_Target_1 is A Hero) Equal to True
            • (Temp_Target_1 is A structure) Equal to False
          • Then - Actions
            • -------- ------------------------------------------------------------------------------------------------- --------
            • Set DamageEventAmount = (DamageEventAmount - (0.10 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))
            • Unit - Set life of Emerald_Dummy_Unit to ((Life of Emerald_Dummy_Unit) - (10.00 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))%
            • -------- ------------------------------------------------------------------------------------------------- --------
          • Else - Actions
What this group doing?

Thanks for the help guys, okay what I'm doing in this trigger and as far as I understand what I'm doing :ogre_hurrhurr:

I'm reducing the damage from allied heroes by 10% X 1 per level and setting the life of the emerald core unit (the summoned unit that will absorb the damage) to - 10% X 1 per level.

Since I don't know how to directly transfer the damage to the emerald core unit. So my trigger proves wrong :ogre_hurrhurr: how should I do it then? I Have change the unit event by the way.
 
Level 11
Joined
Dec 19, 2012
Messages
411
okay what I'm doing in this trigger and as far as I understand what I'm doing
But your trigger tells me differently :)

  • Set DamageEventAmount = (DamageEventAmount - (0.10 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))
^Not even get used inside the trigger, what the point you changing the value?

  • Unit - Set life of Emerald_Dummy_Unit to ((Life of Emerald_Dummy_Unit) - (10.00 x (Real((Level of Emerald Core (Forest Keeper) for Spell_Caster[Temp_Integer_1])))))%
Are you sure you want to set the hp in percentage form instead of value form?


Assuming you cast the spell, and there are 3 allied heroes around. If 1 allied hero take damaged, the dummy unit will need to get damaged by 3 times due to 3 allied heroes near. Isn't it should be damaged by only once?
 
Level 7
Joined
Oct 19, 2015
Messages
286
The way your code works, every time any unit takes damage, you loop through all cores and for each one, restore health to all adjacent heroes.

What you should be doing is, whenever a unit takes damage, first check if the damaged unit is a valid unit (for performance reasons), if it is then loop through all the cores and check if the damaged unit is in range of each core, as well as checking if it is an ally of the core, if it is then you modify the life of the damaged unit and the core.
 
Well i think you missunderstanded the DDS a little bit.
You only have to check if the damaged unit fullfills the conditions of beeing protected and then get the protectors and change the amount of damage and reduce the protector's life by the same amount.

I'll offer you my version how i would do it.

First you use "Bribes GUI Damage Engine" don't you, then you should change the event to DamageModifierEvent. This way you can change the Damage before it is dealt.

To have a smother and lighter work creating an aura with an unique buff which the ermald unit has might be a good option. Makes it easier to detect units which are likely protected and the power of the protection.

my version would be this.
Does not clean Leaks, I think you can do that

  • Emerald Dmg
    • Ereignisse
      • Spiel - DamageModifierEvent becomes Gleich 1.00
    • Bedingungen
    • Aktionen
      • -------- Hast to be in another init trigger --------
      • -------- Defines the % of beeing absorbed --------
      • Set Emerald_LVL_Multiplier[1] = 0.20
      • Set Emerald_LVL_Multiplier[2] = 0.30
      • Set Emerald_LVL_Multiplier[3] = 0.40
      • Set Emerald_LVL_Multiplier[4] = 0.50
      • -------- - --------
      • -------- Real Stuf --------
      • -------- - --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (DamageEventTarget has buff Your Buff ) equal True
        • 'THEN'-Aktionen
          • -------- Unit might be likely under protecion of Emerald unit --------
          • -------- loop through emeralds --------
          • Einheitengruppe - Pick every unit in EmeraldUnits and do (Actions)
            • Schleifen - Aktionen
              • -------- Does this emerald protect us? --------
              • -------- Check Range --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Distance between (Position of DamageEventTarget) and (Position of (Picked unit))) <= 500.00
                • 'THEN'-Aktionen
                  • -------- He protects us!!!! --------
                  • -------- Calculate the amount and save it in an temp real --------
                  • -------- Do your tranfer by Reducing Life and reducing Damageamount --------
                  • -------- ------ --------
                  • Set temp_Damge = (DamageEventAmount x Emerald_LVL_Multiplier[(Level of Your Aura for (Picked unit))])
                  • Set DamageEventAmount = (DamageEventAmount - temp_Damge)
                  • Einheit - Set life of (Picked unit) to ((Leben of (Picked unit)) - temp_Damge)
                  • -------- Check if Killed by this dmg --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Bedingungen
                      • (Life of (Picked unit)) < 0.40
                    • 'THEN'-Aktionen
                      • -------- Do your Explosion Stuff --------
                    • 'ELSE'-Aktionen
                • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Sorry for my late response, I've been busy working and I forgot about this thread :ogre_hurrhurr:

The only problem in an aura is that there's a delay on the removing of buff when the unit is no longer in range, but anyway I think that's the only way.
 
Status
Not open for further replies.
Top