PDA

View Full Version : [Share] XP for killing a player



Onlykl
04-07-09, 11:00 AM
This script rewards a player with XP for killing a player of the opposite faction.

I added setup.cpp & setup.h for ppls who dont know how to set it up.

Script:

/*********************************/
/* Scripted by ToAsT */
/*********************************/

#include "StdAfx.h"
#include "Setup.h"

void KillPlayer(Player *pPlayer, Player *pVictim)
{
uint32 plr_level = pPlayer->getLevel();
uint32 vic_level = pVictim->getLevel();

if( vic_level <= ( plr_level - 10 ) || vic_level >= ( 10 + plr_level) )
return;

CalculateXP(pPlayer);
}

void CalculateXP( Player * pPlayer )
{
uint32 plr_level = pPlayer->getLevel();
uint32 xp1;

if( plr_level <= 10 )
{
xp1 = 200;
}else if( plr_level <= 20 )
{
xp1 = 500;
}else if( plr_level <= 30 )
{
xp1 = 1000;
}else if( plr_level <= 40 )
{
xp1 = 1500;
}else if( plr_level <= 50 )
{
xp1 = 2000;
}else if( plr_level <= 60 )
{
xp1 = 2500;
}else if( plr_level <= 69 )
{
xp1 = 3000;
}

pPlayer->GiveXP(xp1,0,false);
}

void SetupPlayerXP(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &KillPlayer);
}


Setup.h:

#ifndef INSTANCE_SCRIPTS_SETUP_H
#define INSTANCE_SCRIPTS_SETUP_H

void SetupPlayerXP(ScriptMgr * mgr);
void CalculateXP(Player * pPlayer);

#endif
Setup.cpp:

#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)
{
SetupPlayerXP(mgr);
}

#ifdef WIN32

BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}

#endif
Credits
Toast from ArcEmu forums

mydlay
04-07-09, 11:05 AM
nice one! This is my first time running across a script that gives you exp for killing players.

Onlykl
04-07-09, 11:07 AM
Its soo old script and its perfect for PvP servers :))

mec
09-09-09, 02:52 PM
very nice

Cinnamal
20-12-09, 08:24 AM
Howdy, im a newbie at all these stuff, and i'd like someone to explain where to put this text. I will rep the one who helps me. thanks

Paradox
20-12-09, 12:06 PM
You wrote this your self? Hence it comes familiar to me.

LiLLeCarl
21-12-09, 03:13 PM
weeha but it should be a equation instead of random xp ;D

Paradox
22-12-09, 11:16 AM
Ya, quite. But still, this script comes in familiar for me.

Onlykl
23-12-09, 04:15 PM
[
Credits
Toast from ArcEmu forums

Lol What a retard read little!

kjanko
23-12-09, 04:55 PM
All you do is share retard.

Onlykl
24-12-09, 04:27 AM
E debilcino nemoj da mi jedes govna citaj malo bre mater ti jebem tvoju siptarsku!!!! Jer sam napisao da je napravio toast a ne ja mater ti nenormalnu siptarsku!!! ODJEBI BRE!!!

Dimman
24-12-09, 05:57 AM
E debilcino nemoj da mi jedes govna citaj malo bre mater ti jebem tvoju siptarsku!!!! Jer sam napisao da je napravio toast a ne ja mater ti nenormalnu siptarsku!!! ODJEBI BRE!!!

Why aren't you writing in English ?
And isn't there a lang rule (Only English) ?

Onlykl
24-12-09, 06:09 AM
Because it is for kjanko not for you!

Dimman
24-12-09, 07:12 AM
Because it is for kjanko not for you!

But you have no reason to write in that lang.

LiLLeCarl
26-12-09, 03:29 PM
Lol What a retard read little!
1 did i say that you wrote it
2 is it allowed to flame here go to ******* if you wanna do that
3 im better then you so stfu please :D

translated Onlykl's message with google translate:

E debilcino do not eat shit we read a little bre mater ti jebem your siptarsku!! Because I wrote that he made a toast does not mater ti abnormal siptarsku! BRE **** off!

Shouldnt he get a week ban?