War Barrage v1.1
by Magoiche
by Magoiche
GUI/JASS: vJASS
MUI/MPI: MUI and MPI
Leakless?: Yep
Lagless?: Yep
Requirements: NewGen and PolledWait2(Inside the Map)
Import Difficult: Medium
Description: Using his amazing skills of nanotechnology the caster create a etheral indestructable tank in 0.25 seconds. The casters enters the tank and start sending waves of powerfull rockets doing damage in an AoE every 0.20 seconds and stuning enemies for 1 second.
Level 1 - 20 Damage and 175 AoE.
Level 2 - 30 Damage and 200 AoE.
Level 3 - 40 Damage and 225 AoE.
Level 4 - 50 Damage and 250 AoE.
Screenshots:
Code:
JASS:
//////////////////////////////////////////////
//// War Barrage ////
//// by Magoiche Saika ////
//////////////////////////////////////////////
////NOTE: Everything that you can't change////
//// in this script you can in the ////
//// Object Editor. ////
//////////////////////////////////////////////
scope WarBarrage initializer Initial
globals
private constant integer WarBarrageSpellRawData = 039;A000039;
// Raw Data of the War Barrage spell
private constant integer WarBarrageTankDummyRawData = 039;u000039;
// Raw Data of the Tank Dummy that will apear in the place of the caster
private constant integer RocketsSpellRawData = 039;A001039;
// Raw Data of the Rockets spell
private constant integer WarBarrageDummyRawData = 039;u001039;
// Raw Data of the Dummy
private constant integer WarBarrageNumberOfWavesPerLevel = 2
// Number of waves per level Ex: Lvl-1: 2 Lvl-2: 4...
private constant real WarBarrageTimeBetweenWaves = 0.25
// Time between each wave
private constant real WarBarrageDistanceOfWaves = 150
// Distance between each wave
private constant real WarBarrageDummyTimedLife = 3
// The time the Dummy will live. Put it something more than the Effect Duration for the Rockets Spell
private constant string RocketsOrderString = "clusterrockets"
// Rockets Use/Turn On Order Id
private constant integer WarBarrageTankDummyRedVertexColor = 255
// Red Vertex Color for the Tank. Max 255 Min 0
private constant integer WarBarrageTankDummyGreenVertexColor = 255
// Green Vertex Color for the Tank. Max 255 Min 0
private constant integer WarBarrageTankDummyBlueVertexColor = 255
// Blue Vertex Color for the Tank. Max 255 Min 0
private constant integer WarBarrageTankDummyTrasnparency = 190
// Transparency for the Tank. Max 255 Min 0
private constant real WarBarrageDestroyTreeAoE = 250
// AoE that each wave will kill trees. Put 0 and trees won't be destroyed.
private constant string WarBarrageEnterTankSpecialEffect = "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl"
// Effect that apears when the caster enters the tank
endglobals
private function PolledWait2 takes real Duration returns nothing
local real TimeRemaining
local real st = TimerGetElapsed( bj_gameStartedTimer )
if st <= 0 then
set bj_gameStartedTimer = CreateTimer()
call TimerStart( bj_gameStartedTimer, 1000000, false, null )
endif
if Duration > 0 then
loop
set TimeRemaining = Duration - TimerGetElapsed( bj_gameStartedTimer ) + st
exitwhen TimeRemaining <= 0
if ( TimeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD ) then
call TriggerSleepAction( 0.1 * TimeRemaining )
else
call TriggerSleepAction( bj_POLLED_WAIT_INTERVAL )
endif
endloop
endif
endfunction
private function EnumDestructablesInCircle2 takes real radius, location loc, code actionFunc returns nothing
local rect r
local real centerX = GetLocationX( loc )
local real centerY = GetLocationY( loc )
if radius > 0 then
set bj_enumDestructableCenter = loc
set bj_enumDestructableRadius = radius
set r = Rect( centerX - radius, centerY - radius, centerX + radius, centerY + radius )
call EnumDestructablesInRect( r, filterEnumDestructablesInCircleBJ, actionFunc )
call RemoveRect( r )
endif
set r = null
endfunction
private function KillTrees takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == WarBarrageSpellRawData
endfunction
private function Actions takes nothing returns nothing
local integer LoopAIndex = 0
local real WaveDistance = WarBarrageDistanceOfWaves
local unit Caster = GetTriggerUnit()
local real CasterFacing = GetUnitFacing( Caster )
local real x = GetUnitX( Caster )
local real y = GetUnitY( Caster )
local unit Dummy = CreateUnit( GetOwningPlayer( Caster ), WarBarrageTankDummyRawData, x, y, CasterFacing )
local real CastX
local real CastY
local location CastLoc
local integer NumberOfWaves = WarBarrageNumberOfWavesPerLevel * GetUnitAbilityLevel( Caster, WarBarrageSpellRawData )
call SetUnitPathing( Caster, false )
call DestroyEffect( AddSpecialEffect( WarBarrageEnterTankSpecialEffect, x, y ) )
call SetUnitPosition( Dummy, x, y )
call ShowUnit( Caster, false )
call SelectUnit( Caster, false )
call SetUnitVertexColor( Dummy, WarBarrageTankDummyRedVertexColor, WarBarrageTankDummyGreenVertexColor, WarBarrageTankDummyBlueVertexColor, WarBarrageTankDummyTrasnparency )
call UnitApplyTimedLife( Dummy, 039;BFTL039;, ( NumberOfWaves * WarBarrageTimeBetweenWaves ) + WarBarrageDummyTimedLife )
set x = x + 50 * Cos( CasterFacing * 0.017 )
set y = y + 50 * Sin( CasterFacing * 0.017 )
loop
exitwhen LoopAIndex >= NumberOfWaves
set Dummy = CreateUnit( GetOwningPlayer( Caster ), WarBarrageDummyRawData, x, y, CasterFacing )
set CastX = x + WaveDistance * Cos( CasterFacing * 0.017 )
set CastY = y + WaveDistance * Sin( CasterFacing * 0.017 )
set CastLoc = Location( CastX, CastY )
call UnitApplyTimedLife( Dummy, 039;BFTL039;, WarBarrageDummyTimedLife )
call UnitAddAbility( Dummy, RocketsSpellRawData )
call SetUnitAbilityLevel( Dummy, RocketsSpellRawData, GetUnitAbilityLevel( Caster, WarBarrageSpellRawData ) )
call IssuePointOrder( Dummy, RocketsOrderString, CastX, CastY )
call PolledWait2( WarBarrageTimeBetweenWaves )
call EnumDestructablesInCircle2( WarBarrageDestroyTreeAoE, CastLoc, function KillTrees )
set LoopAIndex = LoopAIndex + 1
set WaveDistance = WaveDistance + WarBarrageDistanceOfWaves
endloop
call PolledWait2( WarBarrageDummyTimedLife - ( 1.35 * WarBarrageTimeBetweenWaves ) )
call SetUnitPosition( Caster, x, y )
call ShowUnit( Caster, true )
call SetUnitPathing( Caster, true )
call SelectUnit( Caster, true )
call RemoveLocation( CastLoc )
set CastLoc = null
set Caster = null
set Dummy = null
endfunction
private function Initial takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Actions )
set trig = null
endfunction
endscope
Credits
- Vexorian for the PolledWait2
Changelog
v1.0 - Created and Submited the Spellpack
v1.1 - Fixed the Dummy position. Thanks to Trollvottel
v1.1 - Fixed the Dummy position. Thanks to Trollvottel
Instructions of how to import inside the map!