Carlitos Flow
Developer (lvl*1)
- Joined
- Mar 2, 2011
- Messages
- 156
- Solutions
- 4
- Reaction score
- 10
Good day guys, well, im working on a script and need some help please... like this video (of course i will do for tibia):
*Im Using T.F.S 0.3.6
*When someone dead the team is kicked from the quest, and the team need wait 24hrs to try again.
*I will try use "boxes" because tibia doesn't have that "green containers.
*When the team kill all monsters (all boxes break) they finish the quest and add exp, and ofc the reward.
*If the team done the quest, they must wait 30 days for do the quest again.
*The "entrance" can be like an anihilator (4 tiles) and a lever, i have already added this on the script than im editing.
*From the boxes (green containers) when you broke the box will born a monster random [2nd script]. If im wrong you can say me please.
*When the team kill all monsters and they done the quest, this quest must reset automatically for another team than want to do. (Create the boxes again on the map). [I don't know how i can do this on the script]
*I Know, i don't have a good english and im new trying to learn lua, but this is than i did done of the script, and i really hope your help guys, thank guy.
actions/lever.lua
action/box.lua
King Regards!
*Im Using T.F.S 0.3.6
*When someone dead the team is kicked from the quest, and the team need wait 24hrs to try again.
*I will try use "boxes" because tibia doesn't have that "green containers.
*When the team kill all monsters (all boxes break) they finish the quest and add exp, and ofc the reward.
*If the team done the quest, they must wait 30 days for do the quest again.
*The "entrance" can be like an anihilator (4 tiles) and a lever, i have already added this on the script than im editing.
*From the boxes (green containers) when you broke the box will born a monster random [2nd script]. If im wrong you can say me please.
*When the team kill all monsters and they done the quest, this quest must reset automatically for another team than want to do. (Create the boxes again on the map). [I don't know how i can do this on the script]
*I Know, i don't have a good english and im new trying to learn lua, but this is than i did done of the script, and i really hope your help guys, thank guy.
actions/lever.lua
Code:
local playerA={
{x=1154, y=1582, z=7},
{x=1154, y=1581, z=7},
{x=1154, y=1580, z=7},
{x=1154, y=1579, z=7},
}
local playerB={
{x=1154, y=1582, z=8},
{x=1153, y=1582, z=8},
{x=1152, y=1582, z=8},
{x=1151, y=1582, z=8},
}
local c = {
Storage = 10540, -- Number Storage
Tiempo = 30, -- Days for next quest
Premio = { -- {ID item, how many items},
{8309, 3}, -- Nail x3
{10570, 2}, -- Which Hat x2
},
}
local globalExhaust = {
get = function (storage)
local exhaust = getGlobalStorageValue(storage)
if(exhaust > 0) then
local left = exhaust - os.time()
if(left >= 0) then
return left
end
end
return false
end,
set = function (storage, time)
setGlobalStorageValue(storage, os.time() + time)
end
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = {}
if item.itemid == 1945 then
for i = 1, 4 do
t[i]=getTopCreature(playerA[i]).uid
if t[i] == 0 or not isPlayer(t[i]) then
return doPlayerSendCancel(cid, 'You need 4 players for this quest.')
elseif getPlayerLevel(t[i]) < 100 then
return doPlayerSendCancel(cid, 'All players need to have level 100 or higher.')
end
end
---- When someone team is doing
starting={x=58, y=1112, z=7, stackpos=253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x=142, y=1288, z=7, stackpos=253}
players=0
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
local accID, nIP = getPlayerAccountId(cid), getPlayerIp(cid)
local Belero = {
[c.Storage+1] = {accID},
[c.Storage+2] = {nIP},
}
---- When start Quest
for i = 1, #t do
doTeleportThing(t[i], playerB[i])
doSendMagicEffect(playerA[i], CONST_ME_POFF)
doSendMagicEffect(playerB[i], CONST_ME_ENERGYAREA)
end
elseif players > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Please wait for the team currently fighting to finish.')
return false
end
elseif accID == getGlobalStorageValue(c.Storage+1) or nIP == getGlobalStorageValue(c.Storage+2) then
doPlayerSendCancel(cid, (globalExhaust.get(c.Storage) > 0 and "You must wait " .. timeString(globalExhaust.get(c.Storage)) .. " days to do this quest again." or nil))
return true
elseif
for k, v in pairs(Belero) do
setGlobalStorageValue(k, v[1])
globalExhaust.set(c.Storage, c.Tiempo * 24 * 60 * 60)
addEvent(setGlobalStorageValue, c.Tiempo * 24 * 60 * 60 * 1000, k, -1)
end
for _, v in ipairs(c.Premio) do
doPlayerAddItem(cid, v[1], v[2])
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already done your quest this month.!")
return true
end
action/box.lua
Code:
local summon={
{'Dragon'},
{'Demon'},
{'Dragon Lord'},
{'Fury'}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == xxxx then --- item from the box
for i = 1, 4 #summon do
doCreateMonster[math.random(unpack(summon[i]))]
doRemoveItem(xxxx.uid, 1) --- remove the box
end
end
end
Last edited: