Chat global
[Resolvido] [Dúvida]Travar EXP nos mapas
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.
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...
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];
}
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:
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 por: @zorikOnSever.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 EXPno 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...
@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;
}
Code. Learn. Evolve.
@zorik Thank you, I'm using FrozenPK's source code. Search results as follows
Can't the file be uploaded?
- 20 Fóruns
- 247 Tópicos
- 1,409 Posts
- 9 Online
- 262 Membros

