Jump to content

[patch] PLAYER_FLAGS_NO_XP_GAIN


Auntie Mangos
 Share

Recommended Posts

  • 39 years later...

So, patch 3.2 added a new feature into the game: turning off all experience gains. This is done through the flag PLAYER_FLAGS_NO_XP_GAIN. It removes exp bar from the UI and prevents player from gaining experience.

Here is the implementation of this nice feature:

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e818df5..5caeb02 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2399,6 +2399,9 @@ void Player::GiveXP(uint32 xp, Unit* victim)
    if(!isAlive())
        return;

+    if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
+        return;
+
    uint32 level = getLevel();

    // XP to money conversion processed in Player::RewardQuest

(pastebin)

If you want to really test it, you need a patch for scriptdev: http://paste2.org/p/497061 (Note: text data is not blizz-like, I play on ru realms on offy)

An SQL update:

UPDATE creature_template SET ScriptName = "npc_experience_eliminator" WHERE entry IN (35365, 35364);

And you need to spawn one of NPCs, 35365 or 35364.

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

I think you don't earn experience for anything, and also you don't earn extra money for experience. A friend that plays on ofi tells me that. I read in the release notes of the patch that this is principally for not gain experience on battlegrounds but this feature is not implemented yet on mangos isn't it?

Link to comment
Share on other sites

For implemetion, propertly implemention to be sure, need know some things.

For example what with max level characters that get gold for not received xp.

Is they still get gold with option

More low -level characters just not get XP or maybe also start get gold?

for quest only as max level?

A very interesting note, never though about that.

Just tested it myself, turned off exp receiving and completed a daily quest which normally gives 13.23g at 80. In quest log I could read that I would receive 13.23g, and so I got standard 13.23 gold after completing that quest.

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
  • 1 month later...

I'm using this:

(place it into npcs_special or whereever you want)

/*######
## npc_experience_eliminator
+######*/

#define GOSSIP_ITEM_STOP_XP_GAIN "I don't want to gain experience anymore."
#define GOSSIP_CONFIRM_STOP_XP_GAIN "Are you sure you want to stop gaining experience?"
#define GOSSIP_ITEM_START_XP_GAIN "I want to be able to gain experience again."
#define GOSSIP_CONFIRM_START_XP_GAIN "Are you sure you want to be able to gain experience once again?"

bool GossipHello_npc_experience_eliminator(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM_EXTENDED(
GOSSIP_ICON_CHAT,
pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED) ? GOSSIP_ITEM_START_XP_GAIN : GOSSIP_ITEM_STOP_XP_GAIN,
GOSSIP_SENDER_MAIN,
GOSSIP_ACTION_INFO_DEF+1,
pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED) ? GOSSIP_CONFIRM_START_XP_GAIN : GOSSIP_CONFIRM_STOP_XP_GAIN,
100000,
false
);

pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}

bool GossipSelect_npc_experience_eliminator(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if(uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
// cheater(?) passed through client limitations
if(pPlayer->GetMoney() < 100000)
return true;

pPlayer->ModifyMoney(-100000);

if(pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED))
pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
else
pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);

pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
newscript = new Script;
newscript->Name = "npc_experience_eliminator";
newscript->pGossipHello = &GossipHello_npc_experience_eliminator;
newscript->pGossipSelect = &GossipSelect_npc_experience_eliminator;
newscript->RegisterSelf();

For ScriptDev2 (Original by LordJZ) and this for core:

if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED))
return;

and it's working for me

Note: The Original SD2 script isn't valid, use this, it has some compilation errors fixed. The sql of first post remains valid.

Link to comment
Share on other sites

@Edder: I just tried the script with the modifications that Ankso suggested. Unfortunately the script won't work after relogging. It works fine, until you log out and login again. You will have to pay another 10g in order to 'freeze' your xp.

Link to comment
Share on other sites

@Edder: I just tried the script with the modifications that Ankso suggested. Unfortunately the script won't work after relogging. It works fine, until you log out and login again. You will have to pay another 10g in order to 'freeze' your xp.

For me, it works after relogin...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • 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