• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS]Torrent v1.1d [Inspired by DotA]

Yeah bla bla bla bla about originality and such, haven't uploaded a spell or anything in a while and this got heavily requested out there so there you go!

Basic it's based on this spell but without the slow part. That's about it...


Using his unparalleled knowledge of the sea,
Kunkka is able to summon a blast of water at
a targeted area. After 2 seconds a fierce
torrent of water erupts from the ground, the
stream blasting enemies caught in the AoE into
the sky and dealing damage.

Level 1 - 120 damage.
Level 2 - 180 damage.
Level 3 - 240 damage.
Level 4 - 300 damage.


This is made purely in vJASS thus a vJASS compiler is needed. Either you use JASSHelper directly or just JNGP, kthxbye!

How to import is inside the code but for you guys who don't know how to read, I'll place it here as well along with all requirements (a lot hehe).

And no Bribe I will not turn this into a library. Scopes are just fine.


*How to import
1. Import all required Libraries and create the object data (AIDS, Status, DummyCaster)
2. Copy this code and paste into a trigger or copy the trigger.
3. Copy the ability and change the ABILID to the new id given.
4. Give the spell to a hero, credit me and the authors in the credits section above and enjoy!





Credits:
*Status, AIDS, T32, GTrigger, DummyCaster - Jesus4Lyf
*TimerUtils - Vexorian
*GroupUtils - Rising_Dusk
*Autofly - Azlier
*TidalEruption model - Unknown Author
*Allowing me to use his testmap! - -Berz-

Also remember to give me credits if the spell is used along with the authors above.

Wooah this spell requires a lot, common libraries I guess, enjoy the quote.

Requires Status, T32, TimerUtils, AutoFly optional GT, SpellEffectEvent, GroupUtils
Thus Status requires AIDS and DummyCaster as well.

All required libraries are inside the map.


torrentv10.png



JASS:
scope Torrent
/*
    Requires Status, T32, TimerUtils, AutoFly
        Thus Status requires AIDS and DummyCaster as well.
        
    *Torrent v1.1d by baassee
        Description:
        
        Using his unparalleled knowledge of the sea, 
        Kunkka is able to summon a blast of water at 
        a targeted area. After 2 seconds a fierce 
        torrent of water erupts from the ground, the 
        stream blasting enemies caught in the AoE into 
        the sky and dealing damage.

        Level 1 - 120 damage.
        Level 2 - 180 damage. 
        Level 3 - 240 damage.
        Level 4 - 300 damage.
        
    *FAQ about code
        The code contains two structs, one for just the initial delay of two seocnds
        and the second for the actual eruption.
        
        I used GT as I am used to it.
        
        I used Status because it's the best out there at the moment.
        
        I used AutoFly(Aids Version) because I had AIDS already with Status
        
        I recommend though using UnitIndexer by Nestharus with the AIDS BC
        Can be found at this link below:
        http://www.hiveworkshop.com/forums/jass-functions-413/system-unit-indexer-172090/
        
        Yes I didn't want the spell to stack with itself because it would have looked ridiculous with the height changes.
        And I was lazy so that's the reason behind the stackgroup.
        
        Typical parabola function, first made by Moyack and Spec(?) anyway it's way too common to be credited.
        
        And there are two boolean constants
            one for pausing or not pausing (will stun if not paused)
            second for preloading or not preloading
        
    *Information
        Yes this spell is based on DotA's Admiral's Torrent spell. It's exactly the same except
        the slowing part and the height (couldn't find the maximum height at playdota). 
        Also added an option to pause or not pause the units thrown up in the air.
        
        I cannot use any custom icon although I recommend using this icon:
        http://www.hiveworkshop.com/forums/icons-541/btntorrent-162809/?prev=search%3Dtorrent%26d%3Dlist%26r%3D20
        
        The TidalEruption model was found in a spellpack by RMX, no credits were actually given in that spellpack
        thus I don't know who's the author of the model but it's not mine.
        
    *Credits
        *Status, AIDS, T32, GTrigger, DummyCaster - Jesus4Lyf
        *TimerUtils - Vexorian
        *GroupUtils - Rising_Dusk
        *Autofly - Azlier
        *TidalEruption model - Unknown Author
        
        Also remember to give me credits if the spell is used along with the authors above.
    
    *How to import
        1. Import all required Libraries and create the object data (AIDS, Status, DummyCaster)
        2. Copy this code and paste into a trigger or copy the trigger.
        3. Copy the ability and change the ABILID to the new id given.
        4. Give the spell to a hero, credit me and the authors in the credits section above and enjoy!
        
    *Changelog
        v1.0 - Released
        v1.1 - Made GTrigger optional along with making SpellEffectEvent optional as well.
             - Made Damage optional.
             - Made GroupUtils optional.
             - Changed Condition into Filter.
        v1.1b- Fixed a mistake with optionalizing GT and SpellEffectEvent.
        v1.1c- Forgot to static if out GroupEnumUnitsInArea which made it uncompileable.
        v1.1d- Removed GetWidgetLife(u) > 0.405 and just because of "I could add this"
               I added a FoG loop instead of groupenumeration + filter.
               Also made the filter among the configuration functions.
        
    **************************************************************************************************************************
    
    *Configurables
*/

    //CONSTANTS
    
    globals
        //The abilityid when pasting into the object editor
        private constant integer ABILID         = 'A000'
        
        //the ground effect that will be on the ground during the 2 seconds delay
        private constant string GROUNDEFFECT    = "Objects\\Spawnmodels\\Other\\IllidanFootprint\\IllidanWaterSpawnFootPrint.mdl"
        
        //the splash effect when the delay reached 0.
        private constant string SPLASHEFFECT    = "war3mapImported\\TidalEruption.mdx"
        
        //the attacktype of the damage
        private constant attacktype ATT         = ATTACK_TYPE_NORMAL
        
        //damagetype of the damage
        private constant damagetype DAM         = DAMAGE_TYPE_MAGIC
        
        //weapontype of the damage
        private constant weapontype WEA         = null
        
        //if you want the spell to pause the units or not
        //if false then it will stun them instead
        private constant boolean PAUSE          = false
        
        //preload the specialeffects used?
        private constant boolean PRELOAD        = true
        
        //don't touch this, it's because it would look stupid without it
        //and I'm lazy of course
        private group stackgroup                = CreateGroup()
    endglobals
    
    //FUNCTIONS
    
    //the delay before the eruption
    private function GetDelay takes integer lvl returns real
        return 2. + lvl * 0.
    endfunction
    
    //the aoe of the spell
    private function GetAoe takes integer lvl returns real
        return 200. + lvl * 0.
    endfunction
    
    //the damage dealt
    private function GetDmg takes integer lvl returns real
        return 60. + 60. * lvl
    endfunction
    
    //the duration in the air, taken from playdota.com
    private function GetDur takes integer lvl returns real
        return 1.53 + lvl*0.
    endfunction
    
    //the maximum height the units thrown in the air will reach
    //no idea what the original value is
    private function GetHei takes integer lvl returns real
        return 400. + lvl * 0.
    endfunction
    
    private function GetFilter takes unit u, player p returns boolean
        return not IsUnitType(u, UNIT_TYPE_DEAD) and/*
        */ IsUnitEnemy(u, p) and/*
        */ not IsUnitInGroup(u, stackgroup) and/*
        */ not IsUnitType(u, UNIT_TYPE_STRUCTURE) and/*
        */ not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)
    endfunction

    
// END OF CONFIGURABLES

    //standard parabola formula
    private function ParabolaZ takes real h, real d, real x returns real
        return (4 * h / d) * (d - x) * (x / d)
    endfunction
    
    //eruption struct, the struct throwing units in the air
    private struct Eruption extends array
        unit u //unit in the air
        real counter //counter to cheat the parabola function
        real dur //duration in the air, cheats the parabola function as maxdistance
        real h //maximum height
        
        //recycling variables
        static integer ic = 0
        static thistype r = 0
        thistype rn

        //loop method
        private method periodic takes nothing returns nothing
            set .counter = .counter + T32_PERIOD //increasing "x" in the parabola function
            call SetUnitFlyHeight(.u, ParabolaZ(.h, .dur, .counter), 0.) //sets the new flyheight of the unit
            if .counter >= .dur then //checks if the spell has ended or not
                static if PAUSE then //static if to check if pause is allowed or not
                    call Status[.u].removePause()
                else
                    call Status[.u].removeStun()
                endif
                call SetUnitFlyHeight(.u, GetUnitDefaultFlyHeight(.u), 0.) //return to the default flying height
                call GroupRemoveUnit(stackgroup, .u) //remove the unit from the stackgroup
                call .stopPeriodic()//stop the periodic
                set rn = r //recycling structs
                set r = this // - || -
            endif
        endmethod
        implement T32x
        //create method
        static method create takes unit u, real dur, real h returns thistype
            local thistype this //dunno what to call it, indexing?
            if (r == 0) then
                set ic = ic + 1
                set this = ic
            else
                set this = r
                set r = r.rn
            endif
            set .u = u //unit
            set .counter = 0. //initializing the counter
            set .dur = dur //duration
            set .h = h //height
            call GroupAddUnit(stackgroup, u)//add the unit to the stackgroup
            static if PAUSE then //static if about pausing
                call Status[u].addPause()
            else
                call Status[u].addStun() //else we stun the unit
            endif
            call .startPeriodic() //fire the periodic (t32)
            return this
        endmethod
    endstruct
    
    //the delay struct
    private struct Torrent extends array
        unit caster //casting unit
        real dmg //dmg
        real aoe //aoe
        real x //the targetx
        real y //the targety
        real dur //duration for the eruption struct
        real h //height yes we need it here as well
        effect eff //special effect on the ground
        
        //recycle variables
        static integer ic = 0
        static thistype r = 0
        thistype rn
        static thistype dat //for the filter function
        static if not LIBRARY_GroupUtils then
            static group ENUM_GROUP = CreateGroup()
        endif
        
        static method secondphase takes nothing returns nothing
            local timer t = GetExpiredTimer() //track the timer
            local thistype this = GetTimerData(t) //get the data
            local unit u
            call DestroyEffect(.eff) //destroy the effect on the ground
            set dat = this //for the filter method
            call DestroyEffect(AddSpecialEffect(SPLASHEFFECT, .x, .y)) //create the eruption effect
            // just because this is faster...
            static if LIBRARY_GroupUtils then
                call GroupEnumUnitsInArea(ENUM_GROUP, .x, .y, .aoe, null) //enum
            else
                call GroupEnumUnitsInRange(ENUM_GROUP, .x, .y, .aoe, null)
            endif
            loop
                set u = FirstOfGroup(ENUM_GROUP)
                exitwhen null == u
                if GetFilter(u, GetOwningPlayer(.caster)) then
                    static if LIBRARY_Damage then
                        call Damage_Spell(.caster, u, .dmg)
                    else
                        call UnitDamageTarget(.caster, u, .dmg, false,false, ATT, DAM, WEA)
                    endif
                    call Eruption.create(u, .dur, .h)
                endif
                call GroupRemoveUnit(ENUM_GROUP, u)
            endloop
            //endfaster
            call ReleaseTimer(t) //recycle timer
            set t = null //null local
            set u = null
            //recycle part
            set rn = r 
            set r = this
        endmethod
        static method create takes nothing returns thistype
            local thistype this
            local integer lvl = GetUnitAbilityLevel(GetTriggerUnit(), ABILID) //because I want to set it at declaration not after
            local timer t = NewTimer() //get timer
            local string s = GROUNDEFFECT //local player thingie
            if (r == 0) then //indexing part?
                set ic = ic + 1
                set this = ic
            else
                set this = r
                set r = r.rn
            endif
            set .caster = GetTriggerUnit() //casting unit
            set .dmg = GetDmg(lvl) //dmg
            set .aoe = GetAoe(lvl) //aoe
            if IsPlayerEnemy(GetLocalPlayer(), GetTriggerPlayer()) then //to make the effect only show for allies
                set s = ""
            endif
            set .x = GetSpellTargetX() //targetx
            set .y = GetSpellTargetY() //targety
            set .dur = GetDur(lvl) //duration
            set .h = GetHei(lvl) //height
            set .eff = AddSpecialEffect(s, .x, .y) //create the effect
            call SetTimerData(t, this)
            call TimerStart(t, GetDelay(lvl), false, function thistype.secondphase) //fire timer with the delay
            set t = null //nullling
            return this
        endmethod
        
        static method condition takes nothing returns boolean
            static if not LIBRARY_GT then
                static if not LIBRARY_SpellEffectEvent then
                    if GetSpellAbilityId() == ABILID then
                        call thistype.create()
                    endif
                else
                    call thistype.create()
                endif
            else
                call thistype.create()
            endif

            return false
        endmethod
        //initializing
        private static method onInit takes nothing returns nothing
            local trigger t
            static if LIBRARY_GT then
                call TriggerAddCondition(GT_RegisterStartsEffectEvent(CreateTrigger(), ABILID), Filter(function thistype.condition))
            else
                static if LIBRARY_SpellEffectEvent then
                    call RegisterSpellEffectEvent(ABILID, function thistype.condition)
                else
                    set t = CreateTrigger()
                    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
                    call TriggerAddCondition(t, Filter(function thistype.condition))
                    set t = null
                endif
            endif
            static if PRELOAD then //to preload or not preload
                call Preload(GROUNDEFFECT)
                call Preload(SPLASHEFFECT)
            endif
        endmethod
    endstruct //end of story
endscope


*Changelog
v1.0 - Released
v1.1 - Made GTrigger optional along with making SpellEffectEvent optional as well.
- Made Damage optional.
- Made GroupUtils optional.
- Changed Condition into Filter.
v1.1b- Fixed a mistake with optionalizing GT and SpellEffectEvent.
v1.1c- Forgot to static if out GroupEnumUnitsInArea which made it uncompileable.
v1.1d- Removed GetWidgetLife(u) > 0.405 and just because of "I could add this"
I added a FoG loop instead of groupenumeration + filter.
Also made the filter among the configuration functions.


Enjoy.

~baassee
When writing the story of your life, don't let anyone else hold the pen.

Keywords:
torrent, admiral, kunkka, dota, spell, tidal, eruption, vjass, mui, baassee
Contents

Torrent v1.1d (Map)

Reviews
20 Oct 2011 Bribe: All points fixed - thanks! The only weird thing is that the hero doesn't have to channel the spell during the delay period, I wouldn't know if that's the same as how DotA did it. ~ Approved

Moderator

M

Moderator

20 Oct 2011
Bribe: All points fixed - thanks! The only weird thing is that the hero doesn't have to channel the spell during the delay period, I wouldn't know if that's the same as how DotA did it.

~ Approved
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
GT? D:
That's hurtful :(

T32? D:
That's insulting :(

Status? D:
That's a crime :(

GT is more common than your library at the moment :)

T32 is fine, in a good map where you use t32 properly, it will always have instances running :)

Status,

Don't say that UnitProperties is better? Status along with UnitIndexer and AIDS bc is the best I can think of atm (and bonusmod sucks).

extends array

I love you teehee

<3

bassee mind doing wild axes too? :p In GUI if possible.

Ehum maybe but not in GUI, it's already been made? by RMX. In GUI.

JASS:
    //the delay before the eruption
    private function GetDelay takes integer lvl returns real
        return 2. + lvl * 0.
    endfunction

This (lvl * 0.) always returns 0?

Nice work ^^

Yeap that part will always return 0, it's there to make it easier for the users. And integers are so fast that those will probably never make your map loose performance anyway :)

well he is so good in making maths in warcraft 3 D:
i hope there will be next chapter after the end of the sory o_O

i'll just do the "nestharus-library compatibility" again o_O

Is that an insult or just sarcasm? :p

lol just add unitindexer with aids bc and it will work with no changes in the spellcode.
 
Level 10
Joined
May 27, 2009
Messages
494
well aids bc is bugging up with indexer, i found out thatttttt the aids bc will not work as with unit indexer (the aids bc will tend to run last after the normal unitindexer declaration, so i need to do the "nestharus-library compatibility" in order to this aids aids run first before libraries begin firing)
and what i said is neither insult nor sarcasm :p
 
Level 19
Joined
Jul 12, 2010
Messages
1,713
spells seems pretty good 5/5 :thumbs_up:
but why i can't extract the TidalEruption.mdx model? and why it has 0kb?

Corrupted maybe?
i downloaded this spell 5 times and i get the same thing all the time...

EDIT:
nvm i managed to extract the model using WinMPQ...

EDIT 2:
well any chance for a GUI ver?

EDIT 3:
also how about a description? :p
 
Last edited:
Level 22
Joined
Nov 14, 2008
Messages
3,256
spells seems pretty good 5/5 :thumbs_up:
but why i can't extract the TidalEruption.mdx model? and why it has 0kb?

Corrupted maybe?
i downloaded this spell 5 times and i get the same thing all the time...

EDIT:
nvm i managed to extract the model using WinMPQ...

EDIT 2:
well any chance for a GUI ver?

EDIT 3:
also how about a description? :p
Export it from the import manager?

It's all vJASS baby!

Not GUI but probably vanilla JASS yes.

It's in the code on top actually but yeah seems quite odd not having it in the description. Good point.

without even checking it... it's a baassee spell so it gota be great :D

thanks old friend <3 :)
 
Level 7
Joined
Sep 2, 2011
Messages
350
Cool. I was always amazed on how people do these things.
Specially the one that hides the bubble from enemies. I mean, how?
 
Level 7
Joined
Sep 2, 2011
Messages
350
I successfully copied all the required thingy from the spell map to my map. However, the units doesn't fly at all. It only takes damage. I guess it's because of the AIDS issue. Few of my libraries are anti-Aids.
 
Top