Jump to content

[C++/lua] Anti EXP Ring


xkillmt2
 Share

Recommended Posts

Guia de instalação:

Primeiro, abra o char.h e procure:

SetExp(DWORD exp)

Adicione abaixo:

bool            block_exp;

Agora, abra o char.cpp e procure:

case POINT_EXP: {

Adicione abaixo:

if (block_exp)
    return;

Agora abra o questlua_pc.cpp e procure:

{ "give_award_socket",      pc_give_award_socket      },

Adicione abaixo:

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

Ainda em questlua_pc.cpp procure por:

void RegisterPCFunctionTable()

Adicione acima:

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;
}

Agora você abre input_login.cpp e procure:

ch->SendGreetMessage();

Adicione acima:

ch->block_exp = false;


Tudo está pronto no jogo agora.
Agora você pode compilar a source.

No arquivo quest_functions você deve inserir as seguintes novas funções:

pc.block_exp
pc.unblock_exp

Exemplo Quest:

quest antiexp begin
    state start begin
        when login begin
            if pc.getqf("antiexp") == 1 then
                pc.block_exp()
                chat("Anti EXP ainda está ativado.")
            end
        end
        when ITEMVNUM.use begin
            if pc.getqf("antiexp") == 0 then
                pc.block_exp()
                pc.setqf("antiexp", 1)
                chat("O Anti EXP foi ativado.")
            elseif pc.getqf("antiexp") == 1 then
                pc.unblock_exp()
                pc.setqf("antiexp", 0)
                chat("O Anti EXP foi desabilitado.")
            end
        end
    end
end

 

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

  • 4 years later...

Quando bloqueiam a EXP ela não vai para lado nenhum. Um amigo meu, pediu-me para lhe fazer uma forma de "guardar" a EXP que era desperdiçada quando se bloqueia a mesma. 

Aqui fica a solução:

 

 

#### Quest

Spoiler
		when 40004.use begin
			say("Spend EXP?")
			if (select("Yes", "No") == 1) then
				pc.give_exp2(item.get_socket(0))
				item.set_socket(0, 0)
				item.remove()
			end
		end


---- Esta quest precisa algumas modificações. Entre elas a verificação se podem receber a experiencia ou não. Por isso serve apenas para indicar o caminho

 

#### Bin/root/uitooltip.py

Spoiler
// Search:
		
		elif item.ITEM_TYPE_QUEST == itemType:
			for i in xrange(item.LIMIT_MAX_NUM):
				(limitType, limitValue) = item.GetLimit(i)

				if item.LIMIT_REAL_TIME == limitType:
					self.AppendMallItemLastTime(metinSlot[0])
					

// Add after:
			
			if itemVnum == 40004:
				self.AppendSpace(5)
				if metinSlot[0] != 0:
					self.AppendDescription("Experiência: %s " % metinSlot[0] , 26, self.CONDITION_COLOR)
				else:
					self.AppendDescription("Sem Experiência" , 26, self.CONDITION_COLOR)

 

#### Src/game/char.cpp 

Spoiler
//Search:
					if (block_exp) {
						return;
					}

//Replace with:
					
					if (block_exp && amount > 0) 
					{
						LPITEM item = FindSpecifyItem(40004); //	<-- if need change item 40004 for other one
						if (NULL != item && item->GetSocket(0) < 2100000000){	// <-- 2100000000 limite maximo de EXP a guardar
							item->SetSocket(0, item->GetSocket(0)+amount);
							if (item->GetSocket(0) > 2100000000)
								item->SetSocket(0, 2100000000);
						} 
						return;
					}
                          
                          

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...