• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Trinity C++][Core Modification] Make a zone Sanctuary

Synth

Exalted Member
Hello Emudevs,today i'm going to share a simple core modifications to make your own zone a Sanctuary made by Madness.

Script info:
●Allow dueling in the specified zone.
●Disables PvP between factions.

Script:
Open Player.cpp - You can find it here: src/server/game/Entities/Player
Find line 7636
That is the line
if (area && area->IsSanctuary()) // in sanctuary
Replace with - NEW=COLOR
if (area && area->IsSanctuary() || GetAreaId() == 100) // Replace the 100 with your area ID

Just change the 100 to whatever area ID you wish to use. (Use .gps in the area you wish to make a sanctuary and replace it with the ID above).

If you have any question feel free to ask me!
Thank you!
Best regards,
Synth !
 

Tommy

Founder
Nice!

Only thing I'm concerned about it will it show "Sanctuary" after doing this? I doubt it considering that might need a value change in the DBC. :/
 

Synth

Exalted Member
Nice!

Only thing I'm concerned about it will it show "Sanctuary" after doing this? I doubt it considering that might need a value change in the DBC. :/
Thank you :),well i have a problem with DBC when i change the value for i disable PvP + Duel on a zone don't work,that's why i didn't make it via DBC cz i don't know if it works or no,this own i tested and its working perfectly.
I try this value on field 4:19496
 

callmephil

Respected Member
Thank you :),well i have a problem with DBC when i change the value for i disable PvP + Duel on a zone don't work,that's why i didn't make it via DBC cz i don't know if it works or no,this own i tested and its working perfectly.
I try this value on field 4:19496

It's Because there is TWO Sanctuary id in dbc, One for Shattrath/Dalaran and the "Duel Zone" Under-dalaran this one will not allow you to PvP just to do duels.
 

Lstm

Respected Member
Can I add more than 1 area?
Example: if (area && area->IsSanctuary() || GetAreaId() == area1, area2, area3, area4, etc...) // Replace the 100 with your area ID
 

Zero

Noble Member
Can I add more than 1 area?
Example: if (area && area->IsSanctuary() || GetAreaId() == area1, area2, area3, area4, etc...) // Replace the 100 with your area ID

Yes, but not like that. You'll have to add each expression with a new operator. Although it's probably best to define a set of integers if you're going to do a lot of areas though.

Honestly it's a lot quicker and easier to do it via DBC. Edit the area flags in AreaTable.dbc and restart your server, cuts a 10~ minute recompile down to a 30 second restart.
Here's everything you need to know: http://collab.kpsn.org/display/tc/AreaTable
You can enable duels or disable them as you please as well. The sanctuary change will be in effect, but it won't show the blue area text client side unless they've got the same DBC file in a patch, but it'll still disable it nonetheless.
 
Last edited:

Lstm

Respected Member
Yes but my idea is to add in at least a 5 worldserver.conf areas so I can change whenever you want :)
 
Can I add more than 1 area?
Example: if (area && area->IsSanctuary() || GetAreaId() == area1, area2, area3, area4, etc...) // Replace the 100 with your area ID

You can do this :

if (area && area->IsSanctuary() || GetAreaId() == area1 || GetAreaId() == area2 || GetAreaId() == area3 || GetAreaId() == area4)

when you use " || " means "OR" , 1° check "OR" 2° check "OR" 3° check ... etc...
 
Last edited:

Abundant

Enthusiast
Nevermind,

This does work I was placing the function in the wrong area.

Thanks Again bud. :)
 
Last edited:

reng1

Emulation Addict
it works, but for some reason it disables pvp in the whole eastern kingdoms if i use a area in it somewhere. but pvp works in kalimdor..

any clue to make it disable just one area?
 

Jafferwaffer

Exalted Member
Sounds like you've used the wrong Area ID, could be you used the area ID for whole of Eastern kingdoms (which i think is 1?)

If you are still having trouble and want to do this manually then PM, Email me
 
Top