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

Rock Trap v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
this is a simple spell that I made quickly. It is easy to customize.

The spell create a rock, it will fall.

Credit ALVK if you use it in your map

If someone can post the triggers... I have Wc3 in french. thx !

Keywords:
Rock, Trap,
Contents

Rock Trap (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 23:59, 19th Jul 2012 Magtheridon96: You have on location leak: Set rocks_2 = (Units within real_range of (Position of (Picked unit))) The damage is dealt more than once. The...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

23:59, 19th Jul 2012
Magtheridon96:

  • You have on location leak:
    • Set rocks_2 = (Units within real_range of (Position of (Picked unit)))
  • The damage is dealt more than once.
  • The hashtable variable doesn't need to be an array.
  • Setting the height at a rate of 0 is instant
  • You're changing the height of the rock and adding an expiration timer for each unit in the AoE
  • The trigger is never turned off when no more units are casting the spell.
  • 0.25 is not smooth :/. 0.03 would be much better.

What I would recommend is making it a spell that creates a rock at a certain height, which should be configurable from a configuration trigger (You did that, but you didn't use the variable), and then calculates the amount of periodic ticks to reach the ground, continues to add 1 to a counter every time the periodic trigger runs until the count is equal to the desired ticks, and then destroys the rock and deals damage ONCE to units in range.
Currently, it deals damage to units multiple times :/
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Here are the triggers :
  • init var
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hash[1] = (Last created hashtable)
      • -------- just customize the spell here : --------
      • -------- this is the range for entered units --------
      • Set real_range = 200.00
      • Set real_damage = 500.00
      • -------- this is the time during the trap stay --------
      • Set integer_time = 15
  • rt cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Falling rocks
    • Actions
      • Set point3 = (Target point of ability being cast)
      • -------- create the rock --------
      • Unit - Create 1 dummy for Player 1 (Red) at point3 facing (Random angle) degrees
      • -------- make it can fly --------
      • Unit - Add Crow Form to (Last created unit)
      • Animation - Change (Last created unit) flying height to 500.00 at 1000000000.00
      • Unit Group - Add (Last created unit) to rocks
      • -------- save the time in a hashtable --------
      • Hashtable - Save 15 as 1 of (Key (Last created unit)) in hash[1]
      • Custom script: call RemoveLocation( udg_point3 )
  • rt effect
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in rocks and do (Actions)
        • Loop - Actions
          • -------- verify that the unit's time is not equal to 0 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of (Key (Picked unit)) from hash[1]) Greater than 0
            • Then - Actions
              • -------- save the unit's time as unit's time-1 --------
              • Hashtable - Save ((Load 1 of (Key (Picked unit)) from hash[1]) - 1) as 0 of (Key (Picked unit)) in hash[1]
              • Set point4 = (Position of (Picked unit))
              • Set rocks_2 = (Units within real_range of (Position of (Picked unit)))
              • Set unit = (Picked unit)
              • Unit Group - Pick every unit in rocks_2 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to (Owner of unit)
                    • Then - Actions
                      • Unit - Add a 1.50 second Generic expiration timer to unit
                      • Unit - Cause unit to damage (Picked unit), dealing real_damage damage of attack type Spells and damage type Normal
                      • Unit - Add Crow Form to unit
                      • Animation - Change unit flying height to 0.00 at 1500.00
                      • Unit - Kill unit
                      • Unit Group - Remove unit from Explode
                    • Else - Actions
              • Custom script: call DestroyGroup( udg_rocks_2 )
              • Custom script: call RemoveLocation( udg_point4 )
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Explode
              • Unit - Kill (Picked unit)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in hash[1]
My opinion for the spell : i am not very good at hashtables, so i can't say if it's MUI. I think it is tough... Leaks also seem to be cleared. Pretty good spell! Also, i saw that ALVK joined THW today, which means that this spell is a GOD SPELL for a newbie! Good job there! :]
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

First of all welcome to the Hive and just a note: Just because someone is new to the hive, it doesn't mean he/she is a noob in triggering and these things =)


To the spell: Well I have to say it took a longer time until I understand the sense of that spell but I found something.

1) The stone even falls, when there are no alive units but dead units under it. You should filter them out.
2) I saw the target units get damage even if the rock is just falling down. Would be cooler, if the units only get some damage, if the rock impacts on them.
3) Wondering why you use an array hashtable? Well I don't know hashtables but I don't think you have to.
4) Store the rock into a variable with "Set unit-variable = (Last created Unit)" and refer to the variable.

5) I would like it more, when you create an effect like thunderclap if the rock hits the ground.

Else for the first step it's okay so far :eek:

Greetings and Peace
Dr. Boom
 
Well I thought I'd make a few notes on this spell:

1) Potential Configurables:
- Spell
- Rock Fly Height
- Damage Base
- Damage per Level
- Rock fall speed (rate)
- Rock Time (base and per level)
- Dummy unit type
- Aoe (base and per level)

Just a few, you get the gist.

2) oh, 0 is faster than 100,000,000 or whatever you put there

3) While Mui, there really wasn't much point in using a hashtable for just a single value, since it's not too complex, keeping track of things using a hashtable wouldn't be much of a reason (the one I use)

4) you don't need an arrayed hashtable

5) I don't tsee this explode group being used anywhere?

6) You kill the rock unit twice?

7) you only need to add crow form once, that or just make the dummy flying anyway

8) you should make it so it doesn't effect magic immunes and the like (and dead units) also shouldn't really effect flyers.

9) also shouldn't hit allies.

All I could come up for now, hope you become a great spellmaker some day.
 
Level 4
Joined
Jun 16, 2012
Messages
25
This is a cool idea, but it's a buggy spell. When the rock falls it deals damage, but then the location of damage stays there and damage everything that goes near it... Forever. dont quote me on this but this is probably the result of never turning off the loop trigger. :wink:

Edit: Also welcome to hive, im new too!
 
Last edited:
Top