[General] Making unit immobile but can attack

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
Anyone knows how to make my hero become immobile but can still attack like towers after using transformation spell based of tinker robo goblin spell. I tried to use dummy unit to web my hero after he use that robo goblin spell but after hero got web debuff, hero cant use the robo goblin spell to return to his original form. any idea?
 
JASS:
//  DisableUnitMovement /* v1.0.0.1
//    *   Disables unit movement. They can still turn, but will stay in
//    *   place. It simulates an ensnare-like effect, except that it will
//    *   not ground units, it does not have buffs, does not interrupt
//    *   channeled casts and appears to have no downsides.
//    *   Full credits to WaterKnight for discovering this technique.
//--------------------------------------------------------------------      
function DisableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, 0)
endfunction
//--------------------------------------------------------------------   
function EnableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, GetUnitDefaultPropWindow(u) * bj_DEGTORAD)
endfunction
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
The Prop Window is the angle in which you can cast spells and attack etc.
So you can have a Prop Window difference between your facing angle and the angle between you and the target.

That it stops the movement of said unit, is just something weird assuming the unit never really faces that angle (but it can rotate... and it doesnt apply on movement).
 
Level 6
Joined
Jan 2, 2015
Messages
171
JASS:
//  DisableUnitMovement /* v1.0.0.1
//    *   Disables unit movement. They can still turn, but will stay in
//    *   place. It simulates an ensnare-like effect, except that it will
//    *   not ground units, it does not have buffs, does not interrupt
//    *   channeled casts and appears to have no downsides.
//    *   Full credits to WaterKnight for discovering this technique.
//--------------------------------------------------------------------     
function DisableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, 0)
endfunction
//--------------------------------------------------------------------  
function EnableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, GetUnitDefaultPropWindow(u) * bj_DEGTORAD)
endfunction

do you have GUI Version for it? i am not JASS user. hehe
 
Status
Not open for further replies.
Top