HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shadows of Caster in a leap spell - HELP

03-08-2007, 05:44 PM#1
anXieTy
Hello again, here i am again ^^
my second spell i want to make is a leap spell which moves the caster to the targetpoint very quickly. So for now, i wanted to attach shadows of the caster to the caster, like in vex´mega-spellmap the elemental has. So i looked @ his triggers, and tried to do the same- doesnt work.. i know why, but i cant get this prob solved. I want to create a dummyunit, it lives 1 second, then dying, but its a demonhunter, so this ugly death animation appears.

How can i fix that? is there any possibility to hide death animation, i cant remove the unit in the same function, because its a timer function... for now, i tried with gamecache, but i dont get how to GetStoredUnits -_- for now, here is my code, hope some1 could help me, THX!7

Code:
function Trig_Time_Void_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A01N' ) ) then
        return false
    endif
    return true
endfunction    


function Time_Void_DmgTargets takes nothing returns nothing
local player p
local real dmg

                                                                          
set p = GetOwningPlayer( udg_TimeVoid_Caster )
set dmg = 50.00
call UnitDamageTargetBJ( udg_TimeVoid_Caster, GetEnumUnit(), dmg, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL )
call GroupAddUnit	(udg_TimeVoid_Targets, GetEnumUnit())
call AddSpecialEffectTarget (GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 2), GetEnumUnit(),"chest")
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set p = null
endfunction


function Trig_Time_Void_conds takes nothing returns boolean
local player p
set p = GetOwningPlayer( udg_TimeVoid_Caster )

if IsPlayerAlly( p, GetOwningPlayer(GetFilterUnit())) then
   return false
elseif IsUnitType( GetFilterUnit(), UNIT_TYPE_STRUCTURE) then
   return false
elseif IsUnitDeadBJ(GetFilterUnit()) then
   return false
elseif IsUnitInGroup (GetFilterUnit(), udg_TimeVoid_Targets)then
   return false
endif

return true
endfunction

function Trig_Time_Void_expi takes nothing returns nothing
        local rect rs
        local group g
        local boolexpr filter = Condition(function Trig_Time_Void_conds) 
        local unit db = null
        local unit da = null   

        set g = CreateGroup ()
        set udg_t = GetExpiredTimer()
        set udg_r = ( udg_dist * udg_m )
        set udg_p = PolarProjectionBJ (udg_cpos, udg_r, udg_deg)
        set rs = RectFromCenterSizeBJ(udg_p, 150.00, 150.00)        
        call SetUnitPositionLoc	 (udg_TimeVoid_Caster,  udg_p)     
        
        
        if ( udg_r >= udg_enddist ) then
        call PauseTimerBJ( true, udg_t )
        call AddSpecialEffectLocBJ (	udg_p, GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 2) )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )       
    else
    
        call AddSpecialEffectTarget (GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 1), udg_TimeVoid_Caster,"chest")
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )  
        call RemoveUnit(udg_TimeVoid_Dummy[1])
                set udg_TimeVoid_Dummy[1]=udg_TimeVoid_Dummy[0]
                set udg_TimeVoid_Dummy[0]=CreateUnit( Player(15), GetUnitTypeId(udg_TimeVoid_Caster), 0,0, GetUnitFacing(udg_TimeVoid_Caster)) 
                call UnitAddAbility( udg_TimeVoid_Dummy[0], 'Aloc' )
                call UnitApplyTimedLifeBJ( 1, 'BTLF', udg_TimeVoid_Dummy[0] )
                call SetUnitColor( udg_TimeVoid_Dummy[0], GetPlayerColor( GetOwningPlayer(udg_TimeVoid_Caster) ) )
                call SetUnitPosition(udg_TimeVoid_Dummy[0], GetUnitX(udg_TimeVoid_Caster), GetUnitY(udg_TimeVoid_Caster) )
                call SetUnitVertexColor(udg_TimeVoid_Dummy[0], 255,255,255,127)
                call SetUnitVertexColor(udg_TimeVoid_Dummy[1], 255,255,255,63)        
    endif
        set udg_m = (udg_m+1)  
        call RemoveLocation (udg_p)
    call GroupEnumUnitsInRect( g, rs, filter )
    call ForGroup( g, function Time_Void_DmgTargets )
    call RemoveRect (rs)
    call DestroyGroup (g)
    call DestroyBoolExpr(filter)       

    endfunction

function Trig_Time_Void_Actions takes nothing returns nothing
     
    
    call TimerStart(udg_t,0.01,true,function Trig_Time_Void_expi)  
                                                       
    set udg_TimeVoid_Caster    = GetSpellAbilityUnit()  
    set udg_cpos = GetUnitLoc(udg_TimeVoid_Caster)    
    set udg_tp = GetSpellTargetLoc ()
    set udg_enddist = DistanceBetweenPoints ( udg_tp,  udg_cpos)
    set udg_deg  = AngleBetweenPoints ( udg_cpos ,  udg_tp   )
    set udg_m  = 0
    set udg_dist = 45   
    call GroupClear (udg_TimeVoid_Targets)
    call AddSpecialEffectLocBJ (	udg_p, GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 0) )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )  
     endfunction
    
    
    
    
       

//===========================================================================
function InitTrig_Time_Void takes nothing returns nothing
    set gg_trg_Time_Void = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Void, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Time_Void, Condition( function Trig_Time_Void_Conditions ) )
    call TriggerAddAction( gg_trg_Time_Void, function Trig_Time_Void_Actions )                   
    call Preload(GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 0))
    call Preload(GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 1))
    call Preload(GetAbilityEffectById('A01N', EFFECT_TYPE_AREA_EFFECT, 2))
endfunction






sry, posted wrong trigger 5 mins ago...
03-08-2007, 06:11 PM#2
wantok
Have you tried freezing it's animation speed so it can't play the death animation? I think that would work.
03-08-2007, 06:22 PM#3
Vexorian
call ShowUnit(dummy,false) ?
03-08-2007, 06:34 PM#4
anXieTy
well, i want to create a shadow every time the caster moves... so it hide doesnt work right i think. So, that freezing sounds nice, can you tell me the jass function for this? and if there is anything special about it, tell me this too pls :P

BW, anX

Edit: wantok´s idea doesnt work :(
03-08-2007, 07:27 PM#5
Vexorian
...

You can just use an invisible model for the model?
03-08-2007, 07:40 PM#6
anXieTy
ok, you missunderstood, i want to make a shadow of the hero using the heroes model, just a bit more transparent (?). Dont you remind your spellpack "spellfactory3" the bane elemental has a leap spell with some of his shadows appearing. I wanted to do it like that.

anX

edit: maybe trying a normal unit with hero model?

:O
03-08-2007, 08:47 PM#7
Vexorian
...

But then if you want to kill it without showing the death animation, hiding it before you kill it will work.