Get the count of behaviors of the target unit by UnitBehaviorCount(). You can get the name of each behavior in sequence by UnitBehaviorGet(TargetUnit,BehaviorIndex) up to the total count. You can transfer the behavior by UnitBehaviorTransfer() from source unit to target unit.
Though you may want to start from the last behavior and count down to zero, or indexes will be messed up. Or just transfer the first behavior of the list up to the total count.
Is it possible to assign multiple behaviors a unit owns to another unit by one trigger/command?
I just don't want to create like 30 "if a unit holds a behavior, then assign it to another unit" constructions for each possible behavior ;/
Get the count of behaviors of the target unit by UnitBehaviorCount(). You can get the name of each behavior in sequence by UnitBehaviorGet(TargetUnit,BehaviorIndex) up to the total count. You can transfer the behavior by UnitBehaviorTransfer() from source unit to target unit.
Though you may want to start from the last behavior and count down to zero, or indexes will be messed up. Or just transfer the first behavior of the list up to the total count.
oh yeah, this works, thank you!