Moderator
M
Moderator
17:14, 16th Jun 2010
Hanky:
The spell is too simple. You could make this spell even without triggers.
Hanky:
The spell is too simple. You could make this spell even without triggers.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
(0 ratings)
Approved
Unit Group - Pick every unit in (Units within 200.00 of minepoint) and do (Actions)
Unit - Set the custom value of (Last created unit) to (((Level of Mine!! for (Triggering unit)) x 50) + (Intelligence of (Triggering unit) (Include bonuses)))
Mine

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Mine!!

Actions


-------- Here we set the position where the mine shall spawn --------


Set minepoint = (Position of (Triggering unit))


-------- Here we create the unit, set the damage the mine should deal and add a timer to kill the mine --------


Unit - Create 1 Mine dummy for (Owner of (Triggering unit)) at minepoint facing Default building facing degrees


Unit - Set the custom value of (Last created unit) to (((Level of Mine!! for (Triggering unit)) x 50) + (Intelligence of (Triggering unit) (Include bonuses)))


Unit - Add a 5.00 second Generic expiration timer to (Last created unit)


-------- Leak fix --------


Custom script: call RemoveLocation (udg_minepoint)
Mine damage

Events


Unit - A unit Dies

Conditions


(Unit-type of (Triggering unit)) Equal to Mine dummy

Actions


-------- Here we set where the mine exploded --------


Set minepoint = (Position of (Triggering unit))


-------- SFX :D --------


Special Effect - Create a special effect at minepoint using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl


Special Effect - Destroy (Last created special effect)


Special Effect - Create a special effect at minepoint using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl


Special Effect - Destroy (Last created special effect)


-------- We remove the leak caused by the group --------


Custom script: set bj_wantDestroyGroup = true


-------- We pick all units in 200 area around the mine and deal damage to them. --------


Unit Group - Pick every unit in (Units within 200.00 of minepoint) and do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






And - All (Conditions) are true







Conditions








Or - Any (Conditions) are true









Conditions










((Picked unit) is A structure) Equal to True










((Picked unit) is A Hero) Equal to True










((Picked unit) is A ground unit) Equal to True








(Owner of (Picked unit)) Not equal to (Owner of (Triggering unit))





Then - Actions






Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real((Custom value of (Triggering unit)))) damage of attack type Chaos and damage type Demolition





Else - Actions


-------- Leak fix --------


Custom script: call RemoveLocation (udg_minepoint)
Custom script: set bj_wantDestroyGroup = true
Custom script: set bj_wantDestroyGroup = true
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
Or - Any (Conditions) are true
Conditions
((Picked unit) is A structure) Equal to True
((Picked unit) is A Hero) Equal to True
((Picked unit) is A ground unit) Equal to True
(Owner of (Picked unit)) Not equal to (Owner of (Triggering unit))
Then - Actions
Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real((Custom value of (Triggering unit)))) damage of attack type Chaos and damage type Demolition
Else - Actions
Mine

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Mine

Actions


Set loc = (Target point of ability being cast)


Unit - Create 1 Mine dummy for (Owner of (Triggering unit)) at loc facing Default building facing degrees


Unit - Add a 5.00 second Generic expiration timer to (Last created unit)


Custom script: call RemoveLocation (udg_loc)


-------- Saving the data to the next free slot --------


Set Mine_Max = (Mine_Max + 1)


Set Mine_Unit[(Mine_Max x 2)] = (Last created unit)


Set Mine_Unit[((Mine_Max x 2) + 1)] = (Triggering unit)


Set Mine_Damage[Mine_Max] = (Real((((Level of (Ability being cast) for (Triggering unit)) x 50) + (Intelligence of (Triggering unit) (Include bonuses)))))
Mine Damage

Events


Unit - A unit Dies

Conditions


(Unit-type of (Triggering unit)) Equal to Mine dummy

Actions


Set loc = (Position of (Triggering unit))


Special Effect - Create a special effect at loc using Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl


Special Effect - Destroy (Last created special effect)


-------- Searching for the slot which contains the triggering mine --------


For each (Integer i) from 1 to Mine_Max, do (Actions)



Loop - Actions




-------- Check if the current mine is the triggering mine --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






Mine_Unit[(i x 2)] Equal to (Triggering unit)





Then - Actions






-------- Save the caster so we don't have to retrieve him from the array all over again --------






Set u = Mine_Unit[((Mine_Max x 2) + 1)]






Custom script: set bj_wantDestroyGroup = true






Unit Group - Pick every unit in (Units within 300.00 of loc matching ((((Matching unit) is A flying unit) Equal to False) and (((Life of (Matching unit)) Greater than 0.00) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is Et and do (Actions)







Loop - Actions








Unit - Cause u to damage (Picked unit), dealing Mine_Damage[i] damage of attack type Chaos and damage type Demolition






Custom script: call RemoveLocation (udg_loc)






-------- Fill curent slot with the data from last slot to make things go faster --------






Set Mine_Unit[(i x 2)] = Mine_Unit[(Mine_Max x 2)]






Set Mine_Unit[((i x 2) + 1)] = Mine_Unit[((Mine_Max x 2) + 1)]






Set Mine_Damage[i] = Mine_Damage[Mine_Max]






Set Mine_Max = (Mine_Max - 1)






Skip remaining actions





Else - Actions
Custom script: set bj_wantDestroyGroup = true
function ForGroupBJ takes group whichGroup, code callback returns nothing
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
call ForGroup(whichGroup, callback)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(whichGroup)
endif
endfunction
