Itutorial
Excellent OT User
- Joined
- Dec 23, 2014
- Messages
- 2,307
- Solutions
- 68
- Reaction score
- 982
So I am creating a stat system on items like WoW and many other RPGs nowadays.
I need help figuring out how to make it so when a player equips items with: +stamina or +wisdom
it will change their health/mana and also when they remove it.
I tried modifying movement.cpp
I tried to have it change the players health/mana there.
Unfortunately
player->manaMax
and
creature->healthMax
are protected.
I tried creating a way to change them even though they are protected like this:
Obviously not the right way to do it because I could no longer move armor off of my character though, my god character was able to move items off of him.
Will someone help me with this?
I need help figuring out how to make it so when a player equips items with: +stamina or +wisdom
it will change their health/mana and also when they remove it.
I tried modifying movement.cpp
Code:
uint32_t MoveEvent::EquipItem(MoveEvent* moveEvent, Player* player, Item* item, slots_t slot, bool isCheck)
uint32_t MoveEvent::DeEquipItem(MoveEvent*, Player* player, Item* item, slots_t slot, bool)
I tried to have it change the players health/mana there.
Unfortunately
player->manaMax
and
creature->healthMax
are protected.
I tried creating a way to change them even though they are protected like this:
Code:
creature.h
void setMaxHealth(int32_t newMaxHealth) {
healthMax = newMaxHealth;
}
player.h
void setMaxMana(uint32_t newMaxMana) {
manaMax = newMaxMana;
}
Obviously not the right way to do it because I could no longer move armor off of my character though, my god character was able to move items off of him.
Will someone help me with this?