• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to do these?

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
1.Triggered evasion.
2.Non-channeled mana/life drain.
3.Damage in excess mana(damages the unit while mana regeneraion if mana is full.

Thanks for the time... :D
 
Level 3
Joined
Jul 13, 2010
Messages
46
Too easy! here:


  • Triggered Evasion
  • Events
  • Unit is attacked
  • Conditions
  • Triggering Unit Has Evasion
  • Actions
  • If Random Integer between 5 * Level of Evasion from triggering and 100 less than or equal to 5 * Level of Evasion from triggering unit
  • Loop Actions
  • Unit - Add Evasion(Neutral Hostile 100%)
  • Wait 0.80 seconds
  • Unit - Remove Evasion(Neutral Hostile 100%)
for non channeled drain,create a dummy ability which will target a unit,ok this is kinda tricky and needs a few variables.
Variables list:
Drain_Caster
Drain_Target
Drain_Time

and here goes:
  • Drain
  • Events
  • Unit - Unit starts the effect of an ability
  • Conditions
  • Ability - Ability being cast equal to drain
  • Actions
  • Set Drain_Caster = Triggering unit
  • Set Drain_Target = Target unit of ability being cast
  • Set Drain_Time = 5 * Level of drain for triggering unit
  • Drain Loop(initialy off)
  • Events
  • Time - Every 1 secs of game
  • Actions
  • If Drain_Time Greater than 0
  • Loop Actions
  • Unit set life of Drain_Target = life of drain target - 20
  • Unit set life of Drain_Caster = life of drain caster + 20
  • Lightning Destroy Last created special effect
  • lightning create a lighting effect using"whatever" from position of Drain_Caster to Drain_Target
as for the excess damage:
  • Events
  • Every 1 seconds of the game
  • Actions
  • Unit Group - pick every unit in units in playable map area matching unit type of matching unit equal to "whatever" and mana of matching unit equal to 100% of unit's default mana and do actions
  • Loop Actions
  • unit - make picked unit damage picked unit dealing 1-5 damage of attack type normal and damage type normal
(sorry i wasn't reaaly sure about the last one cuz i got confused with all the triggers but the first 2 are ok)
 
Last edited:
Level 10
Joined
Sep 6, 2008
Messages
423
I'll cook something up for you, that doesn't leak and doesn't run unless needed and is mostly bug free. Just give me a couple of minutes to fire up the WE and get going.

Edit: Here you go. I haven't tested them but they should work.
  • Triggered Evasion 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 Triggered Evasion <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup (udg_Temp_Group)
  • Triggered Evasion add
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Triggered Evasion <gen> the event (Unit - (Triggering unit) Takes damage)
  • Triggered Evasion
    • Events
    • Conditions
      • (Level of Triggered Evasion for (Triggering unit)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to ((Level of Triggered Evasion for (Triggering unit)) x 5)
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
        • Else - Actions
  • Drain init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Drain loop <gen>
        • Else - Actions
      • Set Index[1] = (Index[1] + 1)
      • Set Index[2] = (Index[2] + 1)
      • Set Drain_Caster[Index[2]] = (Triggering unit)
      • Set Drain_Target[Index[2]] = (Target unit of ability being cast)
      • Set Drain_Duration[Index[2]] = (10.00 + (2.00 x (Real((Level of Animate Dead for (Triggering unit))))))
      • Set Drain_Interval[Index[2]] = 1.00
      • -------- If you want it to drain mana, set this variable on 0, if you want it to drain hp set it to 1 --------
      • Set Drain_Mana_or_Hp[Index[2]] = 0
  • Drain loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Index[3]) from 1 to Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Drain_Duration[Index[3]] Greater than 0.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Drain_Caster[Index[3]] is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Drain_Target[Index[3]] is alive) Equal to True
                    • Then - Actions
                      • Set Drain_Duration[Index[3]] = (Drain_Duration[Index[0]] - 0.03)
                      • Set Drain_Counter[Index[3]] = (Drain_Counter[Index[3]] + 0.03)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Drain_Counter[Index[3]] Greater than or equal to Drain_Interval[Index[3]]
                        • Then - Actions
                          • Set Drain_Counter[Index[3]] = (Drain_Counter[Index[3]] - Drain_Interval[Index[3]])
                          • Set Temp_Loc = (Position of Drain_Caster[Index[3]])
                          • Special Effect - Create a special effect at Temp_Loc using Abilities\Spells\Other\Drain\ManaDrainCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Loc)
                          • Set Temp_Loc = (Position of Drain_Target[Index[3]])
                          • Special Effect - Create a special effect at Temp_Loc using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Loc)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Drain_Mana_or_Hp[Index[3]] Equal to 0
                            • Then - Actions
                              • Unit - Set mana of Drain_Target[Index[3]] to ((Mana of Drain_Target[Index[3]]) - Drain_Amount[Index[3]])
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Max mana of Drain_Caster[3]) - (Mana of Drain_Caster[3])) Less than Drain_Amount[Index[3]]
                                • Then - Actions
                                  • Unit - Cause Drain_Caster[Index[3]] to damage Drain_Target[Index[3]], dealing (Drain_Amount[Index[3]] - ((Max mana of Drain_Caster[Index[3]]) - (Mana of Drain_Caster[Index[3]]))) damage of attack type Spells and damage type Normal
                                • Else - Actions
                              • Unit - Set mana of Drain_Caster[Index[3]] to ((Mana of Drain_Caster[Index[3]]) + Drain_Amount[Index[3]])
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Drain_Mana_or_Hp[Index[3]] Equal to 1
                                • Then - Actions
                                  • Unit - Cause Drain_Caster[Index[3]] to damage Drain_Target[Index[3]], dealing Drain_Amount[Index[3]] damage of attack type Spells and damage type Normal
                                  • Unit - Set life of Drain_Caster[Index[3]] to ((Life of Drain_Caster[Index[3]]) + Drain_Amount[Index[3]])
                                • Else - Actions
                        • Else - Actions
                    • Else - Actions
                      • Set Drain_Duration[Index[3]] = 0.00
                • Else - Actions
                  • Set Drain_Duration[Index[3]] = 0.00
            • Else - Actions
              • Set Index[1] = (Index[1] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Index[1] Equal to 0
                • Then - Actions
                  • Set Index[2] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top