Spellpack Magic / Mana Spells

S

sinners_la_b

Guest
This is my magic / mana spell back. Very fun to use in my opinion, hopefully you enjoy

Magic Overload

Jass : Yes
Lag : No
Leaks : No

The caster becomes overloaded with magical energies which then erupt in lines at random distance and random angles.

CODE !

JASS:

<div style="margin-left: 20px">

scope MagicOverload
//*********************************************************************************************
//                                       Magic Overload                                       *  
//                                     ------------------                                     *
//                                              BY                                            *
//                                                                                            *
//                                                                                            *
//                                          sinners_la_b                                      *
//                                                                                            * 
//                            contact at : <a href="mailto:[email protected]">[email protected]</a>                           *
//                                                                                            *  
//                          Read the README for Implementaion details                         *
//                                                                                            *  
//*********************************************************************************************


globals

//&lt;--------&gt;START RAW CODES&lt;--------&gt;

    private constant integer MagicOverload_Raw               = &#039;A000&#039;   // Raw code of Magic Overload
    private constant integer MagicOverload_DummyRaw          = &#039;u001&#039;   // Raw cope of a dummy units, in the spell they are the effects

//&lt;--------&gt;END RAW CODES&lt;--------&gt;
   
   
//&lt;--------&gt;START REAL VALUES&lt;--------&gt;   
   
    private constant real MagicOverload_MinimumDistance      = 100.00 // Minimum distance from caster the lines will be made
    private constant real MagicOverload_MaximumDistance      = 500.00 // Base Maximum (Base + Further * level)
    private constant real MagicOverload_MaximumDistanceFurther = 100.00 // Further Maximum
    private constant real MagicOverload_Damage               = 120  // Base Damage ( Base + Further * level)
    private constant real MagicOverload_DamageFurther        = 50   // Further Damagr

//&lt;--------&gt;END REAL VALUES&lt;--------&gt;     
    
endglobals

 struct MO

    unit caster
    integer count
    integer level
    group k
    
    
endstruct


function MagicOverload_IdCheck takes nothing returns boolean
 return GetSpellAbilityId() == MagicOverload_Raw 
endfunction

function MagicOverload_Cond takes nothing returns boolean
local timer t   = GetExpiredTimer()
local MO d
set d = GetTimerStructA(t)

        return (not IsUnitInGroup(GetFilterUnit(), d.k)) and IsPlayerEnemy(GetOwningPlayer(d.caster), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)==false

endfunction


function MagicOverload_Create takes nothing returns nothing 

        local timer t           = GetExpiredTimer()
        local real newx
        local real newy
        local real newx2
        local real newy2
        local real distance        
        local real angle
        local real newangle
        local unit dummy
        local unit array dummy2
        local boolexpr b        = Condition(function MagicOverload_Cond)
        local integer ui        = 1
        local group g           = CreateGroup()
        local unit next
        local MO d
        
        set d = GetTimerStructA(t)
                
       
                   
                   if GetUnitCurrentOrder(d.caster) == OrderId(&quot;channel&quot;) then
        
                
                                      
                                      set dummy = CreateUnit(GetOwningPlayer(d.caster), MagicOverload_DummyRaw, GetUnitX(d.caster), GetUnitY(d.caster), 0.00)
                    
                                                    call UnitApplyTimedLife(dummy, &#039;BTLF&#039;, 2.00)
                    
                                                set distance = GetRandomReal(MagicOverload_MinimumDistance, MagicOverload_MaximumDistance + MagicOverload_MaximumDistanceFurther * d.level)
                                                set angle = GetRandomReal(1, 359)
                    
                    
                    
                                set newx = GetUnitX(d.caster) + distance * Cos(angle * bj_RADTODEG)
                                set newy = GetUnitY(d.caster) + distance * Sin(angle * bj_RADTODEG)
                        
                                    call SetUnitPosition(dummy, newx, newy)
                  
                        set newangle = AngleInReal(GetUnitX(d.caster), GetUnitY(d.caster), GetUnitX(dummy), GetUnitY(dummy))
                  
                    
                            set d.count = 100
                        
                        loop
                        
        
                                exitwhen d.count &gt;= distance
                    
                       
                            set dummy2[ui] = CreateUnit(GetOwningPlayer(d.caster), MagicOverload_DummyRaw, GetUnitX(d.caster), GetUnitY(d.caster), 0.00)
                       
                           call UnitApplyTimedLife(dummy2[ui], &#039;BTLF&#039;, 0.50)
                                
                              set newx2 = GetUnitX(d.caster) + d.count * Cos(newangle * bj_DEGTORAD)
                              set newy2 = GetUnitY(d.caster) + d.count * Sin(newangle * bj_DEGTORAD)
                                
                                    call SetUnitPosition(dummy2[ui], newx2, newy2)
                                    
                                        call GroupEnumUnitsInRange(g, GetUnitX(dummy2[ui]), GetUnitY(dummy2[ui]), 100, b)
                            call GroupClear(d.k)
                                     loop
                                                    
                                                    set next = FirstOfGroup(g)
                                    
                                                       
                                                       exitwhen next == null
                                        
                                        call GroupAddUnit(d.k, next)
                                        
                                                    call UnitDamageTarget(d.caster, next, MagicOverload_Damage + MagicOverload_DamageFurther * d.level , true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
                                   
                                                        call GroupRemoveUnit(g, next)
                                            
                                    endloop

                                 
                                 
                            set d.count = d.count + 100
                            set ui = ui + 1
                          
                            
                        endloop
                        
                        
                        
            else
            
            call PauseTimer(t)
            call ClearTimerStructA(t)
            call DestroyTimer(t)
            call d.destroy()
            call DestroyGroup(g)
            call DestroyBoolExpr(b)
            
                set t = null
                set dummy = null
                set d.caster = null
                set next = null
           loop
            
                exitwhen ui == 0
                
                    set dummy2[ui] = null
                    
                set ui = ui - 1
                
            endloop
            
        endif
            
        
endfunction




function MagicOverload_Core takes nothing returns nothing

        local timer t           = CreateTimer()
     
        local MO d              = MO.create()
        
        set d.count             = 100
        set d.caster            = GetTriggerUnit()
        set d.level             = GetUnitAbilityLevel(d.caster, MagicOverload_Raw)
        set d.k                 = CreateGroup()
                
                call SetTimerStructA(t, d)
       
                
            call TimerStart(t, 0.25, true, function MagicOverload_Create)
      
        
    
    endfunction

endscope

//===========================================================================
function InitTrig_Magic_Overload takes nothing returns nothing
    
    local trigger gg_trg_Magic_Overload = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Magic_Overload, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Magic_Overload, Condition( function MagicOverload_IdCheck ) )
    call TriggerAddAction( gg_trg_Magic_Overload, function MagicOverload_Core )
    
endfunction
&#8203;</div>


SCREENSHOT !

No1.jpg


Corupt Power

Jass : Yes
Lag : No
Leak : No

The caster corupts the power of all enemy units around him dealing damage and returning some of that corupted power back to him in pure form

CODE !

JASS:

<div style="margin-left: 20px">

scope CoruptPower
//*********************************************************************************************
//                                         Corupt Power                                       *  
//                                       ---------------                                      *
//                                              BY                                            *
//                                                                                            *
//                                                                                            *
//                                          sinners_la_b                                      *
//                                                                                            * 
//                            contact at : <a href="mailto:[email protected]">[email protected]</a>                           *
//                                                                                            *  
//                          Read the README for Implementaion details                         *
//                                                                                            *  
//*********************************************************************************************



globals

//&lt;--------&gt;START RAW CODES&lt;--------&gt;



            private constant integer CP_Raw                     = &#039;A001&#039; // Raw code of Corupt Power
            private constant integer CP_DummyRaw                = &#039;u002&#039; // Raw code of a dummy unit
            private constant integer CP_LightningRaw            = &#039;A002&#039; // Raw code of chain lightning that does the damage
 


//&lt;--------&gt;END RAW CODES&lt;--------&gt;        
            

//======================================================================            
            
            
//&lt;--------&gt;START REAL VALUES&lt;--------&gt;   

            
                                                                                   
            private constant real CP_Range                      = 400.00
            private constant real CP_Delay                      = 1


//&lt;--------&gt;END REAL VALUES&lt;--------&gt;

endglobals


struct CP

    unit caster
    real x
    real y
    real count
    integer level
   
    
endstruct

function CoruptPower_IdCheck takes nothing returns boolean
 return GetSpellAbilityId() == CP_Raw 
endfunction

function CoruptPower_Cond takes nothing returns boolean
  local CP d
  set d = GetTimerStructA(GetExpiredTimer())
  return IsPlayerEnemy(GetOwningPlayer(d.caster), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)==false
endfunction

function CoruptPower_Cast takes nothing returns nothing
    
        local CP d
        local timer t           = GetExpiredTimer()
        local unit dummy
       
        
                    set d = GetTimerStructA(t)
        
            set dummy = CreateUnit(GetOwningPlayer(d.caster), CP_DummyRaw , d.x, d.y, 0.00)
            call UnitAddAbility(dummy, CP_LightningRaw)
            call SetUnitAbilityLevel(dummy, CP_LightningRaw, d.level)
            
        call IssueTargetOrder(dummy, &quot;chainlightning&quot;, GetEnumUnit())
    
    
    
    call UnitApplyTimedLife(dummy, &#039;BTLF&#039;, 0.25)
    
    set t = null
    set dummy = null
            
endfunction


 function CoruptPower_Create takes nothing returns nothing

            local timer t               = GetExpiredTimer()
            local group g               = CreateGroup()
            local CP d
            local integer groupunits
            set d = GetTimerStructA(t)
          
       
       if GetUnitCurrentOrder(d.caster) == OrderId(&quot;charm&quot;) then
        
      
           
        call GroupEnumUnitsInRange(g, d.x, d.y, CP_Range, Condition(function CoruptPower_Cond))
        
        set groupunits = CountUnitsInGroup(g)
        
            call ForGroup(g, function CoruptPower_Cast)
     
            
    call SetUnitState(d.caster, UNIT_STATE_LIFE, GetUnitState(d.caster, UNIT_STATE_LIFE) + d.level * groupunits * 5 )    
       
       else
        
        call PauseTimer(t)
        call ClearTimerStructA(t)
        call DestroyGroup(g)
        call DestroyTimer(t)
        call d.destroy()

        set t = null
       
       endif

                
                    
                    
                    
                    
endfunction

 function CoruptPower_Core takes nothing returns nothing

            local timer t               = CreateTimer()
            local location l            = GetSpellTargetLoc()       
            local CP d                    = CP.create()
           
           
               
                set d.caster            = GetTriggerUnit()
                set d.level             = GetUnitAbilityLevel(d.caster, &#039;A001&#039;)
                set d.x                 = GetUnitX(d.caster)
                set d.y                 = GetUnitY(d.caster)
         
      
        call SetTimerStructA(t, d)
   
        
           call TimerStart(t, CP_Delay , true, function CoruptPower_Create)


        set t = null
        call RemoveLocation(l)
        set l = null


endfunction

endscope

//===========================================================================
function InitTrig_Corupt_Power takes nothing returns nothing
    set gg_trg_Corupt_Power = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Corupt_Power, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Corupt_Power, Condition( function CoruptPower_IdCheck ) )
    call TriggerAddAction( gg_trg_Corupt_Power, function CoruptPower_Core  )
endfunction
&#8203;</div>

SCREENSHOT !

CoruptPower.jpg

Mana Flood

Jass : Yes
Lag : No
Leak : No

Floods a unit with mana creating a barrier that absorbs damage. When the barrier reaches its brink it burst releasing the stored damage as mana and restoring some mana to all units around the target. Also when the unit has the shield on it will not take damage however your mana will be minused.

CODE !

JASS:

<div style="margin-left: 20px">

scope ManaFlood
//*********************************************************************************************
//                                          Mana Flood                                        *  
//                                       ---------------                                      *
//                                              BY                                            *
//                                                                                            *
//                                                                                            *
//                                          sinners_la_b                                      *
//                                                                                            * 
//                            contact at : <a href="mailto:[email protected]">[email protected]</a>                           *
//                                                                                            *  
//                          Read the README for Implementaion details                         *
//                                                                                            *  
//*********************************************************************************************

globals 

//&lt;--------&gt;START RAW CODES&lt;--------&gt;

        private constant integer ManaFlood_Raw              = &#039;A005&#039; // Raw code of Mana Flood
        private constant integer ManaFlood_DummyRaw         = &#039;u002&#039; // Raw code of dummy
        private constant integer ManaFlood_LightningRaw     = &#039;A004&#039; // Raw code of Lightning
        
//&lt;--------&gt;END RAW CODES&lt;--------&gt;

//&lt;--------&gt;START REAL VALUES&lt;--------&gt;

        private constant real ManaFlood_DamageRecieved              = 100.00 // Base of the damage ( base + further * level)
        private constant real ManaFlood_DamageRecievedFurther       = 50.00 // Further of the damage
        private constant real ManaFlood_Mana                        = 50
        private constant real ManaFlood_ManaFurther                 = 25
        
        real ManaFlood_DamageCounter       = 0
        
//&lt;--------&gt;END REAL VALUES&lt;--------&gt;

endglobals

struct MF

    unit caster
    unit target
    integer level
    real DamageRequired
    effect e
    triggeraction ta
    effect e2
endstruct

function ManaFlood_IdCheck takes nothing returns boolean
return GetSpellAbilityId() == ManaFlood_Raw 
endfunction

function ManaFlood_Cond takes nothing returns boolean

    local MF data                   = GetTriggerStructA(GetTriggeringTrigger())

return IsUnitAlly(GetFilterUnit(), GetOwningPlayer(data.caster)) and not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) ) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) &gt;0.405 and not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD))

endfunction


function ManaFlood_Detect takes nothing returns nothing

        local trigger tr                = GetTriggeringTrigger()
        local MF data                   = GetTriggerStructA(tr)                      
        local group g                   = CreateGroup()
        local unit next
        local unit dummy
        
        if ManaFlood_DamageCounter &lt; data.DamageRequired then
            
            set data.e                      = AddSpecialEffectTarget(&quot;Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl&quot;, data.target, &quot;origin&quot;)
            set data.e2                     = AddSpecialEffectTarget(&quot;Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl&quot;, data.target, &quot;overhead&quot;)
            
              
                call SetUnitState(data.target, UNIT_STATE_LIFE, GetUnitState(data.target, UNIT_STATE_LIFE) + GetEventDamage())
                call SetUnitState(data.target, UNIT_STATE_MANA, GetUnitState(data.target, UNIT_STATE_MANA) - GetEventDamage() / data.level)

                    set ManaFlood_DamageCounter = ManaFlood_DamageCounter + GetEventDamage()
            
            if GetUnitState(data.target, UNIT_STATE_MANA) &lt;= 0.405 then
                
                
        
        call TriggerRemoveAction(tr, data.ta)
        call DestroyEffect(data.e)
        call DestroyEffect(data.e2)
        call DestroyTrigger(tr)
        call data.destroy()
        call DestroyGroup(g)
        
            set next = null
            set dummy = null
           
           endif
     
        else
       
            call GroupEnumUnitsInRange(g, GetUnitX(data.target), GetUnitY(data.target), 400.00, Condition( function ManaFlood_Cond))
        
        
                    loop
                    
                        set next = FirstOfGroup(g)
                    
                            exitwhen next == null
                
                
                set dummy = CreateUnit(GetOwningPlayer(data.caster), ManaFlood_DummyRaw, GetUnitX(data.target), GetUnitY(data.target), 0.00)
                
                    call UnitAddAbility(dummy, ManaFlood_LightningRaw)
                    call UnitApplyTimedLife(dummy, &#039;BTLF&#039;, 0.25)
                    call IssueTargetOrder(dummy, &quot;chainlightning&quot;, next)
                        
                        call SetUnitState(next, UNIT_STATE_MANA, GetUnitState(next, UNIT_STATE_MANA) + ManaFlood_Mana + ManaFlood_ManaFurther * data.level)
               
               call GroupRemoveUnit(g, next)
                
                  
                
                    endloop
        
        call TriggerRemoveAction(tr, data.ta)
        call DestroyEffect(data.e)
        call DestroyEffect(data.e2)
        call DestroyTrigger(tr)
        call data.destroy()
        call DestroyGroup(g)
        
            set next = null
            set dummy = null
       
       endif
        
endfunction
        
            
                    
function ManaFlood_Core takes nothing returns nothing

        
        local MF data                   = MF.create()
        local trigger tr                = CreateTrigger()
            
        
    set ManaFlood_DamageCounter             = 0
            
            set data.caster                 = GetTriggerUnit()
            set data.target                 = GetSpellTargetUnit()
            set data.level                  = GetUnitAbilityLevel(data.caster, ManaFlood_Raw)
            set data.DamageRequired         = ManaFlood_DamageRecieved + ManaFlood_DamageRecievedFurther * data.level
            set data.e                      = AddSpecialEffectTarget(&quot;Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl&quot;, data.target, &quot;origin&quot;)
            set data.e2                     = AddSpecialEffectTarget(&quot;Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl&quot;, data.target, &quot;overhead&quot;)
            
            
                call SetTriggerStructA(tr, data)
            
            call TriggerRegisterUnitEvent(tr, data.target, EVENT_UNIT_DAMAGED)
            set data.ta = TriggerAddAction(tr, function ManaFlood_Detect)
    
    call PolledWait(25)
    
        call TriggerRemoveAction(tr, data.ta)
        call DestroyEffect(data.e)
        call DestroyEffect(data.e2)
        call ClearTriggerStructA(tr)
        call DestroyTrigger(tr)
        call data.destroy()
 
        
       
endfunction
endscope
//===========================================================================
function InitTrig_Mana_Flood takes nothing returns nothing
    set gg_trg_Mana_Flood = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Mana_Flood, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Mana_Flood, Condition( function ManaFlood_IdCheck ) )
    call TriggerAddAction( gg_trg_Mana_Flood, function ManaFlood_Core )
endfunction
&#8203;</div>


SCREENSHOT !

ManaFlood.jpg


Hope you like them

Sinners
 

Attachments

  • Magic Mana Spells.w3x
    79.6 KB · Views: 220

hell_knight

Playing WoW
Reaction score
126
lol you could see my tutorial open in the background =)

Nice use of lightning effects +rep

( Can't test map , I think the problem is I don't got NewGen )
 
Reaction score
456
Nice looking spells.. but really brain-exploding coding, as there is so many empty lines between the calls.
 
S

sinners_la_b

Guest
Nice looking spells.. but really brain-exploding coding, as there is so many empty lines between the calls.

Yeah it just a personal thing cause it is easier for me to read it.

Also i thought the indents indented the code but i guess not.

Also Credit to hell_knight the the tutorial of custom lightning effects
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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