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

Feature Rook System by Elf

StreamSide

Joseluis Gonzalez
Staff member
Support Team
Joined
Aug 31, 2007
Messages
3,608
Solutions
51
Reaction score
1,224
Location
Arica - Chile
well, is simple, elf do this code and i will show you how to add it..

let start.
go to player.cpp and change:
Code:
                if(!inventory[SLOT_BACKPACK])
for
Code:
                if(g_config.getBool(ConfigManager::ROOK_SYSTEM) && level <= (uint32_t)g_config.getNumber(ConfigManager::ROOK_LEVELTO) && vocation_id != 0)
                {
                        if(Town* _town = Towns::getInstance()->getTown(g_config.getNumber(ConfigManager::ROOK_TOWN)))
                        {
                                level = 1;
                                soulMax = 100;
                                capacity = 400;
                                stamina = STAMINA_MAX;
                                health = healthMax = 150;
                                loginPosition = masterPosition = _town->getPosition();
                                experience = magLevel = manaSpent = mana = manaMax = soul = balance = marriage = promotionLevel = 0;
                                setTown(_town->getID());
                                setVocation(0);
                                leaveGuild();
                                storageMap.clear();

                                for(uint32_t i = SKILL_FIRST; i <= SKILL_LAST; ++i)
                                {
                                        skills[i][SKILL_LEVEL] = 10;
                                        skills[i][SKILL_TRIES] = 0;
                                }

                                for(uint32_t i = SLOT_FIRST; i < SLOT_LAST; ++i)
                                {
                                        if(inventory[i])
                                                g_game.internalRemoveItem(NULL, inventory[i]);
                                }
                        }
                }
                else if(!inventory[SLOT_BACKPACK])

then go to configmanager.cpp
Before:
Code:
    m_isLoaded = true;
Add:
Code:
    m_confNumber[ROOK_LEVELTO] = getGlobalNumber("rookLevelTo", 5);
    m_confNumber[ROOK_TOWN] = getGlobalNumber("rookTownId", 1);
    m_confBool[ROOK_SYSTEM] = getGlobalBool("rookSystem", true);

ok, now go to configmanager.h
After:
Code:
                        LOOT_MESSAGE_TYPE,
Add:
Code:
                        ROOK_LEVELTO,
                        ROOK_TOWN,
and after:
Code:
                        PREMIUM_SKIP_WAIT,
Add:
Code:
                        ROOK_SYSTEM,

Now to config.lua:
Code:
rookLevelTo = X
rookTownId = X
rookSystem = true
and where X is your number :D
done...
rep to Elf or me S: // Elf: to elf <3
 
Last edited:
Code:
                                experience = magLevel = manaSpent = mana = manaMax = soul = 0;
:S
 
experience = magLevel = manaSpent = mana = manaMax = soul = 0;
LOL
EASY ¬¬ NOTHING TO EXPLAIN..
 
Problems when compilling...

2220 C:\...\player.cpp 'vocation_id' was not declared in this scope

if(g_config.getBool(ConfigManager::ROOK_SYSTEM) && level <= (uint32_t)g_config.getNumber(ConfigManager::ROOK_LEVELTO) && vocation_id != 0)
 
Change [cpp]vocation_id != 0 [/cpp]

By

[cpp]player->getVocationId() != 0[/cpp]

I dont know if "player" is declared in that part of the code but try it
 
How could I alter this so that when I reach a certain level a popup to pick promotion appears?
 

Similar threads

Back
Top