Well, the problem is,
// 0x40 leader rights
// siege flags: attacker - 0x180 sword over name, defender - 0x80 shield, 0xC0 crown (|leader), 0x1C0 flag (|leader)
writeD(_relation);
is used for sieges, not for clan wars... so, in my thinking, RelationChanged should control the title but it doesn't. I tried changing the relation, it didn't work :/