Chat global

Chat
Loading the chat ...
[Dúvida]Travar EXP ...
 
Notifications
Clear all

[Resolvido] [Dúvida]Travar EXP nos mapas

8 Posts
4 Usuários
3 Reactions
244 Visualizações
Curioso123
(@curioso123)
Posts: 48
Conselheiro
Topic starter
 

Minha ideia é deixar os jogadores com nível 150-180 recebendo EXP somente dentro de 1 mapa, e qualquer outro que os jogadores deste nível for, que ele não consiga receber nenhum exp.

//if (lpPartyPlayers[cnt]->smCharInfo.Level >= 150 && lpPartyPlayers[cnt]->Position.Area != 43)
//
//PlayerEXP = 0;

encontrei isso desativado na source, mesmo ativando em alterando o jogador ainda continua recebendo exp normal em todos os mapas, alguém poderia me dar uma força ? obrigado desde já!!!


~ Aprender nunca é demais...

 
Postado : 11/10/2025 8:12 pm
Zorik
(@zorik)
Posts: 4
Apoiador Ativo
 

OnSever.cpp - Para jogadores solo
PartySever.cpp - Para jogadores em grupo

 

adiciona isso no OnServer.h

#define LEVEL_150_180_MIN_LEVEL     150
#define LEVEL_150_180_MAX_LEVEL     180
#define LEVEL_150_180_ALLOWED_MAP   10      // AQUI TU COLOCA O ID/FIELD DO MAPA PERMITIDO O EXP

no PartyServer.cpp procura por

PlayerEXP =PartyExp[1];

e cola isso até o IF

PlayerEXP = PartyExp[1];
					}
					else
					{
						cQuestHandler.KillMonster(lpPartyPlayers[cnt], lpChar, true);

						int x = (lpPlayInfo->Position.x - lpPartyPlayers[cnt]->Position.x) >> FLOATNS;
						int z = (lpPlayInfo->Position.z - lpPartyPlayers[cnt]->Position.z) >> FLOATNS;
						int dist = x * x + z * z;

						if (dist < PARTY_GETTING_DIST)
						{
							PlayerEXP = PartyExp[1];
					}
				}
			}

			// Aqui verifica o EXP por mapa para níveis 150-180
			if (lpPartyPlayers[cnt]->smCharInfo.Level >= LEVEL_150_180_MIN_LEVEL && 
				lpPartyPlayers[cnt]->smCharInfo.Level <= LEVEL_150_180_MAX_LEVEL)
			{
				if (lpPartyPlayers[cnt]->Position.Area != LEVEL_150_180_ALLOWED_MAP)
				{
					PlayerEXP = 0; // Bloqueia EXP se não estiver no mapa permitido
				}
			}
			

			if (PlayerEXP) {

No OnServer.cpp procura por isso:

INT64 PlayerEXP = srGetTotalExp(lpChar->smMonsterInfo.GetExp, lpChar->smCharInfo.Level - lprsPlayInfo->smCharInfo.Level, lprsPlayInfo);

E abaixo adiciona isso:

		// Verifica o EXP por mapa para níveis 150-180
		if (lprsPlayInfo->smCharInfo.Level >= LEVEL_150_180_MIN_LEVEL && 
			lprsPlayInfo->smCharInfo.Level <= LEVEL_150_180_MAX_LEVEL)
		{
			if (lprsPlayInfo->Position.Area != LEVEL_150_180_ALLOWED_MAP)
			{
				PlayerEXP = 0; // Bloqueia EXP se não estiver no mapa permitido
			}
		}

Code. Learn. Evolve.

 
Postado : 08/11/2025 1:34 am
Raka and Curioso123 reacted
Curioso123
(@curioso123)
Posts: 48
Conselheiro
Topic starter
 

Postado por: @zorik

OnSever.cpp - Para jogadores solo
PartySever.cpp - Para jogadores em grupo

 

adiciona isso no OnServer.h

#define LEVEL_150_180_MIN_LEVEL     150
#define LEVEL_150_180_MAX_LEVEL     180
#define LEVEL_150_180_ALLOWED_MAP   10      // AQUI TU COLOCA O ID/FIELD DO MAPA PERMITIDO O EXP

no PartyServer.cpp procura por

PlayerEXP =PartyExp[1];

 

e cola isso até o IF

PlayerEXP = PartyExp[1];
					}
					else
					{
						cQuestHandler.KillMonster(lpPartyPlayers[cnt], lpChar, true);

						int x = (lpPlayInfo->Position.x - lpPartyPlayers[cnt]->Position.x) >> FLOATNS;
						int z = (lpPlayInfo->Position.z - lpPartyPlayers[cnt]->Position.z) >> FLOATNS;
						int dist = x * x + z * z;

						if (dist < PARTY_GETTING_DIST)
						{
							PlayerEXP = PartyExp[1];
					}
				}
			}

			// Aqui verifica o EXP por mapa para níveis 150-180
			if (lpPartyPlayers[cnt]->smCharInfo.Level >= LEVEL_150_180_MIN_LEVEL && 
				lpPartyPlayers[cnt]->smCharInfo.Level <= LEVEL_150_180_MAX_LEVEL)
			{
				if (lpPartyPlayers[cnt]->Position.Area != LEVEL_150_180_ALLOWED_MAP)
				{
					PlayerEXP = 0; // Bloqueia EXP se não estiver no mapa permitido
				}
			}
			

			if (PlayerEXP) {

No OnServer.cpp procura por isso:

INT64 PlayerEXP = srGetTotalExp(lpChar->smMonsterInfo.GetExp, lpChar->smCharInfo.Level - lprsPlayInfo->smCharInfo.Level, lprsPlayInfo);

E abaixo adiciona isso:

		// Verifica o EXP por mapa para níveis 150-180
		if (lprsPlayInfo->smCharInfo.Level >= LEVEL_150_180_MIN_LEVEL && 
			lprsPlayInfo->smCharInfo.Level <= LEVEL_150_180_MAX_LEVEL)
		{
			if (lprsPlayInfo->Position.Area != LEVEL_150_180_ALLOWED_MAP)
			{
				PlayerEXP = 0; // Bloqueia EXP se não estiver no mapa permitido
			}
		}

Obrigado chefe, ajudou demais!!! 

 


~ Aprender nunca é demais...

 
Postado : 09/11/2025 12:08 am
Zorik reacted
 adcd
(@adcd)
Posts: 22
Mentor Respeitado
 

@zorik I'm not gaining experience points from killing monsters in my game. How can I fix this? Thanks.


 
Postado : 09/11/2025 6:32 am
Zorik
(@zorik)
Posts: 4
Apoiador Ativo
 

@adcd Try analyzing your XP rate in config.ini and check it in OnServer.cpp. Since I don’t have access to your source code, I can’t give a concrete answer, but you should look into that.

NOTE: Check: config.ini → [Rate] section → Exp key must have a value greater than 0.

int srGetTotalExp(int exp, int level)
{

	if (level < 0)
	{
		level *= -1;
	}
	int result = 0;

	if (level <= 19)
	{
		result = exp;
	}
	else
	{
		result = (int)(exp * 0.15);
	}

	if (result < 0)
	{
		result = (int)(exp * 0.5);
	}

	File file("config.ini");
	ExpServer = file.readInt("Rate", "Exp");

	return result * ExpServer;
}

Este post foi modificado 3 semanas atrás por Zorik

Code. Learn. Evolve.

 
Postado : 09/11/2025 1:29 pm
 adcd
(@adcd)
Posts: 22
Mentor Respeitado
 

@zorik Thank you, I'm using FrozenPK's source code.  Search results as follows

 

int srGetTotalExp(int exp, int level)
{
if (level < 0)
{
level *= -1;
}
 
int result = 0;
 
 
if (level <= 10)
{
result = exp;
}
if (level <= 20)
{
result = (int)(exp * 0.85);
}
if (level <= 30)
{
result = (int)(exp * 0.70);
}
else
{
result = (int)(exp * 0.55);
}
 
if (result < 0)
{
result = 0;
}
 
return result;
}

 
Postado : 09/11/2025 1:50 pm
 adcd
(@adcd)
Posts: 22
Mentor Respeitado
 

Can't the file be uploaded?


 
Postado : 09/11/2025 2:02 pm
Raka
 Raka
(@rakabr)
Posts: 44
Admin
 

@zorik Obrigado pela colaboração 😉


Apenas criando um legado 😊

 
Postado : 10/11/2025 2:04 am
Compartilhar:

Anúncio