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

[8.0] - TFS 1.2

Bug when sending parcel, if there is a spacing in front of the player's name, the parcel is excluded and doesn't go anywhere, for example

"Player____" <------ Bug here, parcel deleted! (bug)
"Carlin"
So the parcel is deleted and the items lost

just like that it works
"Player" <------ Parcel works! (Normal)
"Carlin"

In case the name is wrong
"Playerfsad" <------ Parcel don't works, and it's not excluded (Normal)
"Carlin"
The parcel will stay on top of the mail and nothing will happen.
 

Attachments

Bug when sending parcel, if there is a spacing in front of the player's name, the parcel is excluded and doesn't go anywhere, for example

"Player____" <------ Bug here, parcel deleted! (bug)
"Carlin"
So the parcel is deleted and the items lost

just like that it works
"Player" <------ Parcel works! (Normal)
"Carlin"

In case the name is wrong
"Playerfsad" <------ Parcel don't works, and it's not excluded (Normal)
"Carlin"
The parcel will stay on top of the mail and nothing will happen.

change bool
Lua:
bool Mailbox::sendItem(Item* item) const
to

Lua:
bool Mailbox::sendItem(Item* item) const
{
    std::string receiver;
    uint32_t depotId = 0;
    if (!getReceiver(item, receiver, depotId)) {
        return false;
    }

    /**No need to continue if its still empty**/
    if (receiver.empty() || depotId == 0) {
        return false;
    }

    Player* player = g_game.getPlayerByName(receiver);
    if (player) {
        DepotLocker* depotLocker = player->getDepotLocker(depotId);
        if (depotLocker) {
            if (g_game.internalMoveItem(item->getParent(), depotLocker, INDEX_WHEREEVER, item, item->getItemCount(), nullptr) == RETURNVALUE_NOERROR) {
                g_game.transformItem(item, item->getID() + 1);
                player->onReceiveMail();
                return true;
            }
        }
    } else {
        Player tmpPlayer(nullptr);
        if (!IOLoginData::loadPlayerByName(&tmpPlayer, receiver)) {
            return false;
        }

        if (DepotLocker* depotLocker = tmpPlayer.getDepotLocker(depotId)) {
            if (g_game.internalMoveItem(item->getParent(), depotLocker, INDEX_WHEREEVER, item, item->getItemCount(), nullptr) == RETURNVALUE_NOERROR) {
                g_game.transformItem(item, item->getID() + 1);
                tmpPlayer.setLastDepotId(depotLocker->getDepotId());
                IOLoginData::savePlayer(&tmpPlayer);
                return true;
            }
        }
    }
    return false;
}

and bool
Lua:
bool Mailbox::getReceiver(Item* item, std::string& name, uint32_t& depotId) const
to:

Lua:
bool Mailbox::getReceiver(Item* item, std::string& name, uint32_t& depotId) const
{
    const Container* container = item->getContainer();
    if (container) {
        for (Item* containerItem : container->getItemList()) {
            if (containerItem->getID() == ITEM_LABEL && getReceiver(containerItem, name, depotId)) {
                return true;
            }
        }
        return false;
    }

    const std::string& text = item->getText();
    if (text.empty()) {
        return false;
    }

    std::string townName;
    std::istringstream iss(item->getText(), std::istringstream::in);
    getline(iss, name, '\n');
    getline(iss, townName, '\n');

    trimString(name);
    Town* town = g_game.map.towns.getTown(townName);
    if (town) {
        depotId = town->getID();
        return true;
    }

    return false;
}
 
Bug when sending parcel, if there is a spacing in front of the player's name, the parcel is excluded and doesn't go anywhere, for example

"Player____" <------ Bug here, parcel deleted! (bug)
"Carlin"
So the parcel is deleted and the items lost

just like that it works
"Player" <------ Parcel works! (Normal)
"Carlin"

In case the name is wrong
"Playerfsad" <------ Parcel don't works, and it's not excluded (Normal)
"Carlin"
The parcel will stay on top of the mail and nothing will happen.

In mailbox.cpp

bool
C++:
bool Mailbox::getReceiver(Item* item, std::string& name) const

Put
C++:
trimString(name);

above:
C++:
    trimString(strTown);
    Town* town = g_game.map.towns.getTown(strTown);
    if (town) {
        depotId = town->getID();
        return true;
    }

    return false;
}

and recompile
 
There's another problem on the server that I can't solve for days, it's about the sale of vial, when selling the via the npc buys manafluid and lifefluid, I'm not sure if it's a problem with the sources, because I've tried several ways and I couldn't solve.

I already tried all these ways and the error still persists. in npc lua or xml.

exemples:

lua
shopModule:addSellableItem({'vial', 'flask'}, 2006, 5, 'vial')
shopModule:addSellableItem({'vial', 'flask'}, 2006, 5, 0, 'vial')
shopModule:addSellableItem({'vial', 'flask'}, 2006, 5, 8, 'vial')

or

xml
<parameter key="shop_buyable" value="vial,2006,5" />

all these ways and the npc still buy any full bottle


another fact, when placing an empty vial in the hotkey, it counts all full vials as vial.
 

Attachments

Upgrade to 8.10 and after creating the ultimate healing rune there is a crash client
Anyone know where the problem is?
 
Last edited:
Upgrade to 8.10 and after creating the ultimate healing rune there is a crash client
Anyone know where the problem is?
If you want help with something unrelated to the distro of this topic, go to the support section please.I will not answer here.
 
rn6KZd2.gif

After quickly going down the NPC continues to talk to me.
I am using the NPC Addoner which is in your distribution and it gives me an error:
stack traceback:
[C]: in function '__index'
data/npc/scripts/addon.lua:100: in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:401: in function 'onCreatureSay'
data/npc/scripts/addon.lua:7: in function <data/npc/scripts/addon.lua:7>

7:
Lua:
function onCreatureSay(cid, type, msg)         npcHandler:onCreatureSay(cid, type, msg)     end

100:
Lua:
                doPlayerAddOutfit(cid, addoninfo[rtnt[talkUser]].outfit_male, 3)
 
good afternoon everybody

I have a problem with this TFS...

I put the runes to be stackable, but I can't move them in quantities, only 1 by 1...

runes.gif
 
good afternoon everybody

I have a problem with this TFS...

I put the runes to be stackable, but I can't move them in quantities, only 1 by 1...

View attachment 74093
take a look at it, it happened my TFS 1.2 was like this bug, I followed the tutorial and it solved the problem..
 
This is the tfs downgraded by ninja , i did some changes for myself ,and now i want to share .I never hosted it and don't know if it's stable or not , i am not a skilled programmer but i didn't find any critical bug yet. Maybe someone finds these files usefull =) ,all credits goes to @Ninja for this downgrade and for tfs team .If someone find bugs or have some fixes share with us =)

fixed stairhope delay (now its working properly on config.lua)
fixed send parcel to offline players -- credits to Gesior.pl --
fixed stackpos -- credits to Nekiro --
fixed Check that player partner isn't self -- jo3bingham --
fixed Update premium time on login -- credits to Nekiro --
fixed client debug when gm or monster spawn on player -- credits Ferrus --
fixed distance attacks not hitting targets on the same sqm -- credits Anastaciaa --
fixed logout delay when player is disconected
fixed Unpassable and movable item teleport bug -- credits mattyx14 --
Moved shared experience formula to Lua -- credits DSpeichert ,edumntg and me --
removed party description onlook ex:Your party has 2 members and 0 pending invitations.
removed guild online and count members onlook
removed damage ,heal and experience message to spectators
changed /clean command ,now cleans protect zones
changed unjustified kill warning message to red =)
changed skill advance message
added autostack, configurable on config.lua
added allow fight back, configurable on config.lua
added loot message, configurable on config.lua
added loot channel -- credits to cbrm --
(if you dont want the loot channel to open everytime a player login, just remove this line on creaturescripts <event type="login" name="loot" script="loot.lua"/>

added field owner name onlook -- credits to Steve Albert --
added magic wall and wild growth counter
added players can walk through GMs in ghost mode
added Walkthrough everything Ctrl + Arrow keys -- credits to Printer --
added classicAttackSpeed, configurable on config.lua -- credits to Mkalo --
Monster direction fix (monsters standing to your left look to the east and monsters standing to your right look to the west.) -- credits to joseluis2g --

*skull in protect zone ,if you throw some field and enter pz ,you will get white skull if someone step in the field
*crash related to login(i am only able to reproduce this if i login with the host machine): C++ - crash tfs 1.2 downgraded by Ninja (https://otland.net/threads/crash-tfs-1-2-downgraded-by-ninja.258451/#post-2544655)
*runes stack inside full containers bug ,there is a workaround for this , but it's still a bug : TFS 1.X+ - tfs 1.2 runes on container (https://otland.net/threads/tfs-1-2-runes-on-container.262139/#post-2535403)
(workaround for this bug is : remove attribute key="type" value="rune" from all runes in items.xml ,change the runes properties to stackable in Tibia.SPR with object builder, and reload the atributes of items.otb with some itemeditor)

*weird monsters walk animation :Windows - Monsters lagging/appear to be dashing (https://otland.net/threads/monsters-lagging-appear-to-be-dashing.250419/)

Well for now this is my last update ,if anyone finds a bug(or want to contribute ), you can report here in this thread or here in github celohere/forgottenserver (https://github.com/celohere/forgottenserver)
New Changes
**fixed the use of lifefluid on hotkeys -- crédits to me --
**fixed fluid wrong message on hotkeys -- crédits to danielsalim1 --
**fixed bug of runes in full container -- crédits to me --
**fixed monsters walk dashing -- crédits to me --
**fixed crash on login -- crédits to danielsalim1 and mattyx14 --
**added auto recharge ammo (arrows and bolts recharges automatically now) -- crédits to Joe Rod and Emilianenko --
**added player ban -- crédits to Gesior.pl -- (now the ban for excessive player killing is banning only the player, and not the entire account)



fixed stairhope delay (now its working properly on config.lua)
fixed send parcel to offline players -- crédits to Gesior.pl --
fixed stackpos -- crédits to Nekiro --
fixed Check that player partner isn't self -- crédits to jo3bingham --
fixed Update premium time on login -- crédits to Nekiro --
fixed client debug when gm or monster spawn on player -- crédits to Ferrus --
fixed distance attacks not hitting targets on the same sqm -- crédits to Anastaciaa --
fixed logout delay when player is disconected
Moved shared experience formula to Lua -- crédits to DSpeichert ,edumntg and me --
removed party description onlook ex:Your party has 2 members and 0 pending invitations.
removed guild online and count members onlook
removed damage ,heal and experience message to spectators
changed /clean command ,now cleans protect zones
changed unjustified kill warning message to red =)
changed skill advance message
added autostack, configurable on config.lua
added allow fight back, configurable on config.lua
added loot message, configurable on config.lua
added loot channel -- crédits to cbrm --
(if you dont want the loot channel to open everytime a player login, just remove this line on creaturescripts <event type="login" name="loot" script="loot.lua"/>
added field owner name onlook -- crédits to Steve Albert --
added magic wall and wild growth counter
added players can walk through GMs in ghost mode -- crédits to me --
added Walkthrough everything Ctrl + Arrow keys -- crédits to Printer --
added classicAttackSpeed, configurable on config.lua -- crédits to Mkalo --
Monster direction fix (monsters standing to your left look to the east and monsters standing to your right look to the west.) -- crédits to joseluis2g --


Known Bugs:

*skull in protect zone ,if you throw some field and enter pz ,you will get white skull if someone step in the field
brother, good morning, are you still working on this ot? keep fixing the source plx bugs.. i like this one ot :)
I'll keep an eye on the commits!
 
I'm using a task system that is counting in the party, but it counts for who deals the most damage and who gives the last hit, if the same player deals more damage and the last hit, the task counts 2x for each one... help?

function onKill(player, target)
if target:isPlayer() or target:getMaster() then
return true
end

local party = player:getParty()
print("Killer: " .. player:getName())
print("Target: " .. target:getName())
local players = {}
if party then
print("There was a party")
players = party:getMembers()
leader = party:getLeader()
print("Party leader:" .. leader:getName())
table.insert(players, leader)
else
print("Solo")
players = {player}
end

print("Number of players in party: " .. #players)


for p = 1, #players do
local partyMember = players[p]
print("Processing kill for player " .. partyMember:getName())
local targetName, startedTasks, taskId = target:getName():lower(), partyMember:getStartedTasks()
for i = 1, #startedTasks do
taskId = startedTasks
if isInArray(tasks[taskId].creatures, targetName) then
local killAmount = partyMember:getStorageValue(KILLSSTORAGE_BASE + taskId)
if killAmount < tasks[taskId].killsRequired then
partyMember:setStorageValue(KILLSSTORAGE_BASE + taskId, killAmount + 1)
partyMember:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,'You kill: ' .. killAmount + 1 .. "/" .. tasks[taskId].killsRequired .. " " ..tasks[taskId].raceName)
else
partyMember:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,'You complete task of ' ..tasks[taskId].raceName)
end
end
end
end
return true
end

--MESSAGE_STATUS_DEFAULT
 
@celohere Thanks a lot! That was the thing that annoyed me the most in this engine. You have repaired the problem that runes didnt stack properly - instead charges it had runes quantity and you could only move one at once..
Also:
<attribute key="type" value="rune" />
need to be written under every rune in items.xml.

Psst @Hover Design
how to stack runes bro, mi cliente and items otb not stackable
 
ubuntu@vps-1a50b3a5:~/ots/src/build$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/ots/src/build
ubuntu@vps-1a50b3a5:~/ots/src/build$ make
Hi, I have a problem with compilation. after entering "cmake.." I get this message. it says that the build has been created but it is nowhere to be found. entering "make" later does nothing. please help.
 
Back
Top