Hi, I'm making a spike trap spell, and I need some help. This is as far as I have got:
The trap is like a mine, it digs underground waiting for an enemy to pass by then it's going to dig up and trap the fool and spike him! (I just love spiking things^^) The trap model file is an orc burrow btw. The real problem right now is that I have no idea how to make the trap event when a unit comes close, I tried with an aura as you can see above, the spike trap aura. It is a buff who only can buff enemy units but I still don't get it how to make the next trigger event to work correctly, hopw you understand what I mean with all this...
Code:
Spike trap setup
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Spike trap
Actions
Set SpikeTrapCaster = (Casting unit)
Unit - Create 1 EarthSpike mine dummy for (Owner of SpikeTrapCaster) at (Position of SpikeTrapCaster) facing (Position of (Triggering unit))
Unit - Turn collision for (Last created unit) Off
Unit - Order (Last created unit) to Undead Crypt Fiend - Burrow
Unit - Create 1 Spike trap A for (Owner of SpikeTrapCaster) at (Position of SpikeTrapCaster) facing (Position of (Triggering unit))
Set SpikeTrap = (Last created unit)
Set SpikeTrapPoint = (Position of SpikeTrap)
Unit - Turn collision for SpikeTrap Off
Unit - Add Permanent Invisibility to SpikeTrap
Animation - Change SpikeTrap's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
Code:
Spike trap activate
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) is in (Units of type Spike trap A)) Equal to True
Actions
Set SpikeTrapvictim = (Attacked unit)
Unit - Pause SpikeTrapvictim
Unit - Move SpikeTrap instantly to (Position of SpikeTrapvictim)
Unit - Remove Permanent Invisibility from SpikeTrap
Wait 0.50 game-time seconds
Unit - Add Earth spikes dummy to SpikeTrap
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Spike trap for SpikeTrapCaster) Equal to 1
Then - Actions
Unit - Cause SpikeTrapCaster to damage SpikeTrapvictim, dealing 300.00 damage of attack type Pierce and damage type Normal
Else - Actions
The trap is like a mine, it digs underground waiting for an enemy to pass by then it's going to dig up and trap the fool and spike him! (I just love spiking things^^) The trap model file is an orc burrow btw. The real problem right now is that I have no idea how to make the trap event when a unit comes close, I tried with an aura as you can see above, the spike trap aura. It is a buff who only can buff enemy units but I still don't get it how to make the next trigger event to work correctly, hopw you understand what I mean with all this...