The Hive Workshop Spells:
SPIN VERSION 1.1
Images
Details
Uploaded: 03:00, 22nd Jul 2012
Last Updated: 04:56, 22nd Jul 2012
Keywords: Spin, Lightning, Spiral, Comments, Herp, THE SPELL SPINS LIKE A CHAIR, SPIN IT TO WIN IT, SPIN ME BABY ONE MORE TIME, DERP, -, GUI, JASS, Capslock
Type: Target Ground
Category: GUI / Triggers
SPIN
SPIN
Ingame Description
The caster fires up lasers at the targeted location. The lasers will spin in a circle and then fire outwards, stunning and harming all those near the lasers.
TRIGGERS
SpinInt
SpinCastdurr
Events
Conditions
Actions
-------- --------
-------- --------
-------- --------
-------- --------
-------- --------
-------- THIS IS YOUR CASTER. --------
Set SPU = (Triggering unit)
-------- THIS IS THE TARGETING POINT --------
Set SP1 = (Target point of ability being cast)
-------- THIS IS YOUR DUMMY --------
Custom script: set udg_SPU2 = CreateUnitAtLoc(GetTriggerPlayer(), udg_SpinDummyId, udg_SP1, 270)
-------- THIS IS YOUR HANDLE --------
Custom script: set udg_Handle_Spin = GetHandleId(udg_SPU2)
-------- THESE ARE YOUR LIGHTNINGS --------
Set SPI3 = (Random integer number between 1 and 3)
For each (Integer SPI2) from 1 to 8, do (Actions)
Loop - Actions
Set SP2 = (SP1 offset by Spin_Lighting_Distance towards ((Real(SPI2)) x 45.00) degrees)
-------- LIGHTNING RAWR --------
Custom script: set udg_SL = AddLightningEx(udg_SLT, true , GetLocationX(udg_SP2), GetLocationY(udg_SP2), GetLocationZ(udg_SP2) + (udg_SPH), GetLocationX(udg_SP2), GetLocationY(udg_SP2), GetLocationZ(udg_SP2) + (udg_SPH) )
-------- LIGHTNING COLOR --------
-------- RED, GREEN, BLUE, GHOST --------
-------- LOOK BLUE! A PAINTBRUSH! --------
Custom script: call SetLightningColor(udg_SL, udg_SLB[udg_SPI3], udg_SLB[udg_SPI3*6], udg_SLB[udg_SPI3*5], 1)
-------- SAVE YOUR LIGHTNING --------
Custom script: call SaveLightningHandle(udg_Hash_Spin, udg_Handle_Spin, udg_SPI2, udg_SL)
-------- KILL BAD THINGS --------
Custom script: call RemoveLocation(udg_SP2)
-------- --------
-------- THIS IS YOUR ABILITY LEVEL --------
Set SPI = (Level of Spin for SPU)
-------- --------
-------- --------
-------- --------
-------- THIS IS YOUR DAMAGE --------
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 9, udg_Spin_RotationDamage * udg_SPI)
-------- THIS IS YOUR LAUNCH DAMAGE --------
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 10, udg_Spin_FireDamage * udg_SPI)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-------- THIS IS THE VALUE WHICH THE LASER'S DISTANCE INCREASES BY PER MOVEMENT UNTIL IT REACHES THE MAXIMUM AoE --------
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 14, udg_Spin_MaxAoE / (udg_Spin_StartingAoE*4))
-------- THIS IS THE LIGHTNING'S STARTING DISTANCE. --------
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 16, udg_Spin_StartingAoE)
-------- THIS IS WHERE WE SAVE THE HERO FOR THOSE NITPICKERS. --------
Custom script: call SaveUnitHandle(udg_Hash_Spin, udg_Handle_Spin, 15, udg_SPU)
-------- THIS IS WHERE WE SAVE THE LEVEL OF THE ABILITY. --------
Custom script: call SaveInteger(udg_Hash_Spin, udg_Handle_Spin, 0, udg_SPI)
-------- THIS IS WHERE WE SET THE DURATION OF THE LAUNCH. --------
Custom script: call SaveInteger(udg_Hash_Spin, udg_Handle_Spin, 23, 60)
-------- --------
-------- --------
-------- ADD THE DUMMY UNIT TO THE UNIT GROUP --------
Custom script: call GroupAddUnit(udg_Spin_Group, udg_SPU2)
-------- INCREASE THE TRIGGER RAWEGJLHAWE;LRGHAL;EGHEJLARGAER --------
Set Spin_Integur = (Spin_Integur + 1)
-------- START THE SPELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL --------
Trigger - Turn on SpinSpinSPIN <gen>
-------- THIS IS YOUR BOOMSTICK --------
Custom script: call RemoveLocation(udg_SP1)
SpinSpinSPIN
Events
Conditions
Actions
Unit Group - Pick every unit in Spin_Group and do (Actions)
Loop - Actions
Set SPU = (Picked unit)
Custom script: set udg_Handle_Spin = GetHandleId(udg_SPU)
Set SP1 = (Position of SPU)
-------- LOAD VARIABLES --------
Custom script: set udg_SR1 = LoadReal(udg_Hash_Spin, udg_Handle_Spin, 16)
Custom script: set udg_SR3 = LoadReal(udg_Hash_Spin, udg_Handle_Spin, 11)
Custom script: set udg_Spin_LaunchBool = LoadBoolean(udg_Hash_Spin, udg_Handle_Spin, 21)
-------- MOVE LIGHTNING --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Else - Actions
Custom script: set udg_SPU4 = LoadUnitHandle(udg_Hash_Spin, udg_Handle_Spin, 15)
Custom script: set udg_Spin_EffeciencyReal = LoadReal(udg_Hash_Spin, udg_Handle_Spin, 10)
Custom script: set udg_SPI3 = LoadInteger(udg_Hash_Spin, udg_Handle_Spin, 0)
Custom script: set udg_SPI4 = LoadInteger(udg_Hash_Spin, udg_Handle_Spin, 23) - 1
Custom script: call SaveInteger(udg_Hash_Spin, udg_Handle_Spin, 23, udg_SPI4)
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 16, udg_SR1 + LoadReal(udg_Hash_Spin, udg_Handle_Spin, 14) * 2.6)
Custom script: set udg_SR2 = LoadReal(udg_Hash_Spin, udg_Handle_Spin, 17) + (udg_SR3 / 5)
Set Spin_Player = (Owner of SPU)
For each (Integer SPI) from 1 to 8, do (Actions)
Loop - Actions
Set Spin_EffeciencyReal = (SR2 + (45.00 x (Real(SPI))))
Custom script: set udg_SL = LoadLightningHandle(udg_Hash_Spin, udg_Handle_Spin, udg_SPI)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Else - Actions
Set SP2 = (SP1 offset by (((SR1 x 1.20) + Spin_StartingAoE) - Spin_MaxAoE) towards Spin_EffeciencyReal degrees)
Set SP3 = (SP1 offset by (SR1 + Spin_StartingAoE) towards Spin_EffeciencyReal degrees)
-------- JIMMY MATHS. --------
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within (Spin_MaxAoE x (0.01 x (60.00 - (Real(SPI4))))) of SP2 matching (((Owner of (Matching unit)) Not equal to Spin_Player) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit and do (Actions)
Loop - Actions
Set SPU2 = (Picked unit)
Custom script: call UnitDamageTarget(udg_SPU4, udg_SPU2, udg_Spin_EffeciencyReal, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
Custom script: set udg_SPU3 = CreateUnitAtLoc(udg_Spin_Player, udg_SpinDummyId, udg_SP1, 270)
Unit - Add SHORT STUN (THIS IS YOUR STUN) to SPU3
Custom script: call SetUnitAbilityLevel(udg_SPU3, udg_Spin_ShortStun, udg_SPI3)
Custom script: call IssueTargetOrder( udg_SPU3, udg_SpinAbilityString2, udg_SPU2 )
Custom script: call UnitApplyTimedLife( udg_SPU3, 'BTLF', 1 )
Custom script: call SetUnitExploded( udg_SPU3, true )
Custom script: call GroupAddUnit(udg_Spin_DamageGroup, udg_SPU2)
Set Spin_Integur = (Spin_Integur + 1)
Custom script: set udg_SPI3 = GetHandleId(udg_SPU2)
Custom script: call SaveInteger(udg_Hash_Spin, udg_SPI3, 22, 33)
Custom script: call MoveLightningEx(udg_SL, true , GetLocationX(udg_SP2), GetLocationY(udg_SP2), GetLocationZ(udg_SP2) + (udg_SPH), GetLocationX(udg_SP3), GetLocationY(udg_SP3), GetLocationZ(udg_SP3) + (udg_SPH) )
Custom script: call RemoveLocation(udg_SP2)
Custom script: call RemoveLocation(udg_SP3)
-------- ADJUST VARIABLES, INFLICT DAMAGE --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
-------- SARGE, WE'RE GOING TO NEED A BUCKET --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Custom script: set udg_SR2 = 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Custom script: set udg_SPU4 = LoadUnitHandle(udg_Hash_Spin, udg_Handle_Spin, 15)
Custom script: set udg_Spin_EffeciencyReal = LoadReal(udg_Hash_Spin, udg_Handle_Spin, 9)
Set Spin_Player = (Owner of SPU)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within (Spin_StartingAoE + SR1) of SP1 matching (((Owner of (Matching unit)) Not equal to Spin_Player) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is Magic Immune) Equa and do (Actions)
Loop - Actions
Set SPU2 = (Picked unit)
Custom script: call UnitDamageTarget(udg_SPU4, udg_SPU2, udg_Spin_EffeciencyReal, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Custom script: set udg_SPU3 = CreateUnitAtLoc(udg_Spin_Player, udg_SpinDummyId, udg_SP1, 270)
Unit - Add LONG STUN (THIS IS YOUR STUN) to SPU3
Custom script: call IssueTargetOrder( udg_SPU3, udg_SpinAbilityString, udg_SPU2 )
Custom script: call UnitApplyTimedLife( udg_SPU3, 'BTLF', 1 )
Custom script: call SetUnitExploded( udg_SPU3, true )
Custom script: call GroupAddUnit(udg_Spin_DamageGroup, udg_SPU2)
Set Spin_Integur = (Spin_Integur + 1)
Custom script: set udg_SPI3 = GetHandleId(udg_SPU2)
Custom script: call SaveInteger(udg_Hash_Spin, udg_SPI3, 22, 33)
Else - Actions
Else - Actions
Else - Actions
Custom script: call SaveReal(udg_Hash_Spin, udg_Handle_Spin, 17, udg_SR2)
-------- LAUNCH --------
-------- IT'S SUPER EFFECTIVE --------
Custom script: if udg_Spin_LaunchBool == false and LoadBoolean(udg_Hash_Spin, udg_Handle_Spin, 19) and LoadBoolean(udg_Hash_Spin, udg_Handle_Spin, 20) then
Custom script: call SaveBoolean(udg_Hash_Spin, udg_Handle_Spin, 21, true)
Custom script: endif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Custom script: call RemoveLocation(udg_SP1)
Unit Group - Pick every unit in Spin_DamageGroup and do (Actions)
Update Log
Quote:
v1.0 Uploaded
v1.1 Efficiency supreme
Rating - 0.00 (0 votes)
Moderator Comments
Recommended
07:53, 22nd Jul 2012
Magtheridon96: Approved.
THIS IS YOUR REVIEW
http://www.hiveworkshop.com/forums/2187672-post3.html
This spell is very well-written and readable :>
It just needs a few minor enhancements.
This spell is approved and works properly.
(32.97 KB, 448 Downloads)
07-22-2012, 03:04 AM
#2 (permalink )
User
Join Date: Jun 2011
Posts: 165
Last edited by -Derp-; 07-22-2012 at 03:34 AM .
07-22-2012, 04:23 AM
#3 (permalink )
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,700
In JASS, == true is the most useless thing ever because you could remove it and be unaffected ^_^
edit
So much win xD
Tips:
What if I told you,
this could all be optimized to ONE line O: :O O:
(You need 3 arrays to set on map init)
edit
Since I know you're an exceptional GUIer and decent JASS-scripter, I'm going to be a bit stricter here ;D
Since you're using custom scripts, you might as well use coordinates instead of locations :p
Instead of the target point, use GetSpellTargetX() and GetSpellTargetY().
edit
This also means that CreateUnitAtLoc has got to go. Use CreateUnit.
edit
A better screenshot would be nice :C
Last edited by Magtheridon96; 07-22-2012 at 04:58 AM .
07-22-2012, 04:36 AM
#4 (permalink )
Most spells/systems
Join Date: May 2009
Posts: 1,193
Ow, blinding screenshot you have there
07-22-2012, 02:57 PM
#5 (permalink )
User
Join Date: Jun 2011
Posts: 165
Thanks Magtheridon!
I've updated the screenshot, I'll update the code soon.
Updated, fixed stuff.
Last edited by -Derp-; 07-29-2012 at 08:57 PM .
08-04-2012, 02:07 PM
#6 (permalink )
User
Join Date: Aug 2012
Posts: 18
Can i ask that why everybody always use "channel" ability to make a new ability?
08-04-2012, 05:27 PM
#7 (permalink )
User
Join Date: Jun 2011
Posts: 165
It's used as the ability doesn't cause any side effects like damage and you can set the ability's stats. i.e. target type
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 06:24 PM .