• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

32bit instead of 16 on health and mana

Berit

New Member
Joined
Jul 6, 2014
Messages
10
Reaction score
0
Hi,

I tried to change the health and mana in OTC to show up as 32 bit instead of 16bit. But when I compiled I get errors and the client just writes huge numbers as health and mana.

WLqRHfQ.png


Here is the code bit I changed in "protocolgameparse.cpp":
Code:
if(g_game.getFeature(Otc::GameDoubleHealth)) {
        health = msg->getU32();
        maxHealth = msg->getU32();
    } else {
        health = msg->getU32();
        maxHealth = msg->getU32();
    }

Thanks for reading this and I hope someone can help me figure this out.

Kind regards, Berit.
 
You dont need to change that code, you just have to enable the feature Otc::GameDoubleHealth. If you change that your server has to support it as well and send the health as a 32-bit integer.
 
How do I enable that feature and how do I make my server send health as 32-bit? I'm super new to compiling and messing arond with source files.
 
I am assuming you want to get your health into % So i will go ahead and share the easiest way possible without source edits.

Go to your game_healthinfo open healthinfo.lua and find function onHealthChange(localPlayer, health, maxHealth) and change it to this
Code:
function onHealthChange(localPlayer, health, maxHealth)
local percent =  (health /maxHealth)*100
  healthBar:setText(math.floor(percent))
  --healthBar:setText(health .. ' / ' .. maxHealth)
  healthBar:setTooltip(tr(healthTooltip, health, maxHealth))
  healthBar:setValue(health, 0, maxHealth)
end

function onManaChange(localPlayer, mana, maxMana)
local percent2 =  (mana /maxMana)*100
  manaBar:setText(math.floor(percent2))
  --manaBar:setText(mana .. ' / ' .. maxMana)
  manaBar:setTooltip(tr(manaTooltip, mana, maxMana))
  manaBar:setValue(mana, 0, maxMana)
end

That is health change and mana change. Old values are still there if you ever want to revert. Just reload the mod and the numbers change to %
 
I am assuming you want to get your health into % So i will go ahead and share the easiest way possible without source edits.

Go to your game_healthinfo open healthinfo.lua and find function onHealthChange(localPlayer, health, maxHealth) and change it to this
Code:
function onHealthChange(localPlayer, health, maxHealth)
local percent =  (health /maxHealth)*100
  healthBar:setText(math.floor(percent))
  --healthBar:setText(health .. ' / ' .. maxHealth)
  healthBar:setTooltip(tr(healthTooltip, health, maxHealth))
  healthBar:setValue(health, 0, maxHealth)
end

function onManaChange(localPlayer, mana, maxMana)
local percent2 =  (mana /maxMana)*100
  manaBar:setText(math.floor(percent2))
  --manaBar:setText(mana .. ' / ' .. maxMana)
  manaBar:setTooltip(tr(manaTooltip, mana, maxMana))
  manaBar:setValue(mana, 0, maxMana)
end

That is health change and mana change. Old values are still there if you ever want to revert. Just reload the mod and the numbers change to %
Hello, is possible to have health and mana in 32 bit but showing the real number of mana and hp and not in percentage without source editing?
 
If you use OTClient in things.lua add:
Lua:
g_game.enableFeature(Otc::GameDoubleHealth)

And if you didn't change anything it's normally showing health/mana in real number.
 
If you use OTClient in things.lua add:
Lua:
g_game.enableFeature(Otc::GameDoubleHealth)

And if you didn't change anything it's normally showing health/mana in real number.
should i put that inside a function? because if i put it alone, otclient cant load gamelib

should i put that inside a function? because if i put it alone, otclient cant load gamelib
Okey i have added it correctly now, but looks like a part might be missing?
f1869285305e7143729e8459e4cf76e8.png

Cos that amount ain't real xd

OMG plz sorry for the double post i totally forgot when doing this, i cant delete it

Solved it, tfs needed work
 
Last edited by a moderator:
Okey i have added it correctly now, but looks like a part might be missing?
f1869285305e7143729e8459e4cf76e8.png

Cos that amount ain't real xd

OMG plz sorry for the double post i totally forgot when doing this, i cant delete it

Solved it, tfs needed work

Hi excuse me
can say that modify in tfs?
 
I did all in otclient and it gives me the int32 values, but it does not give me the real hp and mana
f1869285305e7143729e8459e4cf76e8.png
currently the character has 180k hp and 30000 mana, and this show more
 
Back
Top