Ir para conteúdo

[Código] Level para pokemons


Posts Recomendados

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!

 

 

Nota: (Estava escrito no arquivo.lua postado abaixo.)

///

nota se crie quando criar o pokemon seta o atribudo exp como 0

assim com o o exp2

 

agora é so adaptar no go/back na parte que multiplica a life pegando o atributo

boost

mesma coisa na hora de usar o cd na parte que soma

o level de player

 

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	  

end

 

 

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

Link para o comentário
Compartilhar em outros sites

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

Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...

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!

Link para o comentário
Compartilhar em outros sites

  • 1 year later...
×
×
  • Criar Novo...