verdehile95
Member
- Joined
- Jan 31, 2024
- Messages
- 47
- Reaction score
- 5
Hello i looking for task npc i Have visum ots 8.7 thanks for help
don't workI believe it should work on your TFS 8.7. Why don't you use TFS 1.5 8.6 Nekiro? It's much better than TFS 8.7. Was it because you wanted the mount system, right?
NPC - Grizzly Adams (Killing in the name of... Quest) All tasks, more real-tibia
This is the new script for Killing in the name of... Quest that i made. It includes mort features to real-tibia. Features: You can start only the tasks acording to your level and/or storage You can repeat tasks (Times can be changed) You can start 3 task at same time (Count can be changed)...otland.net
post your login.luaa
Post automatically merged:
don't work
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/login.luanLogin
luaRegisterCreatureEvent(). Creature not found
stack traceback:
[C]: in function 'registerCreatureEvent'
data/creaturescripts/scripts/login.lua:107: in function <data/creaturescripts/scripts/login.lua:41>
-- ### CONFIG ###post your login.lua
players
SET onlinetime7
=players.onlinetime6, onlinetime6
=players.onlinetime5, onlinetime5
=players.onlinetime4, onlinetime4
=players.onlinetime3, onlinetime3
=players.onlinetime2, onlinetime2
=players.onlinetime1, onlinetime1
=players.onlinetimetoday, onlinetimetoday
=0;"))players
SET exphist7
=players.exphist6, exphist6
=players.exphist5, exphist5
=players.exphist4, exphist4
=players.exphist3, exphist3
=players.exphist2, exphist2
=players.exphist1, exphist1
=players.experience-players.exphist_lastexp, exphist_lastexp
=players.experience;"))players
SET onlinetimetoday
=players.onlinetimetoday+60, onlinetimeall
=players.onlinetimeall+60 WHERE online
= 1;"))type
= 'login';"))z_ots_comunication
WHERE id
= " .. id .. ";"))z_shop_history_item
SET trans_state
='realized', trans_real
=" .. os.time() .. " WHERE id = " .. id .. ";"))What is visum ots 8.7? You should write your TFS/OTX/Canary version next time, that will make it easier to help you and provide as much information as possible.Hello i looking for task npc i Have visum ots 8.7 thanks for help
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
SQL_COMUNICATION_INTERVAL = SQL_interval * 1000
function onLogin(cid)
if(InitShopComunication == 0) then
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
InitShopComunication = eventServ
end
if(InitHistory == 0) then
local historyPage = addEvent(historyPage, 60000, {})
InitHistory = historyPage
end
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "BountyHunter")
registerCreatureEvent(cid, "Castle")
registerCreatureEvent(cid, "mageBomb")
registerCreatureEvent(cid, "KillingInTheNameOf") -- Dodane wydarzenie
return TRUE
end
function historyPage(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
local historyPage = addEvent(historyPage, 60000, {})
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
assert(con:execute("UPDATEplayers
SETonlinetime7
=players.onlinetime6,onlinetime6
=players.onlinetime5,onlinetime5
=players.onlinetime4,onlinetime4
=players.onlinetime3,onlinetime3
=players.onlinetime2,onlinetime2
=players.onlinetime1,onlinetime1
=players.onlinetimetoday,onlinetimetoday
=0;"))
assert(con:execute("UPDATEplayers
SETexphist7
=players.exphist6,exphist6
=players.exphist5,exphist5
=players.exphist4,exphist4
=players.exphist3,exphist3
=players.exphist2,exphist2
=players.exphist1,exphist1
=players.experience-players.exphist_lastexp,exphist_lastexp
=players.experience;"))
end
assert(con:execute("UPDATEplayers
SETonlinetimetoday
=players.onlinetimetoday+60,onlinetimeall
=players.onlinetimeall+60 WHEREonline
= 1;"))
con:close()
env:close()
end
function sql_communication(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
result_plr = assert(con:execute("SELECT * FROM z_ots_comunication WHEREtype
= 'login';"))
todo = result_plr:fetch({}, "a")
while todo do
id = tonumber(todo.id)
action = tostring(todo.action)
delete = tonumber(todo.delete_it)
cid = getPlayerByName(tostring(todo.name))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(todo.param1)
local itemtogive_count = tonumber(todo.param2)
local container_id = tonumber(todo.param3)
local container_count = tonumber(todo.param4)
local add_item_type = tostring(todo.param5)
local add_item_name = tostring(todo.param6)
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeight(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeight(itemtogive_id, 1)
else
items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeight(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeight(itemtogive_id, 1)
else
full_weight = getItemWeight(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'Otrzymales: >> '.. add_item_name ..' << ze sklepiku OTS!')
delete = assert(con:execute("DELETE FROMz_ots_comunication
WHEREid
= " .. id .. ";"))
assert(con:execute("UPDATEz_shop_history_item
SETtrans_state
='realized',trans_real
=" .. os.time() .. " WHERE id = " .. id .. ";"))
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << ze sklepiku OTS czeka na Ciebie! Zrob miejsce w plecaku i poczekaj '.. SQL_interval ..' sekund na niego.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << ze sklepiku OTS czeka na Ciebie! Wazy '.. full_weight ..' oz., masz tylko '.. free_cap ..' oz. wolnego cap. Zwolnic miejsce i poczekaj '.. SQL_interval ..' sekund na niego.')
end
end
todo = result_plr:fetch (todo, "a")
end
con:close()
env:close()
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
registerCreatureEvent(cid, "KilledMonstersCounter")
end
propably tfs 0.4What is visum ots 8.7? You should write your TFS/OTX/Canary version next time, that will make it easier to help you and provide as much information as possible.
How to display CODE properly in your post
This thread is to inform users about how they should tag their codes in their threads. [code=html] HTML CODE HERE [/code] Hello! Hello World! This is coded in HTML! [code=XML] XML CODE HERE [/code] [code=php]...otland.net
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
SQL_COMUNICATION_INTERVAL = SQL_interval * 1000
function onLogin(cid)
if(InitShopComunication == 0) then
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
InitShopComunication = eventServ
end
if(InitHistory == 0) then
local historyPage = addEvent(historyPage, 60000, {})
InitHistory = historyPage
end
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "BountyHunter")
registerCreatureEvent(cid, "Castle")
registerCreatureEvent(cid, "mageBomb")
registerCreatureEvent(cid, "KillingInTheNameOf") -- Dodane wydarzenie
return TRUE
end
function historyPage(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
local historyPage = addEvent(historyPage, 60000, {})
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
assert(con:execute("UPDATE `players` SET `onlinetime7`=players.onlinetime6, `onlinetime6`=players.onlinetime5, `onlinetime5`=players.onlinetime4, `onlinetime4`=players.onlinetime3, `onlinetime3`=players.onlinetime2, `onlinetime2`=players.onlinetime1, `onlinetime1`=players.onlinetimetoday, `onlinetimetoday`=0;"))
assert(con:execute("UPDATE `players` SET `exphist7`=players.exphist6, `exphist6`=players.exphist5, `exphist5`=players.exphist4, `exphist4`=players.exphist3, `exphist3`=players.exphist2, `exphist2`=players.exphist1, `exphist1`=players.experience-players.exphist_lastexp, `exphist_lastexp`=players.experience;"))
end
assert(con:execute("UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1;"))
con:close()
env:close()
end
function sql_communication(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
result_plr = assert(con:execute("SELECT * FROM z_ots_comunication WHERE `type` = 'login';"))
todo = result_plr:fetch({}, "a")
while todo do
id = tonumber(todo.id)
action = tostring(todo.action)
delete = tonumber(todo.delete_it)
cid = getPlayerByName(tostring(todo.name))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(todo.param1)
local itemtogive_count = tonumber(todo.param2)
local container_id = tonumber(todo.param3)
local container_count = tonumber(todo.param4)
local add_item_type = tostring(todo.param5)
local add_item_name = tostring(todo.param6)
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeight(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeight(itemtogive_id, 1)
else
items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeight(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeight(itemtogive_id, 1)
else
full_weight = getItemWeight(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'Otrzymales: >> '.. add_item_name ..' << ze sklepiku OTS!')
delete = assert(con:execute("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";"))
assert(con:execute("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";"))
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << ze sklepiku OTS czeka na Ciebie! Zrob miejsce w plecaku i poczekaj '.. SQL_interval ..' sekund na niego.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << ze sklepiku OTS czeka na Ciebie! Wazy '.. full_weight ..' oz., masz tylko '.. free_cap ..' oz. wolnego cap. Zwolnic miejsce i poczekaj '.. SQL_interval ..' sekund na niego.')
end
end
todo = result_plr:fetch (todo, "a")
end
con:close()
env:close()
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
registerCreatureEvent(cid, "KilledMonstersCounter")
end
registerCreatureEvent(cid, "KilledMonstersCounter")
registerCreatureEvent(cid, "KillingInTheNameOf") -- Dodane wydarzenie
ok i do this and...yeah thats definetly 0.x
move this
Lua:registerCreatureEvent(cid, "KilledMonstersCounter")
to line after this
Lua:registerCreatureEvent(cid, "KillingInTheNameOf") -- Dodane wydarzenie
You have pasted register creature in function where is no parameter cid, this line supposed to be in onLogin function
ok my fault i do this andfirst error: remove 108 line probably contains registerCreatureEvent(cid, "KilledMonstersCounter")
i said "move" not copy
second, probably lib missing that author of this system provided but you did something wrong or not even included this file into your data/libs folder
Only lib folder i Have is in data/npc/lib data/action/lib etc i dont have folder lib in dat foldermake a lua file in directory data/lib name it i dont know Task System.lua and paste a lib code that author of this system provided in his post
ps. if you have problems to implement code that its literaly ready to copy paste you should start your journey from something easier to understand what you are doing and where you are doings changes and why you are doing these changes / apply the new code
Only lib folder i Have is in data/npc/lib data/action/lib etc i dont have folder lib in dat folder I send screanshot when i Wake up
What TFS is this? Where did you download it from?
Simply can't download to check this OT... Honestly, it's better if you use a more updated mechanism like TFS 1.5 Nekiro 8.6, which is much better than your server... Just abandon the inferior TFS 0.4x and migrate to TFS 1.x Nekiro, it's already solved!!!... Many scripts and systems you're looking for are always found here on Otland!I dont know what tfs is this
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Billie" script="Billie.lua" walkinterval="10000" floorchange="0" speed="100">
<health now="150" max="150"/>
<look type="136" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I need a service... Say {help} or {task} to more informations."/>
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
-- VARIABLES --
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = string.lower(msg)
local id_item = 2160 -- ITEM YOU WILL EARN WHEN COMPLETING THE TASK
local quantidade_item = 1 -- NUMBER OF ITEMS YOU WILL WIN
local exp = 500000 -- EXPERIENCE YOU WILL GAIN
local monstro = "Magmar" -- MONSTER NAME
local quantidade_monstro = 50 -- NUMBER OF MONSTERS
local storage = 32500 --NPC STORAGE
local storage_npc = 34900 -- STORAGE THAT THE NPC GIVES TO THE PLAYER TO START THE TASK
local storage_quantidade = 32510 --STORAGE THAT CONTAINS THE NUMBER OF MONSTERS DEFEATED BY THE PLAYER
local storage_task = 32600 -- TASK COMPLETION STORAGE
local storage_mensagem = 32505 -- STORAGE TO MAKE DIALOGUE MORE BEAUTIFUL
local restante = (quantidade_monstro - getPlayerStorageValue(cid, storage_quantidade)) + 1
----------------------------------- [ DIALOGUE WITH NPC] -----------------------------------
if msgcontains(msg, 'task') then
if getPlayerStorageValue(cid, storage) == 1 then
selfSay("You have already done my task.", cid)
talkState[talkUser] = 0
return true
else
if getPlayerStorageValue(cid, storage_npc) < 1 then
selfSay("I need you kill " ..quantidade_monstro.. " " ..monstro.. ". Do you accept my task?", cid)
else
selfSay("Have you already finished my task?", cid)
end
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, storage_mensagem) < 1 and getPlayerStorageValue(cid, storage_npc) < 1 then
selfSay("Ok, go to complete my task.", cid)
talkState[talkUser] = 0
setPlayerStorageValue(cid, storage_mensagem, 1)
setPlayerStorageValue(cid, storage_npc, 1)
setPlayerStorageValue(cid, storage_quantidade, 1)
return true
end
if getPlayerStorageValue(cid, storage_task) < 1 then
selfSay("You don't finish my task yet. You need to kill " ..restante.. " " ..monstro.. " yet." , cid)
talkState[talkUser] = 0
return true
else
selfSay("Congratulations! You finished my task! Receive your reward.", cid)
doSendMagicEffect(getThingPos(cid), 27)
doPlayerAddExp(cid, exp)
doPlayerAddItem(cid, id_item, quantidade_item)
setPlayerStorageValue(cid, storage, 1)
talkState[talkUser] = 0
return true
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
local monstro = "Magmar" -- MONSTER NAME
local quantidade = 50 -- MONSTER QUANTITY
local storage_npc = 34900 -- DON'T MOVE
local storage_quantidade = 32510 -- DON'T MOVE
local storage_task = 32600 -- DON'T MOVE
function onKill(cid, target, lasthit)
if getPlayerStorageValue(cid, storage_npc) > 0 then
if getPlayerStorageValue(cid, storage_task) < 1 then
if getPlayerStorageValue(cid, storage_quantidade) < quantidade then
if isPlayer(cid) and getCreatureName(target) == monstro then
local restantes = quantidade - getPlayerStorageValue(cid, storage_quantidade)
doPlayerSendTextMessage(cid, 27, "Billie: " ..restantes.. " " ..monstro.. " restantes para derrotar." )
setPlayerStorageValue(cid, storage_quantidade, getPlayerStorageValue(cid, storage_quantidade) + 1)
return true
end
elseif getPlayerStorageValue(cid, storage_quantidade) == quantidade then
doPlayerSendTextMessage(cid, 27, "Billie: You don't have more " ..monstro.. " to defeat. Come back to get your reward.")
setPlayerStorageValue(cid, storage_quantidade, -1)
setPlayerStorageValue(cid, storage_task, 1)
return true
end
else
return true
end
else
return true
end
end
registerCreatureEvent(cid, "task_billie")
<event type="kill" name="task_billie" script="task_billie.lua"/>
yes.ok can i transfer my map to tfs 1.5?