This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Heliocratic

Pages: [1]
1
Serverside Modding / Re: [QUESTION] C++ Question SetPhaseMask
« on: November 30, 2014, 09:49:40 am »
Hi, I haven't worked on TrinityCore for 3 months now, but I'll give you a definite answer. I worked on a creature deathsystem, on the technical side I decided to phase all the creatures instead of kill/delete them from the DB, to avoid abuse. So I messed with phasing and found that your solution is right but only works untill the next server restart because you're changing the phase of a creature in memory only, not through the Database.

Code: [Select]
void OnPlayerEnter(Player* player) OVERRIDE
{
if player->HasSpell(95000)
Creature* temp = instance->GetCreature(CreatureGUID);
temp -> SetPhaseMask(x01, false);
}

Like I said, this is only a temporary solution, if you want to permanently add a NPC to a phase then this little snippet of code is required.

Code: [Select]
killed->SetPhaseMask(8, true); //Put NPC in phase 8
WorldDatabase.PExecute("UPDATE creature SET phaseMask = 8 WHERE guid = %u;", killed->GetGUIDLow()); // Update the database to set the creature's phase mask.

I've tested this snippet and it works.

So, here is your slightly corrected code,
Code: [Select]
void OnPlayerEnter(Player* player)
{
if (player->HasSpell(95000))
Creature* temp = instance->GetCreature(CreatureGUIDLow);
temp -> SetPhaseMask(1, true);
WorldDatabase.PExecute("UPDATE creature SET phaseMask = 1 WHERE guid = %u;", killed->GetGUIDLow());
}

Again, the executing to database is if you want to make the NPC stay there permanently, just remove the SQL line if you want the NPC to be temporary.

2
If you want to go another route, you could just remove the control button in the interface's LUA. LUA is techincally easier to learn than C++

3
I've done this before on Trinitycore 3.3.5a, I don't know if you're using Trinitycore 3.3.5a or not, so I'll just explain what I did.

I edited StableSlotPrices.dbc, and I figured out that editing the client side .DBC is not enough, you need to update your server-side .DBCs as well. Or else if you just edit the client side, it will only visually change the price but not actually change it server-side. So remember to update your server-side .DBCs

4
There are .DBCs within the server core itself, it should be in the same folder as your V-maps and such.

The serverside .DBC you may need to edit to get the string server to change is....Startup_Strings.dbc!

If you've already tried this, then don't mind me.

5
Resources and Tools / Re: [C++] LightAdder
« on: April 09, 2014, 08:23:24 am »
I'm going to try this out and tell you if I used/implemented everything right. I was bummed out when I got Milly's darker nights to find out torches don't actually produce light on their own. Now I have the power to change that, thanks.

6
Resources and Tools / Re: [RELEASE] Darker Nights 4.3.4 (+3.3.5)
« on: April 09, 2014, 08:18:39 am »
I tried this in 3.3.5, works like a charm. Truly thanks, Milly. I implemented this on my server, Aevum-WoW. Its an RP server and they love it. I have credited you for the darker nights within my own forum patch notes.

Pages: [1]