DUNGEON_DIFFICULTY3 = "Epic (Unused)";
UnitPopupButtons["DUNGEON_DIFFICULTY3"] = { text = DUNGEON_DIFFICULTY3, dist = 0 };
Logger.network=2,Console Server
In worldserver.conf, I enabled network debug logging by setting this value:Code: [Select]Logger.network=2,Console ServerWith this, any time the server runs WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) (in gameHandlersMiscHandlers.cpp), it prints some debug info in the worldserver console. Then I used /run SetDungeonDifficulty(#). It worked for values of 1 and 2 (normal and heroic), but it didn't seem to send anything to the server with a difficulty value of 3. That means you probably need to use AIO to send a request to set dungeon difficulty to 3. Hopefully you don't need to otherwise mess with the client to fix the unused difficulty. TrinityCore should be able to set your difficulty to 3 if it receives the request. You'll also need to increment the MAX_DUNGEON_DIFFICULTY constant. Not sure what else you'd need.
Right, but if you wanted to make the button work, you would need to add a way to send the request to change the difficulty (using AIO, probably).I don't know how dungeon difficulties themselves are implemented.
https://wowdev.wiki/DB/Difficulty?
You'll also need to increment the MAX_DUNGEON_DIFFICULTY constant. Not sure what else you'd need.
void HandleSetDungeonDifficulty(Difficulty mode);
void WorldSession::HandleSetDungeonDifficulty(Difficulty mode){ TC_LOG_DEBUG("network", "MSG_SET_DUNGEON_DIFFICULTY"); if (mode >= MAX_DUNGEON_DIFFICULTY) { TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUID().GetCounter(), mode); return; } if (Difficulty(mode) == _player->GetDungeonDifficulty()) return; // cannot reset while in an instance Map* map = _player->FindMap(); if (map && map->IsDungeon()) { TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName().c_str(), _player->GetGUID().GetCounter()); return; } Group* group = _player->GetGroup(); if (group) { if (group->IsLeader(_player->GetGUID())) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* groupGuy = itr->GetSource(); if (!groupGuy) continue; if (!groupGuy->IsInMap(groupGuy)) return; if (groupGuy->GetMap()->IsNonRaidDungeon()) { TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUID().GetCounter(), groupGuy->GetName().c_str(), groupGuy->GetGUID().GetCounter()); return; } } // the difficulty is set even if the instances can't be reset //_player->SendDungeonDifficulty(true); group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player); group->SetDungeonDifficulty(Difficulty(mode)); } } else { _player->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false); _player->SetDungeonDifficulty(Difficulty(mode)); }}
/** * Sets the [Player]s dungeon difficulty to the specified value * * @param uint32 difficulty */ int SetDungeonDifficulty(Eluna* /*E*/, lua_State* L, Player* player) { Difficulty difficulty = (Difficulty)Eluna::CHECKVAL<uint32>(L, 2, 0); WorldSession* session = player->GetSession(); session->HandleSetDungeonDifficulty(difficulty); bool isInGroup = (player->GetGroup() != 0); player->SendDungeonDifficulty(isInGroup); return 0; }
{ "SetDungeonDifficulty", &LuaPlayer::SetDungeonDifficulty },
local AIO = AIO or require("AIO")AIO.AddAddon()if AIO.IsServer() then -- TrinityCore: starting from 0=normal, 1=heroic, 2=epic local MAX_DUNGEON_DIFFICULTY = 3 function HandlePlayerSetDungeonDifficulty(player, msg) -- difficulties start at 0 in TrinityCore, 1 in client msg = tonumber(msg) - 1 if msg >= 0 and msg < MAX_DUNGEON_DIFFICULTY then player:SetDungeonDifficulty(msg) end end AIO.RegisterEvent("SetDungeonDifficulty", HandlePlayerSetDungeonDifficulty) returnendUnitPopupButtons["DUNGEON_DIFFICULTY3"] = { text = DUNGEON_DIFFICULTY3, dist = 0 };UnitPopupMenus["DUNGEON_DIFFICULTY"] = { "DUNGEON_DIFFICULTY1", "DUNGEON_DIFFICULTY2", "DUNGEON_DIFFICULTY3" };DUNGEON_DIFFICULTY_5PLAYER_EPIC = "5 Player (Epic)";function SetDungeonDifficultyCustom(difficulty) AIO.Msg():Add("SetDungeonDifficulty", difficulty):Send()endorigSetDungeonDifficulty = SetDungeonDifficultySetDungeonDifficulty = function(...) local difficulty = ... if difficulty < 3 then origSetDungeonDifficulty(difficulty) else SetDungeonDifficultyCustom(difficulty) endend
What's the sane way to copy over all monster spawns from a normal dungeon? From what I understand, they're stored in world.creature
UPDATE world.creature SET spawnMask=15 WHERE map=[map ID];
Quote from: "Grymskvll"What's the sane way to copy over all monster spawns from a normal dungeon? From what I understand, they're stored in world.creatureIn world.creature, the spawnMask column determines which difficulties a creature will spawn on. So if you want to make every creature in a Map spawn for every difficulty, you can just set the spawnMask to 15 ("Spawned in all versions of maps").To set this spawnMask for all creatures in a specific map, you can use this mysql statement (AT YOUR OWN RISK):Code: [Select]UPDATE world.creature SET spawnMask=15 WHERE map=[map ID];Replace [map ID] with the map you want to change. You still need to add Epic difficulty entries for each creature_template in the dungeon. Otherwise it uses the heroic or normal version as fallback.As far as I know, that leaves just two imperfections:-the dungeon portal becomes invisible when you set difficulty to to Epic. If anyone has an idea how the game picks its instance portal models, please let me know-the little dungeon difficulty indicator when you're inside a dungeon (in the top-right, next to the minimap) just displays "0". Odds are there's no blp for an Epic difficulty (like the skull flag for Heroic), so you probably need to do some interface modding, which wouldn't be an issue since you need to use an AIO script to make the difficulty selection menu work anyway. I'm a little dismayed that I couldn't even get the indicator to show "5", though, even with a modified client-side MapDifficulty.dbc-game objects don't seem to be spawning, gotta figure out how that stuff works (like the web door in Azjol-Nerub)
UPDATE world.gameobject SET spawnMask=15 WHERE map=[map ID];
To fix gameobjects, you need to set the spawnMask just like we did with creatures:Code: [Select]SELECT * FROM world.gameobject WHERE map=[map ID];For some reason, the maxplayers and difficultystring values in MapDifficulty.dbc don't get checked for newly created rows, and I can't figure out why. I'm guessing there's something missing in Map.dbc or something. I made a hacky workaround by hooking GetInstanceInfo(). It'll work for 5 man Epic dungeons. Also I kind of completely neglected Epic raids. Unfortunately, Epic raids would need some more in-depth modding, since in world.creature_template, difficulty_entry_# only goes up to 3, meaning you can have up to 4 difficulty versions including the base. All 4 of these versions are already used by raids for N10, N25, H10 and H25. It could be as simple as adding more columns to the table, I don't know. Other than that you'd need to add another Eluna method (SetRaidDifficulty), get some AIO communication akin to the one I wrote for SetDungeonDifficulty, and add some extra conditions in the hooked GetInstanceInfo() to check for raid and difficulty so that maxplayers and difficultystring returned by it are correct, maybe mess with some core constants, add the necessary client strings, mess with the minimap indicator (more on that below).Also, for some reason MiniMapInstanceDifficulty_OnEvent can't be overwritten in an AIO script properly. The modified version will just exist side by side with the original, and events will call the original instead of our modified version. That's not a huge problem, since you can just supply a modified Minimap.lua (where the function resides) in a custom patch, which would be necessary if you want Epic difficulty to have a different minimap indicator blp anyway. Speaking of which, I made an Epic difficulty instance banner, it's included in the patch below, along with a modified Minimap.luaPreview (new epic banner on the right):Looking at the banner now, I probably should've reduced the emblem's alpha a tiny bit. Oh well! The attached file also contains the Photoshop document for that image, as well as an updated AIO script.So right now the issues are:-invisible instance portal when you select Epic dungeon difficulty (no idea how this works)-no Epic raid support-hacky GetInstanceInfo() mod instead of properly loading maxplayers and the difficultystring from MapDifficulty.dbcMirror: https://a.fluntcaps.me/nywray.zip
SELECT * FROM world.gameobject WHERE map=[map ID];
GAMEOBJECT_TYPE_DUNGEONDIFFICULTY = 31 data0: mapID (From Map.dbc) data1: difficulty 0 5 man normal, 10 man normal1 5 man heroic, 25 normal2 5 Man Epic (Possibily), 10 man heroic3 25 man heroic