Rochet2 / Issues

Issues about anything and everything
https://rochet2.github.io/
0 stars 0 forks source link

Updated TC Broke Transmog #13

Closed ghost closed 9 years ago

ghost commented 9 years ago

Looks like TC commit https://github.com/TrinityCore/TrinityCore/commit/a0e50ea35fca61447bf07fc45d93c98234ba59f7

Broke the script. They changed around some functions.

In file included from /root/TrinityCore/src/server/shared/DataStores/DBCStore.h:23:0, from /root/TrinityCore/src/server/game/DataStores/DBCStores.h:23, from /root/TrinityCore/src/server/game/Scripting/ScriptMgr.h:24, from PrecompiledHeaders/ScriptPCH.h:8: /root/TrinityCore/src/server/scripts/Custom/Transmog/Transmogrification.cpp: In member function ‘TransmogTrinityStrings Transmogrific ation::Transmogrify(Player*, uint64, uint8, bool)’: /root/TrinityCore/src/server/scripts/Custom/Transmog/Transmogrification.cpp:271:271: error: ‘GUID_LOPART’ was not declared in this sc ope TC_LOG_DEBUG("custom.transmog", "Transmogrification::Transmogrify - Player (GUID: %u, name: %s) tried to transmogrify an ite m (lowguid: %u) with a wrong slot (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName().c_str(), GUID_LOPART(ite mGUID), slot);

Rochet2 commented 9 years ago

This update will likely be delayed some due to current situations unless someone makes a PR to fix the guids.

Should be pretty straight forward from what it seems. Just changing the uint64 to ObjectGuid and use the appropriate methods instead of the missing macros and so.

DDuarte commented 9 years ago

I've described the required changes due to guid changes in http://collab.kpsn.org/display/tc/API+Changes#APIChanges-BlueCORE/ScriptsCore/Entities:AddedObjectGuidclassfromMaNGOS(Mergebranch'Object'Guid')

BloodDragon2580 commented 9 years ago

Check this https://bitbucket.org/lordpsyan/trinitycore-patches/src/bfa0c4bcd19233e0ac9e8cd5e63e28968228e6fb/TrinityCore/335a/Individual/Transmogrification.patch?at=default

DDuarte commented 9 years ago

@LordPsyan is an expert in stealing patches

BloodDragon2580 commented 9 years ago

I dont no but the patch works with rev. 5ac62d9ca3bdaf19e32bfa8fb85b87d2a954cc9a So I only just wanted to help.

ghost commented 9 years ago

Thanks for all the information, I started working on it. @DarkBrain2580 I don't see how that patch could work, it's full of the very functions I am replacing =/

I believe I have it working, except this block that I can't figure out. I got it working (with bad value) and in game the NPC works, I cannot click "How Transmog Works" but I can transmog an item, just after logout and back it it does not save. The block below is obviously the database save function. Any suggestions?

if (!player->transmogMap.empty())
            {
                // Only save items that are in inventory / bank / etc
                std::vector<uint64> items = sTransmogrification->GetItemList(player);
                for (std::vector<uint64>::const_iterator it = items.begin(); it != items.end(); ++it)
                {
                    TransmogMapType::const_iterator it2 = player->transmogMap.find(*it);
                    if (it2 == player->transmogMap.end())
                        continue;

                    trans->PAppend("REPLACE INTO custom_transmogrification (GUID, FakeEntry, Owner) VALUES (%u, %u, %u)", GUID_LOPART(it2->first), it2->second, lowguid);
                }
            }

Working with the part:

GUID_LOPART(it2->first)
DDuarte commented 9 years ago

@zharvek: see the wiki page I linked above, it says what to replace with GUID_LOPART

ghost commented 9 years ago

Sorry @DDuarte I'm not the best at this but I'm trying.

I have tried playing with this one section as much as I can think of but I always get a 0 (zero) in the database. I am watching the db transactions and I see it running the replace command, with the zero.

Playing around...

ObjectGuid guid;
uint32 testing = guid.GetCounter();
trans->PAppend("REPLACE INTO custom_transmogrification (GUID, FakeEntry, Owner) VALUES (%u, %u, %u)", testing, it2->second, lowguid);
trans->PAppend("REPLACE INTO custom_transmogrification (GUID, FakeEntry, Owner) VALUES (%u, %u, %u)", guid.GetCounter(it2->first);, it2->second, lowguid);

I tried other stuff with the examples as well. I did get it working, but I don't think it's correct. I just left it as

it2->first

And left out the GUID_LOPART entirely. Maybe this value is already correct because other changes in the core have already modified it?

Edit: What I have so far: https://github.com/zharvek/TrinityCore/commit/925f84478d0808d8fed08101172028db05bf7ee0

Averdrity commented 9 years ago

When does the script get's updated to work with latest TC?

Rochet2 commented 9 years ago

Aokromes already posted an updated (though possibly untested) version to TC forum release main post. See the attached file here: http://www.trinitycore.org/f/topic/6508-patch-transmogrification-335a/

I also have an updated version, but I cant test it at the moment so Im not posting it to the repo.

deadmanevil commented 9 years ago

some patch that works

Rochet2 commented 9 years ago

Transmog is now updated in the main repo Make a new issue if you have issues with it etc.