Flare
Stops copies me!
- Reaction score
- 662
My latest creation, a spell based on Diablo 2's Frozen Orb ability (it launches an orb of ice which launches shards of ice at rapid rate, dealing damage to anything that gets in its way)
I intended on submitting this for the Ice spell contest, but it didn't follow the rules (was originally created before the spell contest, even though it wasn't working properly)
Frozen Orb
Launches a large orb of frost, which fires chilling shards of ice around it, destroying everything in its path.
This spell is fully MUI, up to 100 instances (maximum number of instances possible with the way the spell is currently made is about 300 since there is 27 bolts fired per cast, and 8192 (max array size, isnt it?) divided by 27 will give roughly 300)
Spell is made in GUI, with small amount of JASS for leak removal
There are no leaks that I can see
There is a small bit of lag, but considering about 7 or 8+ units are being periodically moved at a time, it isn't bad (BEWARE: SPAMMING THIS SPELL 5+ TIMES BEFORE THE OTHER ORBS HAVE BEEN DESTROYED IS A VERY BAD IDEA)
Screenshots (they are pretty damn large ^^):
Code:
Please leave feedback, bug reports and suggestions.
If you are going to use this spell in your map, please give me credit
Officially approved as of 3rd Jan 2008 ^^ (my second approved spell, and my final GUI spell)
HUGE UPDATE!
I've reworked the damage triggers, so that potential bug about ownership of damaging unit will NOT occur. I've also removed all instances of (Custom Value of (Picked Unit)) and replaced it with tempint.
The spell should now be safe when repeatedly cast.
I intended on submitting this for the Ice spell contest, but it didn't follow the rules (was originally created before the spell contest, even though it wasn't working properly)
Frozen Orb
Launches a large orb of frost, which fires chilling shards of ice around it, destroying everything in its path.
This spell is fully MUI, up to 100 instances (maximum number of instances possible with the way the spell is currently made is about 300 since there is 27 bolts fired per cast, and 8192 (max array size, isnt it?) divided by 27 will give roughly 300)
Spell is made in GUI, with small amount of JASS for leak removal
There are no leaks that I can see
There is a small bit of lag, but considering about 7 or 8+ units are being periodically moved at a time, it isn't bad (BEWARE: SPAMMING THIS SPELL 5+ TIMES BEFORE THE OTHER ORBS HAVE BEEN DESTROYED IS A VERY BAD IDEA)
Code:
Implementing:
-Copy the 5 triggers within the Frozen Orb category
-Copy ALL the custom units (Hidden Dummy, Bolt Dummy, Orb Dummy).
-Copy the hero ability Frozen Orb
-Change any necessary configurable properties (they have comments above them)
-Add the Frozen Orb ability to your hero.
Screenshots (they are pretty damn large ^^):
Code:
Trigger:
- FO Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Frozen Orb
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- OrbCV Less than 100
- Then - Actions
- Set OrbCV = (OrbCV + 1)
- Else - Actions
- Set OrbCV = 1
- If - Conditions
- Set Caster[OrbCV] = (Triggering unit)
- Set CasterLoc[OrbCV] = (Position of Caster[OrbCV])
- Set TargetPt[OrbCV] = (Target point of ability being cast)
- Set InitAngle[OrbCV] = (Angle from TargetPt[OrbCV] to CasterLoc[OrbCV])
- Unit - Create 1 Orb Dummy for (Owner of Caster[OrbCV]) at CasterLoc[OrbCV] facing (InitAngle[OrbCV] - 180.00) degrees
- Unit - Set the custom value of (Last created unit) to OrbCV
- Set OrbDummy[OrbCV] = (Last created unit)
- -------- Orb damage configuration --------
- Set OrbDamage[OrbCV] = ((Random real number between 18.00 and 40.00) + ((Random real number between 10.00 and 15.00) x (Real((Level of Frozen Orb for Caster[OrbCV])))))
- Unit Group - Add (Last created unit) to OrbGroup
- Set OrbDist[OrbCV] = 0.00
- Trigger - Add to FO orb damage <gen> the event (Unit - A unit comes within 100.00 of OrbDummy[OrbCV])
- Custom script: call RemoveLocation (udg_CasterLoc[udg_OrbCV])
- Custom script: call RemoveLocation (udg_TargetPt[udg_OrbCV])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- FO movement
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Number of units in BoltGroup) Greater than 0
- (Number of units in OrbGroup) Greater than 0
- Conditions
- Or - Any (Conditions) are true
- Actions
- Unit Group - Pick every unit in OrbGroup and do (Actions)
- Loop - Actions
- Set OrbLoc[(Custom value of (Picked unit))] = (Position of (Picked unit))
- -------- Orb speed configuration --------
- Set NewOrbLoc[(Custom value of (Picked unit))] = (OrbLoc[(Custom value of (Picked unit))] offset by 20.00 towards (InitAngle[(Custom value of (Picked unit))] - 180.00) degrees)
- Unit - Move (Picked unit) instantly to NewOrbLoc[(Custom value of (Picked unit))]
- Unit - Create 1 Hidden Dummy for (Owner of (Picked unit)) at NewOrbLoc[(Custom value of (Picked unit))] facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
- Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
- Unit Group - Pick every unit in OrbDamageGroup and do (Actions)
- Loop - Actions
- -------- This is where the damage for the orb occurs --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is alive) Equal to True
- ((Picked unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True
- Then - Actions
- Unit - Cause OrbDummy[(Custom value of (Last created unit))] to damage (Picked unit), dealing OrbDamage[(Custom value of (Last created unit))] damage of attack type Spells and damage type Normal
- Floating Text - Create floating text that reads ((String((Integer(OrbDamage[(Custom value of (Last created unit))])))) + !) above (Picked unit) with Z offset 0.00, using font size 9.00, color (0.00%, 0.00%, 100.00%), and 30.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- -------- Orb damage text floats down --------
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 270.00 degrees
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
- -------- Damage is randomized everytime a unit is hit --------
- Set OrbDamage[(Custom value of (Picked unit))] = ((Random real number between 18.00 and 40.00) + ((Random real number between 10.00 and 15.00) x (Real((Level of Frozen Orb for Caster[(Custom value of (Picked unit))])))))
- Unit Group - Remove (Picked unit) from OrbDamageGroup
- Else - Actions
- Unit Group - Remove (Picked unit) from OrbDamageGroup
- If - Conditions
- Loop - Actions
- -------- This counts how long the orb has been alive --------
- Set OrbDist[(Custom value of (Picked unit))] = (OrbDist[(Custom value of (Picked unit))] + 0.04)
- -------- This is the maximum lifetime of the orb (ignore the variable name) --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- OrbDist[(Custom value of (Picked unit))] Greater than or equal to 2.50
- Then - Actions
- Unit Group - Remove (Picked unit) from OrbGroup
- Unit - Remove (Picked unit) from the game
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_OrbLoc[GetUnitUserData(GetEnumUnit())])
- Custom script: call RemoveLocation (udg_NewOrbLoc[GetUnitUserData(GetEnumUnit())])
- Loop - Actions
- Unit Group - Pick every unit in BoltGroup and do (Actions)
- Loop - Actions
- Set BoltLoc[(Custom value of (Picked unit))] = (Position of (Picked unit))
- -------- Bolt speed configuration --------
- Set NewBoltLoc[(Custom value of (Picked unit))] = (BoltLoc[(Custom value of (Picked unit))] offset by 25.00 towards (Facing of (Picked unit)) degrees)
- Unit - Move (Picked unit) instantly to NewBoltLoc[(Custom value of (Picked unit))]
- Unit - Create 1 Hidden Dummy for (Owner of (Picked unit)) at NewBoltLoc[(Custom value of (Picked unit))] facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
- Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
- Unit Group - Pick every unit in BoltDamageGroup and do (Actions)
- Loop - Actions
- -------- This is where bolt damage occurs --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is alive) Equal to True
- ((Picked unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True
- Then - Actions
- Unit - Cause BoltDummy[(Custom value of (Last created unit))] to damage (Picked unit), dealing BoltDamage[(Custom value of (Last created unit))] damage of attack type Spells and damage type Normal
- Floating Text - Create floating text that reads ((String((Integer(BoltDamage[(Custom value of (Last created unit))])))) + !) above (Picked unit) with Z offset 0.00, using font size 7.00, color (40.00%, 30.00%, 70.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- -------- Bolt damage text floats up --------
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
- -------- Bolt damage is randomized after a unit is hit --------
- Set BoltDamage[(Custom value of (Last created unit))] = ((Random real number between 1.00 and 17.00) + ((Random real number between 5.00 and 10.00) x (Real((Level of Frozen Orb for Caster[(Custom value of (Picked unit))])))))
- Unit Group - Remove (Picked unit) from BoltDamageGroup
- Else - Actions
- Unit Group - Remove (Picked unit) from BoltDamageGroup
- If - Conditions
- Loop - Actions
- -------- This counts how long the bolt has been alive for --------
- Set BoltDist[(Custom value of (Picked unit))] = (BoltDist[(Custom value of (Picked unit))] + 0.04)
- -------- This determines how long the bolt will live --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- BoltDist[(Custom value of (Picked unit))] Greater than or equal to 0.75
- Then - Actions
- Unit Group - Remove (Picked unit) from BoltGroup
- Unit - Remove (Picked unit) from the game
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_BoltLoc[GetUnitUserData(GetEnumUnit())])
- Custom script: call RemoveLocation (udg_NewBoltLoc[GetUnitUserData(GetEnumUnit())])
- Loop - Actions
- Unit Group - Pick every unit in OrbGroup and do (Actions)
- Events
Trigger:
- FO boltspawn
- Events
- Time - Every 0.11 seconds of game time
- Conditions
- (Number of units in OrbGroup) Greater than 0
- Actions
- Unit Group - Pick every unit in OrbGroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- BoltCV Less than 2700
- Then - Actions
- Set BoltCV = (BoltCV + 1)
- Else - Actions
- Set BoltCV = 1
- If - Conditions
- Set OrbLoc[(Custom value of (Picked unit))] = (Position of (Picked unit))
- -------- The angle at which each ice bolt will fly --------
- Set SpawnAngle[(Custom value of (Picked unit))] = (SpawnAngle[(Custom value of (Picked unit))] + 40.00)
- Unit - Create 1 Bolt Dummy for (Owner of (Picked unit)) at OrbLoc[(Custom value of (Picked unit))] facing SpawnAngle[(Custom value of (Picked unit))] degrees
- Unit - Set the custom value of (Last created unit) to BoltCV
- Unit Group - Add (Last created unit) to BoltGroup
- Set BoltDummy[(Custom value of (Last created unit))] = (Last created unit)
- -------- Bolt damage configuration --------
- Set BoltDamage[(Custom value of (Last created unit))] = ((Random real number between 1.00 and 17.00) + ((Random real number between 5.00 and 10.00) x (Real((Level of Frozen Orb for Caster[(Custom value of (Picked unit))])))))
- Set BoltDist[BoltCV] = 0.00
- Trigger - Add to FO bolt damage <gen> the event (Unit - A unit comes within 100.00 of BoltDummy[BoltCV])
- Custom script: call RemoveLocation (udg_OrbLoc[GetUnitUserData(GetEnumUnit())])
- Custom script: call RemoveLocation (udg_NewOrbLoc[GetUnitUserData(GetEnumUnit())])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in OrbGroup and do (Actions)
- Events
Trigger:
- FO orb damage
- Events
- Conditions
- Actions
- -------- All the damage dealt is dealt with in the movement trigger --------
- Unit Group - Add (Triggering unit) to OrbDamageGroup
Trigger:
- FO bolt damage
- Events
- Conditions
- Actions
- -------- All the damage dealt is dealt with in the movement trigger --------
- Unit Group - Add (Triggering unit) to BoltDamageGroup
Please leave feedback, bug reports and suggestions.
If you are going to use this spell in your map, please give me credit
Officially approved as of 3rd Jan 2008 ^^ (my second approved spell, and my final GUI spell)
HUGE UPDATE!
I've reworked the damage triggers, so that potential bug about ownership of damaging unit will NOT occur. I've also removed all instances of (Custom Value of (Picked Unit)) and replaced it with tempint.
The spell should now be safe when repeatedly cast.