Spell War Barrage

Magoiche

Member
Reaction score
20
War Barrage v1.1
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:
warbarragexe0.png

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 = 'A000'
    // Raw Data of the War Barrage spell
    private constant integer WarBarrageTankDummyRawData = 'u000'
    // Raw Data of the Tank Dummy that will apear in the place of the caster
    private constant integer RocketsSpellRawData = 'A001'
    // Raw Data of the Rockets spell
    private constant integer WarBarrageDummyRawData = 'u001'
    // 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, 'BFTL', ( 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, 'BFTL', 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

Instructions of how to import inside the map!​
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Code looks good.
Looks good from the screenie too.
Although I think you maybe got a little missile SFX happy ;) :p .
Good nonetheless.

EDIT: Maybe you could link the "NewGen" text to the NewGen Thread?
 

D.V.D

Make a wish
Reaction score
73
Looks like a spammed rocket barrage. Eh, just my opinion.

/D.V.D
/http://gamezonezelda.blogspot.com
 

Magoiche

Member
Reaction score
20
@Wolfie

I don't get the SFX part. i.i
Add the link. Thanks =P

@DVD

Its is like you said.
But with the part you can't die because you are in a indestructable tank.
And its a line of rockets.

Anyway i apreciate your comments.

+rep both
 

BlackRose

Forum User
Reaction score
239
War Barrage looks cool, and fun.

People need to make more spells with a lot of eyecandy stuff, or things that grab attention.

+REP.
 

Magoiche

Member
Reaction score
20
Thanks for the comment. +rep

Yeah. Eyecandyness of 1337 doom pwns all i.i


Any more suggestion or comment?

I am waiting them =P
 

Trollvottel

never aging title
Reaction score
262
the missiles dont seem to be fired by the tank but to come from inside it. so please change the starting point of the missiles a bit.
 

Magoiche

Member
Reaction score
20
Thanks for the comments! +rep

@Trollvottel

Fixed. Thanks for notcing it. ^^


Added v1.1

- Fixed Dummy Position. thanks to Trollvottel
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top