Iron Roots v1.1

This bundle is marked as approved. It works and satisfies the submission rules.
Iron Roots
Roots burst from the ground, holding the target enemy unit down until released or until the target dies. While held, the unit cannot move or attack, and suffers X damage per second. The roots have Y health, and if destroyed, will release their victim.

Multi-Unit Instanceable: Yes
No. of Triggers: 4
No. of Custom Abilities: 5
No. of Custom Units (dummies) Required: 1
No. of Custom Effects/Models Required: 0
No. of Custom Dummy Items Required: 4

Video of the spell in use: http://www.wegame.com/watch/spell-iron-roots/

Mana cost and cool down are of course, arbitrary, and can be edited to what you desire.


This is my First Spell submission to Hive Workshop, but is by no means my first attempt at custom spells. This is however my first attempt at MUI spells by using HashTables - so go easy on me if the triggering seems a little "inefficient".

EXTRA SPECIAL THANKS TO: Maker


The Init is the only trigger that needs editing to change the damage/health per rank that the skill has.
  • Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set IR_HTable = (Last created hashtable)
      • Set IR_HPperRank = 100
      • -------- Set this number to how much Health per rank of the spell you want the Roots to have. --------
      • -------- Though the system fully supports any value here, it can cause lag if the health of the roots --------
      • -------- becomes greater than 10,000 --------
      • Set IR_DamPerRank = 10.00
      • -------- Set this number to how much damage per second you want the roots to deal per rank of the spell. --------
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Iron Roots
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in IR_RootedUG) Equal to True
        • Then - Actions
          • -------- You can add whatever actions you want here, but for an example, --------
          • -------- I display text to warn you the unit is already rooted. --------
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffffcc00Error|r -...
        • Else - Actions
          • Unit Group - Add (Target unit of ability being cast) to IR_RootedUG
          • -------- The unit is added to a unit group --------
          • Unit - Turn collision for (Target unit of ability being cast) Off
          • Set IR_Loc = (Position of (Target unit of ability being cast))
          • Unit - Create 1 Iron Roots for (Owner of (Triggering unit)) at IR_Loc facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_IR_Loc)
          • -------- Point leaks are removed --------
          • -------- ------------------------ --------
          • -------- Newly added in 1.1: Damage Ranks and Max Health modification of Roots --------
          • -------- ------------------------ --------
          • Set IR_String = (String((IR_HPperRank x (Level of Iron Roots for (Triggering unit)))))
          • Set IR_TempInt = (Length of IR_String)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IR_TempInt Greater than or equal to 3
            • Then - Actions
              • Set IR_Hundreds = (Integer((Substring(IR_String, 1, (IR_TempInt - 2)))))
              • Set IR_Tens = (Integer((Substring(IR_String, (IR_TempInt - 1), (IR_TempInt - 1)))))
              • Set IR_Digits = (Integer((Substring(IR_String, IR_TempInt, IR_TempInt))))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IR_TempInt Equal to 2
                • Then - Actions
                  • Set IR_Hundreds = 0
                  • Set IR_Tens = (Integer((Substring(IR_String, 1, 1))))
                  • Set IR_Digits = (Integer((Substring(IR_String, 2, 2))))
                • Else - Actions
                  • Set IR_Hundreds = 0
                  • Set IR_Tens = 0
                  • Set IR_Digits = (Integer((Substring(IR_String, 1, 1))))
          • -------- This mess of conversions above converts the relevant health per rank into 100s, 10s and 1s. --------
          • -------- This will then be used to loop an action to add that many +100, +10 and +1 health tomes to the Roots. --------
          • -------- I could loop a +1 health tome hundreds or even thousands of times --------
          • -------- ...but who wants that kind of lag? =) --------
          • Unit - Add IR_CustInv to (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IR_Hundreds Equal to 0
            • Then - Actions
            • Else - Actions
              • For each (Integer A) from 1 to IR_Hundreds, do (Actions)
                • Loop - Actions
                  • Hero - Create IR_+100 Health and give it to (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IR_Tens Equal to 0
            • Then - Actions
            • Else - Actions
              • For each (Integer A) from 1 to IR_Tens, do (Actions)
                • Loop - Actions
                  • Hero - Create IR_+10 Health and give it to (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IR_Digits Equal to 0
            • Then - Actions
            • Else - Actions
              • For each (Integer A) from 1 to IR_Digits, do (Actions)
                • Loop - Actions
                  • Hero - Create IR_+1 Health and give it to (Last created unit)
          • -------- This negative tome removes the base 1 health of the Root. --------
          • Hero - Create IR_-1 Health and give it to (Last created unit)
          • -------- You can if you wish remove this and give the Root some extra base health in the Object editor --------
          • -------- Remember to change your tooltips though if you're going to do this! --------
          • Unit - Remove IR_CustInv from (Last created unit)
          • -------- Now we must save the damage per rank of the ability with each target. --------
          • Hashtable - Save (IR_DamPerRank x (Real((Level of Iron Roots for (Triggering unit))))) as 1 of (Key (Target unit of ability being cast)) in IR_HTable
          • -------- With that done, the damage trigger can load the relevant information about damage and apply it --------
          • -------- ------------------------ --------
          • -------- End 1.1 Changes --------
          • -------- ------------------------ --------
          • Unit - Pause (Target unit of ability being cast)
          • Unit - Pause (Last created unit)
          • -------- Pausing the units simulates the stun effect --------
          • Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Target unit of ability being cast)) in IR_HTable
          • -------- This saves the Root as associated by its accompanying Target --------
          • Hashtable - Save Handle Of(Target unit of ability being cast) as 0 of (Key (Last created unit)) in IR_HTable
          • -------- This saves the Target as associated by its accompanying Root --------
  • Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in IR_RootedUG) Not equal to 0
    • Actions
      • -------- The damage is loaded from when the spell was first cast on the unit. --------
      • -------- The damage source is the Root that is associated with the unit. --------
      • Unit Group - Pick every unit in IR_RootedUG and do (Actions)
        • Loop - Actions
          • Unit - Cause (Load 0 of (Key (Picked unit)) in IR_HTable) to damage (Picked unit), dealing (Load 1 of (Key (Picked unit)) from IR_HTable) damage of attack type Spells and damage type Normal
  • Escape or Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- ------------------------ --------
      • -------- Newly added in 1.1: Triggers merged together. --------
      • -------- ------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Iron Roots
        • Then - Actions
          • -------- This unpauses the unit by loading the target unit from the associating dying Root --------
          • Unit - Unpause (Load 0 of (Key (Triggering unit)) in IR_HTable)
          • Unit Group - Remove (Load 0 of (Key (Triggering unit)) in IR_HTable) from IR_RootedUG
          • -------- ...and removes them from the unit group, so as not to continue damaging them. --------
          • Animation - Reset (Load 0 of (Key (Triggering unit)) in IR_HTable)'s animation
          • Unit - Turn collision for (Load 0 of (Key (Triggering unit)) in IR_HTable) On
          • -------- ...and puts the collision back on. --------
          • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in IR_HTable
          • Hashtable - Clear all child hashtables of child (Key (Load 0 of (Key (Triggering unit)) in (Last created hashtable))) in IR_HTable
          • -------- All child Hash Table leaks are removed here. --------
          • -------- Whether the unit has escaped or died, this trigger will run, so the leaks are removed regardless. --------
          • -------- This is because when the unit dies, the root is killed, causing this section of the trigger to run anyway. --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in IR_RootedUG) Equal to True
        • Then - Actions
          • -------- Special Effects! Replaceable of course. --------
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Remove (Triggering unit) from IR_RootedUG
          • -------- This kills the now redundant Root by loading the Root unit from the associating dying Target --------
          • Unit - Kill (Load 0 of (Key (Triggering unit)) in IR_HTable)
          • Unit - Turn collision for (Triggering unit) On
          • -------- Even though the unit is dead, we turn collision back on, just in case the unit is ressurected or something similar --------
        • Else - Actions

Version 1.1 Changes
- The ability now has different levels.
- Lots of thanks to Maker for the max health increase technique.
- Ability is now user friendly to edit the damage per rank / health per rank of the spells with only a single Integer / Real field.

Keywords:
Roots, Nature, Stun, Crowd Control, Damage over time
Contents

Iron Roots 1.1 (Map)

Reviews
13:05, 17th Jun 2010 Hanky: Looks useful enough. So I'll approve your spell. The only thing is dislike is that Damage trigger is always active.

Moderator

M

Moderator

13:05, 17th Jun 2010
Hanky:
Looks useful enough. So I'll approve your spell. The only thing is dislike is that Damage trigger is always active.
 
Level 14
Joined
Aug 31, 2009
Messages
762
Nope, it's just the standard Entangling roots spell effect being used as a unit's model file - therefore letting me tint the unit.

EDIT: Added a video preview so you can see the spell working without having to load the map yourself.
 
Last edited:
I'm not so certain about using object editor hp as the roots hp, I think it would be better if you used a variable set for each root as it's 'hp' and each time it gets attacked that number goes down, or something like that, It would also make it more adaptable for people modifing it as it would allow hp to change each level as well.

Also you can merge the two last ones into just one to save trigger numbers, but that isn't required.

I just noticed, The spell doesn't appear to be leveled, I suggest making it leveled as it would open a much wider range of places were it could be used, for example atm it's almost completaly useless for something like an rpg, orpg, campaigns, hero arenas and suchlike unless it were to be used as an item ability.

Edit: Above suggestions done, A good spell, which shall be useful in many places gj :D
I shall rate such a spell 4/5 I dont give 5/5 Cos it's missing.....something which I cannot put my finger on at this time, but I shall give u +Rep for this as it's something I like alot :D
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
762
I was thinking more along the lines of a Boss ability for this kind of thing. I suppose I could go back and make it a levelable skill - perhaps changing the root's damage each level or something along those lines.

Thanks for the criticism though, and I'll take a look at making it a multi-level ability and also making the health of the Roots more customisable without using the Object editor.
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
762
Ok, I'm working on making this ability very user friendly for editing. There's now a single field in the Initialisation Trigger called "IR_HPperRank". You can set this to any number and it should (hopefully) calculate from this number how much health tomes to give the Roots. I have also taken your suggestion and merged the Death and Escape triggers into one.

I'll demonstrate this by example:

Say you enter 1337 health per rank.

First it converts 1337 to a String.
It then sets "IR_Hundreds" to equal the first character of that string up to the 3rd from last character of the string. (13)
It then sets "IR_Tens" to equal the second to last character of that String. (3)
And then sets "IR_Digits" to equal the last character of that String. (7)

The system also understands that if the Number is only 2 or 1 digit long, it will set IR_Hundreds = 0 and/or IR_Tens = 0 as appropriate.

Now it loops adding Tomes to a unit. It will add 13*Spell Rank*[+100 Health] tomes, 3*Spell Rank*[+10 Health] tomes and lastly 7*Spell Rank*[+1 Health] tomes. (For a total of 1337 bonus health per rank). Oh, and as the Roots always have a base of 1 health, it then adds a [-1 Health] tome.


Now, if I may say so myself... I'm quite impressed with this method, and it's quite probably the most complex bit of triggering I've ever done simply to aid with making the spell easy to edit. I've just got the damage part to fiddle around with now and I'll be sure to upload it again with these new changes - and hopefully get some votes!
 
Last edited:
Level 9
Joined
Sep 5, 2015
Messages
375
any way to shove in a line of gui to make the damage scale with an attribute?

Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Level of (ABILITY HERE) for (Triggering unit)))) x 0.50) x (Real((AgilityForExample of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal

something like this? where would you put it lol
 
Level 14
Joined
Aug 31, 2009
Messages
762
any way to shove in a line of gui to make the damage scale with an attribute?

Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Level of (ABILITY HERE) for (Triggering unit)))) x 0.50) x (Real((AgilityForExample of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal

something like this? where would you put it lol
Change this line:

Hashtable - Save (IR_DamPerRank x (Real((Level of Iron Roots for (Triggering unit))))) as 1 of (Key (Target unit of ability being cast)) in IR_HTable
 
Top