Ir para conteúdo

Featured Replies

Postado

eu achei um topico em outro forum, que bota a barra de mana/vida por % só que nao sei onde coloca esse script

alguem ajuda?

 

 

segue abaixo o script:

--Remove health/mana by percentages: Evil Hero(Zeriikler:Changed few things)
function doPlayerAddManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerAddMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerAddHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doCreatureAddHealth(cid, (health / 100) * percent)
return TRUE
end
function doPlayerRemoveManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerRemoveMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerRemoveHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doPlayerRemoveHealth(cid, (health / 100) * percent)
return TRUE
end
--Remove HP/MANA
function doPlayerRemoveHealth(cid, hp)
doCreatureAddHealth(cid, -hp)
return TRUE
end
function doPlayerRemoveMana(cid, mana)
doPlayerAddMana(cid, -mana)
return TRUE
end

onde coloca isso?

void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
msg->AddByte(0xA0);
msg->AddU16((uint16_t)std::ceil(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH)));
msg->AddU16((uint16_t)100);
msg->AddU32(uint32_t(player->getFreeCapacity() * 100));
uint64_t experience = player->getExperience();
if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp
msg->AddU32(0x7FFFFFFF);
else
msg->AddU32(experience);
msg->AddU16(player->getPlayerInfo(PLAYERINFO_LEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));
msg->AddU16((uint16_t)std::ceil(player->getMana() * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA)));
msg->AddU16((uint16_t)100);
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_SOUL));
msg->AddU16(player->getStaminaMinutes());
}

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

Resolvido por poko360

Ir para solução
  • Respostas 27
  • Visualizações 5.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) { msg->AddByte(0xA0); msg->AddU16((uint16_t)std::ceil(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); m

Postado
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
msg->AddByte(0xA0);
msg->AddU16((uint16_t)std::ceil(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH)));
msg->AddU16((uint16_t)100);
msg->AddU32(uint32_t(player->getFreeCapacity() * 100));
uint64_t experience = player->getExperience();
if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp
msg->AddU32(0x7FFFFFFF);
else
msg->AddU32(experience);
msg->AddU16(player->getPlayerInfo(PLAYERINFO_LEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));
msg->AddU16((uint16_t)std::ceil(player->getMana() * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA)));
msg->AddU16((uint16_t)100);
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_SOUL));
msg->AddU16(player->getStaminaMinutes());
}

Tu tem as sources?

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Postado

Você tem que ter as sources e adicionar esses codes no cpp dela, sem as sources não é possível.

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo