• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Chromosphere effect wont work...

Status
Not open for further replies.
Level 7
Joined
May 23, 2011
Messages
179
The dota skill chrmosphere wont take effect.... Whats wrong with my Trigger.... Did i miss something??
  • Time Lock 2
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Time_Lock and do (Actions)
        • Loop - Actions
          • Set hero = (Picked unit)
          • Set temploc = (Position of hero)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 1700.00 of temploc matching (((Matching unit) has buff Devotion Aura) Equal to True)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
                • Then - Actions
                  • Unit - Pause (Picked unit)
                  • Wait 2.00 seconds
                  • Unit - Unpause (Picked unit)
                • Else - Actions
          • Custom script: call RemoveLocation(udg_temploc)
Please help....
 
It's Chronoshpere, first of all :p

Waits inside Unit Group enumerations don't work, resulting the units to become unpaused, since there is no time period between those two actions.

There is no reason to constantly Pause a unit. Just add it in a unit group once the spell is cast and fire a timer. Once the timer ends, unpause the units from that unit group. I had made a sample map once, but I will have to find it.
 
Level 7
Joined
Nov 19, 2007
Messages
253
Here is how i made this spell in my map its MUI and in vJass:
JASS:
scope timePrison initializer i

    private struct TP
        unit caster
        unit dummy
        group sGroup
        integer count
        integer count2
    endstruct
    
    globals
        private TP array timePrisonDB
        private integer dbIndex=-1
        private timer time=CreateTimer()
        private unit globalCaster
    endglobals
    
    private function c2 takes nothing returns boolean
        local TP tempDat
        local integer index=0
        loop
        exitwhen index>dbIndex
            set tempDat=timePrisonDB[index]
            if IsUnitInGroup(GetDyingUnit(),tempDat.sGroup)==true then
                call GroupRemoveUnit(tempDat.sGroup,GetDyingUnit())
                call PauseUnit(GetDyingUnit(),false)
                call SetUnitTimeScale(GetDyingUnit(),1)
            endif
            set index=index+1
        endloop
        return false
    endfunction
    
    private function gFunc takes nothing returns nothing
        call PauseUnit(GetEnumUnit(),false)
        call SetUnitTimeScale(GetEnumUnit(),1)
    endfunction
    
    private function filter takes nothing returns boolean
        local TP tempDat
        local integer index=0
        if IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(globalCaster))==true and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>=1 then
            call PauseUnit(GetFilterUnit(),true)
            call SetUnitTimeScale(GetFilterUnit(),0)
        endif
        loop 
        exitwhen index>dbIndex
            set tempDat=timePrisonDB[index]
                if tempDat.caster==globalCaster then
                    if IsUnitInGroup(GetFilterUnit(),tempDat.sGroup)==false and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>=1 then
                        call GroupAddUnit(tempDat.sGroup,GetFilterUnit())
                    endif
                endif
            set index=index+1
        endloop
        return false
    endfunction
    
    private function p takes nothing returns nothing
        local TP tempDat
        local integer index=0
        local group g
        loop
        exitwhen index>dbIndex
            set tempDat=timePrisonDB[index]
            set tempDat.count2=tempDat.count2-1
            if tempDat.count2<=0 then
                set g=CreateGroup()
                set globalCaster=tempDat.caster
                call GroupEnumUnitsInRange(g,GetUnitX(tempDat.dummy),GetUnitY(tempDat.dummy),450,Filter(function filter))
                call DestroyGroup(g)
                call SetUnitTimeScale(tempDat.dummy,0)
                set tempDat.count=tempDat.count-1
            endif
            if tempDat.count==0 then
                call RemoveUnit(tempDat.dummy)
                call tempDat.destroy()
                set timePrisonDB[index]=timePrisonDB[dbIndex]
                set dbIndex=dbIndex-1
                call ForGroup(tempDat.sGroup,function gFunc)
                call DestroyGroup(tempDat.sGroup)
                if dbIndex==-1 then
                    call PauseTimer(time)
                endif
            endif
            set index=index+1
        endloop
    endfunction

    private function c takes nothing returns boolean
        local TP tempDat
        if GetSpellAbilityId()=='A085' then
            set tempDat=TP.create()
            set tempDat.sGroup=CreateGroup()
            set tempDat.count2=GetRandomInt(6,12)
            set tempDat.caster=GetTriggerUnit()
            set tempDat.count=20*(4+GetUnitAbilityLevel(tempDat.caster,'A085'))+tempDat.count2
            set tempDat.dummy=CreateUnit(GetTriggerPlayer(),'h00M',GetSpellTargetX(),GetSpellTargetY(),0)
            call SetUnitTimeScale(tempDat.dummy,15)
            if dbIndex==-1 then
                call TimerStart(time,0.05,true,function p)
            endif
            set dbIndex=dbIndex+1
            set timePrisonDB[dbIndex]=tempDat
        endif
        return false
    endfunction
 
    private function i takes nothing returns nothing
        local trigger trig=CreateTrigger()
        local trigger trig2=CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(trig,Condition(function c))
        set trig=null
        call TriggerRegisterAnyUnitEventBJ(trig2,EVENT_PLAYER_UNIT_DEATH)
        call TriggerAddCondition(trig2,Condition(function c2))
        set trig2=null
    
endscope

If you want i can put this into your map
 
Level 7
Joined
Nov 19, 2007
Messages
253
I allready gave you code all you need to do is put it into your map and change some ID's
change all 'A085' into your spell ID, all 'h00M' into your dummy unit ID and thats all..
 
Status
Not open for further replies.
Top