Spell War Barrage

Magoiche

Member
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:

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
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?
 

Magoiche

Member
@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
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
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
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
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 The Helper:
    Happy Hump Day!
  • V-SNES V-SNES:
    Happy Friday!
  • cubanral cubanral:
    agreed!
  • The Helper The Helper:
    Friday Yay!
  • mgarcia mgarcia:
    did you guys catch Carl's interview? https://www.youtube.com/watch?v=kuHiMXABkGs
  • mgarcia mgarcia:
    he's the one that informed me about the DVD's working!
  • mgarcia mgarcia:
    he also mentioned the progress on the controllers!
  • The Helper The Helper:
    I did actually it was cool to see the NUON mention
  • The Helper The Helper:
    https://discord.com/channels/985377399338332202/985377399950696481 you can still use this chat too we are two fisted now :)
  • thewrongvine thewrongvine:
    costs me $80 to fill gas tank sad face
  • Ghan Ghan:
    Oof
  • The Helper The Helper:
    Yeah that gas is some expensive stuff :)
  • The Helper The Helper:
    ghan does not have to worry about it he has a tesla and I have a small tank so it does not cost me usually more than 50
  • The Helper The Helper:
    fyi Ghan we are getting an error trying to access stats or world editor tutorials Error 526 Ray ID: 72128c6bf99f6707 • 2022-06-26 02:35:15 UTCInvalid SSL certificate
  • Ghan Ghan:
    An artifact of switching to Cloudflare... the Let's Encrypt certs can't autorenew through Cloudflare.
  • Ghan Ghan:
    I got the forum updated before things expired but there were some other casualties.
  • Ghan Ghan:
    Everything should be fixed now....
  • The Helper The Helper:
    Thank you Ghan!
  • The Helper The Helper:
    Happy Monday!
  • The Helper The Helper:
    new NUON forum mod cubanral!
    +1
  • The Helper The Helper:
  • tom_mai78101 tom_mai78101:
    Started learning how to make tools-assisted speedruns, so I'm lately busy.
  • tom_mai78101 tom_mai78101:
    Here's my current project.
    +3
  • O Old Mountain Shadow:
    that was pretty good!
  • jonas jonas:
    really cool! I saw the game before but always thought it's just a half as good double dragon. Now I realize it actually has a lot of depth!

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top