- Reaction score
- 880
I wouldn't be surprised if there is another spell somewhere similar to this, but I didn't find one and I wanted to make this anyway. 
It's my first spell using vJASS and a scope, so look out for that code!
JASS - vJASS (NewGen Required)
MUI - Very
Works - Is that a question for a spell submission?
Fun - Great explosions will be had by all!
Leaks - 0 Rads of exposure and falling
Thanks to Tinki3 for the cool test map!
Implementation inside!
Here's the code for it. Critiques appreciated.
It's my first spell using vJASS and a scope, so look out for that code!
JASS - vJASS (NewGen Required)
MUI - Very
Works - Is that a question for a spell submission?
Fun - Great explosions will be had by all!
Leaks - 0 Rads of exposure and falling
Thanks to Tinki3 for the cool test map!
Implementation inside!
Artillery Barrage
This spell gives the hero the ability to call up an attack of artillery units from off-screen to splatter your enemies across the map. Or, at least, the spell's AoE.
This spell gives the hero the ability to call up an attack of artillery units from off-screen to splatter your enemies across the map. Or, at least, the spell's AoE.


Here's the code for it. Critiques appreciated.
JASS:
scope ShockArtillery
globals
private constant integer Number = 10 // This indicates the number of artillery attacks.
private constant integer ArtilleryUnit = 'h000' // This is the rawcode of the artillery unit.
private constant integer AbilityCode = 'A000' // This is the rawcode of the actual artillery ability.
private constant integer Range = 400 // This is the range of the attack area of the artillery units.
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == AbilityCode
endfunction
private function ShockArtilleryActions takes nothing returns nothing
local location targetloc = GetSpellTargetLoc()
local location UnitLoc = PolarProjectionBJ(targetloc, 4000, GetUnitFacing(GetTriggerUnit()) + 180)
local location RandomLoc
local integer count = 0
local integer AbilityLevel = GetUnitAbilityLevel(GetTriggerUnit(), AbilityCode)
local unit Artillery
loop
exitwhen count >= Number*AbilityLevel
set count = count + 1
set Artillery = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), ArtilleryUnit, UnitLoc, 0.00)
call ShowUnit(Artillery, false)
set RandomLoc = PolarProjectionBJ(targetloc, GetRandomInt(0, Range/2), GetRandomReal(0, 360))
call IssuePointOrderLoc( Artillery, "attackground", RandomLoc )
call UnitApplyTimedLife(Artillery, 'BTLF', 1.50)
call PolledWait(GetRandomReal(0.10, 0.85))
call RemoveLocation(RandomLoc)
endloop
call RemoveLocation(targetloc)
call RemoveLocation(UnitLoc)
set targetloc = null
set UnitLoc = null
set RandomLoc = null
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger ShockArtillery = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(ShockArtillery, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ShockArtillery, Condition(function Conditions))
call TriggerAddAction( ShockArtillery, function ShockArtilleryActions )
endfunction
endscope
Attachments
-
45.4 KB Views: 373