You could also do this in c++ Very Easily
Code:
#include "StdAfx.h"
#include "Setup.h"
void PvPDisableAtMall(PlayerPointer Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
{
/*
Comment One or The Other - One can set the map ID or One Can set the Zone ID - Example
if (Plr->GetMapId() == 44) = Turns Off PvP Flag when The Enter Map ID 44 ( Unused Monestary Instance )
if (Plr->GetZoneId() == 394) = Turns Off PvP on Zone ID 394 ( Some Random Town Area in Grizzly Hills )
Now that you see how to do this, you can also Add more zones to your "Disabled Areas" that you wish PvP
to Disable on entry to save players from being ganked when exiting BG's or coming from other contested areas
In the Future I may write this one out so that it disables pvp on entry of every new map, its really
annoying when you enter an instance and certain things don't work because you are flagged for pvp
Adding This to every map or zone possible with GM Checks can also be a good way to shut off pvp flags
for Game Masters ^QQ^
NOTE: PvP Can Still Be Enabled once you are in the map or zone, this only turns off your pvp flag
On Map or Zone Entry
TO DO: Figure out a constant call to have the script check every second if players are flagged and to disable
*/
/* EXAMPLE FOR ADDED MAPS / ZONES */
/*
// Random Map and Zone ID's used for Examples
if (Plr->GetGetMapId() == 44)
{
if (Plr->GetMapId() == 571)
{
if (Plr->GetZoneId() == 396)
{
if (Plr->GetZoneId() == 1457)
{
*/
//if (Plr->GetMapId() == 169)
if (Plr->GetZoneId() == 394)
{
if (Plr->IsPvPFlagged())
{
Plr->StopPvPTimer();
Plr->RemovePvPFlag();
/*
This Message is sent to the player on map / zone entry
*/
sChatHandler.SystemMessage(Plr->GetSession(), "PvP is Disabled Here");
/*
This Message Is sent to the Console Like So-
"Server: Kalan Has Entered A Non PVP Area"
*/
char msg[256];
sprintf(msg, "%s", Plr->GetName());
sprintf(msg, "%s Has Entered A Non PVP Area", msg);
Log.Notice("Server", msg);
}
}
}
void SetupPvPDisableAtMall(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_WORLD, (void*)&PvPDisableAtMall);
}
Not Mine I found it but its pretty easy to understand and somewhat easier then editiny mpqs credits go to tekkeryole on ac web for this
But good guide non the less