bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 941
- Solutions
- 7
- Reaction score
- 129
- Location
- Brazil
- YouTube
- caruniawikibr
hello, how could I make the player reset all the spells he learned and clear the depot.
tf 1.5 7.72
player.cpp
tf 1.5 7.72
player.cpp
Lua:
setTown(g_game.map.towns.getTown(g_config.getNumber(ConfigManager::ROOK_TOWN_ID)));
loginPosition = town->getTemplePosition();
// reset skills
for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) { //for each skill
skills[i].level = 10;
skills[i].percent = 0;
skills[i].tries = 0;
}
// unlearn all spells
learnedInstantSpellList.clear();
// reset inventory
for (int32_t slot = getFirstIndex(); slot < getLastIndex(); slot++) {
if (inventory[slot]) {
g_game.internalRemoveItem(inventory[slot]);
}
}