• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Search results

  1. Z

    Windows Server Crashes

    First of all: Client info: Tibia / OTC, version, revision (if OTC). Server info: distro, revision Then, do you get any error message from the client? And what's even more important, what crashes?? (Topic states it's the server, here you talk about tibia crashing). In either scenario, do you...
  2. Z

    onBlock/blockHit function?

    Well, if monster deal no damage, it is either because it was blocked by armor or shield of the player (or other custom stuff, like resistance). And at least in TFS 1.2+ this is done BEFORE dealing any damage and if the block is successful (either by armor or shield), the function returns - no...
  3. Z

    tfs 1.2+ How to change healing colour?

    enum TextColor_t : uint8_t { TEXTCOLOR_BLUE = 5, TEXTCOLOR_LIGHTGREEN = 30, TEXTCOLOR_LIGHTBLUE = 35, TEXTCOLOR_MAYABLUE = 95, TEXTCOLOR_DARKRED = 108, TEXTCOLOR_LIGHTGREY = 129, TEXTCOLOR_SKYBLUE = 143, TEXTCOLOR_PURPLE = 155, TEXTCOLOR_RED = 180...
  4. Z

    tfs 1.2+ How to change healing colour?

    This link leads you to the correct line for health change and it is even highlighted. Put some effort at least and read what you've been given..
  5. Z

    Change damage numbers to text (example 10000 to 10k) [TFS 1.2]

    I think what he meant is that the protocol itself does not support it (the client application). With OTClient it should be possible though (perhaps would require some modifications of OTC too).
  6. Z

    Changing Level Cap [TFS 1.2]

    You would need to use boost::multiprecision and use uint128_t (128-bit integer) depending what is actually "blocking" you. I would say it's most probably experience points, so you would need to modify your source to represent the experience as 128-bit integer (it's 64-bit probably). You would...
  7. Z

    Lua Remove Target from Player

    Great, I added missing then (damn lua, I will never get used to this) and searchTarget call for monsters to my post! // edit I applied rest of changes you have done. I'd have probably tested it myself, but I don't have any working Tibia / OTC :)
  8. Z

    Lua Remove Target from Player

    This seems interesting. I didn't even know NetworkMessage is available in lua. I guess I need to take back what I said about not being able to do this in lua then :) So just to complete my solution: local function sendCancelTarget(player) local msg = NetworkMessage() msg:addByte(0xA3)...
  9. Z

    Lua Quest time online to do again

    Sorry. I didn't really check the parts I didn't modify and they contained more errors. local mins = 60 * 1000 local hours = 60 * 60 * 1000 local days = 24 * 60 * 60 * 1000 local quests = { [8000] = { item = 2385, lvl = 1, time = 1 * mins }, -- sabre [8001] = { item = 2485, lvl = 2, time...
  10. Z

    Lua Check items in bp

    You want to check ONLY these two slots? Because otherwise, this script will check all player items, including these slots. If you want to only check these two slots, you can use Player:getSlotItem(SLOT) and compare to the item you want to find.
  11. Z

    Lua Remove Target from Player

    The only feasible solution would be to expose the sendCancelTarget method via lua player::sentCancelTarget, if you really need this. Then you would just call it after setTarget.
  12. Z

    Lua Quest time online to do again

    Your two if statements break scoping / blocks. Try this: local mins = 60 * 1000 local hours = 60 * 60 * 1000 local days = 24 * 60 * 60 * 1000 local quests = { [8000] = { item = 2385, lvl = 1, time = 1 * mins }, -- sabre [8001] = { item = 2485, lvl = 2, time = 5 * mins}, -- doublet...
  13. Z

    Lua Check items in bp

    Sorry, didn't see it. local items = { 2160, } local function checkItems(playerUid, items) local player = Player(playerUid) if not player then return false end for i = 1, #items do if player:getItemCount(items[i]) > 0 then npcHandler:say('Remove the items first.'...
  14. Z

    Lua Remove Target from Player

    Just to clarify things, the code (lua) I gave you make attackers stop attacking, right? Just the client state is not updated (the red square marker)? I just pointed you to source code responsible for this behaviour. Here the Creature::setAttackedTarget is called and if this returns false...
  15. Z

    Lua Remove Target from Player

    Yes, you can't use Monster:removeTarget if your attacker is a player. so Creature:setTarget does actually work (attacker stops attacking the player), but not like you expected (no update on client side). I did find the reason for this in source code and I believe this is expected behaviour of...
  16. Z

    Lua Remove Target from Player

    Yes, because your code is wrong. You need to check if target is equal to the player. Just like it is done in my code. Creature:getTarget() takes no arguments. local playersOnly = false local player = Player(cid) local attackers = Game.getSpectators(player:getPosition(), false, playersOnly, 10...
  17. Z

    Lua Remove Target from Player

    ###### getTarget() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local creature = Creature(...) creature:getTarget() ``` > **Added in version:** 1.0 As for getSpectators: Game.getSpectators(position[, multifloor = false[, onlyPlayer = false[, minRangeX...
  18. Z

    Lua Remove Target from Player

    Try this: function onCastSpell(cid, var) local player = Player(cid) local attackers = Game.getSpectators(player:getPosition(), false, false, 0, 10, 0, 10) for i = 1, #attackers do if attackers:getTarget() == player then attackers:setTarget(nil) end...
  19. Z

    Lua Quest time online to do again

    Replace this (line 27): if getPlayerFreeCap(cid) >= getItemWeightById(quest, 1) then with if getPlayerFreeCap(cid) >= getItemWeightById(quest.item, 1) then
  20. Z

    Lua Only in protection zone

    Then there must be something else missing. I'm afraid this is where my knowledge ends regarding this. I assume you didn't configure your server to 1 frags for red skull? :) I also think you should mark this thread as answered and create a new one instead, concerning your new issue (since the...
Back
Top