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

[1.4.2] [Spells] exevo gran ran dom

Adorius Black

Advanced OT User
Joined
Mar 31, 2020
Messages
348
Solutions
3
Reaction score
226
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.


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 :)
random.webp

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
 
I don't want to comment on the code but I'm just curious. Do you find any tibian real case scenario where such spell would be useful? I'm asking not as a server owner but let's say from the player side. Tibia monsters usually have differents immunities or resistances for elementals. In given spell you have no power to choose elemental but mostly you will be interested in doing as high damage as possible.

Do you have any idea how to encourage to use such spell? For isntance, I was thinking that UE rain is great concept until I started using it. It was annoying watching all these misses and I rather wanted to use regular spell than wishing myself best luck to hit the monster. We can say that 'limiting regular UE' is the answer but that's punishing method not the rewarding one.
 
I don't want to comment on the code but I'm just curious. Do you find any tibian real case scenario where such spell would be useful? I'm asking not as a server owner but let's say from the player side. Tibia monsters usually have differents immunities or resistances for elementals. In given spell you have no power to choose elemental but mostly you will be interested in doing as high damage as possible.

Do you have any idea how to encourage to use such spell? For isntance, I was thinking that UE rain is great concept until I started using it. It was annoying watching all these misses and I rather wanted to use regular spell than wishing myself best luck to hit the monster. We can say that 'limiting regular UE' is the answer but that's punishing method not the rewarding one.
This spell is designed specifically for a new vocation called Illusionist. This vocation is characterized by having similar HP and mana values to a Sorcerer, but its core identity lies in unpredictability and chaos.


The Illusionist can cast a spell that deals completely random damage, which creates an element of uncertainty and surprise in every encounter. This mechanic is intentional — the purpose is not to guarantee maximum damage, but to introduce a chaotic playstyle where the outcome is never fully predictable. Sometimes the spell may deal lower damage, but in other situations it can result in unexpectedly high bursts, making each cast feel unique and risky.


This randomness reflects the very nature of the Illusionist: a master of distortion, illusion, and unstable magic. The spell is not meant to compete directly with standard high-damage spells in terms of consistency, but rather to offer an alternative playstyle focused on excitement, variability, and strategic risk-taking.


In this way, the Illusionist becomes a vocation for players who enjoy dynamic and unconventional combat, where every fight can unfold differently depending on the roll of fate.
 
By the way, I wanted to upload it to Resources → Spells, but I can’t anymore.
Yes it's because otland has a funny system :D Having two times resource button for no reason

Resource button 1 that everyone know and used

1763942336747.webp
(Blocked resource creation there for no reason)

Resource button 2 that noone used
1763942395949.webp
(You can create resource creation there)

But you can watch your creation from resource 2 in resource 1 so makes no sense at all

They've changed that randomly and really noone asked for that but what ever now we got some random "stars" rating :D
 
Last edited:
Back
Top