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

BlackFun OT [BETA TEST]

5CC225C5-4D45-4EFF-8067-595F28446408.webp
Have you already linked your socials to your Blackfun profile?


No?!


You can't be serious!


Go fix that right now and connect them!


When you add your social media accounts, everyone can see them on your profile - meaning you're doing self-promotion directly on Blackfun! « Build your network, show who you are, and let the community find you easily.


And don't forget - if you want the "Favorite" (verified) badge @


just message Donado on Telegram


and


you'll get it EXCLUSIVELY for FREE!


(Yes, the same badge that usually costs 40,000


Blackfun Points!


So don't wait - grab yours before it's gone!


And share this with your friends - because I'm not always in such a good mood!
 
Hi everyone,
Today I was just casually chatting with ChatGPT and we ended up creating this script. It looks pretty interesting. It works like "exevo gran mas vis", with the difference that each SQM has a random effect, and whichever effect hits the player is the one that applies to them.
random.webp

By the way, I wanted to upload it to Resources → Spells, but I can’t anymore.


What do you think — is this a good script or complete nonsense? I don’t really understand LUA very well, but I tried to create a fully functional code. If anyone who knows more spots a bug, feel free to point it out :)
LUA:
local animationDelay = 60
local combat = {}

local area = {
    {{0},{0},{0},{3}},
    {{0},{0},{1},{2}},
    {{0},{1},{0},{2}},
    {{1},{0},{0},{2}},
    {{1},{0},{0},{0},{2}},
    {{1},{0},{0},{0},{0},{2}},
}

local effects = {
    CONST_ME_FIREAREA,
    CONST_ME_ENERGYAREA,
    CONST_ME_MAGIC_BLUE,
    CONST_ME_HOLYDAMAGE,
    CONST_ME_MORTAREA,
    CONST_ME_CARNIPHILA,
    CONST_ME_SMALLCLOUDS,
    CONST_ME_POISONAREA,
    CONST_ME_TELEPORT,
    CONST_ME_EXPLOSIONAREA
}

-- Funkcia na náhodný damage podľa efektu
local function getRandomDamage(effect, level, maglevel)
    local baseMin = (level / 5) + (maglevel * 3.6) + 22
    local baseMax = (level / 5) + (maglevel * 6) + 37

    -- Tu môžeš upraviť multiplikátory podľa efektu
    if effect == CONST_ME_FIREAREA then
        return -math.random(baseMin, baseMax)
    elseif effect == CONST_ME_ENERGYAREA then
        return -math.random(baseMin*0.8, baseMax*1.2)
    elseif effect == CONST_ME_MAGIC_BLUE then
        return -math.random(baseMin*0.5, baseMax*1.5)
    elseif effect == CONST_ME_HOLYDAMAGE then
        return -math.random(baseMin*1.5, baseMax*2)
    else
        return -math.random(baseMin, baseMax)
    end
end

for i, a in ipairs(area) do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) -- neutrálne, aby sa dali efekty meniť
    combat[i]:setArea(createCombatArea(a))
end

local function executeCombat(_combat, cid, var, level, maglevel)
    local player = Player(cid)
    if player then
        local effect = effects[math.random(#effects)]
        _combat:setParameter(COMBAT_PARAM_EFFECT, effect)
        local dmg = getRandomDamage(effect, level, maglevel)
        _combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, 0, dmg, 0, dmg) -- nastavenie damage pre túto vlnu
        _combat:execute(player, var)
    end
end

function onCastSpell(creature, var)
    local player = creature:getPlayer()
    if not player then return false end

    local level = player:getLevel()
    local maglevel = player:getMagicLevel()

    for i, c in ipairs(combat) do
        if i == 1 then
            executeCombat(c, player:getId(), var, level, maglevel)
        else
            addEvent(executeCombat, animationDelay * (i - 1), c, player:getId(), var, level, maglevel)
        end
    end

    return true
end
 
Back
Top