• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help...About Armor Reduction.

Status
Not open for further replies.
There you go

  • Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set AR_Hashtable = (Last created hashtable)
      • Set AR_Ability[0] = Item Armor Bonus -1
      • Set AR_Ability[1] = Item Armor Bonus -2
      • Set AR_Ability[2] = Item Armor Bonus -4
      • Set AR_Ability[3] = Item Armor Bonus -8
      • Set AR_Ability[4] = Item Armor Bonus -16
      • Set AR_Ability[5] = Item Armor Bonus -32
      • Set AR_Ability[6] = Item Armor Bonus -64
      • Set AR_Ability[7] = Item Armor Bonus -128
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to UnitTakesDamage <gen> the event (Unit - (Picked unit) Takes damage)
  • Add
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to UnitTakesDamage <gen> the event (Unit - (Triggering unit) Takes damage)
  • UnitTakesDamage
    • Events
    • Conditions
      • ((Triggering unit) has buff Armor Reduction ) Equal to True
      • (Level of Armor Reduction for (Damage source)) Greater than 0
    • Actions
      • Set i = (Key (Triggering unit))
      • Unit - Remove Armor Reduction buff from (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in AR_Group) Equal to False
        • Then - Actions
          • Unit Group - Add (Triggering unit) to AR_Group
          • Trigger - Turn on RemoveReduction <gen>
          • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Undead\Cripple\CrippleTarget.mdl
          • Hashtable - Save Handle Of(Last created special effect) as 0 of i in AR_Hashtable
        • Else - Actions
      • Hashtable - Save 5.00 as 0 of i in AR_Hashtable
      • Set AR_Reduction = ((Load 0 of i from AR_Hashtable) + 2)
      • Hashtable - Save AR_Reduction as 0 of i in AR_Hashtable
      • For each (Integer i) from 0 to 7, do (Actions)
        • Loop - Actions
          • Unit - Remove AR_Ability[i] from (Triggering unit)
      • Custom script: loop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Greater than 0
          • AR_Reduction Greater than 0
        • Then - Actions
          • Set i = (i - 1)
          • Set r = (Power(2.00, (Real(i))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Real(AR_Reduction)) Greater than or equal to r
            • Then - Actions
              • Unit - Add AR_Ability[i] to (Triggering unit)
              • Set AR_Reduction = (AR_Reduction - (Integer(r)))
            • Else - Actions
        • Else - Actions
          • Custom script: exitwhen true
      • Custom script: endloop
  • RemoveReduction
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in AR_Group and do (Actions)
        • Loop - Actions
          • Set i = (Key (Picked unit))
          • Set r = ((Load 0 of i from AR_Hashtable) - 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • r Greater than 0.00
            • Then - Actions
              • Hashtable - Save r as 0 of i in AR_Hashtable
            • Else - Actions
              • Special Effect - Destroy (Load 0 of i in AR_Hashtable)
              • Hashtable - Clear all child hashtables of child i in AR_Hashtable
              • Unit Group - Remove (Picked unit) from AR_Group
              • For each (Integer i) from 0 to 7, do (Actions)
                • Loop - Actions
                  • Unit - Remove AR_Ability[i] from (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (AR_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
There might be some way to do this with normal abilities but this one is more flexible (e.g. you are able to change armor like 2 4 8 16 32 etc or make it based on damage)
 

Attachments

  • Armor Reduction.w3x
    16.5 KB · Views: 52
Status
Not open for further replies.
Top