Jump to content
  • 0

help rewite this script so i can use it.


rullare

Question

hi all srry if u feel that i ask to mutch^^ i want to help me self but i don't know amy c++ so i can't write anything:(

i find this code and i get intrested in it^^

#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);

i need it for mangos 1.12.1 2.4.3 amd trinity core 3.3.5, maybe i can go amngos for 3.3.5 too but yea^^

are there anyway of makeing it better if so i want to learn. but i think its not that easy^^

thx for all help i can get^^

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

I'd suggest you start taking tutorials online of C++. everything in the core is C++. for starters, where did you get this? those header files don't look familiar at all so it's probably not even for mangos.

Whatever core this belongs to, it's giving XP for killing a player. However it makes no call for Player header files in mangos.

Link to comment
Share on other sites

ok. but that i want are a script thats give me xp when i kill players. so u can kill both players and mobs to get xp.

i get this script from oregon core 2.4.3 so u right no mangos but i want it for mangos^^

if its easyer to rewrite a script ok how do i do that then^^?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use