Ir para conteúdo

Fir3element

Héroi
  • Registro em

  • Última visita

Tudo que Fir3element postou

  1. Nome: Sistema de reset Versão testada: TFS 0.3.6pl1 / 0.4 / 0.3.7 / 1.1 Créditos: fireelement Imagem: Vá em data/talkactions/talkactions.xml e adicione essa tag: Para TFS 0.3/0.4: Para TFS 1.1/1.0: Agora vá em data/talkactions/scripts/ e crie um arquivo com o nome reset.lua e cole isso nele: Para TFS 0.3/0.4: Para TFS 1.1: Para TFS 1.0:
  2. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    Diz ai, se possível me envie uma MP pra eu ver seu post. @edit Tinha um bug no sistema de reset, usa esse: local config = { backToLevel = 8, exp = 4200, redskull = false, battle = false, pz = false, stages = { {resets = 4, level = 350, vip = 330}, {resets = 9, level = 355, vip = 335}, {resets = 14, level = 360, vip = 340}, {resets = 19, level = 365, vip = 345}, {resets = 24, level = 380, vip = 350}, {resets = 29, level = 390, vip = 355}, {resets = 34, level = 410, vip = 360}, {resets = 39, level = 430, vip = 365}, {resets = 44, level = 450, vip = 370} } } function onSay(cid, words, param) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local function setResets(cid, count) setPlayerStorageValue(cid, 1020, getResets(cid) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "Voce precisa estar sem red skull para resetar.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Voce precisa estar em protection zone para resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce precisa estar sem battle para resetar.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.vip or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "Voce precisa do level " .. resetLevel .. " ou mais para resetar.") end setResets(cid, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `level` = " .. config.backToLevel .. ", `experience` = " .. config.exp .. " WHERE `id` = " .. guid) return true end
  3. The Forgotten King.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="The Forgotten King" script="promotion.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="133" head="20" body="39" legs="45" feet="7" addons="0"/> </npc> scripts/promotion.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 2000000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 2000000, level = 8, promotion = 1, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new())
  4. local healthMax, manaMax = getCreatureMaxHealth(cid), getCreatureMaxMana(cid) doPlayerAddLevel(cid, -(getPlayerLevel(cid)/2)) setCreatureMaxHealth(cid, healthMax) setCreatureMaxMana(cid, manaMax)
  5. Será? Dei uma olhada aqui nos client e não vi nenhuma dll, só se uniram com o .exe
  6. Se o do Snowsz não funcionar:
  7. Não me lembro bem mas acho que é só alterar a RSA.
  8. Tenta colocar isso no script do npc: doPlayerAddLevel(cid, -(getPlayerLevel(cid)/2))
  9. http://www.microsoft.com/en-us/download/details.aspx?id=30679
  10. Qual TFS você está utilizando?
  11. Windows? dev-cpp: alt+p -> Parâmetros -> Compilador C++, adicione: -D__ENABLE_SERVER_DIAGNOSTIC__ Creio que o projeto já vem com essa tag, então é só fazer as alterações na source e compilar.
  12. E nem vai, agora que percebi a função aehuea Fazer isso em lua é bem chato, tenta usar esse sistema: http://www.tibiaking.com/forum/topic/9256-reset-system-with-sources/ Resets no look: http://www.tibiaking.com/forum/topic/9256-reset-system-with-sources/page-2#entry311539 Script para resetar: http://www.tibiaking.com/forum/topic/55036-pedido-sistema-de-resets-com-stages/#entry323611
  13. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    data/events/scripts/player.lua, troque a função onLook por isso: function Player:onLook(thing, position, distance) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local description = "You see " .. thing:getDescription(distance) .. ". Resets: " .. getResets(cid) if self:getGroup():getAccess() then if thing:isItem() then description = string.format("%s\nItem ID: %d", description, thing:getId()) local actionId = thing:getActionId() if actionId ~= 0 then description = string.format("%s, Action ID: %d", description, actionId) end local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID) if uniqueId > 0 and uniqueId < 65536 then description = string.format("%s, Unique ID: %d", description, uniqueId) end local itemType = thing:getType() local transformEquipId = itemType:getTransformEquipId() local transformDeEquipId = itemType:getTransformDeEquipId() if transformEquipId ~= 0 then description = string.format("%s\nTransforms to: %d (onEquip)", description, transformEquipId) elseif transformDeEquipId ~= 0 then description = string.format("%s\nTransforms to: %d (onDeEquip)", description, transformDeEquipId) end local decayId = itemType:getDecayId() if decayId ~= -1 then description = string.format("%s\nDecays to: %d", description, decayId) end elseif thing:isCreature() then local str = "%s\nHealth: %d / %d" if thing:getMaxMana() > 0 then str = string.format("%s, Mana: %d / %d", str, thing:getMana(), thing:getMaxMana()) end description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. "." end local position = thing:getPosition() description = string.format( "%s\nPosition: %d, %d, %d", description, position.x, position.y, position.z ) if thing:isCreature() then if thing:isPlayer() then description = string.format("%s\nIP: %s.", description, Game.convertIpToString(thing:getIp())) end end end self:sendTextMessage(MESSAGE_INFO_DESCR, description) end
  14. Pode fazer o que o Wakon disse, mas se quiser mudar na source: protocolgame.cpp, procure por: if(player->hasCondition(CONDITION_INFIGHT)) troque por: if(!player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) && player->hasCondition(CONDITION_INFIGHT))
  15. if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\nResets: [" .. getPlayerReset(cid) .."]") end return true end
  16. tenta ai: local config = { {fromPos = {x = 32953, y = 32072, z = 7}, toPos = {x = 32963 y =, 32081, z = 7}, townId = 1}, {fromPos = {x = 32364, y = 32231, z = 7}, toPos = {x = 32374, y = 32243, z = 7}, townId = 2}, {fromPos = {x = 32642, y = 31921, z = 11}, toPos = {x = 32656, y = 31929, z = 11}, townId = 3}, {fromPos = {x = 32356, y = 31775, z = 7}, toPos = {x = 32364, y = 31787, z = 7}, townId = 4}, {fromPos = {x = 32718, y = 31628, z = 7}, toPos = {x = 32736, y = 31639, z = 7}, townId = 5}, {fromPos = {x = 32313, y = 32818, z = 7}, toPos = {x = 32322, y = 32830, z = 7}, townId = 7}, {fromPos = {x = 32590, y = 32740, z = 7}, toPos = {x = 32600, y = 32750, z = 7}, townId = 8}, {fromPos = {x = 33188, y = 32844, z = 8}, toPos = {x = 33201, y = 32857, z = 8}, townId = 9}, {fromPos = {x = 33210, y = 32450, z = 1}, toPos = {x = 33217, y = 32457, z = 1}, townId = 10}, {fromPos = {x = 33208, y = 31803, z = 8}, toPos = {x = 33225, y = 31819, z = 8}, townId = 11}, {fromPos = {x = 32207, y = 31127, z = 7}, toPos = {x = 32218, y = 31138, z = 7}, townId = 12}, {fromPos = {x = 32785, y = 31274, z = 7}, toPos = {x = 32789, y = 31279, z = 7}, townId = 13}, {fromPos = {x = 33018, y = 31514, z = 11}, toPos = {x = 33032, y = 31531, z = 11}, townId = 14}, {fromPos = {x = 33442, y = 31312, z = 9}, toPos = {x = 33454, y = 31326, z = 9}, townId = 28}, {fromPos = {x = 33510, y = 32360, z = 6}, toPos = {x = 33516, y = 32366, z = 6}, townId = 29} } function onUse(cid, item, fromPosition, itemEx, toPosition) local playerPos, isInTemple, temple, townId = getCreaturePosition(cid), false for i = 1, #config do temple = config[i] if isInRange(playerPos, temple.fromPos, temple.toPos) then if getTilePzInfo(playerPos) then isInTemple, townId = true, temple.townId break end end end if not isInTemple then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Try to move more to the center of a temple to use the spiritual energy for a teleport.') return true end setPlayerStorageValue(cid, Storage.AdventurersGuild.Stone, townId) doSendMagicEffect(playerPos, CONST_ME_TELEPORT) local destination = {x = 32210, 32300, 6) doTeleportThing(cid, destination) doSendMagicEffect(destination, CONST_ME_TELEPORT) return true end
  17. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { backToLevel = 8, exp = 4200, redskull = false, battle = false, pz = false, stages = { {resets = 4, level = 350, vip = 330}, {resets = 9, level = 355, vip = 335}, {resets = 14, level = 360, vip = 340}, {resets = 19, level = 365, vip = 345}, {resets = 24, level = 380, vip = 350}, {resets = 29, level = 390, vip = 355}, {resets = 34, level = 410, vip = 360}, {resets = 39, level = 430, vip = 365}, {resets = 44, level = 450, vip = 370} } } function onSay(cid, words, param) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local function setResets(cid, count) setPlayerStorageValue(cid, getPlayerStorageValue(cid, 1020) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "Voce precisa estar sem red skull para resetar.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Voce precisa estar em protection zone para resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce precisa estar sem battle para resetar.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.vip or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "Voce precisa do level " .. resetLevel .. " ou mais para resetar.") end setResets(cid, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `level` = " .. config.backToLevel .. ", `experience` = " .. config.exp .. " WHERE `id` = " .. guid) return true end
  18. db: http://hastebin.com/ludevoxohi.vbs executa isso dps: ALTER TABLE `players` ADD `cast` TINYINT NOT NULL DEFAULT '0', ADD `castViewers` INT( 11 ) NOT NULL DEFAULT '0', ADD `castDescription` VARCHAR( 255 ) NOT NULL
  19. tenta usar essa função com a amount negativa (ex.: -5): function doPlayerAddLevel(cid, amount, round) local experience, level = 0, getPlayerLevel(cid) if(amount > 0) then experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level)) else experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount)) end return doPlayerAddExperience(cid, experience) end
  20. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    erro meu: local config = { backToLevel = 8, exp = 4200, redskull = false, battle = true, pz = false, stages = { {resets = 4, level = 350, vip = 330}, {resets = 9, level = 355, vip = 335}, {resets = 14, level = 360, vip = 340}, {resets = 19, level = 365, vip = 345}, {resets = 24, level = 380, vip = 350}, {resets = 29, level = 390, vip = 355}, {resets = 34, level = 410, vip = 360}, {resets = 39, level = 430, vip = 365}, {resets = 44, level = 450, vip = 370} } } function onSay(cid, words, param) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local function setResets(cid, count) setPlayerStorageValue(cid, getPlayerStorageValue(cid, 1020) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "Voce precisa estar sem red skull para resetar.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Voce precisa estar em protection zone para resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce precisa estar sem battle para resetar.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.vip or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "Voce precisa do level " .. resetLevel .. " ou mais para resetar.") end setResets(cid, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `players` SET `level` = " .. config.backToLevel .. ", `experience` = " .. config.exp .. " WHERE `id` = " .. guid) return true end
  21. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { backToLevel = 8, exp = 4200, redskull = false, battle = true, pz = false, stages = { {resets = 4, level = 350, vip = 330}, {resets = 9, level = 355, vip = 335}, {resets = 14, level = 360, vip = 340}, {resets = 19, level = 365, vip = 345}, {resets = 24, level = 380, vip = 350}, {resets = 29, level = 390, vip = 355}, {resets = 34, level = 410, vip = 360}, {resets = 39, level = 430, vip = 365}, {resets = 44, level = 450, vip = 370} } } function onSay(cid, words, param) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local function setResets(cid, count) setPlayerStorageValue(cid, getPlayerStorageValue(cid, 1020) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "Voce precisa estar sem red skull para resetar.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Voce precisa estar em protection zone para resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce precisa estar sem battle para resetar.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.vip or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "Voce precisa do level " .. resetLevel .. " ou mais para resetar.") end setResets(cid, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `players` SET `level` = " .. config.backToLevel .. ", `experience` = " .. exp .. " WHERE `id` = " .. guid) return true end
  22. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    function getPlayerPoints(cid) local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") local p = Info:getDataInt("premium_points") Info:free() return p end function doPlayerAddPoints(cid, points) local dif = getPlayerPoints(cid) + points if dif >= 0 then db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return true end return false end function doPlayerRemovePoints(cid, points) local dif = getPlayerPoints(cid) - points if dif >= 0 then db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return true end return false end
  23. Fir3element postou uma resposta no tópico em Suporte Tibia OTServer
    tenta ai: local config = { backToLevel = 8, redskull = false, battle = true, pz = false, stages = { {resets = 4, level = 350, vip = 330}, {resets = 9, level = 355, vip = 335}, {resets = 14, level = 360, vip = 340}, {resets = 19, level = 365, vip = 345}, {resets = 24, level = 380, vip = 350}, {resets = 29, level = 390, vip = 355}, {resets = 34, level = 410, vip = 360}, {resets = 39, level = 430, vip = 365}, {resets = 44, level = 450, vip = 370} } } function onSay(cid, words, param) local function getResets(cid) local resets = getPlayerStorageValue(cid, 1020) return resets < 0 and 0 or resets end local function setResets(cid, count) setPlayerStorageValue(cid, getResets(cid) + count) end if config.redskull and getCreatureSkullType(cid) == 4 then return doPlayerSendCancel(cid, "Voce precisa estar sem red skull para resetar.") elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Voce precisa estar em protection zone para resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "Voce precisa estar sem battle para resetar.") end local resetLevel = 0 for x, y in ipairs(config.stages) do if getResets(cid) <= y.resets then resetLevel = isPremium(cid) and y.vip or y.level break end end if getPlayerLevel(cid) < resetLevel then return doPlayerSendCancel(cid, "Voce precisa do level " .. resetLevel .. " ou mais para resetar.") end setResets(cid, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `players` SET `level` = " .. config.backToLevel .. ", `experience` = " .. getExperienceForLevel(config.backToLevel) .. " WHERE `id` = " .. guid) return true end

Informação Importante

Confirmação de Termo