• 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. Sarah Wesker

    Lua Directional Spell & addEvent issue

    local combat = Combat() combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5)) local effects = {CONST_ME_MAGIC_BLUE, CONST_ME_MAGIC_RED, CONST_ME_MAGIC_GREEN} local disEffects = {CONST_ANI_ENERGY, CONST_ANI_FIRE, CONST_ANI_POISON} local function callback(cid, creaturePos...
  2. Sarah Wesker

    Lua Directional Spell & addEvent issue

    Yes, well it is a fairly simple example, but it is better to use predefined areas than to build the areas with functions in real time You can use the direction of attack with the objective and calculate the areas. I don't do it, because I'm going out, and I won't be back home for a while...
  3. Sarah Wesker

    Lua Directional Spell & addEvent issue

    Here I will leave you an example with two addresses, if you can finish the other addresses do so, if not let me know: -- LuaFormatter off local AR_S = createCombatArea{ {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {0, 1, 0}, {0, 3, 0} } local AR_N = createCombatArea{ {0, 3, 0}...
  4. Sarah Wesker

    Lua Directional Spell & addEvent issue

    You can do it like this, but you'll have to make do with an onCombatTile event, to provide the custom damage. local combat1 = Combat() combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)...
  5. Sarah Wesker

    Programmer CONDITION_INVISIBLE - Make character invisible

    I haven't tried it but it should work for players: local ghostTime = 1000 * 10 -- 10 seconds local removeEvents = {} local function removeGhost(playerId) local player = Player(playerId) if player then player:setGhostMode(false) end end function onCastSpell(creature...
  6. Sarah Wesker

    TFS 1.X+ Quick question about addEvent()

    Assuming that the item cannot be moved to any player or container, that is, it can only be moved on the map, you can do the following trick: local itemIdToEffectId = { [365] = 40, [370] = 41, [375] = 42, [380] = 43, [385] = 44 } local itemIdToTime = { [365] = 299, --...
  7. Sarah Wesker

    C++ TFS 1.2 Game::checkCreatureAttack high usage in performance

    At first glance everything seems correct. Maybe if the specialItems table is very large it could be optimized The local increase function could be optimized too, since building functions and tables are one of the most expensive things in Lua. Same for getAchievementInfo However, the best option...
  8. Sarah Wesker

    C++ TFS 1.2 Game::checkCreatureAttack high usage in performance

    I have checked the time each call takes in this attack cycle doAttacking consumes about 0.2 milliseconds when the attack is applied and 99% of this small period of time is taken up by Lua onHealthChange events Here is the event loop that consumes all the time...
  9. Sarah Wesker

    C++ TFS 1.2 Game::checkCreatureAttack high usage in performance

    If the attack speed on your server is very low, it is evident that 15 or 20+ players will cause this method to be called many times. When you choose a target, the method is called: doAttacking then from doAttacking checkCreatureAttack is called and checkCreatureAttack calls doAttacking again It...
  10. Sarah Wesker

    26.08.2023 TFS NEKIRO 7.72 <fmt> lib problem

    remove this code: You don't need this piece of code, and you do the same thing I told you Only in your case you need to change: farmat_as to static_cast<int>
  11. Sarah Wesker

    26.08.2023 TFS NEKIRO 7.72 <fmt> lib problem

    You must use the changes that were mentioned in the previous messages In the unlikely event that you can't compile, you can try doing the same but instead of tfs::to_underlying use static_cast<int> 😊 Example: <>
  12. Sarah Wesker

    TFS1.5 Downgraded to 8.6 Quest Log Support

    If you are using TFS 1.5 (master), you can activate this script and you will be able to load your xml file as usual in previous versions. Or just use the new way to create Quests in TFS: Game.createQuest("Tibia Tales", { storageId = 12650, storageValue = 1, missions = { {...
  13. Sarah Wesker

    TFS1.5 Downgraded to 8.6 Quest Log Support

    Also remember to mention which version you are using: TFS 0.x+? TFS 1.x+? Canary? OTBR? OTX? ect... Nobody is a magician/sorcerer to guess what engine you are using.
  14. Sarah Wesker

    TFS 1.X+ What client version is used on the current TFS master from Github?

    Simply add the corresponding fields -- MySQL mysqlHost = "127.0.0.1" mysqlUser = "" mysqlPass = "" mysqlDatabase = "" mysqlPort = 3306 mysqlSock = "" works the same way as always You can also obtain this data from ENV if you wish
  15. Sarah Wesker

    TFS 1.X+ What client version is used on the current TFS master from Github?

    https://github.com/otland/forgottenserver/blob/a9049040279bba57ef987196fd548b6c730593ef/src/definitions.h#L13
  16. Sarah Wesker

    Simple Question about LUA

    function onGetFormulaValues(player, skill, attack, factor) local min = ((((player:getLevel() * 4) + (attack * (skill*0.1)))/2)*crit) local max = ((player:getLevel() * 4) + (attack * (skill*0.1))*crit) player:addSoul(math.ceil(math.random(min, max) * 0.01)) return -min, -max end...
  17. Sarah Wesker

    Storage tfs 1.5 error

    it is very possible that you have more onLogin events in other scripts If you have recently added new scripts to your datapack you should consider that perhaps one of them is the cause of the error That guy mentioned onLogin because it is the main file, but there may be more If you have made...
  18. Sarah Wesker

    Storage tfs 1.5 error

    go to file: data/lib/compat/compat.lua and remove all this: Don't worry, this will be removed in the future anyway.
  19. Sarah Wesker

    Storage tfs 1.5 error

    function onLogin(player) local serverName = configManager.getString(configKeys.SERVER_NAME) local loginStr = "Welcome to " .. serverName .. "!" if player:getLastLoginSaved() <= 0 then loginStr = loginStr .. " Please choose your outfit." player:sendOutfitWindow()...
  20. Sarah Wesker

    [Tutorial] How to setup a server on Canary distro (13.21)

    Thank you very much for the contribution, the tutorial is very good, by following the steps you can open your server and website without any problem.
Back
Top