Ir para conteúdo
  • Cadastre-se

preciso de correçao do Npc.cpp alguem ?,o meu veio com bug do elfbot


Posts Recomendados

Na linha 1838 existe essa expressão:

		if(NpcState* npcState = getState(player, true))
		{
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

Troque para isso:

		if(NpcState* npcState = getState(player, true))
		{
			if(amount <= 0)
			{
				amount = 1;
			}			
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

Espero ter ajudado.

Link para o post
Compartilhar em outros sites

Na linha 1838 existe essa expressão:

		if(NpcState* npcState = getState(player, true))
		{
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

Troque para isso:

		if(NpcState* npcState = getState(player, true))
		{
			if(amount <= 0)
			{
				amount = 1;
			}			
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

Espero ter ajudado.

porque nao fez pra min huehue :P indo testa

 

Deu os seguinte erro na compilaçao

Compiler: Default compiler
Building Makefile: "C:\Users\Weverton\Downloads\PField Pro\Server Sources\dev-cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Users\Weverton\Downloads\PField Pro\Server Sources\dev-cpp\Makefile.win" all
g++.exe -c ../npc.cpp -o obj//npc.o -I"C:/Users/Weverton/Desktop/StiansRepackDev-Cpp_v2/Stian's Repack Dev-Cpp v2/include/c++"  -D__USE_MYSQL__ -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__   -fexpensive-optimizations -O1
 
In file included from ../npc.h:21,
                 from ../npc.cpp:25:
../const.h:731:7: warning: no newline at end of file
 
In file included from ../creature.h:26,
                 from ../npc.h:23,
                 from ../npc.cpp:25:
../enums.h:355:7: warning: no newline at end of file
In file included from ../map.h:20,
                 from ../creature.h:28,
                 from ../npc.h:23,
                 from ../npc.cpp:25:
 
../tools.h:139:7: warning: no newline at end of file
In file included from ../creature.h:29,
                 from ../npc.h:23,
                 from ../npc.cpp:25:
../condition.h:377:7: warning: no newline at end of file
../npc.cpp: In member function `void Npc::onPlayerTrade(Player*, ShopEvent_t, int32_t, uint16_t, uint8_t, uint8_t, bool, bool)':
../npc.cpp:1877: error: a function-definition is not allowed here before '{' token
../npc.cpp:1897: error: a function-definition is not allowed here before '{' token
../npc.cpp:1908: error: a function-definition is not allowed here before '{' token
../npc.cpp:1931: error: a function-definition is not allowed here before '{' token
../npc.cpp:1955: error: a function-definition is not allowed here before '{' token
../npc.cpp:1987: error: a function-definition is not allowed here before '{' token
../npc.cpp:2269: error: a function-definition is not allowed here before '{' token
../npc.cpp:2331: error: a function-definition is not allowed here before '{' token
../npc.cpp:2336: error: a function-definition is not allowed here before '{' token
../npc.cpp:2358: error: a function-definition is not allowed here before '{' token
../npc.cpp:2367: error: a function-definition is not allowed here before '{' token
../npc.cpp:2396: error: a function-definition is not allowed here before '{' token
../npc.cpp:2449: error: a function-definition is not allowed here before '{' token
../npc.cpp:2456: error: a function-definition is not allowed here before '{' token
../npc.cpp:2463: error: a function-definition is not allowed here before '{' token
 
../npc.cpp:2470: error: a function-definition is not allowed here before '{' token
../npc.cpp:2474: error: expected `;' before ':' token
../npc.cpp:2482: error: no matching function for call to `NpcScriptInterface::NpcScriptInterface()'
 
../npc.h:46: note: candidates are: virtual NpcScriptInterface::~NpcScriptInterface()
../npc.cpp:2483: error: expected `;' before '{' token
../npc.cpp:2488: error: a function-definition is not allowed here before '{' token
../npc.cpp:2493: error: a function-definition is not allowed here before '{' token
../npc.cpp:2499: error: a function-definition is not allowed here before '{' token
../npc.cpp:2514: error: a function-definition is not allowed here before '{' token
../npc.cpp:2536: error: a function-definition is not allowed here before '{' token
../npc.cpp:2555: error: a function-definition is not allowed here before '{' token
../npc.cpp:2584: error: a function-definition is not allowed here before '{' token
../npc.cpp:2594: error: a function-definition is not allowed here before '{' token
../npc.cpp:2604: error: a function-definition is not allowed here before '{' token
../npc.cpp:2619: error: a function-definition is not allowed here before '{' token
../npc.cpp:2643: error: a function-definition is not allowed here before '{' token
../npc.cpp:2655: error: a function-definition is not allowed here before '{' token
../npc.cpp:2680: error: a function-definition is not allowed here before '{' token
../npc.cpp:2698: error: a function-definition is not allowed here before '{' token
../npc.cpp:2713: error: a function-definition is not allowed here before '{' token
 
../npc.cpp:2732: error: a function-definition is not allowed here before '{' token
../npc.cpp:2761: error: a function-definition is not allowed here before '{' token
../npc.cpp:2789: error: a function-definition is not allowed here before '{' token
../npc.cpp:2854: error: a function-definition is not allowed here before '{' token
 
../npc.cpp:2882: error: `npc' was not declared in this scope
../npc.cpp:2882: error: expected primary-expression before '(' token
../npc.cpp:2882: error: expected primary-expression before '*' token
../npc.cpp:2883: error: expected `;' before '{' token
../npc.cpp:2889: error: a function-definition is not allowed here before '{' token
../npc.cpp:2893: error: expected primary-expression before '(' token
../npc.cpp:2893: error: expected primary-expression before "file"
../npc.cpp:2893: error: expected primary-expression before '*' token
../npc.cpp:2893: error: expected `;' before ':' token
../npc.cpp:2917: error: a function-definition is not allowed here before '{' token
../npc.cpp:2948: error: a function-definition is not allowed here before '{' token
../npc.cpp:2979: error: a function-definition is not allowed here before '{' token
../npc.cpp:3013: error: a function-definition is not allowed here before '{' token
../npc.cpp:3048: error: a function-definition is not allowed here before '{' token
../npc.cpp:3087: error: a function-definition is not allowed here before '{' token
../npc.cpp:3112: error: a function-definition is not allowed here before '{' token
../npc.cpp:3137: error: a function-definition is not allowed here before '{' token
../npc.cpp:3163: error: expected `}' at end of input
 
make.exe: *** [obj//npc.o] Error 1
 
Execution terminated

Editado por Valakinhas (veja o histórico de edições)

 

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo