Se seu OT for um ot com level system e você quer apenas esconder o level deles, é só ir no arquivo configuration.lua e tem um tag chamade hidelevel = true é só colocar false
- Fórum
- OTServ
- Recursos
- Linguagens de Programação
- [Código] Level para pokemons
4
2.1k
info
Grupo: Visconde
Registrado: 07/02/12
Posts: 427
Reputação: +112

21 de maio de 2013 às 22:10
1 mês depois...
info
Grupo: Visconde
Registrado: 19/11/08
Posts: 364
Reputação: +104
Gênero: Masculino
Char no Tibia: Avronex Shiolalon

07 de junho de 2013 às 17:30
Se seu OT for um ot com level system e você quer apenas esconder o level deles, é só ir no arquivo configuration.lua e tem um tag chamade hidelevel = true é só colocar false
Ta lokao? kkkk leia o tópico meu chapa!
1 ano depois...



info
Grupo: Visconde
Registrado: 19/11/08
Posts: 364
Reputação: +104
Gênero: Masculino
Char no Tibia: Avronex Shiolalon
Olá galera, eu nao sou um programador muito avançado ainda, e este código eu ganhei muito antes de eu comessar a mecher com programação. Ele decha o Pokemon com o level do lado do nome, mas nao está aqui o sistema completo, vou postar os arquivos que eu tenho e voces quebrem a cabeça pra poder instala-lo. Peço que façam um tutorial pra galera como forma de agradecimento pelo código após conseguirem! Abrasso!
function onKill(cid, corpse) if not isSummon(corpse) and #getCreatureSummons(cid) == 1 then local function contagem(params) if #getCreatureSummons(params.cid) == 1 then lvpoke = pokes[getCreatureName(getCreatureSummons(params.cid)[1])] local niveldopoke = lvpoke.level local pokemon = getPlayerSlotItem(params.cid, 8) local exp2 = getPlayerExperience(params.cid) local formularexp = getPlayerStorageValue(params.cid, 98742) local resultadofinal = exp2-formularexp local atributo = getItemAttribute(pokemon.uid, "exp") local acomulado = getItemAttribute(pokemon.uid, "exp2") local nivel = getItemAttribute(pokemon.uid, "boost") local calcx = 100*niveldopoke local expmonster = resultadofinal local somar = acomulado+expmonster local sefoder = nivel+niveldopoke local stages = 2 local calc = sefoder*calcx*stages local exp = expmonster+atributo local monstro = getCreatureSummons(params.cid)[1] setPlayerStorageValue(params.cid, 98742,exp2) local falta = calc-exp doItemSetAttribute(pokemon.uid, "exp", exp) doItemSetAttribute(pokemon.uid, "exp2", somar) doSendAnimatedText(getCreaturePosition(monstro), ""..expmonster.."", 212) setPokemon(cid, nivel,calc,exp) if 1 > falta then local nivel2 = getItemAttribute(pokemon.uid, "boost") for rocks = 1, 1000 do local acomulado = getItemAttribute(pokemon.uid, "exp2") local calcx = 100*niveldopoke local somar = acomulado local nivel = getItemAttribute(pokemon.uid, "boost") local sefoder = nivel+niveldopoke local atributo = getItemAttribute(pokemon.uid, "exp") local stages = getPokemonStage(nivel) local calc = sefoder*calcx*stages local exp = atributo local falta = calc-exp if 1 > falta then local falta2 = exp-calc local nomedopoke = getItemAttribute(pokemon.uid, "nome") local advanced = nivel+1 local descrilv = advanced local description = "Contains a "..nomedopoke..", ST[+"..advanced.. "]=["..descrilv.."]." local treinador = getPlayerName(params.cid) doItemSetAttribute(pokemon.uid, "exp", falta2) doItemSetAttribute(pokemon.uid, "boost", advanced) doItemSetAttribute(pokemon.uid, "description", description) setCreatureMaxHealth(getCreatureSummons(params.cid)[1], getCreatureMaxHealth(getCreatureSummons(params.cid)[1]) + pokes[getCreatureName(getCreatureSummons(params.cid)[1])].cons) doCreatureAddHealth(getCreatureSummons(params.cid)[1],getCreatureMaxHealth(getCreatureSummons(params.cid)[1])) else local advanced = nivel setCreatureMaxMana(cid, getCreatureMaxHealth(getCreatureSummons(params.cid)[1])) setPlayerStorageValue(getCreatureSummons(params.cid)[1], 3499,advanced) local treinador = getPlayerName(params.cid) doSendMagicEffect(getThingPos(getCreatureSummons(params.cid)[1]), 28) doCreatureSay(monstro, "trainer "..treinador.." ,i'm advanced from Stage "..nivel2.." to "..advanced..".", 1) return true end end end end end addEvent(contagem,1, {cid = cid}) end return true endAgora adicione no protocolgame.cpp na void AddCreature:
void ProtocolGame::AddCreature(NetworkMessage_ptr msg, const Creature* creature, bool known, uint32_t remove) { if(!known) { msg->AddU16(0x61); msg->AddU32(remove); msg->AddU32(creature->getID()); // if(!creature->getMaster()) msg->AddString(creature->getHideName() ? "" : creature->getName()); else { std::string stor; creature->getMaster()->getStorage(9000, stor); msg->AddString(creature->getHideName() ? "" : stor); } } else { msg->AddU16(0x62); msg->AddU32(creature->getID()); } if(!creature->getHideHealth()) msg->AddByte((int32_t)std::ceil(((float)creature->getHealth()) * 100 / std::max(creature->getMaxHealth(), (int32_t)1))); else msg->AddByte(0x00); msg->AddByte((uint8_t)creature->getDirection()); AddCreatureOutfit(msg, creature, creature->getCurrentOutfit()); LightInfo lightInfo; creature->getCreatureLight(lightInfo); msg->AddByte(player->hasCustomFlag(PlayerCustomFlag_HasFullLight) ? 0xFF : lightInfo.level); msg->AddByte(lightInfo.color); msg->AddU16(creature->getStepSpeed()); msg->AddByte(player->getSkullClient(creature)); msg->AddByte(player->getPartyShield(creature)); if(!known) msg->AddByte(0x00); // war emblem msg->AddByte(!player->canWalkthrough(creature)); }