Likes: 0
Results 1 to 10 of 15
Thread: [Share] XP for killing a player
-
04-07-09, 12:00 PM #1
[Share] XP for killing a player
Register to remove this adThis 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:
Code:/*********************************/ /* 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:
Code:#ifndef INSTANCE_SCRIPTS_SETUP_H #define INSTANCE_SCRIPTS_SETUP_H void SetupPlayerXP(ScriptMgr * mgr); void CalculateXP(Player * pPlayer); #endif
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) { SetupPlayerXP(mgr); } #ifdef WIN32 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } #endif
Toast from ArcEmu forums
› See More: [Share] XP for killing a player
-
04-07-09, 12:05 PM #2
nice one! This is my first time running across a script that gives you exp for killing players.
-
04-07-09, 12:07 PM #3
-
09-09-09, 03:52 PM #4
- Rep Power
- 0
- Reputation
- 52
very nice
-
20-12-09, 09:24 AM #5
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
-
20-12-09, 01:06 PM #6
You wrote this your self? Hence it comes familiar to me.
-
21-12-09, 04:13 PM #7
weeha but it should be a equation instead of random xp ;D
Whos dat "LilleCarl"
Its LilleCarl OMGBBQLOLZXD
-
22-12-09, 12:16 PM #8
Ya, quite. But still, this script comes in familiar for me.
-
23-12-09, 05:15 PM #9
-
23-12-09, 05:55 PM #10
Register to remove this adAll you do is share retard.