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

Since i can't release this at resources section. encouraged mosnters

jeanphilip

Well-Known Member
Joined
Oct 26, 2023
Messages
254
Reaction score
55
LUA:
double combo spell / wave beams }
-- Config
local MONSTER_NAMES = {"Dragon", "Dragon Lord", "Demon", "Hydra"} -- Replace with the names of the monsters you want to modify

local function onCreatureAppear(creature)
    if isMonster(creature) then
        local creatureName = getCreatureName(creature)
        for _, name in ipairs(MONSTER_NAMES) do
            if creatureName == name then
                registerCreatureEvent(creature, "onCreatureAttack")  -- Corrected event name
                break
            end
        end
    end
end

local function onCreatureAttack(creature, target, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if isMonster(creature) then
        local creatureName = getCreatureName(creature)
        for _, name in ipairs(MONSTER_NAMES) do
            if creatureName == name then
                -- Simulate a double spell combo by casting two different random spells from the creature's spell list
                local spellList = getCreatureSpells(creature)
                if spellList and #spellList > 1 then
                    local randomIndex1 = math.random(1, #spellList)
                    local randomIndex2 = randomIndex1
                    while randomIndex2 == randomIndex1 do
                        randomIndex2 = math.random(1, #spellList)
                    end
                    local randomSpell1 = spellList[randomIndex1]
                    local randomSpell2 = spellList[randomIndex2]
                  
                    -- Cast the first spell immediately
                    doCreatureCastSpell(creature, randomSpell1)
                  
                    -- Add a slight delay before casting the second spell
                    addEvent(doCreatureCastSpell, 300, creature, randomSpell2)
                end
                break
            end
        end
    end
    return true
end

for _, name in ipairs(MONSTER_NAMES) do
    registerCreatureEvent(name, "onCreatureAppear")
end
melee
Code:
-- Config
local MONSTER_NAMES = {"Dragon", "Dragon Lord", "Demon", "Hydra", "Hunter"} -- Replace with the names of the monsters you want to modify

local function onCreatureAppear(creature)
    if isMonster(creature) then
        local creatureName = getCreatureName(creature)
        for _, name in ipairs(MONSTER_NAMES) do
            if creatureName == name then
                registerCreatureEvent(creature, "onCreatureAttack")  -- Corrected event name
                break
            end
        end
    end
end

local function onCreatureAttack(creature, target, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if isMonster(creature) then
        local creatureName = getCreatureName(creature)
        for _, name in ipairs(MONSTER_NAMES) do
            if creatureName == name then
                -- Simulate a double spell combo by casting two different random spells from the creature's spell list
                local spellList = getCreatureSpells(creature)
                if spellList and #spellList > 1 then
                    local randomIndex1 = math.random(1, #spellList)
                    local randomIndex2 = randomIndex1
                    while randomIndex2 == randomIndex1 do
                        randomIndex2 = math.random(1, #spellList)
                    end
                    local randomSpell1 = spellList[randomIndex1]
                    local randomSpell2 = spellList[randomIndex2]
                  
                    -- Cast the first spell immediately
                    doCreatureCastSpell(creature, randomSpell1)
                  
                    -- Add a slight delay before casting the second spell
                    addEvent(doCreatureCastSpell, 100, creature, randomSpell2)
                end
                break
            end
        end
    end
    return true
end

for _, name in ipairs(MONSTER_NAMES) do
    registerCreatureEvent(name, "onCreatureAppear")
end

for me monster seems behave way better. maight be not the real behavior altough

enjoy
made this like two years ago
 

Attachments

Last edited:
Back
Top