
Tudo que Snowsz postou
-
(Resolvido)Talkaction Deathlist [TFS1.X]
Isso é assunto pra outro tópico kk
-
(Resolvido)Talkaction Deathlist [TFS1.X]
local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and not isInArray(KillersArray, CreatureMT:getName()) then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Isso deve resolver ↑. Sobre o site eu não entendo muito bem, mas posso até tentar.
-
(Resolvido)Talkaction Deathlist [TFS1.X]
Pensei que só queria de player kkk, sobre cortar 2 letras, é falta de prática minha, mesmo mexendo com isso todo dia, me sinto enferrujado sempre, isso deve resolver: local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Talk: local function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end local function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end local function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function onSay(player, words, param) local resultId = db.storeQuery("SELECT `id`, `name` FROM `players` WHERE `name` = " .. db.escapeString(param)) if resultId ~= false then local targetGUID = result.getNumber(resultId, "id") local targetName = result.getString(resultId, "name") result.free(resultId) local str = "" local breakline = "" local resultId = db.storeQuery("SELECT `time`, `level`, `killed_by`, `is_player`, `player_killers` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC") if resultId ~= false then repeat if str ~= "" then breakline = "\n" end local date = os.date("*t", result.getNumber(resultId, "time")) local article = "" local killed_by = result.getString(resultId, "killed_by") if result.getNumber(resultId, "is_player") == 0 then article = getArticle(killed_by) .. " " killed_by = killed_by:lower() end local killers = (result.getString(resultId, "player_killers") or ""):gsub(";", ", ") if date.day < 10 then date.day = "0" .. date.day end if date.hour < 10 then date.hour = "0" .. date.hour end if date.min < 10 then date.min = "0" .. date.min end if date.sec < 10 then date.sec = "0" .. date.sec end str = str .. breakline .. " " .. date.day .. getMonthDayEnding(date.day) .. " " .. getMonthString(date.month) .. " " .. date.year .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec .. " Morto no Level " .. result.getNumber(resultId, "level") .. " por " .. killers .. "." until not result.next(resultId) result.free(resultId) end if str == "" then str = "Sem mortes." end player:popupFYI("Mortes do personagem, " .. targetName .. ".\n\n" .. str) else player:sendCancelMessage("O jogador com esse nome não existe.") end return false end
-
(Resolvido)Talkaction Deathlist [TFS1.X]
Erro meu kkk, fez bem em mudar lá, tenta agora: local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and CreatureMT:isPlayer() then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end
-
item que fala
Caso seja TFS 1.X: local Messages = { [Id do item] = "Msg", [Id do item2] = "Msg2 etccc" } function onUse(player, item, fromPosition, itemEx, toPosition) player:say(Messages[item:getId()]) return true end Isso não vai funcionar, o correto seria: local Messages = { [ID] = {Text = "Msg", Color = 21}, [ID] = {Text = "Msg", Color = 21} } function onUse(cid, item, fromPosition, itemEx, toPosition) doSendAnimatedText(getCreaturePosition(cid), Messages[item.itemid].Text, Messages[item.itemid].Color) return true end
-
(Resolvido)Talkaction Deathlist [TFS1.X]
Execute isso no MySQL: ALTER TABLE player_deaths ADD player_killers TEXT NOT NULL Talkaction: local function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end local function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end local function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function onSay(player, words, param) local resultId = db.storeQuery("SELECT `id`, `name` FROM `players` WHERE `name` = " .. db.escapeString(param)) if resultId ~= false then local targetGUID = result.getNumber(resultId, "id") local targetName = result.getString(resultId, "name") result.free(resultId) local str = "" local breakline = "" local resultId = db.storeQuery("SELECT `time`, `level`, `killed_by`, `is_player`, `player_killers` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC") if resultId ~= false then repeat if str ~= "" then breakline = "\n" end local date = os.date("*t", result.getNumber(resultId, "time")) local article = "" local killed_by = result.getString(resultId, "killed_by") if result.getNumber(resultId, "is_player") == 0 then article = getArticle(killed_by) .. " " killed_by = killed_by:lower() end local killers = (result.getString(resultId, "player_killers") or ""):gsub(";", ", ") killers = killers:sub(1, #killers-2) if date.day < 10 then date.day = "0" .. date.day end if date.hour < 10 then date.hour = "0" .. date.hour end if date.min < 10 then date.min = "0" .. date.min end if date.sec < 10 then date.sec = "0" .. date.sec end str = str .. breakline .. " " .. date.day .. getMonthDayEnding(date.day) .. " " .. getMonthString(date.month) .. " " .. date.year .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec .. " Morto no Level " .. result.getNumber(resultId, "level") .. " por " .. killers .. "." until not result.next(resultId) result.free(resultId) end if str == "" then str = "Sem mortes." end player:popupFYI("Mortes do personagem, " .. targetName .. ".\n\n" .. str) else player:sendCancelMessage("O jogador com esse nome não existe.") end return false end Creaturescript: local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and CreatureMT:isPlayer() then table.insert(KillersArray, v:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', ' .. table.concat(KillersArray, ";") .. ')') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Não testei então tenta aí. A identação saiu meio bugada umas partes mas não importa.
-
[Base DxP]This editor needs an updated items.otb version
Nah, n sou de usar pokémon. Já que isso não resolveu não tenho ideia, talvez o @Nolis saiba.
-
[Base DxP]This editor needs an updated items.otb version
Na pasta 854 no RME, troca o item otb de lá pra o seu item otb, 8.54 ou 8.60, não sei qual a versão de pokémon.
-
Creature Information Offset
Assim que tiver tempo ajusto o tópico com a versão atualizada, to resolvendo umas treta.
-
[New Cast System] OTX3 8.60
Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
-
[10.98] Carlin Revamp 2.0
Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
- Update ProtocolGame::AddPlayerStats - TFS 1.3 & OTX 3
- Mapper King 2018
-
Aura healing system
-- CONFIGURAÇÕES local aurastr = 25950 -- storage da aura local estr = 25951 -- storage para o exhaust local porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem local quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) local tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) local tipoaura = 30 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo) local efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) local BlockedAreas = { {FromPos = {x = 10, y = 10, z = 7}, ToPos = {x = 20, y = 20, z = 7}}, } -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal) if(i<=8 and i>1) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura(1,0,cid) else return true end else return true end end -- Função principal function onLogin(cid) for k, v in pairs(BlockedAreas) do if isInArea(getThingPos(cid), v.FromPos, v.ToPos) then return true end end efeitosAura(1,tempo/8,cid) return true end Fon.
-
Aura healing system
-- CONFIGURAÇÕES local aurastr = 25950 -- storage da aura local estr = 25951 -- storage para o exhaust local porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem local quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) local tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) local tipoaura = 30 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo) local efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) local BlockedAreas = { {FromPos = {x = 10, y = 10, z = 7}, ToPos = {x = 20, y = 20, z = 7}}, } -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal) if(i<=8 and i>1) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura(1,0,cid) else return true end else return true end end -- Função principal function onLogin(cid) for k, v in pairs(BlockedAreas) do if isInArea(cid, v.FromPos, v.ToPos) then return true end end efeitosAura(1,tempo/8,cid) return true end
-
Aura healing system
-- CONFIGURAÇÕES aurastr = 25950 -- storage da aura estr = 25951 -- storage para o exhaust porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) tipoaura = 30 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo) efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura(i,tm,cid) if isCreature(cid) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal) if(i<=8 and i>1) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if i<=8 then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif i>8 then return efeitosAura(1,0,cid) else return true end else return true end end -- Função principal function onLogin(cid) efeitosAura(1,tempo/8,cid) return true end Ih rapaz, foi tão hard que até os dedo ta doendo aqui, vishhhh...
-
Bau diário
Não vai funcionar, vc não colocou junto a função string.diff que originalmente não existe nas libs do TFS/OTX. E seria mais inteligente mudar isso: for _, table in pairs(config.items) do for i=1, #config.items do player:addItem(table[i]) end end table é uma variável já existente nativa do lua, onde existem todas as funções de tabelas, não é bom ficar sobre-escrevendo assim, por mais que do jeito que está seja datada como uma local.
-
Creature Information Offset
Faz tempo que não posto nada, então deu vontade, tava brincando um pouco ai fiz esse sisteminha básico. • Gifs Nesse primeiro Gif, ao trocar a direção da Outfit, o nome e as barras de informações como Health, Mana, mudam de posição, isso é bom para ajustar as Outfits de acordo com o seu tamanho, como o Demon, ficar com as informações logo em cima da cabeça, ou Hydra, todos estão com o local padrão. Aqui era como as informações ficavam com essa Outfit originalmente, no padrão de sempre dos clients. Comparativo em imagem estática: Tibia Outfit antes e depois: Aqui estão algumas outfits que meu primo @Fae1z fez, apliquei o sistema de offset nelas, uma do Graves, uma do Ekko, ambos são personagens do game League of Legends, e uma baseada Uganda Knuckle: Ekko antes: Ekko depois: Graves antes e depois: Uganda Knuckle antes e depois: Aqui eu estava brincando de por as informações da Outfit de anão de modo drogado kkk. • Código Em Creature.h modifique nesta linha: void Creature::drawInformation(const Point& point, bool useGray, const Rect& parentRect, int drawFlags) Mude "const Point& point" para "Point& point". Ficando: void Creature::drawInformation(Point& point, bool useGray, const Rect& parentRect, int drawFlags) Embaixo de: std::string getName() { return m_name; } Adicione: Point getInformationOffset() { return m_informationOffset; } void setInformationOffset(int x, int y) { m_informationOffset.x = x; m_informationOffset.y = y; } Embaixo de: Position m_oldPosition; Adicione: Point m_informationOffset; Agora, em Creature.cpp procure por: void Creature::drawInformation(const Point& point, bool useGray, const Rect& parentRect, int drawFlags) Mude "const Point& point" para "Point& point". Ficando: void Creature::drawInformation(Point& point, bool useGray, const Rect& parentRect, int drawFlags) Sim, isso está repetido, é assim mesmo, o processo é necessário em Creature.h e Creature.cpp, nessa função a variável point tem seu tipo alterado de Const para normal. Ainda em Creature.cpp procure por: if(!useGray) fillColor = m_informationColor; Pule duas linhas e adicione: point.x += m_informationOffset.x; point.y += m_informationOffset.y; Agora, em Luafunctions.cpp procure por: g_lua.bindClassMemberFunction<Creature>("jump", &Creature::jump); Embaixo adicione: g_lua.bindClassMemberFunction<Creature>("setInformationOffset", &Creature::setInformationOffset); g_lua.bindClassMemberFunction<Creature>("getInformationOffset", &Creature::getInformationOffset); A parte da source é só isso. Foi criada uma variável do tipo Point na classe Creature, que pode armazenar dois valores do tipo Int, sendo eles X & Y, assim detendo uma posição de offset, para ajustar a posição das informações(Health Bar, Mana Bar e Name) da criatura, essa variável é usada na função Creature::drawInformation, onde ocorre todo o desenho de informações das criaturas, lá o offset criado altera a posição de um Point usado como posição base das informações, alterando esse Point todo o resto segue aquela posição, você pode setar o offset diretamente na criatura, as funções podem ser usadas tanto na source usando C++ quanto nos scripts usando Lua, em Lua o uso das funções é o seguinte: Essa função retorna uma tabela com X & Y, algo como "table = {x = 10, y = 20}", são as posições do offset. Creature:getInformationOffset() Exemplo de uso: local Offset = Creature:getInformationOffset() print(Offset.x) print(Offset.y) Isso vai printar no client_terminal do OTClient os valores de X & Y. Enquanto esta altera as posições usando os valores X & Y. Creature:setInformationOffset(x, y) Exemplo: Creature:setInformationOffset(10, -5) Essa configuração de offset vai aumentar X em 10 Pixels e diminuir Y em 5 Pixels, no meu primeiro gif, na direção Sul do Char, eu usei X diminuindo 13 Pixels e Y diminuindo 8 Pixels, algo como isso: Creature:setInformationOffset(-13, -8) Para tudo isso funcionar igual os gifs acima eu fiz um módulo especial, onde dependendo da Outfit e da direção que a criatura está olhando, ele vai alterar o offset de acordo. Para criar o módulo, siga estes passos: Na pasta do OTClient em modules/ crie uma pasta chamada game_creatureinformation, dentro crie um arquivo com o mesmo nome e a extensão .otmod, algo como "game_creatureinformation.otmod", o conteúdo do arquivo é este: Module name: game_creatureinformation description: Changes the position of the informations point to correctly draw names and creature bars. author: Snowsz website: tibiaking.com autoload: true reloadable: true sandboxed: true version: 1.0 scripts: [ game_creatureinformation ] @onLoad: init() @onUnload: terminate() Crie um arquivo com o mesmo nome e a extensão .lua, algo como "game_creatureinformation.lua", o conteúdo do arquivo é este: --[[ Directions: North /\ East > South \/ West < Structure: [OutfitID] = { [Direction] = {x = OFFSETX, y = OFFSETY}, } ]] --Lista de offsets para cada Outfit. local OutfitOffsets = { [143] = { --Outfit do primeiro gif [North] = {x = -13, y = -8}, [East] = {x = -17, y = -8}, [South] = {x = -13, y = -8}, [West] = {x = -15, y = -8}, }, [160] = { --Outfit de anão com o nome full drogado. [North] = {x = 0, y = 0}, [East] = {x = 0, y = 0}, [South] = {x = -13, y = -80}, [West] = {x = 0, y = 0}, } } local function translateDir(dir) if dir == NorthEast or dir == SouthEast then return East elseif dir == NorthWest or dir == SouthWest then return West end return dir end local function getOutfitInformationOffset(outfit, dir) if OutfitOffsets[outfit] then return OutfitOffsets[outfit][translateDir(dir)] end return {x = 0, y = 0} end local function onCreatureAppear(creature) local Offset = getOutfitInformationOffset(creature:getOutfit().type, creature:getDirection()) creature:setInformationOffset(Offset.x, Offset.y) end local function onCreatureDirectionChange(creature, oldDirection, newDirection) local Offset = getOutfitInformationOffset(creature:getOutfit().type, newDirection) creature:setInformationOffset(Offset.x, Offset.y) end local function onCreatureOutfitChange(creature, newOutfit, oldOutfit) local Offset = getOutfitInformationOffset(newOutfit.type, creature:getDirection()) creature:setInformationOffset(Offset.x, Offset.y) end function init() connect(LocalPlayer, {onOutfitChange = onCreatureOutfitChange}) connect(Creature, { onAppear = onCreatureAppear, onDirectionChange = onCreatureDirectionChange, onOutfitChange = onCreatureOutfitChange }) end function terminate() disconnect(LocalPlayer, {onOutfitChange = onCreatureOutfitChange}) disconnect(Creature, { onAppear = onCreatureAppear, onDirectionChange = onCreatureDirectionChange, onOutfitChange = onCreatureOutfitChange }) end A parte do módulo está finalizada, o que resta agora é configurar as Outfits na tabela com seus determinados Offsets, e não se preocupe, se a outfit não estiver configurada, ela vai seguir o padrão normal, o módulo só altera algo quando determinada Outfit está configurada. Para configurar o módulo é simples, basta seguir o padrão: [ID DA OUTFIT AQUI] = { [North] = {x = 0, y = 0}, [East] = {x = 0, y = 0}, [South] = {x = 0, y = 0}, [West] = {x = -0, y = 0}, }, Nos primeiros colchetes coloque o ID da sua Outfit para ter o offset modificado, os colchetes restantes são as direções, não é necessário mexer neles, dentro de cada índice da tabela tem os offsets X & Y, basta modificar o valor de acordo, sendo ele positivo ou negativo. NÃO SE ESQUEÇA DA VÍRGULA NO FINAL "},".
-
[PEDIDO] Referente ao tfs 0.4 (rev3777) do Fir3element
@Fir3element não são em todos os tfs, talvez do 0.x, mas o 1.x+ não tem, testei aqui.
-
[Show Off] Pokémon Global (Old Client custom)
Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
- Magnus Task System 1.2
-
ajuda soucer
Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
-
POR FAVOR o SERVER do PXG alguem tem? completo, obg.
Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
-
Sobre o Comércio
Também acho isso, mas da pra permitir nas assinaturas com devidas regras.
-
(Resolvido)Tirar Simbolo % do Script
Então ta na mão de deus.