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

Lua [TFS 1.3] Free Scripting Service 📝

Status
Not open for further replies.

Sarah Wesker

ƐƖєgαηт Sуηтαx ❤
Staff member
TFS Developer
Support Team
Joined
Mar 16, 2017
Messages
1,408
Solutions
154
Reaction score
1,958
Location
London
GitHub
MillhioreBT
Twitch
millhiorebt
I am bored, and I have some days in which I will not have much to do, if you need a script you can post here what you want and if it meets the requirements below, I will do it for you

🗒 Requirements:
🔶 TFS engine 1.3+
🔶 That does not include changes in the sources (if you don't know what this is, you can still ask💬)
🔶 I'll only do one script per person so don't spam🔇too much, until a second chance ...
🔶 It depends on what you ask, I will make the decision to accept or not to do it👀
🔶 I know that several people have posted threads similar to this one, but to add more variety, also not all can be available at the same time👌

Don't be afraid to ask 🤗

👍 If I like your post it means that I have taken the task! 👍
 
Last edited:
I need that when killing a monster it explodes or generates an explosion when it dies, second that a monster heals a boss if it is killed near the same, If you need more explanation, let me know
Post automatically merged:

I need that when killing a monster it explodes or generates an explosion when it dies, second that a monster heals a boss if it is killed near the same, If you need more explanation, let me know
 
I am bored, and I have some days in which I will not have much to do, if you need a script you can post here what you want and if it meets the requirements below, I will do it for you

🗒 Requirements:
🔶 TFS engine 1.3+
🔶 That does not include changes in the sources (if you don't know what this is, you can still ask💬)
🔶 I'll only do one script per person so don't spam🔇too much, until a second chance ...
🔶 It depends on what you ask, I will make the decision to accept or not to do it👀
🔶 I know that several people have posted threads similar to this one, but to add more variety, also not all can be available at the same time👌

Don't be afraid to ask 🤗

👍 If I like your post it means that I have taken the task! 👍



Hi there
someone could help me
with this file
What happens is that when you open the door, it turns it into another, it becomes more doors ..

example
door 1 becomes 2 and thus it becomes.
 

Attachments

Hi Sarah,

I need a spell that ricochet the damage on mobs closer to the main target.
if possible to make configurable like this;
Lua:
distanceEffect = 30
damageType = COMBAT_PHYSICALDAMAGE
ricochetChance = 20%
IncreaseRicochetWithSkill = +1 mob each +20 skill


ehh, maybe i asked a little bit to much, but i hope you can help me with this one XD
 
Hello, I've been looking for a script that when you kill a specific type of monster, it will give a chance of spawning another for its respective type of monster. As an example: you kill a dragon, there is a small chance of spawning a dragon miniboss, or you kill a dragon lord, there is a chance of spawning a dragon lord miniboss

Hope you can help me out with this one.
 
hello, I would need a spell that, when used on an opponent, takes him to certain positions on the map and returns with him in five seconds, thank you very much for your attention, best regards.
 
I need that when killing a monster it explodes or generates an explosion when it dies, second that a monster heals a boss if it is killed near the same, If you need more explanation, let me know
Post automatically merged:
data/scripts/yourscriptname.lua
Lua:
local explosion = {
    ["Demon"] = {
        area = createCombatArea(AREA_CROSS6X6),
        min = -1000,
        max = -1500,
        effect = CONST_ME_FIREAREA,
        combat = COMBAT_FIREDAMAGE
    }
}
local cExplosionWhenDie = CreatureEvent("ExplosionWhenDie")
function cExplosionWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = explosion[creature:getName()]
    if prop then
        doAreaCombatHealth(creature:getId(), prop.combat, creature:getPosition(), prop.area, prop.min, prop.max, prop.effect, ORIGIN_SPELL)
    end
    return true
end
cExplosionWhenDie:register()
local healing = {
    ["Dragon"] = {
        bossName = "Demon",
        radius = 7,
        min = 1000,
        max = 1500,
        distanceEffect = CONST_ANI_HOLY,
        effect = CONST_ME_MAGIC_BLUE
    }
}
local cHealBossWhenDie = CreatureEvent("HealBossWhenDie")
function cHealBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = healing[creature:getName()]
    if prop then
        local creaturePos = creature:getPosition()
        local spectators = Game.getSpectators(creaturePos, false, false, prop.radius, prop.radius, prop.radius, prop.radius)
        for _, spectator in pairs(spectators) do
            if spectator:getName() == prop.bossName then
                bossPosition = spectator:getPosition()
                creaturePos:sendDistanceEffect(bossPosition, prop.distanceEffect)
                spectator:addHealth(math.random(prop.min, prop.max))
                bossPosition:sendMagicEffect(prop.effect)
            end
        end
    end
    return true
end
cHealBossWhenDie:register()
local ev = EventCallback
function ev.onTargetCombat(creature, target)
    if creature:isPlayer() and target:isMonster() then
        if explosion[target:getName()] then
            target:registerEvent("ExplosionWhenDie")
        elseif healing[target:getName()] then
            target:registerEvent("HealBossWhenDie")
        end
    end
    return RETURNVALUE_NOERROR
end

The demon throws an explosion when he dies
The dragon heals the demon when he dies

Use the table explosion to add other explosive monsters
Use the table healing to add other monsters that heal a nearby boss or monster
 
data/scripts/yourscriptname.lua
Lua:
local explosion = {
    ["Demon"] = {
        area = createCombatArea(AREA_CROSS6X6),
        min = -1000,
        max = -1500,
        effect = CONST_ME_FIREAREA,
        combat = COMBAT_FIREDAMAGE
    }
}
local cExplosionWhenDie = CreatureEvent("ExplosionWhenDie")
function cExplosionWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = explosion[creature:getName()]
    if prop then
        doAreaCombatHealth(creature:getId(), prop.combat, creature:getPosition(), prop.area, prop.min, prop.max, prop.effect, ORIGIN_SPELL)
    end
    return true
end
cExplosionWhenDie:register()
local healing = {
    ["Dragon"] = {
        bossName = "Demon",
        radius = 7,
        min = 1000,
        max = 1500,
        distanceEffect = CONST_ANI_HOLY,
        effect = CONST_ME_MAGIC_BLUE
    }
}
local cHealBossWhenDie = CreatureEvent("HealBossWhenDie")
function cHealBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = healing[creature:getName()]
    if prop then
        local creaturePos = creature:getPosition()
        local spectators = Game.getSpectators(creaturePos, false, false, prop.radius, prop.radius, prop.radius, prop.radius)
        for _, spectator in pairs(spectators) do
            if spectator:getName() == prop.bossName then
                bossPosition = spectator:getPosition()
                creaturePos:sendDistanceEffect(bossPosition, prop.distanceEffect)
                spectator:addHealth(math.random(prop.min, prop.max))
                bossPosition:sendMagicEffect(prop.effect)
            end
        end
    end
    return true
end
cHealBossWhenDie:register()
local ev = EventCallback
function ev.onTargetCombat(creature, target)
    if creature:isPlayer() and target:isMonster() then
        if explosion[target:getName()] then
            target:registerEvent("ExplosionWhenDie")
        elseif healing[target:getName()] then
            target:registerEvent("HealBossWhenDie")
        end
    end
    return RETURNVALUE_NOERROR
end

The demon throws an explosion when he dies
The dragon heals the demon when he dies

Use the table explosion to add other explosive monsters
Use the table healing to add other monsters that heal a nearby boss or monster

thk

Sarah Wesker

 
data/scripts/yourscriptname.lua
Lua:
local explosion = {
    ["Demon"] = {
        area = createCombatArea(AREA_CROSS6X6),
        min = -1000,
        max = -1500,
        effect = CONST_ME_FIREAREA,
        combat = COMBAT_FIREDAMAGE
    }
}
local cExplosionWhenDie = CreatureEvent("ExplosionWhenDie")
function cExplosionWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = explosion[creature:getName()]
    if prop then
        doAreaCombatHealth(creature:getId(), prop.combat, creature:getPosition(), prop.area, prop.min, prop.max, prop.effect, ORIGIN_SPELL)
    end
    return true
end
cExplosionWhenDie:register()
local healing = {
    ["Dragon"] = {
        bossName = "Demon",
        radius = 7,
        min = 1000,
        max = 1500,
        distanceEffect = CONST_ANI_HOLY,
        effect = CONST_ME_MAGIC_BLUE
    }
}
local cHealBossWhenDie = CreatureEvent("HealBossWhenDie")
function cHealBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = healing[creature:getName()]
    if prop then
        local creaturePos = creature:getPosition()
        local spectators = Game.getSpectators(creaturePos, false, false, prop.radius, prop.radius, prop.radius, prop.radius)
        for _, spectator in pairs(spectators) do
            if spectator:getName() == prop.bossName then
                bossPosition = spectator:getPosition()
                creaturePos:sendDistanceEffect(bossPosition, prop.distanceEffect)
                spectator:addHealth(math.random(prop.min, prop.max))
                bossPosition:sendMagicEffect(prop.effect)
            end
        end
    end
    return true
end
cHealBossWhenDie:register()
local ev = EventCallback
function ev.onTargetCombat(creature, target)
    if creature:isPlayer() and target:isMonster() then
        if explosion[target:getName()] then
            target:registerEvent("ExplosionWhenDie")
        elseif healing[target:getName()] then
            target:registerEvent("HealBossWhenDie")
        end
    end
    return RETURNVALUE_NOERROR
end

The demon throws an explosion when he dies
The dragon heals the demon when he dies

Use the table explosion to add other explosive monsters
Use the table healing to add other monsters that heal a nearby boss or monster

:/
:(
 
Hi Sarah,

I need a spell that ricochet the damage on mobs closer to the main target.
if possible to make configurable like this;
Lua:
distanceEffect = 30
damageType = COMBAT_PHYSICALDAMAGE
ricochetChance = 20%
IncreaseRicochetWithSkill = +1 mob each +20 skill


ehh, maybe i asked a little bit to much, but i hope you can help me with this one XD

Hi @Niloahs
⚡ Bounce Spell ⚡

GIF 03-02-2021 12-46-19 a. m..gif
In this visual example, you can see when the spell gets all hits, this will depend on the chance you set
Note: I'm not sure if it is exactly what you ordered, I hope so
 
Last edited:
I am bored, and I have some days in which I will not have much to do, if you need a script you can post here what you want and if it meets the requirements below, I will do it for you

🗒 Requirements:
🔶 TFS engine 1.3+
🔶 That does not include changes in the sources (if you don't know what this is, you can still ask💬)
🔶 I'll only do one script per person so don't spam🔇too much, until a second chance ...
🔶 It depends on what you ask, I will make the decision to accept or not to do it👀
🔶 I know that several people have posted threads similar to this one, but to add more variety, also not all can be available at the same time👌

Don't be afraid to ask 🤗

👍 If I like your post it means that I have taken the task! 👍
Hi, thanks for doing this! much appreciated!

So i would like to ask for a spell, that does so:
-Summons a creature
-Summon can be killed by players and monsters
-If the summon is killed by player or monster he explodes and doesnt deal any damage to the surrounding players (but does to the monsters)(area of explosion is 1 sqm around the summon)
-Summon upon reaching the target explodes(dies) and deals x amount of dmg (monsters and targeted player(only to targeted player) )
-Summon doesnt deal any other damage than explosion upon dying.
-Damage calculated based on player level and magic lvl.

If you decide to even create this spells, here are some additional, probably more time consuming features of this spell, perhaps u would be so kind to also add them , if not then its all good and im grateful anyway.
-Summons health is the % health of the player that summons it.
-Summons movement speed is 1.5x greater than the player that summons it.
-Summon follows u even if u change floor
-Summon teleports back to the player if he lost the player from the screen.

Thank you in advance.
 
Last edited:
Hey good morning (or evening). If u want help me am gonna be very happy man:
Actually I tried to edit existing script with stats, by adding more options like attackspeed etc. (with options to modal)
But my skill right now is not that much for this and I always end with errors in console
Can u add to this script some options like attackspeed (-1%) and dmg reduction (+1%)?
I have done adding attackspeed .lua function to server.
Can u help me? <3

The script:
 
Hello, I've been looking for a script that when you kill a specific type of monster, it will give a chance of spawning another for its respective type of monster. As an example: you kill a dragon, there is a small chance of spawning a dragon miniboss, or you kill a dragon lord, there is a chance of spawning a dragon lord miniboss

Hope you can help me out with this one.
What you ask is not very specific, however it is quite simple ...

When I read your publication, i imagine more things than you have asked, however those things require changes in the sources to be viable, the truth would have been beautiful, unfortunately in my publication I mentioned that I will not make changes in the sources.

Anyway, I made you a small script which generates a monster of the same type with an increased amount of life, when generated, an explosion effect is sent to give it a more dramatic touch.

data/scripts/yourscriptname.lua
Lua:
local spawnbosses = {
    ["Rotworm"] = {
        chance = 50,
        bossName = "Demon" -- i use Demon only for test
    },
    ["Dragon"] = {
        chance = 50,
        bossName = "Dragon Boss"
    }
}

local cSpawnBossWhenDie = CreatureEvent("SpawnBossWhenDie")
function cSpawnBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = spawnbosses[creature:getName()]
    if prop and math.random(100) <= prop.chance then
        Game.createMonster(prop.bossName, creature:getPosition())
    end
    return true
end
cSpawnBossWhenDie:register()

local ev = EventCallback
function ev.onTargetCombat(creature, target)
    if creature:isPlayer() and target:isMonster() and spawnbosses[target:getName()] then
        target:registerEvent("SpawnBossWhenDie")
    end
    return RETURNVALUE_NOERROR
end

GIF 03-02-2021 04-17-11 a. m..gif

Normally what would be expected of a miniboss is that it has: name, damage and other different properties, but without changes in the sources it is not possible, only the health per default, I hope this script will help you, or at least as an example, maybe for the next round you can imagine something that is more within reach ;)
Post automatically merged:

hello, I would need a spell that, when used on an opponent, takes him to certain positions on the map and returns with him in five seconds, thank you very much for your attention, best regards.
Hi @Restles
I hope this is enough, thanks for participating

data/scripts/yourscriptname.lua
Lua:
local spellTpConfig = {
    toPositions = {
        Position(3127, 1802, 7),
        Position(3128, 1807, 7),
        Position(3131, 1807, 7)
    },
    interval = 5 * 1000 -- 5 seconds
}

local spell = Spell(SPELL_INSTANT)

function spell.onCastSpell(creature, variant)
    local tid = variant:getNumber()
    local target = Creature(tid)
    local afterPos = target:getPosition()
    creature:getPosition():sendDistanceEffect(afterPos, CONST_ANI_ENERGY)
    afterPos:sendMagicEffect(CONST_ME_POFF)
    target:teleportTo(spellTpConfig.toPosition)
    spellTpConfig.toPosition:sendMagicEffect(CONST_ME_TELEPORT)
    addEvent(function(tid, afterPos)
        local target = Creature(tid)
        if target then
            target:getPosition():sendMagicEffect(CONST_ME_POFF)
            target:teleportTo(afterPos)
            afterPos:sendMagicEffect(CONST_ME_TELEPORT)
        end
    end, spellTpConfig.interval, tid, afterPos)
    return true
end

spell:name("Teleport Spell")
spell:words("exuna tp")
spell:group("attack")
spell:vocation("sorcerer", "master sorecerer")
spell:id(1)
spell:cooldown(1000)
spell:level(200)
spell:range(6)
spell:manaPercent(13)
spell:needTarget(true)
spell:blockWalls(true)
spell:isPremium(true)
spell:register()

GIF 03-02-2021 04-32-04 a. m..gif

In the configuration you can add all the positions you want, in this example I use a position quite close to the target, but it works at any distance, the time can also be configured.
 
Last edited:
What you ask is not very specific, however it is quite simple ...

When I read your publication, i imagine more things than you have asked, however those things require changes in the sources to be viable, the truth would have been beautiful, unfortunately in my publication I mentioned that I will not make changes in the sources.

Anyway, I made you a small script which generates a monster of the same type with an increased amount of life, when generated, an explosion effect is sent to give it a more dramatic touch.

data/scripts/yourscriptname.lua
Lua:
local spawnbosses = {
    ["Rotworm"] = {
        chance = 50,
        newHppc = 2.50
    },
    ["Dragon"] = {
        chance = 50,
        newHppc = 1.10
    }
}

local cSpawnBossWhenDie = CreatureEvent("SpawnBossWhenDie")
function cSpawnBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local prop = spawnbosses[creature:getName()]
    if prop and math.random(100) <= prop.chance then
        local name = creature:getName()
        local maxHp = creature:getMaxHealth()
        if maxHp == MonsterType(name):getMaxHealth() then
            local pos = creature:getPosition()
            local boss = Game.createMonster(name, pos)
            if boss then
                pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
                local newMaxHp = maxHp * prop.newHppc
                boss:setMaxHealth(newMaxHp)
                boss:addHealth(newMaxHp)
            end
        end
    end
    return true
end
cSpawnBossWhenDie:register()

local ev = EventCallback
function ev.onTargetCombat(creature, target)
    if creature:isPlayer() and target:isMonster() and spawnbosses[target:getName()] then
        target:registerEvent("SpawnBossWhenDie")
    end
    return RETURNVALUE_NOERROR
end

View attachment 54473

Normally what would be expected of a miniboss is that it has: name, damage and other different properties, but without changes in the sources it is not possible, only the health per default, I hope this script will help you, or at least as an example, maybe for the next round you can imagine something that is more within reach ;)
Thanks for helping me out with this, the script looks great! I didn't thought it would require to edit sources as I had the idea that I would only need to create a copy of the xml file of the monsters and edit them to make them stronger, so when the original monster is killed, the script would summon the stronger version. I should have explained that by miniboss I only meant a stronger version of the monster, as that is what makes it confusing and complicated. Anyways, the script does what I wanted and its a great help, thanks again for making it.
 
Thanks for helping me out with this, the script looks great! I didn't thought it would require to edit sources as I had the idea that I would only need to create a copy of the xml file of the monsters and edit them to make them stronger, so when the original monster is killed, the script would summon the stronger version. I should have explained that by miniboss I only meant a stronger version of the monster, as that is what makes it confusing and complicated. Anyways, the script does what I wanted and its a great help, thanks again for making it.
i Edit the code in a moment so you can add your custom monsters as mini boss, you just have to wait a few minutes ;) thanks
 
I would like a script that gives bonus EXP for each connected MC (with a maximum of 4 mcs)
tfs 1.3

OPTION 1 (eventcallbacks):

open the file: data/scripts/eventcallbacks/players/default_onGainExperience.lua
above this code snippet: return exp paste the following code:
Lua:
exp = exp * (1 + (math.min(4, #getPlayersByIPAddress(player:getIp())) -1 * 0.10))

in such a way that it looks like this:
1612343778987.png

OPTION 2 (classic events):

If you don't use event callbacks, then go to this file: data/events/scripts/players.lua
and you do the same procedure mentioned above
If you are following these steps, then look for the function: function Player:onGainExperience(source, exp, rawExp)
and the code you need to paste now is:
Lua:
exp = exp * (1 + (math.min(4, #getPlayersByIPAddress(self:getIp())) -1 * 0.10))
in such a way that it looks like this:
1612343982572.png

-----------------------------------------------------------------------------------------------------------------------
Note: i not add a configuration table, because it is not necessary, it is only a line of code, easy to edit, as you can see, the number 4 is the maximum number of MC, and the number 0.10, is the extra amount of experience for each MC

GIF 03-02-2021 05-23-32 a. m..gif
 
Status
Not open for further replies.
Back
Top