Weep
Godspeed to the sound of the pounding
- Reaction score
- 400
Needler
by Weep
Version 1.1.1
by Weep
Version 1.1.1
-- General Information --
If you've played any game in the Halo series, this should be familiar. It's a bit more in the style of WC3 abilities: the shots have perfect tracking and can't be evaded by movement like they can in Halo, like most of WC3's native abilities such as Storm Bolt.Linked lists = variable-size multidimensional arrays. This was a good learning exercise.
Made in GUI and leakless (as far as GUI can be). All spells are MUI. Requires a unit autoindexer (eg. AIDS) and GDD.
-- Description --
Repeatedly fires explosive crystal shards at an enemy. Shards will stick into the target, dealing a small amount of damage, then wait a short time before exploding. If a group of shards is stuck in the target when one explodes, they will chain react in a large explosion dealing damage in an area.-- Screenshot --
-- Readme --
Code:
Needler -- v1.1.1 -- by Weep
Requires:
1. An instant unit autoindexer, such as AIDS by Jesus4Lyf, AutoIndex by grim001, or
UnitIndexingUtils by Rising_Dusk. (GUI-AIDS is included in the demo map.)
2. GDD by Weep (included in the demo map or available from
http://www.thehelper.net/forums/showthread.php?t=137957)
3. The base ability "Needler".
4. The dummy-caster ability "Needle (Dummy Ability)".
5. The buff "Needler".
6. The unit-types "Dummy (Ground)" and "Dummy (Flying)".
7. This trigger category and the triggers it contains.
-- What? --
This spell is like the Needler weapon from the Halo series of games. It fires projectiles
at an enemy that home in on it and stick into it when they hit, dealing a small amount of
damage. After a delay, the stuck projectiles will explode, dealing more damage. If
enough projectiles are stuck, they will chain-react together and produce a more damaging
explosion in an AOE.
It is MPI/MUI/SUI up to 8191 simultaneous needles and 8191 simultaneous casters.
-- How To Implement --
1. Be sure "Automatically create unknown variables while pasting trigger data" is
enabled in the World Editor general preferences.
2. Add the required resources listed above, if not already present in your map.
3. The rawcodes for the imported units and abilities have probably changed; set the
"Needle (Dummy Ability)" ability to apply the buff "Needler" at all levels. If
desired, change the duration, cooldown, range, targets allowed, levels, and mana cost
of the "Needler" ability to suit your map.
In the "Needler Globals" trigger, set ND__DummyTypes[0] to "Dummy (Ground)", and set
ND__DummyTypes[1] to "Dummy (Flying)". Set ND__Ability to the "Needler" ability, set
ND__AbilityNeedle to the "Needle (Dummy Ability)" ability, and ND__Buff to the
"Needler" buff. Edit any of the other parameters to suit your map.
-- Notes --
When using a unit autoindexer, you will not be able to have any other triggers in your map
that set a unit's custom value, since this is what autoindexers do. Any such triggers can
be remade using an integer array using the unit's custom value as the index.
-- Credits --
Credit in your map is not needed but appreciated. Please include this README. Do not
claim this spell as your own work.
-- Version History --
1.1.1: Added checks for target visibility and death.
1.1.0: Added maximum range and swiveling.
1.0.0: First release.
-- Configuration and Globals --
Trigger:
- Needler Globals
- Events
- Map initialization
- Conditions
- Actions
- -------- The dummy unit-types used by Needler. 0 is Dummy (Ground), 1 is Dummy (Flying). --------
- Set ND__DummyTypes[0] = Dummy (Ground)
- Set ND__DummyTypes[1] = Dummy (Flying)
- -------- The ability used for Needler. --------
- Set ND__Ability = Needler
- -------- The order string for Needler. --------
- Set ND__Order = (Order(shadowstrike))
- -------- The ability used by the dummy caster for a single needle. --------
- Set ND__AbilityNeedle = Needle (Dummy Ability)
- -------- The scale to be applied to the needle projectile (scales the dummy caster). --------
- Set ND__NeedleScale = 50.00
- -------- The buff applied by the needle dummy ability. --------
- Set ND__Buff = Needler
- -------- The maximum range of the spell. If the target moves out of range, the casting will stop. --------
- Set ND__MaxRange = 1200.00
- -------- If true, the spell will stop firing if the target moves out of sight. --------
- Set ND__RequireSight = True
- -------- The effect to be added to a unit to represent a needle stuck in it. --------
- Set ND__FXNeedle = Abilities\Weapons\VoidWalkerMissile\VoidWalkerMissile.mdl
- -------- The attachment points which will be randomly used for stuck needles. --------
- Set ND__Attachments[1] = head
- Set ND__Attachments[2] = chest
- Set ND__Attachments[3] = hand left
- Set ND__Attachments[4] = hand right
- Set ND__Attachments[5] = foot left
- Set ND__Attachments[6] = foot right
- -------- The number of specified attachment points. --------
- Set ND__AttachmentCount = 6
- -------- The effect to be used when a needle detonates. --------
- Set ND__FXDetonate = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
- -------- The effect to be used when a grouping of needles explodes in a cluster. --------
- Set ND__FXCluster = Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
- -------- The damage to be dealt when a needle first impacts. --------
- Set ND__DamageInitial = 3.00
- -------- The damage type caused by a needle's initial impact. --------
- Set ND__DamageInitialType = Pierce
- -------- The damage to be dealt by a single needle when it detonates. --------
- Set ND__DamageDetonate = 15.00
- -------- The damage type caused by a needle's detonation. --------
- Set ND__DamageDetonateType = Normal
- -------- The delay after being hit by a needle before the needles will detonate, if not enough for a cluster. --------
- Set ND__DetonationDelay = 2.50
- -------- The damage to be dealt by a cluster of needles when they chain-react. --------
- Set ND__DamageCluster = 200.00
- -------- The number of needles that need to be stuck in an enemy to chain-react. --------
- Set ND__ClusterCount = 10
- -------- If true, all stuck needles will go off at once if there are enough. --------
- -------- If false, only the number of needles that constitute a cluster will go off together at a time. --------
- Set ND__ClusterSimultaneity = False
- -------- The splash damage area for a needle cluster explosion. --------
- Set ND__ClusterAOE = 250.00
- -------- If true, the damage will fall off linearly with distance, dealing full damage at the center and 0 at the edge. --------
- -------- If false, all units in the AOE will take full damage. --------
- Set ND__FalloffAOE = True
- -------- If true, the explosion will damage allied units, too. --------
- Set ND__FriendlyAOE = False
- -------- The damage type caused by a cluster explosion. --------
- Set ND__DamageClusterType = Siege
- -------- The delay after being hit by a needle before the needles will detonate, if there are enough for a cluster. --------
- Set ND__ClusterDelay = 0.75
- -------- The period used to calculate timing. --------
- Set ND__Period = 0.02
- -------- The period to fire needles immediately after casting the spell. --------
- Set ND__RateStart = 0.20
- -------- How much the firing period decreases each time a needle is fired. (Basically, acceleration of the rate of fire.) --------
- Set ND__RateSpeedup = 0.02
- -------- The fastest rate at which needles can be fired. --------
- Set ND__RateMax = 0.10
- -------- Precomputation. Don't edit below this line! --------
- Countdown Timer - Start ND__Timer as a Repeating timer that will expire in ND__Period seconds
- Set ND__DamageCluster = (ND__DamageCluster / (Real(ND__ClusterCount)))
- Events
-- Triggers --
Trigger:
- Needler Fire Needle
- Events
- Conditions
- Actions
- Custom script: if IsUnitInRange(udg_ND_TempUnit[0], udg_ND_CasterTarget[udg_ND_TempInteger[0]], udg_ND__MaxRange) and (IsUnitType(udg_ND_CasterTarget[udg_ND_TempInteger[0]], UNIT_TYPE_DEAD) or GetUnitTypeId(udg_ND_CasterTarget[udg_ND_TempInteger[0]]) == 0) == false then
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (ND_CasterTarget[ND_TempInteger[0]] is dead) Equal to True
- ND__RequireSight Equal to True
- Or - Any (Conditions) are true
- Conditions
- (ND_CasterTarget[ND_TempInteger[0]] is fogged to (Owner of ND_Dummies[ND_TempInteger[0]])) Equal to True
- (ND_CasterTarget[ND_TempInteger[0]] is masked to (Owner of ND_Dummies[ND_TempInteger[0]])) Equal to True
- Conditions
- Then - Actions
- Unit - Order ND_TempUnit[0] to Stop
- Else - Actions
- Custom script: call SetUnitFacing(udg_ND_TempUnit[0], bj_RADTODEG * Atan2(GetUnitY(udg_ND_CasterTarget[udg_ND_TempInteger[0]]) - GetUnitY(udg_ND_TempUnit[0]), GetUnitX(udg_ND_CasterTarget[udg_ND_TempInteger[0]]) - GetUnitX(udg_ND_TempUnit[0])))
- Set ND_TempReal[0] = (20.00 x (Random real number between -1.00 and 1.00))
- Custom script: call SetUnitX(udg_ND_Dummies[udg_ND_TempInteger[0]], GetUnitX(udg_ND_TempUnit[0])+udg_ND_TempReal[0]*Cos(90+GetUnitFacing(udg_ND_TempUnit[0])*bj_DEGTORAD))
- Custom script: call SetUnitY(udg_ND_Dummies[udg_ND_TempInteger[0]], GetUnitY(udg_ND_TempUnit[0])+udg_ND_TempReal[0]*Sin(90+GetUnitFacing(udg_ND_TempUnit[0])*bj_DEGTORAD))
- Animation - Change ND_Dummies[ND_TempInteger[0]] flying height to (Current flying height of ND_TempUnit[0]) at 0.00
- Unit - Grant shared vision of ND_CasterTarget[ND_TempInteger[0]] to (Owner of ND_Dummies[ND_TempInteger[0]])
- Unit - Order ND_Dummies[ND_TempInteger[0]] to Night Elf Warden - Shadow Strike ND_CasterTarget[ND_TempInteger[0]]
- Unit - Deny shared vision of ND_CasterTarget[ND_TempInteger[0]] to (Owner of ND_Dummies[ND_TempInteger[0]])
- If - Conditions
- Custom script: else
- Unit - Order ND_TempUnit[0] to Stop
- Custom script: endif
Trigger:
- Needler Explode
- Events
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleCount[ND_TempInteger[1]] Greater than or equal to ND__ClusterCount
- Then - Actions
- Set ND_TempPoint[1] = (Position of ND_TempUnit[1])
- Set ND_TempGroup = (Units within ND__ClusterAOE of ND_TempPoint[1] matching (((Matching unit) is dead) Equal to False))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND__ClusterSimultaneity Equal to True
- Then - Actions
- Set ND_TempInteger[99] = ND_NeedleCount[ND_TempInteger[1]]
- Set ND_NeedleCount[ND_TempInteger[1]] = 0
- Else - Actions
- Set ND_TempInteger[99] = ND__ClusterCount
- Set ND_NeedleCount[ND_TempInteger[1]] = (ND_NeedleCount[ND_TempInteger[1]] - ND__ClusterCount)
- If - Conditions
- Unit Group - Pick every unit in ND_TempGroup and do (Actions)
- Loop - Actions
- Set ND_TempUnit[3] = (Picked unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (ND_TempUnit[3] is A flying unit) Not equal to (ND_TempUnit[1] is A flying unit)
- (ND_TempUnit[3] is A structure) Equal to True
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND__FalloffAOE Equal to True
- Then - Actions
- Set ND_TempPoint[3] = (Position of ND_TempUnit[3])
- Set ND_TempReal[3] = (1.00 - ((Distance between ND_TempPoint[1] and ND_TempPoint[3]) / ND__ClusterAOE))
- Custom script: call RemoveLocation(udg_ND_TempPoint[3])
- Else - Actions
- Set ND_TempReal[3] = 1.00
- If - Conditions
- Set ND_TempInteger[11] = ND_NeedleFirst[ND_TempInteger[1]]
- For each (Integer ND_TempInteger[100]) from 1 to ND_TempInteger[99], do (Actions)
- Loop - Actions
- Special Effect - Destroy ND_NeedleEffects[ND_TempInteger[11]]
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- ND__FriendlyAOE Equal to True
- (ND_TempUnit[3] belongs to an ally of (Owner of ND_NeedleOwner[ND_TempInteger[11]])) Not equal to True
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Set ND_TempInteger[2] = (Custom value of ND_NeedleOwner[ND_TempInteger[11]])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of ND_Casters[ND_TempInteger[2]]) Not equal to No unit-type
- Then - Actions
- Unit - Cause ND_Casters[ND_TempInteger[2]] to damage ND_TempUnit[3], dealing (ND_TempReal[3] x ND__DamageCluster) damage of attack type ND__DamageClusterType and damage type Normal
- Else - Actions
- Unit - Cause ND_NeedleOwner[ND_TempInteger[11]] to damage ND_TempUnit[3], dealing (ND_TempReal[3] x ND__DamageCluster) damage of attack type ND__DamageClusterType and damage type Normal
- If - Conditions
- Else - Actions
- If - Conditions
- Set ND_TempInteger[11] = ND_NeedleNext[ND_TempInteger[11]]
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Loop - Actions
- For each (Integer ND_TempInteger[100]) from 1 to ND_TempInteger[99], do (Actions)
- Loop - Actions
- Special Effect - Destroy ND_NeedleEffects[ND_NeedleFirst[ND_TempInteger[1]]]
- Set ND_NeedlePrev[ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]] = 0
- Set ND_NeedleFreedIndices[ND_NeedleFirst[ND_TempInteger[1]]] = ND_NeedleLastFree
- Set ND_NeedleLastFree = ND_NeedleFirst[ND_TempInteger[1]]
- Set ND_NeedleFirst[ND_TempInteger[1]] = ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]
- Loop - Actions
- Custom script: call DestroyGroup(udg_ND_TempGroup)
- Custom script: call RemoveLocation(udg_ND_TempPoint[1])
- Special Effect - Create a special effect attached to the chest of ND_TempUnit[1] using ND__FXCluster
- Special Effect - Destroy (Last created special effect)
- Else - Actions
- For each (Integer ND_TempInteger[100]) from 1 to ND_NeedleCount[ND_TempInteger[1]], do (Actions)
- Loop - Actions
- Unit - Cause No unit to damage ND_TempUnit[1], dealing ND__DamageDetonate damage of attack type ND__DamageDetonateType and damage type Normal
- Special Effect - Destroy ND_NeedleEffects[ND_NeedleFirst[ND_TempInteger[1]]]
- Special Effect - Create a special effect attached to the ND_NeedleAttachments[ND_NeedleFirst[ND_TempInteger[1]]] of ND_TempUnit[1] using ND__FXDetonate
- Special Effect - Destroy (Last created special effect)
- Set ND_TempInteger[2] = (Custom value of ND_NeedleOwner[ND_NeedleFirst[ND_TempInteger[1]]])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of ND_Casters[ND_TempInteger[2]]) Not equal to No unit-type
- Then - Actions
- Unit - Cause ND_Casters[ND_TempInteger[2]] to damage ND_TempUnit[1], dealing ND__DamageDetonate damage of attack type ND__DamageDetonateType and damage type Normal
- Else - Actions
- Unit - Cause ND_NeedleOwner[ND_NeedleFirst[ND_TempInteger[1]]] to damage ND_TempUnit[1], dealing ND__DamageDetonate damage of attack type ND__DamageDetonateType and damage type Normal
- If - Conditions
- Set ND_NeedlePrev[ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]] = 0
- Set ND_NeedleFreedIndices[ND_NeedleFirst[ND_TempInteger[1]]] = ND_NeedleLastFree
- Set ND_NeedleLastFree = ND_NeedleFirst[ND_TempInteger[1]]
- Set ND_NeedleFirst[ND_TempInteger[1]] = ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]
- Loop - Actions
- Set ND_NeedleCount[ND_TempInteger[1]] = 0
- For each (Integer ND_TempInteger[100]) from 1 to ND_NeedleCount[ND_TempInteger[1]], do (Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Trigger:
- Needler Damage Detect
- Events
- Game - GDD_Event becomes Equal to 0.00
- Conditions
- (GDD_DamagedUnit has buff ND__Buff) Equal to True
- Actions
- Unit - Remove ND__Buff buff from GDD_DamagedUnit
- Set ND_TempInteger[1] = (Custom value of GDD_DamagedUnit)
- Set ND_TempInteger[2] = (Custom value of GDD_DamageSource)
- -------- If the indexed unit is not the same as this unit, clear everything and index it. --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GDD_DamagedUnit Not equal to ND_NeedleUnits[ND_TempInteger[1]]
- Then - Actions
- For each (Integer ND_TempInteger[100]) from 1 to ND_NeedleCount[ND_TempInteger[1]], do (Actions)
- Loop - Actions
- Special Effect - Destroy ND_NeedleEffects[ND_NeedleFirst[ND_TempInteger[1]]]
- Set ND_NeedleFreedIndices[ND_NeedleFirst[ND_TempInteger[1]]] = ND_NeedleLastFree
- Set ND_NeedleLastFree = ND_NeedleFirst[ND_TempInteger[1]]
- Set ND_NeedleFirst[ND_TempInteger[1]] = ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]
- Loop - Actions
- Set ND_NeedleCount[ND_TempInteger[1]] = 0
- Set ND_NeedleUnits[ND_TempInteger[1]] = GDD_DamagedUnit
- Set ND_NeedledUnitCount = (ND_NeedledUnitCount + 1)
- Set ND_NeedledUnitIndex[ND_NeedledUnitCount] = ND_TempInteger[1]
- For each (Integer ND_TempInteger[100]) from 1 to ND_NeedleCount[ND_TempInteger[1]], do (Actions)
- Else - Actions
- If - Conditions
- -------- Initial impact damage --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of ND_Casters[ND_TempInteger[2]]) Not equal to No unit-type
- Then - Actions
- Unit - Cause ND_Casters[ND_TempInteger[2]] to damage GDD_DamagedUnit, dealing ND__DamageInitial damage of attack type ND__DamageInitialType and damage type Normal
- Else - Actions
- Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing ND__DamageInitial damage of attack type ND__DamageInitialType and damage type Normal
- If - Conditions
- -------- Add a needle --------
- Set ND_NeedleCount[ND_TempInteger[1]] = (ND_NeedleCount[ND_TempInteger[1]] + 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleLastFree Equal to 0
- Then - Actions
- Set ND_NeedleIndexCount = (ND_NeedleIndexCount + 1)
- Set ND_TempInteger[11] = ND_NeedleIndexCount
- Else - Actions
- Set ND_TempInteger[11] = ND_NeedleLastFree
- Set ND_NeedleLastFree = ND_NeedleFreedIndices[ND_NeedleLastFree]
- If - Conditions
- Set ND_TempInteger[22] = (Random integer number between 1 and ND__AttachmentCount)
- Special Effect - Create a special effect attached to the ND__Attachments[ND_TempInteger[22]] of GDD_DamagedUnit using ND__FXNeedle
- Set ND_NeedleEffects[ND_TempInteger[11]] = (Last created special effect)
- Set ND_NeedleAttachments[ND_TempInteger[11]] = ND__Attachments[ND_TempInteger[22]]
- Set ND_NeedleOwner[ND_TempInteger[11]] = GDD_DamageSource
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleCount[ND_TempInteger[1]] Greater than 1
- Then - Actions
- Set ND_NeedleNext[ND_NeedleLast[ND_TempInteger[1]]] = ND_TempInteger[11]
- Set ND_NeedlePrev[ND_TempInteger[11]] = ND_NeedleLast[ND_TempInteger[1]]
- Set ND_NeedleLast[ND_TempInteger[1]] = ND_TempInteger[11]
- Else - Actions
- Set ND_NeedleFirst[ND_TempInteger[1]] = ND_TempInteger[11]
- Set ND_NeedleLast[ND_TempInteger[1]] = ND_TempInteger[11]
- Set ND_NeedlePrev[ND_TempInteger[11]] = 0
- If - Conditions
- Set ND_NeedleNext[ND_TempInteger[11]] = 0
- -------- Set the timeout --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleCount[ND_TempInteger[1]] Greater than or equal to ND__ClusterCount
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleTime[ND_TempInteger[1]] Greater than ND__ClusterDelay
- Then - Actions
- Set ND_NeedleTime[ND_TempInteger[1]] = ND__ClusterDelay
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Set ND_NeedleTime[ND_TempInteger[1]] = ND__DetonationDelay
- If - Conditions
- Events
Trigger:
- Needler Periodic
- Events
- Time - ND__Timer expires
- Conditions
- Actions
- For each (Integer ND_TempInteger[200]) from 1 to ND_NeedledUnitCount, do (Actions)
- Loop - Actions
- Set ND_TempUnit[1] = ND_NeedleUnits[ND_NeedledUnitIndex[ND_TempInteger[200]]]
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of ND_TempUnit[1]) Not equal to No unit-type
- Then - Actions
- Set ND_TempInteger[1] = (Custom value of ND_TempUnit[1])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleTime[ND_TempInteger[1]] Less than or equal to 0.00
- Then - Actions
- Trigger - Run Needler Explode <gen> (ignoring conditions)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleCount[ND_TempInteger[1]] Greater than 0
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_NeedleCount[ND_TempInteger[1]] Greater than or equal to ND__ClusterCount
- Then - Actions
- Set ND_NeedleTime[ND_TempInteger[1]] = ND__ClusterDelay
- Else - Actions
- Set ND_NeedleTime[ND_TempInteger[1]] = ND__DetonationDelay
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Set ND_NeedleUnits[ND_TempInteger[1]] = No unit
- Set ND_NeedledUnitIndex[ND_TempInteger[200]] = ND_NeedledUnitIndex[ND_NeedledUnitCount]
- Set ND_TempInteger[200] = (ND_TempInteger[200] - 1)
- Set ND_NeedledUnitCount = (ND_NeedledUnitCount - 1)
- If - Conditions
- Else - Actions
- Set ND_NeedleTime[ND_TempInteger[1]] = (ND_NeedleTime[ND_TempInteger[1]] - ND__Period)
- If - Conditions
- Else - Actions
- Set ND_TempInteger[1] = ND_NeedledUnitIndex[ND_TempInteger[200]]
- For each (Integer ND_TempInteger[100]) from 1 to ND_NeedleCount[ND_TempInteger[1]], do (Actions)
- Loop - Actions
- Special Effect - Destroy ND_NeedleEffects[ND_NeedleFirst[ND_TempInteger[1]]]
- Set ND_NeedleFreedIndices[ND_NeedleFirst[ND_TempInteger[1]]] = ND_NeedleLastFree
- Set ND_NeedleLastFree = ND_NeedleFirst[ND_TempInteger[1]]
- Set ND_NeedleFirst[ND_TempInteger[1]] = ND_NeedleNext[ND_NeedleFirst[ND_TempInteger[1]]]
- Loop - Actions
- Set ND_NeedleCount[ND_TempInteger[1]] = 0
- Set ND_NeedleUnits[ND_TempInteger[1]] = No unit
- Set ND_NeedledUnitIndex[ND_TempInteger[200]] = ND_NeedledUnitIndex[ND_NeedledUnitCount]
- Set ND_TempInteger[200] = (ND_TempInteger[200] - 1)
- Set ND_NeedledUnitCount = (ND_NeedledUnitCount - 1)
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in ND_CasterGroup and do (Actions)
- Loop - Actions
- Set ND_TempUnit[0] = (Picked unit)
- Set ND_TempInteger[0] = (Custom value of ND_TempUnit[0])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Current order of ND_TempUnit[0]) Equal to ND__Order
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ND_CasterTime[ND_TempInteger[0]] Less than or equal to 0.00
- Then - Actions
- Trigger - Run Needler Fire Needle <gen> (ignoring conditions)
- If (ND_CasterRate[ND_TempInteger[0]] Greater than ND__RateMax) then do (Set ND_CasterRate[ND_TempInteger[0]] = (Max((ND_CasterRate[ND_TempInteger[0]] - ND__RateSpeedup), ND__RateMax))) else do (-------- Do Nothing --------)
- Set ND_CasterTime[ND_TempInteger[0]] = ND_CasterRate[ND_TempInteger[0]]
- Else - Actions
- Set ND_CasterTime[ND_TempInteger[0]] = (ND_CasterTime[ND_TempInteger[0]] - ND__Period)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Unit Group - Remove ND_TempUnit[0] from ND_CasterGroup
- Unit - Add a 30.00 second Generic expiration timer to ND_Dummies[ND_TempInteger[0]]
- Set ND_Dummies[ND_TempInteger[0]] = No unit
- If - Conditions
- Loop - Actions
- For each (Integer ND_TempInteger[200]) from 1 to ND_NeedledUnitCount, do (Actions)
- Events
Trigger:
- Needler Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to ND__Ability
- Actions
- Set ND_TempUnit[0] = (Triggering unit)
- Set ND_TempInteger[0] = (Custom value of ND_TempUnit[0])
- Unit Group - Add ND_TempUnit[0] to ND_CasterGroup
- Set ND_CasterTarget[ND_TempInteger[0]] = (Target unit of ability being cast)
- Set ND_CasterRate[ND_TempInteger[0]] = ND__RateStart
- Set ND_CasterTime[ND_TempInteger[0]] = ND__RateStart
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of ND_Dummies[ND_TempInteger[0]]) Equal to No unit-type
- Then - Actions
- Set ND_TempPoint[0] = (Position of ND_TempUnit[0])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (ND_TempUnit[0] is A flying unit) Equal to True
- Then - Actions
- Unit - Create 1 ND__DummyTypes[1] for (Owner of ND_TempUnit[0]) at ND_TempPoint[0] facing 0.00 degrees
- Else - Actions
- Unit - Create 1 ND__DummyTypes[0] for (Owner of ND_TempUnit[0]) at ND_TempPoint[0] facing 0.00 degrees
- Unit - Add Storm Crow Form to (Last created unit)
- Unit - Remove Storm Crow Form from (Last created unit)
- If - Conditions
- Set ND_Dummies[ND_TempInteger[0]] = (Last created unit)
- Unit - Add ND__AbilityNeedle to ND_Dummies[ND_TempInteger[0]]
- Custom script: call RemoveLocation(udg_ND_TempPoint[0])
- Animation - Change ND_Dummies[ND_TempInteger[0]]'s size to (ND__NeedleScale%, 100.00%, 100.00%) of its original size
- Else - Actions
- Unit - Change ownership of ND_Dummies[ND_TempInteger[0]] to (Owner of ND_Casters[ND_TempInteger[0]]) and Retain color
- If - Conditions
- Set ND_Casters[(Custom value of ND_Dummies[ND_TempInteger[0]])] = ND_TempUnit[0]
- Trigger - Run Needler Fire Needle <gen> (ignoring conditions)
- Events
-- Credits --
Credit in your map is not needed but appreciated. Please include the READMEs. Do not claim these spells as your own work.-- Version History --
1.1.1: Added checks for target visibility and death.
1.1.0: Added maximum range and swiveling.
1.0.0: First release.
1.1.0: Added maximum range and swiveling.
1.0.0: First release.
--------------------------------------
All comments welcome.