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

[7.72] OTHire 0.0.1b - Based in OTServ Trunk (Latest)

Do like I did in my old sources, I've created 3 options of Exp Formula, to change the exp formula type, you just need to edit the config.lua, below are those 3 options

* Tibianic HR Exp Formula (Thanks to Iryont who gave to me)
* MasterCores Exp Formula (MasterCores files released)
* Original Tibia Exp Formula

At player.h, change this:
Code:
static uint64_t getExpForLevel(uint32_t level)
{
level--;
return ((50ULL * level * level * level) - (150ULL * level * level) + (400ULL * level))/3ULL;
}

For this:
Code:
    static uint64_t getExpForLevel(int32_t level)
    {
        std::string ExpFormulaType = g_config.getString(ConfigManager::TYPE_FORMULA);
     
        level--;
        if(ExpFormulaType == "original"){
            return ((50ULL * level * level * level) - (150ULL * level * level) + (400ULL * level))/3ULL;      
        }
     
        else if(ExpFormulaType == "tibianic"){
            return (level * 35ULL) * (level * level * level) / 500ULL + 10ULL * level;
        }  
     
        else if(ExpFormulaType == "mastercores"){
            return ((level * 50ULL) * (level * level * level) / 500ULL)+10ULL;
        }
      }

At configmanager.cpp, below that line:
Code:
m_confInteger[CONTAINER_ITEMS_AUTO_STACK] = getGlobalBoolean(L, "container_items_auto_stack", false);

Add this:
Code:
m_confString[TYPE_FORMULA] = getGlobalString(L, "ExpFormulaType", "original");

In configmanager.h, below that line:
Code:
CONTAINER_ITEMS_AUTO_STACK,

Add this:
Code:
TYPE_FORMULA,

Hope you enjoy it !!!
@Nottinghster this line:
Code:
std::string ExpFormulaType = g_config.getString(ConfigManager::TYPE_FORMULA);
Gives 2 errors.
g_config and ConfigManager are global not declared anywhere. Check this: https://travis-ci.org/TwistedScorpio/OTHire/builds/46640096
 
Sorry, forgot about this:

In player.h, add this:

Code:
#include "configmanager.h"
extern ConfigManager g_config;
Still got this error on compile:
warning C4715: 'Player::getExpForLevel' : not all control paths return a value
 
Anyone solved thi issue with invisible talkaction?

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/gminvisible.lua:eek:nSay

LuaScriptInterface::luaGetPlayerFlagValue(). No valid flag index.
 
Anyone solved thi issue with invisible talkaction?

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/gminvisible.lua:eek:nSay

LuaScriptInterface::luaGetPlayerFlagValue(). No valid flag index.
global.lua

Change
Code:
PLAYERFLAG_CANNOTBESEEN = 46
to
Code:
PLAYERFLAG_CANNOTBESEEN = 45
 
Hello @Ezzz you wrote in the thread that the shared party experience is working. Just need a function to activate it. Well Ond has helped me a great deal and he made a function that enabled it BUT server crashes when a monster dies so something must be wrong with the code. Any chance you could help me out? Or anyone else I'll pay to get this function working.
 
Any news on why doShowTextDialog causes client to crash?
I tried having a NPC do doShowTextDialog and client crash, same if I open spellbook which uses doShowTextDialog
 
For those who have the message in console about the FluidTypes, paste this in your items.xml

Code:
<item id="20001" name="water" fluidClient="1"/>
<item id="20002" name="blood" fluidClient="2"/>
<item id="20003" name="beer" fluidClient="3"/>
<item id="20004" name="slime" fluidClient="4"/>
<item id="20005" name="lemonade" fluidClient="5"/>
<item id="20006" name="milk" fluidClient="6"/>
<item id="20007" name="manafluid" fluidClient="7"/>
<item id="20010" name="lifefluid" fluidClient="10"/>
<item id="20011" name="oil" fluidClient="11"/>
<item id="20013" name="urine" fluidClient="13"/>
<item id="20014" name="coconut milk" fluidClient="14"/>
<item id="20015" name="wine" fluidClient="12"/>
<item id="20019" name="mud" fluidClient="19"/>
<item id="20021" name="fruit juice" fluidClient="21"/>
<item id="20027" name="rum" fluidClient="27"/>
<item id="20035" name="tea" fluidClient="16"/>
<item id="20036" name="mead" fluidClient="17"/>
<item id="20027" name="rum" fluidClient="15"/>

Thanks all worked fine except for <item id="20015" name="wine" fluidClient="12"/>
That's green but should be purple?
 
Any news on why doShowTextDialog causes client to crash?
I tried having a NPC do doShowTextDialog and client crash, same if I open spellbook which uses doShowTextDialog

Function sendTextWindow at protocolgame.cpp

Replace it with:

Code:
void ProtocolGame::sendTextWindow(uint32_t windowTextId, uint32_t itemId, const std::string& text)
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(msg){
        TRACK_MESSAGE(msg);
        msg->AddByte(0x96);
        msg->AddU32(windowTextId);
        msg->AddItemId(itemId);

        msg->AddU16(text.size());
        msg->AddString(text);

        msg->AddString("");
    }
}
 
Function sendTextWindow at protocolgame.cpp

Replace it with:

Code:
void ProtocolGame::sendTextWindow(uint32_t windowTextId, uint32_t itemId, const std::string& text)
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(msg){
        TRACK_MESSAGE(msg);
        msg->AddByte(0x96);
        msg->AddU32(windowTextId);
        msg->AddItemId(itemId);

        msg->AddU16(text.size());
        msg->AddString(text);

        msg->AddString("");
    }
}
That's already on github as I remember
 
why so much viruses alert? false positives?
I see no download link on the first post of this thread that is where you can (and should) download things of xD you need to download the source code and compile it by yourself if you don't want to take any virus (false or not) into your pc
 
I see no download link on the first post of this thread that is where you can (and should) download things of xD you need to download the source code and compile it by yourself if you don't want to take any virus (false or not) into your pc

there's an actual .exe file in the github o_O
 
Back
Top