-
Por onde começar?
Na verdade é simples e facil haha, mas rápido nem pensar. Tu deve começar em qualquer linguagem pela lógica de programação, tendo uma grande noção dela vc embarca em qualquer linguagem inclusive Lua (e C++ das sources), não ligue pra erros de sintax, acontece toda hora, por via das duvidas use uma boa IDE como VS Code. Após saber a lógica vai modificando alguns scripts e testando funções ja imbutidas por outros programadores, exemplo:
-
-
(Resolvido)Script DoubleExp
Nao lembro das sintax de lua, acho queria +/- isso local oldRates = getPlayerRates(cid) -- Monday = Segunda -- Tuesday = Terça -- Wednesday = Quarta -- Thursday = Quinta -- Friday = Sexta -- Saturday = Sabado -- Sunday = Domingo function onLogin(cid) DoubleDays = {"Saturday", "Sunday"} isInArray(DoubleDays, os.date("%A")) then if (oldRates => 2) then doPlayerSetRate(cid, SKILL__LEVEL, 4.0) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Double XP]\nHoje estamos em evento de Double XP!\nAproveite.") else doPlayerSetRate(cid, SKILL__LEVEL, 2.0) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Double XP]\nHoje estamos em evento de Double XP!\nAproveite.") end return true end
-
Rates/ Stages Skill
.
-
mysql error tile_items
se esse erro ai ta aparecendo no seu console precisa modificar o script que esta setando a sql, ta errado, ta mandando 6 atributos quando deveriam ser 7 INSERT INTO `tile_items` (`tile_id`, `world_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`, `serial`) VALUES (226, 0, 1, 0, 1998, 1, '', 'IWEOF-HIM51-DOMBF-T7PC1'), (226, 0, 2, 0, 2160, 50, '2', 'BGHF5-20X3H-2MF5D-JNK8H'), (226, 0, 3, 0, 2673, 100, 'd', 'N07YM-OTI37-K3PR8-JUJ7Y'), (226, 0, 4, 1, 2673, 94, '^', ''), (226, 0, 5, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 6, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 7, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 8, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 9, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 10, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 11, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 12, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 13, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 14, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 15, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 16, 1, 2673, 100, 'dÿÿÿÿ', ''), (226, 0, 17, 1, 2673, 100, 'dÿÿÿÿ', '')
-
[AJUDA] Mudar 3 coisas na distro.
Eu creio que a moeda basta você alterar no próprio script do NPC, cada um pode aceitar uma moeda (item) diferente também.
-
Como faz o Script de captura de Pokemon lendario? tem como alguem fazer pra mim?
Olá, experimente mudar chance="0" para chance="1", ja deve bastar. Se tem curiosidade de saber sobre a % de captura no seu servidor verifique o arquivo catch.lua
-
Spells que so garra em monstro (Suporte)
local water = {490, 491, 492, 493} local combat = createCombatObject() local meteor = createCombatObject() setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(meteor, COMBAT_PARAM_EFFECT, 31) setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, 0, -5000, 0, -8000) local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, 5000) setConditionFormula(stun, -0.1, 0, -0.1, 0) setCombatCondition(meteor, stun) local meteor_water = createCombatObject() setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, 0, -5000, 0, -8000) combat_arr = { {0, 0, 0,}, {0, 1, 0,}, {0, 0, 0,}, } local combat_area = createCombatArea(combat_arr) setCombatArea(combat, combat_area) local function meteorCast(p) doCombat(p.cid, p.combat, positionToVariant(p.pos)) end local function stunEffect(cid) doSendMagicEffect(getThingPos(cid), CONST_ME_STUN) end function onTargetTile(cid, pos) if (math.random(0, 0) == 0) then local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}) if (isInArray(water, ground.itemid) == TRUE) then local newpos = {x = pos.x - 0, y = pos.y - 0, z = pos.z} doSendDistanceShoot(newpos, pos, 26) addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water}) else local newpos = {x = pos.x - 0, y = pos.y - 0, z = pos.z} doSendDistanceShoot(newpos, pos, 26) addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor}) end end end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) if (isMonster(target)) then return doCombat(cid, combat, var) else doPlayerSendTextMessage(cid,20,'Uso restrito em players.') end
-
Encrypton reagiu a uma resposta no tópico: [10.98][TFS 1.2] PokeDash Pota v1.0 - Server, Client, Sources, Site, Map editor e Item editor
-
Ajuda simples de sistema de lenhador *
as arvores do mapa são do ID 13048? Caso não forem é só adicionar o ID do itemID que esta no remeres condizente a todas arvores que deverão ser cortadas no mapa
-
Ajuda simples de sistema de lenhador *
local config = { item = {13048}, -- Itens que poderão ser cortados chance = 70, -- Chance de cortar (1 a 100) madeiras = {26381, 2674}, -- Itens que o player poderá ganhar transformItem = 26147, -- Item o qual a árvore será transformado texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore time = 1, -- Minutos para a arvore crescer novamente --outfit = {[0] = 0, [1] = 0}, -- Outfits female e male --out_time = 0 -- Tempo em segundos que a outfit estará trocada. } local function checkMove(uid) if isPlayer(uid) then doCreatureSetNoMove(uid, FALSE) end end local function Arvore(pos, t) doCleanTile(pos) doCreateItem(config.transformItem, 1, pos) addEvent(function() doCleanTile(pos) doCreateItem(t, 1, pos) end, config.time * 60 * 1000) end function onUse(cid, item, fromPosition, itemEx, toPosition) local text = config.texts[math.random(1, #config.texts)] local t = nil if isInArray(config.item, itemEx.itemid) then --doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000) doCreatureSetNoMove(cid, TRUE) --addEvent(checkMove, config.out_time * 1000, cid) if math.random(1,100) >= config.chance then local wood = math.random(3, 7) local prem = config.madeiras[math.random(1, #config.madeiras)] doPlayerAddItem(cid, prem, wood) doSendMagicEffect(toPosition, 1) doSendMagicEffect(fromPosition, 1) doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".") doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE) t = itemEx.itemid Arvore(toPosition, t) else doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE) doSendMagicEffect(toPosition, 1) doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE) end return true end end
-
(Resolvido)barqueiro com destino aleatorio
Faz muito tempo que não programo lua, mas você pode usar algo parecido com isso math.randomseed(0) local function SORTEIO() N = math.random() return N end for I = 1, 5 do X = SORTEIO() end if X == 1 then caminho = 'x=119, y=51, z=6' elseif X == 2 then caminho = 'x=143, y=170, z=6' end ai cada destino novo é só você adicionar um novo elseif e mudar as coordenadas da variavel caminho Em seguida, subtitui os caminhos reais que devem ser aleatorios dentro do seu script, exclui os X= 109230912 Y= 21938123 Z = 12938912 pelo valor da variavel caminho
-
(Resolvido)Ajuda simples de sistema de PET
Você tentou usar fora da conta god?
-
(Resolvido)Ajuda simples de sistema de PET
function onUse(cid, item, frompos, item2, topos) local exstorage = 45718 local time = 0*60 if exhaustion.check(cid, exstorage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você precisa esperar antes de usar novamente.") return TRUE end local dolls = { [2155] = {pet = "Pet Dalmata"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR [2277] = {pet = "Pet Bode"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR } local go = dolls[item.itemid] local summon = getCreatureSummons(cid) local waittime = 60 -- Tempo de exhaustion em segundos local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc... if exhaustion.check(cid, strtime) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, strtime) .. " segundos para usar esse item novemente.") return true end --------------------------------------------------- if not (getTilePzInfo(getCreaturePosition(cid))) then if #summon >= 1 then for _, pid in ipairs(summon) do doRemoveCreature(pid) doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1) -- MENSAGEM AO REMOVER O PET exhaustion.set(cid, strtime, waittime) -- checar time end return true end if item.itemid == 2155 then -- ID DO ITEM doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) -- MENSAGEM AO SUMONAR O PET doSendAnimatedText(getPlayerPosition(cid), "!!!", 180) end if item.itemid == 2277 then -- ID DO ITEM doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) -- MENSAGEM AO SUMONAR O PET doSendAnimatedText(getPlayerPosition(cid), "!!!", 180) end else doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) return true end end
-
Ajuda pfv!!!!!!!!!!!!!!!!!!!!!!!
o jovem... plmds... eu coloquei o tibia.exe pra dowload ali em cima E só substituir o arquivo...
-
Ajuda pfv!!!!!!!!!!!!!!!!!!!!!!!
o .pic e .spr não tem relação com seu erro, usando o novo client que enviei e alterando os dados no config.lua conforme falei alguns tópicos a cima deve funcionar, a ligação de client x servidor basicamente são só nesses 2 arquivos
-
movements duplicado
Solta os 2 script ai que eu junto eles pra vc