1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Frost Orb v1.2

Submitted by xD.Schurke
This bundle is marked as approved. It works and satisfies the submission rules.
Another spell made by me with vJass

===================================================================
Frost Orb

Creates an orb which surrounds the target. Each unit hit by the orb will be damaged and frozen for 2 seconds. Each unit can only frozen for one time.
Level 1 - The orb deals 90 damage. Max. 10 units can be hit by the orb.
Level 2 - The orb deals 140 damage. Max. 18 units can be hit by the orb.
Level 3 - The orb deals 190 damage. Max. 26 units can be hit by the orb.
===================================================================

The Spell Requires:

JNGP

changes
==========================================
v1.0
- release
==========================================
v1.1
- Cleaned the script
- Removed unnecessary script lines
- Now there is a better overview
- Removed the interface-system by Hankey, Replaced it with the timer stacking method
- Added a Group Recycler (For more information check the GroupRecycler Trigger
- Changed + Removed some constants
- Reduced the range of the Orb-Missile to 85
- Removed DUMMY_DURATION constant
==========================================
v.1.2
- Fixed a bug with the missile pathing
==========================================

Script
Code (vJASS):
library GroupRecycler
//*********************************************************************
//* Group Recycler 1.0 by xD.Schurke
//* ------------------
//*  
//* To implement just create a custom text trigger and paste the script
//* there.
//*
//* This script requires vJass (JassNewGenPack)
//*  
//* Usage of the scriot:  
//*   - Recycle Groups
//*  
//* set group g = NewGroup()  : Get a group (alternative to CreateGroup)
//* call ReleaseGroup(g)      : Releases a group (alternative to  
//*                                                 DestroyGroup)
//*  
//*********************************************************************
    globals
        private constant integer MAX_GROUPS = 8191
   
        private group array rG
        private integer rN = 0
    endglobals
   
    function NewGroup takes nothing returns group
        if (rN == 0) then
            set rG[0] = CreateGroup()
        else
            set rN = rN - 1
        endif
     return rG[rN]
    endfunction

    function ReleaseGroup takes group g returns nothing
        if(g == null) then
            debug call BJDebugMsg("Warning: Try to release a null group")
            return
        endif
        if (rN == MAX_GROUPS) then
            debug call BJDebugMsg("Warning: Limit reached, Destroying Group")
            call DestroyGroup(g)
        else
            call GroupClear(g)
            set rG[rN] = g
            set rN = rN + 1
        endif    
    endfunction
endlibrary

Code (vJASS):
//*********************************************************************************************************************
//* Frost Orb v.1.2 by xD.Schurke
//* ------------------------------
//*
//* Requirements:
//* --------------
//* * vJass (JassNewGenPack)
//* * GroupRecycler
//*
//*
//*
//* Changes in version 1.1:
//* ----------
//* * Cleaned the script
//*   * Removed unnecessary script lines
//*   * Now there is a better overview
//*   * Removed the interface-system by Hankey, Replaced it with the timer stacking method
//*   * Added a Group Recycler (For more information check the GroupRecycler Trigger
//* * Changed + Removed some constants  
//*   * Reduced the range of the Orb-Missile to 85
//*   * Removed DUMMY_DURATION constant
//*
//* Changes in version 1.2:
//* ----------
//* * Fixed a bug with the missile pathing
//*
//*
//*
//* 1. Copy the GroupRecycler to your map
//* 2. Copy the Frost Orb Trigger to your map
//* 3. Copy the Spells and Buffs (Obejct Editor) to your map => You maybe need to change the raw codes in Frost Orb
//* 4. Change nessesery things in the Frost Orb constants
//*   4.1 Check Dummy Raw-Code (If needed copy dummy-unit (Object Editor) and dummy model (Import Manager) dummy.mdx)
//*   4.2 Check Spell Raw-Codes
//*
//*********************************************************************************************************************

library FrostOrb initializer frostInt requires GroupRecycler
globals
   
    private constant integer        DUMMY                       = 'h000' //the dummy raw-code => Change to your map specific one
    private constant integer        SPELL_RAW                   = 'A000' //the spell raw-code => Change to your map specific one
    private constant integer        DUMMY_SPELL                 = 'A001' //the dummy-spell raw-code => Change to your map specific one
    private constant integer        DUMMY_SPELL_DEBUFF          = 'B000' //the dummy-spell-debuff raw-code => Change to your map specific one
    private constant integer        TIMED_LIFE                  = 'BTLF' //the timed life buff raw code => DO NOT CHANGE
   
    private constant string         MISSILE_SFX                 = "Abilities\\Weapons\\ZigguratFrostMissile\\ZigguratFrostMissile.mdl" //the orb modell
   
    private constant real           MISSILE_DISTANCE            = 85. //the distance between target and orb
    private constant real           MISSILE_SPEED               = 12.  //the orb speed increase/decrease for change speed
    private constant real           MISSILE_DURATION            = 15.  //the duration of the orb in seconds
    private constant real           MISSILE_DURATION_INCREASE   = 6.   //how many seconds are added per level
    private constant real           MISSILE_MOTION_UPDATE       = 0.03 //for duration reason => DO NOT CHANGE
    private constant real           MISSILE_DAMAGE              = 90.  //the damage delt to the units hit by the orb
    private constant real           MISSILE_DAMAGE_INCREASE     = 50.  //the damage added per lvl
    private constant real           MISSILE_RADIUS              = 80.  //the radius where the orb deals damage to units
   
    private constant integer        MAX_HITS                    = 10   //how many units can be hit by the spell
    private constant integer        MAX_HITS_INCREASE           = 8    //units added to spell per lvl who can be hit
   
    //attatchement point
    private constant string         chest = "chest"
   
    //Group Reason stuff => DO NOT CHANGE
                     group          tmpG = CreateGroup()
                     player         tmpP
                     boolexpr       Cond
   
    private          timer          Tim = CreateTimer()
    private          integer array  Data
    private          integer        Total = 0
endglobals

//Constant functions for damage/duration/hit formular
private constant function Hits takes integer lvl returns integer
    return MAX_HITS+((lvl-1)*MAX_HITS_INCREASE)
endfunction

private constant function Damage takes integer lvl returns real
    return MISSILE_DAMAGE+((lvl-1)*MISSILE_DAMAGE_INCREASE)
endfunction

private constant function Duration takes integer lvl returns real
    return MISSILE_DURATION+((lvl-1)*MISSILE_DURATION_INCREASE)
endfunction

//group filter function
private function filter takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(),tmpP) and (GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0) and IsUnitType(GetFilterUnit(),UNIT_TYPE_GROUND) and (GetUnitTypeId(GetFilterUnit())!=DUMMY)
endfunction

//the struct for the orb
private struct FrostStruct
    unit    caster        //the caster who casts the spell
    unit    target        //the target of the Frost Orb
    unit    missile       //the Frost Orb
    effect  sfx           //Frost Orb Effect
    real    x        = 0. //x of target
    real    y        = 0. //y of target
    real    ang      = 0  //angle for orb movement
    real    dur      = 0  //duration counted
    integer hit      = 0  //how many units were hit by the orb
    group   g             //to prevent multiple damaging in one surrounding
   
    static method move takes nothing returns nothing
        local FrostStruct dat
        local integer i = 0
        local unit u
        local unit dummy
        local real x = 0.
        local real y = 0.
        loop
            exitwhen i >= Total
            set dat = Data[i]
            set dat.dur = dat.dur + MISSILE_MOTION_UPDATE
            set dat.x = GetUnitX(dat.target)
            set dat.y = GetUnitY(dat.target)
            set x = dat.x + MISSILE_DISTANCE * Cos(dat.ang * bj_DEGTORAD)
            set y = dat.y + MISSILE_DISTANCE * Sin(dat.ang * bj_DEGTORAD)
            set tmpP = GetOwningPlayer(dat.caster)
            call GroupEnumUnitsInRange(tmpG,x,y,MISSILE_RADIUS,Cond)
            loop
                set u = FirstOfGroup(tmpG)
                exitwhen u == null
                if IsUnitInGroup(u,dat.g) or GetUnitAbilityLevel(u,DUMMY_SPELL_DEBUFF) > 0 then
                    call GroupRemoveUnit(tmpG,u)
                else                    
                    call UnitDamageTarget(dat.caster,u,Damage(GetUnitAbilityLevel(dat.caster,SPELL_RAW)),false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
                    set dummy = CreateUnit(GetOwningPlayer(dat.caster),DUMMY,GetUnitX(u),GetUnitY(u),0)
                    call UnitAddAbility(dummy,DUMMY_SPELL)
                    call IssueTargetOrder(dummy,"thunderbolt",u)
                    call UnitApplyTimedLife(dummy,TIMED_LIFE,1.)
                    set dat.hit = dat.hit + 1
                    call GroupAddUnit(dat.g,u)
                    call GroupRemoveUnit(tmpG,u)
                endif                
            endloop
            call SetUnitPosition(dat.missile,x,y)
            set dat.ang = dat.ang + MISSILE_SPEED
            if dat.dur >= Duration(GetUnitAbilityLevel(dat.caster,SPELL_RAW)) or GetUnitState(dat.target,UNIT_STATE_LIFE) <= 0 or dat.hit >= Hits(GetUnitAbilityLevel(dat.caster,SPELL_RAW)) then
                set Total = Total - 1
                set Data[i] = Data[Total]
                set i = i - 1
                call FrostStruct.destroy(dat)
            endif
            set i = i + 1
        endloop
        set dummy = null
        set u = null
    endmethod
   
    static method create takes nothing returns FrostStruct
        local FrostStruct dat = FrostStruct.allocate()
        if Total == 0 then
            call TimerStart(Tim,MISSILE_MOTION_UPDATE,true,function FrostStruct.move)
        endif
        set Data[Total] = dat
        set Total = Total + 1
        return dat
    endmethod
   
    method onDestroy takes nothing returns nothing
        call KillUnit(.missile)
        call ReleaseGroup(.g)
        set .g = null
        set .caster = null
        set .missile = null
        set .target = null
        set .sfx = null  
    endmethod
endstruct

//Condition
private function frostCond takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_RAW
endfunction

//Actions creates struct and sets values
private function frostAction takes nothing returns nothing
    local FrostStruct F
    local real x
    local real y
    set F = FrostStruct.create()
    set F.g = NewGroup()
    set F.caster = GetTriggerUnit()
    set F.target = GetSpellTargetUnit()
    set F.x = GetUnitX(F.target)
    set F.y = GetUnitY(F.target)
    set x = F.x + MISSILE_DISTANCE * Cos(F.ang * bj_DEGTORAD)
    set y = F.y + MISSILE_DISTANCE * Sin(F.ang * bj_DEGTORAD)
    set F.missile = CreateUnit(GetOwningPlayer(F.target),DUMMY,F.x,F.y,0)
    set F.sfx = AddSpecialEffectTarget(MISSILE_SFX,F.missile,chest)
    call SetUnitPathing(F.missile,false)
    set F.ang = F.ang + MISSILE_SPEED
endfunction

//Event etc.
private function frostInt takes nothing returns nothing
    local trigger int = CreateTrigger()
    local integer index = 0
    local unit u
    loop
        call TriggerRegisterPlayerUnitEvent(int, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition(int,Condition(function frostCond))
    call TriggerAddAction(int,function frostAction)
    set int = null
    set Cond=Condition(function filter)
    //Preload
    set u = CreateUnit(Player(14),DUMMY,999999,999999,0)
    call UnitAddAbility(u,DUMMY_SPELL)
    call RemoveUnit(u)
    set u = null
    call Preload(MISSILE_SFX)
    call PreloadStart()
endfunction
endlibrary


Keywords:
vJASS,Frost,Orb,Jass,xD.Schurke,Spell
Contents

Frost Orb v1.0 (Map)

Reviews
Moderator
20:23, 3rd Dec 2008 Hanky: A really good spell, I like the idea very much. The scripting is good just very small improvements could be done there, also the spell is leakfree and MUI, so far I can see it. The visual effects are well done and the...
  1. 20:23, 3rd Dec 2008
    Hanky:
    A really good spell, I like the idea very much. The scripting is good just very small improvements could be done there, also the spell is leakfree and MUI, so far I can see it. The visual effects are well done and the documentation and tooltips are ok too.

    Well, you done again a good job. I just can highly recommend to use this spell if this is what you are searching for.
     
  2. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    Omg!
    I was expecting the Diablo one, and then you show me this!

    Its genial!
    (+rep)

    Oh, what is Hanky's Interface system?
     
  3. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    it's a system which is used by structs so that you don't need timer and timer attatch systems anymore :)
     
  4. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    Meh. I didnt understand a single thing of that, but that doesnt change the fact, that this spell is awesome.

    Remind me of that Wc3 magic, that did somewhat the same. Shield of Lightning.

    But its not nearly as cool.
     
  5. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    nice to hear that it's cool :p
     
  6. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
  7. kewlthis

    kewlthis

    Joined:
    Jun 5, 2008
    Messages:
    533
    Resources:
    0
    Resources:
    0
    Pretty cool spell
     
  8. Paladon

    Paladon

    Joined:
    Dec 6, 2007
    Messages:
    2,083
    Resources:
    42
    Icons:
    28
    Packs:
    2
    Spells:
    12
    Resources:
    42
    Oh yea, this looks nice. Cool spell.
     
  9. G_Rator

    G_Rator

    Joined:
    Nov 13, 2008
    Messages:
    38
    Resources:
    1
    Maps:
    1
    Resources:
    1
    yea, it's a cool spell. but i hope that this is not a bug: you can cast multiple orbs at a time and damage the units with ???? damage that kills them instantli. other than that i give 5/5 for the spell
     
  10. Dynasti

    Dynasti

    Joined:
    Oct 18, 2007
    Messages:
    877
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Nice cool spell, i would be glad if you used some timer system and paused the unit instead of using dummy abilities. For some reason i think that somethething is missing... but what?... 4/5 ^^
     
  11. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    it's to show that it's mui ;O
     
  12. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    597
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    wow i am late here... awesome job this is really great spell 5/5 rating now and +rep
     
  13. pippo

    pippo

    Joined:
    Mar 6, 2008
    Messages:
    476
    Resources:
    4
    Icons:
    1
    Skins:
    1
    Spells:
    2
    Resources:
    4
    ...
    if you try to cast the ability 5 or more times on your hero, and then you move the hero won't be free to walk!!!

    just i think that's a big bug 3/5
     
  14. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    oh i see, i fix it :p
     
  15. expazatrix

    expazatrix

    Joined:
    Apr 11, 2009
    Messages:
    242
    Resources:
    0
    Resources:
    0
    Your map won't load up.
    I click start game and it gos and then comes back to the map selection.
    It doesn't even show the loading screen.

    I don't know what it is but can you fix it? Thanks.
     
  16. aider

    aider

    Joined:
    Jul 14, 2010
    Messages:
    245
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I get a compile error with the GroupRecycler
    Does this sentence: "function NewGroup takes nothing returns group" need to be unique? There is another system I got (GroupUtils) that also has the "function NewGroup takes nothing returns group" sentence.
    If the problem is that they crash, what to do?
     
  17. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    Use one of both systems :O
     
  18. thenether

    thenether

    Joined:
    Sep 4, 2013
    Messages:
    1
    Resources:
    0
    Resources:
    0
    nice :3
     
  19. Necromancer

    Necromancer

    Joined:
    Aug 22, 2015
    Messages:
    40
    Resources:
    0
    Resources:
    0
    Your map won't test. Bring me on the menu of frozen throne then even if I proceed to the map menu itself. It's not loading.