Jump to content

[patch] Race/Faction change


Auntie Mangos

Recommended Posts

I finished my dev on Race/Faction change. Now patch can be gave there

Subject : You can now change your race or faction like you can customize your character

Written by : Me (Ner'zhul)

Dev link : http://getmangos.eu/community/showthread.php?13818-dev-Faction-race-change-%28full-core-side%29&p=113879#post113879

Patch file : http://paste2.org/p/822971

Don't hesistate to thanks me :P

How it works ?

Simply add entries into database for faction change, example : tank druid chest t9 for alliance into alliance_id on player_changefaction_items and tank druid chest t9 for horde into horde_id

then when a player switch faction the item will be converted

Warning ! I've change patch now because table name in sources is wrong :P

Link to comment
Share on other sites

  • 40 years later...
I agree with Voldemmort. Unless one of the database groups has already put in support for this, I consider this patch incomplete without the correct queries to update the tables.

Usually the tables are put in place before the database supports it; for example, the DB gossip system.

In any case, I think this is probably the correct way of implementing it. Maybe it could use some clean-up though.

Link to comment
Share on other sites

MaNGOS does not supply a full, playable database, but they do establish the templates the DB groups use for adding the data.

That's why I said it needed a bit more work, unless you consider it done and expect the MaNGOS devs to correct the table data.

Link to comment
Share on other sites

  • 3 weeks later...

Race change working OK. But faction change, at least on my server, isn't working.

Explanation:

Icon appears next to the name.

Do changes and bla bla bla.

Press Accept and noting happens to the character.

Any idea why is this happening?

Oh, also take a look at this http://paste2.org/p/864377 . I used that way to change fly routes in my SQL method, maybe could help.

Thx for the work anyways.

P.D.: Sorry my bad english, I'm spanish.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Hi !

Nice patch, it works perfectly.. But you don't cover all case :

Some quest is only for one faction and it isn't marked in the db.

The proper solution should be to look all characters' quest and look all creature_questrelation for see if the faction is friendly or not. (do you understand what i mean?)

Thanks (:

Link to comment
Share on other sites

  • 2 months later...

Hello,

I'm trying to update this patch to latest rev, but I need some help with a compile error.

I have in CharacterHandler.cpp this:

Player::LeaveAllArenaTeams(GUID_LOPART(guid));

But it is showing me this error:

..\\..\\src\\game\\CharacterHandler.cpp(1225) : error C2248: 'ObjectGuid::ObjectGuid'

Someone have any idea how to fix this compile error?

I have done this and it appear to work.

Player::LeaveAllArenaTeams(guid);

What do you think?

Link to comment
Share on other sites

  • 3 months later...

+               // Item conversion
+               if(QueryResult *result2 = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_items"))
+               {
+                       do
+                       {
+                               Field *fields2 = result2->Fetch();
+                               uint32 item_alliance = fields2[0].GetUInt32();
+                               uint32 item_horde = fields2[1].GetUInt32();
+                               CharacterDatabase.PExecute("UPDATE `character_inventory` set item = '%u' where item = '%u' AND guid = '%u'",
+                                       team == BG_TEAM_ALLIANCE ? item_alliance : item_horde, team == BG_TEAM_ALLIANCE ? item_horde : item_alliance, guid);
+
+                               CharacterDatabase.PExecute("UPDATE `item_instance` SET `data`=CONCAT(CAST(SUBSTRING_INDEX(`data`, ' ', 3) AS CHAR), ' ', '%u', ' ',     CAST(SUBSTRING_INDEX(`data`, ' ', (3-64))AS CHAR)) WHERE CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 4), ' ', '-1') AS UNSIGNED) = '%u' AND owner_guid = '%u'",
+                                               team == BG_TEAM_ALLIANCE ? item_alliance : item_horde, team == BG_TEAM_ALLIANCE ? item_horde : item_alliance, GUID_LOPART(guid));
+                       }
+                       while( result2->NextRow() );
+               }

CharacterDatabase.PExecute("UPDATE `character_inventory` set item = '%u' where item = '%u' AND guid = '%u'",

i guess here must be

set item_template ... where item_template ...

Link to comment
Share on other sites

  • 3 months later...

Look, MaNGOS as i see it provide some SQL data, for example this should convert medallions from horde to alliance, and rep, quests etc... and i think MaNGOS should provide that data, else the system is fully broken... So why dont you just submit what you have added in the sql's

- LilleCarl

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use