Ir para conteúdo
  • Cadastre-se

tibia ia 🔥 Script Grátis de Alta Qualidade! | Revolução no Desenvolvimento de Servidores Tibia – Conheça o Tibia-AI! 🔥


Posts Recomendados

  • Administrador

 Apresentando o Tibia-IA: A IA para Desenvolvimento de Servidores Tibia! 


 O que é o Tibia-IA?

Um modelo de IA especializado para Tibia! Ele está atualmente em teste gratuito, e eu adoraria que vocês o experimentassem. Basta acessar https://ai.tibiaking.com, criar uma conta e começar a usar totalmente de graça! 

 Versão Experimental Fechada
Atualmente, algumas funcionalidades ainda estão em desenvolvimento. No momento, apenas a geração de scripts está disponível para o público.

Se encontrarem qualquer problema nos scripts gerados, me avisem! Vamos juntos construir a IA mais poderosa para ajudar no desenvolvimento de servidores Tibia!  
Contato direto discord : underewar

 Acesse agora: https://ai.tibiaking.com


 Como funciona?

  1.  Geração automática de scripts LUA para TFS
  2.  Suporte a diferentes eventos, criaturas, NPCs, magias, etc.
  3.  Ferramenta em constante evolução para aprimorar o desenvolvimento
  4. Novidades em breve confira no site.

O acesso ao Tibia-IA está disponível para testes GRATUITOS! 

  • Basta criar uma conta em: https://ai.tibiaking.com

  • Utilize a IA para gerar seus scripts de forma simples e rápida

  • Envie feedbacks para ajudarmos a tornar a ferramenta ainda melhor!

    Problemas relatar diretamente no meu discord pessoal : underewar

 

 

Link para o post
Compartilhar em outros sites
  • Under mudou o título para 🔥 Script Grátis de Alta Qualidade! | Revolução no Desenvolvimento de Servidores Tibia – Conheça o Tibia-AI! 🔥
  • 3 weeks later...
  • Administrador
19 horas atrás, idlerpl disse:

why not use https://cursor.com its 10000x better?

NOP!
Well mate its not easy like that let me explain to you.

On tibia server we have many many custom datas and src in internet my system deep analyse these custom data or src attached to it and are able to generate codes and documentaion for the attached data or src.

Its not an IA promp generator. its an MODEL builded to do it based on the files, for the actual scenario i'm using tfs 1.5 in future each user will be able to add own data and src version from internet such as tibiaking server's or any other forum and get an 100% accuracy function with the src function or data new libs.

If you have more experience with TFS otserver you will now for many servers you can't just throw a random data in to diferent src it will generate errors, my system will be able to attach diferent datas to src and add missing src infuture.

As you can see its not simple as you think.

Example Pick any DBZ or PKM or any CUSTOM server on internet try use a DATA pack from other CUSTOM server will not work most of this server have diferents SRC FUNCTION with make not possible or not compatible.

MY system are able to deep analyse src and data and generate for your context.

I aprretiate your feedback.

System now underupdate since i only got 200GB vram i can only USE the model or TRAIN the model at momment model its traning will be back on 10 days aprox.

DEV NOTES :



I have not builded ALL LLM FEATURES and in some cases i still use Sentence-Transformer and Chroma to Use CPU and RAM instead use LLM by VRAM
 some FEATURES LIKE QUERY FILE SEARCH OR SEMANTIC SEARCH I STILL USE FROM GPT OTHER LIKE SEMANTIC EDIT I STILL USE FROM GPT, THE ASSET FROM MODEL ITS UNIQUE CONFIGURED BY CONTEXT.
What that means ?
WELL basicly my model communicate with GPT to tell him how exact the data and src works and from it the script generation use semantic earch and file seach from gpt to analyse better ways to give a correctly aawnser, when gpt find it it send to my model and my model confirm if that is correcly based on the current context or not.

In the new version upcoming of the app will be easier to see this unique features since i will be adding all servers from tibiaking to the app
at momment only tfs 1.5 for obvious reason.

image.png
image.png
image.png
 

I have plans to release a tool based on windows app as well but first i want to do others deadlines.

Link para o post
Compartilhar em outros sites

yeah but cursor is sonnet 3.7 coding model that reads your entire repository plus if you set public not private it learns from the repo i have been teaching it alongspellcaster.luawith others it can easily identify TFS distro and write scripts with correct guidance example of stuff i wrote using good prompts Its funny for you to assume my lack of knowledge yet i have been building servers for over 14 years now :)  
 

Spoiler

-- Spellcaster script
-- This script handles the automatic casting of spells for players
-- It uses the SpellSystem library for all spell definitions and helper functions

-- Import the SpellSystem library
dofile('data/lib/spellsystem.lua')

function onThink(creature, interval)
    if not creature:isPlayer() then
        return false
    end

    local player = creature:getPlayer()
    
    -- Check and fix spell storages every 60 seconds (1200 ticks)
    local fixCheckStorage = 999999  -- Special storage for tracking when to check
    local fixCheckValue = player:getStorageValue(fixCheckStorage)
    
    if fixCheckValue == -1 then
        fixCheckValue = 0
        player:setStorageValue(fixCheckStorage, 0)
    end
    
    fixCheckValue = fixCheckValue + 1
    player:setStorageValue(fixCheckStorage, fixCheckValue)
    
    if fixCheckValue >= 1200 then
        -- Reset counter and check/fix storages
        player:setStorageValue(fixCheckStorage, 0)
        SpellSystem.checkAndFixSpellStorages(player)
    end
    
    -- Check each spell independently
    for spellName, spellData in pairs(SpellSystem.spells) do
        -- Get base spell info
        local baseStorage = spellData.baseStorage
        local baseStorageValue = player:getStorageValue(baseStorage)
        
        -- Only process spells that are specifically enabled
        if baseStorageValue > 0 then
            -- Use a dedicated tick counter storage (baseStorage + 100000 to avoid conflicts)
            local tickStorage = baseStorage + 100000
            local tickCount = player:getStorageValue(tickStorage)
            
            -- Initialize tick count if not set
            if tickCount == -1 then
                tickCount = 0
                player:setStorageValue(tickStorage, 0)
            end
            
            -- Get upgrade levels
            local speedUpgrade = player:getStorageValue(spellData.upgradeStorages.castSpeed)
            if speedUpgrade == -1 then speedUpgrade = 0 end
            
            -- Calculate cast time in ticks
            local finalTicks = SpellSystem.getCastTime(spellData.baseCastTime, speedUpgrade)
            
            -- Increment tick count
            tickCount = tickCount + 1
            player:setStorageValue(tickStorage, tickCount)
            
           
            
            -- Check if enough ticks have passed
            if tickCount >= finalTicks then
                -- Reset tick counter
                player:setStorageValue(tickStorage, 0)
                
                -- Get other upgrades
                local areaUpgrade = player:getStorageValue(spellData.upgradeStorages.area)
                if areaUpgrade == -1 then areaUpgrade = 0 end
                
                local damageUpgrade = player:getStorageValue(spellData.upgradeStorages.damage)
                if damageUpgrade == -1 then 
                    -- If damage upgrade is not set, initialize it with the spell's max damage
                    if spellData.baseDamage and spellData.baseDamage.max then
                        damageUpgrade = spellData.baseDamage.max
                        player:setStorageValue(spellData.upgradeStorages.damage, damageUpgrade)
                    
                    else
                        damageUpgrade = 5  -- Fallback default
                        player:setStorageValue(spellData.upgradeStorages.damage, damageUpgrade)
                    end
                end
                
                -- Execute spell based on type
                if SpellSystem.endsWith(spellName, "Strike") then
                    -- Strike spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local positions = SpellSystem.getStrikeArea(player, areaUpgrade)
                    
                    local combatType = SpellSystem.combatTypes[spellName]
                    local effect = SpellSystem.effects[spellName]
                    
                
                    -- Apply damage and effects
                    for _, targetPos in ipairs(positions) do
                        local tile = Tile(targetPos)
                        if tile then
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        doTargetCombatHealth(player, creature, combatType, -damage, -damage, effect)
                                    end
                                end
                            end
                            targetPos:sendMagicEffect(effect)
                        end
                    end
                elseif SpellSystem.endsWith(spellName, "Missile") then
                    -- Missile spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local direction = player:getDirection()
                    
            
                    -- Get distance upgrade value
                    local distanceUpgrade = player:getStorageValue(spellData.upgradeStorages.distance)
                    if distanceUpgrade == -1 then distanceUpgrade = 0 end
                    local maxDistance = SpellSystem.getMissileDistance(distanceUpgrade)
                    
                    -- Initialize target position
                    local targetPos = nil
                    local foundMonster = false
                    
                    -- Scan up to maxDistance tiles forward for monsters
                    for distance = 1, maxDistance do
                        local checkPos = Position(playerPos)
                        if direction == DIRECTION_NORTH then
                            checkPos.y = checkPos.y - distance
                        elseif direction == DIRECTION_SOUTH then
                            checkPos.y = checkPos.y + distance
                        elseif direction == DIRECTION_EAST then
                            checkPos.x = checkPos.x + distance
                        elseif direction == DIRECTION_WEST then
                            checkPos.x = checkPos.x - distance
                        end
                        
                        -- Check for monster at this position
                        local tile = Tile(checkPos)
                        if tile then
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        targetPos = checkPos
                                        foundMonster = true
                                        break
                                    end
                                end
                            end
                        end
                        
                        if foundMonster then
                            break
                        end
                        
                        -- If we've reached the max distance and found no monster, use this position
                        if distance == maxDistance then
                            targetPos = checkPos
                        end
                    end
                    
                    -- Get combat type and effects
                    local combatType = SpellSystem.combatTypes[spellName]
                    local effect = SpellSystem.effects[spellName]
                    local projectile = SpellSystem.projectiles[spellName]
                    
                    -- Show projectile and effect
                    playerPos:sendDistanceEffect(targetPos, projectile)
                    targetPos:sendMagicEffect(effect)
                    
                    -- Deal damage if there's a monster
                    local tile = Tile(targetPos)
                    if tile then
                        local creatures = tile:getCreatures()
                        if creatures then
                            for _, creature in ipairs(creatures) do
                                if creature:isMonster() then
                                    doTargetCombatHealth(player, creature, combatType, -damage, -damage, effect)
                                end
                            end
                        end
                        
                        -- Handle area effects if upgraded
                        if areaUpgrade > 0 then
                            local areaPositions = SpellSystem.getMissileAreaPositions(targetPos, areaUpgrade, direction, player)
                            for _, areaPos in ipairs(areaPositions) do
                                local areaTile = Tile(areaPos.pos)
                                if areaTile then
                                    -- If this is an extra missile, show the projectile effect
                                    if areaPos.isExtraMissile then
                                        playerPos:sendDistanceEffect(areaPos.pos, projectile)
                                    end
                                    
                                    local areaCreatures = areaTile:getCreatures()
                                    if areaCreatures then
                                        for _, creature in ipairs(areaCreatures) do
                                            if creature:isMonster() then
                                                local areaDamage = math.floor(damage * areaPos.damageModifier)
                                                doTargetCombatHealth(player, creature, combatType, -areaDamage, -areaDamage, effect)
                                            end
                                        end
                                    end
                                    areaPos.pos:sendMagicEffect(effect)
                                end
                            end
                        end
                    end
                elseif spellName == "thunders" then
                    -- Thunder spell execution
                    local damage = SpellSystem.calculateThunderDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    
                    
                    -- Get number of targets based on upgrade
                    local maxTargets = spellData.baseTargets
                    if player:getStorageValue(spellData.upgradeStorages.targets) > 0 then
                        maxTargets = maxTargets + player:getStorageValue(spellData.upgradeStorages.targets)
                    end
                    
                    -- Find all potential targets in area
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    local targetIds = SpellSystem.findTargetsInRadius(playerPos, radius)
                    
                    -- Randomly select targets up to maxTargets
                    for i = 1, math.min(#targetIds, maxTargets) do
                        local randomIndex = math.random(1, #targetIds)
                        local targetId = targetIds[randomIndex]
                        
                        -- Get the creature object from the ID
                        local target = Creature(targetId)
                        
                        if target and target:isMonster() then
                            -- Show effect and deal damage
                            playerPos:sendDistanceEffect(target:getPosition(), CONST_ANI_ENERGY)
                            doTargetCombatHealth(player, target, COMBAT_ENERGYDAMAGE, -damage, -damage, CONST_ME_ENERGYHIT)
                        end
                        
                        -- Remove this target from the pool
                        table.remove(targetIds, randomIndex)
                    end
                elseif spellName == "rockAttack" then
                    -- Rock Attack spell execution - throws rocks on random 8x8 tiles around player
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Calculate area based on upgrades (base is 3)
                    local area = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Define the 8x8 area around player
                    local maxRange = 4 -- 4 tiles in each direction = 8x8 area
                    
                    -- Number of rocks to cast based on area upgrade (min 3, max 9)
                    local numRocks = math.min(9, math.max(3, areaUpgrade + 2))
                    
                    -- Cast the spell on random positions
                    for i = 1, numRocks do -- Cast numRocks rock attacks
                        -- Generate random position within range
                        local offsetX = math.random(-maxRange, maxRange)
                        local offsetY = math.random(-maxRange, maxRange)
                        local centerPos = Position(playerPos.x + offsetX, playerPos.y + offsetY, playerPos.z)
                        
                        -- Apply effect at center position
                        centerPos:sendMagicEffect(effect)
                        
                        -- Apply damage in area (area x area square)
                        for x = -math.floor(area/2), math.floor(area/2) do
                            for y = -math.floor(area/2), math.floor(area/2) do
                                local targetPos = Position(centerPos.x + x, centerPos.y + y, centerPos.z)
                                local tile = Tile(targetPos)
                                if tile then
                                    local creatures = tile:getCreatures()
                                    if creatures then
                                        for _, creature in ipairs(creatures) do
                                            if creature:isMonster() then
                                                doTargetCombatHealth(player, creature, COMBAT_EARTHDAMAGE, -damage, -damage, effect)
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                elseif spellName == "vineGrip" then
                    -- Vine Grip spell execution - casts in 1x3 in front of player and then extends forward
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local direction = player:getDirection()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Helper function to cast vine grip at a specific position
                    local function castVineGrip(pos, player, damage, effect)
                        local tile = Tile(pos)
                        if tile then
                            -- Apply effect
                            pos:sendMagicEffect(effect)
                            
                            -- Apply damage to monsters
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        doTargetCombatHealth(player, creature, COMBAT_EARTHDAMAGE, -damage, -damage, effect)
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Get area upgrade (determines how far the vine extends)
                    local maxDistance = math.min(7, areaUpgrade + 1) -- Default 1, max 7
                    
                    -- Initial positions (1x3 in front of player)
                    local initialPositions = {}
                    
                    if direction == DIRECTION_NORTH then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y - 1, playerPos.z))
                    elseif direction == DIRECTION_SOUTH then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y + 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x, playerPos.y + 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y + 1, playerPos.z))
                    elseif direction == DIRECTION_EAST then
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y + 1, playerPos.z))
                    elseif direction == DIRECTION_WEST then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y + 1, playerPos.z))
                    end
                    
                    -- Cast on initial positions
                    for _, pos in ipairs(initialPositions) do
                        castVineGrip(pos, player, damage, effect)
                    end
                    
                    -- Store player GUID for addEvent safety
                    local playerGUID = player:getGuid()
                    
                    -- Schedule additional casts for forward positions
                    for distance = 2, maxDistance do
                        -- Use addEvent to delay each wave by 100ms
                        addEvent(function(guid, dir, initPositions, dist, dmg, fx)
                            -- Get player by GUID to ensure they're still online
                            local p = Player(guid)
                            if not p then
                                return -- Player logged out, abort
                            end
                            
                            -- Calculate positions for this wave
                            local wavePositions = {}
                            for _, initPos in ipairs(initPositions) do
                                local newPos = Position(initPos)
                                if dir == DIRECTION_NORTH then
                                    -- Fix: Calculate position based on initial position and current distance
                                    newPos.y = initPos.y - (dist - 1)
                                elseif dir == DIRECTION_SOUTH then
                                    newPos.y = initPos.y + (dist - 1)
                                elseif dir == DIRECTION_EAST then
                                    newPos.x = initPos.x + (dist - 1)
                                elseif dir == DIRECTION_WEST then
                                    newPos.x = initPos.x - (dist - 1)
                                end
                                table.insert(wavePositions, newPos)
                            end
                            
                            -- Cast on this wave's positions
                            for _, pos in ipairs(wavePositions) do
                                castVineGrip(pos, p, dmg, fx)
                            end
                        end, (distance - 1) * 100, playerGUID, direction, initialPositions, distance, damage, effect)
                    end
                elseif spellName == "plantEater" then
                    -- Plant Eater spell execution - attacks random monsters around player
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Set a mutex to prevent conflicts with other spells
                    local plantEaterMutex = 170299 -- Special storage for plantEater mutex
                    if player:getStorageValue(plantEaterMutex) > 0 then
                        -- Spell is already running, skip this execution
                        return true
                    end
                    -- Set mutex (will be cleared after 5 seconds)
                    player:setStorageValue(plantEaterMutex, 1)
                    
                    -- Calculate area based on upgrades (base is 1)
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Find all monsters in radius
                    local targetIds = {}
                    for x = -radius, radius do
                        for y = -radius, radius do
                            local checkPos = Position(playerPos.x + x, playerPos.y + y, playerPos.z)
                            local tile = Tile(checkPos)
                            if tile then
                                local creatures = tile:getCreatures()
                                if creatures then
                                    for _, creature in ipairs(creatures) do
                                        if creature:isMonster() then
                                            -- Store monster ID instead of the creature object itself
                                            table.insert(targetIds, creature:getId())
                                        end
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Store player GUID for addEvent safety
                    local playerGUID = player:getGuid()
                    
                    -- Attack random monsters if any found
                    if #targetIds > 0 then
                        -- Attack a random monster every second for 5 seconds
                        for i = 0, 4 do
                            addEvent(function(guid, monsterIds, dmg, fx, mutexStorage)
                                -- Get player by GUID to ensure they're still online
                                local p = Player(guid)
                                if not p then
                                    return -- Player logged out, abort
                                end
                                
                                -- Clear mutex on last iteration
                                if i == 4 then
                                    p:setStorageValue(mutexStorage, 0)
                                end
                                
                                -- Filter out any creatures that no longer exist
                                local validTargets = {}
                                for _, monsterId in ipairs(monsterIds) do
                                    local target = Creature(monsterId)
                                    if target and target:isMonster() then
                                        table.insert(validTargets, target)
                                    end
                                end
                                
                                -- Attack a random target if any valid ones remain
                                if #validTargets > 0 then
                                    local randomIndex = math.random(1, #validTargets)
                                    local target = validTargets[randomIndex]
                                    
                                    -- Apply effect and damage
                                    target:getPosition():sendMagicEffect(fx)
                                    doTargetCombatHealth(p, target, COMBAT_EARTHDAMAGE, -dmg, -dmg, fx)
                                end
                            end, i * 1000, playerGUID, targetIds, damage, effect, plantEaterMutex)
                        end
                    else
                        -- No targets found, clear mutex immediately
                        player:setStorageValue(plantEaterMutex, 0)
                    end
                elseif spellName == "scytheReaper" then
                    -- Scythe Reaper spell execution - applies poison condition to random monsters
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Set a mutex to prevent conflicts with other spells
                    local scytheReaperMutex = 170399 -- Special storage for scytheReaper mutex
                    if player:getStorageValue(scytheReaperMutex) > 0 then
                        -- Spell is already running, skip this execution
                        return true
                    end
                    -- Set mutex (will be cleared after execution)
                    player:setStorageValue(scytheReaperMutex, 1)
                    
                    -- Get damage upgrade for poison strength
                    local damageValue = damageUpgrade
                    if damageValue <= 0 then
                        damageValue = 50 -- Default minimum
                    end
                    
                    -- Calculate area based on upgrades (base is 2)
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Find all monsters in radius by ID
                    local targetIds = {}
                    for x = -radius, radius do
                        for y = -radius, radius do
                            local checkPos = Position(playerPos.x + x, playerPos.y + y, playerPos.z)
                            local tile = Tile(checkPos)
                            if tile then
                                local creatures = tile:getCreatures()
                                if creatures then
                                    for _, creature in ipairs(creatures) do
                                        if creature:isMonster() then
                                            -- Store monster ID and position
                                            table.insert(targetIds, {
                                                id = creature:getId(),
                                                pos = {
                                                    x = creature:getPosition().x,
                                                    y = creature:getPosition().y,
                                                    z = creature:getPosition().z
                                                }
                                            })
                                        end
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Store player GUID for safety
                    local playerGUID = player:getGuid()
                    
                    -- Apply poison to random monsters if any found
                    if #targetIds > 0 then
                        -- Use addEvent to process targets in a separate execution context
                        addEvent(function(guid, monsterData, dmgValue, fx, mutexStorage)
                            -- Get player by GUID to ensure they're still online
                            local p = Player(guid)
                            if not p then
                                -- Clear mutex and abort if player is offline
                                return
                            end
                            
                            -- Apply to up to 3 random targets
                            local maxTargets = math.min(3, #monsterData)
                            local processedTargets = 0
                            
                            while processedTargets < maxTargets and #monsterData > 0 do
                                local randomIndex = math.random(1, #monsterData)
                                local targetInfo = monsterData[randomIndex]
                                
                                -- Get the monster by ID
                                local target = Creature(targetInfo.id)
                                
                                -- Safety check for valid target
                                if target and target:isMonster() then
                                    -- Create a new poison condition for each target
                                    local poison = Condition(CONDITION_POISON)
                                    poison:setParameter(CONDITION_PARAM_DELAYED, true)
                                    poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
                                    poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
                                    poison:setParameter(CONDITION_PARAM_STARTVALUE, -dmgValue)
                                    poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
                                    poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)
                                    
                                    -- Apply effect and poison condition
                                    target:getPosition():sendMagicEffect(fx)
                                    target:addCondition(poison)
                                    
                                    -- Also apply initial damage
                                    doTargetCombatHealth(p, target, COMBAT_EARTHDAMAGE, -dmgValue, -dmgValue, fx)
                                    
                                    processedTargets = processedTargets + 1
                                end
                                
                                -- Remove this target from the pool
                                table.remove(monsterData, randomIndex)
                            end
                            
                            -- Clear mutex after processing
                            if p then
                                p:setStorageValue(mutexStorage, 0)
                            end
                        end, 50, playerGUID, targetIds, damageValue, effect, scytheReaperMutex)
                    else
                        -- No targets found, clear mutex immediately
                        player:setStorageValue(scytheReaperMutex, 0)
                    end
                elseif SpellSystem.endsWith(spellName, "TargetMissile") then
                    -- Target Missile spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    
                   
                    -- Find target in gradually expanding area based on upgrades
                    local targetInfo = SpellSystem.findTargetInArea(player, areaUpgrade)
                    if targetInfo then
                        -- Get combat type and effects
                        local combatType = SpellSystem.combatTypes[spellName]
                        local effect = SpellSystem.effects[spellName]
                        local projectile = SpellSystem.projectiles[spellName]
                        
                        -- Show projectile and effect
                        playerPos:sendDistanceEffect(targetInfo.position, projectile)
                        targetInfo.position:sendMagicEffect(effect)
                        
                        -- Deal damage
                        doTargetCombatHealth(player, targetInfo.creature, combatType, -damage, -damage, effect)
                        
                        -- Handle area effects if upgraded
                        if areaUpgrade > 0 then
                            local areaPositions = SpellSystem.getMissileAreaPositions(targetInfo.position, areaUpgrade, player:getDirection(), player)
                            for _, areaPos in ipairs(areaPositions) do
                                local areaTile = Tile(areaPos.pos)
                                if areaTile then
                                    local areaCreatures = areaTile:getCreatures()
                                    if areaCreatures then
                                        for _, creature in ipairs(areaCreatures) do
                                            if creature:isMonster() then
                                                local areaDamage = math.floor(damage * areaPos.damageModifier)
                                                doTargetCombatHealth(player, creature, combatType, -areaDamage, -areaDamage, effect)
                                            end
                                        end
                                    end
                                    areaPos.pos:sendMagicEffect(effect)
                                end
                            end
                        end
                    end
                end
            end
        end
    end
    return true
end

 

gen_floor.lua gen_killmonster.lua

Link para o post
Compartilhar em outros sites
  • Administrador
4 horas atrás, idlerpl disse:

yeah but cursor is sonnet 3.7 coding model that reads your entire repository plus if you set public not private it learns from the repo i have been teaching it alongspellcaster.luawith others it can easily identify TFS distro and write scripts with correct guidance example of stuff i wrote using good prompts Its funny for you to assume my lack of knowledge yet i have been building servers for over 14 years now :)  
 


-- Spellcaster script
-- This script handles the automatic casting of spells for players
-- It uses the SpellSystem library for all spell definitions and helper functions

-- Import the SpellSystem library
dofile('data/lib/spellsystem.lua')

function onThink(creature, interval)
    if not creature:isPlayer() then
        return false
    end

    local player = creature:getPlayer()
    
    -- Check and fix spell storages every 60 seconds (1200 ticks)
    local fixCheckStorage = 999999  -- Special storage for tracking when to check
    local fixCheckValue = player:getStorageValue(fixCheckStorage)
    
    if fixCheckValue == -1 then
        fixCheckValue = 0
        player:setStorageValue(fixCheckStorage, 0)
    end
    
    fixCheckValue = fixCheckValue + 1
    player:setStorageValue(fixCheckStorage, fixCheckValue)
    
    if fixCheckValue >= 1200 then
        -- Reset counter and check/fix storages
        player:setStorageValue(fixCheckStorage, 0)
        SpellSystem.checkAndFixSpellStorages(player)
    end
    
    -- Check each spell independently
    for spellName, spellData in pairs(SpellSystem.spells) do
        -- Get base spell info
        local baseStorage = spellData.baseStorage
        local baseStorageValue = player:getStorageValue(baseStorage)
        
        -- Only process spells that are specifically enabled
        if baseStorageValue > 0 then
            -- Use a dedicated tick counter storage (baseStorage + 100000 to avoid conflicts)
            local tickStorage = baseStorage + 100000
            local tickCount = player:getStorageValue(tickStorage)
            
            -- Initialize tick count if not set
            if tickCount == -1 then
                tickCount = 0
                player:setStorageValue(tickStorage, 0)
            end
            
            -- Get upgrade levels
            local speedUpgrade = player:getStorageValue(spellData.upgradeStorages.castSpeed)
            if speedUpgrade == -1 then speedUpgrade = 0 end
            
            -- Calculate cast time in ticks
            local finalTicks = SpellSystem.getCastTime(spellData.baseCastTime, speedUpgrade)
            
            -- Increment tick count
            tickCount = tickCount + 1
            player:setStorageValue(tickStorage, tickCount)
            
           
            
            -- Check if enough ticks have passed
            if tickCount >= finalTicks then
                -- Reset tick counter
                player:setStorageValue(tickStorage, 0)
                
                -- Get other upgrades
                local areaUpgrade = player:getStorageValue(spellData.upgradeStorages.area)
                if areaUpgrade == -1 then areaUpgrade = 0 end
                
                local damageUpgrade = player:getStorageValue(spellData.upgradeStorages.damage)
                if damageUpgrade == -1 then 
                    -- If damage upgrade is not set, initialize it with the spell's max damage
                    if spellData.baseDamage and spellData.baseDamage.max then
                        damageUpgrade = spellData.baseDamage.max
                        player:setStorageValue(spellData.upgradeStorages.damage, damageUpgrade)
                    
                    else
                        damageUpgrade = 5  -- Fallback default
                        player:setStorageValue(spellData.upgradeStorages.damage, damageUpgrade)
                    end
                end
                
                -- Execute spell based on type
                if SpellSystem.endsWith(spellName, "Strike") then
                    -- Strike spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local positions = SpellSystem.getStrikeArea(player, areaUpgrade)
                    
                    local combatType = SpellSystem.combatTypes[spellName]
                    local effect = SpellSystem.effects[spellName]
                    
                
                    -- Apply damage and effects
                    for _, targetPos in ipairs(positions) do
                        local tile = Tile(targetPos)
                        if tile then
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        doTargetCombatHealth(player, creature, combatType, -damage, -damage, effect)
                                    end
                                end
                            end
                            targetPos:sendMagicEffect(effect)
                        end
                    end
                elseif SpellSystem.endsWith(spellName, "Missile") then
                    -- Missile spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local direction = player:getDirection()
                    
            
                    -- Get distance upgrade value
                    local distanceUpgrade = player:getStorageValue(spellData.upgradeStorages.distance)
                    if distanceUpgrade == -1 then distanceUpgrade = 0 end
                    local maxDistance = SpellSystem.getMissileDistance(distanceUpgrade)
                    
                    -- Initialize target position
                    local targetPos = nil
                    local foundMonster = false
                    
                    -- Scan up to maxDistance tiles forward for monsters
                    for distance = 1, maxDistance do
                        local checkPos = Position(playerPos)
                        if direction == DIRECTION_NORTH then
                            checkPos.y = checkPos.y - distance
                        elseif direction == DIRECTION_SOUTH then
                            checkPos.y = checkPos.y + distance
                        elseif direction == DIRECTION_EAST then
                            checkPos.x = checkPos.x + distance
                        elseif direction == DIRECTION_WEST then
                            checkPos.x = checkPos.x - distance
                        end
                        
                        -- Check for monster at this position
                        local tile = Tile(checkPos)
                        if tile then
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        targetPos = checkPos
                                        foundMonster = true
                                        break
                                    end
                                end
                            end
                        end
                        
                        if foundMonster then
                            break
                        end
                        
                        -- If we've reached the max distance and found no monster, use this position
                        if distance == maxDistance then
                            targetPos = checkPos
                        end
                    end
                    
                    -- Get combat type and effects
                    local combatType = SpellSystem.combatTypes[spellName]
                    local effect = SpellSystem.effects[spellName]
                    local projectile = SpellSystem.projectiles[spellName]
                    
                    -- Show projectile and effect
                    playerPos:sendDistanceEffect(targetPos, projectile)
                    targetPos:sendMagicEffect(effect)
                    
                    -- Deal damage if there's a monster
                    local tile = Tile(targetPos)
                    if tile then
                        local creatures = tile:getCreatures()
                        if creatures then
                            for _, creature in ipairs(creatures) do
                                if creature:isMonster() then
                                    doTargetCombatHealth(player, creature, combatType, -damage, -damage, effect)
                                end
                            end
                        end
                        
                        -- Handle area effects if upgraded
                        if areaUpgrade > 0 then
                            local areaPositions = SpellSystem.getMissileAreaPositions(targetPos, areaUpgrade, direction, player)
                            for _, areaPos in ipairs(areaPositions) do
                                local areaTile = Tile(areaPos.pos)
                                if areaTile then
                                    -- If this is an extra missile, show the projectile effect
                                    if areaPos.isExtraMissile then
                                        playerPos:sendDistanceEffect(areaPos.pos, projectile)
                                    end
                                    
                                    local areaCreatures = areaTile:getCreatures()
                                    if areaCreatures then
                                        for _, creature in ipairs(areaCreatures) do
                                            if creature:isMonster() then
                                                local areaDamage = math.floor(damage * areaPos.damageModifier)
                                                doTargetCombatHealth(player, creature, combatType, -areaDamage, -areaDamage, effect)
                                            end
                                        end
                                    end
                                    areaPos.pos:sendMagicEffect(effect)
                                end
                            end
                        end
                    end
                elseif spellName == "thunders" then
                    -- Thunder spell execution
                    local damage = SpellSystem.calculateThunderDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    
                    
                    -- Get number of targets based on upgrade
                    local maxTargets = spellData.baseTargets
                    if player:getStorageValue(spellData.upgradeStorages.targets) > 0 then
                        maxTargets = maxTargets + player:getStorageValue(spellData.upgradeStorages.targets)
                    end
                    
                    -- Find all potential targets in area
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    local targetIds = SpellSystem.findTargetsInRadius(playerPos, radius)
                    
                    -- Randomly select targets up to maxTargets
                    for i = 1, math.min(#targetIds, maxTargets) do
                        local randomIndex = math.random(1, #targetIds)
                        local targetId = targetIds[randomIndex]
                        
                        -- Get the creature object from the ID
                        local target = Creature(targetId)
                        
                        if target and target:isMonster() then
                            -- Show effect and deal damage
                            playerPos:sendDistanceEffect(target:getPosition(), CONST_ANI_ENERGY)
                            doTargetCombatHealth(player, target, COMBAT_ENERGYDAMAGE, -damage, -damage, CONST_ME_ENERGYHIT)
                        end
                        
                        -- Remove this target from the pool
                        table.remove(targetIds, randomIndex)
                    end
                elseif spellName == "rockAttack" then
                    -- Rock Attack spell execution - throws rocks on random 8x8 tiles around player
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Calculate area based on upgrades (base is 3)
                    local area = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Define the 8x8 area around player
                    local maxRange = 4 -- 4 tiles in each direction = 8x8 area
                    
                    -- Number of rocks to cast based on area upgrade (min 3, max 9)
                    local numRocks = math.min(9, math.max(3, areaUpgrade + 2))
                    
                    -- Cast the spell on random positions
                    for i = 1, numRocks do -- Cast numRocks rock attacks
                        -- Generate random position within range
                        local offsetX = math.random(-maxRange, maxRange)
                        local offsetY = math.random(-maxRange, maxRange)
                        local centerPos = Position(playerPos.x + offsetX, playerPos.y + offsetY, playerPos.z)
                        
                        -- Apply effect at center position
                        centerPos:sendMagicEffect(effect)
                        
                        -- Apply damage in area (area x area square)
                        for x = -math.floor(area/2), math.floor(area/2) do
                            for y = -math.floor(area/2), math.floor(area/2) do
                                local targetPos = Position(centerPos.x + x, centerPos.y + y, centerPos.z)
                                local tile = Tile(targetPos)
                                if tile then
                                    local creatures = tile:getCreatures()
                                    if creatures then
                                        for _, creature in ipairs(creatures) do
                                            if creature:isMonster() then
                                                doTargetCombatHealth(player, creature, COMBAT_EARTHDAMAGE, -damage, -damage, effect)
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                elseif spellName == "vineGrip" then
                    -- Vine Grip spell execution - casts in 1x3 in front of player and then extends forward
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local direction = player:getDirection()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Helper function to cast vine grip at a specific position
                    local function castVineGrip(pos, player, damage, effect)
                        local tile = Tile(pos)
                        if tile then
                            -- Apply effect
                            pos:sendMagicEffect(effect)
                            
                            -- Apply damage to monsters
                            local creatures = tile:getCreatures()
                            if creatures then
                                for _, creature in ipairs(creatures) do
                                    if creature:isMonster() then
                                        doTargetCombatHealth(player, creature, COMBAT_EARTHDAMAGE, -damage, -damage, effect)
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Get area upgrade (determines how far the vine extends)
                    local maxDistance = math.min(7, areaUpgrade + 1) -- Default 1, max 7
                    
                    -- Initial positions (1x3 in front of player)
                    local initialPositions = {}
                    
                    if direction == DIRECTION_NORTH then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y - 1, playerPos.z))
                    elseif direction == DIRECTION_SOUTH then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y + 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x, playerPos.y + 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y + 1, playerPos.z))
                    elseif direction == DIRECTION_EAST then
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x + 1, playerPos.y + 1, playerPos.z))
                    elseif direction == DIRECTION_WEST then
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y - 1, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y, playerPos.z))
                        table.insert(initialPositions, Position(playerPos.x - 1, playerPos.y + 1, playerPos.z))
                    end
                    
                    -- Cast on initial positions
                    for _, pos in ipairs(initialPositions) do
                        castVineGrip(pos, player, damage, effect)
                    end
                    
                    -- Store player GUID for addEvent safety
                    local playerGUID = player:getGuid()
                    
                    -- Schedule additional casts for forward positions
                    for distance = 2, maxDistance do
                        -- Use addEvent to delay each wave by 100ms
                        addEvent(function(guid, dir, initPositions, dist, dmg, fx)
                            -- Get player by GUID to ensure they're still online
                            local p = Player(guid)
                            if not p then
                                return -- Player logged out, abort
                            end
                            
                            -- Calculate positions for this wave
                            local wavePositions = {}
                            for _, initPos in ipairs(initPositions) do
                                local newPos = Position(initPos)
                                if dir == DIRECTION_NORTH then
                                    -- Fix: Calculate position based on initial position and current distance
                                    newPos.y = initPos.y - (dist - 1)
                                elseif dir == DIRECTION_SOUTH then
                                    newPos.y = initPos.y + (dist - 1)
                                elseif dir == DIRECTION_EAST then
                                    newPos.x = initPos.x + (dist - 1)
                                elseif dir == DIRECTION_WEST then
                                    newPos.x = initPos.x - (dist - 1)
                                end
                                table.insert(wavePositions, newPos)
                            end
                            
                            -- Cast on this wave's positions
                            for _, pos in ipairs(wavePositions) do
                                castVineGrip(pos, p, dmg, fx)
                            end
                        end, (distance - 1) * 100, playerGUID, direction, initialPositions, distance, damage, effect)
                    end
                elseif spellName == "plantEater" then
                    -- Plant Eater spell execution - attacks random monsters around player
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Set a mutex to prevent conflicts with other spells
                    local plantEaterMutex = 170299 -- Special storage for plantEater mutex
                    if player:getStorageValue(plantEaterMutex) > 0 then
                        -- Spell is already running, skip this execution
                        return true
                    end
                    -- Set mutex (will be cleared after 5 seconds)
                    player:setStorageValue(plantEaterMutex, 1)
                    
                    -- Calculate area based on upgrades (base is 1)
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Find all monsters in radius
                    local targetIds = {}
                    for x = -radius, radius do
                        for y = -radius, radius do
                            local checkPos = Position(playerPos.x + x, playerPos.y + y, playerPos.z)
                            local tile = Tile(checkPos)
                            if tile then
                                local creatures = tile:getCreatures()
                                if creatures then
                                    for _, creature in ipairs(creatures) do
                                        if creature:isMonster() then
                                            -- Store monster ID instead of the creature object itself
                                            table.insert(targetIds, creature:getId())
                                        end
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Store player GUID for addEvent safety
                    local playerGUID = player:getGuid()
                    
                    -- Attack random monsters if any found
                    if #targetIds > 0 then
                        -- Attack a random monster every second for 5 seconds
                        for i = 0, 4 do
                            addEvent(function(guid, monsterIds, dmg, fx, mutexStorage)
                                -- Get player by GUID to ensure they're still online
                                local p = Player(guid)
                                if not p then
                                    return -- Player logged out, abort
                                end
                                
                                -- Clear mutex on last iteration
                                if i == 4 then
                                    p:setStorageValue(mutexStorage, 0)
                                end
                                
                                -- Filter out any creatures that no longer exist
                                local validTargets = {}
                                for _, monsterId in ipairs(monsterIds) do
                                    local target = Creature(monsterId)
                                    if target and target:isMonster() then
                                        table.insert(validTargets, target)
                                    end
                                end
                                
                                -- Attack a random target if any valid ones remain
                                if #validTargets > 0 then
                                    local randomIndex = math.random(1, #validTargets)
                                    local target = validTargets[randomIndex]
                                    
                                    -- Apply effect and damage
                                    target:getPosition():sendMagicEffect(fx)
                                    doTargetCombatHealth(p, target, COMBAT_EARTHDAMAGE, -dmg, -dmg, fx)
                                end
                            end, i * 1000, playerGUID, targetIds, damage, effect, plantEaterMutex)
                        end
                    else
                        -- No targets found, clear mutex immediately
                        player:setStorageValue(plantEaterMutex, 0)
                    end
                elseif spellName == "scytheReaper" then
                    -- Scythe Reaper spell execution - applies poison condition to random monsters
                    local playerPos = player:getPosition()
                    local effect = SpellSystem.effects[spellName]
                    
                    -- Set a mutex to prevent conflicts with other spells
                    local scytheReaperMutex = 170399 -- Special storage for scytheReaper mutex
                    if player:getStorageValue(scytheReaperMutex) > 0 then
                        -- Spell is already running, skip this execution
                        return true
                    end
                    -- Set mutex (will be cleared after execution)
                    player:setStorageValue(scytheReaperMutex, 1)
                    
                    -- Get damage upgrade for poison strength
                    local damageValue = damageUpgrade
                    if damageValue <= 0 then
                        damageValue = 50 -- Default minimum
                    end
                    
                    -- Calculate area based on upgrades (base is 2)
                    local radius = SpellSystem.calculateArea(spellData.baseArea, areaUpgrade)
                    
                    -- Find all monsters in radius by ID
                    local targetIds = {}
                    for x = -radius, radius do
                        for y = -radius, radius do
                            local checkPos = Position(playerPos.x + x, playerPos.y + y, playerPos.z)
                            local tile = Tile(checkPos)
                            if tile then
                                local creatures = tile:getCreatures()
                                if creatures then
                                    for _, creature in ipairs(creatures) do
                                        if creature:isMonster() then
                                            -- Store monster ID and position
                                            table.insert(targetIds, {
                                                id = creature:getId(),
                                                pos = {
                                                    x = creature:getPosition().x,
                                                    y = creature:getPosition().y,
                                                    z = creature:getPosition().z
                                                }
                                            })
                                        end
                                    end
                                end
                            end
                        end
                    end
                    
                    -- Store player GUID for safety
                    local playerGUID = player:getGuid()
                    
                    -- Apply poison to random monsters if any found
                    if #targetIds > 0 then
                        -- Use addEvent to process targets in a separate execution context
                        addEvent(function(guid, monsterData, dmgValue, fx, mutexStorage)
                            -- Get player by GUID to ensure they're still online
                            local p = Player(guid)
                            if not p then
                                -- Clear mutex and abort if player is offline
                                return
                            end
                            
                            -- Apply to up to 3 random targets
                            local maxTargets = math.min(3, #monsterData)
                            local processedTargets = 0
                            
                            while processedTargets < maxTargets and #monsterData > 0 do
                                local randomIndex = math.random(1, #monsterData)
                                local targetInfo = monsterData[randomIndex]
                                
                                -- Get the monster by ID
                                local target = Creature(targetInfo.id)
                                
                                -- Safety check for valid target
                                if target and target:isMonster() then
                                    -- Create a new poison condition for each target
                                    local poison = Condition(CONDITION_POISON)
                                    poison:setParameter(CONDITION_PARAM_DELAYED, true)
                                    poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
                                    poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
                                    poison:setParameter(CONDITION_PARAM_STARTVALUE, -dmgValue)
                                    poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
                                    poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)
                                    
                                    -- Apply effect and poison condition
                                    target:getPosition():sendMagicEffect(fx)
                                    target:addCondition(poison)
                                    
                                    -- Also apply initial damage
                                    doTargetCombatHealth(p, target, COMBAT_EARTHDAMAGE, -dmgValue, -dmgValue, fx)
                                    
                                    processedTargets = processedTargets + 1
                                end
                                
                                -- Remove this target from the pool
                                table.remove(monsterData, randomIndex)
                            end
                            
                            -- Clear mutex after processing
                            if p then
                                p:setStorageValue(mutexStorage, 0)
                            end
                        end, 50, playerGUID, targetIds, damageValue, effect, scytheReaperMutex)
                    else
                        -- No targets found, clear mutex immediately
                        player:setStorageValue(scytheReaperMutex, 0)
                    end
                elseif SpellSystem.endsWith(spellName, "TargetMissile") then
                    -- Target Missile spell execution
                    local damage = SpellSystem.calculateDamage(spellData.baseDamage, damageUpgrade)
                    local playerPos = player:getPosition()
                    
                   
                    -- Find target in gradually expanding area based on upgrades
                    local targetInfo = SpellSystem.findTargetInArea(player, areaUpgrade)
                    if targetInfo then
                        -- Get combat type and effects
                        local combatType = SpellSystem.combatTypes[spellName]
                        local effect = SpellSystem.effects[spellName]
                        local projectile = SpellSystem.projectiles[spellName]
                        
                        -- Show projectile and effect
                        playerPos:sendDistanceEffect(targetInfo.position, projectile)
                        targetInfo.position:sendMagicEffect(effect)
                        
                        -- Deal damage
                        doTargetCombatHealth(player, targetInfo.creature, combatType, -damage, -damage, effect)
                        
                        -- Handle area effects if upgraded
                        if areaUpgrade > 0 then
                            local areaPositions = SpellSystem.getMissileAreaPositions(targetInfo.position, areaUpgrade, player:getDirection(), player)
                            for _, areaPos in ipairs(areaPositions) do
                                local areaTile = Tile(areaPos.pos)
                                if areaTile then
                                    local areaCreatures = areaTile:getCreatures()
                                    if areaCreatures then
                                        for _, creature in ipairs(areaCreatures) do
                                            if creature:isMonster() then
                                                local areaDamage = math.floor(damage * areaPos.damageModifier)
                                                doTargetCombatHealth(player, creature, combatType, -areaDamage, -areaDamage, effect)
                                            end
                                        end
                                    end
                                    areaPos.pos:sendMagicEffect(effect)
                                end
                            end
                        end
                    end
                end
            end
        end
    end
    return true
end

 

 

gen_floor.lua gen_killmonster.lua

My model can use sonnet 3.7 and its not better 
try to ask for an entire CUstom sytem for any custom data pack will not work.

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Johncore
      Open Source MMORPG emulador de Tibia escrito em C++.
      Servidor Oficial do Tibiaking!

       
       
        
       Novidades!
       
      - Protocolo 12.51
       
      - Bestiary
      - Charms
      - Boosted Creature
      - Quick Loot
      - Supply Stash
      - Event Schedule
      - GLOBAL MAP FULL
      - Quests com Quest Log 100%
      - Anti Rollback 100%
      - Source Optimizada
      - Sistema Anti WPE 100%
      - SUMMER UPDATE 2020 AND WINTER UPDATE 2020
      - Bounac
      - Wherehyenas
      - Mirrored Nightmare
      - Exercise Training 100%
      - Monstros 100%
      - Trainer Offline 100%
      - Trainer Online 100%
      - War System 100%
       
       

       
      Imagens :
       
      THAIS TEMPLE
       

       
       
      



      Downloads 

       
       Servidor + Database: 
       Download 
      »» PROJETO OFFICIAL:  GITHUB
       
      »» Distro + Dlls 64x
       otg-king_Distro_e_Dlls_Tibiaking.com.zip

       
      OTG Gesior
      GESIOR OFFICIAL CLIQUE AQUI

       

      MAP EDITOR 12.51
       
      - Remere's Map Editor 3.7.1 - Paletas atualizadas!
       
       
       
      - Remere's Map Editor 3.7.0: MediaFire (scan)
      - Items (.otb e .xml) do OTG King Otserv 12.51 https://github.com/Johncorex/otg-king/tree/master/data/items
       

       
      Créditos :
      The Forgotten Server
      OTG contribuidores
      OTX contribuidores
      Otbr contribuidores
      Johncore
      Erick Nunes
      Cjaker
      Leu
      Tibiaking
      Marson Schneider
      Erimyth
      Nolis
      Toninho
      Renan Ulian
      jzdj

       
       
      Grupo Whatsapp Official OTG (duvidas, chat):
      LINK
       
    • Por idlerpl
      TFS 1.5
       
      https://gyazo.com/b42464c4e3689d5d1a199e738208fb24

      game_fishing (1).zip
    • Por idlerpl
      . What server or website do you use as a base? 
      TFS 1.5
      What is the reason for this topic? 
      Free module share
       
       
       
      game_bank.zip
    • Por Under
      ATENÇÃO, DESENVOLVEDORES DE OTSERV! 
      Uma nova era está chegando — e você vai fazer parte dela desde o começo! 
       Ferramentas de IA + Formação Completa
      Estamos finalizando ferramentas exclusivas de inteligência artificial que vão revolucionar a forma como você cria e gerencia servidores de Tibia.
      E pra abrir com estilo, chegou a primeira etapa da nossa formação completa:
       Curso de Pixel Art para Tibia e Derivados


      Instrutor: Brendon Nogard, fundador da Pixel Art School
      Uma das maiores referências em arte para servidores de tibia no Brasil!
       Quem é o Nogard? @Nogard
      video-de-apresent.mp4
       
      Criador das primeiras remakes gráficas da PXG
      Mais de 10 anos de experiência com Pixel Art
      Conduziu a evolução da perspectiva GBA para um visual moderno e imersivo
      Influenciou uma geração inteira de criadores na comunidade OTServer no Brasil.
       O que você vai aprender nesse curso?
      Compre Aqui!
       Perspectiva 45° para Tibia e derivados
       Criação de itens: pokébolas, loots, mochilas, poções
       Personagens animados com variações de cabelo
       Criaturas como Wolf, Werewolf, Snake, Horse e Centauro
       Cenários: paredes, cortinas, troféus
       Texturas: folhas, rochas
       Fundamentos de estilo, coerência e construção de sprites profissionais
        Duração: 12 horas
        VALOR : R$250,00
       BÔNUS POR R$50,00
      Também está disponível o Curso de Pixel Art Top Down, ideal pra quem quer começar do zero absoluto:
      Crie personagens, inimigos, chefes
      Monte todo o ambiente do seu jogo
         Duração: 3 horas
       Por que isso é importante pra você?
      Esse é o primeiro passo pra criar um OTServer com:
       Identidade visual única
       Alto nível gráfico
       Suporte de ferramentas de IA exclusivas
       E um método claro, testado e acessível!
       Nas próximas 4 semanas...
      Vamos liberar novos cursos sobre:
       Criação de mapas
       Desenvolvimento de sistemas e scripts
       IA aplicada ao design de jogo (desenvolvimento)
       Balanceamento, mecânicas e muito mais!
       Garanta sua vaga agora!
      Comece hoje mesmo com o pé direito.
      Compre Aqui!
    • Por Under
      A CipSoft acaba de anunciar uma grande novidade: a empresa agora também será responsável pelo desenvolvimento e operação do clássico The Settlers Online! 
      O time que já cuidava do jogo seguirá dedicado ao projeto, mas agora diretamente do novo escritório da CipSoft em Düsseldorf, na Alemanha.
       
      Pra quem não conhece, The Settlers Online é um jogo com uma base de jogadores muito fiel e engajada — algo que a CipSoft conhece bem graças à comunidade Tibiana que, há décadas, mostra paixão, comprometimento e amor pelo jogo. 
      O mais importante:
      É incrível ver a CipSoft crescendo e levando seu espírito de comunidade para novos horizontes, sem esquecer de onde veio e quem está com ela há tantos anos. 
      Anúncio oficial no fórum do Tibia
      Site oficial de The Settlers Online (Brasil)
       
  • Estatísticas dos Fóruns

    96842
    Tópicos
    519603
    Posts
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo