Reputation tables are full. he table has 2 parts. The common and for each pair of races.
(0, 47, 'Ironforge', 0, 530, 'Darkspear Trolls') Used for translation to Human(ID 1) to Orc (ID 2).
If need transfer Human(1) to Troll(8) (1, 47, 'Ironforge', 8, 76, 'Orgrimmar') must be used.
This code implement replace (0, 47, 'Ironforge', 0, 530, 'Darkspear Trolls') to (1, 47, 'Ironforge', 8, 76, 'Orgrimmar') for Human(1) \\ Troll(8)
CREATE TEMPORARY TABLE current_rep
SELECT
Trep.race_A AS race_1, Trep.rep_A AS rep_1, Trep.commentA AS comment1, Trep.race_H AS race_2, Trep.rep_H AS rep_2, Trep.commentH AS comment2
FROM
character_reputation AS Rep, transfer_reputation AS Trep
WHERE
faction = rep_A AND guid = SrcP
AND ((race_A = SrcR AND race_H = DestR) OR
(race_A = 0 AND
rep_A NOT IN
(SELECT
rep_A
FROM
transfer_reputation
WHERE
(race_A = SrcR AND race_H = DestR) AND rep_A = transfer_reputation.rep_A)
)
);
+ // Delete Friend List
+ CharacterDatabase.PExecute("DELETE FROM `character_social` WHERE `guid`= '%u'",GUID_LOPART(guid));
It is necessary to delete the character from other friend lists.
DELETE FROM character_social WHERE guid = <char_guid> OR friend = <char_guid>;
Need to implement some checks before faction change. http://eu.blizzard.com/support/article.xml?locale=en_GB&articleId=39811
"If the character is a Guild Master, you will not be able to perform a Faction Change."