• 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!

TFS 1.X+ rook system tfs 1.5

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
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]);
                        }
                    }
 
the player, when returning to rookgard, needs to lose all the learned spells and clear all the depots.
did you mamaged to solved this?
nevermind, solved by adding this
Lua:
                    // unlearn all spells
                    learnedInstantSpellList.clear();
in player cpp thanks @bpm91

still need houses and depot
 
Last edited:
Back
Top