HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Locating a point in front of hero.

10-16-2006, 06:00 AM#1
The_AwaKening
I'm calling up a dummy unit to cast crushing wave in 3 directions when I summon an elemental. Trigger works fine, but unfortunately the elementals are not always summoned directly in front of my hero, so I need the code to find the point directly in front of my hero. Here is what I have.

Collapse JASS:
function WE_Summon takes nothing returns nothing
 local unit d
 local unit s=GetSummonedUnit()
 local unit c=GetSummoningUnit()
 local integer i=0
    loop
        exitwhen i>2
        set d=CreateUnit(GetOwningPlayer(c),'e003',GetUnitX(c),GetUnitY(c),GetUnitFacing(c))
        call UnitApplyTimedLife(d,'BTLF',2)
        call UnitAddAbility(d,'ACc3')
        call SetUnitAbilityLevel(d,'ACc3',GetUnitAbilityLevel(c,'AHwe'))
        call IssuePointOrder(d,"carrionswarm",(GetUnitX(s)+(i*50))-50,(GetUnitY(s)+(i*50))-50)
        set i=i+1
    endloop
 set d=null
 set c=null
 set s=null
endfunction
10-16-2006, 08:10 AM#2
zen87
theres a small problem with spells like crushing wave, carrion swarm, or shockwave, is that they cant cast on cliff, so i suggest this (only work if your hero are not flying and your dummy must be flying unit)

create the dummy at location offese by 50 at 0, 120, 240 degress, then order the dummy cast the <whatever wave spell> towards the location of the hero (well the place where hero standing is 100% not cliffs if the hero is not an air unit =| )