
JASS:
native SetUnitPathing takes unit whichUnit, boolean flag returns nothing
I'd suggest using this native by setting it to false during the spell duration, and setting it to true when it ends. Probably you'll have issues near to water... well, I've been too long away from modding.