-
Total de itens
512 -
Registro em
-
Última visita
-
Dias Ganhos
16
Tudo que brun123 postou
-
openChannelDialog não é uma função padrão dos servidores, foi uma função adicionada no distro do pda o único jeito de fazer isso aí que você viu no vídeo é baixar o código fonte do seu servidor, adicionar a função (tem um tutorial na área de programação -> códigos prontos) e depois recompilar o servidor e trocar o executável na pasta aí é só usar a script que o pessoal postou aqui se for action, você precisa colocar a tag no actions.xml e a script na pasta actions/scripts/, agora se for movements, tem que colocar a tag no movements.xml e a script no movements/scripts/ o que o slicer falou foi pra você simplesmente tirar um linha no script e colocar uma outra lina no lugar, você precisa de dedos e bloco de notas pra fazer isso, não leva nem 10 segundos, prometo pra você isso não tem nada a ver com creaturescript, então não precisa se preocupar em editar o login.lua
-
resolvido [Encerrado] [Dúvida] Fishing PDA
tópico respondeu ao Gabriel10101 de brun123 em Tópicos Sem Resposta
é porque o servidor usa uma variável do tipo unsigned long int pra armazenar a skill tries que precisa pra certa skill chegar em tal level, e o alcance desse tipo de variável é de 0 até 2^32 - 1, a fórmula pra calcular as tries de um certo level é: TRIES_NO_LEVEL = SKILL_BASE * SKILL_FORMULA^(LEVEL - 11) SKILL_BASE e SKILL_FORMULA são duas propriedades da vocation do player nesse vocations.xml que vocês estão usando, só está definido o SKILL_FORMULA das skills, o valor do SKILL_BASE assume o padrão do servidor quando não definido, no caso do fishing é 20. substituindo o "TRIES_NO_LEVEL" pelo alcance máximo do tipo de variável e usando skill_base como 20 e skill_formula como 3, o level deveria ir só até o 28, depois disso o comportamento é imprevisível obviamente skill_formula não pode ser um número menor que 1, isso faria com que ficasse cada vez mais fácil upar de level, e se for 1, isso faz com que todo level seja necessário o mesmo número de tries para upar skill_base deve ser inteiro e quanto maior, mais difícil de upar a skill também para alterar a base basta fazer assim no xml: <skill fishing="1.3" fishBase="40"/> -
resolvido [Encerrado] [Dúvida] Fishing PDA
tópico respondeu ao Gabriel10101 de brun123 em Tópicos Sem Resposta
quanto maior esse número, mais difícil é de upar se não me engano... -
Em talkaction: function onSay(cid) local function getTime(s) local h = math.floor(s / 3600) local m = math.floor((s - h * 3600 )/ 60) local s = s - h * 3600 - m * 60 return h .. ":" .. m .. ":" .. s end local message = "Você precisa esperar %s para usar novamente." local time = getPlayerStorageValue(cid, 83922) - os.time() local hours = 3 if time > 0 and time < hours * 3600 then return doPlayerSendCancel(cid, message:format(getTime(time))) end setPlayerStorageValue(cid, 83922, os.time() + hours * 3600) return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end pra mudar pra action, basta troca o function onSay por function onUse
-
if getTileInfo(getThingPos(cid)).nologout then -- está em nologout end
-
eita, ta feia a coisa erhaushaue multiplicar por 10 e dividir por 100 é a mesma coisa que dividir por 10 o script do sky mata o player que usar a skill também achei que lua admitisse 0 como false e faltou o not no script do slicer, usa esse aqui: function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target == 0 then return not doPlayerSendCancel(cid, "You need a target.") end if getCreatureHealth(cid) <= getCreatureMaxHealth(cid) * .1 then return not doPlayerSendCancel(cid, "You don't have enough life.") end if getCreatureMana(cid) <= getCreatureMaxMana(cid) * .1 then return not doPlayerSendCancel(cid, "You don't have enough mana.") end local tPos = getThingPos(target) doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, -getCreatureMaxHealth(cid) * .1) doCreatureAddMana(cid, -getCreatureMaxMana(cid) * .1) return true end o player não consegue usar a spell se não tiver mana ou hp pra pagar
-
adiciona isso: if not target then return not doPlayerSendCancel(cid, "You need a target.") end embaixo de: local target = getCreatureTarget(cid)
-
sky, seu loop do for é executado apenas uma vez e a captura é feita incorretamente... o certo seria algo assim: function getAllMonsterNames() local tmp = {} local file = io.open("monsters.xml", "r") for i in file:read("*a"):gmatch("<(.-)>") do local name = i:match('.+name="(.-)".+') if name then table.insert(tmp, name) end end return tmp end mas o problema dessa função é que sempre que um player fizer login, o servidor vai ter que abrir o monsters.xml, fazer um loop considerável e depois fechar o arquivo (coisa que faltou na função) e se vários players logarem ao mesmo tempo, o server pode travar... então o mais correto seria abrir o arquivo apenas uma vez e armazenar os nomes dos monstros lidos e guardar as informações em uma variável que permanece até que o servidor feche, assim o arquivo só será aberto uma vez usa esse script: local xml = io.open(getDataDir().."monster/monsters.xml", "r") local monsters = false if xml then local text = xml:read("*all") xml:close() monsters = {} for monstername in text:gmatch('name="(.-)"') do table.insert(monsters, monstername) end end function onLogin(cid) if monsters and isInArray(monsters, getCreatureName(cid)) then return false end return true end
-
usa essa script: local xml = io.open(getDataDir().."monster/monsters.xml", "r") local monsters = false if xml then monsters = xml:read("*all") xml:close() end function onLogin(cid) print(type(monsters)) print(getDataDir().."monster/monsters.xml") if monsters and monsters:find('name="'..getCreatureName..'"') then return false end return true end vai aparecer 2 mensagens no seu console, me mostra elas
-
ah você usa versão mais antiga, aí complica... testa assim: local xml = io.open(getDataDir().."monster/monsters.xml", "r") local monsters = false if xml then monsters = xml:read("*all") xml:close() end function onLogin(cid) if monsters and monsters:find('name="'..getCreatureName..'"') then return false end return true end
-
tem como bloquear por script, assim: cria um arquivo chamado monstername.lua em data/creaturescripts/scripts e cole isso dentro: function onLogin(cid) local result = doCreateMonster(getCreatureName(cid), getThingPos(cid), false) if tonumber(result) then doRemoveCreature(result) end return not result end agora abra o arquivo creaturescripts.xml (data/creaturescripts) e adicione essa tag: <event type="login" name="CheckMonsterName" event="script" value="monstername.lua"/>
-
não deu pra enteder bem o que era pra ser isso aí, mas tenta assim: function hasWater(cid, percent, item, limit) if percent > (limit or 100) then return false end local pouch = item or getPlayerSlotItem(cid, 10) local ids = {11941, 11943} if isInArray(ids, pouch.itemid) and (pouch.actionid == 0 and 100 or pouch.actionid-100) >= percent then local newtype = (pouch.actionid == 0 and 100 + (limit or 100) or pouch.actionid) - percent if newtype == 100 then doTransformItem(pouch.uid, 11940) end doSetItemActionId(pouch.uid, newtype) return newtype end return false end function onLook(cid, thing, position, lookDistance) if thing.itemid > 1 then local n = hasWater(cid, 0, thing, 200) if n then doPlayerSendTextMessage(cid, 22, (n-100) .. "% of water.") end end return true end
-
existe uma configuração no config.lua que já faz o summon teletransportar pra perto do player, não tinha necessidade de usar essa script, mas eu nunca deletei esse arquivo, só desativei ele
-
é porque a sua função getposbydir modifica o parâmetro em vez de criar novas tabelas, como eu modifiquei essa função eu não tenho esse problema, mas o tfs padrão tem que fazer de outro jeito pra não dar problemas, testa assim: function onCastSpell(cid) local item = 1337 local tempo = 5 * 1000 local efeito_ao_criar = CONST_ME_MAGIC_GREEN local efeito_ao_remover = CONST_ME_POFF for direction = 0, 7 do local position = getPosByDir(getThingPos(cid), direction) doCreateItem(item, position) doSendMagicEffect(position, efeito_ao_criar) end addEvent(function (center, id) for direction = 0, 7 do local position = getPosByDir({x = center.x, y = center.y, z = center.z}, direction) local item = getTileItemById(position, id).uid if item > 1 then doSendMagicEffect(position, efeito_ao_remover) doRemoveItem(item) end end end, tempo, getThingPos(cid), item) return true end
-
bom, testei aqui e funcionou certinho pega esse script abaixo, executa a spell uma vez e olha o console do seu servidor, depois dos itens serem removidos vão aparecer 8 mensagens, aí você me mostra elas: function onCastSpell(cid) local item = 1337 local tempo = 5 * 1000 local efeito_ao_criar = CONST_ME_MAGIC_GREEN local efeito_ao_remover = CONST_ME_POFF for direction = 0, 7 do local position = getPosByDir(getThingPos(cid), direction) doCreateItem(item, position) doSendMagicEffect(position, efeito_ao_criar) end addEvent(function (center, id) print(string.format("Centro: %d/%d", center.x or -1, center.y or -1)) for direction = 0, 7 do local position = getPosByDir(center, direction) local item = getTileItemById(position, id) print(string.format("Dir. % %d/%d / uid: %d", direction, position.x or -1, position.y or -1, item.uid)) if item.uid > 1 then doSendMagicEffect(position, efeito_ao_remover) doRemoveItem(item.uid) end end end, tempo, getThingPos(cid), item) return true end
-
function onCastSpell(cid) local item = 1337 local tempo = 5 * 1000 local efeito_ao_criar = CONST_ME_MAGIC_GREEN local efeito_ao_remover = CONST_ME_POFF for direction = 0, 7 do local position = getPosByDir(getThingPos(cid), direction) doCreateItem(item, position) doSendMagicEffect(position, efeito_ao_criar) end addEvent(function (center, id) for direction = 0, 7 do local position = getPosByDir(center, direction) local item = getTileItemById(position, id).uid if item > 1 then doSendMagicEffect(position, efeito_ao_remover) doRemoveItem(item) end end end, tempo, getThingPos(cid), item) return true end
-
você tem que abrir o seu mapa com algum editor de mapas e colocar o action id dos chãos que vão ativar essa script igual ao actionid que você configurou no movements.xml
-
function onCastSpell(cid, var) local DANOS = 3 -- danos local ATTACKMIN = 250 -- minimo local ATTACKMAX = 400 -- maximo local EFEITO = 30 -- efeito local DIST = 28 -- efeito de distancia local DELAY = 200 -- intervalo entre ataques em ms local target = getCreatureTarget(cid) if target > 0 then local function triggerSpell(caster, enemy, tries) if (tries or 1) <= 0 or not isCreature(caster) or not isCreature(enemy) then return end doTargetCombatAttack(caster, enemy, COMBAT_HOLYDAMAGE, ATTACKMIN, ATTACKMAX, EFEITO) doSendDistanceShoot(getThingPos(caster), getThingPos(enemy), DIST) addEvent(triggerSpell, DELAY, caster, enemy, (tries or 1) - 1) end triggerSpell(cid, target, DANOS) else doPlayerSendCancel(cid, "You need a target.") return false end return true end
-
troca essa linha: function onStepIn(cid, item, position, fromPosition) por essa: function onStepIn(cid, item, position, _, fromPosition)
-
basta trocar essa linha: if(isNumber(param)) then por essa: if tonumber(param) then
-
passive [Encerrado] Passive Illusion
tópico respondeu ao Noninhouh de brun123 em Tópicos Sem Resposta
a real é que faz muito tempo que não mexo com server de pokemon e todo mundo usa uma versão com bastante modificações... então é melhor deixar isso pro slicer mesmo HEAUSHUE pra colocar cooldown adiciona isso embaixo de elseif spell == "..." local storage = 124239 if getPlayerStorageValue(cid, storage) - os.time() > 0 then return end setPlayerStorageValue(cid, storage, os.time() + 6) -
passive [Encerrado] Passive Illusion
tópico respondeu ao Noninhouh de brun123 em Tópicos Sem Resposta
elseif spell == "" then local time = 5 * 1000 local name = getCreatureName(cid) local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off) local newSummon = doSummonMonster(cid, name) if not isCreature(newSummon) then return end setWildPokemonLevel(newSummon, getLevel(cid), status) doTeleportThing(newSummon, getThingPos(cid), false) doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT) addEvent(function(uid) if isCreature(uid) then doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT) doRemoveCreature(uid) end end, time, newSummon) só fazer agora em algum onThink ou onStatsChange pra executar a função docastspell com o nome da skill -
passive [Encerrado] Passive Illusion
tópico respondeu ao Noninhouh de brun123 em Tópicos Sem Resposta
me explica o que ela faz que eu tento fazer -
é, tem que registrar no player, não tinha lido o script, só vi o nome na tag "pokemonidle" e fez sentido ser no summon... enfim, basta usar esse script: local efeito = 1 -- coloque 0 para remover o efeito quando o pokemon teleportar local max = 9 -- distancia max entre o pokemon e o player local function doIncreaseSpeed(cid) if not isCreature(cid) then return true end doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, 2.5*(getCreatureBaseSpeed(cid) + getSpeed(cid))) end function onLogin(cid) registerCreatureEvent(cid, "PokemonIdle") return true end function onThink(cid, interval) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then return true end if #getCreatureSummons(cid) >= 1 and not isCreature(getCreatureTarget(cid)) then if getDistanceBetween(getThingPos(cid), getThingPos(getCreatureSummons(cid)[1])) > max then doTeleportThing(getCreatureSummons(cid)[1], getThingPos(cid), false) doSendMagicEffect(getThingPos(cid), 21) end end return true end e essas tags: <event type="think" name="PokemonIdle" event="script" value="poketele.lua"/> <event type="login" name="PokemonIdleLogin" event="script" value="poketele.lua"/>
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.