Just a small onkill script :>
PvP.cpp
Code:
//Coded by WaRxHeAd
#include "Setup.h"
#include "StdAfx.h"
void SetupPvPSystem(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &OnKillPlayer);
}
void OnKillPlayer(Player * pPlayer, Player * pVictim)
{
if(pPlayer == pVictim) /*What a looooooser :) */
return;
pPlayer->ModUInt32Value(PLAYER_FIELD_COINAGE, 100000);
pPlayer->BroadcastMessage("You have killed %s and earned 10 gold.", pVictim->GetName());
std::stringstream msg;
msg << pVictim->GetName();
msg << " has been maimed, and disfigured by: ";
msg << pPlayer->GetName();
sWorld.SendWorldWideScreenText(msg.str().c_str());
pVictim->ModUInt32Value(PLAYER_FIELD_COINAGE, 30000);
pVictim->BroadcastMessage("You have been raped by %s and gained 3 gold because of your high spirits.", pPlayer->GetName());
}
Setup.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupPvPSystem(mgr);
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Setup.h
Code:
#include "StdAfx.h"
void SetupPvPSystem(ScriptMgr * mgr);
void OnKillPlayer(Player * pPlayer, Player * pVictim);
I did not copy and paste this, I did not steal anyone's work.
Enjoy.