Aller au contenu

Nouveau membre ?! Pense à te présenter pour accéder au contenu du forum !

New member ?! Introduce yourself to get access to the forum !

Messages recommandés

Hello

 

Today, I am going to share a system of blocking and unlocking experience.

 

Search this in : char.cpp

               if (gPlayerMaxLevel <= GetLevel())
                  return;

Add under : 

               if (block_exp && amount > 0)
               {
                  return;
               

Save and close : char.cpp

 

Open and search this in : char.h

void         SetExp(DWORD exp)   { m_points.exp = exp;   }

Add under : 

      bool         block_exp;

Save and close : char.h

 

Open and search this in : questlua_pc.cpp

{ "give_award_socket",   pc_give_award_socket   },

Add under : 

         { "block_exp",         _block_exp },
         { "unblock_exp",      _unblock_exp },

Search in the same file : 

void RegisterPCFunctionTable()

Add under : 

   int _block_exp(lua_State* L)

   {
      LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
      ch->block_exp = true;
      return 0;
   }
   int _unblock_exp(lua_State* L)
   {
      LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
      ch->block_exp = false;
      return 0;
   }

Save and close : questlua_pc.cpp

 

Open and search this in : input_login.cpp

      if (g_bCheckClientVersion)
      {

Replace like this : 

		if (g_bCheckClientVersion)
		{
			ch->block_exp = false;
			int version = atoi(g_stClientVersion.c_str());
			int date = atoi(d->GetClientVersion());

Save and close : input_login.cpp

 

Open and search this in : guild.cpp

bool CGuild::OfferExp(LPCHARACTER ch, int amount)

Add under  :

if (ch->block_exp == true)
            return false;

Save and close : guild.cpp

 

Finally we can compile the game source !

 

In your folder quest in file : quest_function

 

Add : 

pc.block_exp
pc.unblock_exp

Quest : 

quest block_exp begin
    state start begin
        when login begin
            if pc.getqf("antiexp") == 1 then
                pc.block_exp()
                chat("Reminder: Check if your ring is blocking or unlocking.")
            end
        end
        when ITEMVNUM.use begin
            if pc.getqf("antiexp") == 0 then
                pc.block_exp()
                pc.setqf("antiexp", 1)
                chat("Experience blocking has been activated")
            elseif pc.getqf("antiexp") == 1 then
                pc.unblock_exp()
                pc.setqf("antiexp", 0)
                chat("The experience lock has been disabled.")
            end
        end
    end
end

 

If you have any problem with this topic, I invite you to create a help request in the support section.

Modifié par Reaper

Partager ce message


Lien à poster
Partager sur d’autres sites

×

Information importante

By using this site, you agree to our Conditions d’utilisation.