• 🏆 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!

Nova System 2.02

A system that can be used to make different kinds of Nova spells, like instant novas, time-delayed novas, channeled spells that creates novas around you, etc... read the code header for more details

The system can be used simply using one function call, but also supports more advanced usage thru event registrations.

I have included 5 sample spells

Requires:
JNGP to edit/save

Note: Way of usage between 2.0 and earlier versions changed especially for those using the interface functions, so anyone using this system will have to change their codes a bit if you're planning to update



JASS:
/*

    NovaSystem 2.02 By Adiktuz  
    
    Credits to  Vexorian for dummy.mdx, J4L for T32, 
                Bribe for Table, SpellEffectEvent and Magtheridon96 for RegisterPlayerUnitEvent
                Nestharus for WorldBounds
                                          
--------------------------------------------------------------------------------------------

    Description:                                                                                    
                                                                                            
    A simple system that can be used to create:                                                 
                                                                                            
        1)An instant Nova                                                                           
                                                                                            
        2)A targeted Nova                                                                           
                                                                                            
        3)A time-delayed Nova                                                                       
                                                                                            
        4)A Channeled spell which creates novas around you                                          
                                                                                            
        5)A spell which creates novas around a target area over time                                
                                                                                            
        6)A non-channeled spell which creates novas around you                                      
                                                                                            
        7)And some others    

                                                                       
--------------------------------------------------------------------------------------------
    How to Import                                                                               
                                                                                            
        Copy Nova and the required libraries into your map                                            
                                                                                            
        Export Dummy.mdx and import it to your map and create a dummy unit if you dont have one     
                                                                                            
        Set the global DUMMY_ID to the rawcode of your dummy unit                                   
--------------------------------------------------------------------------------------------


    Editable Globals                                                                            
                                                                                            
        DUMMY_ID = the rawcode of the dummy unit                                                    
                                                                                            
        TICK = the timer interval                                                                   
                                                                                            
        FLY = the rawcode of Medivh's raven form    

                                                 
--------------------------------------------------------------------------------------------
    How to use:                                                                                 
                                                                                            
        For very simple, 1-time Nova use this function                                              
                                                                                            
            NovaSystem.simpleCreate(unit caster,real x, real y, real faoe,                    
            real height, damage, real scale, string path, attacktype at, damagetype dt )               

        For very simple, 1-time Nova with time delay use this function                                              
                                                                                            
            NovaSystem.simpleCreateDelay(unit caster,real x, real y, real delay, real faoe,                    
            real height, damage, real scale, string path, attacktype at, damagetype dt )
            
        For very simple, 1-time Nova with time delay + target use this function                                              
                                                                                            
            NovaSystem.simpleCreateDelayTarget(unit caster, unit target, real x, real y, real delay, real faoe,                    
            real height, damage, real scale, string path, attacktype at, damagetype dt ) 
                                                                                      
        For normal use, you just need to call the function                                          
                                                                                             
            NovaSystem.create(parameters)                                                               
                                  
            see the details below for what the parameters mean
                                  
            Here are the parameters for the .create method arranged in order with details                                      
                                                                                            
                unit caster - the unit casting the spell     
                
                unit target - the target unit of the spell
                            - if this has a value, the nova will follow the target
                                                                                            
                real x - the center x of the nova AOE                                                       
                                                                                            
                real y - the center y of the nova AOE                                                       
                                                                                            
                real aoe - the max distance that novas can be created from the center                                                     

                real faoe - the radius of EACH nova's explosion                                             
                                                                                            
                real height - the height of the nova special effect                                         
                                                                                            
                integer npil - lowerbound of nova created per interval                                      
                                                                                            
                integer npih - higherbound of nova created per interval                                     
                                                                                            
                *amount of nova created per interval is randomized from npil to npih*                       
                                                                                            
                real ni - interval between nova creations, set this to a number higher than TICK            
                                                                                            
                real ntt - the duration of the spell                                                        
                                                                                            
                real damage - the damage amount of each nova                                                
                                                                                            
                real scalex - the x scale of the nova special effect                                           
                                                                                                                                                                                                                                                                                                                            
                boolean channel - determines wheteher if nova spell is channeled                            
                                                                                            
                boolean oncast - whether novas will start on cast                                           
                                                                                            
                    -if false -> first set of novas will be created after ni                                    
                                                                                            
                boolean follow ->determines if the caster will remain as the center of the AOE              
                                                                                            
                *set it to true only for non-channeled no-target novas*                                     
                                                                                              
                string path - the path to the nova special effect                                           
                                                                                            
                attacktype at - the damage's attacktype                                                     
                                                                                            
                damagetype dt - the damage's damagetype   

                boolean circular - whether the AOE is circular or square, TRUE = circular, FALSE = Square
                   for the simple nova methods, it is set to true by default
                            
                integer abil - rawcode of the ability (used for the onXX events)
    
    Note: I did not add a target method to the simpleCreate method because there is no point in that.
    
--------------------------------------------------------------------------------------------
    Registering onXX events:

        NovaSystem.registerOnDamage(integer abil, code action)
            -> runs when a unit is damaged
        NovaSystem.registerOnHit(integer abil, code action)
            -> runs when a unit is hit (before filter is done, meaning it will run for ALL units around the nova)
        NovaSystem.registerOnNova(integer abil, code action)
            -> runs when a nova is created
        NovaSystem.registerOnFinish(integer abil, code action)
            -> runs when an instance of the Nova struct has ended
    
        You can use NovaSystem.data to get the instance of Nova that triggered the events
    
    Nova struct members that you can use:
        
        real x 
        real y
        unit caster
        real aoe
        real faoe
        integer npih
        integer npil
        real ni 
        real ntc 
        real ntt 
        real nxi 
        boolean channel = false
        real damage
        string path
        player owner
        real scalex
        boolean follow
        real height
        attacktype at
        damagetype dt
        boolean circular
        integer abil
        
    Sample:
        NovaSystem.data.damage will return the damage value stored in that instance
        
    Check the sample triggers for working examples
                                                                   
--------------------------------------------------------------------------------------------


    The system automatically cancels a channeled nova when the caster moves, casts a new spell etc...
    
    To cancel a channeled nova using other events, just use:
    
    call NovaSystem.ForceCancel(unit caster)
    
*/


library Nova requires T32, Table, RegisterPlayerUnitEvent, MapBounds                   
    
    globals
        //Dummy ID
        private constant integer DUMMY_ID = 'e000'
        //TimerInterval
        private constant real TICK = .03
        //Rawcode of Medivh's raven form
        private constant integer FLY = 'Amrf'
        //Do not Edit
        private group NOVA_GROUP = CreateGroup()
        private Table NovaTable
        private Table onDamageTable 
        private Table onNovaTable 
        private Table onFinishTable 
        private Table onHitTable
    endglobals
    
    module NSInit
    
        static method onInit takes nothing returns nothing
            set NovaTable = Table.create()
            set onDamageTable = Table.create()
            set onNovaTable = Table.create()
            set onHitTable = Table.create()
            set onFinishTable = Table.create()
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_CAST, function thistype.Cancel)
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER, function thistype.Cancel)
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, function thistype.Cancel)
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, function thistype.Cancel)
        endmethod
    
    endmodule
    
    struct NovaSystem
        real x 
        real y
        unit caster
        unit target
        real aoe
        real faoe
        integer npih
        integer npil
        real ni 
        real ntc 
        real ntt 
        real nxi 
        boolean channel = false
        real damage
        string path
        player owner
        real scalex
        boolean follow
        real height
        attacktype at
        damagetype dt
        boolean circular
        integer abil
        static real xx
        static real yy
        static thistype data
        static thistype datu
        static unit filter
        
        
        static method registerOnDamage takes integer abil, code action returns nothing
            if not onDamageTable.handle.has(abil) then
                set onDamageTable.trigger[abil] = CreateTrigger()
            endif
            call TriggerAddCondition(onDamageTable.trigger[abil], Filter(action))
        endmethod
        
        static method registerOnNova takes integer abil, code action returns nothing
            if not onNovaTable.handle.has(abil) then
                set onNovaTable.trigger[abil] = CreateTrigger()
            endif
            call TriggerAddCondition(onNovaTable.trigger[abil], Filter(action))
        endmethod
        
        static method registerOnHit takes integer abil, code action returns nothing
            if not onHitTable.handle.has(abil) then
                set onHitTable.trigger[abil] = CreateTrigger()
            endif
            call TriggerAddCondition(onHitTable.trigger[abil], Filter(action))
        endmethod
        
        static method registerOnFinish takes integer abil, code action returns nothing
            if not onFinishTable.handle.has(abil) then
                set onFinishTable.trigger[abil] = CreateTrigger()
            endif
            call TriggerAddCondition(onFinishTable.trigger[abil], Filter(action))
        endmethod
        
        stub method OnHitFilter takes unit u returns boolean
            return (IsUnitEnemy(u, this.owner) and GetWidgetLife(u) >= .405 and (IsUnitType(u, UNIT_TYPE_DEAD) != true))
        endmethod
        
        //The group loop that is run when a nova is created
        static method Looper takes nothing returns boolean
            set filter = GetFilterUnit()
            if onHitTable.handle.has(data.abil) then
              call TriggerEvaluate(onHitTable.trigger[data.abil])
            endif
            if data.OnHitFilter(filter) then
                call UnitDamageTarget(data.caster, filter, data.damage, false, false, data.at, data.dt, null)
                if onDamageTable.handle.has(data.abil) then
                    call TriggerEvaluate(onDamageTable.trigger[data.abil])
                endif
            endif
            return false
        endmethod

        //For canceling a channeled nova using other triggers
        static method ForceCancel takes unit u returns nothing
            set datu = NovaTable[GetHandleId(u)]
            if datu != 0 then
                set datu.ntt = 0.00
            endif
        endmethod
        
        //For canceling a channeled nova using the systems default events
        static method Cancel takes nothing returns nothing
            set datu = NovaTable[GetHandleId(GetTriggerUnit())]
            if datu != 0 then
                set datu.ntt = 0.00
            endif
        endmethod
        
        method CreateNova takes nothing returns nothing
            local unit efx = CreateUnit(Player(15), DUMMY_ID, xx, yy, 0.00)
            if UnitAddAbility(efx, FLY) then
                call UnitRemoveAbility(efx, FLY)
            endif
            call SetUnitScale(efx, this.scalex, 0, 0)
            call SetUnitFlyHeight(efx, this.height, 0.00)
            call DestroyEffect(AddSpecialEffectTarget(this.path, efx, "origin"))
            call UnitApplyTimedLife(efx, 'BTLF', 1.00)
            if onNovaTable.handle.has(data.abil) then
              call TriggerEvaluate(onNovaTable.trigger[data.abil])
            endif
            call GroupEnumUnitsInRange(NOVA_GROUP, xx, yy, this.faoe, Condition(function NovaSystem.Looper))
            set efx = null
        endmethod
        
        //Ensures that the X and Y are within map bounds
    
        method GetPoint takes nothing returns nothing
            local real angle = 0.0
            local real range = GetRandomReal(0.0,this.aoe)
            if this.circular then
                set angle = GetRandomReal(0.0, 6.2832)
                set xx = GetBoundedX(this.x + Cos(angle)*range)
                set yy = GetBoundedY(this.y + Sin(angle)*range)
            else
                
                set xx = GetBoundedX(GetRandomReal(this.x - this.aoe, this.x + this.aoe))
                set yy = GetBoundedY(GetRandomReal(this.y - this.aoe, this.y + this.aoe))
            endif
        endmethod
        
        private method periodic takes nothing returns nothing
            local integer a = 1
            local integer b = 0
            set data = this
            set data.ntc = data.ntc + TICK
            if data.ntc >= data.nxi then
                set data.nxi = data.nxi + data.ni
                set b = GetRandomInt(data.npil, data.npih)
                loop
                    exitwhen a > b
                    if data.follow then
                        set data.x = GetUnitX(data.caster)
                        set data.y = GetUnitY(data.caster)
                    elseif data.target != null then
                        set data.x = GetUnitX(data.target)
                        set data.y = GetUnitY(data.target)
                    endif
                    call data.GetPoint()
                    call data.CreateNova()
                    set a = a + 1
                endloop
            endif
            if data.ntc >= data.ntt then
                call data.stopPeriodic()
                if onFinishTable.handle.has(data.abil) then
                    call TriggerEvaluate(onFinishTable.trigger[data.abil])
                endif
                if data.channel then
                    call NovaTable.remove(GetHandleId(data.caster))
                endif
                call data.destroy()
            endif
        endmethod
        
        implement T32x
        
        static method create takes unit caster, unit target, real x, real y, real aoe, real faoe, real height, integer npil,/*
        */integer npih, real ni, real ntt,real damage, real scale, boolean channel, boolean oncast,/*
        */boolean follow, string path, attacktype at, damagetype dt, boolean circular, integer abil returns thistype
            local integer a = 1
            local integer b = GetRandomInt(npil, npih)
            set data = .allocate()
            set data.caster = caster
            set data.owner = GetOwningPlayer(caster)
            set data.target = target
            //Ensures that the initial x,y values are within map bounds
            set data.x = GetBoundedX(x)
            set data.y = GetBoundedY(y)
            set data.follow = follow
            set data.height = height
            set data.aoe = aoe
            set data.damage = damage
            set data.channel = channel
            set data.path = path
            set data.npil = npil
            set data.npih = npih
            set data.ni = ni
            set data.nxi= ni
            set data.ntt = ntt
            set data.scalex = scale
            set data.faoe = faoe
            set data.ntc = 0.00
            set data.at = at
            set data.dt = dt
            set data.circular = circular
            set data.abil = abil
            if channel then
                set NovaTable[GetHandleId(caster)] = data
            endif
            if oncast then
                loop
                    exitwhen a > b
                    call data.GetPoint()
                    call data.CreateNova()
                    set a = a + 1
                endloop
            endif
            call data.startPeriodic()
            return data
        endmethod
        
        static method simpleCreate takes unit caster,unit target,real x, real y, real faoe, real height,/*
        */ real damage, real scale, string path, attacktype at, damagetype dt,integer abil returns thistype
            return thistype.create(caster,null, x, y, 0.0, faoe, height, 1, 1, 0.0, 0.0,damage, scale, false, false, false, path, at, dt, TRUE,abil)
        endmethod
        
        static method simpleCreateDelay takes unit caster,real x, real y, real delay, real faoe, real height,/*
        */ real damage, real scale, string path, attacktype at, damagetype dt,integer abil returns thistype
            return thistype.create(caster,null, x, y, 0.0, faoe, height, 1, 1, delay, delay,damage, scale, false, false, false, path, at, dt, TRUE,abil)
        endmethod
        
        static method simpleCreateDelayTarget takes unit caster, unit target,real x, real y, real delay, real faoe, real height,/*
        */ real damage, real scale, string path, attacktype at, damagetype dt,integer abil returns thistype
            return thistype.create(caster,target, x, y, 0.0, faoe, height, 1, 1, delay, delay,damage, scale, false, false, false, path, at, dt, TRUE,abil)
        endmethod
        
        implement NSInit
        
    endstruct

endlibrary







Version 1.0
uploaded spell

Version 1.01

-you can now make non-channeled instant cast over time nova spells follow the caster

-set the height of the special effect

-removed xe requirement

-edited header a bit

Version 1.02
- added OnHit interface method (now you can create supportive Nova spells)

Version 1.02b
- modified the OnNova method, it is now fired during the creation of a Nova, rather than it being the nova creation method itself

Version 1.03
- edited the damage filter method, it is now an interface method
- OnHitFilter which will allow the user to modify the filter per spell by extending the struct
and creating their own OnHitFilter method.
-Also added a fully commented tranquility code using this system (no test spell)

Version 1.04
- remove GetInstance as it was useless
-changed GetChanneledInstance to use hashtables
Version 1.05- made it run on T32
Version 1.05b - changed the onHitFilter into a stub method
Version 1.06 - merged the EndChannel library into the main library and added a method for forcing the cancellation of a channeling nova
Version 1.07 - removed the booleans on the get x/y functions and added the .exist check for the interface methods
Version 1.07b - some more optimization
Version 1.08 - separated the x,y,z scales to add more possibilities to the effects
Version1.08b - undid the last change since it was useless due to the engine's weird actions which makes effects only scale with the lowest scaling value set on the unit
- replaced initializer by module init
Version 1.09 - Added wrapper functions for those who don't need the full capabilities of the system
- Made it run under RegisterPlayerUnitEvent and replaced hashtable with Table
Version 1.09b - Added capability for circular AOE since the previous codes were for square AOE
- Combined the methods for obtaining the x,y points into just one method
Version 1.10 - Added another check for map bounds right at the create method for those lazy enough to not ensure that the value they feed is out of bounds
Version 2.0 - Replaced the interface and made it use Event registration methods because it is said that interfaces are slow and produce lots of waste codes.
Also made it run using my MapBounds snippet to shorten the code.
Version 2.01 - Some minor updates/fixes
Version 2.02 - added a target
parameter to enable creation of a nova that follows a target.

-NOTICE-
Making another nova from onNova, onHit and onDamage event handlers can cause unwanted results.

Credits:
Vexorian for dummy.mdx
Jesus4Lyf for Timer32
Bribe for Table
Magtheridon96 for RegisterPlayerUnitEvent

Keywords:
rylai, freezing field, frost, flame, electric, lightning, nova, aoe, damage, system, vjass, jass, gui, bomb, structs, dota, warcraft, magic, arcane
Contents

NovaSystem 2.02 (Map)

Reviews
Bribe: Approved! Some final notes: [8190] is not needed for declaring an array. I read in your messages you were worried about "not". "not" does not affect a line of booleans, only the boolean that follows it. So instead of "bool != true" it...

Moderator

M

Moderator

Bribe:

Approved! Some final notes:

[8190] is not needed for declaring an array.

I read in your messages you were worried about "not". "not" does not affect a line of booleans, only the boolean that follows it. So instead of "bool != true" it would just be "not bool". Whenever you're not sure, just spam some "()", effectively nulling any chance it could go wrong. "exitwhen (not bool) and (not bool2)"
 
Level 10
Joined
Sep 3, 2009
Messages
458
5/5!

well you know it's a pretty awesome system and can be used for alot of stuff specially elemental spells and the like.

For the code ehm just starting vJASS but I guess it's fine >.>

Dunno about originality, haven't seen a system like this before, looks original to me!
 
You should really take time to create a GUI one for GUI users ;) Overall it was a nice system dude =D Keep it up :D

well, its usable in GUI... you just need one function call... though it needs JNGP...

anyway, I cant really make spells/systems in GUI anymore coz I find it hard to do things like this (needs so many clicks and variables on the variable manager)... and somehow my mind seems to reject it...

^_^... thanks!
 
Level 15
Joined
Jul 6, 2009
Messages
889
Blah. I really hate the header you have, and the way you present the code. It's not pleasant to read. The header / documentation / thing discourages me from looking over the rest. Also, I dislike the requirement of xe as well ~

Could try looking over Projectile or AdvancedAura (I'm such an idiot haha, in that thread haha) and their code?
 
Last edited:
Level 10
Joined
Sep 3, 2009
Messages
458
wow the header was a bit cluttered then but now, it's easier to read. Also like the non channeled follow the caster feature. Can be used for a sort of like say a thunderstorm that follows the caster. Awesome update.

offtopic: wuts xe anyway?
 
wow the header was a bit cluttered then but now, it's easier to read. Also like the non channeled follow the caster feature. Can be used for a sort of like say a thunderstorm that follows the caster. Awesome update.

offtopic: wuts xe anyway?

the required libraries present in the first version...

xebasic, xefx

they are from a set of vjass libraries (xe) made by Vexorian that can be used for different things, like dummy casters, ability preload, special effect creation, custom damages etc...
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
You should also add onHit method into the interface (some only wants effects not damage :D) as onDamage only is fired for enemy units. Also add IsUnitType(u, UNIT_TYPE_DEAD) into the death check just to make it even better (I also thought it wasn't needed but TH told me to add that).

Else I really like it :D what's the next system for ya, I hope not projectile like ;)
 
Yeah, OnHit... I'll add it... now!!!

maybe I'll just replace the GetWidgetLife with that... or do they both need to be used?

I already made a ProjSys... but somehow now I realized that it was a FAIL... it was meant to be used by GUIers... so it was a vJASS FAIL (and it was my very first venture into vJASS)!!! and since there are many ProjSys out there, I decided not to improve it or make another one... ^_^
 
Well I kept both but I guess one is suffiencient but we'll see what TH says :D

Oh well then you'll need some new ideas sir! ;)

need to spread rep damn it...

okay, update coming!!!

I think I'll focus first on SoE and Arzachel... ^_^

EDIT: UPDATED!

thanks for the suggestion, now you can make a supportive nova spell.

PS: given too much rep in the last 24hrs...

EDIT 2: is there anybody wants an example of a supportive Nova?

EDIT 3: added an example of a supportive Nova.
 
Last edited:
NOTICE: For those who downloaded 1.02, please download again, I made a little error which makes it deal no damage to any unit... ^_^

for those who want to know what:

JASS:
if IsUnitEnemy(filter, data.owner) and GetWidgetLife(filter) >= .405 and IsUnitType(filter, UNIT_TYPE_DEAD)  then
//I forgot to do  IsUnitType(filter, UNIT_TYPE_DEAD) != true

Credits to neku99 for reporting it...

other note: The magnataurs dont get damaged because they are magic immune, its not a bug.
 
nice comment ;)

Possible to add a onTree method? Wonder if ever someone would need it :) also i hate dest enums

hmmm... dont want to do the enum myself... and I dont think someone would need an onTree method...

I'll just modify the interface method OnNova to be something else which fires during the current OnNova, so someone who would want a dest enum can do it themselves... gonna update after a bit

EDIT: Updated!...
 
if somebody has any idea for a feature that can be implemented, feel free to suggest.... ^_^

EDIT: while I was thinking, I realized a major flaw in my systems, that is the fact that its hard to modify the damage filter per spell that uses the system, so I added a new interface method (OnHitFilter) which is used as the filter that checks if a unit will be damaged or not... now users just need to extend the struct and make their own OnHitFilter method to modify the damage filter... ^_^
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
method OnHitFilter takes unit u returns boolean

Just change that to:

stub method OnHitFilter takes unit u returns boolean

And delete OnHitFilter from the interface. Stub methods, when declared by the parent struct, are pretty much the same as interface methods that "default nothing"

The changes look good so far although, strangely, there is an HTML code in the "End Channel" trigger.
 
method OnHitFilter takes unit u returns boolean

Just change that to:

stub method OnHitFilter takes unit u returns boolean

And delete OnHitFilter from the interface. Stub methods, when declared by the parent struct, are pretty much the same as interface methods that "default nothing"

The changes look good so far although, strangely, there is an HTML code in the "End Channel" trigger.

ahh... okay, I'll change it... ^_^

what html code?

EDIT: updated... changed OnHitFilter into a stub method... cannot find the html code... ^_^
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
well, its usable in GUI... you just need one function call... though it needs JNGP...

anyway, I cant really make spells/systems in GUI anymore coz I find it hard to do things like this (needs so many clicks and variables on the variable manager)... and somehow my mind seems to reject it...

^_^... thanks!

Whaaaaaat, you say this is easier than GUI? O_O My mind farts when I look upon this text, I don't understand shit.
 
Updated! Added capability to assign a target unit to the nova, which if used, causes the nova to follow that target...

EDIT: I'm gonna work on another update for this that will allow you to assign multiple channeling novas to a caster without bugging... (because right now if you do that, only the last nova will be linked to the unit)
 
Last edited:
Level 3
Joined
Sep 9, 2009
Messages
658
Yeah...I don't get that which is why I asked. You can create circular novas yes but I don't see where I can set the angle for the polar projection. The way you put it, it seems like simpleCreate was meant to do randomized explosions in a circle shape.

These three in particular give me that impression.

real faoe - the radius of EACH nova's explosion
integer npil - lowerbound of nova created per interval
integer npih - higherbound of nova created per interval

If each nova deals damage on its own, that means a unit can be damaged more than once depending on its position. Is there a way, I can make it so that units only get damaged once?
 
Huh? Why do you need angle for polar projection? The method takes the x,y coordinates of the points to be used as center of the nova itself...
normally, you will be using GetSpellTargetX and GetSpellTargetY for those parts...

simpleCreate was made to do exactly 1 nova...

maybe you misread? I have clearly stated in the header that simpleCreate is for 1-time Nova...

JASS:
/*
For very simple, 1-time Nova use this function                                              
                                                                                            
            NovaSystem.simpleCreate(unit caster,real x, real y, real faoe,                    
            real height, damage, real scale, string path, attacktype at, damagetype dt )
*/

btw, npil and npih are from the list of ALL parameters... as you can see, simpleCreate doesn't take those parameters...

If you still have problems, see my other spells that uses this system (Creeping Flames, Echo Buster )... (or even just the 5 sample spells that come with these)...

For the last question, just make a single nova...

now if you want that for a multi-nova spell, you'd need to create another script that extends the NovaSystem struct and replace the onHitFilter stub method... then you'd create a function which runs upon onDamage that saves units hit into a group... then on the onHitFilter, check if the unit is part of the group or not...
 
Top