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

Search results

  1. Non Sequitur

    Lua [TFS 1.X] Poison Arrow, % Chance of poison instead of poison per hit

    local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW) combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0) local condition =...
  2. Non Sequitur

    Compiling [TFS 1.2] Outifts and Mounts limit

    Right now you can have 65536 different lookTypes and 65536 different mounts, are you seriously considering adding more outfits/mounts than that?
  3. Non Sequitur

    Solved Attempt to index a nil value problem [TFS 1.2]

    This is not how a rational discussion works. Can you refer to any source from which you can base the following claim: "there is no such thing as a legacy function"? Because I can find a lot of them: "The term can also mean code inserted into modern software for the purpose of maintaining an...
  4. Non Sequitur

    Solved 1.2 Actions script help, please

    if player:getPosition() ~= Position(config.stand) then Should be: if player:getPosition() ~= Position(config.stand[1]) then
  5. Non Sequitur

    Solved Attempt to index a nil value problem [TFS 1.2]

    1) The order does matter, the item is always the second parameter in onUse: (reference) onUse(player, item, fromPosition, target, toPosition, isHotkey) 2) There are no uid or actionid members in an Item object, the valid members (all of them functions) are these: reference. I stand corrected.
  6. Non Sequitur

    Creating new item

    I know he wants to, I was just explaining to @Lava Titan how to create an item with its own attributes that looks like an existing item. If the OP wants a new item type, then there is no other way than editing the items.otb/items.xml accordingly. And even then, having two items sharing the same...
  7. Non Sequitur

    Creating new item

    @Lava Titan There is no way to create an item like that in Lua, what you can do is create a "fake" item, it will have the same id but you can customize its attributes/behavior with Lua.
  8. Non Sequitur

    Creating new item

    @Lava Titan I just mentioned you are writing it wrong. Anyway, there is no such attribute, what you need to do is create an amulet of loss with Game.createItem and then change this item's attributes to whatever your "new" item should have, if it should be called Amulet of the Stars, change its...
  9. Non Sequitur

    Creating new item

    I wasn't referring to you. Back to topic, I don't think it is a good idea to have two items sharing the same spriteId (clientId), there would be no way for the server to know which item the client is referring to, since the client only knows about the clientId. This is a function that wouldn't...
  10. Non Sequitur

    Creating new item

    @Lava Titan You can simply create an item with Game.createItem and set its attributes with item:setAttribute(attribute, value). These are the attributes you can change that way: registerEnum(ITEM_ATTRIBUTE_NONE) registerEnum(ITEM_ATTRIBUTE_ACTIONID) registerEnum(ITEM_ATTRIBUTE_UNIQUEID)...
  11. Non Sequitur

    [TFS 1.2] Luascript channel

    You shouldn't have items and positions hard coded in the environment because they aren't updated, they will be the same values from the first time the player used the console and accessing them could crash the server (e.g container:getName() after throwing your backpack in the water or trash). I...
  12. Non Sequitur

    Understading a server, (forgottenserver/opentibia/C++ codebase)

    The Asio dispatcher runs in one thread, however I can't tell you if it spawns other threads to invoke the callbacks passed to it, I don't think it does but you would have to look up the implementation details to know that for sure. And no, requests aren't queued per se, they will be dealt with...
  13. Non Sequitur

    Understading a server, (forgottenserver/opentibia/C++ codebase)

    TFS has a lot of concurrent programming going on, that is the reason you will see a lot of mutexes throughout the code, as I'm sure you know, they provide thread safety by preventing that multiple threads access the same resource at the same time. TFS uses Boost.Asio to asynchronously handle...
  14. Non Sequitur

    Solved Memory Leak ~ 12Gb of Ram Usage

    You can't leak memory in Lua because of the garbage collector. Memory "leaks" whenever you grab a piece of memory from the heap and it becomes either unreachable (zero pointers that point to it) or your code fails to clean it up. In Lua (and many other languages), however, whenever an object is...
  15. Non Sequitur

    Lua TFS 1.0 | Reward chest system, some advises?

    @ATT3 I have made a pull request on the TFS repository that implements such feature. It was made for TFS 1.2 but perhaps it could be useful for you in other ways.
  16. Non Sequitur

    Spell help! Easy!

    Try this: local function executeCombat(cid, var) local creature = Creature(cid) if creature then combat:execute(creature, var) end end local hitCount = 5 function onCastSpell(creature, var) combat:execute(creature, var) for i = 1, hitCount - 1 do...
  17. Non Sequitur

    Solved Attempt to index local 'player' problem [TFS 1.2]

    Try this: function onThink(interval) for _, player in ipairs(Game.getPlayers()) do if player:getStorageValue(76965) < 1 then print("Bot inspection.") player:sendTextMessage(22, "You have 3 minutes to say !antibot or you going to get kicked.")...
  18. Non Sequitur

    Compiling Problem Compiling Latest TFS (Windows)

    Download and compile mpir. And no, the workaround is fine if you can't update your libraries.
  19. Non Sequitur

    Compiling Problem Compiling Latest TFS (Windows)

    You can either update your mpir libraries, as implied by @Call Me Taffy, or use this workaround. Add this line after the last #include in any .cpp file (e.g actions.cpp): extern "C" {FILE __iob_func[3] = {*stdin, *stdout, *stderr}; }
  20. Non Sequitur

    Solved Add Condition onUse

    Remove this line combat:setCondition(condition) And add this instead: player:addCondition(condition)
Back
Top