Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,435
- Solutions
- 68
- Reaction score
- 1,082
So I am creating a WoW-like stat system on items. Two of the stats are: Stamina, Wisdom they give the player more maximum health/mana.
I modified movevents.cpp so when someone puts an item on with +stamina or +wisdom it increases their maximum health/mana.
This is how it is coded now.
This is the way the maxhitpoints attribute for items is used in the original movement.cpp code when equipping items.
The problem is the health/mana bar in otclient doesn't update with player->sendStats().
On my God character I can see my character has the added health/mana from the item by looking at myself.
Otclient doesn't correct the health/mana bar until I heal or get damaged.
How can I force otclient to update the health and mana bar once I put the armor on?
Otclient updates the skills window when armor is put on but is not updating the health bar window.
Any help is appreciated.
I modified movevents.cpp so when someone puts an item on with +stamina or +wisdom it increases their maximum health/mana.
This is how it is coded now.
Code:
//skill modifiers
for (int32_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
if (it.abilities->skills[i]) {
player->setVarSkill(static_cast<skills_t>(i), it.abilities->skills[i]);
player->sendSkills();
if (i == SKILL_STAMINA) {
player->setVarStats(static_cast<stats_t>(STAT_MAXHITPOINTS), +(it.abilities->skills[i] * 2));
player->sendStats();
}
if (i == SKILL_WISDOM) {
player->setVarStats(static_cast<stats_t>(STAT_MAXMANAPOINTS), +(it.abilities->skills[i] * 2));
player->sendStats();
}
}
}
This is the way the maxhitpoints attribute for items is used in the original movement.cpp code when equipping items.
The problem is the health/mana bar in otclient doesn't update with player->sendStats().
On my God character I can see my character has the added health/mana from the item by looking at myself.
Otclient doesn't correct the health/mana bar until I heal or get damaged.
How can I force otclient to update the health and mana bar once I put the armor on?
Otclient updates the skills window when armor is put on but is not updating the health bar window.
Any help is appreciated.