• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Torrent Slash v1.02

Hello! I decided to update my spell, after a long time of waiting.
===================================
Calls forth several blades to converge towards the caster after a few seconds.



  • Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The ability --------
      • Set Cnfg_TS_Ability = Torrent Slash
      • -------- ---------------------------------- --------
      • -------- Angle Reduction of the four blades. --------
      • Set Cnfg_TS_AngleRed = 6.20
      • -------- The number of blades created --------
      • Set Cnfg_TS_Blades = 6
      • -------- Damage of the Blades --------
      • Set Cnfg_TS_BladeDamage[1] = 25.00
      • Set Cnfg_TS_BladeDamage[2] = 32.00
      • Set Cnfg_TS_BladeDamage[3] = 40.00
      • -------- How far the blades can damage units --------
      • Set Cnfg_TS_BladeDamageRange = 66.66
      • Set Cnfg_TS_BladeModel = Abilities\Weapons\BloodElfSpellThiefMISSILE\BloodElfSpellThiefMISSILE.mdl
      • -------- The model of the blood --------
      • Set Cnfg_TS_BladeHitEffect = BloodSplatTiny.mdx
      • -------- The size of the blade in percentage --------
      • Set Cnfg_TS_BladeSize = 150.00
      • -------- Speed --------
      • Set Cnfg_TS_BladeSpeed = 60.00
      • -------- The degrees between each blade creation. If you want a circle, divide 360 by the number of blades. --------
      • Set Cnfg_TS_DegreesPerArray = 60.00
      • -------- Circumference of the blade spawn --------
      • Set Cnfg_TS_DistancePerBlades = 500.00
      • Set Cnfg_TS_DistancePerBlades = (Cnfg_TS_DistancePerBlades / 2.00)
      • -------- How long each blade lasts --------
      • Set Cnfg_TS_DurationMax = 2.22
      • -------- Every other blade receives a decrease in speed, but increase in lifetime. Decimal % --------
      • -------- Warning: Never set to 0.00. --------
      • Set Cnfg_TS_LayerDiff = 1.50
  • Torrent Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cnfg_TS_Ability
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on Torrent Slash Loop <gen>
        • Else - Actions
      • Set OffsetLoc = (Position of (Triggering unit))
      • Set TempInteger = 1
      • -------- Blades --------
      • For each (Integer TempIndex) from 1 to Cnfg_TS_Blades, do (Actions)
        • Loop - Actions
          • -------- Indexing --------
          • Set TS_MaxIndex = (TS_MaxIndex + 1)
          • -------- Cache caster --------
          • Set TS_Caster[TS_MaxIndex] = (Triggering unit)
          • Set TS_Damage[TS_MaxIndex] = Cnfg_TS_BladeDamage[(Level of Cnfg_TS_Ability for TS_Caster[TS_MaxIndex])]
          • -------- Angle/Duration/Speed --------
          • Set TS_Duration[TS_MaxIndex] = Cnfg_TS_DurationMax
          • Set TS_Speed[TS_MaxIndex] = Cnfg_TS_BladeSpeed
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInteger Equal to 1
            • Then - Actions
              • Set TempInteger = 0
            • Else - Actions
              • Set TempInteger = 1
              • -------- Wild One! --------
              • Set TS_Duration[TS_MaxIndex] = (TS_Duration[TS_MaxIndex] x Cnfg_TS_LayerDiff)
              • Set TS_Speed[TS_MaxIndex] = (TS_Speed[TS_MaxIndex] - (TS_Speed[TS_MaxIndex] / Cnfg_TS_LayerDiff))
          • -------- Player --------
          • Set TS_Player[TS_MaxIndex] = (Owner of TS_Caster[TS_MaxIndex])
          • Set TempReal = (Cnfg_TS_DegreesPerArray x (Real(TempIndex)))
          • Set TS_BladeDegree[TS_MaxIndex] = TempReal
          • Set TempPoint = (OffsetLoc offset by Cnfg_TS_DistancePerBlades towards TempReal degrees)
          • Unit - Create 1 Dummy for TS_Player[TS_MaxIndex] at TempPoint facing TS_BladeDegree[TS_MaxIndex] degrees
          • Custom script: set udg_TS_Blade[udg_TS_MaxIndex] = bj_lastCreatedUnit
          • Unit - Add a TS_Duration[TS_MaxIndex] second Generic expiration timer to TS_Blade[TS_MaxIndex]
          • Animation - Change TS_Blade[TS_MaxIndex]'s size to (Cnfg_TS_BladeSize%, 0.00%, 0.00%) of its original size
          • Special Effect - Create a special effect attached to the chest of TS_Blade[TS_MaxIndex] using Cnfg_TS_BladeModel
          • Set TS_BladeEffect[TS_MaxIndex] = (Last created special effect)
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_OffsetLoc)
  • Torrent Slash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempIndex) from 1 to TS_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TS_Duration[TempIndex] Greater than 0.00
            • Then - Actions
              • Set TS_Duration[TempIndex] = (TS_Duration[TempIndex] - 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TS_Blade[TempIndex] is alive) Equal to True
                • Then - Actions
                  • -------- ------------ --------
                  • Set TempPoint = (Position of TS_Blade[TempIndex])
                  • Set TS_BladeDegree[TempIndex] = (TS_BladeDegree[TempIndex] - Cnfg_TS_AngleRed)
                  • Set OffsetLoc = (TempPoint offset by TS_Speed[TempIndex] towards TS_BladeDegree[TempIndex] degrees)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Unit - Move TS_Blade[TempIndex] instantly to OffsetLoc, facing TS_BladeDegree[TempIndex] degrees
                  • -------- Damage Group --------
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within Cnfg_TS_BladeDamageRange of OffsetLoc) and do (Actions)
                    • Loop - Actions
                      • Set TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Life of TempUnit) Greater than 0.41
                          • (TempUnit belongs to an enemy of TS_Player[TempIndex]) Equal to True
                        • Then - Actions
                          • Unit - Cause TS_Caster[TempIndex] to damage TempUnit, dealing TS_Damage[TempIndex] damage of attack type Spells and damage type Universal
                          • Special Effect - Create a special effect attached to the chest of TempUnit using Cnfg_TS_BladeHitEffect
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                  • Custom script: call RemoveLocation(udg_OffsetLoc)
                • Else - Actions
            • Else - Actions
              • -------- Leak Removal --------
              • Custom script: call DestroyEffect(udg_TS_BladeEffect[udg_TempIndex])
              • -------- Here, we replace the CurrentIndex with the Max. --------
              • Set TS_Blade[TempIndex] = TS_Blade[TS_MaxIndex]
              • Set TS_BladeDegree[TempIndex] = TS_BladeDegree[TS_MaxIndex]
              • Set TS_BladeEffect[TempIndex] = TS_BladeEffect[TS_MaxIndex]
              • Set TS_Caster[TempIndex] = TS_Caster[TS_MaxIndex]
              • Set TS_Damage[TempIndex] = TS_Damage[TS_MaxIndex]
              • Set TS_Duration[TempIndex] = TS_Duration[TS_MaxIndex]
              • Set TS_Speed[TempIndex] = TS_Speed[TS_MaxIndex]
              • Set TS_MaxIndex = (TS_MaxIndex - 1)
              • Set TempIndex = (TempIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TS_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Custom script: set udg_TempUnit = null
v1.00 - Uploaded
x/x/13 v1.01 - Fixed some little things.
8/1/14 v.1.02 - Overhaul.


Icon: lelyanra, recolored by me.


Keywords:
Torrent, Slash, Torrent Slash, Cake
Contents

Torrent Slash (Map)

Reviews
BPower: Approved. Old: Torrent Slash v1.01 | Reviewed by Maker | 30th Jun 2013 NEEDS FIX You are leaking special effects in the looping trigger [tr] You could index the blade unit / degree / effect into single...

Moderator

M

Moderator

BPower: Approved.

Old:

Torrent Slash v1.01 | Reviewed by Maker | 30th Jun 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • You are leaking special effects in the looping trigger
126248-albums6177-picture66523.png


  • You could index the blade unit / degree / effect into single
    arrays to avoid long if/then/elses in the cast and looping trigger
[tr]
 
In the configuration trigger,there is a for loop action. In configurations,we don't use this,we put the values one by one in-case the user wants to have damage not relative to each other(e.g level 1 = 100, level 2 = 54.5, level 3 = 184.5,etc)

and also, as I have mentioned to your spells and the other rejected spells that are in GUI must have their variables have a prefix,some of your variables are missing it.
 
TempPoint ,Temp Unit, etc.
Btw, for loop must start at 1.

and also, because of its current state about the glaives,the glaive number is not recommended as configurable anymore. It will be hard for those beginners to CnP the codes just to index the glaives 5>.

Btw, Unit group range should be configurable.

Replace UnitApplyTimedLifeBJ with call UnitApplyTimedLife(whichUnit, buffId, duration)
and also, doing it in custom script is useless because GUI 99% BJS.

JASS:
//===========================================================================

function UnitApplyTimedLifeBJ takes real duration, integer buffId, unit whichUnit returns nothing

    call UnitApplyTimedLife(whichUnit, buffId, duration)

endfunction

For the unit scaling(actions), set the other two values to 0. X is enough for scaling.
So its (size, 0, 0)

Ability Level of Caster must be indexed.

Your indexing has a problem. You are not moving the last index to the removed index,you are just nulling the values of the removed index.
It must be, ex.:
set unitData[tempIndex] = unitData[lastIndex]

Damage effect attachments should be configurable.

TempPoint[0] = (TS_CasterPos[TempInteger[0]] offset by 400.00 towards 270.00 degrees)

400 and 270 must be configurable as well.
 
i dont like the arrayed lvls for this. i rather it this way although it kills what almia suggested. about lvl 2 being lower than lvl 1 for damage.

i have 2 variables for damage one is called damageBase. the other is called damagePerLvl. the formula then goes like this. damageBase + ( abilityLvl * damagePerLvl)
lets say my base is 500 and my per lvl one is 250.
this means lvl 1 is 750. lvl 2 is 1000. lvl 3 is 1250 and so on.
The best thing about this is those 2 variables work for all the lvls. As many lvl as u want. so if i want to change my ability to have 100 lvls then i dont have to have 100 lines of the damage. Those 2 variables already do it. example: lvl 100 would be like this 500 + ( 100 * 250)
which would come out to be 25500 damage.

ur indexing is also old style. i thought u learned the way i did it ?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
@deathismyfriend
Level 1 - 300 Damage
Level 2 - 330 Damage
Level 3 - 420 Damage
Level 4 - 760 Damage

Solve this.

@OT
It is better to do it like this;
  • Actions
    • Set Damage[1] = 300.00
    • Set Damage[2] = 330.00
    • Set Damage[3] = 420.00
    • Set Damage[4] = 760.00
It gives more freedom to the user and bend the spells' configuration to his/her will.

In the cast trigger, you just need to do this;
  • Set DamageDealt = Damage[(Level of (Ability being cast) for (Triggering unit))]
Or if you have multiple setup;
  • Actions
    • Set TempInt = (Level of (Ability being cast) for (Triggering unit))
    • Set DamageDealt = Damage[TempInt]
    • Set AreaOfEffect = AOE[TempInt]
    • Set Range = Distance[TempInt]
But yes, everything in this world has pros and cons, right ?

Formula-based
Pros
- Works with any kinds of level
- No need extra work - just to need to find the right formula

Cons
- Value is in scale
Indexing-based
Pros
- You can alter its value per level without being attached to a certain scale
- Easy to understand and get what level does what damage

Cons
- If you have 100 levels = 100 lines of code
So you just have to find which situation fits you the best.

If your spell only has 5 levels or at least 10, just use Indexing-based.

If your spell has 20 level or more, just Formula-based.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
In order to save computation time you should store TriggeringUnit into a variable. Variables lookups are much faster than function calls, consider the loop.

  • (Life of TempUnit) Greater than 0.41
--> Change this IsUnitAlive, in a narrow sense units with 0.41 life are not dead. The excact border would be 0.405

Damagetype and Attacktype could be configurable.
 
Top