Tudo que Tricoder postou
-
Shop guild não envia o item
Nossa, agora que vi que confundi o adrianinho com o ADM WAR. Veja se resolve seu problema: http://www.tibiaking.com/forum/topic/32919-tfs-10-guildpoints-system-talkactions/
-
Faço Scripts Para Todos
Não apareceu nada, esse é o problema, nem mesmo a mensagem e muito menos algum tipo de erro na distro kkkkkk
-
error ao abrir server
Sua memória aguenta o mapa e o servidor em si?
-
Shop guild não envia o item
Tente: -- ### 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 ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then full_weight = getItemWeightById(itemtogive_id, 1) 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, 'You just got a >> '.. add_item_name ..' << from the Havoc-Online Shop Offert. Please logout so your character can save.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end
-
Como diminuir chance obsidian/wooden?
Altere os valores de local random, effect = math.random(1, 100000) Altere também o valor que está em { } no começo, exemplo: Isso significa: [monsterid] = {chance, itemyougetfromskinning} Ou seja: 2830 = id do monstro. 25000 = chances de conseguir 5878 = ID do que você vai conseguir (no caso, está o ID do minotaur leather) Não sei se aumentando ou diminuindo o 25000 é que dificulta conseguir, mas vai mudando até você ver como fica... Faça isso no script do obsidian e do wooden. Se resolver, marque como melhor resposta, por favor.
-
Shop guild não envia o item
Desculpa não entendi o que quis dizer com isso. Repetindo, aparece algum erro na sua distro?
-
Como corrigir erro 0xc00007b RME
Tente isso e avise se conseguiu ou não:
-
Shop guild não envia o item
Aparece algum erro na distro? O personagem pelo qual você está enviando o item, tem o nick grande? As vezes o shop da problema por causa disso também.
-
Pokemon te teleporta para sua house
Instalando <talkaction words="!h" event="script" value="tele.lua"/> <talkaction words="/h" event="script" value="tele.lua"/> <talkaction words="h" event="script" filter="quotation" value="tele.lua"/> tele.lua local poke = {'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mr.mime', 'Porygon'} local etele = 9499 local cdtele = 1800 function onSay(cid, words, param) if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use teleport.") return true end if not isInArray(poke, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "Sorry, this pokemon can\'t cast teleport.") return true end if exhaustion.get(cid, etele) then tempo = (exhaustion.get(cid, etele)) / 60 min = math.floor(tempo) doPlayerSendCancel(cid, "Your pokemon is tired, you have to wait more "..min.." minutes to cast teleport again.") return true end local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local lugar = { ["falador"] = { pos = {x=1032, y=1025, z=7},level = 5,price = 1000,n="Falador"}, ["sendas"] = { pos = {x=949, y=953, z=7},level = 10, price = 2000,n="Sendas"}, ["furbridge"] = { pos = {x=1100, y=1122, z=7},level = 15,price = 3000,n="Furbridge"}, ["spenzel"] = { pos = {x=1206, y=1116, z=6},level = 15,price = 3000,n="Spenzel"}, ["mesten"] ={ pos = {x=931, y=1066, z=7},level = 20,price = 4000,n="Mesten"} } if (param == '') then local str = "" str = str .. "Places to go :\n\nHouse\nFalador\nSendas\nFurbridge\nMesten\nSpenzel" doShowTextDialog(cid, 7416, str) return TRUE end if string.lower(param) == "house" then if getHouseByPlayerGUID(getPlayerGUID(cid)) then nome = getCreatureName(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 29) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))) pos2 = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z} doSendMagicEffect(getThingPos(cid), 29) doCreatureSay(cid, ""..nome..", teleport to our home!", 1) local item = getPlayerSlotItem(cid, 8) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) doCreatureSay(getCreatureSummons(cid)[1], "TELEPORT!", TALKTYPE_MONSTER) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), CONST_ME_TELEPORT) exhaustion.set(cid, etele, cdtele) doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 10, 0) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.") end return true end local a = lugar[string.lower(param)] if not(a) then doPlayerSendTextMessage(cid, 22, "This place doesn\'t exist.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only premium members can use this skill.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your pokemon can\'t concentrate during fights.") return TRUE end nome = getCreatureName(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 29) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, a.pos) pos2 = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z} doSendMagicEffect(a.pos, 29) doCreatureSay(cid, ""..nome..", teleport to "..lugar[string.lower(param)].n.."!", 1) local item = getPlayerSlotItem(cid, 8) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) doTeleportThing(getCreatureSummons(cid)[1], pos2, false) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) doCreatureSay(getCreatureSummons(cid)[1], "TELEPORT!", TALKTYPE_MONSTER) doSendMagicEffect(pos2, CONST_ME_TELEPORT) exhaustion.set(cid, etele, cdtele) doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 10, 0) return TRUE end Créditos Dash
-
Escolha Pokemon através de NPC
Instalando local focus = 0 -- NÃO EDITE ISSO local talk_start = 0 -- NÃO EDITE ISSO local target = 0 -- NÃO EDITE ISSO local following = false -- NÃO EDITE ISSO local attacking = false -- NÃO EDITE ISSO local newbie = 1010101 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local health = 1000 local maxhealth = 1000 newbies = getPlayerStorageValue(cid,newbie) msg = string.lower(msg) newperson = getPlayerStorageValue(cid,newbie) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello, I am professor Hoa. I was once a legendary pokemon trainer, now I have switched to studies in the laboratory of Professor Oak.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, wait your turn.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'help') and newbies <= 0 then selfSay('I have a charmander, squirtle anh bulbasaur. I can give you one pokemon to help you make your journey, would you like?') talk_state = 1 elseif talk_state == 1 and newbies <= 0 then if msgcontains(msg, 'yes') then selfSay('Ok, so what pokemon you like?') talk_state_s = 2 elseif talk_state_s == 2 then if msgcontains(msg, 'bulbasaur') then local description = "Contains a Bulbasaur." local poke1 = "This is Bulbasaur's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Bulbasaur") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 2222) doPlayerAddItem(cid, 2147, 6) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Bulbasaur, ") selfSay("You Choose a Bulbasaur. Here are your pokemon and 6 pokeballs.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'charmander') then local description = "Contains a Charmander." local poke1 = "This is Charmander's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Charmander") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 2222) doPlayerAddItem(cid, 2147, 6) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Charmander, ") selfSay("You Choose a Charmander. Here are your pokemon and 6 pokeballs.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'squirtle') then local description = "Contains a Squirtle." local poke1 = "This is Squirtle's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Squirtle") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 2222) doPlayerAddItem(cid, 2147, 6) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Squirtle, ") selfSay("You Choose a Squirtle. Here are your pokemon and 6 pokeballs.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 else selfSay("Tell me what pokemon you like?") end elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") talk_state = 0 elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 2 then selfSay('Good bye!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Bye...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) >= 2 then selfSay('Good bye then.') focus = 0 end end end <?xml version="1.0" encoding="UTF-8"?> <npc name="Professor Hoa" script="your lua file" walkinterval="2000" floorchange="0"> <health now="200" max="200"/> <look type="171" head="97" body="114" legs="114" feet="0" /> </npc> Créditos Shiko Erye
-
[TFS 0.x] Mudar cor do outfit aleatóriamente por comando ou ao logar (automático)
Comando !color /color Você usa o comando e a cor do seu outfit muda de forma aleatória. Instalando randomcolor.lua local config = { needPremium = true, -- Precisa de premium? needMoney = 25000, -- Precisa de premium? Se precisar, coloque o dinheiro necessário, se não precisar, coloque "false". makeExhaustion = 5, --- Quer deixar com exhaust? Coloque o tempo de exhaust em segundos, se não quiser, coloque "false". exhaustionStorage = 3232, ------ storage para salvar o exhausted. effect = CONST_ME_BLOCKHIT, -- Irá aparecer algum efeito? Se sim, coloque o número do efeito, coloque "false" se não. msg = "MUDANDO DE COR DE OUTFIT....", -- Mensagem que irá aparecer type = MESSAGE_INFO_DESCR, - O tipo de mensagem que será enviada, aqui estão tipos de mensagem: --[[MESSAGE_EVENT_ADVANCE, MESSAGE_EVENT_DEFAULT, MESSAGE_STATUS_CONSOLE_ORANGE, MESSAGE_INFO_DESCR, MESSAGE_STATUS_SMALL, MESSAGE_STATUS_CONSOLE_BLUE, MESSAGE_STATUS_CONSOLE_RED, MESSAGE_STATUS_WARNING, you can see it too in lib/constant.lua ]] -- } function onSay(cid, words, param, channel) if (exhaustion.get (cid, config.exhaustionStorage)) then return doPlayerSendCancel (cid, "Wait "..exhaustion.get (cid, config.exhaustionStorage).. " seconds to do it again.") end if (config.needPremium and isPremium (cid) == false) then return doPlayerSendCancel(cid, "You need premium to use this command.") end if (config.needMoney ~= false and tonumber(config.needMoney) and doPlayerRemoveMoney(cid, config.needMoney) == false ) then return doPlayerSendCancel (cid, "You need "..config.needMoney.. " to use this command.") end if (config.makeExhaustion ~= false and tonumber(config.makeExhaustion)) then exhaustion.set (cid, config.exhaustionStorage, config.makeExhaustion) end if (config.effect ~= false and tonumber(config.effect)) then local pos = getThingPos(cid) doSendMagicEffect(pos, config.effect) end if (config.msg ~= false) then doPlayerSendTextMessage(cid, config.type, config.msg) end local out = getCreatureOutfit(cid) doCreatureChangeOutfit (cid, {lookType = out.lookType, lookHead = math.random(132) , lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = out.lookAddons } ) return true end talkactions.xml <talkaction words="!color;/color" event="script" value="randomcolor.lua" /> Observação Caso queira que o player logue e logo mude a cor do outfit automaticamente, coloque isso em login: local out = getCreatureOutfit(cid) doCreatureChangeOutfit (cid, {lookType = out.lookType, lookHead = math.random(132) , lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = out.lookAddons } ) Créditos StreamSide, Jetro
-
[TFS 0.x] Give me money
Comando !money Você pode utilizar apenas UMA VEZ, ao utilizar, de forma aleatória você terá a chancer de ganhar crystal coin, platinum coin ou gps. Instalando give_me_money.lua azar = { [1] = {item=2148, name='gold coin'}, [2] = {item=2152, name='platinum coin'}, [3] = {item=2160, name='crystal coin'}, } queststatus = getPlayerStorageValue(cid, 7820) function onSay(cid, word, param) local random_azar = math.random(1,3) local random_count = math.random(1,100) if queststatus <= 0 then doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You recive " .. azar[random_azar].name .. " as your reward.") doPlayerAddItem(cid,azar[random_azar].item,[random_count]) setPlayerStorageValue(cid,7820,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You already have you reward.") end return true end talkactions.xml <talkaction words="!money" script="give_me_money.lua" /> Créditos garu066
-
Faço Scripts Para Todos
Testei e não funcionou... Apareceu o channel, porém, quando o player morreu, não apareceu nenhuma mensagem no channel.
-
[TFS 0.X] Banco por comando (!deposit, !balance, !withdraw)
Comando !balance !deposit !withdraw Instalando balance.lua function onSay(cid, words, param) if getTilePzInfo(getPlayerPosition(cid)) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your account balance is ".. getPlayerBalance(cid) .." gold.") else doPlayerSendCancel(cid, "You can only use this command in PZ.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end deposit.lua function onSay(cid, words, param) if getPlayerTown(cid) == 24 then --------- ID DA CIDADE doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot deposit money being in Rookgaard.") return end if isPlayer(cid) == TRUE and param ~= "" then if getTilePzInfo(getPlayerPosition(cid)) == TRUE then if doPlayerRemoveMoney(cid, param) == TRUE then doPlayerSetBalance(cid, param) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have added the amount of ".. param .." gold to your balance. You can withdraw your money anytime you want to.") else doPlayerSendCancel(cid, "You do not have enough money.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You can only use this command in PZ.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end end withdraw.lua function onSay(cid, words, param) if getPlayerTown(cid) == 24 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot withdraw money being in Rookgaard.") return end if isPlayer(cid) == TRUE and param ~= "" then if getTilePzInfo(getPlayerPosition(cid)) == TRUE then if getPlayerBalance(cid) >= param then doPlayerSetBalance(cid, getPlayerBalance(cid) - param) doPlayerAddMoney(cid, param) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Here you are, ".. param .." gold.") else doPlayerSendCancel(cid, "You do not have enough money.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You can only use this command in PZ.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end end talkactions.xml <talkaction words="!balance" script="balance.lua" /> <talkaction words="!deposit" script="deposit.lua" /> <talkaction words="!withdraw" script="withdraw.lua" /> Créditos Rurouni
-
Faço Scripts Para Todos
Um channel onde só mostraria as mortes do servidor com a cor branca. O player fulano [204] acaba de ser morto por ciclano [97]! Se tiver como, se possível também colocar pra mostrar mortes por monstro. O player fulano [204] acaba de ser morto por um Demon! ID desse channel: 12 E outra coisa que esqueci também, você sabe fazer um Loot Channel? Eu cheguei até a postar aqui. ID: 13
-
Faço Scripts Para Todos
Eita haha, pra se dispor à isso realmente tem que ter muita paciência e vontade de aprender cada vez mais. Reputado pela iniciativa! Então, gostaria de pedir algo que eu venho quebrando a cabeça direto pra conseguir mas sempre fico perdida. Death channel pra 8.60, no caso, TFS 0.x.
- Fazer a pessoa falar o que você quer
-
Apenas premium account pode usar teleport
Descrição Apenas pessoas premium account poderão usar o teleport, se não for, ela não poderá. Action da porta 39812 Instalando PremiumTeleport.lua function onStepIn(cid, fromPosition) local pos = {x=1000, y=1000, z=7} local txt = "You have been teleported." local fail = "You are not premium." if isPlayer(cid) and isPremium(cid) then doTeleportThing(cid, pos) doSendMagicEffect(pos, 12) doPlayerSendTextMessage(cid, 22, txt) else doPlayerSendTextMessage(cid, 22, fail) doTeleportThing(cid, fromPosition) end return TRUE end movements.xml <movevent type="StepIn" actionid="39812" event="script" value="PremiumTeleport.lua"/> Créditos megachock
-
Fazer a pessoa falar o que você quer
Descrição A pessoa fala o que você colocou no comando. !say Instalando makesay.lua function onSay(cid, words, param, channel) local t = string.explode(param, ",") local tmp = t[1] if(t[2]) then tmp = t[2] end if(param == '') then doPlayerSendTextMessage(cid, 20, "Esse codigo nao existe.") return true end if not playerExists(t[1]) then doPlayerSendTextMessage(cid, 20, "Esse player nao existe.") return true else doCreatureSay(getPlayerByName(t[1]), tmp, 1) end return true end talkactions.xml <talkaction words="!say" default="1" script="makesay.lua"/> Créditos Andy Man
-
Monstro por level [Quantos x monstro precisa matar para passar de level]
Screenshot Como se usa Use !exp nomedomonstro E então aparecerá: Instalando monster.lua function onSay(cid, words, param, channel) local exp = getConfigValue('rateExperience') local time = 60 -- EM SEGUNDOS if param == "" then doPlayerSendCancel(cid, "Param Needed(For Ex:!exp rotworm)") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end if not getMonsterInfo(param) then doPlayerSendCancel(cid, "Monster Name Is Incorrect") return true end if exhaustion.check(cid, 1023) then doPlayerSendCancel(cid, "You Need To Wait "..math.floor(exhaustion.get(cid,1023))..".") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end if getExperienceForLevel(getPlayerLevel(cid)+1) > getPlayerExperience(cid) then local exped = getExperienceForLevel(getPlayerLevel(cid)+1) - getPlayerExperience(cid) local monsterned = string.lower(getMonsterInfo(param).experience) * exp local expneed = math.floor(exped / monsterned)+1 doPlayerPopupFYI(cid, "You need to kill "..expneed.." "..param.." to advance to Level "..getPlayerLevel(cid)+1 .."") exhaustion.set(cid, 1023, time*1000) elseif getPlayerExperience(cid) > getExperienceForLevel(getPlayerLevel(cid)+1) then local exped2 = getPlayerExperience(cid) - getExperienceForLevel(getPlayerLevel(cid)+1) local monsterned2 = string.lower(getMonsterInfo(param).experience) * exp local expneed = math.floor(exped2 / monsterned2)+1 doPlayerPopupFYI(cid,"You need to kill "..expneed2.." "..param.." to advance to Level "..getPlayerLevel(cid)+1 .."") exhaustion.set(cid, 1023, time*1000) end return true end talkactions.xml <talkaction words="!exp" event="script" value="monster.lua"/> ATENÇÃO Se seu servidor for de exp stages, apenas mude: local exp = getConfigValue('rateExperience') para: local exp = getExperienceStage(getPlayerLevel(cid)) Créditos tetra20, Erexo
-
[TFS 0.4 e OTX] Bloqueando IPs/links no Default/Trade/Help/Private
Informação Não importa o que a pessoa digite, ela em hipótese nenhuma conseguirá falar. Exemplo: azhaurn.servegame.com azhaurn...servegame....com azhaurn!!! serve game!!! com a z h a u r n servegame c o m Se ela digitar tipo assim, mesmo assim, não conseguirá falar. Instalando blocklinks.lua local blockedLinks = {'PALAVRA 1', 'PALAVRA 2', 'PALAVRA 3', 'PALAVRA 4'} local muteStorage = 16246 local muteTime = 2 -- EM SEGUNDOS -- END OF CONFIG -- local blockedLinksData = {} local separator = '[ !\t%$%^%+%-%.%%_,<>]*' for _, linkText in pairs(blockedLinks) do local data = {} data.link = linkText data.preg = '.*' for c in string.gmatch(linkText, '.') do if(c == '.') then data.preg = data.preg .. '.*' else data.preg = data.preg .. c .. separator end end data.preg = data.preg .. '.*' table.insert(blockedLinksData, data) end function isLegalMessage(words) for _, blockedLink in pairs(blockedLinksData) do if(string.match(words, blockedLink.preg) ~= nil) then return false, blockedLink.link end end return true, '' end function onSay(cid, words, param, channel) words = words .. ' ' .. param local legalMessage, forbiddenLink = isLegalMessage( string.lower(words)) if(not legalMessage) then local muteStorageValue = getPlayerStorageValue(cid, muteStorage) if(muteStorageValue > os.time()) then doPlayerSendCancel(cid, 'You are still muted for ' .. muteStorageValue-os.time() .. ' seconds.') return true end setPlayerStorageValue(cid, muteStorage, os.time()+muteTime) if(channel == CHANNEL_DEFAULT) then doCreatureSay(cid, '...', TALKTYPE_SAY) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Link: ' .. forbiddenLink .. ' PROIBIDO.') return true end return false end talkactions.xml <talkaction words="illegalWords" default="1" script="blocklinks.lua"/> Modificando Em local blockedLinks = acrescente o link ou a palavra que você quer que a pessoa não consiga falar. Créditos Gesior.pl
-
[TFS 0.X] !played - Tempo total jogado
Comando !played Aparecerá por exemplo: Total time played: 3 days, 7 hours, 25 minutes, since 10 July 2015. Instalando played.lua function onSay(cid, words, param, channel) local v = "" local srt = "" local secs = "" secs = getPlayerOnlineTime(cid) -- converting secs -- local hours = math.ceil(secs / 3600) - 1 local minutes = math.ceil((secs - (3600 * hours)) / 60) if (minutes == 60) then minutes = 0 hours = hours + 1 end local days = math.ceil(hours / 24) - 1 hours = math.ceil(hours - (24 * days)) if (hours == 24) then hours = 0 days = days + 1 end -- end of conversion -- str = "Total time played: ".. days .." days, ".. hours .." hours, ".. minutes .." minutes, since " .. os.date("%d %b %Y", getCreateDate(cid)) .. "." doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end function getPlayerOnlineTime(cid) local query = db.getResult("SELECT `onlinetimeall` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") if query:getID() ~= -1 then return query:getDataInt("onlinetimeall") end query:free() return LUA_ERROR end function getCreateDate(cid) local query = db.getResult("SELECT `create_date` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") if query:getID() ~= -1 then return query:getDataInt("create_date") end query:free() return LUA_ERROR end talkactions.xml <talkaction words="!played" script="played.lua"/> Créditos Peonso
-
Comando !online mostrando pessoas de x level pra cima (!online x)
Comando !online level Ex. !online 200 e só aparecerá as pessoas onlines com level a partir de 200. Instalando Substitua o script padrão por: local config = { showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param) local players = getPlayersOnline() local strings = {} local i = 1 local position = 1 for _, pid in ipairs(players) do seal = true if param ~= "" then setPlayerStorageValue(cid, 30112, param) if getPlayerLevel(pid) < getPlayerStorageValue(cid, 30112) then seal = false end end if seal then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. ", " end if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]" i = i + 1 end end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return TRUE end Créditos Erexo
-
[TFS 1.0] Ranking diferente in-game
Screenshots Comando !highscores Instalando /globalevents/globalevents.xml <globalevent type="startup" name="Highscore" script="highscores.lua"/> <globalevent interval="10800000" name="Highscores" script="highscores.lua"/> /globalevents/scripts/highscores.lua local QueryList = { ['Level'] = {'`name`, `level` AS `score` FROM `players`', 'ORDER BY `experience` DESC'}, ['Magic Level'] = {'`name`, `maglevel` AS `score` FROM `players`', 'ORDER BY `maglevel` DESC, `manaspent` DESC'}, --['Storage'] = {'`players`.`name` AS `name`, `value` AS `score` FROM `player_storage` LEFT JOIN `players` ON `player_storage`.`player_id` = `players`.`id`', 'AND `key` = 1550 ORDER BY `value` DESC'} } for i, skill in ipairs({'fist','club','sword','axe','dist','shielding','fishing'}) do local index = (skill == 'dist' and 'Distance' or skill:gsub('^%l',string.upper)) .. (i < 6 and ' Fighting' or '') QueryList[index] = {'`name`, `skill_' .. skill .. '` AS `score` FROM `players`','ORDER BY `skill_' .. skill .. '` DESC, `skill_' .. skill .. '_tries` DESC'} end function updateHighscores() for skill, query in pairs(QueryList) do local t, Query = {}, db.storeQuery('SELECT ' .. query[1] .. ' WHERE `deletion` = 0 AND `group_id` < 3 ' .. query[2] .. ' LIMIT 30;') if Query ~= false then repeat table.insert(t, {result.getDataString(Query, 'name'), result.getDataInt(Query, 'score')}) until not result.next(Query) result.free(Query) setGlobalStorageValue(skill, t) end end setGlobalStorageValue('highscores', os.time()) end function onStartup() updateHighscores() end function onThink(interval) updateHighscores() return true end /creaturescripts/creaturescripts.xml <event type="modalwindow" name="Highscores" script="highscores.lua"/> /creaturescripts/scripts/highscores.lua SkillWindow = { [1337] = 'Local highscores at ' .. getConfigInfo('serverName'), [1338] = 'Level', [1339] = 'Magic Level', [1340] = 'Shielding', [1341] = 'Distance Fighting', [1342] = 'Sword Fighting', [1343] = 'Club Fighting', [1344] = 'Axe Fighting', [1345] = 'Fist Fighting', [1346] = 'Fishing', --[1347] = 'Storage' } highscores = ModalWindow(1337, SkillWindow[1337], 'Choose a category:') for i, skill in ipairs({'Level','Magic','Shielding','Distance','Sword','Club','Axe','Fist','Fishing'}) do highscores:addChoice(i, skill) end --highscores:addChoice(10, 'Storage') highscores:addButton(1, 'Show') highscores:addButton(2, 'Close') highscores:addButton(3, 'Info') highscores:setDefaultEnterButton(1) highscores:setDefaultEscapeButton(2) highscores:setPriority(true) function string.diff(diff) --by Colandus and fixed by Cykotitan local format = { {'day', diff / 60 / 60 / 24}, {'hour', diff / 60 / 60 % 24}, {'minute', diff / 60 % 60}, {'second', diff % 60} } local out = {} for k, t in ipairs(format) do local v = math.floor(t[2]) if(v > 0) then table.insert(out, (k < #format and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or '')) end end local ret = table.concat(out) if ret:len() < 16 and ret:find('second') then local a, b = ret:find(' and ') ret = ret:sub(b+1) end return ret end function string.abbr(first, final, limit) local str = first .. final if str:len() > limit then str = first:sub(1, limit-(final:len())) .. final end return str end function sendSkillWindow(cid, windowId) local highscore = ModalWindow(windowId, 'Ranking for ' .. SkillWindow[windowId], 'Scroll down for entire list') for rank, score in ipairs(getGlobalStorageValue(SkillWindow[windowId])) do highscore:addChoice(rank, string.abbr(rank .. '. ' .. score[1], '... ' .. score[2], 30)) end highscore:addButton(1, 'Back') highscore:addButton(2, 'Close') highscore:addButton(3, 'Info') highscore:setDefaultEscapeButton(2) highscore:setPriority(true) highscore:sendToPlayer(cid) end function onModalWindow(cid, modalWindowId, buttonId, choiceId) if not SkillWindow[modalWindowId] then return end if buttonId == 3 then doPlayerPopupFYI(cid, 'Local highscores were last updated ' .. string.diff(os.time()-getGlobalStorageValue('highscores')) .. ' ago.') elseif buttonId == 1 then if modalWindowId == 1337 then sendSkillWindow(cid, 1337+choiceId) else highscores:sendToPlayer(cid) end return end return unregisterCreatureEvent(cid, 'Highscores') end /talkactions/talkactions.xml <talkaction words="!highscores" script="highscores.lua" /> /talkactions/scripts/highscores.lua function onSay(cid, words, param) registerCreatureEvent(cid, 'Highscores') highscores:sendToPlayer(cid) return false end Créditos cbrm
-
[TFS 0.x] Mostrar quantidade de money - Show Money
Descrição Em 0.x há o comando !q, porém, esse script que trago à vocês, mostra diferente a quantidade de money. Em vez de aparecer assim; You have 100000000 gold. Aparecerá dessa forma: You have 1 KK Instalando Vá em money.lua na pasta talkactions e substitua tudo por: function onSay(cid, words, param, channel) local money = getPlayerMoney(cid) local kk = 100000000 local hd = 10000000 if (money > 0 and money < 1000) then money = money.." gp." elseif (money >= 1000 and money < hd) then money = money / 1000 .." K." elseif (money >= hd and money < kk) then money = money / 100000 .." K." elseif (money >= kk) then money = money / kk .. " KK." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " .. money ) return true end Créditos Joe Rod