Tudo que Danyel Varejao postou
-
(Resolvido)(PEDIDO) Script porta que só passa quem matou os monstros da lista
Eu editei lá, faltou eu colocar a tag da action, tá tudo certinho agr, só instalar corretamente!
-
(Resolvido)(PEDIDO) Script porta que só passa quem matou os monstros da lista
1º Em data/creaturescripts/scripts adicione um arquivo chamado Quest_Bosses.lua e cole isso dentro: local Configs = { Bosses = { ["Nome do boss"] = 60000, ["Nome do boss"] = 60001, ["Nome do boss"] = 60002, ["Nome do boss"] = 60003, ["Nome do boss"] = 60004, ["Nome do boss"] = 60005, ["Nome do boss"] = 60006, ["Nome do boss"] = 60007, ["Nome do boss"] = 60008, ["Nome do boss"] = 60009, ["Nome do boss"] = 60010, } } function onDeath(cid, corpse, deathList) for Name, Storage in pairs(Configs.Bosses) do if getCreatureName(cid) == Name then for i = 1, #deathList do setPlayerStorageValue(deathList[i], Storage, 1) end end end registerCreatureEvent(cid, "Quest_Bosses") return true end 2º Configure o script pra o nome dos boss corretamente, Exemplo: ["Rat"], ["Orc"] etc 3º Em data/creaturescripts/scripts/login.lua adicione isso dps de qualquer registerCreatureEvent registerCreatureEvent(cid, "Quest_Bosses") 4º Em data/creaturescripts/creaturescripts.xml adicione essa tag: <event type="death" name="Quest_Bosses" event="script" value="Quest_Bosses.lua"/> 5º Em data/actions/scripts cria um arquivo chamado Quest_Bosses.lua e cole isso: local Configs = { Door_AID = 6000, Bosses = { [1] = {60000, "Nome do Boss1"}, [2] = {60001, "Nome do Boss2"}, [3] = {60002, "Nome do Boss3"}, [4] = {60003, "Nome do Boss4"}, [5] = {60004, "Nome do Boss5"}, [6] = {60005, "Nome do Boss6"}, [7] = {60006, "Nome do Boss7"}, [8] = {60007, "Nome do Boss8"}, [9] = {60008, "Nome do Boss9"}, [10] = {60009, "Nome do Boss10"}, [11] = {60010, "Nome do Boss11"}, } } local function CheckKillBosses(cid) for i = 1, #Configs.Bosses do if getPlayerStorageValue(cid, Configs.Bosses[i][1]) < 0 then return false end end return true end local function EmptyBosses(cid) local Table = {} for i = 1, #Configs.Bosses do if getPlayerStorageValue(cid, Configs.Bosses[i][1]) < 0 then table.insert(Table, Configs.Bosses[i][2]) end end return table.concat(Table, ', ') end function onUse(cid, item, fromPosition, itemEx, toPosition) local Player_Pos = getThingPos(cid) if item.aid == Configs.Door_AID then if CheckKillBosses(cid) then if Player_Pos.x == toPosition.x then if Player_Pos.y < toPosition.y then Player_Pos.y = toPosition.y + 1 else Player_Pos.y = toPosition.y - 1 end elseif Player_Pos.y == toPosition.y then if Player_Pos.x < toPosition.x then Player_Pos.x = toPosition.x + 1 else Player_Pos.x = toPosition.x - 1 end end doTeleportThing(cid, Player_Pos, true) doSendMagicEffect(Player_Pos, CONST_ME_TELEPORT) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Falta voce matar: ".. EmptyBosses(cid) ..".") end end return true end 6º Em data/actions/actions.xml adicione a tag: <action actionid="6000" event="script" value="Quest_Bosses.lua"/> 7º Configure o nome dos bosses corretamente e não esqueça de colocar a porta com ActionID 6000 no seu remeres map editor! 8º No xml de todos os bosses coloque isso antes de </monster>: <script> <event name="Quest_Bosses"/> </script> Caso tenha alguma dúvida ou não funcione só falar!
-
Premium points Transfer Document
Olá @SilentKill pelo que eu entendi do sistema é o seguinte, funciona como uma troca de PONTOS por ITEMS usando o trade. correto? Aqui vai os scripts! 1º Em data/npc/scripts adicione um arquivo chamado NamekJin Seller.lua e cole isso dentro: 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 greetCallback(cid) talkState[cid] = 0 return true end function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end if talkState[cid] == nil or talkState[cid] == 0 then Count_Points = tonumber(msg) if isInArray(Points_Trade.Points, Count_Points) then npcHandler:say("Do you want to buy a premium points transfer document that will transfer ".. Count_Points .." premium points, right?", cid) talkState[cid] = 1 else npcHandler:say("Escolha um numero entre ".. table.concat(Points_Trade.Points, ', ') ..".", cid) talkState[cid] = 0 end elseif talkState[cid] == 1 then if msgcontains(msg, 'yes') then local Document = doCreateItemEx(Points_Trade.Document_ItemID) doItemSetAttribute(Document, "name", "".. Count_Points .." premium points transfer document") doItemSetAttribute(Document, "points", Count_Points) doPlayerAddItemEx(cid, Document) npcHandler:say("Você obteve um documento que vale ".. Count_Points .." premium points, use ele no trade com alguem.", cid) talkState[cid] = 0 else npcHandler:say("Ok, volte mais tarde.", cid) talkState[cid] = 0 end end return true end npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Eu vendo alguns utensílios e Premium Points transfers para você transferir pontos para outros jogadores, lembre-se para comprar use '10,ppt' para 10 pontos.") npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2º Em data/lib adicione um arquivo chamado Points_Trade.lua e cole isso dentro: Points_Trade = { Document_ItemID = 1954, Points = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, } function DocumentPoints(Item) return tonumber(getItemAttribute(Item.uid, "points")) end function getPlayerPoints(cid) local AccountID = getPlayerAccountId(cid) local Points = 0 local Result = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = ".. AccountID .."") if Result:getID() ~= -1 then Points = Result:getDataInt("premium_points") end return tonumber(Points) end function doPlayerAddPoints(cid, Points) local AccountID = getPlayerAccountId(cid) local Result = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '".. AccountID .."'") if Result:getID() ~= -1 then db.executeQuery("UPDATE `accounts` SET `premium_points` = " .. getPlayerPoints(cid) + Points .. " WHERE `id` = " .. AccountID .. ";") end return true end function doPlayerRemovePoints(cid, Points) local AccountID = getPlayerAccountId(cid) local Result = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '".. AccountID .."'") if Result:getID() ~= -1 then db.executeQuery("UPDATE `accounts` SET `premium_points` = " .. getPlayerPoints(cid) - Points .. " WHERE `id` = " .. AccountID .. ";") end return true end 3º Em data/creaturescripts/scripts adicione um arquivo chamado Points_Trade.lua e cole isso dentro: function onTradeAccept(cid, target, item, targetItem) if isPlayer(cid) and isPlayer(target) then if item.itemid == Points_Trade.Document_ItemID then doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "Você recebeu ".. DocumentPoints(item) .." premium points.") doPlayerAddPoints(target, DocumentPoints(item)) doPlayerRemovePoints(cid, DocumentPoints(item)) addEvent(doPlayerRemoveItem, 1, target, Points_Trade.Document_ItemID, 1) elseif targetItem.itemid == Points_Trade.Document_ItemID then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você recebeu ".. DocumentPoints(targetItem) .." premium points.") doPlayerAddPoints(cid, DocumentPoints(targetItem)) doPlayerRemovePoints(target, DocumentPoints(targetItem)) addEvent(doPlayerRemoveItem, 1, cid, Points_Trade.Document_ItemID, 1) end end return true end function onTradeRequest(cid, target, item) if item.itemid == Points_Trade.Document_ItemID then if getPlayerPoints(cid) < DocumentPoints(item) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você não tem ".. DocumentPoints(item) .." para realizar uma troca.") return false end end return true end 4º Em data/creaturescripts/scripts/login.lua adicione isso dps de qualquer linha que contenha registerCreatureEvent registerCreatureEvent(cid, "Points_Trade_Request") registerCreatureEvent(cid, "Points_Trade") 5º Em data/creaturescripts/creaturescripts.xml adicione uma tag: <event type="traderequest" name="Points_Trade_Request" event="script" value="Points_Trade.lua"/> <event type="tradeaccept" name="Points_Trade" event="script" value="Points_Trade.lua"/> 6º Em data/npc adicione um arquivo chamado NamekJin Seller.xml e coloque isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="NamekJin Seller" script="NamekJin Seller.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="138" head="97" body="59" legs="45" feet="102" addons="2"/> </npc> Se te ajudou marque como melhor resposta!, obrigado.
-
DoubleExp Potion
DOUBLE POTION.rar
-
Clicar em X item Ser teleportado e retira item da BP
local Configs = { ItemID = 5906, -- ID do item que precisa. Count = 100, -- Quantidade do item que precisa. Storage = 33423, -- Storage que vai receber ao usar o item Position = {x = 169, y = 414, z = 7} -- Posição a ser teleportado. } function onUse(cid, item, fromPosition, item2, toPosition) if getPlayerItemCount(cid, Configs.ItemID) >= Configs.Count then if getPlayerStorageValue(cid, Configs.Storage) < 1 then if getCreatureSkullType(cid) <= 3 then doTeleportThing(cid, Configs.Position) doSendMagicEffect(getThingPos(cid), 44) doPlayerRemoveItem(cid, Configs.ItemID, Configs.Count) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce foi teletransportado por ".. Configs.Count .."x ".. getItemInfo(Configs.ItemID).name ..".") setPlayerStorageValue(cid, Configs.Storage, 1) else doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce nao pode teletransportar com skulls.") end end else doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce nao tem ".. Configs.Count .." ".. getItemInfo(Configs.ItemID).name ..".") end return true end
-
PISO QUE SE MOVE PARA LADO
Veja se é isto que vc quer. local Configs = { Positions = { {x = 159, y = 52, z = 7}, {x = 160, y = 52, z = 7}, {x = 161, y = 52, z = 7}, {x = 159, y = 53, z = 7}, {x = 161, y = 53, z = 7}, {x = 159, y = 54, z = 7}, {x = 160, y = 54, z = 7}, {x = 161, y = 54, z = 7} } } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) doTeleportThing(cid, Configs.Positions[math.random(1, #Configs.Positions)]) return true end
-
(Resolvido)Spell que acumula storage
Não entendi muito bem oque voce quis, mas testa ai Script do ataque. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local Configs = { Storage = 12202, -- Storage da marca Time = 5, -- Tempo em segundos de cada marca } local function RemoveMark(cid) if isPlayer(cid) then setPlayerStorageValue(cid, Configs.Storage, getPlayerStorageValue(cid, Configs.Storage) - 1) end return true end local function AddMark(cid) if isPlayer(cid) then if getPlayerStorageValue(cid, Configs.Storage) <= 5 then setPlayerStorageValue(cid, Configs.Storage, getPlayerStorageValue(cid, Configs.Storage) + 1) addEvent(RemoveMark, Configs.Time * 1000, cid) end end return true end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if isPlayer(target) then AddMark(target) end return doCombat(cid, combat, var) end Script pra remover as marcas local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local Configs = { Storage = 12202, -- Storage da marca Damages_Per_Mark = 50, } function onCastSpell(cid, var) local Damage = getPlayerStorageValue(cid, Configs.Storage) * Configs.Damages_Per_Mark if getPlayerStorageValue(cid, Configs.Storage) > 0 then doCreatureAddHealth(cid, -Damage) setPlayerStorageValue(cid, Configs.Storage, 0) end return doCombat(cid, combat, var) end Não testei, caso aconteça algo de errado me avise!
- [System] Auto Loot Perfect
- [System] Auto Loot Perfect
-
[System] Auto Loot Perfect
~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7 Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa. 1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo: 2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione: 3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione: 4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione: 5° - Em data/actions/actions.xml adicione a seguinte tag: <!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost. 6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag: <!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag: <!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/> Créditos 50% Killua(Vitor Bertolucci) 50% Danyel Varejão
-
(Resolvido)Error CreatureScript - Item Por Level e Vocação
Você está ligando o autoloot, usando !autoloot power ou !autoloot on, algo do tipo?
-
(Resolvido)Error CreatureScript - Item Por Level e Vocação
Adiciona isso na lib lá e testa dnv. tabela_storages = { filtrateString = function(str) local tb, x, old, last = {}, 0, 0, 0 local first, second, final = 0, 0, 0 if type(str) ~= "string" then return tb end for i = 2, #str-1 do if string.byte(str:sub(i,i)) == string.byte(':') then x, second, last = x+1, i-1, i+2 for t = last,#str-1 do if string.byte(str:sub(t,t)) == string.byte(',') then first = x == 1 and 2 or old old, final = t+2, t-1 local index, var = str:sub(first,second), str:sub(last,final) tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var) break end end end end return tb end, translateIntoString = function(tb) local str = "" if type(tb) ~= "table" then return str end for i, t in pairs(tb) do str = str..i..": "..t..", " end str = "a"..str.."a" return tostring(str) end } function setPlayerTableStorage(cid, key, value) return doPlayerSetStorageValue(cid, key, tabela_storages.translateIntoString(value)) end function getPlayerTableStorage(cid, key) return tabela_storages.filtrateString(getPlayerStorageValue(cid, key)) end function setGlobalTableStorage(key, value) return setGlobalStorageValue(key, tabela_storages.translateIntoString(value)) end function getGlobalTableStorage(key) return tabela_storages.filtrateString(getGlobalStorageValue(key)) end function getStorageZero(storage) local sto = getGlobalStorageValue(storage) return sto > 0 and sto or 0 end function getPlayerStorageZero(cid, storage) local sto = getPlayerStorageValue(cid, storage) if tonumber(sto) then return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0) end return tonumber(0) end
-
(Resolvido)Error CreatureScript - Item Por Level e Vocação
Creaturescripts.xml não é o script não rsrs
-
(Resolvido)Error CreatureScript - Item Por Level e Vocação
Posta seu creaturescripts.xml e seu login.lua ai por favor.
-
(Resolvido)Error CreatureScript - Item Por Level e Vocação
Isso é um sistema de autoloot... Certo, o erro mudou agr coloca isso daqui na mesma lib: function countTable(table) local y = 0 if type(table) == "table" then for _ in pairs(table) do y = y + 1 end return y end return false end
-
(Resolvido)Como crio item para da points no site?
Caso você utilize site, quando um character é criado ele é copiado dos Samples, ou seja, tudo que tiver nos samples vão para o seu character novo. Caso não utilize site terá que adicionar um script de FirstItems em creaturescripts
-
Portas ''MALDITAS''
Pode me dizer qual o provedor da sua internet? Se for via rádio é chatinho mesmo :S
-
Portas ''MALDITAS''
É possivel mas isso é muito raro, creio eu que você que não está conseguindo realmente liberar as portas, se você utiliza 2 roteadores terá que abrir nos dois. Sendo assim o seu modem abrindo as portas para o ip do seu roteador/wifi E o do seu roteador/wifi abrindo para o seu ipv4. Ou simplesmente você pode ligar o DMZ Host nos 2 para não ter que liberar as portas. O DMZ Host no seu modem padrão libere pro ip do seu roteador e do seu roteador libere pro seu ipv4 Lembrando que pra abrir as portas é em Fowarding ou os Famosos Servidores Virtuais... rsrs
-
Portas ''MALDITAS''
Exatamente, quando acontece isto significa que as portas do seu modem não estão abertas.
-
(Resolvido)Como crio item para da points no site?
Cria um arquivo chamado Points.lua em data/lib e cole isto: function getAccountPoints(cid) local Result = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'') if(Result:getID() == -1) then return false end local Points = Result:getDataInt("premium_points") Result:free() return tonumber(Points) end function doAccountAddPoints(cid, Count) return db.query("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) + Count .."' WHERE `name` ='"..getPlayerAccount(cid).."'") end function doAccountRemovePoints(cid, Count) return db.query("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) - Count .."' WHERE `name` ='"..getPlayerAccount(cid).."'") end Em seguida vá até a pasta data/actions/actions.xml e cole isto, lembrando que o id do item está configurado para 2345: <action itemid="2345" event="script" value="Add_Points.lua"/> Em seguida vá até a pasta data/actions/scripts e cria um arquivo chamado Add_Points.lua e cole isto dentro: local Configs = { Count = 1 } function onUse(cid, item, fromPosition, itemEx, toPosition) doAccountAddPoints(cid, Configs.Count) doCreatureSay(cid, "Congratulations, your received ".. Configs.Count .." premium points!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 28) doRemoveItem(item.uid, 1) return true end Caso tenha te ajudado marque como melhor resposta, obrigado.
-
Portas ''MALDITAS''
Geralmente essas duas portas e várias nestes sites não falam realmente quando estão abertas, o melhor jeito pra você testar isso é colocando o OT online e entrando como 127.0.0.1 ou localhost.
-
EVENTO GUERRA
Poste os devidos scripts do evento meu amigo, ninguém aqui é vidente pra saber não...
-
SCRIPT ANUNCIAR MORTE S/BUGS
data/creaturescripts/creaturescripts.xml cole isto: <event type="login" name="BroadCast_Kill_Login" event="script" value="Kill_Broadcast.lua"/> <event type="kill" name="BroadCast_Kill" event="script" value="Kill_Broadcast.lua"/> data/creaturescripts/scripts cria um arquivo com nome Kill_Broadcast.lua e cole isto dentro: function onKill(cid, target) if isPlayer(target) then if ((isInParty(target) and isInParty(cid)) and (getPlayerParty(cid) == getPlayerParty(target))) and isPlayer(target) then broadcastMessage(getCreatureName(cid) .. " just killed ".. getCreatureName(target).." (Justified)", MESSAGE_EVENT_ORANGE) elseif getCreatureSkullType(cid) == 4 or getCreatureSkullType(cid) == 3 and getCreatureSkullType(target) == 0 and isPlayer(target) then broadcastMessage(getCreatureName(cid) .. " just killed ".. getCreatureName(target).." (UnJustified)", MESSAGE_EVENT_ORANGE) elseif getCreatureSkullType(target) == 3 or getCreatureSkullType(target) == 4 and isPlayer(target) then broadcastMessage(getCreatureName(cid) .. " just killed ".. getCreatureName(target).." (Justified)", MESSAGE_EVENT_ORANGE) end end return true end function onLogin(cid) registerCreatureEvent(cid, "BroadCast_Kill") registerCreatureEvent(cid, "BroadCast_Kill_Login") return true end Marque como melhor resposta caso tenha resolvido seu tópico. Obrigado
-
Paladin perdendo muita skill (Urgente)
Verifique as skills do seu Paladin Sample e veja se realmente existe as duas.
-
Comprar item por comando
local Money = {ItemID = 2145, Quantidade = 5} local Item = {ItemID = 11454, Quantidade = 1} function onSay(cid, words, param, channel) if doPlayerRemoveItem(cid, Money.ItemID, Money.Quantidade) then doPlayerAddItem(cid, Item.ItemID, Item.Quantidade) doPlayerSendTextMessage(cid, 4, "Parabéns, você comprou ".. Item.Quantidade .."x ".. getItemInfo(Item.ItemID).name ..".") else doPlayerSendTextMessage(cid, 4, "Você não tem ".. Money.Quantidade .." ".. getItemInfo(Money.ItemID).name ..".") end return true end