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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  5. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  6. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. 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 Bite v1.0.2

Submitted by JC Helas
This bundle is marked as pending. It has not been reviewed by a staff member yet.

Frost Bite v1.0.2



Credits


Requires


Changelogs


Code

Code (vJASS):

native UnitAlive takes unit id returns boolean//Remove this if you already had one
//! zinc
    library FrostBite
    /*-----------------------------------------------------------------------------------/
    /-    v1.0.2
    /-       JC Helas
    /-
    /-   Description:
    /-       Release an ice trap that moves back and forth, after move
    /-       a nova ice will expload that cause them vacuumed to caster's
    /-       position.
    /-
    /-   How to Import:
    /-       1. Goto File>Preferences>General
    /-       2. Mark check the "Automatically create unknown varaibles while pasting data.
    /-       3. Copy the imported dummy.mdx and the custom locust object
    /-       4. Then copy the folder and paste on your map.
    /-
    /-    The spell does not require any libraries.
    /-
    /-----------------------------------------------------------------------------------*/

    {
        private
        {
            /*- Determine the ability ID of Frost Bite -*/
            constant integer SPELL_ID = 'A000'                                            ;
            /*- Determine the dummy id of that stands as frost trap -*/
            constant integer DUM_ID   = 'u000'                                            ;
            /*- Determine the base amount of frost trap -*/
            constant integer LINES    = 12                                                ;
            /*- Determine the additional line per level -*/
            constant integer LINES_LVL= 2                                                 ;
            /*- Determine the damage amount of back and forth -*/
            constant real DAMAGE      = 50.0                                              ;
            /*- Determine the additional amount of damage -*/
            constant real DAMAGE_LVL  = 5.0                                               ;
            /*- Determine the affect of area per line -*/
            constant real DAMAGE_AOE  = 75.0                                              ;
            /*- Determine the distance travel of each line -*/
            constant real DISTANCE    = 600.0                                             ;
            /*- Determine the speed of forth -*/
            constant real SPEED_FORTH = 20.0                                              ;
            /*- Determine the speed of back -*/
            constant real SPEED_BACK  = 35.0                                              ;
            /*- Determine the summoning distance to target caster position -*/
            constant real SUMMON_DIST = 50.0                                              ;
            /*- Determine the speed of vacuum -*/
            constant real VACUUM_SPEED= 25.0                                              ;
            /*- Determine the flying height of vacuumed unit -*/
            constant real VACUUM_Z    = 300.0                                             ;
            /*- Determine the attack type of Frost Bite -*/
            constant attacktype A_TYPE= ATTACK_TYPE_MAGIC                                 ;
            /*- Determine the damage type of Frost Bite -*/
            constant damagetype D_TYPE= DAMAGE_TYPE_NORMAL                                ;
            /*- Determine the owner of dummies -*/
            constant player DUM_OWNER = Player(PLAYER_NEUTRAL_PASSIVE)                    ;
            /*- Determine the model attachment to dummy -*/
            constant string ATTACH    = "origin"                                          ;
            /*- Determine the model of dummy -*/
            constant string MODEL     = "Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl";
            /*- Determine the nova fx -*/
            constant string TARGETFX  = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl";
           
           
            struct data
            {
                player owner;
                unit caster,dummy;
                real angle,rate,speed,dmg,dx,dy;
                effect fx;
                boolean b;
                group g;
            }
           
            struct vacuumdata
            {
                unit u;
                real d,r,z,bz,a;
            }
           
            constant real periodic=0.031250;
            constant group grp=CreateGroup();
            constant timer tmr=CreateTimer();
            integer ix=0;
            integer ic[];
            data link=0;
           
            constant timer vtmr=CreateTimer();
            integer vix=0;
            integer vic[];
           
            function onVacuumLoop()
            {
                integer i=1;
                real x,y;
                vacuumdata this;
                while(i<=vix)
                {
                    this=vic[i];
                    this.r=this.r+VACUUM_SPEED;
                    x=GetUnitX(this.u)+VACUUM_SPEED*Cos(this.a*bj_DEGTORAD);
                    y=GetUnitY(this.u)+VACUUM_SPEED*Sin(this.a*bj_DEGTORAD);
                    SetUnitX(this.u,x);
                    SetUnitY(this.u,y);
                    SetUnitFlyHeight(this.u,this.bz+(Sin(((180.0/this.d)*this.r)*bj_DEGTORAD)*this.z),0.0);
                    if(this.r>=this.d)
                    {
                        SetUnitPathing(this.u,true);
                        SetUnitFlyHeight(this.u,GetUnitDefaultFlyHeight(this.u),0);
                        this.u=null;
                        vacuumdata.destroy(this);
                        vic[i]=vic[vix];
                        vix-=1;
                        i-=1;
                        if(vix==0)PauseTimer(vtmr);
                    }
                    i+=1;
                }
            }
           
            function onVacuum(unit t,real x,real y)
            {
                real dx,dy,xt=GetUnitX(t),yt=GetUnitY(t);
                vacuumdata this=vacuumdata.create();
                vix+=1;vic[vix]=this;
                dx=x-xt;dy=y-yt;
                this.u=t;
                this.r=0.0;
                this.bz=GetUnitFlyHeight(t);
                this.d=SquareRoot(dx*dx+dy*dy)*0.75;
                this.z=(VACUUM_Z/(DISTANCE*0.75))*this.d;
                this.a=bj_RADTODEG*Atan2(y-yt,x-xt);
                UnitAddAbility(t,'Amrf');UnitRemoveAbility(t,'Amrf');
                SetUnitPathing(t,false);
                DestroyEffect(AddSpecialEffect(TARGETFX,xt,yt));
                if(vix==1)TimerStart(vtmr,periodic,true,function onVacuumLoop);
            }
           
            function onFilter(unit t,player p) -> boolean
            {
                return UnitAlive(t) &&
                !IsUnitType(t,UNIT_TYPE_MAGIC_IMMUNE) &&
                !IsUnitType(t,UNIT_TYPE_STRUCTURE) &&
                !IsUnitAlly(t,p);
            }
           
            function onLoop()
            {
                data this;
                integer i=1;
                real x,y;
                unit t;
                while(i<=ix)
                {
                    this=ic[i];
                    x=this.dx;
                    y=this.dy;
                    if(this.rate<100.0)
                    {
                        this.rate=this.rate+this.speed;
                        x=x+(Sin(((180.0/100)*this.rate)*bj_DEGTORAD)*DISTANCE)*Cos(this.angle*bj_DEGTORAD);
                        y=y+(Sin(((180.0/100)*this.rate)*bj_DEGTORAD)*DISTANCE)*Sin(this.angle*bj_DEGTORAD);
                        SetUnitX(this.dummy,x);
                        SetUnitY(this.dummy,y);
                        link=this;
                        GroupEnumUnitsInRange(grp,x,y,DAMAGE_AOE,Filter(function()
                        {
                            unit t=GetFilterUnit();
                            if(onFilter(t,link.owner) && !IsUnitInGroup(t,link.g))
                            {
                                UnitDamageTarget(link.caster,t,link.dmg,true,true,A_TYPE,D_TYPE,null);GroupAddUnit(link.g,t);
                                if(!link.b)
                                {
                                    onVacuum(t,link.dx,link.dy);
                                }
                            }
                            else
                            {
                            }
                        }));
                        GroupClear(grp);
                        if(this.rate>=50.0 && this.b)
                        {
                            this.b=false;
                            this.speed=(100.0/DISTANCE)*SPEED_BACK;
                            GroupClear(this.g);
                        }
                    }
                    else
                    {
                        GroupClear(this.g);
                        DestroyEffect(this.fx);
                        KillUnit(this.dummy);
                        this.caster=null;
                        this.dummy=null;
                        this.owner=null;
                        data.destroy(this);
                        ic[i]=ic[ix];
                        ix-=1;
                        i-=1;
                        if(ix==0)PauseTimer(tmr);
                    }
                    i+=1;
                }
            }
           
            function onCast() -> boolean
            {
                unit u;
                player p;
                real x1,y1,x2,y2,a,d;
                integer i,lvl;
                data this;
                if(GetSpellAbilityId()==SPELL_ID)
                {
                    u=GetTriggerUnit();
                    p=GetOwningPlayer(u);
                    lvl=GetUnitAbilityLevel(u,SPELL_ID);
                    i=LINES+(LINES_LVL*lvl);
                    d=DAMAGE+(DAMAGE_LVL*lvl);
                    x1=GetUnitX(u);
                    y1=GetUnitY(u);
                    a=360.0/i;
                    while(i>0)
                    {
                        x2=x1+SUMMON_DIST*Cos((a*i)*bj_DEGTORAD);
                        y2=y1+SUMMON_DIST*Sin((a*i)*bj_DEGTORAD);
                        this=data.create();
                        ix+=1;ic[ix]=this;
                        this.b=true;
                        this.dx=x2;
                        this.dy=y2;
                        this.dmg=d;
                        this.rate=0.0;
                        this.speed=(100.0/DISTANCE)*SPEED_FORTH;
                        this.angle=a*i;
                        this.caster=u;
                        this.owner=p;
                        this.dummy=CreateUnit(DUM_OWNER,DUM_ID,x2,y2,a*i);
                        this.fx=AddSpecialEffectTarget(MODEL,this.dummy,ATTACH);
                        if(this.g==null)this.g=CreateGroup();
                        if(ix==1)TimerStart(tmr,periodic,true,function onLoop);
                        i-=1;
                    }
                    u=null;
                }
                return false;
            }
           
            function onInit()
            {
                trigger t=CreateTrigger();
                integer i=0;
                while(i<=11)
                {
                    TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null);
                    i+=1;
                }
                TriggerAddCondition(t,Filter(function onCast));
                t=null;
            }
        }
    }
   
//! endzinc
 

Contents

Frost Bite v1.0.2 (Map)

  1. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,941
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    Just another Warcraft III map is an amazing title /sarcasm

    For some reason, vJass short variable always annoys me, and confuse me as well. I'm referring to vacuumdata struct.
    Anyway, nice spell
     
  2. vld99

    vld99

    Joined:
    Jul 10, 2015
    Messages:
    6
    Resources:
    0
    Resources:
    0
    Your spells are isane.Gj n keep up the great work !
     
  3. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    126
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Got daamn gentlemenss,, im very sorry i forgot the while of vacuum was while(i<vix) instead of while(i<=vix)

    Edit: Done

    Thanks maan, it is just I love watching chaotic spells XD

    Hahaha classic title XD, about those variables XD I purposely meant them beacuse vacuum is just an extention of this spell XD
    And thanks :D
     
    Last edited: Jan 10, 2020
  4. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    1,158
    Resources:
    2
    Spells:
    2
    Resources:
    2
    These look awesome, love the creativity.

    Edit: Also make some preview gifs that are better than the one you use for an Icon!
    @Mythic extended his gracious hand to recommend me Screentogif that is extremely useful, pair that with Ezgif.com and you can be scrupulous on the finer details.
     
    Last edited: Jan 10, 2020
  5. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    126
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Thanks maan :D stay tune for more.

    Actaully I dont have legal internet, I used to hack internet with 10mb capping. XD
     
    Last edited: Jan 12, 2020