Ir para conteúdo

Movie

Membro
  • Registro em

  • Última visita

Tudo que Movie postou

  1. Olá a todos, e estou de volta pra postar alguns conteúdos... Fui atrás de um online bonus system para tfs 1.3 e não achei e portanto decidi fazer o meu, com a ajuda do @vankk. ================================================================================================================ Testado em TFS 1.3 na versão 8.60. ================================================================================================================ ================================================================================================================ No seu banco de dados, execute a seguinte query ALTER TABLE `players` ADD `online_time` int(11) NOT NULL DEFAULT 0 ================================================================================================================ O próximo passo é apenas para quem gostaria de que, a cada server save, o número seja zerado! ================================================================================================================ Em globalevents/scripts/startup.lua, após o inicio da função onStartup() adicione o seguinte código db.query("UPDATE `players` SET `online_time` = 0") ================================================================================================================ Agora crie um arquivo chamado onlinebonus.lua em creaturescripts/scripts com isso dentro local event = {} local function addOnlineToken(playerId) local player = Player(playerId) if not player then return false end if player:getIp() == 0 then event[player:getId()] = nil return false end player:addOnlineTime(1) player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você ganhou 1 online token por permanecer online por 1 hora sem deslogar.") player:addItem(12543, 1) event[player:getId()] = addEvent(addOnlineToken, 60 * 60 * 1000, player:getId()) end function onLogin(player) player:registerEvent("OnlineBonus") player:registerEvent("OnlineBonusLogout") if event[player:getId()] == nil then event[player:getId()] = addEvent(addOnlineToken, 60 * 60 * 1000, player:getId()) end return true end function onLogout(player) if event[player:getId()] then event[player:getId()] = nil end return true end -- <event type="login" name="OnlineBonus" script="onlineBonus.lua" /> -- <event type="logout" name="OnlineBonusLogout" script="onlineBonus.lua" /> A tag XML está no fim desse código. ================================================================================================================ Agora, na pasta lib, crie um arquivo chamado onlineTime.lua e coloque isso dentro function Player.getOnlineTime(self) local resultId = db.storeQuery(string.format('SELECT online_time FROM `players` WHERE `id` = %d', self:getGuid())) if not resultId then return 0 end local value = result.getNumber(resultId, "online_time") result.free(resultId) return value end function Player.addOnlineTime(self, amount) db.query(string.format("UPDATE `players` SET `online_time` = `online_time` + %d WHERE `id` = %d", amount, self:getGuid())) end Não esqueça de registrar essa lib no lib.lua. ================================================================================================================ Agora, na pasta talkactions/scripts, crie um arquivo chamado onlinebonus.lua com o seguinte código dentro: function onSay(player, words, param) local skill = player:getOnlineTime(player) local message = "--------[+]------- [Online Bonus System] -------[+]--------\n\nGanhe um online token a cada hora que você passa online sem deslogar.\n\n---------------------------------------------------\n Total\n Desde o server save você já ganhou " .. skill .. " online tokens." doPlayerPopupFYI(player, message) end -- <talkaction words="!onlinebonus" script="onlineBonus.lua"/> A tag XML está no fim desse código. ================================================================================================================ O usuário irá receber um item a cada hora online sem deslogar. O item está no código de creaturescripts com o id 12543, que pode ser alterado para qualquer item que seja agrupável. ================================================================================================================ É isso por hoje.
  2. @Phineasz já tem muitos scripts disponíveis desse tipo no fórum. Porém me chama no discord que faço pra você. Jaja te respondo lá.
  3. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    No real tinha esse sistema, pena que não mexo mais pra 0.x pra te ajudar nesse
  4. Me manda seu game.cpp
  5. Creio que terá que alterar na source. Não tenho muita experiência, mas posso tentar. Me mande a função playerSaySpell no arquivo game.cpp
  6. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Caso ninguém resolva, me marque que eu venho aqui e faço para você.
  7. Pode ser, inclusive acho até melhor
  8. Estou precisando de um sistema de cast para tfs 1.3 Dou rep+ pra quem ajudar Ah, se não for pedir muito por favor alguém poderia arrumar um sistema de task para o mesmo obrigado ficarei no aguardo
  9. https://pastebin.com/wbS1EMzs
  10. Só fazer via storage, igual tem aqui if getPlayerStorageValue(cid, 64854) >= 10 then
  11. Creio que o look no piso deve ser feito via source, não podendo ser alterado via lua ?
  12. Tenta assim function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid, "Position: [X:".. position.x.."] [Y:".. position.y.."] [Z:".. position.z.."]\n[Frags: "..getPlayerFrags(thing.uid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."] \n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." is ") elseif thing.uid == cid then doPlayerSetSpecialDescription(cid, " [Frags: "..getPlayerFrags(cid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."]") local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'. [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0))..'].' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the guild '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
  13. function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid, " [Frags: "..getPlayerFrags(thing.uid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."] \n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." is ") elseif thing.uid == cid then doPlayerSetSpecialDescription(cid, " [Frags: "..getPlayerFrags(cid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."]") local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'. [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0))..'].' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the guild '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
  14. Tenta function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid, " [Frags: "..getPlayerFrags(thing.uid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."] \n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." is ") elseif thing.uid == cid then doPlayerSetSpecialDescription(cid, " [Frags: "..getPlayerFrags(cid).."], [Critical: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0)).."], [Dodge: "..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0)).."]") local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'. [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0))..'].' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the guild '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if isPlayer(thing.uid) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
  15. Me fala o que esse sistema de army faz, não sei onde posso alterar no code ou não.
  16. Me manda o script inteiro e o que você quer remover.
  17. Toma sem açúcar
  18. Só alterei uma coisinha, tenta esse. Obs: code dessa pessoa aí que citei, se for resolvido, REP+ pra ela e não pra mim!
  19. Esse erro acho que pode ser resolvido da mesma maneira que esse aqui
  20. É necessário que as função doPlayerOpenChannel esteja adicionada à sua source para funcionar, já conferiu isso?
  21. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Estou estudando o melhor jeito para fazê-lo, logo volto com o script para você testar. @amarelax serão premium points ou dias de premium?
  22. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Pelo que eu entendi, o player vai vender os seus dias de premium para outro player? É isso?
  23. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Infelizmente esse script seria complexo demais. Não posso fazê-lo
  24. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Não testei, esse é o primeiro, jaja atualizo e posto o do NPC -- ChangeSex para TFS 1.3 -- Feito por Movie local custo = 10000 local cor = 94 -- Cor da calça local splash = 2016 -- ID do splash function onSay(player, words, param) if player:removeMoney(custo) then if player:getSex() == 0 then player:setSex(PLAYERSEX_MALE) Game.createItem(splash, 1, player:getPosition()) player:setOutfit({lookHead = 0, lookBody = 0, lookLegs = cor, lookFeet = 0}) player:say("AAAAAA", TALKTYPE_MONSTER_SAY) player:save() else player:setSex(PLAYERSEX_FEMALE) Game.createItem(splash, 1, player:getPosition()) player:setOutfit({lookHead = 0, lookBody = 0, lookLegs = cor, lookFeet = 0}) player:say("AAAAAA", TALKTYPE_MONSTER_SAY) player:save() return true end else player:say("Você não tem dinheiro suficiente.", TALKTYPE_MONSTER_SAY) return true end end
  25. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Posso ter colocado na categoria errada, caso tenha acontecido, favor realocar pro local correto. Fala pessoal, então.. Nessa quarentena estou no tédio e resolvi fazer alguns scripts que vocês irão pedir... Já aviso que pode haver scripts que não conseguirei fazer e irei te avisar caso isso ocorra. Obs: tenho maior familiaridade com TFS 1.3, porém me arrisco no 0.x. Como pedir o seu script? - Lembrando que, o prazo de entrega das script varia de script para script. - Sempre que for postar foto, erro ou coisas do tipo, poste como SPOILER ou como CODE. - Não irei fazer pedidos complexos demais, não abusem. - Não faço script de tibia derivado. (Eu realmente não entendo nada dessa área) - Detalhe o seu pedido, quanto mais detalhe, melhor ficará seu código. - Caso eu tenha te ajudado, deixa um REP+ e caso queira fazer uma doação, o botão está na minha assinatura <3

Informação Importante

Confirmação de Termo