tooltiperror
Super Moderator
- Reaction score
- 231
JASS:
// Script by Blade.dk
// wc3jass
function CloneUnit takes unit whichUnit, player cloneOwner, real cloneX, real cloneY, real cloneFacing returns unit
local unit clone
local gamecache g = InitGameCache("CloneCache.w3v")
call StoreUnit(g, "clone", "clone", whichUnit)
set clone = RestoreUnit(g, "clone", "clone", cloneOwner, cloneX, cloneY, cloneFacing)
call SetUnitState(clone, UNIT_STATE_LIFE, GetUnitState(whichUnit, UNIT_STATE_LIFE))
call SetUnitState(clone, UNIT_STATE_MANA, GetUnitState(whichUnit, UNIT_STATE_MANA))
call FlushGameCache(g)
set g = null
return clone
endfunction
Perfectly clones a unit. Carries over things like buffs and items and all that jazz (using the other BJ won't).
I figured it was big enough to be a snippet if IsPositionPathable and that stuff is