EzMaN
03-01-10, 10:18 PM
I know some players were looking for something like this, (its actually on our AUDB SVN Project :P )
This will simply kick players when they kill another player in a non pvp zone. You can actually modify this so that it can kick as soon as a players PVP Flag goes active.
/* Modified Script of AntiPvP script for Banned Zones */
/* Original Author Unknown */
/* Modified By WHOS / Tekkeryole */
/* Coded for Aspire HearthStone */
/* Compatible with r1080+ */
#include "StdAfx.h"
#include "Setup.h"
#define MALL_ZONES 2
static uint32 MallZones[MALL_ZONES] = {394, 0};
void EventKillHandler(PlayerPointer pPlr, PlayerPointer pVictim)
{
AreaTable * at = dbcArea.LookupEntry(pPlr->GetMapMgr()->GetAreaID(pPlr->GetPositionX(), pPlr->GetPositionY()));
for(uint32 i = 0; i < MALL_ZONES; i++)
{
if( at && at->ZoneId == MallZones[i] )
{
char onkick[1024];
snprintf((char*)onkick, 1024, "%s was kicked from the server for PvPing in the mall.", pPlr->GetName());
sWorld.SendWorldText(onkick);
pPlr->BroadcastMessage("You were kicked for PvPing in the mall.");
pPlr->Kick(5000);
return;
}
}
}
void SetupAntiPvPAtMall(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &EventKillHandler);
}
##EDIT##
Arc Emu Users use this script:
/* Modified Script of AntiPvP script for Banned Zones */
/* Original Author Unknown */
/* Modified By WHOS / Tekkeryole */
/* Coded for Arc Emu */
/* Compatible with latest Revisions */
#include "StdAfx.h"
#include "Setup.h"
#define MALL_ZONES 2
static uint32 MallZones[MALL_ZONES] = {394, 0};
void EventKillHandler(Player* pPlr, Player* pVictim)
{
AreaTable * at = dbcArea.LookupEntry(pPlr->GetMapMgr()->GetAreaID(pPlr->GetPositionX(), pPlr->GetPositionY()));
for(uint32 i = 0; i < MALL_ZONES; i++)
{
if( at && at->ZoneId == MallZones[i] )
{
char onkick[1024];
snprintf((char*)onkick, 1024, "%s was kicked from the server for PvPing in the mall.", pPlr->GetName());
sWorld.SendWorldText(onkick);
pPlr->BroadcastMessage("You were kicked for PvPing in the mall.");
pPlr->Kick(5000);
return;
}
}
}
void SetupAntiPvPAtMall(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &EventKillHandler);
}
credits to tekkeryole
This will simply kick players when they kill another player in a non pvp zone. You can actually modify this so that it can kick as soon as a players PVP Flag goes active.
/* Modified Script of AntiPvP script for Banned Zones */
/* Original Author Unknown */
/* Modified By WHOS / Tekkeryole */
/* Coded for Aspire HearthStone */
/* Compatible with r1080+ */
#include "StdAfx.h"
#include "Setup.h"
#define MALL_ZONES 2
static uint32 MallZones[MALL_ZONES] = {394, 0};
void EventKillHandler(PlayerPointer pPlr, PlayerPointer pVictim)
{
AreaTable * at = dbcArea.LookupEntry(pPlr->GetMapMgr()->GetAreaID(pPlr->GetPositionX(), pPlr->GetPositionY()));
for(uint32 i = 0; i < MALL_ZONES; i++)
{
if( at && at->ZoneId == MallZones[i] )
{
char onkick[1024];
snprintf((char*)onkick, 1024, "%s was kicked from the server for PvPing in the mall.", pPlr->GetName());
sWorld.SendWorldText(onkick);
pPlr->BroadcastMessage("You were kicked for PvPing in the mall.");
pPlr->Kick(5000);
return;
}
}
}
void SetupAntiPvPAtMall(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &EventKillHandler);
}
##EDIT##
Arc Emu Users use this script:
/* Modified Script of AntiPvP script for Banned Zones */
/* Original Author Unknown */
/* Modified By WHOS / Tekkeryole */
/* Coded for Arc Emu */
/* Compatible with latest Revisions */
#include "StdAfx.h"
#include "Setup.h"
#define MALL_ZONES 2
static uint32 MallZones[MALL_ZONES] = {394, 0};
void EventKillHandler(Player* pPlr, Player* pVictim)
{
AreaTable * at = dbcArea.LookupEntry(pPlr->GetMapMgr()->GetAreaID(pPlr->GetPositionX(), pPlr->GetPositionY()));
for(uint32 i = 0; i < MALL_ZONES; i++)
{
if( at && at->ZoneId == MallZones[i] )
{
char onkick[1024];
snprintf((char*)onkick, 1024, "%s was kicked from the server for PvPing in the mall.", pPlr->GetName());
sWorld.SendWorldText(onkick);
pPlr->BroadcastMessage("You were kicked for PvPing in the mall.");
pPlr->Kick(5000);
return;
}
}
}
void SetupAntiPvPAtMall(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &EventKillHandler);
}
credits to tekkeryole