-
Total de itens
322 -
Registro em
-
Última visita
-
Dias Ganhos
7
Tudo que miguel223 postou
-
Crie um arquivo chamado spear.lua, em creaturescripts/scripts, e adicione: function onAttack(cid, target) if isPlayer(cid) and isCreature(target) then if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == 2389 then if getPlayerStorageValue(cid, 12432) <= 5 then setPlayerStorageValue(cid, 12432, getPlayerStorageValue(cid, 12432) + 1) else doPlayerRemoveItem(cid, 2389, 1, CONST_SLOT_RIGHT) setPlayerStorageValue(cid, 12432, 0) doCreateItem(2389,1,getCreaturePosition(target)) end end if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2389 then if getPlayerStorageValue(cid, 12432) <= 5 then setPlayerStorageValue(cid, 12432, getPlayerStorageValue(cid, 12432) + 1) else doPlayerRemoveItem(cid, 2389, 1, CONST_SLOT_LEFT) setPlayerStorageValue(cid, 12432, 0) doCreateItem(2389,1,getCreaturePosition(target)) end end end end return true end Em login.lua, adicione: registerCreatureEvent(cid, "spear") Em creaturescripts.xml, adicione: <event type="attack" name="spear" event="script" value="spear.lua"/> OBS: gostei desse seu pedido, mó nostalgia haha
-
Em actions.xml, adicione a seguinte linha: <action itemid="7716" script="regitem.lua"/> Em actions/scripts/, crie um arquivo chamado regitem.lua e adicione: function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 12543) <= os.time() then setPlayerStorageValue(cid, 12543, os.time() + 10*60) setPlayerStorageValue(cid, 12544, 1) doPlayerSendTextMessage(cid, 22, "Voce usou um regeneration item. Durante 10 min, voce invocara forcas e, depois, restaurara sua vida e mana maximas. Ate la, aguarde.") doRemoveItem(item.uid, 1) doCreateItem(7717, 1, fromPosition) else doPlayerSendCancel(cid, "Voce ainda esta invocando forcas jogador. Nao podera usar outro regeneration item ate acabar esta invocacao.") end return true end Em creaturescripts/scripts/, crie um arquivo chamado regitem.lua e adicione:
-
Outra opçao seria a seguinte: local lever = { [7045] = {30,30,{2160}} } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPoints(cid) < lever[item.actionid][1] then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.") end removePoints(cid,lever[item.actionid][1]) local add = (lever[item.actionid][2]*86400) if (db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") :getDataInt("vip_time")) > os.time()) then db.executeQuery("UPDATE `accounts` SET `vip_time` = 'vip_time + ".. add .. "' WHERE `accounts`.`id`= " .. getPlayerAccountId(cid) .. "") setPlayerStorageValue(cid, 85258, (db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") :getDataInt("vip_time")) setPlayerStorageValue(cid, 12532, 1) else db.executeQuery("UPDATE `accounts` SET `vip_time` = '".. os.time() + add .. "' WHERE `accounts`.`id`= " .. getPlayerAccountId(cid) .. "") setPlayerStorageValue(cid, 85258, (db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") :getDataInt("vip_time")) setPlayerStorageValue(cid, 12532, 1) end local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") for _, items in pairs(lever[item.actionid][3]) do doPlayerAddItem(cid,items,1) end return trueend E, em creaturescripts/scripts, criando um arquivo de nome chestlever.lua, adicionando: function onLogin(cid) if (db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") :getDataInt("vip_time")) > os.time()) then setPlayerStorageValue(cid, 85258, (db.getResult("SELECT `vip_time` FROM `accounts` WHERE `accounts`.`id` = ".. getPlayerAccountId(cid) ..";") :getDataInt("vip_time")) setPlayerStorageValue(cid, 12532, 1) end return true end function onThink(cid, interval) if getPlayerStorageValue(cid, 12532) >= 1 then if getPlayerStorageValue(cid, 85258) <= os.time() then doTeleportThing(cid, {x= ,y=, z=}) setPlayerStorageValue(cid, 12532, 0) doPlayerSendTextMessage(cid, 22, "Sua vip acabou") end end return true end Em creaturescripts.xml, adicione: <event type="login" name="chestlever" event="script" value="chestlever.lua"/> <event type="think" name="chestlevert" event="script" value="chestlever.lua"/> Em login.lua, adicionando: registerCreatureEvent(cid, "chestlever") registerCreatureEvent(cid, "chestlevert") Dessa forma, todos os chars terão automaticamente o storage. Sem façanhas de precisar logar em 1 q ja tinha. ACTIONID PARA TILE VIP(entrada da vip - usar a action id 12532 no piso/tp): Crie um arquivo em movements/scripts chamado tilevipe.lua e adicione: function onStepIn(cid, item, pos) if getPlayerStorageValue(cid, 12532) >= 1 then doPlayerSendTextMessage(cid, 22, "Bem-vindo a vip, jogador") else return false doPlayerSendCancel(cid, "Voce nao e vip") end return true end Em movements.xml, adicione: <movevent event="StepIn" actionid="12532" script="tilevipe.lua" />
-
O problema eh que ele nao disse q ja tem o script. Então, voce tem q considerar q ele so tem a ideia ne... Mas a intenção foi boa, ta valendo
-
Se pegar, agora eu quero o rep pra mim kkk Para dar menos lag, se pode também substituir function onThink(cid, interval) por function onLogin(cid) Dai o event type se altera pra login tbm. Como funfa, em tese: toda x q o player entrar num personagem, se tiver vip, todos os chars da conta passarão a ter. O bom eh q se criar char novo, pega no char novo tbm, só eh preciso entrar num char q tenha a vip pra q o script se ative.
-
local lever = { [7045] = {30,30,{2160}} } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPoints(cid) < lever[item.actionid][1] then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.") end removePoints(cid,lever[item.actionid][1]) local add = (lever[item.actionid][2]*86400) if getPlayerStorageValue(cid, 85258) > os.time() then setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid) + add) else setPlayerStorageValue(cid, 85258, os.time() + add) end local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") for _, items in pairs(lever[item.actionid][3]) do doPlayerAddItem(cid,items,1) end return true end Em creaturescripts/scripts/, crie um arquivo de nome leverchest.lua e adicione: function onThink(cid, interval) if getPlayerStorageValue(cid, 85258) > os.time() then setPlayerStorageValue(getPlayersByAccountId(getPlayerAccountId(cid)), 85258, getPlayerStorageValue(cid, 85258)) end return true end Em creaturescripts.xml, adicione: <event type="think" name="leverchest" event="script" value="leverchest.lua"/> Em login.lua, registre o evento "leverchest"
-
Ok, aguarde, o problema ta no chest mesmo, vo tentar achar o bug.
-
Tente adicionar isso em lib/functions.lua: function getPlayersByAccount(id)local f = db.getResult("SELECT `id` FROM `players` WHERE `account_id` = "..id..";")local players = {}if f:getID() ~= -1 thenrepeattable.insert(players, f:getDataInt("id"))until not f:next()f:free()endreturn playersend
-
Sua resposta está vaga. Só scripters conseguem entendê-la.
-
Crie um arquivo em spells/scripts de nome transformar.lua e coloque: function onCastSpell(cid, var) doSendMagicEffect(getPlayerPosition(cid), ID EFFECT) doPlayerSetOutfit(cid,LOOKTYPE) end Em spells.xml, adicione: <instant name="Transformation" words="transformar" lvl="55" mana="770" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="transformar.lua"></instant>
-
Ta bem confuso esse script ai, mas posso tentar te ajudar, para voce conseguir fazer sozinho os outros depois: (essa eh a parte que esta o problema) Ali em azul, coloque > os.time() Ali em amarelo, coloque os.time() + 1*24*60*60 Ou seja, to colocando um valor padrao(os.time()) e adicionando o tempo(em segundos) de um dia. Se ainda tiver tempo, fala q a quest ja ta feita. Se tiver só o valor, eh pq o tempo ja passou e voce pode fazer de novo.
-
Ele escreveu "sid" ao inves de "cid". Tenta de novo, fazendo essa alteração. EDIT: acabei de ver q "sid" esta certo, esquece kkk Talvez assim funfe: (se funfar, da o rep pro rapaz ai de cima, so tirei o "Id" do "getPlayersByAccount" local lever = { [7045] = {30,30,{2160}}}function onUse(cid,item,fromPosition,itemEx,toPosition) if getPoints(cid) < lever[item.actionid][1] then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.") end removePoints(cid,lever[item.actionid][1]) local add = (lever[item.actionid][2]*86400) local sid = getPlayersByAccount(getPlayerAccountId(cid)) setPlayerStorageValue(sid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add)) local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") for _, items in pairs(lever[item.actionid][3]) do doPlayerAddItem(cid,items,1) end return trueend
-
action SCRIPT para CheckPoint de teleports
tópico respondeu ao matheusagropassos de miguel223 em Actions e Talkactions
Em movements.xml, adicione: <movevent event="StepIn" itemid="ID DO TP" script="checkpoint.lua" /> Bom, explicando: No tp que leva a quest, coloque action id 3000 no primeiro checkpoint coloque action id 3001 no segundo checkpoint coloque action id 3002 no terceiro checkpoint coloque action id 3003 no tp q leva a sala de premio coloque action id 3004 nas coordenadas: inicio= local de inicio da quest firstcheck = local para onde o primeiro checkpoint leva, ou seja, pra segunda parte da quest ... fim = local da sala de premio OBS: bugo o post de cima, tive q postar outro OBS2: coloquei "fimcheck" ali no fim do script, eh só "fim" -
action SCRIPT para CheckPoint de teleports
tópico respondeu ao matheusagropassos de miguel223 em Actions e Talkactions
Em movements/scripts, crie um arquivo chamado checkpoint.lua e adicione: function onStepIn(cid, item, position, fromPosition) local inicio = {x=, y=, z=} local firstcheck = {x=, y=, z=} local secondcheck = {x=, y=, z=} local thirdcheck = {x=, y=, z=} local fim = {x=, y=, z=} if(item.actionid) == 3000 then if getPlayerStorageValue(cid, 3000) <= 0 then doTeleportThing(cid, inicio) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta no inicio da quest. Passe pelos checkpoints dentro dela para ir direto ao ponto de parada.") end if getPlayerStorageValue(cid, 3000) == 1 then doTeleportThing(cid, firstcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na segunda parte da quest, ja que pegou o primeiro checkpoint! Boa sorte.") end if getPlayerStorageValue(cid, 3000) == 2 then doTeleportThing(cid, secondcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na terceira parte da quest, ja que pegou o segundo checkpoint! Boa sorte.") end if getPlayerStorageValue(cid, 3000) == 3 then doTeleportThing(cid, thirdcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na quarta parte da quest, ja que pegou o terceiro checkpoint! Boa sorte.") end if getPlayerStorageValue(cid, 3000) == 4 then doTeleportThing(cid, fim) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na sala de premio da quest, pois ja a terminou!") end end if(item.actionid) == 3001 then setPlayerStorageValue(cid, 3000, 1) doTeleportThing(cid, firstcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na segunda parte da quest, ja que pegou o primeiro checkpoint! Boa sorte.") end if(item.actionid) == 3002 then setPlayerStorageValue(cid, 3000, 2) doTeleportThing(cid, secondcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na terceira parte da quest, ja que pegou o segundo checkpoint! Boa sorte.") end if(item.actionid) == 3003 then setPlayerStorageValue(cid, 3000, 3) doTeleportThing(cid, thirdcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Voce esta na quarta parte da quest, ja que pegou o terceiro checkpoint! Boa sorte.") end if(item.actionid) == 3004 then setPlayerStorageValue(cid, 3000, 4) doTeleportThing(cid, fimcheck) doSendMagicEffect(getPlayerPosition(cid), 12) doPlayerSendTextMessage(cid, 22, "Parabens! Voce esta na sala de premio, por concluir a quest!!!") end return true end -
function onKill(cid, target) local config = { monstername = "Ferumbras" } if getCreatureName(target) == config.monstername then local catuid = getGlobalStorageValue(tonumber(target)) if catuid >= 19 then return TRUE else return false setGlobalStorageValue(tonumber(target),(catuid+1)) local maxhealth = getCreatureMaxHealth(target) doCreatureAddHealth(target, maxhealth) doSendMagicEffect(getCreaturePosition(target),49) end end return true end
-
Vamos la: Crie um arquivo chamado mountchest.lua em actions/scripts e adicione: function onUse(cid, item, toPosition, itemEx, fromPosition) if(item.actionid == 12663) then if getPlayerStorageValue(cid, 13456) <= 0 then doPlayerAddMount(cid, ID DA MOUNT) doPlayerSendTextMessage(cid, 22, "Voce recebeu a NOME DA MONTARIA mount. Parabens!") setPlayerStorageValue(cid, 12456, 1) else doPlayerSendTextMessage(cid, 22, "Voce ja abriu este bau, jogador.") end end return true end Em actions.xml, adicione: <action actionid="12663" script="mountchest.lua"/>
-
Olá, galera do Xtibia! Estou procurando um parceiro para abrir um baiak (já pronto) hard e bem melhor do que os atuais. No primeiro mês, eu entro com o OT e o parceiro com o dinheiro do host+domínio (somando tudo, o valor gira em torno de 110 reais). Entrar em contato com: miguel_quessada (skype)
-
Entendi, vlw as dicas, se quiser me add no skype pra poder me ajudar com a estrutura dos scripts, é miguel_quessada. Eu sei mexer, mas aprendi sozinho, então normalmente não uso uma estrutura "correta".
-
retired
-
Ok, mas eu ja testei. Pode ficar sussa. Se quiser, altera o 24*60*60*1000 para 10*1000 (10 segundos) e da uma olhada, é mais fácil. Dai depois vc volta o valor inicial (24 horas).
-
Sim, me toquei agora. Atualizei o arquivo para function onTarget. Testa ai. OBS; o comando desativa ataques contra você, não o seu ataque. Todos os players da guild devem dar !attackme off para não serem atacados.
-
[Encerrado] Barra de Status "Stamina"
tópico respondeu ao Bndeir de miguel223 em Tópicos Sem Resposta
Existe o comando getPlayerStamina(cid) <=> XXXX e o comando doPlayerSetStamina(cid, XXXX). A barra já é funcional, basta você usar esses comandos citados para editá-la. -
erro [Encerrado] [AJUDA] Servidor Fechando Sozinho
tópico respondeu ao czxale de miguel223 em Tópicos Sem Resposta
Erros com spells que não encontram criatura são normais. Não acho que seja isso que esteja derrubando seu servidor. Tente usar o Laatido no seu distro e também um anti-nuker (provavelmente é alguma incompatibilidade entre o distro e seu sistema operacional ou algum sobrecarregamento por ataque-DDos ou por falta de memória ram do PC).
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.