Core/Misc: fixed a scenario when character factionchange create unexpected results, also moved packet generating code into unique methods