-
Total de itens
2553 -
Registro em
-
Última visita
-
Dias Ganhos
73
Tudo que zipter98 postou
-
Por padrão, não há como configurar na tag condições envolvendo outras skills, como as citadas por você. Apesar de ser possível mudar isso nas sources do servidor, a opção mais fácil é no próprio código Lua, usando a seguinte função: getPlayerSkillLevel(cid, skillid) Exemplo de uso: if getPlayerSkillLevel(cid, SKILL_SWORD) < 10 then return doPlayerSendCancel(cid, "Você não pode usar esta spell pois seu nível em sword é abaixo de 10.") end OBS: Você deve usar esta condição abaixo do callback onCastSpell.
-
Veja meu comentário neste tópico.
-
Troque: if not look then doSetItemAttribute(pb,"addon",0) return false end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) return true end por: if not look then doSetItemAttribute(pb,"addon",0) end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end
-
Uhum, editado.
-
local options = { --["option"] = key, --Ex.: ["task_1"] = 9230, ["task_2"] = 9321, ["quest"] = 9322, } local choose_more_times = true --True se puder escolher mais de uma opção, false caso contrário. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) msg = msg:lower() if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "quest") or msgcontains(msg, "help") or msgcontains(msg, "options") then local option_table = {} for option, key in pairs(options) do if not choose_more_times and getPlayerStorageValue(cid, key) > -1 then return selfSay("You already have chosen your option.", cid) end option_table[#option_table + 1] = option end selfSay("I have "..#option_table.." options for you. Which one do you choose? {"..table.concat(option_table, ",").."}", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if options[msg] then selfSay("Ok, you chose "..msg.."!", cid) setPlayerStorageValue(cid, options[msg], 1) talkState[talkUser] = 0 else selfSay("I didn't give you this option. Please, tell me a valid one.", cid) end else selfSay("Sorry, I didn't understand what you said.", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Uhum, creatureevent editado.
-
@Martelix O único problema no seu código é a comparação de tabelas através do sinal de igualdade não ser possível. @topic local positions = { wallPos = {x = x, y = y, z = z}, --Posição da parede. toPos = {x = x, y = y, z = z} --Para onde o jogador será teleportado. } function onUse(cid, item, fromPosition, itemEx, toPosition) if toPosition.x == positions.wallPos.x and toPosition.y == positions.wallPos.y and toPosition.z == positions.wallPos.z then doPlayerSendTextMessage(cid, 27, "You used your "..getItemNameById(item.itemid).." in a "..getItemNameById(itemEx.itemid).." and was teleported.") doTeleportThing(cid, positions.toPos) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Use it in the correct wall.") end return true end Tag: <action itemid="5468" event="script" value="nome_do_arquivo.lua"/>
-
Um amigo me pediu este sisteminha alguns dias atrás. Como poderá ver, é algo bem simples. Entretanto, ele pode conflitar com outras mudanças de outfit que o pokémon venha sofrer. Para evitar isso, você terá de fazer algumas mudanças adicionais, explicadas adiante. Primeiramente, em algum arquivo da lib: outfits_order = { --["nome_do_pokemon"] = {outfit1, outfit2, outfit3, ...}, } function doTradeOutfit(cid, index) if not isSummon(cid) then return true end local outfit = outfits_order[getCreatureName(cid)] if not outfit[index] then index = 1 end doSetCreatureOutfit(cid, {lookType = outfit[index]}, -1) addEvent(doTradeOutfit, 200, cid, index + 1) end As outfits devem ser configuradas na ordem em que serão trocadas. O resto dependerá de onde a função será chamada. Se a animação do pokémon começar logo após ele ter sido chamado da pokébola, então, em goback.lua (data/actions/scripts): Abaixo de: local pk = getCreatureSummons(cid)[1] if not isCreature(pk) then return true end Coloque: if outfits_order[getCreatureName(pk)] then doTradeOutfit(pk, 1) end Se formos seguir a lógica da gif demonstrada, a função deveria ser chamada após a mega evolução, o que dependeria de como o sistema usado por você foi escrito. Usando o meu, o processo seria o seguinte: Em pokemon moves.lua (data/lib), no código da spell Mega Evolution: Abaixo de: adjustStatus(newPoke, ball, true, false) coloque: if outfits_order[getCreatureName(newPoke)] then doTradeOutfit(newPoke, 1) end Caso os pokémons que façam parte do sistema de mudança constante de outfit possam ter sua looktype alterada de alguma maneira durante o jogo (por exemplo, um Mega Charizard X usando Outrage ou uma Rapidash usando Blue Flames), você deverá fazer algumas pequenas mudanças. Troque a função que passei anteriormente por essa: function doTradeOutfit(cid, index) if not isSummon(cid) then return true end local outfit = outfits_order[getCreatureName(cid)] if not getCreatureCondition(cid, CONDITION_OUTFIT) or isInArray(outfit, getCreatureOutfit(cid).lookType) then if not outfit[index] then index = 1 end doSetCreatureOutfit(cid, {lookType = outfit[index]}, -1) end addEvent(doTradeOutfit, 200, cid, index + 1) end Depois, no código de todos os possíveis fatores que possam mudar a outfit dos pokémons participantes do sistema, acima da linha responsável pela alteração na looktype: doSetCreatureOutfit(...) Coloque isso: if getCreatureCondition(cid, CONDITION_OUTFIT) then doRemoveCondition(cid, CONDITION_OUTFIT) end Sinceramente, acho que você só terá de fazer isso em pouquíssimos códigos. Por gentileza, poste um feedback do sistema. Assim, saberei se devo ou não mover o tópico.
-
pedido [Encerrado] (Ajuda) system Evoluçao PDA 2.9
tópico respondeu ao EngineerPK de zipter98 em Tópicos Sem Resposta
Tópico Movido Este tópico foi movido de "OTServ → Suporte → Suporte Scripting" para "OTServ → Suporte → Suporte Servidores derivados". -
Epa, jurei ter lido que a vocação iria trocar, não que o jogador seria promovido. Corrigido.
-
NPC: Creatureevent (data/creaturescripts/scripts): local prom_lv, toPos = 2, {x = x, y = y, z = z} --Respectivamente, nível da promoção e posição para onde o jogador será teleportado quando a premium acabar. function onLogin(cid) local prem_days = getPlayerPremiumDays(cid) if prem_days > 0 and getPlayerPromotionLevel(cid) ~= prom_lv then doPlayerSetPromotionLevel(cid, prom_lv) elseif prem_days == 0 and getPlayerPromotionLevel(cid) == prom_lv then doPlayerSetPromotionLevel(cid, prom_lv - 1) doTeleportThing(cid, toPos) end return true end Tag: <event type="login" name="checkVocationPremium" event="script" value="nome_do_arquivo.lua"/>
-
pedido Só pode usar o comando com certa storage
pergunta respondeu ao Gabrielkss de zipter98 em Scripts
Tópico movido para dúvidas / pedidos resolvidos. -
Como a explicação ficou meio vaga, fiz da maneira que entendi. local itemid, toPos = xxx, {x = x, y = y, z = z} --Respectivamente, ID da parede e para onde o jogador será teleportado. function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemid then doPlayerSendTextMessage(cid, 27, "You used your "..getItemNameById(item.itemid).." in a "..getItemNameById(itemid).." and was teleported.") doTeleportThing(cid, toPos) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Use it in the correct wall.") end return true end
-
Tópico Movido Este tópico foi movido de "Xtibia.com → Atendimento → Feedback" para "OTServ → Suporte → Suporte Programação".
-
onTarget também executado por monstros
tópico respondeu ao zipter98 de zipter98 em Linguagens de Programação
Se a storage for alterada durante o "processo", o servidor cai. Para evitar isso, vejam a correção que enviei alguns comentários acima para o nociam. Troque a linha responsável pela modificação na storage por este código: local name = "monster_name" --Nome do monstro. function Substitute(cid) for _, pid in pairs(getSpectators(getThingPos(cid), 8, 8)) do if isMonster(pid) and getCreatureName(pid) == name then local healthNow, posNow = getCreatureHealth(pid), getThingPos(pid) doRemoveCreature(pid) local newMonster = doCreateMonster(name, posNow) doCreatureAddHealth(newMonster, -(getCreatureMaxHealth(newMonster) - healthNow)) end end end setPlayerStorageValue(cid, storage, valor) Substitute(cid) -
Tópico Movido Este tópico foi movido de "OTServ → Anúncio de OTservers → Servidores Derivados" para "OTServ → Downloads → Servidores → Servidores derivados → Sprites de servidores derivados".
-
Tópico Movido Este tópico foi movido de "OTServ → Anúncio de OTservers → Servidores Derivados" para "OTServ → Downloads → Servidores → Servidores derivados → Sprites de servidores derivados".
-
Tópico movido para dúvidas / pedidos resolvidos.
-
elseif spell == "Mamaragan" then local ret = {} ret.id = 0 ret.cd = 9 ret.eff = 136 ret.check = 0 ret.spell = spell ret.cond = "Stun" local pos = getThingPosWithDebug(cid) local areas = {rock1, rock2, rock1, rock3, rock1, rock4, rock1, rock5} for i = 0, 7 do addEvent(doMoveInArea2, i*320, cid, 170, areas[i+1], ELECTRICDAMAGE, min, max, spell, ret) addEvent(doMoveInArea2, i*330, cid, 170, areas[i+1], ELECTRICDAMAGE, 0, 0, spell) end
-
[Encerrado] Erro Script waterfall.lua (Cyan)
tópico respondeu ao Kalashnikov Jr de zipter98 em Tópicos Sem Resposta
Tópico Movido Este tópico foi movido de "OTServ → Scripting → Scripts Prontos → Outros" para "OTServ → Suporte → Suporte Servidores derivados". -
dúvida Effect diferente para pokémons diferentes
pergunta respondeu ao Rumplestiltiskin de zipter98 em Scripts
Tópico movido para dúvidas / pedidos resolvidos. -
Eu não dei ideia alguma.
-
Tópico Movido Este tópico foi movido de "OTServ → Downloads → Servidores → Servidores → OTserv 8.6x e 8.7x" para "OTServ → Downloads → Mapas → Aprovados → Mapas 8.6x e 8.7x".
-
É, imaginei que isso fosse acontecer. Editei meu comentário anterior com as correções (tanto na modificação do NPC quanto no creatureevent).
-
No código do NPC, troque: local stoTime = 96588 local stoKill = 96589 local stoName = 96590 por: local stoTime = 96586 local stoKill = 96585 local stoName = 96587 E, para evitar futuros erros, troque seu creatureevent por este: local function isSummon(cid) if not isCreature(cid) then return false end if getCreatureMaster(cid) ~= cid then return true end return false end function onDeath(cid, corpse, deathList) local stoTime = 96586 local stoKill = 96585 local stoName = 96587 local task = { ["dragon"] = {kill = "Dragon", qnt = 1500, exp = 1000000}, ["dragon lord"] = {kill = "Dragon Lord", qnt = 1000, exp = 800000}, ["hydra"] = {kill = "Hydra", qnt = 800, exp = 700000}, ["frost dragon"] = {kill = "Frost Dragon", qnt = 600, exp = 500000}, ["dragon guardian"] = {kill = "Dragon Guardian", qnt = 500, exp = 400000}, ["thunder dragon"] = {kill = "Thunder Dragon", qnt = 400, exp = 300000}, ["multi"] = {kill = "Multi", qnt = 600, exp = 200000}, ["demodras"] = {kill = "Demodras", qnt = 300, exp = 200000}, } for a = 1, #deathList do local pk = deathList[a] local myTask = task[string.lower(getPlayerStorageValue(pk, stoName))] local left = math.ceil((getPlayerStorageValue(pk, stoTime) - os.time())/(24 * 60 * 60)) if myTask and getCreatureName(cid) == getPlayerStorageValue(pk, stoName) and not isSummon(cid) then if left > 0 and getPlayerStorageValue(pk, stoKill) > 0 then setPlayerStorageValue(pk, stoKill, getPlayerStorageValue(pk, stoKill) - 1) local sto = getPlayerStorageValue(pk, stoKill) local jaMatou = math.abs(getPlayerStorageValue(pk, stoKill)-myTask.qnt) if sto == 0 then doPlayerSendTextMessage(pk, 22, "["..myTask.kill.." Task Finalizada] ("..myTask.qnt.."/"..myTask.qnt..")") else doPlayerSendTextMessage(pk, 22, "["..myTask.kill.." Task] ("..jaMatou.."/"..myTask.qnt..")") end end end end return true end
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
