Step 1: Familiarize Yourself With Phasing
So what is phasing? Phasing is what happens on retail servers when you complete a certain quest and the zone changes on you, or new creatures spawn and old ones disappear etc. and no one but you and others in your phase can see it. (ZOMG RELE?! NO WA1?!1)
Step 2: The Phasing Commands
:PhaseSet(#, 1) <-- the 1 is an optional argument and makes it permanent. Does not work with players. This sets the phase of the object.
:PhaseAdd(#, 1) <-- this makes the object part of another phase. Use this to add multiple phases to an object.
:PhaseDelete(#, 1) <-- Deletes the phase number from the unit and 1 is the same as above.
:GetPhase() <-- Returns the current phase the unit is in
This commands can be used to phase Units, Objects, and Players all alike.
Step 3: How it Works
Now let me explain how phasing works. It works in exponential increases. Essentially you double the base value. What the hell are you talking about Mr. Storm? What I am talking about Timmy is the phase ID which i so graciously named them. Everyone starts in Phase 1 by default. Then we can go into phase 2 by doing 1 + 1 = 2. Then we can go into phase 3 by doing 2+2 = 4, then phase 4 by doing 4+4 = 8. And it continues in that method. 8 + 8 = 16 (which is phase 5) etc.
Step 4: What Happens in a Phase
All objects can be phased, this means, units, creatures, npcs, gameobjects, etc. Hell the clever ones like myself /flex can even script and item that can only be used while in a certain phase Tongue. When in a phase everything around you disappears and you only see what is in that phase. So lets say for example you have an alter that is in phase 2. You as a player are in phase 1. You cannot see that alter. So lets talk to the phase master NPC and tell him to set ur phase to two. You will vanish from the phase you are in, and appear in phase two and can see the alter.
Say you were with your group mate and they didn't like talking to strangers so they didn't talk to the nice phase NPC. Well your group mate will see you disappear and you will no longer see him. Pretty neat huh?
Now phases are set by default to reset to normal after logout ON PLAYERS ONLY. In order to phase a player permanently you have to run a DataBaseQuery using the CharDBQuery and set it in the database. (That is more advanced I am giving you basics).
Step 5: Adding Phases Together
So how can we do this and why does it sound confusing. Well it is actually VERY confusing. I don't like to sugar coat things. But this part sucks. So lets say we have a player in phase 5. Now remember what i said above, everything is in phase 1 by default right. And remember that you cannot see anything that is not in your phase nor can they see you.
"So does that mean I can't see Candy Mountain Charlie??"
"Well if Candy Mountain is in Phase 5 and you are in phase 1 then no, you can't see it.."
BUT
We can combine phase 5 and phase 1's phase values which are respectfully 1 and 16. All I mean by phase value is those base numbers i mentioned above like 1 + 1, 2 + 2, 3 + 3, etc. and that means that whatever is in those two phases can be seen and can see you. So yes maybe you can get to see Candy Mountain afterall Cheesy.
Be wary though. Lets say you are in phase 1 your partner is in phase 5 (or Phase Value 16), and some other guy is in a combination of those phases well then, the guy in the combination phase can see both of you. However the guys in phase 1 cannot see the one in phase 5 and the one in phase 5 cannot see the one in phase 1, BUT they can both see you and you can see BOTH of them. OMFG! PARADOX!!!!
Step 6: Conclusion
Phasing sucks and is difficult to manage, however if you master it just think of the possibilities. It is also up to you the scripter to remember to take your players or objects out of the phase if that is your intention. I don't think you will have many happy campers who are stuck in phase 5 and cannot see ANYTHING other then whatever is phased to phase 5. You can do that to some of those pesty hackers though Wink Let them have fun in there own little phased world. It won't hurt you and no one can see them Tongue
credits!
halestorm 99,5% for making the guide!
me 0,5% for sharing