Results 1 to 9 of 9
http://idgs.in/246084
  1. #1

    Join Date
    May 2009
    Location
    Indonesia
    Posts
    193
    Points
    317.90
    Thanks: 23 / 4 / 4

    Default [Help] Mass Teleport Ability

    Code:
    THE TRIGGERS
    
    Mass Teleport
        Events
            Unit - A unit Begins casting an ability
        Conditions
            (Ability being cast) Equal to Mass Teleport 
        Actions
            -------- Settings Variable --------
            Set MassTeleport_Caster = (Casting unit)
            Set MassTeleport_Target = (Target point of ability being cast)
            Set MassTeleport_Group = (Units within 750.00 of (Position of MassTeleport_Caster) matching (((Matching unit) belongs to an ally of (Owner of MassTeleport_Caster)) Equal to True))
            -------- Triggers / Teleport Effect --------
            Special Effect - Create a special effect at MassTeleport_Target using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
            Set MassTeleport_Effect = (Last created special effect)
            -------- Fading --------
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Unit - Move (Picked unit) instantly to MassTeleport_Target
                    Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
    nah ada yang bisa fix ga ?

    di bagian unit group d jadiin gini :

    setiap 0.10s units yang masuk unit group itu menghilang perlahan2, trus begitu opacitynya 100% invinsible, langsung di teleport ke target.

  2. Hot Ad
  3. #2
    valkemiere's Avatar
    Join Date
    Oct 2006
    Location
    In my Rainbow Castle
    Posts
    1,874
    Points
    5,111.21
    Thanks: 65 / 32 / 31

    Default

    aq rasa skill default mass teleport uda bgitu. casting timeny aj d tmbhin.
    turn on trigger yg ilangin opacity perlahan" tiap brp detik. klo gagal balik normal, klo sukses tele

  4. #3

    Join Date
    May 2009
    Location
    Indonesia
    Posts
    193
    Points
    317.90
    Thanks: 23 / 4 / 4

    Default

    bukan ini beda, jadi nanti target point.

    klo mass teleport biasa kan bs nya walau d target ke ground nanti ke unit sekitarnya, klo yang ini beda, unit di sekitarnya nanti d tele ke target point ^O^

  5. #4
    ranzi's Avatar
    Join Date
    Apr 2007
    Location
    Japanz (Juakarta Puanaazz)
    Posts
    625
    Points
    821.01
    Thanks: 2 / 8 / 6

    Default

    Quote Originally Posted by GulaHula View Post
    bukan ini beda, jadi nanti target point.

    klo mass teleport biasa kan bs nya walau d target ke ground nanti ke unit sekitarnya, klo yang ini beda, unit di sekitarnya nanti d tele ke target point ^O^
    oh gampang..pake timer aj, tar cek de per/s, tiap sec tambahin opactity, tar klo dah mentok, teleport (di move unit) dah.

  6. #5

    Join Date
    May 2009
    Location
    Indonesia
    Posts
    193
    Points
    317.90
    Thanks: 23 / 4 / 4

    Default

    Request.

    Spell Name : Mass Teleport
    Target : Target Point

    THE TRIGGERS :
    Code:
    Mass Teleport
        Events
            Unit - A unit Begins casting an ability
        Conditions
            (Ability being cast) Equal to Mass Teleport
        Actions
            -------- Settings Variable --------
            Set MassTeleport_Caster = (Casting unit)
            Set MassTeleport_Target = (Target point of ability being cast)
            Set MassTeleport_Group = (Units within 750.00 of (Position of MassTeleport_Caster) matching ((((Matching unit) belongs to an ally of (Owner of MassTeleport_Caster)) Equal to True) and (((Owner of (Matching unit)) Not equal to Neutral Passive) and ((Owner of (Matching unit)) Not equal
            -------- Triggers / Teleport Effect --------
            Special Effect - Create a special effect at MassTeleport_Target using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
            Set MassTeleport_Effect = (Last created special effect)
            -------- Fading --------
            Set MassTeleport_FadeTime = (0.10 x (Real((Level of Mass Teleport  for MassTeleport_Caster))))
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 10.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 20.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 30.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 40.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 70.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 80.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 90.00% transparency
            Wait MassTeleport_FadeTime seconds
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
            Wait MassTeleport_FadeTime seconds
            -------- Move --------
            Unit Group - Pick every unit in MassTeleport_Group and do (Actions)
                Loop - Actions
                    Unit - Move (Picked unit) instantly to MassTeleport_Target
                    Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                    Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                    Special Effect - Destroy MassTeleport_Effect
    LIST OF VARIABLE

    MassTeleport_Caster : Unit
    MassTeleport_Effect : Special Effect
    MassTeleport_FadeTime : Real
    MassTeleport_Group : Unit Group
    MassTeleport_Target : Point

    OTHER

    Ability ID : A01l
    (Kalau wat kk di buat bebas aja nanti aku bisa ganti sendiri)

    bisa di convert ke JASS ga ? tulung pls >.<

  7. #6

    Join Date
    May 2009
    Location
    Indonesia
    Posts
    193
    Points
    317.90
    Thanks: 23 / 4 / 4

    Default

    need helpppp

  8. #7
    valkemiere's Avatar
    Join Date
    Oct 2006
    Location
    In my Rainbow Castle
    Posts
    1,874
    Points
    5,111.21
    Thanks: 65 / 32 / 31

    Default

    hmm.. pake integer aja vertex coloringny tiap brp detik gitu.

  9. #8
    Section's Avatar
    Join Date
    Nov 2006
    Location
    about.me/SECTION
    Posts
    2,095
    Points
    11,041.04
    Thanks: 45 / 112 / 98

    Default

    Okay... Use this header... The Fade Effect works well and instanced.

    Code:
    //ALL HEADERS HERE IS ORIGINALLY WRITTEN BY D'SecTioN
    
    function ApplyHeroRespawn takes location respos, unit hero, real duration returns nothing
        local leaderboard array l
        set l[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] = CreateLeaderboard()
        set l[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] = CreateLeaderboardBJ( GetForceOfPlayer(GetOwningPlayer(hero)), ( GetHeroProperName(hero)+": " + I2S(R2I(duration)) + " s"))
        call LeaderboardDisplay(l[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))],true)
    loop
        exitwhen (duration<1)
            call TriggerSleepAction(1.00)
            set duration = duration-1
            call LeaderboardSetLabelBJ(l[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], GetHeroProperName(hero) + ": " + I2S(R2I(duration)) + "s")
    endloop
            call ReviveHeroLoc( hero, respos, true )
            call DestroyLeaderboard(l[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])
        
    
    endfunction
    
    function ApplyFadeEffect takes real start, real end, real smooth, unit wUnit, real duration , real r, real g, real b returns nothing
        local real ct = 0    
        local real step = ((end-start)/duration) / smooth
        local real target = end-start
        //using 0.2sec step
        //call SetUnitVertexColorBJ(wUnit,r,g,b,start)
        call BJDebugMsg("STEP! " + R2S(step))
        call BJDebugMsg("TARGET! " + R2S(target))
        if target > 0 then
        loop
            exitwhen ct == target
            call TriggerSleepAction(1/ smooth)
            set ct = ct + step
            call BJDebugMsg("CTPlus!! " + R2S(ct))
            call SetUnitVertexColorBJ(wUnit,r,g,b,100.00 - ct)
        endloop
        elseif target < 0 then
        loop
            exitwhen ct == target
            call TriggerSleepAction(1/ smooth)
            set ct = ct + step
            call BJDebugMsg("CTMinus! " + R2S(ct))
            call SetUnitVertexColorBJ(wUnit,r,g,b,-ct)
        endloop
        endif
    endfunction
    
    //HERO GLOW REQUIRES PASSIVE SPELL THAT USES HEROGLOW MODEL. 'Ax0J' is the rawcode
    function AddHeroGlow takes unit U returns nothing
        call UnitAddAbilityBJ('A000',U)
        call SetUnitColor(U,GetPlayerColor(GetOwningPlayer(U)))
    endfunction
    function RemoveHeroGlow takes unit U returns nothing
        call UnitRemoveAbilityBJ('A000',U)
    endfunction
    
    function CreateTempFloatTextAtUnit takes string msg, unit target, real offset, real velocity, real degree, real size, real red, real blue, real green, real trans, real timedead returns nothing
        local texttag t
        call CreateTextTagUnitBJ(msg,target,offset,size,red,green,blue,trans)
        set t = GetLastCreatedTextTag()
        call SetTextTagVelocityBJ(t,velocity,degree)
        call SetTextTagPermanentBJ(t,false)
        call SetTextTagAge(t,timedead)
        call SetTextTagLifespan(t,timedead)
        call SetTextTagFadepoint(t,timedead - 1)
        call TriggerSleepAction(timedead + (timedead / 10))
        call DestroyTextTag(t)
        //remove mem leaks
        set t = null
    endfunction
    
    function TargetHeal takes unit whichUnit, real healAmount returns nothing
        call SetUnitLifeBJ(whichUnit,(GetUnitStateSwap(UNIT_STATE_LIFE,whichUnit) + healAmount))
    endfunction
    
    function AddFXLoc_Child takes nothing returns nothing
        local effect tempeffect = bj_lastCreatedEffect
        local real duration = bj_enumDestructableRadius
        call PolledWait(duration)
        call DestroyEffect(tempeffect)
        set tempeffect = null
    endfunction
    
    function AddFXLoc takes  string whichEffect, location where, real duration returns nothing
        local trigger dispatcher = CreateTrigger()
        set bj_enumDestructableRadius = duration
        set bj_lastCreatedEffect = AddSpecialEffectLoc(whichEffect,where)
        call TriggerAddAction(dispatcher,function AddFXLoc_Child)
        call TriggerExecute(dispatcher)
        call DestroyTrigger(dispatcher)
        set dispatcher = null
    endfunction
    Please pay attention at the bolded function. You are able to clean the BJDebugMessage. It was just a debugger.

  10. #9
    ranzi's Avatar
    Join Date
    Apr 2007
    Location
    Japanz (Juakarta Puanaazz)
    Posts
    625
    Points
    821.01
    Thanks: 2 / 8 / 6

    Default

    Code:
    library MassTeleport initializer init requires TimerUtils, GroupUtils
        
    
        globals
        //Configuration-Start==========================================================
            private constant integer SPELL_ID='A000' //spell rawcode
            private constant real AREA_OF_EFFECT=750. //spell AoE, around the caster
            private constant real FINAL_AOE=250. //aoe spell target
            private constant real OPACITY_INCREMENT=10. //opacity incerement in %
            private constant real CASTING_TIME=1. //must match "Data - Follow Through Time" in object editor
            private constant real INTERVAL=0.1 //timer interval
            private constant string CASTER_FX="Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl"
            private constant string ALLY_FX="Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"
        //==End========================================================================
            private group casters
            private boolexpr b
        endglobals
    
        private struct data
            unit caster
            timer t 
            group g
            real x
            real y
            real counter=0.
            real opacity=0.
            effect fx
            boolean teleport=false
            
            static method create takes unit c, timer t, real x, real y returns data
                local data d=data.allocate()
                local group temp=NewGroup()
                local unit u
                
                set d.caster=c
                set d.t=t
                set d.x=x
                set d.y=y
                set d.g=NewGroup()
                set d.fx=AddSpecialEffectTarget(CASTER_FX,c,"origin")
                
                call GroupEnumUnitsInRange(temp,GetUnitX(c),GetUnitY(c),AREA_OF_EFFECT,b)
                
                loop
                set u=FirstOfGroup(temp)
                exitwhen u==null
                    call GroupRemoveUnit(temp,u)
                    if (IsUnitEnemy(u,GetOwningPlayer(c))==false) then
                        call GroupAddUnit(d.g,u)
                    endif
                endloop
                
                call ReleaseGroup(temp)
                
                set u=null
                return d
            endmethod
            
            private method onDestroy takes nothing returns nothing
                local unit u
                local real an //= GetRandomReal( 1, 360 )
                local real dis //= GetRandomReal( 1, 250 )
                local real rad //= an * 0.01734216
                local real x //= .x + dis * Cos ( rad )
                local real y //= .y + dis * Sin ( rad )
                
                call GroupRemoveUnit(casters,.caster)
                
                if (.counter>=CASTING_TIME) then
                    set .teleport=true
                endif
                
                loop
                set u=FirstOfGroup(.g)
                exitwhen u==null
                    call GroupRemoveUnit(.g,u)
                    call SetUnitVertexColor(u,255,255,255,255)
                    call DestroyEffect(AddSpecialEffectTarget(ALLY_FX,u,"origin"))
                    if (.teleport==true) then
                        if (u==.caster) then
                            call SetUnitX(u,.x)
                            call SetUnitY(u,.y)
                        else
                            set an = GetRandomReal( 1, 360 )
                            set dis = GetRandomReal( 1, FINAL_AOE )
                            set rad = an * 0.01734216
                            set x = .x + dis * Cos ( rad )
                            set y = .y + dis * Sin ( rad )
                            call SetUnitX(u,x)
                            call SetUnitY(u,y)
                        endif
                        
                    endif
                endloop
                
                call ReleaseTimer(.t)
                call ReleaseGroup(.g)
                call DestroyEffect(.fx)
                
                set u=null
            endmethod
        endstruct
    
        //Spell Filter
        private function Spell_Filter takes nothing returns boolean
            return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)and(GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE)>0)
        endfunction
        
        private function Conditions takes nothing returns boolean
            return GetSpellAbilityId() == SPELL_ID
        endfunction
        
        private function Cek takes nothing returns nothing
            local timer t=GetExpiredTimer()
            local data d=data(GetTimerData(t))
            local unit u
            local group temp
            
            if (d.counter<CASTING_TIME and GetUnitState(d.caster, UNIT_STATE_LIFE)>0) then
                set d.counter=d.counter+INTERVAL
                set d.opacity=d.opacity+OPACITY_INCREMENT
                set temp=NewGroup()
                call GroupAddGroup(d.g,temp)
                
                loop
                set u=FirstOfGroup(temp)
                exitwhen u==null
                    call GroupRemoveUnit(temp,u)
                    call SetUnitVertexColor(u,255,255,255,PercentTo255(100.0-d.opacity))
                endloop
                
                call ReleaseGroup(temp)
            else
                call d.destroy()
            endif
            
            set u=null
            set temp=null
            set t=null
        endfunction
        
        private function Actions takes nothing returns nothing
            local unit u=GetSpellAbilityUnit()
            local timer t
            local real x=GetSpellTargetX()
            local real y=GetSpellTargetY()
            local data d
            
            
            if (IsUnitInGroup(u,casters)==false) then
                call GroupAddUnit(casters,u)
                set t=NewTimer()
                set d=data.create(u,t,x,y)
                
                call SetTimerData(t,integer(d))
                call TimerStart(t,INTERVAL,true,function Cek)
            endif
            
            set t=null
            set u=null
        endfunction
    
        private function init takes nothing returns nothing
            local trigger t = CreateTrigger(  )
            call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
            call TriggerAddCondition(t, Condition( function Conditions ) )
            call TriggerAddAction(t, function Actions )
            
            call Preload(CASTER_FX)
            call Preload(ALLY_FX)
            
            set b=Condition(function Spell_Filter)
            set casters=NewGroup()
        endfunction
    
    endlibrary
    Demo mapnya di forum sebelah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •