• 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
Premium User
Joined
Nov 17, 2010
Messages
6,800
Solutions
582
Reaction score
5,363
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,
Now return this error:
Code:
[2:29:00.491] [Error - Action Interface]
[2:29:00.491] data/actions/scripts/xikini_buff_character.lua:onUse
[2:29:00.491] Description:
[2:29:00.491] attempt to index a number value
[2:29:00.491] stack traceback:
[2:29:00.491]   [C]: in function 'doSetCreatureOutfit'
[2:29:00.491]   data/actions/scripts/xikini_buff_character.lua:83: in function <data/actions/scripts/xikini_buff_character.lua:64>

#EDIT
@Xikini,
And when i remove this line:
Code:
    doSetCreatureOutfit(cid, index.outfit, timer * 1000)
for test the remaining of the script, no returns errors, but not happens.
(No errors in console, but the system doesnt work - remove item.uid and check storage for use 2x works correctly.)
Edited script for above error. Try again?
Tell me exactly what's not working for the rest of the script?
 
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.

# No current requests pending.
Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]
Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]
Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Thread closed indefinitely. (closing statement here)
Some semi-cool scripts are posted in the second comment.
I suggest going through the thread page by page, because there is many scripts not linked, that are pretty cool and/or useful in their own right.

Cheers,

Xikini

----------

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.

Hey OtLand.

Quick introduction.
My name in a video! Because Reasons.
My name is Xikini. I live in Canada, age 23 - almost 24.
I help my friend on and off with his project Tibia Kingdoms. Kind of in a lull, as I'm mostly helping with lore at the moment, and it does get dull doing the same stuff for a couple of weeks, so I'm opening this thread to help people with some easy scripts or npc's / quests that they may need help on, or simply want someone else to do some scripts for them.

Into the main part of the thread.

I primarily script for a 0.3.7 TFS server. 0.3.6 and 0.4 are very similar, and I've never had problems creating scripts for either TFS. They all use the same functions as far as I can tell. I cannot script 1.xx, so please, don't ask for them.
I'm not an exceptional scripter, but I have learned most of the basics and starting to learn more advanced scripts.

I primarily script for movements/actions/creaturescripts/npcs.
Some recent work I've done.
Casino machine with random rewards? Done.
Making long scripts nice and short? Done and Done.
Making scripts more complicated then people require? Done.
Getting irritated and thoroughly explaining a base script? Done.
Providing alternative ways to create a script? Done.
Stopping the usage of parcels in Rookgaard? Done.
Healing tiles for players? Done.
Simple bridge levers? Done.
Poi tombstone entrance? Done.

If any of this seems interesting and you would like some scripts scripted by me, send a PM my way.
If I'm unable to script your request I will definitely tell you.
If I find an interesting script I'll post it below for others to use and benefit from. I will credit your name for the original request as well. Of course if you really want me to not post a finished script or request you've made I will not share it with the community.

The scripting service provided here is free, so don't hound me to complete scripts you've requested, and I've agreed to make. If I agree to make it, I'll try to give you a timeline on completion. And please, please, if I say I can't script something, don't beg me to create it, or attempt to bribe me to create it. If I can't script it, I can't script it. I'm only a mediocre scripter. Please take that to heart.

To sum things up, I enjoy scripting and helping others and want to contribute to the community a little.
So send me a PM, or post below, and we'll see what we can come up with.
On that note,

Cheers,

Xikini

(Quick side note: No script is too small for me to make or help with. With that in mind, I currently do not work with databases, php, source edits or websites.
Additionally, I do not make spells, raids, monsters or weapon scripts. Thanks!)

Reserved for interesting scripts.

Xikini's Easy Chest System

Simple Base NPC

Simple Add One Item

How storage values work. Part 1 ..::.. Credits for @Codex NG ::..

How storage values work. Part 2 ..::.. Credits for @Xikini ::..

Error with Samples Characters


Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703

27h bump.
Hello, sir i just posted this: [0.4] discovery place, fast travel vía npc

Its a nice idea for rpg travel
 
@Xikini, Wow, now works!!!

Its possible to send magic effect at execute healing hp/mp?

Ex: Healing hp/mp is each 2seconds, when occurs healing hp/mp, send magic effect 32.
replace with this
Lua:
local function recovery(cid, health, mana, duration)
   if not isPlayer(cid) then
       return true
   end

   local cur_health = getCreatureHealth(cid)
   local max_health = getCreatureMaxHealth(cid)
   if cur_health < max_health then
       local add_health = health
       if cur_health + health > max_health then
           add_health = max_health - cur_health
       end
       doCreatureAddHealth(cid, add_health)
   end

   local cur_mana = getCreatureMana(cid)
   local max_mana = getCreatureMaxMana(cid)
   if cur_mana < max_mana then
       local add_mana = mana
       if cur_mana + mana > max_mana then
           add_mana = max_mana - cur_mana
       end
       doCreatureAddMana(cid, add_mana)
   end
   doSendMagicEffect(fromPosition, CONST_ME_SLEEP)
   if duration >= 1 then
       addEvent(recovery, 2000, cid, health, mana, duration - 1)
   end
   return true
end
 
is that possible to make token if i used it on item it will take my name like you see demon helmet (its owned by x) and a talkaction command that if this item have my name on it i can take it back for some money
@Xikini
 
is that possible to make token if i used it on item it will take my name like you see demon helmet (its owned by x) and a talkaction command that if this item have my name on it i can take it back for some money
@Xikini
2 items
1 adds
1 removes

to add - untested
Lua:
local config = {
   item_can_change_owners = false -- true/false
   item_uid = 44444 -- if "item_can_change_owners = false" then UID attached to item
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isCreature(itemEx.uid) then
       doCreatureSay(cid, "You cannot own a creature.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   if config.item_can_change_owners == false then
       if itemEx.uid == config.item_uid then
           doCreatureSay(cid, "Item already owned.", TALKTYPE_ORANGE_1, cid)
           return true
       end
   end
   local itemType = getItemWeaponType(itemEx.uid)
   if itemType == 8 then
       doCreatureSay(cid, "You cannot own ammunition.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif isItemStackable(itemEx.itemid) == true then
       doCreatureSay(cid, "You cannot own stackables.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif itemType == 0 and getItemInfo(itemEx.itemid).armor == 0 then
       doCreatureSay(cid, "Sorry not possible.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   if config.item_can_change_owners == false then
       doItemSetAttribute(itemEx.uid, "uid", 44444)
   end
   doItemSetAttribute(itemEx.uid, "description", "Owned by " .. getCreatureName(cid) .. ".")
   doCreatureSay(cid, "You own this item now.", TALKTYPE_ORANGE_1, cid)
   return true
end
to remove.. very very untested
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isCreature(itemEx.uid) then
       doCreatureSay(cid, "You cannot own a creature.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   local itemType = getItemWeaponType(itemEx.uid)
   if itemType == 8 then
       doCreatureSay(cid, "You cannot own ammunition.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif isItemStackable(itemEx.itemid) == true then
       doCreatureSay(cid, "You cannot own stackables.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif itemType == 0 and getItemInfo(itemEx.itemid).armor == 0 then
       doCreatureSay(cid, "Sorry not possible.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   doItemSetAttribute(itemEx.uid, "uid", 0)
   doItemSetAttribute(itemEx.uid, "description", "")
   doCreatureSay(cid, "Nobody owns this item now.", TALKTYPE_ORANGE_1, cid)
   return true
end
 
2 items
1 adds
1 removes

to add - untested
Lua:
local config = {
   item_can_change_owners = false -- true/false
   item_uid = 44444 -- if "item_can_change_owners = false" then UID attached to item
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isCreature(itemEx.uid) then
       doCreatureSay(cid, "You cannot own a creature.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   if config.item_can_change_owners == false then
       if itemEx.uid == config.item_uid then
           doCreatureSay(cid, "Item already owned.", TALKTYPE_ORANGE_1, cid)
           return true
       end
   end
   local itemType = getItemWeaponType(itemEx.uid)
   if itemType == 8 then
       doCreatureSay(cid, "You cannot own ammunition.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif isItemStackable(itemEx.itemid) == true then
       doCreatureSay(cid, "You cannot own stackables.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif itemType == 0 and getItemInfo(itemEx.itemid).armor == 0 then
       doCreatureSay(cid, "Sorry not possible.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   if config.item_can_change_owners == false then
       doItemSetAttribute(itemEx.uid, "uid", 44444)
   end
   doItemSetAttribute(itemEx.uid, "description", "Owned by " .. getCreatureName(cid) .. ".")
   doCreatureSay(cid, "You own this item now.", TALKTYPE_ORANGE_1, cid)
   return true
end
to remove.. very very untested
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isCreature(itemEx.uid) then
       doCreatureSay(cid, "You cannot own a creature.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   local itemType = getItemWeaponType(itemEx.uid)
   if itemType == 8 then
       doCreatureSay(cid, "You cannot own ammunition.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif isItemStackable(itemEx.itemid) == true then
       doCreatureSay(cid, "You cannot own stackables.", TALKTYPE_ORANGE_1, cid)
       return true
   elseif itemType == 0 and getItemInfo(itemEx.itemid).armor == 0 then
       doCreatureSay(cid, "Sorry not possible.", TALKTYPE_ORANGE_1, cid)
       return true
   end
   doItemSetAttribute(itemEx.uid, "uid", 0)
   doItemSetAttribute(itemEx.uid, "description", "")
   doCreatureSay(cid, "Nobody owns this item now.", TALKTYPE_ORANGE_1, cid)
   return true
end
where is the talkaction script that if it has the owner name he can bring it back for some money :D
 
where is the talkaction script that if it has the owner name he can bring it back for some money :D
like find and teleport the item back to yourself?
dunno, that sounds impossible.
 
isn’t that possible if you give an item a storage when a player adds his name to it? That would require a new table in database I guess?
 
isn’t that possible if you give an item a storage when a player adds his name to it? That would require a new table in database I guess?
zzz talkaction command would take too long and wouldn't be intuitive.
Just use the second script I posted originally and find a second item to use.
 
Hail @Xikini i have a script, to 1 vocation pass the door, but i need 2, 3 , 4 or more vocations passing the door, how can i add? see my script please:

Code:
function onUse(cid, item, frompos, item2, topos)

local VOCNAME = Knight -- NOME DA VOC
local Vocid = 4

if item.uid == 7070 then
status1 = getPlayerVocation(cid)
if status1 == Vocid then

pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendCancel(cid,'Esteja em frente a porta.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode passar, pois nao pertence a linhagem dos Knights.")
end
return 1
else
return 0
end
end
 
Hail @Xikini i have a script, to 1 vocation pass the door, but i need 2, 3 , 4 or more vocations passing the door, how can i add? see my script please:

Code:
function onUse(cid, item, frompos, item2, topos)

local VOCNAME = Knight -- NOME DA VOC
local Vocid = 4

if item.uid == 7070 then
status1 = getPlayerVocation(cid)
if status1 == Vocid then

pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendCancel(cid,'Esteja em frente a porta.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode passar, pois nao pertence a linhagem dos Knights.")
end
return 1
else
return 0
end
end
Lua:
local vocationIds = {1,2,3,4}

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 7070 then
        if isInArray(vocationIds, getPlayerVocation(cid)) then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
                end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
                end
            else
                doPlayerSendCancel(cid,'Esteja em frente a porta.')
                return 1
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode passar, pois nao pertence a linhagem dos .")
        end
        return 1
    end
    return 0
end
 
Hello, I would like to request a script that works like this:

4 levers(1945) with action id = 3006
4 walls(1037)

Like this:
ye81Gla.png


Each lever removes one of those walls with a given position
Like this:
7VIrMu9.png

If the lever gets switched it removes a wall, and the other 3 levers are no longer working.
 
Hello, I would like to request a script that works like this:

4 levers(1945) with action id = 3006
4 walls(1037)

Like this:


Each lever removes one of those walls with a given position
Like this:

If the lever gets switched it removes a wall, and the other 3 levers are no longer working.

I like these simple ones. xP

sK2gsyD.png


XML:
<action actionid="3006" event="script" value="multi_lever_walls.lua"/>
Lua:
local config = { -- [#] = {UID, wall_id, {position}}
   [1] = {45001, 1037, {x = 183, y = 93, z = 7}},
   [2] = {45002, 1037, {x = 185, y = 93, z = 7}},
   [3] = {45003, 1037, {x = 187, y = 93, z = 7}},
   [4] = {45004, 1037, {x = 189, y = 93, z = 7}}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local temp = 0
   for i = 1, #config do
       if config[i][1] == item.uid then
           temp = i
           break
       end
   end       
   if config[temp] then
       if item.itemid == 1946 then
           doCreateItem(config[temp][2], 1, config[temp][3])
           doTransformItem(item.uid, item.itemid - 1)
           return true
       end
       for i = 1, #config do
           if getTileItemById(config[i][3], config[i][2]).uid == 0 then
               return true
           end
       end
       if getTileItemById(config[temp][3], config[temp][2]).uid > 0 then
           doTransformItem(getTileItemById(config[temp][3], config[temp][2]).uid, 0)
           doTransformItem(item.uid, item.itemid + 1)
       end
   end
   return true
end
 
I like these simple ones. xP

sK2gsyD.png


XML:
<action actionid="3006" event="script" value="multi_lever_walls.lua"/>
Lua:
local config = { -- [#] = {UID, wall_id, {position}}
   [1] = {45001, 1037, {x = 183, y = 93, z = 7}},
   [2] = {45002, 1037, {x = 185, y = 93, z = 7}},
   [3] = {45003, 1037, {x = 187, y = 93, z = 7}},
   [4] = {45004, 1037, {x = 189, y = 93, z = 7}}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local temp = 0
   for i = 1, #config do
       if config[i][1] == item.uid then
           temp = i
           break
       end
   end      
   if config[temp] then
       if item.itemid == 1946 then
           doCreateItem(config[temp][2], 1, config[temp][3])
           doTransformItem(item.uid, item.itemid - 1)
           return true
       end
       for i = 1, #config do
           if getTileItemById(config[i][3], config[i][2]).uid == 0 then
               return true
           end
       end
       if getTileItemById(config[temp][3], config[temp][2]).uid > 0 then
           doTransformItem(getTileItemById(config[temp][3], config[temp][2]).uid, 0)
           doTransformItem(item.uid, item.itemid + 1)
       end
   end
   return true
end

Thanks dude Appreciate this works perfectly
 
Lua:
local vocationIds = {1,2,3,4}

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 7070 then
        if isInArray(vocationIds, getPlayerVocation(cid)) then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
                end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
                end
            else
                doPlayerSendCancel(cid,'Esteja em frente a porta.')
                return 1
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode passar, pois nao pertence a linhagem dos .")
        end
        return 1
    end
    return 0
end

Great, working !
 
Change outfit ring ? For example when you use outfit ring - you are able to wear outfit "x" and it appear at outfitwindow so you are able to change colours. Protocol 7.72
 
Status
Not open for further replies.
Back
Top