Ir para conteúdo

Pedro.

Membro
  • Registro em

  • Última visita

Tudo que Pedro. postou

  1. adiciona em globa.lua function getBlessingsCost(level) if level <= 30 then return 2000 elseif level >= 120 then return 20000 else return (level - 20) * 200 end end
  2. porém da algum erro no distro?
  3. local config = { -- base vocationId [1] = { -- skillId [SKILL_FIST] = { -- [{skillLevel}] = skillRate [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_CLUB] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_SWORD] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_AXE] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_DISTANCE] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_SHIELD] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_FISHING] = { [{10, 19}] = 10, [{20, 29}] = 5 }, [SKILL_MAGLEVEL] = { [{10, 19}] = 10, [{20, 29}] = 5 } } } --[[ function Vocation.getBase(self) local demotion = self:getDemotion() while demotion do local tmp = demotion:getDemotion() if not tmp then return demotion end demotion = tmp end return self end ]] local function getSkillRate(player, skillId) local targetVocation = config[player:getVocation():getBase():getId()] if targetVocation then local targetSkillStage = targetVocation[skillId] if targetSkillStage then local skillLevel = player:getSkillLevel(skillId) for level, rate in pairs(targetSkillStage) do if skillLevel >= level[1] and skillLevel <= level[2] then return rate end end end end return skillId == SKILL_MAGLEVEL and configManager.getNumber(configKeys.RATE_MAGIC) or configManager.getNumber(configKeys.RATE_SKILL) end function Player:onGainSkillTries(skill, tries) if not APPLY_SKILL_MULTIPLIER then return tries end return tries * getSkillRate(self, skill) end
  4. testa esse aqui, é que uso no meu servidor 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 -- Travel local function addTravelKeyword(keyword, cost, destination) local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage to ' .. keyword:titleCase() .. ' for ' .. cost .. ' gold coins?', cost = cost, discount = 'postman'}) travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = cost, discount = 'postman', destination = destination}) travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true}) end addTravelKeyword('carlin', 110, Position(32387, 31820, 6)) addTravelKeyword('ab\'dendriel', 130, Position(32734, 31668, 6)) addTravelKeyword('edron', 160, Position(33175, 31764, 6)) addTravelKeyword('venore', 170, Position(32954, 32022, 6)) addTravelKeyword('port hope', 160, Position(32527, 32784, 6)) addTravelKeyword('svargrond', 180, Position(32341, 31108, 6)) addTravelKeyword('liberty bay', 180, Position(32285, 32892, 6)) keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To Carlin, Ab\'Dendriel, Edron, Venore, Port Hope, Liberty Bay or Svargrond?'}) npcHandler:setMessage(MESSAGE_GREET, "Welcome on board, |PLAYERNAME|. Where can I {sail} you today?") npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye. Recommend us if you were satisfied with our service.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.") npcHandler:addModule(FocusModule:new())
  5. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    [Frags: 25 - Deaths: 52]. que era pra ser Frags: 25 - Deaths: 52]. ???????????????????
  6. baixando um servidor que tenha, recomendo do maluco gitlab.com/malucooo/Otxserver-Global
  7. tudo que você editar nos samples quando criarem já vai ter, se tu adicionar os sample skill 40, qndo eu criar um char já vai tá igual.
  8. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    em actions, vê o storage que ta no bau, vê no XML qual é o lua, e edita lá.
  9. somente elas poderão equipar o item.
  10. não entendo de derivados, mas isso é o que? items, movements, weapons? se for movements só você setar no xml por exemplo <movevent type="DeEquip" itemid="11410" slot="feet" level="1" event="function" value="onDeEquipItem"/> <movevent type="Equip" itemid="11410" slot="feet" level="1" event="function" value="onEquipItem"> <vocation id="22"/> <vocation id="23"/> <vocation id="24"/> <vocation id="25" showInDescription="0"/> <vocation id="26 showInDescription="0"/> </movevent>
  11. você setou em o string em core.lua?
  12. adicionou corretamente? nao to podendo testar o script
  13. adiciona ai string.split = function(str, sep) local res = {} for v in str:gmatch("([^" .. sep .. "]+)") do res[#res + 1] = v end return res end string.trim = function(str) return str:match'^()%s*$' and '' or str:match'^%s*(.*%S)' end string.starts = function(str, substr) return string.sub(str, 1, #substr) == substr end string.titleCase = function(str) return str:gsub("(%a)([%w_']*)", function(first, rest) return first:upper() .. rest:lower() end) end
  14. Cara, genial pra eu que estou aprendendo lua agora, muitas vezes vejo outros scripts pois não sei ainda aonde usar CID, type, target, essas coisas se um dia vocês quiserem adaptar um pra tfs 1x
  15. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    postei ai, troca esse por aquele eu já adicionei, ou então você mesmo adiciona.
  16. tenta usar outro php, qual a versão do teu site? 0.36, 2012 etc.
  17. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    troca lá 100-compat.lua
  18. cola aqui p mim data/lib/core/string.lua
  19. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    vai em lib/100-compat.lua procura por db.executeQuery ou db.query ou então cola i compat aqui para eu ver.
  20. Pedro. postou uma resposta no tópico em Suporte Tibia OTServer
    posta ai o record.
  21. tem que registrar o evento registerCreatureEvent(cid, "ProtectLevel") <event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/>
  22. local config = { onlypremium = true, -- se precisa ser premium para não perder nada exp = true, -- se ao morrer o jogador irá perder exp skills = true, -- se ao morrer vai perder skills magic = true, -- se vai perder magic level loot = false, -- se ao morrer o jogador irá perder o loot level = 700000 -- até que level irá proteger o player } function onDeath(cid, corpse, deathList) if isPlayer(cid) and getPlayerLevel(cid) <= config.level then if config.onlypremium == true and isPremium(cid) then if config.loot == false then doCreatureSetDropLoot(cid, false) end if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end end end return true end adiciona em creaturescript, e registra em login
  23. config.lua deathLostPercent = 0 ML function onDeath(cid, corpse, deathList) if isPlayer(cid) and getPlayerMagLevel(cid) >= 1 then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end return true end

Informação Importante

Confirmação de Termo