Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Contributor
    Onlykl's Avatar
    Join Date
    Jan 2009
    Location
    127.0.0.1
    Posts
    247
    Post Thanks / Like
    Rep Power
    19
    Reputation
    244

    [Share] XP for killing a player


    Register to remove this ad
    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:
    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
    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)
    {
        SetupPlayerXP(mgr);
    }
    
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif
    Credits
    Toast from ArcEmu forums




    › See More: [Share] XP for killing a player



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Head of Musara-Network
    mydlay's Avatar
    Join Date
    Jul 2009
    Location
    USA
    Posts
    22
    Post Thanks / Like
    Rep Power
    16
    Reputation
    17
    nice one! This is my first time running across a script that gives you exp for killing players.

  4. #3
    Contributor
    Onlykl's Avatar
    Join Date
    Jan 2009
    Location
    127.0.0.1
    Posts
    247
    Post Thanks / Like
    Rep Power
    19
    Reputation
    244
    Its soo old script and its perfect for PvP servers )

  5. #4
    Banned

    Join Date
    Sep 2009
    Location
    In My Computer
    Posts
    76
    Post Thanks / Like
    Rep Power
    0
    Reputation
    52
    very nice

  6. #5
    Beginner

    Join Date
    Dec 2009
    Posts
    2
    Post Thanks / Like
    Rep Power
    15
    Reputation
    1
    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

  7. #6
    Sergeant
    Paradox's Avatar
    Join Date
    Jul 2009
    Posts
    71
    Post Thanks / Like
    Rep Power
    16
    Reputation
    26
    You wrote this your self? Hence it comes familiar to me.

  8. #7
    Contributor
    LiLLeCarl's Avatar
    Join Date
    Jan 2009
    Posts
    106
    Post Thanks / Like
    Rep Power
    17
    Reputation
    84
    weeha but it should be a equation instead of random xp ;D
    Whos dat "LilleCarl"

    Its LilleCarl OMGBBQLOLZXD

  9. #8
    Sergeant
    Paradox's Avatar
    Join Date
    Jul 2009
    Posts
    71
    Post Thanks / Like
    Rep Power
    16
    Reputation
    26
    Ya, quite. But still, this script comes in familiar for me.

  10. #9
    Contributor
    Onlykl's Avatar
    Join Date
    Jan 2009
    Location
    127.0.0.1
    Posts
    247
    Post Thanks / Like
    Rep Power
    19
    Reputation
    244
    Quote Originally Posted by Onlykl View Post
    [
    Credits
    Toast from ArcEmu forums
    Lol What a retard read little!

  11. #10
    Sergeant

    Join Date
    Nov 2009
    Posts
    75
    Post Thanks / Like
    Rep Power
    15
    Reputation
    44

    Register to remove this ad
    All you do is share retard.

 

 
Page 1 of 2 12 LastLast

Visitors found this page by searching for:

traduire odjebi bre

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 06:50 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org