• 🏆 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!

[Solved] -Armor Stacking

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
344
Hello guys, i've found this spell in the forum, is there anyway i can convert it to make it give -Armor but so it stacks?
Original thread Fire & Earth Spell Pack

  • DDS Main
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Nature's Blessing (Genesaur BRUTE) for (Damage source)) Greater than 0
        • Then - Actions
          • -------- if loop trigger is not used we turn it on --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SF_Switch Equal to 0
            • Then - Actions
              • Trigger - Turn on Storming Flame loop <gen>
            • Else - Actions
          • -------- increasing index --------
          • Set SF_CastNumber = (SF_CastNumber + 1)
          • -------- confirms that ability used by one more unit --------
          • Set SF_Switch = (SF_Switch + 1)
          • Set SF_Off[SF_CastNumber] = True
          • -------- establish damage source --------
          • Set SF_Hero[SF_CastNumber] = (Damage source)
          • -------- define time of strength bonus --------
          • Set SF_Time[SF_CastNumber] = (10.00 + (5.00 x (Real((Level of Nature's Blessing (Genesaur BRUTE) for SF_Hero[SF_CastNumber])))))
          • -------- increasing Hero's strength --------
          • Hero - Modify Strength of SF_Hero[SF_CastNumber]: Add 1
        • Else - Actions
  • DDS Add Unit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is in DDS_Detect) Equal to False
    • Actions
      • Trigger - Add to DDS Main <gen> the event (Unit - (Entering unit) Takes damage)
      • Unit Group - Add (Entering unit) to DDS_Detect
  • DDS Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Trigger - Add to DDS Main <gen> the event (Unit - (Picked unit) Takes damage)
          • Unit Group - Add (Picked unit) to DDS_Detect
      • Custom script: call DestroyGroup(udg_Temp_Group)
  • Storming Flame loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SF) from 1 to SF_CastNumber, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SF_Off[SF] Equal to True
            • Then - Actions
              • -------- define time --------
              • Set SF_Time[SF] = (SF_Time[SF] - 0.50)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SF_Time[SF] Less than or equal to 0.00
                • Then - Actions
                  • -------- confirms that time expired and this index is not used now --------
                  • Set SF_Off[SF] = False
                  • -------- subtract value from hero's strength --------
                  • Hero - Modify Strength of SF_Hero[SF]: Subtract 1
                  • -------- subtract 1 from switch, means one unit less used this trigger --------
                  • Set SF_Switch = (SF_Switch - 1)
                  • -------- if trigger is not used by other units, we can reset index and turn trigger off --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SF_Switch Equal to 0
                    • Then - Actions
                      • Set SF_CastNumber = 0
                      • Trigger - Turn off Storming Flame loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
I would stick to using Bribe's Damage Engine instead of this crap:
  • Trigger - Add to DDS Main <gen> the event (Unit - (Picked unit) Takes damage)

All you need to do is add the DamageEvent to DDS Main.
  • Game - DamageEvent becomes Equal to 1.00
Then delete these triggers: DDS Init, DDS Add Unit
And delete this variable: DDS_Detect

For the Armor reduction it really depends on how you want it to work. But the basic idea would be something like:
Change SF_Hero to be the DamageEventTarget instead of the DamageEventSource. For the Armor reduction, you can Add an ability that adds a negative amount of Armor to SF_Hero. Then once the spell ends, remove the ability.

Also, Dynamic Indexing would be a lot better for a spell like this. The SF_Off stuff is pretty bad.
 
Level 9
Joined
Dec 16, 2017
Messages
344
Ok, i will give a try to that, but i want the -armor to be the a target, not to the caster, and with those above, it can occur from attacks or spells, and if the spells are AOE, it is stacking STR from all enemies hit.
 
Status
Not open for further replies.
Top