Ninja's best answers

  • Ninja

    TFS 1.X+ monsters cant see me, more tiles to the screen

    You need to increase the range for Monster::canSee.
  • Ninja

    OTC open containers limit, is that OTC or server sided?

    Try increasing the following value: otland/forgottenserver & otland/forgottenserver
  • Ninja

    Block Renegeration

    Here you go (Moving this thread to Requests by the way) :p condition.cpp bool ConditionRegeneration::executeCondition(Creature* creature, int32_t interval) { internalHealthTicks += interval; internalManaTicks += interval; if (creature->hasRegenerationBlocked() ||...
  • Ninja

    Lua NPC problem.

    You need to register the callback: npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  • Ninja

    TFS 1.X+ Help with refactoring code

    You could take advantage of Position.getNextPosition.local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) local function movePlayer(cid, direction, executions, maxExecutions) local player = Player(cid) if not player then return end local position...
  • Ninja

    TFS 1.X+ Make 2nd player optional on quest

    You already have all the tools you need, all you have to do is rearrange the content of the 1st for loop. for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions[i]):getTopCreature() if not playerTile or not playerTile:isPlayer() then...
  • Ninja

    TFS 1.X+ Prevent Entering houses

    It can be prevented by removing the following snippet from house.cpp (or by removing the flag CanEditHouses from the GM/CM group): otland/forgottenserver
  • Ninja

    TFS 1.X+ Compilling TFS on debug mode

    You can specify the build type when you generate the build files with CMake. I personally would go for RelWithDebInfo instead of Debug. cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
  • Ninja

    Solved Spell crashing server [TFS 1.2]

    You should never pull stunts like that with items. In this scenario, it most likely crashes the server due to one (or more) item(s) are no longer available in the game. I have prepared a snippet that should take care of the issue you're currently facing: function onCastSpell(creature, var)...
  • Ninja

    Lua Lua Issue (math related)

    It should be running now after altering a few lines: Revisions - Lua Issue (math related) P.S. I'm not going to rewrite the script for you this time, so you're on your own now! ;)
  • Ninja

    Stamina Assistance

    player:setStamina(math.max(0, player:getStamina() - charge))
  • Ninja

    Lua TFS 0.3.7, NPC default speech, how to change?

    If you had gone through the content of npchandler.lua thoroughly, you would have seen that you're presented with two options ;) npcHandler:setMessage(MESSAGE_GREET, "someGreetMessage") <parameter key="message_greet" value="someGreetMessage" /> -- Edit -- Sorry, the XML approach can be found...
  • Ninja

    Lua Can you make this script shorter?

    I honestly can't fathom why you would avoid using a simple table lookup in this instance. The content is already minimal, and what you possibly gain/lose performance-wise (we are talking about nanoseconds now) is simply not worth the trouble.
  • Ninja

    Downgrading TFS 1.2

    It sounds like you might have skipped a few things here and there. Here is an old 1041 patch I created quite some time ago: 1041 downgrade · GitHub (Perhaps it can be of some help).
  • Ninja

    [TFS 1.3][C++/Creaturescripts] Monsters - Non Agro.

    Feature - Simple passive monsters
  • Ninja

    Lua RESET SYSTEM

    Greetings, You can easily add something like that by modifying the contents of the Player events 'onLook' & 'onLookInBattleList' (which you find in the events directory). onLook (below L6): if thing:isCreature() and thing:isPlayer() then description = string.format("%s\nResets: %d"...
  • Ninja

    Solved !shop command not working

    Znote AAC offers up to three different script versions (0.2, 0.3, and tfs 1.0). Why didn't you pick the script that matches your server version?
  • Ninja

    Solved close channel network message

    I still recommend you to modify the source code because you still need to remove the user from the channel itself. function Player.sendCloseChannel(self, channelId) local networkMessage = NetworkMessage() networkMessage:addByte(0xB3) networkMessage:addU16(channelId)...
  • Ninja

    Solved [1.x] disable full light for gods

    You can disable full light for 'access characters' by modifying the following line in protocolgame.cpp: https://github.com/otland/forgottenserver/blob/9c27677b4f660a6c8122a66cfc4e4f2a37257f3e/src/protocolgame.cpp#L2929
  • Ninja

    Compiling XP Gain Rate (client) TFS 1.2

    Here you go : https://gist.github.com/ninjalulz/9dd60115a61745231e69dc8282bb376b
Top