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

[TFS 1.x] Free Scripting and Support

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,015
Solutions
3
Reaction score
629
Location
Canada
Until further notice, I will not be taking any further requests, and any incomplete requests will be put on hold. Due to serious medical concerns with some of my pets, I will not be actively using the forums or doing any scripting. Sorry for the inconvenience.





Well hello everyone. This seems to be a popular trend lately, and I basically already do it anyways. So why not, right?

I'm here to offer my scripting services and/or support, free of charge. I will make basic-medium scripts/systems for free. I may do large and more advanced systems as well, depending on how busy I am.

I support only LUA at this time. My PHP and C++ are both a little rusty.

I also offer support and bugfixing for existing scripts. I accept requests here or via PM and nothing will be released unless you agree to it.

I only support TFS 1.x and 1.1 or higher is preferred.

I'm not looking to reinvent the wheel. If the system you're requesting is already in existence and easily accessible, I won't make it. I can maybe make modifications to it, but that all depends on what you need.

Want to see some of my work? Check my signature.

First come, first served. I will not accept payment for priority service.

Want to thank me? Toss me a like on the post that helped you, and feel free to recommend me to your friends if you found my service to be fast and accurate to your request.

Have at it! :D
 
Last edited:
Thank you :) I'm waiting for you!
sorry for the delay. been a hell of a week.
Globalevents/scripts/startup.lua, add
Code:
db.query("CREATE TABLE IF NOT EXISTS `autoloot` (`id` int(11) unsigned NOT NULL default '1',`list` varchar(3000) NOT NULL default '0',PRIMARY KEY  (`id`))")

Talkaction
Code:
local stor, limit = 7575, 5 --storage, limit to add.

local allow_container = false --empty! not looted with items, atleast for now.

function getAutoLootList(player)
if not Player(player) then
return false
end
local id = player:getGuid()
local list = -1
local resultId = db.storeQuery("SELECT * FROM `autoloot` WHERE `id` = " .. id)
if resultId ~= false then
list = result.getDataString(resultId, "list")
result.free(resultId)
end
return list
end

function setAutoLootList(player, value)
db.query("REPLACE INTO `autoloot` SET `id` = " .. player:getGuid() .. ", `list` = " .. value)
end

function onSay(player, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]

if (action:lower() == 'check') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):explode(',')
end

local txt = 'Autoloot List:\n'
if (#list > 0) then
for k, id in ipairs(list) do
id = id:gsub('_', '')
if tonumber(id) then
txt = txt .. ItemType(tonumber(id)):getName() .. ((k < #list) and '\n' or '')
end
end
else
txt = 'Empty'
end
player:popupFYI(txt)

elseif (action:lower() == 'add') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end

if (#list >= limit) then
return player:sendCancelMessage('You already have ' .. limit .. ' autolooting items.')
end

local item = tonumber(rst)
if not item then
item = ItemType(rst):getId()
if not item then
return player:sendCancelMessage('not valid item.')
end
end

if not allow_container and item:isContainer() then
return player:sendCancelMessage('this item can not be autolooted.')
end

if not ItemType(item):isMovable or not ItemType(item):isPickupable() then
return player:sendCancelMessage('this item can not be autolooted.')
end

if isInArray(list, item) then
return player:sendCancelMessage('This item is already added in your list.')
end
table.insert(list, tostring(item))

local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
setAutoLootList(player, tostring(new))
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. ItemType(item):getName() .. '<< has been added to the autoloot list.')
elseif (action:lower() == 'remove') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end

if (#list == 0) then
return player:sendCancelMessage('You dont have any item added.')
end

local item = tonumber(rst)
if not item then
  item = ItemType(rst):getId()
  if not item then
return player:sendCancelMessage('not valid item.')
  end
end

if not isInArray(list, item) then
return player:sendCancelMessage('This item is not in the list.')
end

local new = ''
for v, id in ipairs(list) do
if (tonumber(id) ~= item) then
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
end
setAutoLootList(player, tostring(new))
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.')

elseif (action:lower() == 'clean') then
setAutoLootList(player, -1)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Autoloot list cleaned.')
end
return true
end

Creaturescripts
Code:
--Creaturescripts
local stor = 7575

function getAutoLootList(player)
if not Player(player) then
return false
end
local id = player:getGuid()
local list = -1
local resultId = db.storeQuery("SELECT * FROM `autoloot` WHERE `id` = " .. id)
if resultId ~= false then
list = result.getDataString(resultId, "list")
result.free(resultId)
end
return list
end

function autoloot(cid, target, pos)
local player = Player(cid)
if not player then
return
end

local function doStack(player, itemid, new)
local count = player:getItemCount(itemid)
if ((count % 100) == 0) then
return player:addItemEx(doCreateItemEx(itemid, new), true)
elseif (count > 100) then
count = count - (math.floor(count / 100) * 100)
end

local newCount = count + new
if (count ~= 0) then
local find = player:getItemById(itemid, true, count)
if (find > 0) then
find:remove()
else
newCount = new
end
end

if (newCount > 100) then
for i = 1, math.floor(newCount / 100) do
player:addItemEx(doCreateItemEx(itemid, 100), true)
end
newCount = (newCount % 100)
end
player:addItemEx(doCreateItemEx(itemid, newCount), true)
end

local function scanContainer(player, cont, list)
for k = (cont:getSize() - 1), 0, -1 do
local tmp = cont:getItem(k)
if (isInArray(list, tmp:getId())) then
if ItemType(tmp:getId()):isStackable() and (player:getItemCount(tmp:getId()) > 0) then
doStack(player, tmp:getId(), tmp:getType())
else
local item = doCreateItemEx(tmp:getId(), tmp:getType())
player:addItemEx(item, true)
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp:getType() .. ' ' .. ItemType(tmp:getId()):getName() .. '.')
tmp:remove()
elseif tmp:isContainer() then
scanContainer(player, tmp, list)
end
end
end

local items = {}
for i = Tile(pos):getItemCount(), 1, -1 do
pos.stackpos = i
items = getThingFromPos(pos)
end

if (#items == 0) then
return
end

local corpse = -1
for _, item in pairs(items) do
if not item:isCreature() then
local name = item:getName():lower()
if name:find(target:lower()) then
corpse = item
break
end
end
end

if (corpse ~= -1) and corpse:isContainer() and (corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == player) then
scanContainer(player, corpse, tostring(getAutoLootList(player)):gsub('_', ''):explode(','))
end
end

function onKill(cid, target)
local player = Player(cid)
if not player then
return true
end
if not Player(target) then
local infos = getAutoLootList(player)
if (infos == -1) then
return true
end

local list = tostring(infos):explode(',')
if (#list == 0) then
return true
end
addEvent(autoloot, 150, cid, target:getName(), target:getPosition())
end
return true
end

I think that's all you should need.
Let me know how it goes.
 
Until further notice, I will not be taking any further requests, and any incomplete requests will be put on hold. Due to serious medical concerns with some of my pets, I will not be actively using the forums or doing any scripting. Sorry for the inconvenience.
 
sorry for the delay. been a hell of a week.
Globalevents/scripts/startup.lua, add
Code:
db.query("CREATE TABLE IF NOT EXISTS `autoloot` (`id` int(11) unsigned NOT NULL default '1',`list` varchar(3000) NOT NULL default '0',PRIMARY KEY  (`id`))")

Talkaction
Code:
local stor, limit = 7575, 5 --storage, limit to add.

local allow_container = false --empty! not looted with items, atleast for now.

function getAutoLootList(player)
if not Player(player) then
return false
end
local id = player:getGuid()
local list = -1
local resultId = db.storeQuery("SELECT * FROM `autoloot` WHERE `id` = " .. id)
if resultId ~= false then
list = result.getDataString(resultId, "list")
result.free(resultId)
end
return list
end

function setAutoLootList(player, value)
db.query("REPLACE INTO `autoloot` SET `id` = " .. player:getGuid() .. ", `list` = " .. value)
end

function onSay(player, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]

if (action:lower() == 'check') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):explode(',')
end

local txt = 'Autoloot List:\n'
if (#list > 0) then
for k, id in ipairs(list) do
id = id:gsub('_', '')
if tonumber(id) then
txt = txt .. ItemType(tonumber(id)):getName() .. ((k < #list) and '\n' or '')
end
end
else
txt = 'Empty'
end
player:popupFYI(txt)

elseif (action:lower() == 'add') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end

if (#list >= limit) then
return player:sendCancelMessage('You already have ' .. limit .. ' autolooting items.')
end

local item = tonumber(rst)
if not item then
item = ItemType(rst):getId()
if not item then
return player:sendCancelMessage('not valid item.')
end
end

if not allow_container and item:isContainer() then
return player:sendCancelMessage('this item can not be autolooted.')
end

if not ItemType(item):isMovable or not ItemType(item):isPickupable() then
return player:sendCancelMessage('this item can not be autolooted.')
end

if isInArray(list, item) then
return player:sendCancelMessage('This item is already added in your list.')
end
table.insert(list, tostring(item))

local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
setAutoLootList(player, tostring(new))
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. ItemType(item):getName() .. '<< has been added to the autoloot list.')
elseif (action:lower() == 'remove') then
local infos, list = getAutoLootList(player), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end

if (#list == 0) then
return player:sendCancelMessage('You dont have any item added.')
end

local item = tonumber(rst)
if not item then
  item = ItemType(rst):getId()
  if not item then
return player:sendCancelMessage('not valid item.')
  end
end

if not isInArray(list, item) then
return player:sendCancelMessage('This item is not in the list.')
end

local new = ''
for v, id in ipairs(list) do
if (tonumber(id) ~= item) then
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
end
setAutoLootList(player, tostring(new))
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.')

elseif (action:lower() == 'clean') then
setAutoLootList(player, -1)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Autoloot list cleaned.')
end
return true
end

Creaturescripts
Code:
--Creaturescripts
local stor = 7575

function getAutoLootList(player)
if not Player(player) then
return false
end
local id = player:getGuid()
local list = -1
local resultId = db.storeQuery("SELECT * FROM `autoloot` WHERE `id` = " .. id)
if resultId ~= false then
list = result.getDataString(resultId, "list")
result.free(resultId)
end
return list
end

function autoloot(cid, target, pos)
local player = Player(cid)
if not player then
return
end

local function doStack(player, itemid, new)
local count = player:getItemCount(itemid)
if ((count % 100) == 0) then
return player:addItemEx(doCreateItemEx(itemid, new), true)
elseif (count > 100) then
count = count - (math.floor(count / 100) * 100)
end

local newCount = count + new
if (count ~= 0) then
local find = player:getItemById(itemid, true, count)
if (find > 0) then
find:remove()
else
newCount = new
end
end

if (newCount > 100) then
for i = 1, math.floor(newCount / 100) do
player:addItemEx(doCreateItemEx(itemid, 100), true)
end
newCount = (newCount % 100)
end
player:addItemEx(doCreateItemEx(itemid, newCount), true)
end

local function scanContainer(player, cont, list)
for k = (cont:getSize() - 1), 0, -1 do
local tmp = cont:getItem(k)
if (isInArray(list, tmp:getId())) then
if ItemType(tmp:getId()):isStackable() and (player:getItemCount(tmp:getId()) > 0) then
doStack(player, tmp:getId(), tmp:getType())
else
local item = doCreateItemEx(tmp:getId(), tmp:getType())
player:addItemEx(item, true)
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp:getType() .. ' ' .. ItemType(tmp:getId()):getName() .. '.')
tmp:remove()
elseif tmp:isContainer() then
scanContainer(player, tmp, list)
end
end
end

local items = {}
for i = Tile(pos):getItemCount(), 1, -1 do
pos.stackpos = i
items = getThingFromPos(pos)
end

if (#items == 0) then
return
end

local corpse = -1
for _, item in pairs(items) do
if not item:isCreature() then
local name = item:getName():lower()
if name:find(target:lower()) then
corpse = item
break
end
end
end

if (corpse ~= -1) and corpse:isContainer() and (corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == player) then
scanContainer(player, corpse, tostring(getAutoLootList(player)):gsub('_', ''):explode(','))
end
end

function onKill(cid, target)
local player = Player(cid)
if not player then
return true
end
if not Player(target) then
local infos = getAutoLootList(player)
if (infos == -1) then
return true
end

local list = tostring(infos):explode(',')
if (#list == 0) then
return true
end
addEvent(autoloot, 150, cid, target:getName(), target:getPosition())
end
return true
end

I think that's all you should need.
Let me know how it goes.

Man, I got some bugs,
The loots not has added to list and the command check not working.

I will post a screen of errors.
 
Hey friend can you do something for me? (TFS 1.2)
A login.lua script that add quest/mission storage to players just to skip boring missions, something like
player:addStorageValue(storageId, storageNumber)

in service of yalahar - http://pastebin.com/chzaP6z1
inquisition - http://pastebin.com/PUEM0M07
wrath of the emperor - http://pastebin.com/9wBBK8Dp
shattered isles - http://pastebin.com/QcfeXavC

the codes is just to see the last missions storage ids, anything you can do for me will be a great help
 
hello i need
manarune tfs 1.0
min max
more mana for level and magic level
effect animation
effect text min max mana player got

here script old version 7.6
Code:
function getPlayerManaMax(cid)
manaNow = getPlayerMana(cid)
doPlayerAddMana(cid,1000000)
manaMax = getPlayerMana(cid)
doPlayerAddMana(cid,manaNow-manaMax)
return manaMax
end
function onUse(cid, item, frompos, item2, topos)
   local config = {
   ended = true,
   effect_enable = true,
   effect = 13,
   text_enable = true,
   text_colour = 191,
   exh =
   {
      exh_enable = true,
      exh_time = 1.4,
      storage = 12345, -- liczba przechowujaca exhausted
   }
}
local voctab =
{
{minn=5, maxx=750, lvmul=2, mlmul=35},
{minn=150, maxx=550, lvmul=12, mlmul=1},
{minn=50, maxx=550, lvmul=5, mlmul=45},
{minn=150, maxx=1550, lvmul=3, mlmul=15}
}
topos.stackpos = 253
player = getThingfromPos(topos)
playerpos = getPlayerPosition(player.uid)
cidpos = getPlayerPosition(cid)
used = false
canUse = true
maglv = getPlayerMagLevel(cid)
voc = getPlayerVocation(cid)
lv=getPlayerLevel(cid)
vocc=voctab[voc]
addminn=vocc.minn +(vocc.lvmul*lv)+(vocc.mlmul*maglv)
addmaxx=vocc.maxx +(vocc.lvmul*lv)+(vocc.mlmul*maglv)
add=math.random(addminn,addmaxx)
if player.uid > 0 then
if getPlayerMana(player.uid) == getPlayerManaMax(player.uid) then
doPlayerSendCancel(cid, "Mana "..getPlayerName(player.uid).." is full!")
return 1
end
else
if getPlayerMana(cid) == getPlayerManaMax(cid) then
doPlayerSendCancel(cid, "Your mana is full.")
return 1
end
end
if(os.time() < getPlayerStorageValue(cid, config.exh.storage)) then
   doPlayerSendCancel(cid,"You are exhausted.")
   canUse = false
end
if (canUse) then
if player.itemid > 0 then
  if (config.effect_enable) then
    doSendMagicEffect(playerpos, config.effect)
    end
if (config.text_enable) then
   doSendAnimatedText(playerpos, add, config.text_colour)
   end
   doPlayerAddMana(player.uid,add)
   used = true
    else
      if config.effect_enable then
         doSendMagicEffect(cidpos, config.effect)
      end
      if (config.text_enable) then
         doSendAnimatedText(cidpos, add, config.text_colour)
      end
      doPlayerAddMana(cid,add)
      used = true
   end
end
if (used) and (canUse) then
   if (config.exh.exh_enable) then
      setPlayerStorageValue(cid, config.exh.storage, os.time() + config.exh.exh_time)
   end
   if (config.ended) then
      if item.type > 1 then
         doChangeTypeItem(item.uid,item.type-1)
      else
         doRemoveItem(item.uid,1)
      end
   end
end
return 1
end
 
I would like a script that makes a rune shoot 2 projectiles with 1 use! :eek: So basicly a SD with double dmg, but split in to 2 projectiles! :D

Thanks in advance :D
 
Until further notice, I will not be taking any further requests, and any incomplete requests will be put on hold. Due to serious medical concerns with some of my pets, I will not be actively using the forums or doing any scripting. Sorry for the inconvenience.
I would like a script that makes a rune shoot 2 projectiles with 1 use! :eek: So basicly a SD with double dmg, but split in to 2 projectiles! :D

Thanks in advance :D
Make a dice npc ? tfs 1.2 no have
 
Hey man, i have a problem with a tfs 0.4 script to change to tfs 1.2, is a movement type..
Code:
function onStepIn(cid, item, position, fromPosition)


local castle_one_name = "Castle24H"   -- Nome do castelo 1
local storages = {154154,54321,123123}    -- Storages ( se vc eh iniciante, deixe como est&#225;...)




local sto_ativ = getGlobalStorageValue(storages[2])
position = getCreaturePosition(cid)
 
 if isPlayerGuild(cid) == TRUE then
 if sto_ativ == 1 or sto_ativ == -1 then

guildname = getPlayerGuildName(cid) 
guild = getPlayerGuildId(cid) 
guild_sto = getGlobalStorageValue(storages[3])

if guild ~= guild_sto then 

  doBroadcastMessage("O(a) Jogador "..getCreatureName(cid)..". Esta Tentando Invadir O "..castle_one_name.." Da Guild \""..guildname..". Aviso Donos Atuais", 22) 

else
 doPlayerSendCancel(cid,"Avance")
end
 else
 doPlayerSendCancel(cid,"Avance")
 end 
   else
   doPlayerSendCancel(cid,"Avance")
   end
   return true
end

function isPlayerGuild(cid)
if getPlayerGuildName(cid) ~= "" then
return TRUE
else
return FALSE
end
end
 
Back
Top