Jump to content

Recommended Posts

  • 42 years later...
Posted

You instead create a new integral value in the player class with a default value of 1

uint32 xprate = 1;

Then inside the void Player::GiveXP(uint32 xp, Unit* victim) function you add this: xp = xp*xprate; (in the beginning would probably be fine)

Then you create a chat command to set the players xprate value.

That should be it, if you need more help, then reply here again! And remember, the goal is to learn!

Posted

In order to set the xprate value through a command will a table be needed?

Also, where should the uint32 xprate =1; go?

I tried adding xp = xp*kill_xp_rate; while keeping the code from the link above and it didn't work.

Posted

uint32 xprate = 1; should be in the player.cpp file inside here:

Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m_reputationMgr(this)

{

And what we are doing atm, is writing our own xp rate system, do you want this to save to the database or just be modified by a command?

Posted

Ok, done that. Now how do I make it so each person can set their own xp rate without using a DB?

Maybe have this when player uses command?

player->SetUInt32Value(xprate, 2);

I don't know how to code it properly, though. ;P

What do you suggest? :)

Guest
This topic is now 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