colandus

  1. Colandus

    mapArea iterator

    Hey. This is a revised version of my old mapArea iterator. This simplifies looping through areas. My old iterator was a bit more confusing for developers who might have wanted to edit the iterator function itself. This time it's using coroutines so the function should be very easily...
  2. Colandus

    [TFS 1.x] Run with CTRL (Advanced Version)

    Hey. This code will allow GM's to run with CTRL. It has some special features too, unlike the regular ones. Features Ghost while running. Because I believe it looks ugly and not serious to run through walls in front of regular players, and also GM's running in general (in front of players), I...
  3. Colandus

    parseAreaMap - extract positions from "map" table

    This function will convert a table like this: local areaMap = { {1,2,0,2,1}, {2,0,0,0,2}, {0,0,3,0,0}, {2,0,0,0,2}, {1,2,0,2,1} } Into this: { [1] = { {x=-2, y=-2}, {x=2, y=-2}, {x=2, y=2}, {x=-2, y=2} }, [2] = { {x=-2, y=-1}...
  4. Colandus

    Repeating events EASIER

    ----------------- -- By Colandus -- _CONT = {} function continue(delay, n, ...) local func = debug.getinfo(2).func if(not _CONT[func]) then _CONT[func] = true addEvent(repeatContinue, delay, func, delay, n, ...) end end function repeatContinue(func, delay, n, ...)...
  5. Colandus

    Teleport players from area (optionally offline)

    Teleport players from a certain area to a new position... Also has the option to teleport offline players. Usage is simple: doTeleportPlayersFromArea(fromPos, toPos, newPos, offlinePlayers --[[ = false]]) set offlinePlayers to true to enable offline players teleport!! do -- Function by...
  6. Colandus

    Spell Death Flames: Mages (Animated)

    A spell from my old server (Original Rox0r + TheOTServer) used by Mages. local repeatAmount = 3 local deathFlamesArea = { createCombatArea({ {0, 1, 0}, {1, 2, 1}, {0, 1, 0} }), createCombatArea({ {0, 1, 1, 1, 0}, {1, 1, 0, 1, 1}, {1...
  7. Colandus

    Spell Holy Death: Mages (Animated)

    A spell from my old server (Original Rox0r + TheOTServer) used by Mages. local holyDeathArea = { createCombatArea({ {0, 1, 0}, {1, 2, 1}, {0, 1, 0} }), createCombatArea({ {0, 1, 1, 1, 0}, {1, 1, 0, 1, 1}, {1, 0, 2, 0, 1}, {1...
  8. Colandus

    Spell Stay Away: Knights (Animated)

    A spell from my old server (Original Rox0r + TheOTServer) used by Knights. local holyWaveArea = { createCombatArea({ {0, 1, 0}, {1, 2, 1}, {0, 1, 0} }), createCombatArea({ {0, 1, 1, 1, 0}, {1, 1, 0, 1, 1}, {1, 0, 2, 0, 1}, {1...
  9. Colandus

    Spell Fierce Berserk: Knights (Animated)

    A spell from my old server (Original Rox0r + TheOTServer) used by Knights. local spinAreas = { createCombatArea({ {2, 1} }), createCombatArea({ {2, 0}, {0, 1} }), createCombatArea({ {2}, {1} }), createCombatArea({ {0...
  10. Colandus

    [CHECK!] get/set/toggle player setting status USE ONLY ONE STORAGE VALUE

    Hey! This great system will allow you to save "settings" into a players storage value using ONLY 1 STORAGE VALUE! However this will only store boolean values (true/false). So, if you use storage value 82000 for your settings, then you will be able to store an infinite amount of settings in just...
  11. Colandus

    event managing functions

    Functions used to repeat an event certain amount of times... Functions can be found here: http://otland.net/f139/use-addevent-properly-loops-50914/ (waste to rewrite them, if they're there) :D They'll be more noticable here ;)
  12. Colandus

    Lua Use addEvent properly with loops

    Use addEvent properly with loops (+ XTRA FUNCTION) Hello... I've seen quite a lots of scripts looping addEvent in a bad way. This will most likely cause your server to lag! Have you ever noticed that you made a spell with over 30 "animated" effects that will lag your server? Well, one reason...
  13. Colandus

    A few useful functions (CHECK!)

    -- Returns the top item on a tile. function getTopItem(pos) pos.stackpos = 1 + getTopCreature(pos).itemid return getTileThingByPos(pos) end -- Teleport a creature with effects, invisible players will not show effects! function doTeleportCreature(cid, pos, pushmove) if(not...
  14. Colandus

    Action Desert/Vocation Quest Script [7.92+]

    local config = { -- level needed to make the quest level = 20, -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards) redo = { status = true, -- true = unlimited, false = once storageValue = 4535 -- only if status...
  15. Colandus

    Multi Quest

    Class for "multi quests" :) Note: The code is untested (cookie for whoever tests it for me!) missionQuest = {} missionQuest.__index = missionQuest function missionQuest.new(doneStorage, confirmedStorage) if(type(doneStorage) ~= 'number') then return FALSE, error("missionQuest...
  16. Colandus

    Simple VIP system

    function getPlayerLastLogin(cid) local lastLogin = getPlayerStorageValue(cid, 45345) if(lastLogin < 0) then doPlayerUpdateLastLogin(cid) return os.time() end return lastLogin end function doPlayerUpdateLastLogin(cid) setPlayerStorageValue(cid, 45345...
  17. Colandus

    TFS 0.3 db class for 0.2

    Hey I made this for my 0.2 server as I didn't feel for updating to 0.3 :D However, the case was that I had made some scripts for my other server which is 0.3 and I didn't feel for remaking them to 0.2 sql functions~ Here I made this class so you can use 0.3 db crap in ur 0.2 serv Make new...
  18. Colandus

    timeString(timeDiff) - "23 hours, 30 minutes and 10 seconds"

    Hey there ;) I made this for a script :p It's very simple to add more date formats, currently its only days, hours, minutes and seconds. UPDATED 2017-02-15 Place this function in data/lib/functions.lua: function timeString(timeDiff, roundVal, roundUpVal) if roundVal and roundVal <= timeDiff...
  19. Colandus

    isPosition - is the position valid?

    Use this function to check whether a position is valid or not. TFS 0.3+ put in data/lib/functions.lua TFS 0.2 or other put in data/global.lua do -- Function by Colandus! local validPositionKeys = {"x", "y", "z", "stackpos"} function isPosition(pos) local keyAmount =...
  20. Colandus

    TalkAction Terror command for GM's :)

    This is funny command I made to terror my players hueahuea :D First you need these functions: Sleep function, Position function Then go to data/talkactions/talkactions.xml and write: <talkaction words="/terror" access="4" script="terror.lua"/> And in data/talkactions/scripts make file called...
Top