1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Starcraft II Beta Key Spell Contest

Discussion in 'Triggers & Scripts' started by TriggerHappy, Apr 25, 2010.

  1. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    It seems like the rules limit the resources allowed by the level at which TriggerHappy finds them "complex", which I find pretty bias towards everybody being a cookie-cutter spell-maker that just makes fireballs that knock everybody backwards. Not to mention a real good spell-maker uses as many resources as he can effectively have at his/her disposal.

    I'm out of this competition though, the rules prohibit experienced editors from really using the extent of their knowledge which I find pretty limiting and stupid.
     
  2. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,271
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    Dude just remake whatever you need the system for within your spell. I finished mine in a few hours and I had to make 3 struct stacks to get it done, but it still works the way it was planned right?

    If you have to simplify your spell (like I did), then who cares? At least you'll have a submission.
     
  3. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    I don't care to compete in a competition leaned towards inexperienced users. It's okay.
     
  4. Piranha89

    Piranha89

    Joined:
    Aug 22, 2008
    Messages:
    128
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I wish to take part in this, using some "real Jass" coding.
    The less systems you may use, the better I'm off with my amount of experience and selfwritten stuff :wink:

    I'll give the betakey to a buddy since I do not want to play that sc2 beta thing.
     
  5. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Just because it's self-made doesn't mean it's allowed, though the rules aren't very specific as to what is included in "all-powerful" systems.
     
  6. Piranha89

    Piranha89

    Joined:
    Aug 22, 2008
    Messages:
    128
    Resources:
    1
    Maps:
    1
    Resources:
    1
    My script only uses some basic functionality that works with attaching data to a timer and using parallel arrays to read out. Seems like this is no problem.
     
  7. The_Witcher

    The_Witcher

    Joined:
    Dec 29, 2008
    Messages:
    229
    Resources:
    13
    Tools:
    1
    Spells:
    12
    Resources:
    13
    Well I am in :)

    good luck to all the other contestants
     
  8. sephiroth1234

    sephiroth1234

    Joined:
    Oct 11, 2009
    Messages:
    455
    Resources:
    0
    Resources:
    0
    And I'm also in! Just give me a few days to complete my spell.....

    And also wish me luck.....
     
  9. The Red Wizard

    The Red Wizard

    Joined:
    Oct 31, 2007
    Messages:
    35
    Resources:
    2
    Maps:
    2
    Resources:
    2
    NEAVER !! :b
    my spell is pure eyecandy atm
     
  10. UniEditXtreme

    UniEditXtreme

    Joined:
    Oct 28, 2008
    Messages:
    34
    Resources:
    0
    Resources:
    0
  11. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Good time to practise some JASS.
     
  12. ikillforeyou

    ikillforeyou

    Joined:
    Jun 10, 2008
    Messages:
    1,340
    Resources:
    33
    Models:
    22
    Icons:
    9
    Packs:
    1
    Tutorials:
    1
    Resources:
    33
    Does it have to be a hero ability, or a unit ability, and does it need to have 3 levels, or what?
     
  13. Eccho

    Eccho

    Joined:
    Nov 29, 2006
    Messages:
    2,297
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I will follow the general spells and scripts minicontest template for habits, I guess.
     
  14. Deaod

    Deaod

    Joined:
    Nov 18, 2007
    Messages:
    805
    Resources:
    12
    Maps:
    1
    Spells:
    11
    Resources:
    12
    So, heres a quick and dirty submission after around 3 hours of work.


    [​IMG]

    Singularity Attack

    Every time Ar'rath attacks, he shoots a singularity sucking every unit in a radius of 250
    into it. The units caught inside the singularity receive damage as they are torn apart.
    After a short time, the singularity disappears.

    Level 1 - Deals up to 100 damage per second. The singularity
    lasts 0.2 seconds.
    Level 2 - Deals up to 200 damage per second. The singularity
    lasts 0.3 seconds.
    Level 3 - Deals up to 300 damage per second. The singularity
    lasts 0.4 seconds.


    Code (vJASS):
    library SingularityAttack initializer Init requires OrbStacking, GroupUtils, optional GetProc
       
        globals
            private constant    integer                 AID                         = 'A002' // Base if off of something like Hardened Skin
           
            private constant    integer                 ORB_PRIORITY                = 0 // determines when to execute this orb, lower means later
            private constant    integer                 ORB_TYPE                    = ABILITY_TYPE_SKILL // if you want this ability to be an item ability, change to ABILITY_TYPE_ITEM
           
            private             real            array   PROC_CHANCE                 // 0..1 // Chance this effect gets activated.
            private constant    real                    PROC_WEIGHT                 = 0.5 // refer to GetProc's documentation for a description on what this does. Only has an effect if GetProc exists
            private             real            array   AOE                         //
            private             real            array   DURATION                    // in seconds
            private             real            array   MIN_PULL                    // speed per second at AOE[level] distance
            private             real            array   MAX_PULL                    // speed per second at 0 distance
            private             real            array   MIN_DAMAGE                  // per second
            private             real            array   MAX_DAMAGE                  // per second
           
            private constant    real                    MIN_DISTANCE                = 0
           
            private constant    string                  TARGET_FX                   = "" // always get destroyed instantly (ie. only plays the death animation)
            private constant    string                  TARGET_FX_ATTPT             = ""
           
            private constant    string                  PULL_FX                     = "" // lasts for however long the unit is pulled towards the unit targeted by the orb
            private constant    string                  PULL_FX_ATTPT               = ""
           
            private constant    attacktype              ATTACK_TYPE                 = ATTACK_TYPE_MAGIC
            private constant    damagetype              DAMAGE_TYPE                 = DAMAGE_TYPE_MAGIC
           
            private constant    real                    TICK                        = 1./40
        endglobals
       
        private function Proc_Chance takes integer level returns real
            return PROC_CHANCE[level]
        endfunction
       
        private function Aoe takes integer level returns real
            return AOE[level]
        endfunction
       
        private function Duration takes integer level returns real
            return DURATION[level]
        endfunction
       
        private function Min_Pull takes integer level returns real
            return MIN_PULL[level]
        endfunction
       
        private function Max_Pull takes integer level returns real
            return MAX_PULL[level]
        endfunction
       
        private function Min_Damage takes integer level returns real
            return MIN_DAMAGE[level]
        endfunction
       
        private function Max_Damage takes integer level returns real
            return MAX_DAMAGE[level]
        endfunction
       
        private function SetUpArrays takes nothing returns nothing
            set PROC_CHANCE[1]=1.
            set PROC_CHANCE[2]=1.
            set PROC_CHANCE[3]=1.
           
            set AOE[1]=250
            set AOE[2]=250
            set AOE[3]=250
           
            set DURATION[1]=0.2
            set DURATION[2]=0.3
            set DURATION[3]=0.4
           
            set MIN_PULL[1]=100
            set MIN_PULL[2]=150
            set MIN_PULL[3]=200
           
            set MAX_PULL[1]=600
            set MAX_PULL[2]=700
            set MAX_PULL[3]=800
           
            set MIN_DAMAGE[1]=10
            set MIN_DAMAGE[2]=20
            set MIN_DAMAGE[3]=30
           
            set MAX_DAMAGE[1]=100
            set MAX_DAMAGE[2]=200
            set MAX_DAMAGE[3]=300
        endfunction
       
        private function ValidateTarget takes unit u, unit caster returns boolean
            return not IsUnitType(u, UNIT_TYPE_DEAD) /*
            */
    and not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) /*
            */
    and not IsUnitType(u, UNIT_TYPE_STRUCTURE) /*
            */
    and IsUnitEnemy(u, GetOwningPlayer(caster)) /*
            */
    and GetUnitMoveSpeed(u)>0 /*
            */

        endfunction
       
        //
       
        globals
            constant key PROC_CHANCE_KEY
        endglobals
       
        private struct Data
            unit target // the unit being pulled to the caster
            unit caster // the unit the target is being pulled to
            unit attacker // the unit that launched the attack that spawned this instance
            integer level // level of AID on attacker
            effect pullfx
           
            real elapsed=0
           
            private integer i
           
            private static thistype array Structs
            private static timer T=CreateTimer()
            private static integer Count=0
           
            private method onDestroy takes nothing returns nothing
                set target=null
                set caster=null
                set attacker=null
                call DestroyEffect(pullfx)
                set pullfx=null
               
                set Count=Count-1
                set Structs[i]=Structs[Count]
                set Structs[i].i=i
                if Count==0 then
                    call PauseTimer(T)
                endif
            endmethod
           
            private static method Callback takes nothing returns nothing
            local integer i=Count-1
            local thistype s
           
            local real x
            local real y
            local real dx
            local real dy
            local real d
            local real ratio
            local real pull
                loop
                    exitwhen i<0
                    set s=.Structs[i]
                   
                    if IsUnitType(s.target, UNIT_TYPE_DEAD) or IsUnitType(s.caster, UNIT_TYPE_DEAD) then
                        call s.destroy()
                    else
                        set x=GetUnitX(s.target)
                        set y=GetUnitY(s.target)
                        set dx=GetUnitX(s.caster)-x
                        set dy=GetUnitY(s.caster)-y
                        set d=SquareRoot(dx*dx+dy*dy)
                        set ratio=d/Aoe(s.level)
                        set pull=TICK*(Min_Pull(s.level)+ratio*(Max_Pull(s.level)-Min_Pull(s.level)))
                        call UnitDamageTarget(s.attacker, s.target, TICK*(Min_Damage(s.level)+ratio*(Max_Damage(s.level)-Min_Damage(s.level))), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                        if d>MIN_DISTANCE  and d>=pull then
                            call SetUnitX(s.target, x+(dx/d)*pull)
                            call SetUnitY(s.target, y+(dy/d)*pull)
                        endif
                       
                        set s.elapsed=s.elapsed+TICK
                        if s.elapsed>=Duration(s.level) then
                            call s.destroy()
                        endif
                    endif
                   
                    set i=i-1
                endloop
            endmethod
           
            static method create takes unit target, unit caster, unit attacker returns thistype
            local thistype s=allocate()
                set s.target=target
                set s.caster=caster
                set s.attacker=attacker
                set s.level=GetUnitAbilityLevel(attacker, AID)
                set s.pullfx=AddSpecialEffectTarget(PULL_FX, target, PULL_FX_ATTPT)
               
                set Structs[Count]=s
                set s.i=Count
                if Count==0 then
                    call TimerStart(T, TICK, true, function thistype.Callback)
                endif
                set Count=Count+1
                return s
            endmethod
        endstruct
       
        globals
            private unit tmpt=null
            private unit tmpc=null
        endglobals
       
        private function OnAttackCallback takes nothing returns boolean
        local unit u=GetFilterUnit()
            if u!=tmpt and ValidateTarget(u, tmpc) then
                call Data.create(u, tmpt, tmpc)
            endif
            set u=null
            return false
        endfunction
       
        private function Actions takes nothing returns boolean
        local unit t=GetDamagedUnit()
        local unit c=GetDamagingUnit()
        local integer level=GetUnitAbilityLevel(c, AID)
            set tmpt=t
            set tmpc=c
            call DestroyEffect(AddSpecialEffectTarget(TARGET_FX, t, TARGET_FX_ATTPT))
            static if LIBRARY_GetProc then
                if GetProc(PROC_CHANCE_KEY, c, Proc_Chance(level)) then
                    call GroupEnumUnitsInArea(ENUM_GROUP, GetUnitX(t), GetUnitY(t), Aoe(level), Condition(function OnAttackCallback))
                    set t=null
                    set c=null
                    return ORB_APPLIED
                endif
            else
                if GetRandomReal(0., 1.)<=Proc_Chance(level) then
                    call GroupEnumUnitsInArea(ENUM_GROUP, GetUnitX(t), GetUnitY(t), Aoe(level), Condition(function OnAttackCallback))
                    set t=null
                    set c=null
                    return ORB_APPLIED
                endif
            endif
            set t=null
            set c=null
            return ORB_NOT_APPLIED
        endfunction
       
        private function Init takes nothing returns nothing
        local Orb o=Orb.create(AID, ORB_TYPE, ORB_PRIORITY, Actions)
           
            static if LIBRARY_GetProc then
                call SetProcWeight(PROC_CHANCE_KEY, PROC_WEIGHT)
            endif
           
            call SetUpArrays()
        endfunction
       
    endlibrary


    Credits are inside the map. If you want Links, tell me.
    All artistic resources have been modified by myself to some extent (the Tosc had its animation names changed to always play the shooting animation when attacking, the CurseBold model has been recolored and the icon has also been recolored and rotated).
    I claim no ownership of any kind for these resources.

    Changelog
    Version 1.0.1
    - added a weight option (only works when you have GetProc imported).
    - made PROC_CHANCE work without having GetProc imported.
    - fixed behaviour when units are at minimum distance.


    In case this update is invalid, ignore it, and use Version 1.0.0 instead.
     

    Attached Files:

    Last edited: May 1, 2010
  15. Piranha89

    Piranha89

    Joined:
    Aug 22, 2008
    Messages:
    128
    Resources:
    1
    Maps:
    1
    Resources:
    1
    It is not finished yet, but that's how it looks like for now. You cannot see some of its functionalitys, it is a just a small demo.
    watch?v=13NL8bjMTJw
     
    Last edited: Apr 28, 2010
  16. Eccho

    Eccho

    Joined:
    Nov 29, 2006
    Messages:
    2,297
    Resources:
    2
    Spells:
    2
    Resources:
    2
    @ Daeod, I just happend to notice so far that you have a spell on about 200 lines, and imported libraries of about 2000 :O. Might mean nothing or much, hrrrrh. Im not the judge and Im sure you know what and what not is allowed:p

    @ Piranha89 I would say the concept is still rather imbalanced. Keep in mind that Mothership had some kind of void ability too which teleported away hostile units from the map for a short period (in case of unorginality, just saying=)?)
     
    Last edited: Apr 27, 2010
  17. Piranha89

    Piranha89

    Joined:
    Aug 22, 2008
    Messages:
    128
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Not if the allied units are the only ones wearing transmitters. Somehow, if they move during teleportation, they take a lot of damage. Opposing forces will experience a similar problem when my spell is finished. It's just 80% finished and got 400 lines already, the custom system behind uses about 170 lines :wink:

    //Edit: Updated.
     
    Last edited: Apr 28, 2010
  18. Preskooldude

    Preskooldude

    Joined:
    Jul 23, 2005
    Messages:
    329
    Resources:
    0
    Resources:
    0
    ALL Right!
    Finally fixed the bugs on my old IntraNET, and added more eyecandy. Just as a recap:
    IntraNET
    Here is mine:
    IntraNET(Intra-Nodal Engineering Technology),
    a unit spell.
    Based off of the Vulture's Spidermines, this new ability deploys IntraNET Nodes. The nodes join together in a web-like fashion. When a new node is deployed, the rest of the web slowly changes function into the new node's function.
    The three functions are thus:
    Attack: Allows the tower to throw projectiles dealing 16 damage each.
    Healing: Allows the tower to heal friendly units, healing 5 damage each.
    Explode: Detonates the web, dealing 150 damage per explosion (100 damage at the fringes)
    Code (vJASS):
    function SummonIntraNETACond takes nothing returns boolean
        return GetSpellAbilityId() == 'A100'
    endfunction

    function SummonIntraNETHCond takes nothing returns boolean
        return GetSpellAbilityId() == 'A101'
    endfunction

    function SummonIntraNETECond takes nothing returns boolean
        return GetSpellAbilityId() == 'A102'
    endfunction

    function FindIntraNETCond takes nothing returns boolean
        local unit u = GetFilterUnit()
        local player p = GetOwningPlayer(u)
        local player p2 = GetOwningPlayer(bj_lastCreatedUnit)
        local boolean b = (GetUnitTypeId(u) == 'h100' or GetUnitTypeId(u) == 'h101' or GetUnitTypeId(u) == 'h102') and  p == p2 and GetUnitState(u, UNIT_STATE_LIFE) > 1
        set u = null
        set p = null
        set p2 = null
        return b
    endfunction

    function SightTowerCond takes nothing returns boolean
        local unit u = GetFilterUnit()
        local player p = GetOwningPlayer(u)
        local player p2 = GetOwningPlayer(bj_lastCreatedUnit)
        local boolean b = (GetUnitTypeId(u) == 'h101' or GetUnitTypeId(u) == 'h102') and  p == p2 and GetUnitState(u, UNIT_STATE_LIFE) > 1
        set u = null
        set p = null
        set p2 = null
        return b
    endfunction

    function HealTowerCond takes nothing returns boolean
        local unit u = GetFilterUnit()
        local player p = GetOwningPlayer(u)
        local player p2 = GetOwningPlayer(bj_lastCreatedUnit)
        local boolean b = (GetUnitTypeId(u) == 'h100' or GetUnitTypeId(u) == 'h102') and  p == p2 and GetUnitState(u, UNIT_STATE_LIFE) > 1
        set u = null
        set p = null
        set p2 = null
        return b
    endfunction

    function ExplodeTowerCond takes nothing returns boolean
        local unit u = GetFilterUnit()
        local player p = GetOwningPlayer(u)
        local player p2 = GetOwningPlayer(bj_lastCreatedUnit)
        local boolean b = (GetUnitTypeId(u) == 'h100' or GetUnitTypeId(u) == 'h101') and  p == p2 and GetUnitState(u, UNIT_STATE_LIFE) > 1
        set u = null
        set p = null
        set p2 = null
        return b
    endfunction

    function DestroyLightnings takes unit u returns nothing
        local integer index = LoadInteger(udg_ht, GetHandleId(u), 0)
        local lightning LFX
       
        loop
            exitwhen index < 1
            set LFX = LoadLightningHandle( udg_ht, GetHandleId(u), index)
            call DestroyLightning(LFX)
            set index = index - 1
        endloop
        set LFX = null
    endfunction

    function CreateLightnings takes unit u, string LFXType returns integer
        local boolexpr bx = Condition( function FindIntraNETCond )
        local group g = CreateGroup()
        local location l = GetUnitLoc(u)
        local location l2
        local lightning LFX
        local integer index = 1
        local unit u2

        set bj_lastCreatedUnit = u
        call GroupEnumUnitsInRangeOfLoc(g, l, 200, bx)
        call GroupRemoveUnit(g, u)
        loop
            set u2 = FirstOfGroup(g)
            exitwhen u2 == null
            set l2 = GetUnitLoc(u2)
            //Figure out what kind of lightning to add.
            set LFX = AddLightningEx(LFXType, true, GetLocationX(l), GetLocationY(l), GetLocationZ(l)+10, GetLocationX(l2), GetLocationY(l2), GetLocationZ(l2)+10)
            //Add it so that when it changes or dies, the lightning can be removed.
            call SaveLightningHandle(udg_ht, GetHandleId(u), index, LFX)
           
            call GroupRemoveUnit(g, u2)
            set index = index + 1
        endloop

        //Cleanup
        call DestroyBoolExpr(bx)
        set bx = null
        call DestroyGroup(g)
        set g = null
        set l = null
        set l2 = null
        set LFX = null
        set u2 = null
        return index
    endfunction

    function Death takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local group g = CreateGroup()
        local location l
        local boolexpr bx = Condition( function FindIntraNETCond )
        local timer ttimer
        local trigger t = GetTriggeringTrigger()

        //Clean up lightnings
        call DestroyLightnings(u)
        call GroupEnumUnitsInRangeOfLoc( g, l, 200, bx )
        loop
            set u = FirstOfGroup(g)
            exitwhen u == null
            call DestroyLightnings(u)
            //Determine what kind of LFX Type / Boolexpr to use.
            if GetUnitTypeId(u) == 'h100' then
                call CreateLightnings(u, "AFOD")
            elseif GetUnitTypeId(u) == 'h101' then
                call CreateLightnings(u, "DRAM")
            elseif GetUnitTypeId(u) == 'h102' then
                call CreateLightnings(u, "CLPB")
            endif
        endloop

        //Cleanup
        set ttimer = null
        set bx = null
        call DestroyGroup(g)
        set g = null
        set l = null
        call DestroyTrigger(t)
    endfunction

    function Change takes nothing returns nothing
        local timer etimer = GetExpiredTimer()
        local timer ttimer
        local unit u = LoadUnitHandle(udg_ht, GetHandleId(etimer), 0)
        local unit u2
        local string LFXType
        local integer index
        local boolexpr bx
        local group g = CreateGroup()
        local location l
        local player p
        local trigger t
       
        //Determine what kind of LFX Type / Boolexpr to use.
        if GetUnitTypeId(u) == 'h100' then
            set LFXType = "AFOD"
            set bx = Condition( function SightTowerCond )
        elseif GetUnitTypeId(u) == 'h101' then
            set LFXType = "DRAM"
            set bx = Condition( function HealTowerCond )
        elseif GetUnitTypeId(u) == 'h102' then
            set LFXType = "CLPB"
            set bx = Condition( function ExplodeTowerCond )
        endif
       
        call DestroyLightnings(u)

        set l = GetUnitLoc(u)
        call GroupEnumUnitsInRangeOfLoc(g, l, 200, bx)
        loop
            set u2 = FirstOfGroup(g)
            exitwhen u2 == null
            //Clean up the current tower
            set t = LoadTriggerHandle(udg_ht, GetHandleId(u2), 1000)
            call DestroyTrigger(t)
           
            set p = GetOwningPlayer(u2)
            set l = GetUnitLoc(u2)
            //Clean up lightnings
            call DestroyLightnings( u2 )
            call GroupRemoveUnit(g, u2)
            call RemoveUnit(u2)
            set u2 = CreateUnit(p, GetUnitTypeId(u), GetLocationX(l), GetLocationY(l), 0)
           
            //Recreate the death trigger
            set t = CreateTrigger()
            call TriggerAddAction( t, function Death )
            call TriggerRegisterUnitEvent( t, u2, EVENT_UNIT_DEATH )
            call SaveTriggerHandle( udg_ht, GetHandleId(u2), 1000, t )
           
            //Finally, allow a new change to occur.
            set ttimer = CreateTimer()
            call SaveUnitHandle(udg_ht, GetHandleId(ttimer), 0, u2)
            call TimerStart( ttimer, 0.5, false, function Change )
       
        endloop
       
        //Create new units/lightning
        set index = CreateLightnings( u, LFXType )
       
        //Update the new tower's index
        call SaveInteger(udg_ht, GetHandleId(u), 0, index)
        call IssuePointOrderLoc( u, "selfdestruct",  l)        //Causes it to blow up if its an exploding tower.
        call AttachSoundToUnit(gg_snd_StasisTotem, u)          //EarCandy
        call StartSound(gg_snd_StasisTotem)                    //EarCandy
       
        //Cleanup
        call DestroyBoolExpr(bx)
        set u = null
        set u2 = null
        call DestroyGroup(g)
        set g = null
        set p = null
        set l = null
        set bx = null
        set ttimer = null
        set etimer = null
        set t = null
    endfunction

    //Initializes the ward
    function SummonIntraNET takes nothing returns nothing
        //Local vars
        local location l = GetSpellTargetLoc()
        local unit u = GetTriggerUnit()
        local player p = GetOwningPlayer(u)
        local string LFXType
        local trigger t = CreateTrigger()
        local timer ttimer
       
        //Figure out where we're supposed to place the node.
        //Figure out what kind of unit to build
        if GetSpellAbilityId() == 'A100' then
            set LFXType = "AFOD"
            set u = CreateUnitAtLoc( p, 'h100', l, 0 )
        elseif GetSpellAbilityId() == 'A101' then
            set LFXType = "DRAM"
            set u = CreateUnitAtLoc( p, 'h101', l, 0 )
        elseif GetSpellAbilityId() == 'A102' then
            set LFXType = "CLPB"
            set u = CreateUnitAtLoc( p, 'h102', l, 0 )
        endif
       
        //Make a trigger catching the unit's death
        call TriggerAddAction( t, function Death )
        call TriggerRegisterUnitEvent( t, u, EVENT_UNIT_DEATH )
        call SaveTriggerHandle( udg_ht, GetHandleId(u), 1000, t )

        //Ripple up a change
        set ttimer = CreateTimer()
        call SaveUnitHandle(udg_ht, GetHandleId(ttimer), 0, u)
        call TimerStart( ttimer, 0.5, false, function Change )
        //EarCandy
        call AttachSoundToUnit(gg_snd_BuildingPlacement, u)
        call StartSound(gg_snd_BuildingPlacement)
       
        //Cleanup
        set u = null
        set p = null
        set l = null
        set ttimer = null
        set t = null
    endfunction

    //===========================================================================
    function InitTrig_IntraNET takes nothing returns nothing
        local integer index
        local trigger IntraNETHeal = CreateTrigger()
        local trigger IntraNETExplode = CreateTrigger()
        local conditionfunc Cond
        local triggeraction Act
        set gg_trg_IntraNET = CreateTrigger()
        set Act = TriggerAddAction( gg_trg_IntraNET, function SummonIntraNET )
        set Act = TriggerAddAction( IntraNETHeal, function SummonIntraNET )
        set Act = TriggerAddAction( IntraNETExplode, function SummonIntraNET )
        set Cond = Condition(function SummonIntraNETACond)
        call TriggerAddCondition( gg_trg_IntraNET, Cond )
        set Cond = Condition(function SummonIntraNETHCond)
        call TriggerAddCondition( IntraNETHeal, Cond )
        set Cond = Condition(function SummonIntraNETECond)
        call TriggerAddCondition( IntraNETExplode, Cond )

        //Let any unit do this.
        set index = 0
        set udg_ht = InitHashtable()
        loop
            call TriggerRegisterPlayerUnitEvent(gg_trg_IntraNET, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
            call TriggerRegisterPlayerUnitEvent(IntraNETHeal, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
            call TriggerRegisterPlayerUnitEvent(IntraNETExplode, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)

            set index = index + 1
            exitwhen index == bj_MAX_PLAYER_SLOTS
        endloop
        set Act = null
        set Cond = null
    endfunction

     


    EDIT: Final update. I swear. New version's on this post. It's easier to test.
     

    Attached Files:

    Last edited: Apr 28, 2010
  19. gaby-boy

    gaby-boy

    Joined:
    Jun 14, 2009
    Messages:
    114
    Resources:
    5
    Spells:
    4
    Tutorials:
    1
    Resources:
    5
    There my spell,

    Zerg Corruption :

    Pick Every Unit In a Circle and deal damage.
    If the unit dies in the Circle, un zergling is spawned.

    Level 1 : AoE = 500 / dmg = 18 / Repeat Time = 0.90 / Time = 8 sec
    Level 2 : AoE = 600 / dmg = 26 / Repeat Time = 0.80 / Time = 11 sec
    Level 3 : AoE = 700 / dmg = 34 / Repeat Time = 0.70 / Time = 14 sec

    Thanks to shamanyouranus for the locus effects

    ~Gaby-Boy:grin:
     

    Attached Files:

  20. Equal

    Equal

    Joined:
    Mar 23, 2007
    Messages:
    306
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Nexus Orbs

    The Nexus Orbs
    by Equal

    [​IMG]

    Story:
    Because of the alliance with the Protoss the Human are able to call for their
    help. They send them some protective orbs from the Nexus. Those orbs are
    using their own material to help as good as they can by lasering down the
    enemies who dare to attack. When there is no other option left, they can be
    used to detonate themselfs.

    Description:
    Calls the Nexus Orbs from the Protoss for help. They stay ready to be
    detonated at target location while they protect the unit with a matter-lazer.
    This consumes their own Hp. Those Orbs automaticaly follow the unit on
    every step it makes.

    Details:
    Orbs have 100Hp, 600 range, and can deal 1 damage for 1 Hp cost.
    Level depending up to 4 orbs.
    Orbs Detonate when they reach their target area or after 7.5 seconds
    fly-time.
    While Flying they will not attack, they have no time to waste ;).

    Full Credits go to:
    - unwirklich for using his interface/icons/textures map as a demonsration map.
    - Talon the Mage for his Marine model and its attatchment.
    - General Frank for his orb model.
    - WILL THE ALMIGHTY for is explosion
    - bloodyroadkill for his supernova icon.
    - Anachron for his holy energy icon.
    - sounds done by me.


    Done in New Jass Gen or how its called on wc3c.

    Edit:Thx to Preskooldude for some Bugs.

    I hope you like, greets Equal
     

    Attached Files:

    Last edited: Apr 28, 2010