
Tudo que xWhiteWolf postou
- [PEDIDO] Item dar efeito de gelo!
-
[Ajuda] Quest Simples, não funciona HELK
não.. storage não tem nada a ver com o item. É apenas um lugar que você salva um valor e utiliza pra controlar as quests e outras coisas do server. Fez a quest o storage de numero XXXXX passa a valer 1, se não fez a quest o storage de numero XXXXX tem valor -1. O item que vai ganhar é esse daqui doPlayerAddItem(cid,2149,10) esse comando adiciona 10 itens de ID 2149.
-
(Resolvido)[HELP] Pet System
é foda, os caras viajam muito... até desanima ajudar assim, o cara vem na pressa de querer resolver o problema e acaba levando 3 dias porque ele não especifica oque ele quer e não inventaram leitura de mente ainda. Se ele tivesse colocado no nome [Ajuda] Pet System e explicado como funcionava e tivesse postando o script isso daqui já teria sido resolvido
-
(Resolvido)[Talkactions] Remove Frags - Erro No Distro
posta o script da talkactions e da actions.
-
(Resolvido)[HELP] Pet System
Velho, você precisa ajudar a gente a te ajudar.. oque esses itens fazem? Nada? São enfeites? Usa aonde? É uma arma? Um equip? É algum item que vc clica e ele faz alguma coisa? Se sim, cadê o script deles? Qual sua versão de tibia? Versão do server?
-
BUG MAGIC LEVEL
global.lua > procura rateMagic = 60 coloca um valor baixo pra diminuir. Se ainda assim não resolver, aí já não sei... no XML\Vocations.xml tem uns multiplicadores de skills por classe mas não tem nada de ML lá, ML é só no config.lua mesmo
-
Problema no Event Zombie - Teleport
tenta agora local config = { playerCount = 2001, -- Global storage for counting the players left/entered in the event zombieCount = 2002, -- Global storage for counting the zombies in the event teleportPosition = {x = 152, y = 50, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 838, y = 61, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 1, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 10, -- Seconds between each spawn of zombie zombieName = "event zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 3, -- Players needed before the zombies can spawn. -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 806, y = 38, z = 7}, -- top left cornor of the playground toPosition = {x = 868, y = 85, z = 7}, -- bottom right cornor of the playground } function onTimer() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) print(getGlobalStorageValue(2001)) end function startEvent() local posit1 = getThingfromPos(config.teleportPosition) if posit1.itemid ~= 0 then doRemoveItem(posit1.uid, 5) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end
-
[Ajuda] Quest Simples, não funciona HELK
o problema desse script é que ele checa um storage e dá outro na hora de pegar o item, fazendo assim com que você sempre possa pegar o item function onUse(cid, item, frompos, item2, topos) local queststatus = getPlayerStorageValue(cid,11638) if item.uid == 10000 and queststatus == -1 then if getPlayerLevel(cid) >= 20 then doPlayerSendTextMessage(cid,22,"Você recebeu sua box 1!") doPlayerAddItem(cid,2149,10) setPlayerStorageValue(cid,11638,1) end else doPlayerSendTextMessage(cid,22,"Você já pegou a sua box 1.") end end Isso tem que ter o mesmo storage que isso: local queststatus = getPlayerStorageValue(cid,11638) setPlayerStorageValue(cid,11638,1) Explicando melhor: Quando o player vai abrir o baú ele checa o storage 11638. Caso o queststatus == -1, prossegue o script que o cara faz a quest. Ao fazer a quest o storage passa a valer "1" então se o player tentar fazer de novo essa quest vai retornar o erro porque o questatus não tá mais valendo -1. Mas pra fazer isso os dois storages tem que ser iguais
-
Pet System + item que add vocation + trocar item por comando!
sobre o pet system: edita a flag do monstro que será seu pet seguindo essa calculadora http://trevorpp.awardspace.com/ só colocar não pode ser atacado que ele já fica imortal. Sobre o script de troca: talkactions\trocar.lua local config = { item1 = XXXX, --\ item2 = YYYYY, -- >>> ID's dos itens que precisam para trocar pelo premio item3 = ZZZZ, --/ premio = KKKK, --id do item que vai dar de premio caso troque effect = 10 --efeito que vai sair ao tracar } function onSay(cid, words, param) if doPlayerRemoveItem(cid,config.item1,1) and doPlayerRemoveItem(cid,config.item2,1) and doPlayerRemoveItem(cid,config.item3,1) then doPlayerAddItem(cid,config.premio,1) doSendMagicEffect(getPlayerPosition(cid), config.effect) doCreatureSay(cid, "!trocar", TALKTYPE_ORANGE_1) else doPlayerSendCancel(cid, 'You do not have '.. getItemNameById(config.item1)..', '.. getItemNameById(config.item2)..' and '.. getItemNameById(config.item3)..' to trade.') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end talkactions.xml: <talkaction words="!trocar" event="script" value="trocar.lua"/>
-
[PEDIDO] npc que distribuidor !
não to com tempo pra fazer mas vou dar a dica pra você ou qualquer outro que for tentar te ajudar: Coloca pra quando comprar pelo site adicionar um valor a um storage, tudo que o npc vai ter que fazer é checar o valor do storage e falar 'você tem um "..getItemnamebyID(config.iditem1).." para receber, deseja recebê-lo agora?' se o player falar sim o cara muda o storage pra 0 e dá o item. Daí dá pra você configurar cada item pra um storage usando elseif. Se o storage for 1 vai receber tal item se o storage for 2 vai receber outro item . . . se o storage for n vai receber o item n. e assim por diante.
-
Pet System + item que add vocation + trocar item por comando!
doPlayerSetVocation(cid, getPlayerVocation(cid)+4) Setar vocação do player (player que usar, pegar a vocação do player que usar e aumentar +4.) O script pega o número da vocação atual e aumenta 4. Se for 1 vai virar 5. (De sorcerer pra master sorcerer), se for 2 vira 6 (de druid pra elder) se for 3 vira 7 (paladin pra royal) e se for 4 vira 8 (de knight pra elite knight)
-
(Resolvido)[HELP] Pet System
se o item fica dentro da bp então ele não é um equipável, você tem que arrumar o level por algum script nas actions. Posta o script aqui que a gente tenta te ajudar e na próxima vez seja mais específico. Item pode ser qualquer merda.
- Problema no Event Zombie - Teleport
-
[PEDIDO] Item dar efeito de gelo!
como a função onstatschange é uma coisa das sources, o único jeito é dar upgrade na versão.. Mas eu não sei se 8.4 não tem onstatschange, talvez até tenha e o problema possa ser alguma outra coisa, só não sei te dizer oque porque aqui funcionou perfeitamente, tanto que eu repeti o sistema pra todas as outras elemental armor's
-
Erro na contagem TASK
leia os comentários de onde você pegou o script, tem mil pessoas reclamando da contagem e tem 4 páginas de edições que o cara fez pra tentar arrumar esse erro. Testa todas as edições porque é certeza de alguma funcionar no seu server, e lembra de criar o arquivo.lua na pasta libs que nem ele falou pra fazer, porque é aquilo que garante que a contagem funcione
-
Problema no Event Zombie - Teleport
globalevents local config = { playerCount = 2001, -- Global storage for counting the players left/entered in the event zombieCount = 2002, -- Global storage for counting the zombies in the event teleportPosition = {x = 152, y = 50, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 838, y = 61, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 1, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 10, -- Seconds between each spawn of zombie zombieName = "event zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 3, -- Players needed before the zombies can spawn. -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 806, y = 38, z = 7}, -- top left cornor of the playground toPosition = {x = 868, y = 85, z = 7}, -- bottom right cornor of the playground } function onTimer() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) print(getGlobalStorageValue(2001)) end function startEvent() local get = getThingfromPos(config.teleportPosition) if get.itemid == config.teleportId then doRemoveItem(get.uid, 1) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end não fiz nenhuma alteração drástica e nem testei mas não tem motivo para não funcionar.
-
[ERRO] SCRIPT
se você não sabe, imagina eu que nunca vi seu globalevents.xml???? Experimenta postar aqui que a gente tenta te ajudar
-
Ajuda com script: Level e Skill Minimo
edita isso for ID = 1, 7 do if SkillsAtuais[ID] < MinimoSkill[Voc][ID] then doPlayerAddSkillTry(cid, (ID - 1), (MinimoSkill[Voc][ID] - SkillsAtuais[ID])) end end doPlayerAddMagLevel(cid, (MinimoSkill[Voc][8] - getPlayerMagLevel(cid)), true) e coloca for ID = 1, 8 do while SkillsAtuais[ID] < MinimoSkill[Voc][ID] do doPlayerAddSkillTry(cid, (ID - 1), (MinimoSkill[Voc][ID] - SkillsAtuais[ID])) doPlayerAddMagLevel(cid, (MinimoSkill[Voc][8] - getPlayerMagLevel(cid)), true) end end deve resolver.
-
Player só ataca outro se forem moradores de cidades diferentes
creaturescripts.xml > procura a função onattack, se não tiver ela fala aqui, caso tenha posta ela aqui > a gente edita pra você
-
(Resolvido)Abrir Ostra e Ganhar Giant Shimmering Pearl
no corpo de um water elemental você diz com ele vivo ou no corpo morto dele após ele morrer? porque se for no corpo é só colocar isso kkkk local config = { waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}, fishable = {4608, 4609, 4610, 4611, 4612, 4613, 7236}, spawning = {4614, 4615, 4616, 4617, 4618, 4619}, holes = {7236}, corpses = { -- [corpse] = {[aid] = { {itemid, countmax, chance} }} [10499] = { {7632, 1, 8600}, --giant shimmering pearl {7633, 1, 8600}, --giant shimmering pearl [101] = { {2226, 1, 16000}, --fish bone {2238, 1, 15000}, --leather boots {2148, 1, 15000}, --gold coin {2376, 1, 14000}, --sword {2152, 1, 13000}, --platinum {7589, 1, 13000}, --strong mana potion {7588, 1, 13000}, --strong health potion {2168, 1, 11500}, --life ring {2167, 1, 15000}, --energy ring {9810, 1, 9500}, --rusty armor {9813, 1, 9500}, --rusty legs {7632, 1, 8600}, --giant shimmering pearl {7633, 1, 8600}, --giant shimmering pearl {7158, 1, 3100}, --rainbow trout {7159, 1, 3100}, --green perch {2146, 1, 11500}, --small sapphire {2149, 2, 11500}, --small emerald {10220, 1, 1500} --leviathan's amulet }, [102] = { {2226, 1, 16000}, --fish bone {2238, 1, 15000}, --leather boots {2148, 1, 15000}, --gold coin {2376, 1, 14000}, --sword {2152, 1, 14000}, --platinum {7589, 1, 14000}, --strong mana potion {7588, 1, 14000}, --strong health potion {2168, 1, 15500}, --life ring {2167, 1, 16000}, --energy ring {9810, 1, 11500}, --rusty armor {9813, 1, 11500}, --rusty legs {7632, 1, 9600}, --giant shimmering pearl {7633, 1, 9600}, --giant shimmering pearl {7158, 1, 5100}, --rainbow trout {7159, 1, 5100}, --green perch {2146, 1, 13500}, --small sapphire {2149, 2, 13500}, --small emerald {10220, 1, 2500} --leviathan's amulet } } }, checkCorpseOwner = getConfigValue("checkCorpseOwner"), rateLoot = getConfigValue("rateLoot"), summons = { -- {skill, name, chance, bossName, bossChance} }, rateSpawn = getConfigValue("rateSpawn"), baitFailRemoveChance = 10, allowFromPz = false, useBait = true, baitCount = 1, fishes = 1 } config.checkCorpseOwner = getBooleanFromString(config.checkCorpseOwner) function onUse(cid, item, fromPosition, itemEx, toPosition) if(isInArray(config.waters, itemEx.itemid)) then if(isInArray(config.spawning, itemEx.itemid)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY) return true end local corpse = config.corpses[itemEx.itemid] if(corpse ~= nil and corpse ~= 0) then corpse = corpse[itemEx.actionid] if(corpse ~= nil and corpse ~= 0) then if(config.checkCorpseOwner and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then local owner = getItemAttribute(itemEx.uid, "corpseowner") if(owner ~= 0 and owner ~= nil and owner ~= getPlayerGUID(cid)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUARENOTTHEOWNER) return true end end local chance, items, default, max = math.random(0, 100000) / config.rateLoot, {}, {}, 0 for _, data in ipairs(corpse) do if(data[3] >= chance) then local tmp = {data[1], math.random(1, data[2])} table.insert(items, tmp) end if(data[3] > max) then default = data max = data[3] end end local itemCount = table.maxn(items) if(itemCount > 0) then local loot = items[math.random(1, itemCount)] doPlayerAddItem(cid, loot[1], loot[2]) else doPlayerAddItem(cid, default[1], default[2]) end doTransformItem(itemEx.uid, getItemInfo(itemEx.itemid).decayTo) doSendMagicEffect(toPosition, CONST_ME_WATERSPLASH) doDecayItem(itemEx.uid) return true end end if(not isInArray(config.fishable, itemEx.itemid)) then return false end local position, formula, tries = getThingPosition(cid), getPlayerSkill(cid, SKILL_FISHING) / 200 + 0.85 * math.random(), 0 config.allowFromPz = config.allowFromPz or not getTileInfo(position).protection if(item.itemid ~= ITEM_MECHANICAL_FISHING_ROD) then if(config.allowFromPz and (not config.useBait or getPlayerItemCount(cid, ITEM_WORM) >= config.baitCount)) then tries = 1 if(isInArray(config.holes, itemEx.itemid)) then if(doPlayerRemoveItem(cid, ITEM_WORM, config.baitCount)) then tries = 2 if(formula > 0.83) then doPlayerAddItem(cid, ITEM_RAINBOW_TROUT, config.fishes) elseif(formula > 0.7) then doPlayerAddItem(cid, ITEM_NORTHERN_PIKE, config.fishes) elseif(formula > 0.5) then doPlayerAddItem(cid, ITEM_GREEN_PERCH, config.fishes) else doPlayerAddItem(cid, ITEM_FISH, config.fishes) end end elseif(formula > 0.7 and doPlayerRemoveItem(cid, ITEM_WORM, config.baitCount)) then tries = 2 if(table.maxn(config.summons) > 0 and getDistanceBetween(position, toPosition) < 2) then local skill, summon = getPlayerSkill(cid, SKILL_FISHING), {name = "", chance = 0, bossName = "", bossChance = 0} for _, data in pairs(config.summons) do if(skill >= data[1]) then summon.name = data[2] summon.chance = data[3] summon.bossName = data[4] summon.bossChance = data[5] end end local random = math.random(1, 100000) / config.rateSpawn if(summon.bossName ~= "" and summon.bossChance >= random) then doCreateMonster(summon.bossName, position) tries = 4 elseif(summon.name ~= "" and summon.chance >= random) then doCreateMonster(summon.name, position) tries = 3 else doPlayerAddItem(cid, ITEM_FISH, config.fishes) end else doPlayerAddItem(cid, ITEM_FISH, config.fishes) end end end elseif(config.allowFromPz and (not config.useBait or getPlayerItemCount(cid, ITEM_NAIL) >= config.baitCount)) then if(formula > 0.7 and doPlayerRemoveItem(cid, ITEM_NAIL, config.baitCount)) then doPlayerAddItem(cid, ITEM_MECHANICAL_FISH, config.fishes) tries = 2 else tries = 1 end end if(tries > 1) then doPlayerAddSkillTry(cid, SKILL_FISHING, tries) if(not isInArray(config.holes, itemEx.itemid)) then doTransformItem(itemEx.uid, itemEx.itemid + 6) else doTransformItem(itemEx.uid, itemEx.itemid + 1) end doDecayItem(itemEx.uid) elseif(tries > 0) then doPlayerAddSkillTry(cid, SKILL_FISHING, 1) if(config.baitFailRemoveChance >= math.random(1, 100)) then if(item.itemid == ITEM_MECHANICAL_FISHING_ROD) then doPlayerRemoveItem(cid, ITEM_NAIL, config.baitCount) else doPlayerRemoveItem(cid, ITEM_FISH, config.baitCount) end end end doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY) return true end se der erro muda essa parte aqui (tira a ultima virgula) [10499] = { {7632, 1, 8600}, --giant shimmering pearl {7633, 1, 8600}, --giant shimmering pearl ficando assim [10499] = { {7632, 1, 8600}, --giant shimmering pearl {7633, 1, 8600} --giant shimmering pearl 10499 é o corpo do water elemental, 7632 e 7633 são os Id's das giant shimmering pearls, 1 é a quantidade que ganha e 8600 é a chance. (essa chance é em 100.000)
- Ao morre remove todos os itens
-
[AJUDA] Annihi bugada
tá dando algum erro? você mudou a posição dos monstros ali na table monster positions?
-
Pet System + item que add vocation + trocar item por comando!
o da pedra que muda vocação tá aqui, só trocar em XXXX pelo ID da pedra que vc for usar actions\scripts\pedravoc.lua: --[[Script made 100% by Night Wolf for churupetinha at tibiaking ~~~ enjoy it]] function onUse(cid, item, frompos, item2, topos) local config = { idpedra = XXXX, -- id do item } if item.itemid == config.idpedra then if getPlayerVocation(cid) <= 4 then doRemoveItem(item.uid, 1) doPlayerSetVocation(cid, getPlayerVocation(cid)+4) doSendMagicEffect(config.pos,math.random(28,30)) --aqui é a parte do efeito, coloquei um random entre o efeito 28~30 que são os fogos de artificio doPlayerSendTextMessage(cid, 22, "You are now a "..getPlayerVocationName(cid).."!") else doPlayerSendTextMessage(cid, 22, "You can't be promoted since you're already a "..getPlayerVocationName(cid).."!") end else end return true end e não esquece de adicionar a tag no actions.xml <action itemid="XXXX" script="pedravoc.lua"/>
-
(Resolvido)[AJUDA] Food Especiais
Eu não gosto de pessoas que postam metade do script e pedem ajuda mas dessa vez eu vou te perdoar porque estou considerando que foi sem querer. local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED } local config = { storage = 10001, --use empty storage exhaust = 600 --Exhaust is in seconds 600 equals 10min } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local food = SPECIAL_FOODS[item.itemid] if(food == nil) then return false end if (getPlayerStorageValue(cid, config.storage) <= os.time()) then setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust) if(not doAddCondition(cid, exhaust)) then return true end for _, condition in ipairs(conditions) do if(getCreatureCondition(cid, condition)) then doRemoveCondition(cid, condition) end end doRemoveItem(item.uid, 1) doCreatureSay(cid, food, TALKTYPE_MONSTER) doSendMagicEffect(getPlayerPosition(cid),14) end return true end
-
(Resolvido)Abrir Ostra e Ganhar Giant Shimmering Pearl
a primeira parte do script: crie um arquivo chamado oyster.lua em actions/scripts --[[Script made 100% by Night Wolf for lagoa at tibiaking ~~~ enjoy it]] function onUse(cid, item, frompos, item2, topos) local config = { idconcha = XXXX, -- id da concha que vai abrir storaged = 45798, -- storage que será utilizado idperola = 2143, -- id da perola que ganha tempo = 20*60*60, --definido para 20 horas (20 HORAS * 60 MINUTOS * 60 SEGUNDOS) pos = getPlayerPosition (cid), --não mexa chance = 20 -- quanto % tem de chance de abrir a ostra e ganhar pérola } time = os.time() + config.tempo if item.itemid == config.idconcha then if os.time() - getCreatureStorage(cid, config.storaged) >= config.tempo then setPlayerStorageValue(cid, config.storaged, time) doRemoveItem(item.uid, 1) if config.chance > math.random(1,100) then doPlayerAddItem(cid, config.idperola) doSendMagicEffect(config.pos,math.random(28,30)) --aqui é a parte do efeito, coloquei um random entre o efeito 28~30 que são os fogos de artificio doPlayerSendTextMessage(cid, 19, "You are real lucky, a "..getItemNameById(config.idperola).."!") else doPlayerSendTextMessage(cid, 19, "The oyster was empty. Better luck next time!") end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You must wait "..config.tempo/3600 .." hours to open another oyster. Next available will be at: " .. os.date("%c", getPlayerStorageValue(cid, config.storaged)).. " (Mes/Dia/Ano e horario).") end end return true end no actions.xml coloque essa linha <action itemid="XXXX" script="oyster.lua"/> sendo XXXX o ID da sua ostra (lembre de editar no script também). a segunda parte precisa editar sua fishing rod pra que ao usar ela em water elementals tenha a chance de dar a pearl