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

@Ezzz Would you say this distro is better to use than Avesta? For 7.4 gameplay using 7.72 client.
 
@Jakkess

It's on login.lua man, here's an example ;)

Code:
function onLogin(cid)

    if getPlayerLevel(cid) < 6 and getPlayerVocation(cid) ~= 0 then
        doTeleportThing(cid, ROOK_TEMPLE)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
        doPlayerSetTown(cid, ROOK_TOWN_ID)
        doPlayerSendCancel(cid, "Nottinghster rocks \o/")
    end   
   
    return true
end
 
@Jakkess

It's on login.lua man, here's an example ;)

Code:
function onLogin(cid)

    if getPlayerLevel(cid) < 6 and getPlayerVocation(cid) ~= 0 then
        doTeleportThing(cid, ROOK_TEMPLE)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
        doPlayerSetTown(cid, ROOK_TOWN_ID)
        doPlayerSendCancel(cid, "Nottinghster rocks \o/")
    end  
  
    return true
end

Sending players with vocation to rook keeping their skills?
 
@Nottinghster @Ezzz

I have 2 questions
First :

Now i can use utani gran hur + exura vita

how to do that on all spells and runes was one exhausted ?


And second :

I can change protocol for 7.4 or 7.6 and use client 7.7 ( with change directx ) ?
 
@Nottinghster @Ezzz

I have 2 questions
First :

Now i can use utani gran hur + exura vita

how to do that on all spells and runes was one exhausted ?


And second :

I can change protocol for 7.4 or 7.6 and use client 7.7 ( with change directx ) ?
If you want to chance it without editing in the sources you can just edit a exhaust value on every spell at spells.xml
customexhaust="2000"
Code:
    <instant name="Energy Strike" words="exori vis" lvl="12" maglv="3" mana="20" direction="1" customexhaust="1000" script="attack/energy_strike.lua">
        <vocation name="Sorcerer"/> <vocation name="Master Sorcerer"/>
        <vocation name="Druid"/>    <vocation name="Elder Druid"/>
    </instant>

This system overwrite the global exhaust in config.lua

Else you have to remove few lines in:
creature.cpp
game.cpp
player.cpp

cant even remember the other files.. but the first solution is one way you can do it.

Also, I wouldnt recommend people have no knowledge how to compile or edit within the sources to use OThire since there is many functions missing.. for example the one you stated about..
 
@EvulMastah

As I said, it's just an example ;)

@Daniel13

In spells.cpp,

bool Spell::playerSpellCheck(Player* player) const

Find this:

if( (isAggressive && player->hasCondition(CONDITION_EXHAUST_COMBAT)) ||
(!isAggressive && player->hasCondition(CONDITION_EXHAUST_HEAL)) )


Change to this:

if (player->hasCondition(CONDITION_EXHAUST_COMBAT) ||
player->hasCondition(CONDITION_EXHAUST_HEAL))
 
@Daniel13

Those servers self-called 7.4 are fake man.
They are running a 7.6/7.7 engine and client too, but they have changed their sprites to look like a 7.4, if you check the client, you'll see the SOUL below equipment.

Here's an example of what I'm talking about

HI4VVvzw.jpg


MfOd94O_D.jpg
 
.:: Rookgaard System ::.
"LUA Scripts"
For those who need it, including me, I've finished the system right now, it's tested and working 100%
It's a shame that OTHire doesn't have this included in sources :(

Here we go:

In functions.lua, add this:
Code:
function doPlayerAddMagicLevel(cid, value) 
local getmana = getPlayerRequiredMana(cid, getPlayerMagLevel(cid)) 
local spendedmana = ((getPlayerRequiredMana(cid, getPlayerMagLevel(cid) + value)) / getConfigValue("rate_mag")) 
    if isPlayer(cid) then 
        doPlayerAddSpentMana(cid, (getmana + spendedmana)) 
    else 
        error("Player not found in function doPlayerAddMagicLevel") 
    end 
end

In global.lua, add this:
Code:
-- Storage for Rook System
STORAGE_ROOK = 3000000

Now in folder creaturescripts > scripts, open the file firsitems.lua, erase everything inside it and paste this:
Code:
local firstItems = {2050, 2382}

function onLogin(cid)
    if getPlayerLastLogin(cid) == 0 or getPlayerStorageValue(cid, STORAGE_ROOK) == 1 then
        for i = 1, #firstItems do
            doPlayerAddItem(cid, firstItems[i], 1)
        end
        doPlayerAddItem(cid, getPlayerSex(cid) == 0 and 2651 or 2650, 1)
        local bag = doPlayerAddItem(cid, 1987, 1)
        doAddContainerItem(bag, 2674, 1)
        setPlayerStorageValue(cid, STORAGE_ROOK, 1)
    end
    return true
end

Now create a file called rook_system.lua, inside of the folder creaturescripts > scripts and paste this:
Code:
function onLogin(cid)
    if getPlayerLevel(cid) < 6 and getPlayerVocation(cid) ~= 0 then -- Check if player level is lower than 6 and vocation is different from No Vocation
        for i = 1, 10 do
            local slotItem = getPlayerSlotItem(cid, i)
            if slotItem.itemid > 0 then
                doRemoveItem(slotItem.uid) -- Remove All Equipments from Player
            end
        end
        doPlayerRemoveLevel(cid, getPlayerLevel(cid)) -- Set Player Level to 1
        setPlayerStorageValue(cid, STORAGE_ROOK, 1) -- First Items
        doPlayerSetVocation(cid, 0) -- Set Player No Vocation
        setCreatureMaxHealth(cid, 150)
        setCreatureMaxMana(cid, 0)
        doPlayerSetMaxCapacity(cid, 440) -- Set Max Capacity to 440 (Default Rookgaard)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) -- Set Max Health to 150 (Default Rookgaard)
        doCreatureAddMana(cid, getCreatureMaxMana(cid)) -- Set Max Mana to 0 (Default Rookgaard)
        doPlayerSetTown(cid, TOWN_ROOKGAARD) -- Set Player Town to Rookgaard, remember to change to your Rookgaard TOWN ID
        doPlayerAddMagicLevel(cid, -getPlayerMagLevel(cid)) -- Set Magic Level to 0
        doPlayerAddSkillTry(cid, 0, -getPlayerSkillLevel(cid, 0)) -- Set Fist Fighting Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 1, -getPlayerSkillLevel(cid, 1)) -- Set Club Fighting Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 2, -getPlayerSkillLevel(cid, 2)) -- Set Sword Fighting Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 3, -getPlayerSkillLevel(cid, 3)) -- Set Axe Fighting Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 4, -getPlayerSkillLevel(cid, 4)) -- Set Distance Fighting Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 5, -getPlayerSkillLevel(cid, 5)) -- Set Shielding Skill to 10 (Default Rookgaard)
        doPlayerAddSkillTry(cid, 6, -getPlayerSkillLevel(cid, 6)) -- Set Fishing Skill to 10 (Default Rookgaard)
        if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
            lookOutfit = 136 
        else 
            lookOutfit = 128 
        end
        doCreatureChangeOutfit(cid, {lookType=lookOutfit, lookHead=78, lookBody=69, lookLegs=58, lookFeet=76}) -- Set Rookgaard Outfit
        doTeleportThing(cid, getPlayerMasterPos(cid, TOWN_ROOKGAARD)) -- Teleport to Rookgaard
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) -- Some gay effect ;)
    end   

    return true
end

Now in folder creaturescripts > creaturescripts.xml, paste this:
Code:
<event name="RookSystem" type="login" script="rook_system.lua"/>

.:: SOURCE EDIT ::.
Open the file luascript.cpp, below this:
Code:
//doSavePlayer(cid)
lua_register(m_luaState, "doSavePlayer", LuaScriptInterface::luaDoSavePlayer);

Add this:
Code:
//getPlayerRequiredMana(cid, magicLevel)
lua_register(m_luaState, "getPlayerRequiredMana", LuaScriptInterface::luaGetPlayerRequiredMana);

Now find this:
Code:
//doSavePlayer(cid)
int LuaScriptInterface::luaDoSavePlayer(lua_State *L)
{
    uint32_t cid = popNumber(L);
    ScriptEnviroment* env = getScriptEnv();

    Player* player = env->getPlayerByUID(cid);

    if (player){
        if (IOPlayer::instance()->savePlayer(player)){
            lua_pushboolean(L, true);
            return 1;
        } else {
            lua_pushboolean(L, false);
        }
    } else {
        lua_pushboolean(L, false);
    }

    return 0;
}

And paste this below the code above:
Code:
int LuaScriptInterface::luaGetPlayerRequiredMana(lua_State* L)
{
    //getPlayerRequiredMana(cid, magicLevel)
    uint32_t magLevel = popNumber(L);

    ScriptEnviroment* env = getScriptEnv();
    if(Player* player = env->getPlayerByUID(popNumber(L)))
        lua_pushnumber(L, player->vocation->getReqMana(magLevel));
    else
    {
        reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }

    return 1;
}

Now in luascript.h, below this:
Code:
static int luaDoPlayerAddMana(lua_State *L);

Add this:
Code:
static int luaGetPlayerRequiredMana(lua_State* L);

And it's done !!!

Hope you all enjoy it ;)
 
Why checking is cid is player after doing operations on it in "doPlayerAddMagicLevel(cid, value)"?

Why deleting all items instead of moving them on the ground? Anyway, why is it onLogin instead of onDeath or if it exists in OTHire - onAdvance?

Default cap is 400 on rook.

doCreatureAddMana(cid, getCreatureMaxMana(cid)) - why are you adding 0 mana?

doPlayerAddSkillTry(cid, 0, -getPlayerSkillLevel(cid, 0)) - I do not really think this sets the skill level to 10, unless this function works in some strange way, which I dont think it does.
 
Did you started mysql server?
This server needs a database on MySql running on background (you have to import schema), then you change the options that @Emky said on config.lua
Bro please im very noob making this how and wich software i need use to do this ? explain me please if u have time thanks :)
 
Back
Top