Spell Regenerative Cyclone

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Regenerative Cyclone

Description:
Your caster summons powerful winds to push her enemies away and heal nearby allies for 10+(40*Level of Ability) in a 450 range.

Uses:
Only Jass NewGen

Settings:

SPELL_ID (integer) = the spell id of the base spell used for the ability, this can be any ability you want as order strings do not matter and targets do not matter.

MOVE_TO_MAX (boolean) = if true this ability will push units to the max range, but not past. if false, this will push units the distance of the max range from their current point, resulting in a farther and longer push

IGNORE_UNIT_PATHING[/color] (boolean) = if true this ability's push will ignore pathing of units for the pushed targets

IGNORE_PATHING (boolean) = if true this overrides IGNORE_UNIT_PATHING because the pushed units will have pathing turned off until they complete the push

DURATION (real) = the duration of the push, if set to 0 the push will be instant or nearly instant

INTERVAL (real) = the interval at which units are moved for the push, currently 0.02 seconds for a smooth push

STUN (boolean) = if true the units will be pause for the duration of the push, best for unruly units who want to move the way opposite the stun

implimentation:
step 1: create a new spell
step 2: get spell id (check the view option view as raw data and find the spell, ID next to name)
step 3: create a trigger, convert to custom text in edit, and replace with below code
step 4: set [ljass]private constant integer SPELL_ID = '[Your Spell id replaces these brackets]'[/ljass]

Code:
JASS:
scope RejuvenationCyclone initializer OnInit
    
    globals
        private constant integer SPELL_ID = 'A000'
//this is the spell ID (under the view tab, check view raw data and find your spell to get this)

        private constant boolean MOVE_TO_MAX = false
//if true this will move units to max range and not past it

        private constant boolean IGNORE_UNIT_PATHING = true
//if true this push will ignore unit pathing

        private constant boolean IGNORE_PATHING = false
//if this is true the push will ignore pathing period

        private constant real DURATION = 0.5
//this is the max duration of  the push, when set to 0 it will be instant

        private constant real INTERVAL = 0.02
//CAN NOT BE 0.00, this is the interval at which the push is issued, frequency relates directly with smoothness and lag

        private constant boolean STUN = true
//set to false if you dont want the units to be stunned while pushed

        private timer RCLLTIMER = CreateTimer() //DO NOT CHANGE
    endglobals
    
    struct RCLL extends array
        unit pushTarget
        real changeX
        real changeY
        integer changeCount
        
        integer next
        integer previous
        
        static integer array recycleList
        static integer lastRecycled = 0
        static integer listSize = 0
        
        private static method Allocate takes nothing returns thistype
            local integer i = RCLL.recycleList[0]
            if (i == 0) then
                set RCLL.listSize = RCLL.listSize + 1
                return RCLL.listSize
            endif
            set RCLL.recycleList[0] = RCLL.recycleList<i>
            set RCLL.recycleList<i> = 0
            return i
        endmethod
        
        static method linkUnit takes unit u, real x, real y returns nothing
            local thistype this = thistype.Allocate()
            set this.pushTarget = u
            set this.changeX = x
            set this.changeY = y
            set this.changeCount = 0
            set this.next = 0
            set this.previous = thistype[0].previous
            set thistype[thistype[0].previous].next = this
            set thistype[0].previous = this
        endmethod
    
        static method removeLink takes integer i returns nothing
            set thistype[thistype<i>.previous].next = thistype<i>.next
            set thistype[thistype<i>.next].previous = thistype<i>.previous
            set thistype.recycleList[thistype.lastRecycled] = i
            set thistype.lastRecycled = i
            set thistype.recycleList<i> = 0
        endmethod
    endstruct

    private function Core takes nothing returns nothing
        local integer i = RCLL[0].next
        local location a
        local real x
        local real y
        loop
            if RCLL[0].next == 0 then
                call PauseTimer(RCLLTIMER)
            endif
            exitwhen i == 0
            if IGNORE_UNIT_PATHING == true then
                call SetUnitPathing(RCLL<i>.pushTarget, false)
            elseif IGNORE_PATHING == true then
                call SetUnitPathing(RCLL<i>.pushTarget, false)
            endif
            if STUN then
                call PauseUnit(RCLL<i>.pushTarget, true)
            endif
            set a = GetUnitLoc(RCLL<i>.pushTarget)
            set x = GetLocationX(a)
            set y = GetLocationY(a)
            call SetUnitX(RCLL<i>.pushTarget, RCLL<i>.changeX + x)
            call SetUnitY(RCLL<i>.pushTarget, RCLL<i>.changeY + y)
            if IGNORE_PATHING == false then
            if IGNORE_UNIT_PATHING == false then
                call SetUnitPathing(RCLL<i>.pushTarget, true)
            endif
            endif
            set RCLL<i>.changeCount = RCLL<i>.changeCount + 1
            if RCLL<i>.changeCount == R2I(DURATION / INTERVAL) then
                if IGNORE_PATHING or IGNORE_UNIT_PATHING then
                    call SetUnitPathing(RCLL<i>.pushTarget, true)
                endif
                if STUN then
                    call PauseUnit(RCLL<i>.pushTarget, false)
                endif
                call RCLL.removeLink(i)
            endif
            set a = null
            set i = RCLL<i>.next
        endloop
    endfunction
    
    private function GroupFilter takes nothing returns boolean
        local boolean bool
        set bool = not IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE)
        set bool = bool and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)
        set bool = bool and not IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL)
        set bool = bool and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE)
        set bool = bool and not IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD)
        return bool
    endfunction
    
    private function OnInitActions takes nothing returns boolean
        local real rx
        local real ry
        local group g = CreateGroup()
        local unit u
        local real x = GetUnitX(GetTriggerUnit())
        local real y = GetUnitY(GetTriggerUnit())
        local real bx
        local real by
        local real r
        if GetSpellAbilityId() == SPELL_ID then
             call GroupEnumUnitsInRange(g, x, y, 450, Filter(function GroupFilter))
             loop
                 set u = FirstOfGroup(g)
                 exitwhen (u == null)
                 if IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) then
                     set bx = GetUnitX(u)
                     set by = GetUnitY(u)
                         set r = bj_RADTODEG * Atan2(by - y, bx - x)
                     if (MOVE_TO_MAX == true) then
                         set rx = bx + 450 * Cos(r * bj_DEGTORAD)
                         set ry = by + 450 * Sin(r * bj_DEGTORAD)
                     elseif (MOVE_TO_MAX == false) then
                         set rx = x + 450 * Cos(r * bj_DEGTORAD)
                         set ry = y + 450 * Sin(r * bj_DEGTORAD)
                     endif
                     set rx = ((rx - x) /(DURATION / INTERVAL))
                     set ry = ((ry - y)/(DURATION / INTERVAL))
                     call RCLL.linkUnit(u, rx, ry)
                 elseif (IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(u)) == true) then
                     call SetUnitState(u, UNIT_STATE_LIFE, (GetUnitState(u, UNIT_STATE_LIFE) + 10.0 + (40.0 * GetUnitAbilityLevel(GetTriggerUnit(), SPELL_ID))))
                 endif
                 call GroupRemoveUnit(g, u)
             endloop
        call TimerStart(RCLLTIMER, INTERVAL, true, function Core)
        endif
        call DestroyGroup(g)
        set g = null
        set u = null
        return true
    endfunction
    
    private function OnInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Filter(function OnInitActions))
        set t = null
    endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


Change Log and Soon to come
Change Log:
  • v1.00 - release - 12/3/2011

Soon to come:
  • Special Effects options
  • Healing function options
  • Damage Options
  • Propper Stun Option without glitch possiblities
 

Attachments

  • Regenerative Cyclone.w3x
    21.5 KB · Views: 372

luorax

Invasion in Duskwood
Reaction score
67
That filter should use comments ([ljass]/* */[/ljass]) instead of that local boolean.
 

Dirac

22710180
Reaction score
147
Not using existant libraries doesn't make the spell better, actually it makes it a lot worse
Remember that these libraries were written and revised by people who are experienced using vJass and their only purpose is to improve your code.
Haven't tested it yet, will when i have the time.
 

luorax

Invasion in Duskwood
Reaction score
67
All the functions should be merged into the struct, and by using the struct's initializer you could get rid of the library initializer. Also, indent the comments below the configurables.

This is a cool snippet.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top