Jump to content

Custum patch used flags PLAYER_FLAGS_XP_USER_DISABLED not worked ???


Recommended Posts

Posted

Hello all, i have make a custum patch for make twink ^^

I used this flags PLAYER_FLAGS_XP_USER_DISABLED but the xp bars disappear but we can have xp yet ...

PLAYER_FLAGS_XP_USER_DISABLED is defined here: Player.h line 520

This flag doesn't work or i have forgotten a things for make twink ?

Thanks

Posted

I make the script, small extract:

pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);

pPlayer->CLOSE_GOSSIP_MENU();

The bar of xp it's removed BUT if we go in the instance or kill mobs we win xP and level up again ...

Posted

Add this to Player.cpp:

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_XP_USER_DISABLED))
+        return;
+
    uint32 level = getLevel();

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

Regards.

Posted

and script part would look something like this

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

Posted

I'm using this:

/*######
## 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.

Posted
pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);

Is this Flag even available after re-login of the character? I thought I read somewhere that the flag was resetting after relog.

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