Warcraft III: MapsModelsSkinsIconsCode SnippetsSpellsToolsTutorials

Welcome

Welcome to the community where modding your favorite game can be possible, and supported by a nice and warm community. Here you will find resources which will help you to develop your projects faster. Additionally you can show your projects and share with a growing community, even be part of the Blizzard Modding Network, which aims to gather all the projects and clans around this game.

Please enjoy your stance here.

Warcraft III Spells & systems

[Spell] Dark Matter v1.0


By Dalve


(Description)
Summons  a dark matter at the targeted point. The dark  matter has  ability to absorb all enemy units within 400  range  onto it's position while releasing smaller dark particles to attack those  captured units. Each particle deals 90 damage  on  hit. Lasts for 15 seconds.

(Details)
  • Level(s): 1
  • Manacost: 270
  • Cooldown: 145 s
  • Cast range: 800
  • Area of Effect: 400







  • (Required)
    • Stack
    • CTL
    • WorldBounds
  • (Optional)
    • SpellEffectEvent
    • AutoFly

  • Import all necessary datas (imports, objects, triggers, etc.) into your map.
  • Install all required dependencies correctly.
  • Configure the spell.
  • Done.

(Readme)
Code: jass  [Select]
  1. /*
  2.  
  3.     [General]
  4.         Name: Dark Matter
  5.         Version: 1.0
  6.         Class: Ultimate
  7.    
  8.     [Details]
  9.         Level(s): 1
  10.         Manacost: 270
  11.         Cooldown: 145 s
  12.         Cast range: 800
  13.         Area of Effect: 400
  14.        
  15.     [Description]
  16.         Summons  a dark matter at the targeted point. The dark  matter
  17.         has  ability to absorb all enemy units within 400  range  onto
  18.         it's position while releasing smaller dark particles to attack
  19.         those  captured units. Each particle deals 90 damage  on  hit.
  20.         Lasts for 15 seconds.
  21.  
  22.     [External dependencies]
  23.         (Required)
  24.             - Stack
  25.             - CTL
  26.             - WorldBounds
  27.         (Optional)
  28.             - SpellEffectEvent
  29.             - AutoFly
  30.            
  31.     [Credits]
  32.         - Nestharus
  33.             | Stack, CTL, WorldBounds, AutoFly
  34.            
  35.         - Bribe
  36.             | SpellEffectEvent
  37.            
  38.         - JetFangInferno
  39.             | Deathwave.mdx
  40.            
  41.         - WILL THE ALMIGHTY
  42.             | Blackhole.mdx
  43.            
  44.         - Hellx-Magnus
  45.             | BTNEyeOfShadow
  46.            
  47.     [How to import]
  48.         - Import all necessary datas (imports, objects, triggers, etc.)
  49.             into your map.
  50.         - Install all required dependencies correctly.
  51.         - Configure the spell.
  52.         - Done.
  53. */
(Spell)
Code: jass  [Select]
  1. scope DarkMatter
  2. /*
  3.  
  4.             ~* Dark Matter *~
  5.                     version 1.0
  6.            
  7.         Created by: Dalvengyr
  8.         Copyright 2015
  9.    
  10.         This resource is copyright protected.
  11.         Don't redistribute without permission.
  12.        
  13.         You are free to edit, use, remake, etc.
  14.         but don't remove the copyright notes
  15.         above.
  16.    
  17. */
  18.  
  19.     /*                 *\
  20.         Configuration
  21.     \*                 */
  22.    
  23.     globals
  24.    
  25.     /*  I. General settings */
  26.    
  27.         // Dummy unit's raw code at Object Editor.
  28.         private constant integer    DUMMY_OBJECT_ID       = 'h000'
  29.        
  30.         // Main spell's raw code at Object Editor.
  31.         private constant integer    SPELL_OBJECT_ID       = 'A000'
  32.        
  33.         // General decay time for special effects.
  34.         // Time for effects to finish their death animations
  35.         // before removed completely.
  36.         private constant real       SFX_DECAY_TIME        = 5.0
  37.        
  38.         // General units' hit z offset. Used for 3D collision.
  39.         private constant real       UNITS_HIT_Z_OFFSET    = 50.0
  40.        
  41.    
  42.     /*  II. Orb settings
  43.                 Orb is an object at the center of spell area.
  44.     */
  45.        
  46.         // Orb model's file path.
  47.         private constant string     ORB_SFX               = "war3mapImported\\BlackHole.mdx"
  48.        
  49.         // Orb's flying height.
  50.         private constant real       ORB_HEIGHT_Z          = 0.0
  51.        
  52.         // Orb's scale/size.
  53.         private constant real       ORB_SCALE             = 1.0
  54.        
  55.         // How bad range between victims and the orb can affect the absorb power.
  56.         private constant real       ORB_POWER_FACTOR      = 0.375
  57.        
  58.        
  59.     /*  III. Swirl settings
  60.                 Swirl is consisted by several "waves" (because I use wave model) which
  61.                 swirl around the main orb.
  62.     */
  63.        
  64.         // Wave's raw code at Object Editor.
  65.         private constant integer    SWIRL_WAVE_OBJECT_ID  = 'h001'
  66.        
  67.         // Wave's animation speed.
  68.         private constant real       SWIRL_TIME_SCALE      = 0.1
  69.        
  70.         // Wave's flying height.
  71.         private constant real       SWIRL_HEIGHT_Z        = 100.0
  72.        
  73.         // Wave's scale/size.
  74.         private constant real       SWIRL_SCALE           = 1.25
  75.        
  76.        
  77.     /*  IV. Particle settings
  78.                 Particles are missiles that are periodically released by the orb to attack
  79.                 captured units.
  80.     */
  81.    
  82.         // Particle's model file path.
  83.         private constant string     PARTICLE_SFX          = "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl"
  84.    
  85.         // Particle's starting fly height when launched.
  86.         private constant real       PARTICLE_LAUNCH_Z     = 100.0
  87.    
  88.         // Particle's scale/size.
  89.         private constant real       PARTICLE_SCALE        = 0.2
  90.    
  91.         // Particle's turn rate.
  92.         private constant real       PARTICLE_TURN_SPEED   = 0.1
  93.    
  94.         // Max range between particle at target to hit the target.
  95.         private constant real       PARTICLE_HIT_RADIUS   = 70.0
  96.    
  97.         // If false, each particle can only hits one target.
  98.         private constant boolean    PARTICLE_PIERCING     = false
  99.        
  100.         // Dealt damage setting.
  101.         private constant attacktype PARTICLE_ATTACK_TYPE  = ATTACK_TYPE_NORMAL
  102.         private constant damagetype PARTICLE_DAMAGE_TYPE  = DAMAGE_TYPE_NORMAL
  103.        
  104.     endglobals
  105.    
  106.     // These settings allow you to assign different values for each level
  107.     // in case the ability has more than one level.
  108.    
  109.     // Number of created wave to swirl around the orb.
  110.     private constant function SwirlCount takes integer level returns integer
  111.         return 9
  112.     endfunction
  113.    
  114.     // Range/distance from the orb to the created waves.
  115.     private constant function SwirlRadius takes integer level returns real
  116.         return 125.0
  117.     endfunction
  118.    
  119.     // Rotation speed of waves, in radians.
  120.     private constant function SwirlRotation takes integer level returns real
  121.         return 0.09
  122.     endfunction
  123.    
  124.     // Dealt damage when particle hits a target.
  125.     private constant function ParticleDamage takes integer level returns real
  126.         return 90.0
  127.     endfunction
  128.    
  129.     // Move speed of each particle.
  130.     private constant function ParticleSpeed takes integer level returns real
  131.         return 5.0
  132.     endfunction
  133.    
  134.     // Maximum delay before the orb releases another particle.
  135.     // Delay is randomized between zero and this value.
  136.     private constant function ParticleSpawnDelayMax takes integer level returns real
  137.         return 0.5
  138.     endfunction
  139.    
  140.     // Maximum range between the orb and targets to absorb them.
  141.     private constant function OrbAoE takes integer level returns real
  142.         return 400.0
  143.     endfunction
  144.    
  145.     // Duration of the spell.
  146.     private constant function OrbDuration takes integer level returns real
  147.         return 15.0
  148.     endfunction
  149.    
  150.     // The absorbtion power.
  151.     private constant function OrbPower takes integer level returns real
  152.         return 15.0
  153.     endfunction
  154.    
  155.     // Classifications of targets that can be affected by this spell.
  156.     private constant function SpellTargets takes unit target, player caster returns boolean
  157.         return IsUnitEnemy(target, caster) and not IsUnitType(target, UNIT_TYPE_STRUCTURE)
  158.     endfunction
  159.    
  160.     // You can add any additional effect to the target here.
  161.     // This function is executed right before the damage is dealt to
  162.     // the target.
  163.     // If you don't need this, you are free to remove this module
  164.     // anytime.
  165.     private module DarkMatterDamageEvent
  166.         static method onDamage takes unit caster, unit target returns nothing
  167.            
  168.         endmethod
  169.     endmodule
  170.    
  171.     // ~*~*~*~*~**~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
  172.    
  173.     globals
  174.         private constant real INTERVAL = 0.0312500
  175.         private group Group = CreateGroup()
  176.     endglobals
  177.    
  178.    
  179.     // Native declaration.
  180.     native UnitAlive takes unit id returns boolean
  181.    
  182.    
  183.     // Stack used to contain/store waves.
  184.     private struct Swirl extends array
  185.         unit unit
  186.         implement Stack
  187.     endstruct
  188.    
  189.    
  190.     // Create swirl at give coordinates.
  191.     private struct Tornado extends array
  192.        
  193.         Swirl swirl
  194.         integer count
  195.        
  196.         real distance
  197.         real angle
  198.         real rotation
  199.        
  200.         real space
  201.         real x
  202.         real y
  203.        
  204.         static constant real TAU = 2*bj_PI
  205.        
  206.         method terminate takes nothing returns nothing
  207.            
  208.             local Swirl node = .swirl.first
  209.            
  210.             // Kill all waves.
  211.             loop
  212.                 exitwhen node == 0
  213.                
  214.                 call KillUnit(node.unit)
  215.                 set node.unit = null
  216.                
  217.                 set node = node.next
  218.             endloop
  219.            
  220.             call .swirl.destroy()
  221.             call destroy()
  222.            
  223.         endmethod
  224.        
  225.        
  226.         implement CTL
  227.        
  228.             local real a
  229.             local integer i
  230.             local Swirl node
  231.            
  232.         implement CTLExpire
  233.        
  234.             set i = .count
  235.             set node = .swirl.first
  236.             set .angle = .angle + .rotation
  237.            
  238.             // Iterate through all nodes to update
  239.             // their angles/rotations.
  240.             loop
  241.                 exitwhen i <= 0
  242.                
  243.                 set a = .angle+.space*i
  244.                 call SetUnitX(node.unit, .x + .distance * Cos(a))
  245.                 call SetUnitY(node.unit, .y + .distance * Sin(a))
  246.                 call SetUnitFacing(node.unit, a*bj_RADTODEG)
  247.                
  248.                 set node = node.next
  249.                 set i = i - 1
  250.             endloop
  251.            
  252.         implement CTLEnd
  253.        
  254.        
  255.         static method spawn takes player p, integer count, real x, real y, real dist, real rot returns thistype
  256.            
  257.             local thistype this = create()
  258.             local integer i = 0
  259.             local real a
  260.             local Swirl node
  261.            
  262.             // Number of waves.
  263.             set .count = count
  264.             // Angle difference between each wave (in radian).
  265.             set .space = TAU/count
  266.             // Initial angle (random).
  267.             set .angle = GetRandomReal(-bj_PI, bj_PI)
  268.             // Allocate stack for waves.
  269.             set .swirl = Swirl.create()
  270.            
  271.             // Distance from center to waves.
  272.             set .distance = dist
  273.             // Rotation rate.
  274.             set .rotation = rot
  275.             set .x = x
  276.             set .y = y
  277.            
  278.             // Create the waves and store into the stack.
  279.             loop
  280.                 exitwhen i >= count
  281.                
  282.                 // Allocate new node to the stack.
  283.                 set node = .swirl.push()
  284.                 set a = .angle+.space*i
  285.                 set node.unit = CreateUnit(p, SWIRL_WAVE_OBJECT_ID, x+dist*Cos(a), y+dist*Sin(a), a*bj_RADTODEG)
  286.                
  287.                 call SetUnitScale(node.unit, SWIRL_SCALE, 1, 1)
  288.                 call SetUnitTimeScale(node.unit, SWIRL_TIME_SCALE)
  289.                
  290.                 if SWIRL_HEIGHT_Z > 0 then
  291.                
  292.                     static if not LIBRARY_AutoFly then
  293.                         if UnitAddAbility(node.unit, 'Amrf') and UnitRemoveAbility(node.unit, 'Amrf') then
  294.                         endif
  295.                     endif
  296.                    
  297.                     call SetUnitFlyHeight(node.unit, SWIRL_HEIGHT_Z, 0)
  298.                 endif
  299.                
  300.                 set i = i + 1
  301.             endloop
  302.            
  303.             return this
  304.         endmethod
  305.        
  306.     endstruct
  307.    
  308.    
  309.     private keyword DarkMatter
  310.    
  311.    
  312.     // Launch 3D homing missile.
  313.     private struct SimpleMissile extends array
  314.        
  315.         effect sfx
  316.         player owner
  317.         group targets
  318.        
  319.         unit caster
  320.         unit target
  321.         unit missile
  322.        
  323.         real x
  324.         real y
  325.         real z
  326.        
  327.         real dc
  328.         real dx
  329.         real damage
  330.        
  331.         real turn
  332.         real angle
  333.         real speed
  334.        
  335.         method terminate takes nothing returns nothing
  336.        
  337.             // Group is only created if piercing is true.
  338.             static if PARTICLE_PIERCING then
  339.                 call DestroyGroup(.targets)
  340.                 set .targets = null
  341.             endif
  342.            
  343.             call DestroyEffect(.sfx)
  344.             call UnitApplyTimedLife(.missile, 'BTLF', SFX_DECAY_TIME)
  345.             call destroy()
  346.            
  347.             // Remove leaks.
  348.             set .missile = null
  349.             set .target = null
  350.             set .caster = null
  351.             set .sfx = null
  352.            
  353.         endmethod
  354.        
  355.         implement optional DarkMatterDamageEvent
  356.        
  357.         implement CTL
  358.        
  359.             local real a
  360.             local real v
  361.             local real h
  362.            
  363.             local real d
  364.             local real x
  365.             local real y
  366.            
  367.             local unit u
  368.             local unit t
  369.             local integer rand
  370.            
  371.         implement CTLExpire
  372.        
  373.             set .dc = .dc + .speed
  374.             set .x = .x + .speed * Cos(.angle)
  375.             set .y = .y + .speed * Sin(.angle)
  376.            
  377.             // Parabola equation.
  378.             set v = 4 * (.dx-.dc) * (.dc/.dx) + PARTICLE_LAUNCH_Z
  379.            
  380.             // If haven't touched the ground and still inside the map bounds.
  381.             if v > 0 and .x < WorldBounds.maxX and .x > WorldBounds.minX and .y < WorldBounds.maxY and .y > WorldBounds.minY then
  382.            
  383.                 call SetUnitX(.missile, .x)
  384.                 call SetUnitY(.missile, .y)
  385.                 call SetUnitFlyHeight(.missile, v, 0)
  386.                
  387.                 // Adjust the angle to face the target.
  388.                 set a = Atan2(GetUnitY(.target)-.y, GetUnitX(.target)-.x)
  389.                 if Cos(.angle - a) < Cos(.turn) then
  390.                     if Sin(a - .angle) >= 0 then
  391.                         set .angle = .angle + .turn
  392.                     else
  393.                         set .angle = .angle - .turn
  394.                     endif
  395.                 else
  396.                     set .angle = a
  397.                 endif
  398.                
  399.                 // Determine one random target from all possible targets.
  400.                 // if not piercing.
  401.                 static if not PARTICLE_PIERCING then
  402.                     set t = null
  403.                     set rand = 0
  404.                 endif
  405.                
  406.                 // Iterates all units around the missile.
  407.                 call GroupEnumUnitsInRange(Group, .x, .y, PARTICLE_HIT_RADIUS, null)
  408.                 loop
  409.                     set u = FirstOfGroup(Group)
  410.                     exitwhen u == null
  411.                     call GroupRemoveUnit(Group,  u)
  412.                    
  413.                     if UnitAlive(u) and SpellTargets(u, owner) then
  414.                    
  415.                         set x = GetUnitX(u)
  416.                         set y = GetUnitY(u)
  417.                         set h = GetUnitFlyHeight(u) + UNITS_HIT_Z_OFFSET - v
  418.                         set d = SquareRoot((.x-x)*(.x-x)+(.y-y)*(.y-y))
  419.                        
  420.                         // 3D spherical collision.
  421.                         if SquareRoot(d*d+h*h) <= PARTICLE_HIT_RADIUS then
  422.                        
  423.                             static if PARTICLE_PIERCING then
  424.                            
  425.                                 if not IsUnitInGroup(u, .targets) then
  426.                                
  427.                                     static if thistype.onDamage.exists then
  428.                                         call thistype.onDamage(.caster, u)
  429.                                     endif
  430.                                
  431.                                     call UnitDamageTarget(.caster, u, .damage, false, false, PARTICLE_ATTACK_TYPE, PARTICLE_DAMAGE_TYPE, null)
  432.                                     call GroupAddUnit(.targets, u)
  433.                                    
  434.                                 endif
  435.                                
  436.                             else
  437.                                
  438.                                 // Quite effective to obtain random unit from a group.
  439.                                 set rand = rand + 1
  440.                                
  441.                                 if GetRandomInt(1, rand) == 1 then
  442.                                     set t = u
  443.                                 endif
  444.                                
  445.                             endif
  446.                         endif
  447.                        
  448.                     endif
  449.                 endloop
  450.                
  451.                 static if not PARTICLE_PIERCING then
  452.                     // If a target is found.
  453.                     if t != null then
  454.                        
  455.                         static if thistype.onDamage.exists then
  456.                             call thistype.onDamage(.caster, t)
  457.                         endif
  458.                    
  459.                         call UnitDamageTarget(.caster, t, .damage, false, false, PARTICLE_ATTACK_TYPE, PARTICLE_DAMAGE_TYPE, null)
  460.                         call terminate()
  461.                         set t = null
  462.                        
  463.                     endif
  464.                 endif
  465.                
  466.             else
  467.                 call terminate()
  468.             endif
  469.            
  470.         implement CTLEnd
  471.        
  472.        
  473.         static method launch takes DarkMatter source, unit target returns thistype
  474.            
  475.             local thistype this = create()
  476.             local real x = GetUnitX(target)
  477.             local real y = GetUnitY(target)
  478.            
  479.             set .target = target
  480.             set .caster = source.caster
  481.             set .owner = source.owner
  482.            
  483.             // Launch from random location nearby the orb.
  484.             set .x = source.x + GetRandomReal(-source.tornado.distance, source.tornado.distance)
  485.             set .y = source.y + GetRandomReal(-source.tornado.distance, source.tornado.distance)
  486.             set .angle = GetRandomReal(-bj_PI, bj_PI)
  487.            
  488.             set .missile = CreateUnit(.owner, DUMMY_OBJECT_ID, .x, .y, .angle*bj_RADTODEG)
  489.             set .sfx = AddSpecialEffectTarget(PARTICLE_SFX, .missile, "origin")
  490.             set .turn = PARTICLE_TURN_SPEED
  491.            
  492.             set .damage = source.damage
  493.             set .speed = source.speed
  494.             set .dx = source.aoe
  495.             set .dc = 0
  496.            
  497.             // Create group if only piercing is true.
  498.             static if PARTICLE_PIERCING then
  499.                 set .targets = CreateGroup()
  500.             endif
  501.            
  502.             static if not LIBRARY_AutoFly then
  503.                 if UnitAddAbility(.missile, 'Amrf') and UnitRemoveAbility(.missile, 'Amrf') then
  504.                 endif
  505.             endif
  506.            
  507.             call SetUnitFlyHeight(.missile, PARTICLE_LAUNCH_Z, 0)
  508.             call SetUnitScale(.missile, PARTICLE_SCALE, 1, 1)
  509.            
  510.             return this
  511.         endmethod
  512.        
  513.     endstruct
  514.    
  515.    
  516.     // Main spell's struct.
  517.     private struct DarkMatter extends array
  518.    
  519.         unit orb
  520.         unit caster
  521.         group targets
  522.        
  523.         Tornado tornado
  524.         player owner
  525.         effect sfx
  526.        
  527.         real aspd
  528.         real aspdx
  529.         real speed
  530.        
  531.         real damage
  532.         real power
  533.         real aoe
  534.        
  535.         real duration
  536.         real x
  537.         real y
  538.        
  539.         real delay
  540.         real delayx
  541.         real rotation
  542.         real amount
  543.        
  544.         static constant real HP = bj_PI/2
  545.        
  546.         method terminate takes nothing returns nothing
  547.        
  548.             local unit u
  549.        
  550.             // Turn all remaining units' collision back to on.
  551.             loop
  552.                 set u = FirstOfGroup(.targets)
  553.                 exitwhen u == null
  554.                 call GroupRemoveUnit(.targets, u)
  555.                 call SetUnitPathing(u, true)
  556.             endloop
  557.        
  558.             call .tornado.terminate()
  559.             call DestroyEffect(.sfx)
  560.             call DestroyGroup(.targets)
  561.             call UnitApplyTimedLife(.orb, 'BTLF', SFX_DECAY_TIME)
  562.            
  563.             call destroy()
  564.             // Remove leaks.
  565.             set .targets = null
  566.             set .caster = null
  567.             set .orb = null
  568.             set .sfx = null
  569.            
  570.         endmethod
  571.        
  572.        
  573.         implement CTL
  574.            
  575.             local group g
  576.        
  577.             local integer rand = 0
  578.             local unit t = null
  579.             local unit u
  580.            
  581.             local real d
  582.             local real x
  583.             local real y
  584.            
  585.             local real h
  586.             local real a
  587.             local real pow
  588.            
  589.         implement CTLExpire
  590.        
  591.             if .duration > INTERVAL then
  592.            
  593.                 set .duration = .duration - INTERVAL
  594.                
  595.                 // Iterate through all units around the orb (within aoe).
  596.                 call GroupEnumUnitsInRange(Group, .x, .y, .aoe, null)
  597.                 loop
  598.                     set u = FirstOfGroup(Group)
  599.                     exitwhen u == null
  600.                     call GroupRemoveUnit(Group, u)
  601.                    
  602.                     if UnitAlive(u) and SpellTargets(u, owner) then
  603.                        
  604.                         set x = GetUnitX(u)
  605.                         set y = GetUnitY(u)
  606.                         set d = SquareRoot((.x-x)*(.x-x)+(.y-y)*(.y-y))
  607.                         // Power is affected by distance between orb and the target.
  608.                         set pow = .power - .power*(d/.aoe)*ORB_POWER_FACTOR
  609.                         // Calculate target angle.
  610.                         set a = Atan2(.y-y, .x-x) - (HP*(d/.aoe))*.rotation
  611.                        
  612.                         if not IsUnitInGroup(u, .targets) then
  613.                             call GroupAddUnit(.targets, u)
  614.                             call SetUnitPathing(u, false)
  615.                         endif
  616.                    
  617.                         if .aspd <= INTERVAL then
  618.                        
  619.                             set rand = rand + 1
  620.                            
  621.                             if GetRandomInt(1, rand) == 1 then
  622.                                 set t = u
  623.                             endif
  624.                            
  625.                         endif
  626.                        
  627.                         if d > pow then
  628.                        
  629.                             call SetUnitX(u, x + pow * Cos(a))
  630.                             call SetUnitY(u, y + pow * Sin(a))
  631.                            
  632.                         else
  633.                        
  634.                             call SetUnitX(u, .x)
  635.                             call SetUnitY(u, .y)
  636.                            
  637.                         endif
  638.                        
  639.                     endif
  640.                 endloop
  641.                
  642.                 // Iterates all affected units which have
  643.                 // escaped the spell area and turn their
  644.                 // collision on.
  645.                 set g = .targets
  646.                 set .targets = CreateGroup()
  647.                 loop
  648.                     set u = FirstOfGroup(g)
  649.                     exitwhen u == null
  650.                     call GroupRemoveUnit(g, u)
  651.                    
  652.                     set x = GetUnitX(u)
  653.                     set y = GetUnitY(u)
  654.                     if SquareRoot((.x-x)*(.x-x)+(.y-y)*(.y-y)) > .aoe then
  655.                         call SetUnitPathing(u, true)
  656.                     else
  657.                         call GroupAddUnit(.targets, u)
  658.                     endif
  659.                 endloop
  660.                
  661.                 if .aspd > INTERVAL then
  662.                     set .aspd = .aspd - INTERVAL
  663.                 elseif t != null then
  664.                     // Launch missile if a random target is found.
  665.                     set .aspd = GetRandomReal(0, .aspdx)
  666.                     call SimpleMissile.launch(this, t)
  667.                     set t = null
  668.                 endif
  669.                
  670.                 // Remove leaks.
  671.                 call DestroyGroup(g)
  672.                 set g = null
  673.             else
  674.                 call terminate()
  675.             endif
  676.            
  677.         implement CTLEnd
  678.        
  679.        
  680.         static method onCast takes nothing returns nothing
  681.            
  682.             local thistype this = create()
  683.             local integer l
  684.            
  685.             set .caster = GetTriggerUnit()
  686.             set .owner = GetTriggerPlayer()
  687.            
  688.             set .x = GetSpellTargetX()
  689.             set .y = GetSpellTargetY()
  690.             set .targets = CreateGroup()
  691.            
  692.             set .orb = CreateUnit(.owner, DUMMY_OBJECT_ID, .x, .y, 270)
  693.             set .sfx = AddSpecialEffectTarget(ORB_SFX, .orb, "origin")
  694.             set l = GetUnitAbilityLevel(.caster, SPELL_OBJECT_ID)
  695.            
  696.             set .aoe = OrbAoE(l)
  697.             set .power = OrbPower(l)
  698.             set .duration = OrbDuration(l)
  699.            
  700.             set .rotation = SwirlRotation(l)
  701.             set .tornado = Tornado.spawn(.owner, SwirlCount(l), .x, .y, SwirlRadius(l), .rotation)
  702.             // Get the rotation direction.
  703.             set .rotation = .rotation/RAbsBJ(.rotation)
  704.            
  705.             set .speed = ParticleSpeed(l)
  706.             set .damage = ParticleDamage(l)
  707.             set .aspd = ParticleSpawnDelayMax(l)
  708.            
  709.             set .aspdx = .aspd
  710.             call SetUnitScale(.orb, ORB_SCALE, 1, 1)
  711.            
  712.             if ORB_HEIGHT_Z > 0 then
  713.                 static if not LIBRARY_AutoFly then
  714.                     if UnitAddAbility(.orb, 'Amrf') and UnitRemoveAbility(.orb, 'Amrf') then
  715.                     endif
  716.                 endif
  717.                 call SetUnitFlyHeight(.orb, ORB_HEIGHT_Z, 0)
  718.             endif
  719.            
  720.         endmethod
  721.            
  722.            
  723.         static if not LIBRARY_SpellEffectEvent then
  724.             private static method check takes nothing returns boolean
  725.                 if GetSpellAbilityId() == SPELL_OBJECT_ID then
  726.                     call thistype.onCast()
  727.                 endif
  728.                 return false
  729.             endmethod
  730.         endif
  731.        
  732.        
  733.         static method onInit takes nothing returns nothing
  734.  
  735.             local trigger t
  736.            
  737.             static if LIBRARY_SpellEffectEvent then
  738.                 call RegisterSpellEffectEvent(SPELL_OBJECT_ID, function thistype.onCast)
  739.             else
  740.                 set t = CreateTrigger()
  741.                 call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
  742.                 call TriggerAddCondition(t, Condition(function thistype.check))
  743.             endif
  744.            
  745.         endmethod
  746.        
  747.     endstruct
  748.    
  749. endscope

  • Nestharus

| Stack, CTL, WorldBounds, AutoFly

           
  • Bribe

| SpellEffectEvent

           
  • JetFangInferno

| Deathwave.mdx


           
  • WILL THE ALMIGHTY

| Blackhole.mdx

           
  • Hellx-Magnus

| BTNEyeOfShadow

[/list]

Picked from the vault...

Double Spinning Blade v1.1.1


By Rheiko

Double Spinning Blade
The User throw a spinning blade towards the target point, for set amount of time the blade will destroyed and the user's illusion will appeared at blade's location. Then he throw a spinning blade again to the user's current location.
Level 1 - 75 damage.
Level 2 - 100 damage.
Level 3 - 125 damage.

READ!! IMPORTANT!!
How to Import
Go to World Editor => file => Preferences => Check the "Automatically create unknown Variable while pasting trigger data" => ok
Copy all triggers (except "Do not import this" trigger) to your map
then open Object Editor, copy the "Spinning Blade" and "Rokhan Dummy" to your map. and store them into Configuration Trigger
(Set DSB_Dummy_Type = Spinning Blade and Set DSB_Dummy_Type2 = Rokhan Dummy)
remember, the first dummy type is for the blade, and the second dummy type is for the illusion

Triggers
Configuration
Trigger: Configuration
    Events
        Map initialization
    Conditions
    Actions
        -------- --------------------------------------------- --------
        -------- Store your ability id here --------
        Set DSB_Ability_ID = Double Spinning Blade
        -------- Store your dummy here --------
        Set DSB_Dummy_Type = Spinning Blade
        Set DSB_Dummy_Type2 = Rokhan Dummy
        -------- Your Caster's animation when cast the spell --------
        Set DSB_Animation = attack
        -------- Your Dummy's animation when cast the spell --------
        Set DSB_Dummy2_Animation = attack
        -------- Your 2nd Dummy's expiration timer --------
        Set DSB_Dummy2_Lifetime = 1.50
        -------- Your 2nd Dummy's color (RGB) --------
        Set DSB_Dummy2_RED = 40.00
        Set DSB_Dummy2_GREEN = 40.00
        Set DSB_Dummy2_BLUE = 40.00
        -------- Your 2nd Dummy's transparency --------
        Set DSB_Dummy2_Transparency = 40.00
        -------- Your ability's damage when it's hit enemies in the line --------
        Set DSB_Damage[1] = 75.00
        Set DSB_Damage[2] = 100.00
        Set DSB_Damage[3] = 125.00
        -------- Area of Effect of the ability --------
        Set DSB_AoE = 150.00
        -------- How far your blade travels --------
        Set DSB_Distance = 1000.00
        -------- How far your blade spawns --------
        Set DSB_Start_Range = 100.00
        -------- Special Effect which spawn when the blade hits your enemies --------
        Set DSB_Special_Effect = Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
        -------- which point your special effect will spawned at? head/chest/hand/overhead/origin, etc --------
        Set DSB_Special_Effect_Location = chest
        -------- Yes = Will Destroy Trees / No = Won't Destroy Trees --------
        Set DSB_Destroy_Tree = True
        -------- --------------------------------------------- --------
        -------- Conditions Configuration --------
        -------- --------------------------------------------- --------
        -------- Units Belongs to enemy player --------
        Set DSB_Conditions[1] = True
        -------- Units is Alive --------
        Set DSB_Conditions[2] = True
        -------- Units is Magic Immune --------
        Set DSB_Conditions[3] = False
        -------- Units is a Structure --------
        Set DSB_Conditions[4] = False
        -------- Units is in UnDamage Group (to prevent damage looping) --------
        Set DSB_Conditions[5] = False
        -------- --------------------------------------------- --------
        -------- DO NOT CHANGE THIS --------
        -------- --------------------------------------------- --------
        Set TempPoint = (Center of (Playable map area))
        Unit - Create 1 Peasant for Player 1 (Red) at TempPoint facing Default building facing degrees
        Custom script:   call RemoveLocation(udg_TempPoint)
        Set DSB_Destroyer = (Last created unit)
        Unit - Hide DSB_Destroyer
        -------- --------------------------------------------- --------
Cast Trigger
Trigger: Double Spinning Blade
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to DSB_Ability_ID
    Actions
        Set DSB_Max_Index = (DSB_Max_Index + 1)
        Set DSB_Owner[DSB_Max_Index] = (Triggering player)
        Set DSB_Caster[DSB_Max_Index] = (Triggering unit)
        Set DSB_Ability_Level[DSB_Max_Index] = (Level of DSB_Ability_ID for DSB_Caster[DSB_Max_Index])
        Animation - Play DSB_Caster[DSB_Max_Index]'s DSB_Animation animation
        Set TempPoint = (Position of DSB_Caster[DSB_Max_Index])
        Set TempPoint2 = (Target point of ability being cast)
        Set DSB_Angle[DSB_Max_Index] = (Angle from TempPoint to TempPoint2)
        Set TempPoint3 = (TempPoint offset by DSB_Start_Range towards DSB_Angle[DSB_Max_Index] degrees)
        Unit - Create 1 DSB_Dummy_Type for DSB_Owner[DSB_Max_Index] at TempPoint3 facing DSB_Angle[DSB_Max_Index] degrees
        Set DSB_Dummy[DSB_Max_Index] = (Last created unit)
        Unit - Add a ((DSB_Distance x 0.03) x 0.03) second Generic expiration timer to DSB_Dummy[DSB_Max_Index]
        Set DSB_Stage[DSB_Max_Index] = 1
        Custom script:   set udg_DSB_UnDamage_Group[udg_DSB_Max_Index] = CreateGroup()
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DSB_Max_Index Equal to 1
            Then - Actions
                Trigger - Turn on DSB Loop <gen>
            Else - Actions
        Custom script:   call RemoveLocation(udg_TempPoint)
        Custom script:   call RemoveLocation(udg_TempPoint2)
        Custom script:   call RemoveLocation(udg_TempPoint3)
Loop Trigger
Trigger: DSB Loop
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        For each (Integer DSB_Current_Index) from 1 to DSB_Max_Index, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        DSB_Stage[DSB_Current_Index] Equal to 1
                    Then - Actions
                        Set TempPoint = (Position of DSB_Dummy[DSB_Current_Index])
                        Set TempPoint2 = (TempPoint offset by (DSB_Distance x 0.03) towards DSB_Angle[DSB_Current_Index] degrees)
                        Unit - Move DSB_Dummy[DSB_Current_Index] instantly to TempPoint2
                        Set DSB_Damage_Group[DSB_Current_Index] = (Units within DSB_AoE of TempPoint)
                        Unit Group - Pick every unit in DSB_Damage_Group[DSB_Current_Index] and do (Actions)
                            Loop - Actions
                                Set TempUnit = (Picked unit)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (TempUnit belongs to an enemy of DSB_Owner[DSB_Current_Index]) Equal to DSB_Conditions[1]
                                        (TempUnit is alive) Equal to DSB_Conditions[2]
                                        (TempUnit is Magic Immune) Equal to DSB_Conditions[3]
                                        (TempUnit is A structure) Equal to DSB_Conditions[4]
                                        (TempUnit is in DSB_UnDamage_Group[DSB_Current_Index]) Equal to DSB_Conditions[5]
                                    Then - Actions
                                        Unit - Cause DSB_Caster[DSB_Current_Index] to damage TempUnit, dealing DSB_Damage[DSB_Ability_Level[DSB_Current_Index]] damage of attack type Spells and damage type Normal
                                        Special Effect - Create a special effect attached to the DSB_Special_Effect_Location of TempUnit using DSB_Special_Effect
                                        Special Effect - Destroy (Last created special effect)
                                        Unit Group - Add TempUnit to DSB_UnDamage_Group[DSB_Current_Index]
                                    Else - Actions
                        Custom script:   call DestroyGroup(udg_DSB_Damage_Group[udg_DSB_Current_Index])
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                DSB_Destroy_Tree Equal to True
                            Then - Actions
                                Destructible - Pick every destructible within DSB_AoE of TempPoint and do (Actions)
                                    Loop - Actions
                                        Set TempDest = (Picked destructible)
                                        Unit - Order DSB_Destroyer to Harvest TempDest
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Current order of DSB_Destroyer) Equal to (Order(harvest))
                                            Then - Actions
                                                Destructible - Kill TempDest
                                            Else - Actions
                                        Unit - Order DSB_Destroyer to Stop
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (DSB_Dummy[DSB_Current_Index] is dead) Equal to True
                            Then - Actions
                                Custom script:   call DestroyGroup(udg_DSB_UnDamage_Group[udg_DSB_Current_Index])
                                Custom script:   set udg_DSB_UnDamage_Group[udg_DSB_Max_Index] = CreateGroup()
                                Set DSB_Stage[DSB_Current_Index] = 2
                                Custom script:   call RemoveLocation(udg_TempPoint2)
                                Set TempPoint2 = (Position of DSB_Caster[DSB_Current_Index])
                                Unit - Create 1 DSB_Dummy_Type2 for DSB_Owner[DSB_Current_Index] at TempPoint facing TempPoint2
                                Set DSB_Dummy2[DSB_Current_Index] = (Last created unit)
                                Unit - Add a DSB_Dummy2_Lifetime second Generic expiration timer to DSB_Dummy2[DSB_Current_Index]
                                Animation - Change DSB_Dummy2[DSB_Current_Index]'s vertex coloring to (DSB_Dummy2_RED%, DSB_Dummy2_GREEN%, DSB_Dummy2_BLUE%) with DSB_Dummy2_Transparency% transparency
                                Animation - Play DSB_Dummy2[DSB_Current_Index]'s DSB_Dummy2_Animation animation
                                Custom script:   call RemoveLocation(udg_TempPoint)
                                Set TempPoint = (Position of DSB_Dummy2[DSB_Current_Index])
                                Set DSB_Angle[DSB_Current_Index] = (Angle from TempPoint to TempPoint2)
                                Set TempPoint3 = (TempPoint offset by DSB_Start_Range towards DSB_Angle[DSB_Current_Index] degrees)
                                Unit - Remove DSB_Dummy[DSB_Current_Index] from the game
                                Unit - Create 1 DSB_Dummy_Type for DSB_Owner[DSB_Current_Index] at TempPoint3 facing DSB_Angle[DSB_Current_Index] degrees
                                Set DSB_Dummy[DSB_Current_Index] = (Last created unit)
                                Unit - Add a ((DSB_Distance x 0.03) x 0.03) second Generic expiration timer to DSB_Dummy[DSB_Current_Index]
                                Custom script:   call RemoveLocation(udg_TempPoint)
                                Custom script:   call RemoveLocation(udg_TempPoint3)
                            Else - Actions
                                Custom script:   call RemoveLocation(udg_TempPoint)
                        Custom script:   call RemoveLocation(udg_TempPoint2)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                DSB_Stage[DSB_Current_Index] Equal to 2
                            Then - Actions
                                Set TempPoint = (Position of DSB_Dummy[DSB_Current_Index])
                                Set TempPoint2 = (TempPoint offset by (DSB_Distance x 0.03) towards DSB_Angle[DSB_Current_Index] degrees)
                                Unit - Move DSB_Dummy[DSB_Current_Index] instantly to TempPoint2
                                Set DSB_Damage_Group[DSB_Current_Index] = (Units within DSB_AoE of TempPoint)
                                Unit Group - Pick every unit in DSB_Damage_Group[DSB_Current_Index] and do (Actions)
                                    Loop - Actions
                                        Set TempUnit = (Picked unit)
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (TempUnit belongs to an enemy of DSB_Owner[DSB_Current_Index]) Equal to DSB_Conditions[1]
                                                (TempUnit is alive) Equal to DSB_Conditions[2]
                                                (TempUnit is Magic Immune) Equal to DSB_Conditions[3]
                                                (TempUnit is A structure) Equal to DSB_Conditions[4]
                                                (TempUnit is in DSB_UnDamage_Group[DSB_Current_Index]) Equal to DSB_Conditions[5]
                                            Then - Actions
                                                Unit - Cause DSB_Caster[DSB_Current_Index] to damage TempUnit, dealing DSB_Damage[DSB_Ability_Level[DSB_Current_Index]] damage of attack type Spells and damage type Normal
                                                Special Effect - Create a special effect attached to the DSB_Special_Effect_Location of TempUnit using DSB_Special_Effect
                                                Special Effect - Destroy (Last created special effect)
                                                Unit Group - Add TempUnit to DSB_UnDamage_Group[DSB_Current_Index]
                                            Else - Actions
                                Custom script:   call DestroyGroup(udg_DSB_Damage_Group[udg_DSB_Current_Index])
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        DSB_Destroy_Tree Equal to True
                                    Then - Actions
                                        Destructible - Pick every destructible within DSB_AoE of TempPoint and do (Actions)
                                            Loop - Actions
                                                Set TempDest = (Picked destructible)
                                                Unit - Order DSB_Destroyer to Harvest TempDest
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Current order of DSB_Destroyer) Equal to (Order(harvest))
                                                    Then - Actions
                                                        Destructible - Kill TempDest
                                                    Else - Actions
                                                Unit - Order DSB_Destroyer to Stop
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (DSB_Dummy[DSB_Current_Index] is dead) Equal to True
                                    Then - Actions
                                        Custom script:   call DestroyGroup(udg_DSB_UnDamage_Group[udg_DSB_Current_Index])
                                        Unit - Remove DSB_Dummy[DSB_Current_Index] from the game
                                        Set DSB_Dummy[DSB_Current_Index] = DSB_Dummy[DSB_Max_Index]
                                        Set DSB_Dummy[DSB_Max_Index] = No unit
                                        Set DSB_Caster[DSB_Current_Index] = DSB_Caster[DSB_Max_Index]
                                        Set DSB_Caster[DSB_Max_Index] = No unit
                                        Set DSB_Angle[DSB_Current_Index] = DSB_Angle[DSB_Max_Index]
                                        Set DSB_Angle[DSB_Max_Index] = 0.00
                                        Set DSB_Ability_Level[DSB_Current_Index] = DSB_Ability_Level[DSB_Max_Index]
                                        Set DSB_Ability_Level[DSB_Max_Index] = 0
                                        Set DSB_Stage[DSB_Current_Index] = DSB_Stage[DSB_Max_Index]
                                        Set DSB_Stage[DSB_Max_Index] = 0
                                        Set DSB_Current_Index = (DSB_Current_Index - 1)
                                        Set DSB_Max_Index = (DSB_Max_Index - 1)
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                DSB_Max_Index Equal to 0
                                            Then - Actions
                                                Trigger - Turn off (This trigger)
                                            Else - Actions
                                    Else - Actions
                                Custom script:   call RemoveLocation(udg_TempPoint)
                                Custom script:   call RemoveLocation(udg_TempPoint2)
                            Else - Actions
Dummy Removal
Trigger: DSB Dummy Removal
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set TempUnit = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of TempUnit) Equal to DSB_Dummy_Type2
            Then - Actions
                Unit - Remove TempUnit from the game
            Else - Actions

Screenshot
#1
#2
#3
#4

Feedbacks and Suggestions is appreciated

Changelogs
v1.1.1
Minor Changes

v1.1
Set unit variable after hide unit action - Fixed
Remove Location (TempPoint and TempPoint2) at Cast Trigger
Store Picked Unit to TempUnit
Store Picked Dest to TempDest
Remove Current Stage Checker
Remove Location before changing stage
The Turn Off ITE is now moved to de-indexing portion of the spell
De-Index ability level

v1.0
Released

Warcraft III models

Inferno Knight


By Tarrasque

a Fire version of:
http://blizzardmodding.info/5387/demon-knight/

Give credit if you use it.

Picked from the vault...

Inferno Knight


By Tarrasque

a Fire version of:
http://blizzardmodding.info/5387/demon-knight/

Give credit if you use it.

Warcraft III Skins

Picked from the vault...

Blizzard Modding Network News

Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena