• 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 Xikini's Free Scripting Service TFS 1.3

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,791
Solutions
581
Reaction score
5,354
Please request
actions / creatureevents / globalevents / npcs / movements / talkactions

Do not request
spells / weapons / monsters / source editing / database queries

My goal of this thread is to learn TFS 1.3 scripting.

------------------------------------
Support

If you have an issue with one of my scripts, I will attempt to help you, but not in this thread.
Make a thread in the support board.
Ensure to follow all rules of the support board.
Without all neccesary information it's impossible to help you.

------------------------------------
I will only be scripting for TFS 1.3

Not TFS 1.1 / 1.2
Not OTServBR / OTX
and certainly not TFS 0.4

When requesting a script, don't ask for "this script I saw on super popular OT".

I don't care where the idea came from.
I don't want to see a video of the script in action.

I'm here to learn how to script better.
Just describe what the script is supposed to do, and I'll try to make it.

Any script that I make in response to a request from this thread will be shared publically, here, in this thread.

I'm not going to make anything in private, so post your request in this thread only.
Please, for the love of god, don't pm me asking to make a script.
I will actually add you to my ignore list if you do that.
--------------

Anyways!

Thanks for coming by and checking the thread out.
If you think there is a better way to script something, feel free to let me know.
I'm here to learn.

Cheers,

Xikini

----

Completed Scripts

DPS Dummy -> using RevScripts
!playerinfo character name -> using RevScripts
Positional Text talkaction -> using RevScripts
||--> Updated version that can use text & effects
Vocational Item Bonus's -> using RevScripts
||--> Updated version with easier config.
Simple damge buff potion -> using Revscripts
Kill monster in specific area, remove stone for x seconds -> using RevScripts
Training Room Teleporter -> using RevScripts
Lever that removes/adds/transforms objects or ground tiles -> using RevScripts
Loot from monster goes into single backpack, no matter how much loot there is.
Extra loot in monsters, based on chance and tier list -> using RevScripts
||--> Updated version that allows specific monsters to have their own loot table
Random Item chest that disappears after use, and respawns after x time -> using RevScripts
Multiple players required to open passageway.
Monster Arena Lever (x amount of waves, complete all waves, teleport appears) -> using RevScripts
Daily Boosted Creatures (experience & loot chance of items)
||--> Updated main file of boosted creatures, so that it triggers at midnight, instead of when the server starts up.
Reward Chest - Extremely simple. -> using Revscripts
Simple Npc that can sell an item, via text.

----

Extremely useful libs that I use quite often.

data/lib/core/player.lua
Give player items by table

data/lib/core/container.lua
getContainerFreeSlots

----

To-Do List

Shalaby - Player death counter. (Movement and talkaction)
Shalaby - Npc kill monster task, with item reward.
Shalaby - Boss respawn after x time.

-------

Last spot I've read messages
 
Last edited:
thanks alot for all the scripts u have made so far! 🤘

Now i have a request for you :)
I would like spell that follow a pattern of positions (enviroment spell)

example


spell1.png
 

Attachments

  • 483e13fde74f1fb31cb68f1e06bad4d9.gif
    483e13fde74f1fb31cb68f1e06bad4d9.gif
    3.7 MB · Views: 53 · VirusTotal
I need boss arena system for tfs 1.3 - 8.6

You can enter boss arena with lever minimum 1 people maximum 5.
You can enter every 10 hours.
If you leave the arena from teleport u cant kill boss again in 10 hours.
If you die in arena u cant kill boss again in 10 hours.
When you enter arena you have 30 min to kill boss otherwise teleport players outside of arena.

Thank you
 
[SCRIPT 1]
Create a system that allow players to buy land and build their own house in the land.
Players can also desconstruct anything they already done in the house and receive the materials back.
Only the player that own that land can build and desconstruct.
Also only allow similar walls and doors to be build. For example, if player build stone wall, he can't put wood wall side by side of a stone wall, just to keep the houses in the server looking normal.








[SCRIPT 2]
Post automatically merged:

How about that same script, but instead of removing it, adding floor?


The script will work the same way I guess, but its for a pirate boat. When you kill 50 pirates (any type of pirate), will appear a floor (bridge) that will conect the boats. The bridge will be active until the boss die. (the boss is in the small boat).

View attachment 54448

View attachment 54447
Hey mate, I think you did not see my request.
 
To be fair, I'm still working on requests from August of last year because of my hiatus. 🧜‍♀️

Once I get the time to finish the last 4 things from that queue, I'll be going through and refilling the to-do list.

If you check the first post, you can see the last spot/time I updated my to-do list.

I'm slow. But it's free. So 🤷‍♂️
 
To be fair, I'm still working on requests from August of last year because of my hiatus. 🧜‍♀️

Once I get the time to finish the last 4 things from that queue, I'll be going through and refilling the to-do list.

If you check the first post, you can see the last spot/time I updated my to-do list.

I'm slow. But it's free. So 🤷‍♂️
Totally get that, and I'm sorry if I sounded like I was asking for the script right way, that wasn't my intention.
 
can you create curses for one quest? ex: have 30% chance to curse the player with one curse below:

1: -5% hp each 10sec;

2: if you kill one creature in one area with corners(X, Y) has a chance to spawn one creature closer you.

3: if you attack one creature, has a chance in the last hit, the creature heal himself complete.

4: if you kill one certain number of creature, you have a 50% chance to kill himself

if the player stay more long time wich 30min with one curse, he will killed.

thank you <3

it's equal to curse of Soul War? or adapted? your choice
 
i was wondering if you can make an example of a quest chest that the player need kill x monster to be opened.
i dont have level doors on my server but i want for example if a player go to crusader helmet quest that player who want do the quest need to kill the giant spider if he don't kill the giant spider can't open the chest :) please if that is possible ofc and hope you understand what i mean :D thanks
 
Ok can you make the script to sell 1,2,3 or ... 'x' store coins (id:24774)?
Done.
nefinoo_simpleNPC.gif
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local coinId = 24774
local coinCost = 42 -- gold coins
local coinsAmount = {}

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)      npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                          npcHandler:onThink()                        end

local function greetCallback(cid)
    npcHandler.topic[cid] = 0
    coinsAmount[cid] = 0
    return true
end

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
    
    local player = Player(cid)

    if msgcontains(msg, "buy") then
        npcHandler:say("How many store coins would you want to buy?", cid)
        npcHandler.topic[cid] = 1
        
    elseif npcHandler.topic[cid] == 1 then
        local amount = tonumber(msg) ~= nil
        if not amount then
            npcHandler:say("I'm unfamiliar with that number. How many store coins do you want to buy?", cid)
            return true
        end
        amount = tonumber(msg)
        if amount < 0 or amount > 1000000 then
            npcHandler:say("I'm unfamiliar with that number. How many store coins do you want to buy?", cid)
            return true
        end
        npcHandler:say("Would you like to purchase " .. amount .. " store coins for " .. (amount * coinCost) .. " gold coins?", cid)
        npcHandler.topic[cid] = 2
        coinsAmount[cid] = amount
        
    elseif npcHandler.topic[cid] == 2 then
        if not msgcontains(msg, "yes") then
            npcHandler:say("Another time then.", cid)
            npcHandler.topic[cid] = 0
            return true
        end
        local cost = coinsAmount[cid] * coinCost
        if player:getMoney() < cost then
            npcHandler:say("You do not have enough gold coins to make this purchase. Another time, maybe?", cid)
            npcHandler.topic[cid] = 0
            coinsAmount[cid] = 0
            return true
        end
        player:removeMoney(cost)
        player:addItem(coinId, coinsAmount[cid], true)
        npcHandler:say("I appreciate your business.", cid)
        npcHandler.topic[cid] = 0
        coinsAmount[cid] = 0
        
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Hey, would you like to make Attack speed script for me?

I would like to get something like this:
10 - Attack speed -> 2000 MS Auto Attack
11 - Attack Speed -> 1990 MS Auto Attack
etc.
At max 100 AS -> 1000 MS Auto attack
 
I need a creature that dead body is a teleport with x, y, z position that disappears over time, like a normal dead body.
 
Player learn a spell at level 10, lets says player learn exori flam. At level 30, he can talk to a npc and upgrade the spell to exori flam hur or exevo gran mas flam for 5k (gold). When the player get the upgrade spell, he doesn't know exori flam anymore, only exori flam hur or exevo gran mas flam.

-> Script need to support several upgrades, for example:
exori flam can be upgraded to exori flam hur or exevo gran mas flam
exori frigo can be upgraded to exori frigo hur or exevo gran mas frigo
 
@Xikini got one for you, guessing it is not that hard but I have no idea where I would start from, being real honest.

Idea: instead of mobs dropping gold and you having to loot them, the gold goes directly into your backpack and stack/auto-converts with the other gold already in your backpack.
 
@Xikini got one for you, guessing it is not that hard but I have no idea where I would start from, being real honest.

Idea: instead of mobs dropping gold and you having to loot them, the gold goes directly into your backpack and stack/auto-converts with the other gold already in your backpack.
Exists alredy. Search for autoloot system
 
Exists alredy. Search for autoloot system
Nah, that still drops the gold. I've managed to do something like what I asked
Still didnt make the auto-stacking/converting one tho, will update this post if I manage to do so.

events\scripts\monster.lua

After
Lua:
        if player then
Add:
Lua:
            local gamount = math.random(mType:experience() * 0.1, mType:experience() * 0.3)
After:
Lua:
            else
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, text)
            end
Add:
Lua:
            player:addItem(2148, gamount) -- INFO: Gold Coin ID + gamount which is defined with our formula.
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You received " .. gamount .. " gold coins.") -- Message player will receive when killing a mob.
 
Last edited:
Nah, that still drops the gold. I've managed to do something like what I asked
Still didnt make the auto-stacking/converting one tho, will update this post if I manage to do so.

events\scripts\monster.lua

After
Lua:
        if player then
Add:
Lua:
            local gamount = math.random(mType:experience() * 5 / player:getLevel()) -- GOLD DROP FORMULA: Creature EXP times 5 divided by the player level. (I guess this could really be improved to be real honest, not that good with formulas.)
After:
Lua:
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, text)
            end
Add:
Lua:
            player:addItem(2148, gamount) -- INFO: Gold Coin ID + gamount which is defined with our formula.
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You received " .. gamount .. " gold coins.") -- Message player will receive when killing a mob.
I'd suggest using
MESSAGE_STATUS_DEFAULT (White message at the bottom of the game window and in the console)
instead of
MESSAGE_INFO_DESCR. (Green message in center of game window and in the console)

It will be less annoying for the player. xP
 
I'd suggest using
MESSAGE_STATUS_DEFAULT (White message at the bottom of the game window and in the console)
instead of
MESSAGE_INFO_DESCR. (Green message in center of game window and in the console)

It will be less annoying for the player. xP
Edited that. Any tips on how to separate hundreds values from tenths?
 
Edited that. Any tips on how to separate hundreds values from tenths?
Can you write that for me?

What it currently looks like:
What you want it to look like:
 
Can you write that for me?

What it currently looks like:
What you want it to look like:
Sure, I'll try to explain.

I have a random value defined by the "gamount" var in the script above, lets assume it randomized 157.
I want to separate that in two or three vars (whatever is possible)

Example:
hundredths = 1
rest = 57

Just so I could make a statement to add 39 platinum coins and 57 gold coins instead of adding like 3957 gold coins
 
Status
Not open for further replies.
Back
Top