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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,812
Solutions
582
Reaction score
5,372
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
@Xikini bump for request
I've been thinking about it on and off.
I have a rough idea in my head on how I might do it though.
So we don't have to use a database, we will need to use a whole bunch of storage values to hold all the different information.
Main thing I'll need to test is sending the prizes through to their depots.

In either case, Yes, I am working on it.
 
Hello Dear. Xikini , how are you?

I would ask a simple script : Every day of the week, there will be a war on the castle. But, this ( castle war ) has time and the appointed day, the tile to it should be open only x hours of the day and will close x + 1 hour of the day . That is, the guild will have only an hour for dueling and possibly take over the castle. The last guild to use the lever , will be in possession of the castle, and of course, have access to a unique port . If possible , add in a BOOK a guild that won the last battle :D ..

thank you.
 
@Xikini I need script sir for my server any one useing cavebotting he got a question maths question if he didn't answer took ban for 1 days if he answer still cavebotting and after 10 minutes got another question can someone understand what i need i useing tfs 0.4 client 8.6 thanks
 
Last edited:
@Xikini the best news I heard all week! Can't wait for the release
Yeah, I have the entire npc already worked out, I just need to get home sometime this weekend so I can test the damn parcel delivery system.

It's a little infuriating not being home to test stuff sometimes.

Cheer up. It should be fully tested soon.
Hello Dear. Xikini , how are you?

I would ask a simple script : Every day of the week, there will be a war on the castle. But, this ( castle war ) has time and the appointed day, the tile to it should be open only x hours of the day and will close x + 1 hour of the day . That is, the guild will have only an hour for dueling and possibly take over the castle. The last guild to use the lever , will be in possession of the castle, and of course, have access to a unique port . If possible , add in a BOOK a guild that won the last battle :D ..

thank you.
I think a bit more information on the area, or script, needs to be added.
While I could guess at what you want.. There is two very different paths this script could go, and I don't want to script both of them. :p

Can you explain exactly how you think the script should work? If required add some pictures to help your explanations.

Thanks!
@Xikini I need script sir for my server any one useing cavebotting he got a question maths question if he didn't answer took ban for 1 days if he answer still cavebotting and after 10 minutes got another question can someone understand what i need i useing tfs 0.4 client 8.6 thanks
Beyond a couple initial issues, such as the ban system not even working in my TFS version, this script is a little beyond my abilities.
I have a vague idea of what would be required to make the script, but yeah.. It's well beyond my scripting experience.

Sorry buddy!
 
@Xikini I need script sir for my server any one useing cavebotting he got a question maths question if he didn't answer took ban for 1 days if he answer still cavebotting and after 10 minutes got another question can someone understand what i need i useing tfs 0.4 client 8.6 thanks
https://otland.net/threads/potar-fully-automatic-100-anti-bot-system-lib-creature-talk-glob.181047/
this is a functional anti-bot system that requires you to input a code every now and then (if you are killing something), that you can modify to your needs, or if xikini is nice maybe he can help you with it :)
keep in mind it has some issues, which are mentioned in the thread though, such as that elfbot can read the text (but you can change the text to be send with doPlayerPopupFYI, which as far as i know, elfbot cant read atleast, although you can use other progrmas to do that, blocking elfbot from doing it will stop 99% of the people from what ive seen)
 
I think a bit more information on the area, or script, needs to be added.
While I could guess at what you want.. There is two very different paths this script could go, and I don't want to script both of them. :p

Can you explain exactly how you think the script should work? If required add some pictures to help your explanations.

Thanks!

Castle War 1.0.
Running all days of the week !!!


At first , I would like that this script is not passed on to anyone, because I wanted to test it first of all , do you accept?

The Castle War happens every day of the week , is only an hour long , it is intended for guilds .

part 1: time tile or tile for time (I'm not sure I'm the best person to answer that :D ok ok let's go there --->

has a right time to begin each day, for example: at 01:00 hr begins and ends at 02:00 p.m.
Example:
00:55 sending a message to multiple players (broadcast) mmm almost all of them, actually..
01:00 - Now all players with guild may enter, and fight until 02:00p.m
01:15 - sent a broadcast message :p The castle war is going on, call your guild and will kill your enemies and stay in the castle ownership with unique monsters. Only example.
01:30 - sent a broadcast message :p // // // ...
01:45 - sent a broadcast message :p // // // ...
01:58 - the last message: Warning that there's only two minutes to the end of the castle war .
02:00 - You can no longer pass through the special tile , now all that is within it will be sent to the temple and the last guild that used the lever is in possession of the castle.

02:01, 02:02, ..03:00, 04:00 ,05:00.. 11:00.. 15:00.. 20:00.. 00:59 --> doPlayerSendTextMessage(cid, 22, "There are no wars for the castle going on right now")

96am34.png
[/IMG]
96am34.png
[/IMG]
96am34.png




the guild that had the best strategy , which killed all the enemies and used the lever finally, will be able to enter the castle
if posible, sent that message: example:

if possible , if not , fine. creature

if getPlayerGuildRank(cid) == 'Leader' then

doPlayerAddItem(cid, 2160, 10)
doPlayerAddPremiumDays(cid, 2)
setPlayerStorageValue(cid, 10001, 1)
doPlayerSendTextMessage(cid, 22, "Congratulations! Your guild was winning the castle war for the castle! You are the Leader, so won 2 vip days and 10 crystal coins!")


and :

else
doPlayerAddItem(cid, 2160, 20)
setPlayerStorageValue(cid, 10001, 1)
doPlayerSendTextMessage(cid, 22, "Congratulations! Your guild was winning the castle war for the castle! You won 20 Crystal Coins!")


Only guild winning the castle war can enter, if not -- looping forever, not enter.
case 1: Congratulations! Welcome to the ̶j̶u̶n̶g̶l̶e̶ to your castle
case 2: Sorry, you were weak and lost the battle , wait until the next battle !! Check the book, right ?


2j5b6n7.png


book information of the castle war.
The last guild that is dominating the castle , that is, who pulled the lever for the last time.
The next battle: today or tomorrow, depends on the time of day.
00:55 - today. example: Aug 14, 2016,
02:01 - only tomorrow, right ?? Aug 15, 2016,

the time: 01:00 am ever.

2cda915.png


The last alliance can use the lever, before the castle closes, will own the castle. After he close, can no longer move it, all go to the temple.


mtqixe.png


At first , I would like that this script is not passed on to anyone, because I wanted to test it first of all , do you accept?

Thank you man !!! Keep it up :)
 
-- Edit, days later. vvvv
@Xikini when i have my request ?
i asked for it 2 months ago
I remember why I stopped working on this request.
When a creature dies it registers for each person who hit the creature.
Unless I can figure out a way out to find who last hit the creature, there's no way to create your script.

-- Edit, days later. ^^^^

Sorry for being a little inactive on the thread guys.
Getting in the mindset for scripting takes me a bit of time.
I do help in the support and request section often, and I've updated my first post with pending requests.
(which are all half finished or completed, just require testing.)


Credits to @Szka for the Request!

Level up rewards, based on vocations.
Can easily add more vocations, items, levels, rewards or change the gifts based on exact vocation. (with a very small edit)

Currently set-up for the 4 base tibia vocations.


data/creaturescripts/creaturescripts.xml

Code:
<event type="advance" name="level_up_gift" script="level_up_gift.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "level_up_gift")
data/creaturescripts/scripts/level_up_gift.lua [Lua] Xikini, Level up reward based on vocations - Pastebin.com
Code:
-- https://otland.net/threads/234306/page-31#post-2386085

local storage = 45001 -- any free storage
local config = { -- levels MUST go in descending order (10, 20, 30 = YES) (30, 10, 20 = ERROR)
    [1] = {level = 50,
        vocations = {
            [1] = { -- sorcerer/master sorcerer
                items = {
                    [1] = {item_id = 1111, count = 1}, -- Maximum 20 Items!
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [2] = { -- druid/elder druid
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [3] = { -- paladin/royal paladin
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [4] = { -- knight/elite knight
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            }
        }
    },
    [2] = {level = 100,
        vocations = {
            [1] = { -- sorcerer/master sorcerer
                items = {
                    [1] = {item_id = 1111, count = 1}, -- And I don't mean max 20 count
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [2] = { -- druid/elder druid
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [3] = { -- paladin/royal paladin
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [4] = { -- knight/elite knight
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            }
        }
    },
    [3] = {level = 150,
        vocations = {
            [1] = { -- sorcerer/master sorcerer
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [2] = { -- druid/elder druid
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [3] = { -- paladin/royal paladin
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            },
            [4] = { -- knight/elite knight
                items = {
                    [1] = {item_id = 1111, count = 1},
                    [2] = {item_id = 1111, count = 1}
                }
            }
        }
    }
}

local function second_chance(cid, vocation, i, table_level, voc_table_list, container_object)
    if not isPlayer(cid) then
        return true
    end
    if getPlayerStorageValue(cid, storage) >= table_level then
        return true
    end
    local container = doCreateItemEx(container_object, 1)
    for n = 1, #voc_table_list do
        doAddContainerItemEx(container, doCreateItemEx(voc_table_list[n].item_id, voc_table_list[n].count))
    end
    if doPlayerAddItemEx(cid, container, FALSE) == RETURNVALUE_NOERROR then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received your level " .. table_level .. " reward!")
        setPlayerStorageValue(cid, storage, table_level)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unable to distribute level up reward due to insufficient capacity or inventory space.")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "System will attempt to distribute level " .. table_level .. " reward again upon next level up.")
    end
end

function onAdvance(cid, skill, oldlevel, newlevel)

    local current_storage_value = getPlayerStorageValue(cid, storage)
    local vocation = 0

    local voc_arr = {{1, 5}, {2, 6}, {3, 7}, {4, 8}}
    for i = 1, #voc_arr do
        if isInArray(voc_arr[i], getPlayerVocation(cid)) then
            vocation = i
            break
        end
    end
    if vocation == 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknown vocation found! Please contact administration. | ERROR CODE: 4500011")
        print("Unknown vocation >" .. getPlayerVocation(cid) .. "< found!\nCharacter: " .. getCreatureName(cid) .. "\ndata/creaturescripts/scripts/level_up_gift.lua")
        return true
    end

    if skill == SKILL__LEVEL and newlevel > oldlevel then
        for i = 1, #config do
            local table_level = config[i].level
            if newlevel >= table_level and table_level > current_storage_value then
                local voc_table_list = config[i].vocations[vocation].items
                local container_object = 1988
                if #voc_table_list < 9 then
                    container_object = 1987
                end
                local container = doCreateItemEx(container_object, 1)
                for n = 1, #voc_table_list do
                    doAddContainerItemEx(container, doCreateItemEx(voc_table_list[n].item_id, voc_table_list[n].count))
                end
                if doPlayerAddItemEx(cid, container, FALSE) == RETURNVALUE_NOERROR then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received your level " .. table_level .. " reward!")
                    setPlayerStorageValue(cid, storage, table_level)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unable to distribute level up reward! System will attempt to distribute again in one minute!")
                    local weight = 0
                    weight = weight + getItemWeightById(container_object, 1, true)
                    for n = 1, #voc_table_list do
                        weight = weight + getItemWeightById(voc_table_list[n].item_id, voc_table_list[n].count, true)
                    end
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please ensure one inventory space and " .. string.format("%.2f", weight) .. " cap is available to receive reward.")
                    addEvent(second_chance, 60000, cid, i, vocation, table_level, voc_table_list, container_object)
                    break
                end
            end
        end
    end

    return true
end
 
Last edited by a moderator:
I need a script Inquisition , where you kill a boss and create a teleport with ActionID .
Code:
*On the site where " Latrivan " and " Golgordan ".
*It is necessary to kill both for create the teleport. if you kill 1/2 boss you need 5 minutes or more(configurable) for kill the other boss
 
Unless I can figure out a way out to find who last hit the creature, there's no way to create your script.
onKill(cid, target, damage, flags)

I've looked into flags some more tonight.
It seems there are 3 flags that are used.. and one of them is classified as "isLast".
I'm hoping this means last hit of the creature but I'll need to do some testing.
I need a script Inquisition , where you kill a boss and create a teleport with ActionID .
Code:
*On the site where " Latrivan " and " Golgordan ".
*It is necessary to kill both for create the teleport. if you kill 1/2 boss you need 5 minutes or more(configurable) for kill the other boss
Untested..

data/creaturescripts/creaturescripts.xml
Code:
<event type="kill" name="kill_two_bosses_create_teleport" event="script" value="kill_two_bosses_create_teleport.lua"/>
data/creaturescripts/login.lua [somewhere near the bottom with the other register events]
Code:
registerCreatureEvent(cid, "kill_two_bosses_create_teleport")
data/creaturescripts/scripts/kill_two_bosses_create_teleport.lua
Code:
local config = {
    global_storage = 45001, -- any empty storage
    boss_one = "Latrivan",
    boss_two = "Golgordan",
    monster_timer = 5 -- Minutes (how long before second boss has to be killed to spawn teleport)
    teleport_position = {x = 1000, y = 1000, z = 7},
    teleport_to_position = {x = 1000, y = 1000, z = 7},
    teleport_timer = 5 -- minutes till remove teleport
}

local function reset_storage(number)
    if getGlobalStorageValue(config.global_storage) == number then
        setGlobalStorageValue(config.global_storage, 0)
    end
    return true
end

onKill(cid, target, damage, flags)
    if getGlobalStorageValue(config.global_storage) == 3 then
        return true
    end
    if isMonster(target) and isPlayer(cid) then
        local target_name = getCreatureName(target)
        if target_name:lower() == config.boss_one:lower() then
            if getGlobalStorageValue(config.global_storage) < 1 then
                if getTileItemById(pos, config.item).uid > 0 then
                    return true
                else
                    setGlobalStorageValue(config.global_storage, 1)
                    addEvent(reset_storage, 1000 * 60 * config.monster_timer, 1)
                end
            elseif getGlobalStorageValue(config.global_storage) == 2 then
                local teleport = doCreateTeleport(1387, config.teleport_to_position, config.teleport_position)
                addEvent(doRemoveItem, config.teleport_timer, teleport.uid)
                setGlobalStorageValue(config.global_storage, 3)
                addEvent(reset_storage, 1000 * 60 * config.teleport_timer, 3)
            end
        elseif target_name:lower() == config.boss_two:lower() then
            if getGlobalStorageValue(config.global_storage) < 1 then
                if getTileItemById(pos, config.item).uid > 0 then
                    return true
                else
                    setGlobalStorageValue(config.global_storage, 2)
                    addEvent(reset_storage, 1000 * 60 * config.monster_timer, 2)
                end
            elseif getGlobalStorageValue(config.global_storage) == 1 then
                local teleport = doCreateTeleport(1387, config.teleport_to_position, config.teleport_position)
                addEvent(doRemoveItem, config.teleport_timer, teleport.uid)
                setGlobalStorageValue(config.global_storage, 3)
                addEvent(reset_storage, 1000 * 60 * config.teleport_timer, 3)
            end
        end
    end
    return true
end
data/globalevents/globalevents.xml
Code:
<globalevent name="Reset_global_storage_kill_two_bosses_create_teleport" type="start" event="script" value="Reset_global_storage_kill_two_bosses_create_teleport.lua"/>
data/globalevents/scripts/Reset_global_storage_kill_two_bosses_create_teleport.lua
Code:
local global_storage = 45001
function onStartup()
    setGlobalStorageValue(global_storage, 0)
    return true
end
 
Last edited:
onKill(cid, target, damage, flags)

I've looked into flags some more tonight.
It seems there are 3 flags that are used.. and one of them is classified as "isLast".
I'm hoping this means last hit of the creature but I'll need to do some testing.

Untested..

data/creaturescripts/creaturescripts.xml
Code:
<event type="kill" name="kill_two_bosses_create_teleport" event="script" value="kill_two_bosses_create_teleport.lua"/>
data/creaturescripts/login.lua [somewhere near the bottom with the other register events]
Code:
registerCreatureEvent(cid, "kill_two_bosses_create_teleport")
data/creaturescripts/scripts/kill_two_bosses_create_teleport.lua
Code:
local config = {
    global_storage = 45001, -- any empty storage
    boss_one = "Latrivan",
    boss_two = "Golgordan",
    monster_timer = 5 -- Minutes (how long before second boss has to be killed to spawn teleport)
    teleport_position = {x = 1000, y = 1000, z = 7},
    teleport_to_position = {x = 1000, y = 1000, z = 7},
    teleport_timer = 5 -- minutes till remove teleport
}

local function reset_storage(number)
    if getGlobalStorageValue(config.global_storage) == number then
        setGlobalStorageValue(config.global_storage, 0)
    end
    return true
end

onKill(cid, target, damage, flags)
    if getGlobalStorageValue(config.global_storage) == 3 then
        return true
    end
    if isMonster(target) and isPlayer(cid) then
        local target_name = getCreatureName(target)
        if target_name:lower() == config.boss_one:lower() then
            if getGlobalStorageValue(config.global_storage) < 1 then
                if getTileItemById(pos, config.item).uid > 0 then
                    return true
                else
                    setGlobalStorageValue(config.global_storage, 1)
                    addEvent(reset_storage, 1000 * 60 * config.monster_timer, 1)
                end
            elseif getGlobalStorageValue(config.global_storage) == 2 then
                local teleport = doCreateTeleport(1387, config.teleport_to_position, config.teleport_position)
                addEvent(doRemoveItem, config.teleport_timer, teleport.uid)
                setGlobalStorageValue(config.global_storage, 3)
                addEvent(reset_storage, 1000 * 60 * config.teleport_timer, 3)
            end
        elseif target_name:lower() == config.boss_two:lower() then
            if getGlobalStorageValue(config.global_storage) < 1 then
                if getTileItemById(pos, config.item).uid > 0 then
                    return true
                else
                    setGlobalStorageValue(config.global_storage, 2)
                    addEvent(reset_storage, 1000 * 60 * config.monster_timer, 2)
                end
            elseif getGlobalStorageValue(config.global_storage) == 1 then
                local teleport = doCreateTeleport(1387, config.teleport_to_position, config.teleport_position)
                addEvent(doRemoveItem, config.teleport_timer, teleport.uid)
                setGlobalStorageValue(config.global_storage, 3)
                addEvent(reset_storage, 1000 * 60 * config.teleport_timer, 3)
            end
        end
    end
    return true
end
data/globalevents/globalevents.xml
Code:
<globalevent name="Reset_global_storage_kill_two_bosses_create_teleport" type="start" event="script" value="Reset_global_storage_kill_two_bosses_create_teleport.lua"/>
data/globalevents/scripts/Reset_global_storage_kill_two_bosses_create_teleport.lua
Code:
local global_storage = 45001
function onStartup()
    setGlobalStorageValue(global_storage, 0)
    return true
end

I' am so sorry, but I think you did not understand well , I said I needed to inquisition , I need to add more boss. and different position of teleports in each room boss.
In this order:
  • Ushuriel
  • Zugurosh
  • Madareth
  • Golgordan and Latrivan (In this. what I said is to apply to this because they are 2 in a room.)
  • Anihilion
  • Hellgorak
 
Last edited:
Status
Not open for further replies.
Back
Top