-
Total de itens
2553 -
Registro em
-
Última visita
-
Dias Ganhos
72
Tudo que zipter98 postou
-
function onSay(cid, words, param) local t = param:explode(",") local pid, amount = getPlayerByName(t[1]), tonumber(t[2]) if not pid or not amount then doPlayerSendCancel(cid, "/command player_name,amount") end doPlayerSendTextMessage(cid, 27, "You deposited "..amount.." gold in "..t[1].."'s bank.") doPlayerSendTextMessage(pid, 27, "You received "..amount.." gold from "..getCreatureName(cid)..". It was deposited in your bank.") doPlayerSetBalance(pid, getPlayerBalance(pid) + amount) return true end
-
function onSay(cid, words, param) local t = param:explode(",") local pid, amount = getPlayerByName(t[1]), tonumber(t[2]) if not pid or not amount then doPlayerSendCancel(cid, "/command player_name,amount") end doPlayerSendTextMessage(cid, 27, "You deposited "..amount.." gold in "..t[1].."'s bank.") doPlayerSetBalance(pid, getPlayerBalance(pid) + amount) return true end
-
Isso aí é erro em outro código (actions/scripts/warzone.lua).
-
Troque: doTeleportThing(cid, tpsaida) por: doTeleportThing(cid, kickposs)
-
local config = { chance = 100, --Coloquem apenas números inteiros (1 - 0.0001%). bosses = { --["monster_name"] = {"boss", "boss", "boss", ...}, ["Dragon"] = {"Dragon Lord", "Demodras", "Frost Dragon"}, } } function onSpawn(cid) if isMonster(cid) then addEvent(function() if isCreature(cid) then local boss, pos = config.bosses[getCreatureName(cid)], getThingPos(cid) if boss and math.random(1, 10000) <= config.chance then doRemoveCreature(cid) doCreateMonster(boss[math.random(#boss)], pos) end end end, 5) end return true end
-
tfs 0.3.6 Comando !cp teleportar após 10 segundos. Como fazer?
pergunta respondeu ao arkanctrus de zipter98 em Scripts
data/talkactions/scripts local teleport_time, exhaust = 10, 20 --Respectivamente, tempo para teleportar e cooldown. function channel_teleport(cid, time) if not isPlayer(cid) then return true elseif getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "You can't teleport while in battle.") return true elseif time <= 0 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60) return true end doPlayerSendTextMessage(cid, 27, time) addEvent(channel_teleport, 1000, cid, time - 1) end function onSay(cid) if getPlayerStorageValue(cid, 2910) > os.time() then doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.") return true elseif getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "You can't use this command in battle.") return true end channel_teleport(cid, teleport_time) return true end Tag: <talkaction words="!cp" event="script" value="nome_do_arquivo.lua"/> -
dúvida Ajuda num pequeno ajuste de um script
pergunta respondeu ao 4sharedddd de zipter98 em Scripts
O seguinte escopo está sujeito a alguns erros: for id, count in pairs(c.checkItems) do if getTileItemById(c.checkPlace, id).count >= count then doRemoveItem(getTileItemById(c.checkPlace, id).uid, count) doSendMagicEffect(c.checkPlace, CONST_ME_POFF) doPlayerSetStorageValue(cid, c.storage, 1) doTeleportThing(cid, c.teleport) doSendMagicEffect(getThingPos(cid), 10) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce sacrificou o corpo de um belo jovem, uma pena... mas for preciso.") else PlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce precisa colocar corpo de alguem na chama roxa do inferno.") end end Se não se importa, aqui está a correção que escrevi: for id, count in pairs(c.checkItems) do local item = getTileItemById(c.checkPlace, id) if item.uid > 0 and item.type >= count then doRemoveItem(item.uid, count) doSendMagicEffect(c.checkPlace, CONST_ME_POFF) doPlayerSetStorageValue(cid, c.storage, 1) doTeleportThing(cid, c.teleport) doSendMagicEffect(getThingPos(cid), 10) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce sacrificou o corpo de um belo jovem, uma pena... mas for preciso.") return true end end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce precisa colocar corpo de alguem na chama roxa do inferno.") -
O código que postei anteriormente deve ser colocado em data/actions/scripts. Na tag, coloque o itemid do martelo. Quanto ao NPC que atribuiu a profissão, aqui está o script: local professions = { storage = 8171, options = { ["blacksmith"] = 1, --["profession"] = storage_value, ["alchemist"] = 2, ["miner"] = 3, } } 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) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "profession") then local options = {} if getPlayerStorageValue(cid, professions.storage) > -1 then selfSay("You already belong to some profession.", cid) return true end for profession_name, _ in pairs(professions.options) do table.insert(options, profession_name) end selfSay("You can choose one between the following professions. Which one did you like more?", cid) doPlayerPopupFYI(cid, table.concat(options, "\n")) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if not professions.options[msg] then selfSay("I don't offer this kind of profession.", cid) return true end selfSay("Congratulations, now you're a "..msg.."!", cid) setPlayerStorageValue(cid, professions.storage, professions.options[msg]) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Ele deve ser colocado em data/npc/scripts. O arquivo .xml, de data/npc, você pode criar baseando-se nos existentes em seu servidor.
-
tfs 0.3.6 [Pedido] monstro que se multiplica com x de vida
pergunta respondeu ao 4sharedddd de zipter98 em Scripts
Basta colocar aquele último trecho de código que enviei no arquivo .xml do monstro (antes de </monster>). -
tfs 0.3.6 [Pedido] monstro que se multiplica com x de vida
pergunta respondeu ao 4sharedddd de zipter98 em Scripts
data/creaturescripts/scripts Código: local health_to_multiple = 500 --Vida que, quando o monstro chegar, será replicado. function onStatsChange(cid, attacker, type, combat, value) if isMonster(cid) and getCreatureHealth(cid) <= health_to_multiple and getPlayerStorageValue(cid, 4911) < 1 and type == STATSCHANGE_HEALTHLOSS then local new_monster = doCreateMonster(getCreatureName(cid), getThingPos(cid)) doCreatureAddHealth(new_monster, -(getCreatureMaxHealth(new_monster) - health_to_multiple)) setPlayerStorageValue(cid, 4911, 1) setPlayerStorageValue(new_monster, 4911, 1) end return true end Tag: <event type="statschange" name="multiple_monster" event="script" value="nome_do_arquivo.lua"/> No arquivo .xml do(s) monstro(s): <script> <event name="multiple_monster"/> </script> -
Sinceramente, não vejo motivos para verificar a storage. Se o jogador estiver na área, participando ou não do evento o sangue criado iria atrapalhar o uso dos itens encontrados no solo.
-
data/creaturescripts/scripts Código: local config = { blood_itemid = xxx, --ID do item correspondente ao sangue. area_coordinates = {fromPos = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}} --(fromPos - posição superior esquerda da área do minigame, toPos = posição inferior direita) } function onStatsChange(cid, attacker, type, combat, value) local player_pos = getThingPos(cid) if isPlayer(cid) and isInArea(player_pos, config.area_coordinates.fromPos, config.area_coordinates.toPos) and type == STATSCHANGE_HEALTHLOSS then addEvent(function() local tile_item = getTileItemById(player_pos, config.blood_itemid).uid if tile_item > 0 then doRemoveItem(tile_item) end end, 5) end return true end Tag: <event type="statschange" name="remove_blood" event="script" value="nome_do_arquivo.lua"/> Não se esqueça de registrar o evento em login.lua.
-
Esse código é basicamente a função do ferreiro, que escrevi baseando-me no que entendi da sua explicação. A atribuição da profissão é bem simples, bastando manipular a storage como o Wolf explicou. local prof_config = { key = 8171, --Storage do sistema de profissões. storage_value = 1, --Valor da storage do sistema de profissões correspondente a ferreiro. fail_chance = xxx, --Chance de falha (%). Caso não haja, basta colocar false. material = {9811, 9819, 9808}, --Materiais. results = {xxx, xxx, xxx, ...} --Possíveis resultados. (itemid) } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, prof_config.key) ~= prof_config.storage_value then return doPlayerSendCancel(cid, "You don't belong to this profession.") elseif not isInArray(prof_config.material, itemEx.itemid) then return doPlayerSendCancel(cid, "You can't use your hammer in this thing.") end doRemoveItem(itemEx.uid, 1) if prof_config.fail_chance and math.random(1, 100) > prof_config.fail_chance then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Fail. :/") doSendAnimatedText(toPosition, "Fail", 215) else local result = prof_config.results[math.random(#prof_config.results)] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You created a "..getItemNameById(result).."!") doPlayerAddItem(cid, result, 1) end return true end
-
Ótima atualização, como sempre. Quanto mais simples as pips, melhor. Algumas das anteriores eram bem chamativas, o que eu particularmente não gostava muito. E o xTibia Achievement, Daniel? Pensei que ia rolar mês passado.
-
Instale esse creatureevent nas suas sources. Depois, crie um arquivo em data/creatureevents/scripts com extensão .lua e coloque o seguinte conteúdo: function onMoveItem(cid, item, fromPosition, toPosition) if getTileInfo(toPosition).house then local house_id, cid_house = getHouseFromPos(toPosition), getHouseByPlayerGUID(getPlayerGUID(cid)) local guest_list = getHouseAccessList(house_id, 0x100):explode("\n") if house_id == cid_house or (#guest_list > 0 and isInArray(guest_list, getCreatureName(cid))) then return true end return false end return true end Tag (não se esqueça de registrar o evento em login.lua): <event type="move" name="throwItemAtHouse" event="script" value="nome_do_arquivo.lua"/>
-
local pvp_level_table = { {minLv = 50, maxLv = 199}, {minLv = 200, maxLv = 801}, } function onTarget(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end for _, level in pairs(pvp_level_table) do if getPlayerLevel(cid) >= level.minLv and getPlayerLevel(cid) <= level.maxLv and getPlayerLevel(target) >= level.minLv and getPlayerLevel(target) <= level.maxLv then return true end end return false end function onStatsChange(cid, attacker, type, combat, value) if not isPlayer(cid) or not isPlayer(attacker) or type ~= STATSCHANGE_HEALTHLOSS then return true end for _, level in pairs(pvp_level_table) do if getPlayerLevel(cid) >= level.minLv and getPlayerLevel(cid) <= level.maxLv and getPlayerLevel(attacker) >= level.minLv and getPlayerLevel(attacker) <= level.maxLv then return true end end return false end Tags: <event type="statschange" name="PVPLevel1" event="script" value="nome_do_arquivo.lua"/> <event type="target" name="PVPLevel2" event="script" value="nome_do_arquivo.lua"/> Não se esqueça de registrar ambos os eventos em login.lua.
-
pedido Ter somente uma magia suprema liberada.
pergunta respondeu ao pedrizito15 de zipter98 em Scripts
local spells = { --["spell_name"] = price, ["exevo gran mas flam"] = 100000, ["exevo gran mas vis"] = 200000, } local spell_list, storage = "*** SUPREME SPELLS ***", 40201 for spell_name, spell_price in pairs(spells) do spell_list = spell_list.."\n"..spell_name.." - "..spell_price.." gold" end 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) local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid msg = msg:lower() if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "spell") or msgcontains(msg, "trade") then selfSay("I sell the following supreme spells. If you like any of them, just tell me the name.", cid) doPlayerPopupFYI(cid, spell_list) talkState[talkUser] = 1 elseif spells[msg] and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) > -1 then selfSay("You already bought a supreme spell.", cid) elseif doPlayerRemoveMoney(cid, spells[msg]) then selfSay("Congratulations, you bought {"..msg.."}!", cid) doPlayerLearnInstantSpell(cid, msg) setPlayerStorageValue(cid, storage, 1) else selfSay("You don't have enough money ({"..spells[msg].."}).", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
Tag: <event type="kill" name="Drop_info" script="nome_do_arquivo.lua"/> Código: local config = { itemid = xxx, --ID do item. drop_message = "Voce dropou %s.", --Mensagem. drop_effect = xxx --Efeito que aparecerá em cima da corpse (apenas para o dono da corpse). OPCIONAL! Se não quiser, coloque false. } function corpse.examine(cid, position, corpse_id) if not isPlayer(cid) then return true end local corpse = getTileItemById(position, corpse_id).uid if corpse <= 1 or not isContainer(corpse) then return true end for slot = 0, getContainerSize(corpse) - 1 do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return true end if item.itemid == config.itemid then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, config.drop_message:format(getItemNameById(item.itemid))) if config.drop_effect then doSendMagicEffect(position, config.drop_effect, cid) end end end end function onKill(cid, target) if not isMonster(target) then return true end local corpse_id = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(corpse.examine, 5, cid, getThingPos(target), corpse_id) return true end Em login.lua, registre: registerCreatureEvent(cid, "Drop_info") PS: É um creatureevent (data/creaturescripts).
-
--== Configurações --== Fim das Configurações Sendo mais específico, os caracteres "ç" e "õ". Muitos servidores apresentam erro em códigos com caracteres, digamos, especiais.
-
local config = { items = {5957, 10000, 8928, 7697, 10311}, -- Itens que ele pode ganhar vp = 12661, -- ID do Vip Coin } function onUse(cid, item, frompos, item2, topos) local rand = math.random(1, #config.items) if (item.actionid == 1144) and item.itemid == 1945 then if getPlayerItemCount(cid, config.vp) >= 6 then doPlayerRemoveItem(cid, config.vp, 6) doPlayerAddItem(cid, config.items[rand], 1) doBroadcastMessage("O Jogador ["..getCreatureName(cid).."] Esta com sorte Hoje e Acaba de Ganhar ["..getItemNameById(config.items[rand]).."] No Cassino.") else doPlayerSendCancel(cid, "Voce precisa de 6 Vip Coins") doSendMagicEffect(getPlayerPosition(cid), 6) end elseif item.itemid == 1946 then doTransformItem(item.uid, item.itemid - 1) end return true end
-
poketibia [Encerrado] [Pedido] Acabar Vip e perder House PDA
tópico respondeu ao Taiger de zipter98 em Tópicos Sem Resposta
Ah, isso aí é premium account. Nesse caso, use o código que enviei anteriormente. -
poketibia [Encerrado] [Pedido] Acabar Vip e perder House PDA
tópico respondeu ao Taiger de zipter98 em Tópicos Sem Resposta
Qual o sistema de VIP utilizado? W/e, escrevi uma versão para premium account. Se quiser, você pode tomá-la como base. function onLogin(cid) local house_id = getHouseByPlayerGUID(getPlayerGUID(cid)) if not isPremium(cid) and house_id > 0 then doPlayerSendTextMessage(cid, 27, "You lost your house.") setHouseOwner(house_id, NO_OWNER_PHRASE, true) end return true end -
E como sabemos se o jogador está nessa arena? Coordenadas e/ou storage?
-
pedido Não carregar pokemons iguais e Pokémon que só pode ser usado por STORAGE
pergunta respondeu ao Amantezinho de zipter98 em Scripts
Abaixo de: if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this monster.") return true end coloque: -
Que arena? O jogador iria voltar para a posição inicial alguns segundos depois ou permaneceria nesta outra dimensão?
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.