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

Ice Shards 1.2

hello,

Description:
He is called an ice shard caller. A hero calls ice shards from the spirits to damage his enemies. The ice shards explodes everywhere around the hero within a given radius.
------------------------------------------------

You will just have to copy the triggers and the variables
----------------------------------------------

Please give credits to me if you use this spell in your map.

Thanks,

eubz

  • Sp Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- /////////////////////////////////////////////////////////////////////////////////// --------
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- YOU CAN SET ALL THESE AS YOU WOULD LIKE THEM TO BE --------
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- /////////////////////////////////////////////////////////////////////////////////// --------
      • -------- How much damage each shard will inflict --------
      • Set C_Damage = 20.00
      • -------- How large is the affected area of the spell where each shard will explode --------
      • Set C_DamageArea_int = 300
      • -------- Change what will be the kind of special effect to use --------
      • Set C_SFX_SpellPathString = Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
      • -------- change how many shards will spawn --------
      • Set C_ShardAmount = 5.00
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- All these can be configured --------
      • -------- for integers, the formula is easy. you will just multiply them by the level of the ability --------
      • -------- then you will know how much or how many shards, AoE, or damage per level is given --------
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- /////////////////////////////////////////////////////////////////////////////////// --------
  • Sp Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spirit Shards
    • Actions
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- DO NOT TOUCH ANYTHING BELOW --------
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • Set C_IndexSize = (C_IndexSize + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • C_IndexSize Greater than C_IndexMaxSize
        • Then - Actions
          • Set C_Index[C_IndexSize] = C_IndexSize
          • Set C_IndexMaxSize = C_IndexSize
        • Else - Actions
      • Set C_Integer = C_Index[C_IndexSize]
      • Set C_Caster[C_Integer] = (Triggering unit)
      • Set C_AoE = C_DamageArea_int
      • Set C_AoE_A = (Random real number between 100.00 and (Real(C_AoE)))
      • Set C_RealShardAmount[C_Integer] = (C_ShardAmount x (Real((Level of Spirit Shards for C_Caster[C_Integer]))))
      • Trigger - Turn on Sp Duration <gen>
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • -------- DO NOT TOUCH ANYTHING ABOVE --------
      • -------- ----------------------------------------------------------------------------------------------------------- --------
  • Sp Duration
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • -------- -------------------------------------------------------------------------------------------------------------------- --------
      • -------- DO NOT TOUCH ANYTHING BELOW --------
      • -------- -------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer C_Loop) from 1 to C_IndexSize, do (Actions)
        • Loop - Actions
          • Set C_Integer = C_Index[C_Loop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • C_RealShardAmount[C_Integer] Less than or equal to 0.00
            • Then - Actions
              • Set C_Index[C_Loop] = C_Index[C_IndexSize]
              • Set C_Index[C_IndexSize] = C_Integer
              • Set C_IndexSize = (C_IndexSize - 1)
              • Set C_Loop = (C_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • C_IndexSize Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set C_RealShardAmount[C_Integer] = (C_RealShardAmount[C_Integer] - 1.00)
              • Set C_RealDamage = (C_Damage x (Real((Level of Spirit Shards for C_Caster[C_Integer]))))
              • Set C_CasterPosition = (Position of C_Caster[C_Integer])
              • Set C_DamagePoints = (C_CasterPosition offset by C_AoE_A towards (Random angle) degrees)
              • Set C_DamageUnits = (Units within 100.00 of C_DamagePoints matching (((Matching unit) belongs to an enemy of (Owner of C_Caster[C_Integer])) Equal to True))
              • -------- the creation of SFX --------
              • Special Effect - Create a special effect at C_DamagePoints using C_SFX_SpellPathString
              • Special Effect - Destroy (Last created special effect)
              • --------
              • Unit Group - Pick every unit in C_DamageUnits and do (Actions)
                • Loop - Actions
                  • Unit - Cause C_Caster[C_Integer] to damage (Picked unit), dealing C_RealDamage damage of attack type Spells and damage type Normal
              • -------- -----------------------------------------------------------------------------------------
              • Custom script: call RemoveLocation(udg_C_CasterPosition)
              • Custom script: call RemoveLocation(udg_C_DamagePoints)
              • Custom script: call DestroyGroup(udg_C_DamageUnits)
      • -------- -------------------------------------------------------------------------------------------------------------------- --------
      • -------- DO NOT TOUCH ANYTHING ABOVE --------
      • -------- -------------------------------------------------------------------------------------------------------------------- --------


Change log:
1. RealDamage is now a real variable and is included in the loop.
2. Destroyed the Special Effect right after it is used.
3. Used points instead of region for the Area of Effect.
4. Other changes as the moderator said.
version 1.1c
1. Changed many with the spell
2. Updated
3. Take a look at the new triggers.
version 1.2
1. Final Fixes done
2. Deleted the dummy, it's of no use now.

Keywords:
ice, shards, cold, icy, eubz
Contents

Ice Shards 1.0 (Map)

Reviews
Moderator: Pharaoh_ Date: 05:13, 26th Apr 2012 Changes made; while this is a bit basic use of hashtables, I will mark it as useful. Approved. • Don't use a region, use Point with polar offset; if you want it random, then use (Point1 offset by...

Moderator

M

Moderator

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 05:13, 26th Apr 2012

Review
Changes made; while this is a bit basic use of hashtables, I will mark it as useful.

Approved.
• Don't use a region, use Point with polar offset; if you want it random, then use (Point1 offset by X towards (Random angle) degrees).
• (Random point in C_DamageArea_Area): Leaks.
• Set C_DummyPosition[C_Integer] = (Position of C_Dummy[C_Integer]): No reason for this variable to be enhanced with array.
• Use Create Special effect and destroy it right after; there's no reason to use a dummy for it.
• Do you really need Skip remanining actions?
• Cause C_Caster[C_Integer] to damage (Picked unit), dealing (Real(C_RealDamage)): 1) C_RealDamage should be a real variable, not an integer. 2) Reload C_RealDamage under the current index within the loop trigger, otherwise you are just loading a global variable from any instance.
• Set C_DummyPosition[C_Integer] = (Position of C_Dummy[C_Integer]): if you had set Random point in region in a variable, then this would not be necessary.
 
Again with the tirggers on this one, please spread them out so it's overall easier to read. This one is about equal simplicity to your other, I'd like to see more configuration on this spell - like a Base and Per Level value for each configurable otherwise the spell may be underpowered early-game and overpowered late game and there wouldn't be much to do about it inbetween, Also you should temporarily store things in variables if they're constantly used (especially if it's in a loop) For instance the level of the ability being cast would be an example which'd apply to this spell
 
• Don't use a region, use Point with polar offset; if you want it random, then use (Point1 offset by X towards (Random angle) degrees).
The shards are far away from the caster in this action therefore, the enemy close to the caster is never hit by any shards. As the AoE increases, the dummy moves farther.
What the spell suppose to be is that enemy units within reach of the caster should randomly be hit even those which are close to the caster.
I have tested the action
  • Centered at position of (Caster[_integer]) offset by (AoE) towards (random angle) degrees
. The offset by (AoE) makes the shards move far away in circle at random angle from the caster and not randomly inside the circle around the caster which what I like.

• Set C_DummyPosition[C_Integer] = (Position of C_Dummy[C_Integer]): if you had set Random point in region in a variable, then this would not be necessary.
How will I identify which enemy units without setting the dummy position. I am using the dummy position as reference so that only those units around 100 of the position of the dummy to be affected by the spell, or be damaged.

• Cause C_Caster[C_Integer] to damage (Picked unit), dealing (Real(C_RealDamage)): 1) C_RealDamage should be a real variable, not an integer. 2) Reload C_RealDamage under the current index within the loop trigger, otherwise you are just loading a global variable from any instance.
1. Sorry, I forgot to change C_RealDamage to real.
2. C_RealDamage is already inside the loop.
• Set C_DummyPosition[C_Integer] = (Position of C_Dummy[C_Integer]): No reason for this variable to be enhanced with array.
Sorry, I haven't done this. Doing this right away.
  • If ((C_Dummy[C_Integer] is dead) Equal to True) then do (Skip remaining actions) else do (Do nothing)
Should I delete this?
Don't use this
  • Unit - A unit Begins casting an ability
Thank you for this.

NOTE:
Please point me in the right direction.
 
Level 20
Joined
Jul 12, 2010
Messages
1,717
  • -------- ---------------------------------------------------------------------------------------------------- --------
  • -------- I have tried Points with polar offset but that doesn't fit what I like the spell to be. --------
  • -------- The ice shards don't come close to the caster. It should come close so that --------
  • -------- ramdom enemies closer to him can also be hit by the shards. --------
  • -------- This action seems to work fine. --------
  • Set C_DamagePoints = (C_CasterPosition[C_Integer] offset by (Real(C_AoE)) towards (Random angle) degrees)
  • -------- ---------------------------------------------------------------------------------------------------- --------
lol what? in this action you are actually using a point with polar offset dude

The ice shards don't seem to come close to the caster.It should come close so that random enemies closer to him can also be hit by the shards.
well if you want the spell to damage units closer to the caster then you should use this:
  • Set C_DamagePoints = (C_CasterPosition[C_Integer] offset by (Random real number between 100.00 and 300.00) towards (Random angle) degrees)
anyway the spell is MUI and leak-less gj 4/5 for now:thumbs_up:
 
You are creating the dummy at C_DamagePoints. Re-setting a variable to track the dummy's location is unnecessary. You already know it, by C_DamagePoints variable, because this is where you create it in the first place. So, use

C_DamageUnits = (Units within 100.00 of C_DamagePoints instead.



  • Set C_RealDamage = (C_Damage + (Real((Level of Spirit Shards for C_Caster[C_Integer]))))
This will cause the spell to damage the enemies for the static damage a user can set in the map initialization + the level of the ability (which should be multiplied, actually, this is how most formulas work).
I'll give you an example:
A user wants to deal 20, 60, 100, 140 damage to a unit per level.
If the user configures C_Damage to 20, then the formula would result
(40 * (Level of (Ability being cast) for (Triggering unit)) - C_Damage).

When you are going to damage the units in your loop trigger (a.k.a. Sp Duration), you force the spell to deal C_Damage + (Level of ability) = 20 + 1 = 21 damage; for level 2 = 20 + 2 = 22 damage. See that?

What you should do is not leave the variable configurable in the Map Initialization, but in the trigger that detects the casting of the spell (a.k.a. Sp Cast). This would end up being
Set C_Damage[C_IndexSize] = (40 * (Level of (Ability being cast) for (Triggering unit)) - 20).

Now, in the Sp Duration, you will load it back to damage the units:
  • Unit Group - Pick every unit in C_DamageUnits and do (Actions)
    • Loop - Actions
      • Unit - Cause C_Caster[C_Integer] to damage (Picked unit), dealing C_RealDamage[C_Integer] damage of attack type Spells and damage type Normal


  • If ((C_Dummy[C_Integer] is dead) Equal to True) then do (Skip remaining actions) else do (Do nothing)
Yes, delete this.
 
Top