currently making...
EDIT: Done!!!
PM me if there any problems
BlackBoyPVP.cpp:
Code:
/*
Author: Pragma
For: BlackBoy0
*/
#include "StdAfx.h"
#include "Setup.h"
#define TOKENID 12345 //token ID
void BBPVP(Player * pPlayer, Player * pVictim)
{
uint32 aLvl, vLvl;
uint32 high, low;
Item * pItem = objmgr.CreateItem(TOKENID, pPlayer);
aLvl = pPlayer->getLevel();
vLvl = pVictim->getLevel();
if((aLvl >= vLvl))
{
high = aLvl;
low = vLvl;
}
else
{
high = vLvl;
low = aLvl;
}
if(aLvl <= 79)
{
pPlayer->GetItemInterface()->AddItemToFreeSlot(pItem);
}
else if(aLvl == 80)
{
pPlayer->GetItemInterface()->AddItemToFreeSlot(pItem);
pPlayer->GetItemInterface()->AddItemToFreeSlot(pItem);
}
if((high - low) <= 10) //if the level difference between the two players is 10 or less
{
pPlayer->BroadcastMessage("Whisper message here"); //message sent to the killer
pVictim->BroadcastMessage("Whisper message here"); //message sent to the victim
}
else //if the level difference is greater than 10
{
pPlayer->BroadcastMessage("Whisper message here"); //message sent to the killer
pVictim->BroadcastMessage("Whisper message here"); //message sent to the victim
}
}
void SetupBlackBoyPVP(ScriptMgr * mgr)
{
sLog.outString("BlackBoyPVP V1.0 Started!");
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &BBPVP);
}
Setup.cpp:
Code:
#include "StdAfx.h"
#include "Setup.h"
#define SKIP_ALLOCATOR_SHARING 1
#include <ScriptSetup.h>
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupBlackBoyPVP(mgr);
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Setup.h:
Code:
void BBPVP(Player * pPlayer, Player * pVictim);
void SetupBlackBoyPVP(ScriptMgr * mgr);