How does adding additional/new phases work in master branch?

Having not worked with the hotfix database before, I’m trying to figure out how to go about adding additional phases to multiple maps that don’t have phaseID’s already. These phases are just for GM’s to transfer into using “.mod phase”, and the phases shouldn’t be active all the time (meaning, a GM has to specifically enter, let’s say “.mod phase #” to go there instead of just entering the zone via .tele)

I can see that in the server code, the game checks Phase.db2 and Map.db2 to see if the Map and phaseID are valid upon using ".mod phase", and if it's invalid, it spits out the appropriate error message of it not existing. Although, I am aware that from Legion to (currently, Shadowlands) that the hotfix database is used instead of the DB2 files.

Unless phase_area in the World database is actually the way to do it (the wiki was sort of confusing me by the phases entered being "always active"), I'm not too sure how to go about adding these additional phases.

You are seeing that because “.mod phase” can do two things, one is change phase (validation with Phase.db2 only, or its hotfix), the other thing is to modify visible terrain (like worgen starting zone) where Map.db2 is used for validation. All you need is new row in phase in hotfix database

I guess the next question would be then, what does ID and Flags stand for here in the phase table under the hotfix database? I know that I would have to attach the added ID in question to hotfix_data later on, but unless I’m misunderstanding something, I don’t see anything regarding adding a specific zone to the list here along with whatever additional phases I’d like to add in this table.

Adding new data to hotfix database only allows you to use custom ids in other places where you would use regular ids.

As for linking them to areas - you said you want it to be done manually with a command, so you dont have to do anything (no, there is no option to only remove the phase when leaving zone without also making it apply automatically when entering)

hotfix_data - unneccessary for you, you are only using this phase serverside

flags - leave 0

So in this case then, if I’m understanding you correctly, the only things I have to do are:

  1. Set an ID of my choosing

  2. Leave flags at 0

  3. Leave hotfix_data alone (as it is irrelevant as you said)

And then if I use that ID with “.mod phase” to phrase somewhere (let’s say I use .mod phase in Stormwind with the ID I would pick as an example), is this still bound to the usual phasemask/phaseID limits? (At least, the Blizz-Like ones.) Sorry if I’m not getting it.

Yes, you cannot use id higher than 65535

So, I did the following in the phase table under the hotfix database:

  1. Set an ID of 83 (random number I picked), Flags set to 0.

  2. Moved, as per my example, to Stormwind, spawned a cow (npc id of 2442)

  3. Unselected the cow and entered “.mod phase 83”

My expectation was that, in this case the cow, that it would “disappear” because I’m no longer on the same phase as the NPC (which was spawned in the main phase.) However, it remained visible.

[ATTACH]2560._xfImport[/ATTACH] My player character after setting “.mod phase 83”.

[ATTACH]2561._xfImport[/ATTACH] The cow npc spawned in the main phase.

I’m assuming this is because the phaseID I picked is being considered “high” enough to see anything below? Or am I misunderstanding something again regarding how this works? :o

gms by default are on all phases.

Right, that makes sense. (Since normally they -need- to be able to on retail). Although, for my purposes, GM’s are the only “player” type on the server (that and the security level 3 Admins), so that’ll impede what I’m looking to do. XD

Sifting through Player.cpp, I see that PhaseHandler has a “SetAlwaysVisible” function that’s set to true and false depending on if the player turned on GM mode, but I don’t think merely switching that true statement to a false would actually do what I’d want to do (It sounds more like that after compiling, GM’s wouldn’t be visible at -all- if I went with that change.)

Would the “in all phases by default” condition for GM’s and Admin’s have to do with RBAC permissions?

No, SetAlwaysVisible was right on point, that basically makes you ignore phasing (you see all phases and objects in all phases see you)

Yeah, so after recompiling the solution with the swapped SetAlwaysVisible true statement to false, worldserver still seems to believe I’m capable of seeing everything.

I guess I should probably explain what I’m actually trying to attempt doing (and should have said so from the start because it would better help you or anyone else help me better XD )


I’m trying to remake “.mod phase” work like this:

  1. Any value besides the max limit could be entered for the phaseID (This one was already solved thanks to you XP )

  2. Worked in any zone, again no matter what phaseID you used. (Ditto for this one, like the first)

  3. Properly moved you to the new phaseID, hiding everything in the main phase from you, and hiding you from anyone who wasn’t in the same phase as yourself

  4. Gameobjects and NPC’s spawned in this manner would likewise obey the previous numbered entry.


Basically, if I were to type “.mod phase 1” as an example, I should not see any anything in the main phase (which includes, but not limited to, players, game objects, npcs, etc etc) since I’m in my own, “secluded” phase. However, if I were to select someone else who -isn’t- in this new phase (such as, selecting them in my party) and typing the same “.mod phase 1”, they would also get shifted into the same phase I’m in. Likewise, the same functionality would exist for game objects and npc’s spawned and/or moved in this manner too.

I previously didn’t think to post it because I had thought this was something small that I couldn’t really piece together from looking at the source code / MySQL databases. I think I might of just made myself confused over how the process actually works server/client side.