
Solutions
-
Bodak Reborn's post in gaz'haragoth Spells was marked as the answerlocal voc = {1, 2, 3, 4, 5, 6, 7, 8} arr = { {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) local combat = createCombatObject() setCombatArea(combat, area) function onTargetTile(cid, pos) local creatureTable = {} local n, i = getTileInfo({x=pos.x, y=pos.y, z=pos.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid while v ~= 0 do if isCreature(v) == true then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid end end if #creatureTable ~= nil and #creatureTable > 0 then for r = 1, #creatureTable do if creatureTable[r] ~= cid then local min = 30000 local max = 30000 if isPlayer(creatureTable[r]) == true and isInArray(voc, getPlayerVocation(creatureTable[r])) == true then doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE) elseif isMonster(creatureTable[r]) == true then doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE) end end end end doSendMagicEffect(pos, CONST_ME_PURPLEENERGY) return true end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") local function delayedCastSpell(cid) if isCreature(cid) == true then doCombat(cid, combat, positionToVariant(getCreaturePosition(cid))) doCreatureSay(cid, "Gaz'haragoth calls down: DEATH AND DOOM!", TALKTYPE_ORANGE_2) end end function onCastSpell(cid, var) doCreatureSay(cid, "Gaz'haragoth begins to channel DEATH AND DOOM into the area! RUN!", TALKTYPE_ORANGE_2) addEvent(delayedCastSpell, 5000, cid) return true end
-
Bodak Reborn's post in (Resolvido)[RESOLVIDO] healar mana em area PZ was marked as the answerEm creaturescripts, chame essa função de tantos em tantos segundos:
function healPZ (health) if getTileInfo(getThingPos(cid)).protection then doPlayerAddHealth (cid, health) end return true end
-
Bodak Reborn's post in (Resolvido)Function was marked as the answeronSay - talkaction
ao dizer algo (que você define no script ou no XML), execute o código.
onThink - creaturescripts/globalevents
há dois tipos de onThink, mas os dois tem o mesmo conceito. A cada 0,5 segundo (se eu não me engano), execute o código.
Como o que você citou não tem cid (creature id) como parâmetro, quer dizer que é globalevents. Se tivesse cid como parâmetro, seria creaturescripts.
onPrepareDeath - creaturescripts
quando alguém vai tomar o hit que vai matá-lo, execute o código.
onKill - creaturescripts
ao matar alguém, execute o código.
Falar de todas é complicado, porque existem várias... olha pelo XML, normalmente os nomes são auto-explicativos.
-
Bodak Reborn's post in (Resolvido)[tile] que adiciona red skull was marked as the answerAdiciona a Red Skull:
function onStepIn(cid, item, position, fromPosition) if isPlayer (cid) then if getCreatureSkull (cid) ~= 4 then doCreatureSetSkullType (cid, 4) end end return true end
Verifica se está com Red Skull:
function onStepIn(cid, item, position, fromPosition) if isPlayer (cid) then if getCreatureSkull (cid) ~= 4 then doTeleportThing(cid, fromPosition, TRUE) doPlayerSendTextMessage(cid, 21, "Apenas quem estiver com RED SKULL pode passar aqui.") return true end end return true end
-
Bodak Reborn's post in (Resolvido)Sistema de forja que faz verificação da quantidade de itens em certa bancada was marked as the answerLembre-se de colocar a quantidade de cada item no config. qnt1 se refere ao t1 e a qnt2 se refere ao t2.
local config = { ["Magic Plate Armor"] = {t1 = 2476, t2 = 2464, t3 = 2472, qnt1 = 10, qnt2 = 15}, -- t1 = ID do ITEM 1 |---| t2 = ID do ITEM 2 |---| t3 = ID do ITEM a ser FORJADO -- ["Dragon Scale Mail"] = {t1 = 2489, t2 = 2487, t3 = 2492, qnt1 = 20, qnt2 = 5}, } function onUse(cid, item, item2, frompos, topos, pos) local r1 = {x = 222, y = 217, z = 7, stackpos= 2} -- Posição 1 ( NÃO MEXA NO stackpos= 2 ) local r2 = {x = 224, y = 217, z = 7, stackpos= 2} -- Posição 2 ( NÃO MEXA NO stackpos= 2 ) local r3 = {x = 223, y = 217, z = 7} -- Posição do Item a Ser Criado local q1 = getThingfromPos(r1) local q2 = getThingfromPos(r2) for i, x in pairs(config) do if q1.itemid == x.t1 and q2.itemid == x.t2 then if q1.type >= x.qnt1 and q1.type >= x.qnt2 then doRemoveItem(q1.uid, x.qnt1) doRemoveItem(q2.uid, x.qnt2) addEvent(doCreateItem, 1000, x.t3, 1, r3) doSendMagicEffect(r3, 47) addEvent(doSendMagicEffect, 900, r3, 39) doPlayerSendTextMessage(cid, 22, "Parabéns, Você Forjou Um " .. i .. ".") break end elseif q1.itemid == x.t2 and q2.itemid == x.t1 then if q1.type >= x.qnt2 and q1.type >= x.qnt1 then doRemoveItem(q1.uid, x.qnt1) doRemoveItem(q2.uid, x.qnt2) addEvent(doCreateItem, 1000, x.t3, 1, r3) doSendMagicEffect(r3, 47) addEvent(doSendMagicEffect, 900, r3, 39) doPlayerSendTextMessage(cid, 22, "Parabéns, Você Forjou Um " .. i .. ".") break end end end return TRUE end -
Bodak Reborn's post in (Resolvido)Respawn de lenda was marked as the answerNo momento não posso testar, então fiz deste modo por ser mais garantido. O código tá feio, não repara, please.
globalevents/scripts
nome_arquivo.lua
local monster = { [1] = {name = "Moltres", respawnPos = {x = 1049, y = 1052, z = 7}}, [2] = {name = "Zapdos", respawnPos = {x = 1049, y = 1052, z = 7}}, [3] = {name = "Articuno", respawnPos = {x = 1049, y = 1052, z = 7}}, } local from = {x = 1040, y = 1047, z = 7} -- canto superior esquerdo da área do boss. local to = {x = 1059, y = 1061, z = 7} -- canto inferior direito da área do boss. local function haveMonster (monsterName) for x = from.x, to.x do for y = from.y, to.y do for z = from.z, to.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster (monsterTile) and getCreatureName (monsterTile) == monsterName then return true end end end end end function onThink(interval, lastExecution) local randomMonster = math.random (#monster) if not haveMonster (monster[1].name) and not haveMonster (monster[2].name) and not haveMonster (monster[3].name) then doSummonCreature (monster[randomMonster].name, monster[randomMonster].respawnPos) doBroadcastMessage (""..monster[randomMonster].name.." acaba de nascer!") end return true end
XML:
<globalevent name="bossSpawn" interval="14400" event="script" value="nome_arquivo.lua"/>
-
Bodak Reborn's post in (Resolvido)[Pedido] Mensagem no Broadcast quando um jogador matar tal pokemon was marked as the answercreaturescripts/scripts
nome_arquivo.lua
local monster = {"Demon"} function onKill(cid, target, lastHit) if isInArray(monster, getCreatureName(target)) then doBroadcastMessage("O jogador "..getCreatureName(cid).." matou o monstro "..getCreatureName(target).."!", 25) end return true end
XML:
<event type="kill" name="killMonsterBroadcast" event="script" value="nome_arquivo.lua"/>
em login.lua, registre o evento.
registerCreatureEvent(cid, "killMonsterBroadcast")
-
Bodak Reborn's post in (Resolvido)Ajustando Script 3 was marked as the answerdoPlayerRemoveItem (cid, item, quant)
-
Bodak Reborn's post in (Resolvido)Todos ganham item ao matar boss was marked as the answerlocal config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in pairs(getPlayersOnline()) do if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid)) then return false end end return true end function onKill(cid, target) if isInArray(config.monster, getCreatureName(target)) then if isMC (cid) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) else doPlayerSendTextMessage (cid, 19, "Você não receberá recompensa por estar de MC.") end end return true end
-
Bodak Reborn's post in (Resolvido)Pedido Script was marked as the answer@Striker Macabrus
function onThink(cid, interval, lastExecution) local config = { storage = 65121, check = 65122, timeToRespawn = 4, -- tempo em horas para nascer outro boss, caso tenha nascido um. city = "Thais", -- cidade para o broadcast. chance = 35 -- porcentagem de chance de nascer. } local monster = { [1] = {name = "Dragon", pos = {x=1050, y=1054, z=7}, effect = 19, tempoSpawn = 60}, [2] = {name = "Demon", pos = {x = 1630, y = 1520, z = 7}, effect = 40, tempoSpawn = 5}, [3] = {name = "Hero", pos = {x = 1356, y = 1325, z = 7}, effect = 27, tempoSpawn = 5}, -- [um número maior que o anterior] = nome do monstro, posição que ele vai nascer, efeito ao nascer, tempo em segundos para nascer. } local percent = math.random (1, config.chance) if getGlobalStorageValue (config.storage) < os.time () then setGlobalStorageValue (config.check, getGlobalStorageValue (config.check) + 1) if percent <= config.chance then for i = 1, #monster do addEvent (doSummonCreature, monster[i].tempoSpawn * 1000, monster[i].name, monster[i].pos) addEvent (doSendMagicEffect, monster[i].tempoSpawn * 1000, monster[i].pos, monster[i].effect) end setGlobalStorageValue (config.storage, config.timeToRespawn * 60 * 60 + os.time ()) setGlobalStorageValue (config.check, 0) doBroadcastMessage("Um boss acaba de aparecer em "..config.city.."!") end elseif getGlobalStorageValue (config.check) == 4 and getGlobalStorageValue (config.storage) < os.time() then for i = 1, #monster do addEvent (doSummonCreature, monster[i].tempoSpawn * 1000, monster[i].name, monster[i].pos) addEvent (doSendMagicEffect, monster[i].tempoSpawn * 1000, monster[i].pos, monster[i].effect) end setGlobalStorageValue (config.check, 0) setGlobalStorageValue (config.storage, config.timeToRespawn * 60 * 60 + os.time ()) doBroadcastMessage("Um boss acaba de aparecer em "..config.city.."!") end return true end
@brendoonh
function onThink(cid, interval, lastExecution) local config = { storage = 65121, check = 65122, timeToRespawn = 4, -- tempo em horas para nascer outro boss, caso tenha nascido um. name = "Dragon", -- nome do boss. pos = {x=1050, y=1054, z=7}, -- posição que ele vai nascer. city = "Thais", -- cidade para o broadcast. chance = 35, -- porcentagem de chance de nascer. effect = 27 -- efeito ao nascer. } local percent = math.random (1, config.chance) if getGlobalStorageValue (config.storage) < os.time () then setGlobalStorageValue (config.check, getGlobalStorageValue (config.check) + 1) if percent <= config.chance then setGlobalStorageValue (config.storage, config.timeToRespawn * 60 * 60 + os.time ()) setGlobalStorageValue (config.check, 0) doSummonCreature(config.name, config.pos) doSendMagicEffect (config.pos, config.effect) doBroadcastMessage("Um boss acaba de aparecer em "..config.city.."!") end elseif getGlobalStorageValue (config.check) == 4 and getGlobalStorageValue (config.storage) < os.time() then setGlobalStorageValue (config.check, 0) setGlobalStorageValue (config.storage, config.timeToRespawn * 60 * 60 + os.time ()) doSummonCreature(config.name, config.pos) doBroadcastMessage("Um boss acaba de aparecer em "..config.city.."!") end return true end
-
Bodak Reborn's post in (Resolvido)[Pedido] Adicionar Recompensa em um Bau was marked as the answeractions/scripts
nome_arquivo.lua
local config = { storage = 65013, item = {2160, 2145, 2159}, -- IDs dos itens. qnt = {5, 3, 8}, -- quantidade de cada item, respectivamente. Ou seja, serão 5 itens de ID 2160, 3 de ID 2145 e 8 de ID 2159. newPos = {x = 1560, y = 1321, z = 7}, -- posição para onde o jogador será teleportado ao dar use no baú. effect = 27, -- efeito. } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue (cid, config.storage) <= 0 then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end setPlayerStorageValue (cid, config.storage, 1) doTeleportThing (cid, config.newPos) doSendMagicEffect (getThingPos(cid), config.effect) doPlayerSendTextMessage (cid, 25, "Parabéns! Você pegou o seu kit inicial!") else doPlayerSendCancel (cid, "Você já pegou o seu kit inicial!") end return true end XML:
<action actionid="ACTION_ID_DO_BAÚ" event="script" value="nome_arquivo.lua"/>
-
Bodak Reborn's post in (Resolvido)Ajustando Script was marked as the answerfunction onStepIn(cid, item, position, fromPosition) if isPlayer (cid) then doCreatureAddHealth (cid, -getCreatureHealth(cid)/100*99) end return true end
-
Bodak Reborn's post in (Resolvido)[AJUDA] PokéDex was marked as the answerSim, mas queria saber se teria que mudar algo nos scripts sobre a pokedex.
Sobre o tópico: você substituiu a pasta "game_textwindow"?
-
Bodak Reborn's post in (Resolvido)Item de Quest call was marked as the answeractions/scripts
nome_arquivo.lua
function onUse(cid, item, frompos, item2, topos) local storage = 546236 local timeToCall = 3 -- tempo em minutos. if getGlobalStorageValue (storage) < os.time() then doBroadcastMessage ("[QUEST CALL] O jogador "..getCreatureName (cid).." está esperando ajuda para fazer a quest 'tal'") setGlobalStorageValue (storage, timeToCall * 60 + os.time()) end return true end
XML:
<action actionid="ACTION_ID" script="nome_arquivo.lua"/>
-
Bodak Reborn's post in (Resolvido)[PEDIDO] World Boss System! was marked as the answerBom, vamos lá.
Não consegui fazer de um jeito "automático", demorei por isso.
Só consegui fazer automático com o storage para todos os pokémons. Espero que fazer "manualmente" não te atrapalhe tanto.
Para cada Giant pokémon, um novo arquivo e uma nova tag deve ser criada em actions.
O ID do item invisível/baú deve ser diferente também.
Lembrando que pelo jeito que eu fiz, você deve criar um item novo. Se não fizer, ao clicar em um item com o mesmo ID que este, você receberá a recompensa.
globalevents/scripts
nome_arquivo.lua
Este vai fazer o monstro aparecer.
function onThink(cid, interval, lastExecution) local bosses = { [1] = {name = "Giant Primeape", times = 3, pos = {[1] = {x=1050, y=1054, z=7}, [2] = {x=1051, y=1054, z=7}, [3] = {x=1052, y=1054, z=7}}}, [2] = {name = "Giant Wigglytuff", times = 1, pos = {[1] = {x=1045, y=1053, z=7}}}, -- [um numero maior que o de cima] = nome do monstro, quantas vezes ele vai spawnar (deve ser igual ao numero de posições), posições que ele vai spawnar. } local boss = math.random (#bosses) for i = 1, bosses[boss].times do doSummonCreature(bosses[boss].name, bosses[boss].pos[i]) end doBroadcastMessage("Um World Boss acaba de aparecer!") return true end
globalevents/scripts
nome_arquivo.lua
Este vai fazer o monstro desaparecer.
function onThink(cid, interval, lastExecution) local from1 = {x = 1046, y = 1048, z = 7} -- canto superior esquerdo da área que irá spawnar o Giant. local to1 = {x = 1055, y = 1059, z = 7} -- canto inferior direito da área que irá spawnar o Giant. for x = from1.x, to1.x do for y = from1.y, to1.y do for z = from1.z, to1.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster(monsterTile) and getCreatureName (monsterTile) == "Giant Primeape" then doRemoveCreature(monsterTile) end end end end doBroadcastMessage ("O World Boss sumiu!") return true end
XML:
<globalevent name="spawnWorldBoss" interval="14400" script="nome_arquivo.lua"/> <globalevent name="removeWorldBoss" interval="3600" script="nome_arquivo.lua"/>
creaturescripts/scripts
nome_arquivo.lua
local bosses = { [1] = {name = "Giant Primeape", item = 12163, storage = 6151321}, [2] = {name = "Giant Wigglytuff", item = 12170, storage = 6151322}, -- [um número mais que o de cima] = {nome do monstro, ID do item, storage para verificar se o player matou o monstro. O storage deve ser diferente dos demais, recomendo ser 1 número maior que o de cima}, -- lembre-se de colocar a vírgula no final. } local timeToRemove = 60 -- tempo em segundos para remover o item invisível/baú. local effect = 27 -- efeito que vai sair do player ao matar o pokémon. local function doCreateItemWithDelay (item, position) doCreateItem(item, 1, position) return true end local function doRemoveItemWithDelay (item, position) local tileItem = getTileItemById(position, item).uid if tileItem ~= 0 then doRemoveItem(tileItem, 1) end return true end function onKill(cid, target) for i = 1, #bosses do if isInArray(bosses[i].name, getCreatureName(target)) then if getPlayerStorageValue (cid, bosses[i].storage) ~= 1 then doPlayerSendTextMessage (cid, 19, "Agora você pode pegar a sua recompensa!") doSendMagicEffect (getThingPos (cid), effect) setPlayerStorageValue (cid, bosses[i].storage, 1) end addEvent(doCreateItemWithDelay, 1, bosses[i].item, getCreaturePosition(target)) addEvent(doRemoveItemWithDelay, timeToRemove * 1000, bosses[i].item, getCreaturePosition(target)) end end return true end
XML:
<event type="kill" name="worldBoss" event="script" value="nome_arquivo.lua"/>
Registre o evento em login.lua.
registerCreatureEvent(cid, "worldBoss")
actions/scripts
nome_arquivo.lua
local config = { item = 2160, -- ID do item que será adicionado. qnt = 5, -- quantidade de itens que será adicionado. timeOut = 4, -- tempo em horas para poder pegar o prêmio deste pokémon novamente. exhausted = 102548, -- esse é o storage do exhausted, um monstro sempre tem que ser diferente do outro. Recomendo colocar um número maior. storage = 6151321, -- storage para verificar se o jogador matou o monstro. Deve ser o mesmo do creaturescripts, para cada monstro. effect = 28, -- efeito que vai sair em cima do player ao dar use no item. } local function timeToCheckIfKillMonster (cid, storage) setPlayerStorageValue (cid, storage, -1) return end function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue (cid, config.storage) == 1 then if getPlayerStorageValue (cid, config.exhausted) < os.time() then doPlayerAddItem (cid, config.item, config.qnt) doPlayerSendTextMessage (cid, 19, "Parabéns! Você derrotou o Giant Primeape!") doSendMagicEffect (getThingPos(cid), config.effect) setPlayerStorageValue (cid, config.exhausted, config.timeOut * 60 * 60 + os.time()) addEvent(timeToCheckIfKillMonster, config.timeOut * 1000 * 60 * 60 , cid, config.storage) else doPlayerSendTextMessage (cid, 19, "Você só poderá receber o prêmio do Giant Primeape em algumas horas.") end else doPlayerSendTextMessage (cid, 19, "Você não derrotou o Giant Primeape.") end return true end
XML:
<action itemid="ID_DO_ITEM_QUE_SERÁ_DROPADO_NA_POSIÇÃO_DO_MONSTRO" event="script" value="nome_arquivo.lua"/>
OBS: No XML do globalevents, o interval é em segundos. 14400 = 4 horas em segundos, 3600 = 1 hora em segundos.
OBS2: No script que remove o monstro, caso queira adicionar mais áreas, você deve criar uma nova variável, ficando assim:
local from1, from2, from3 = posição do canto superior esquerdo da área (from1), posição do canto superior esquerdo da área (from2), posição do canto superior esquerdo da (from3) local to1, to2, to3 = posição do canto inferior direito da área (to1), posição do canto inferior direito da área (t2), posição do canto inferior direito da área (to3)
Exemplo:
local from1, from2, from3 = {x = 1046, y = 1048, z = 7}, {x = 1046, y = 1048, z = 7}, {x = 1030, y = 1032, z = 7} local to1, to2, to3 = {x = 1055, y = 1059, z = 7}, {x = 1055, y = 1059, z = 7}, {x = 1020, y = 1025, z = 7}
Lembre-se: sempre separado por vírgulas.
E também, criar um novo bloco de for, copiando o de cima e trocando apenas o número do from/to e o nome do monstro, exemplo:
for x = from1.x, to1.x do for y = from1.y, to1.y do for z = from1.z, to1.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster(monsterTile) and getCreatureName (monsterTile) == "Giant Primeape" then doRemoveCreature(monsterTile) end end end end for x = from2.x, to2.x do for y = from2.y, to2.y do for z = from2.z, to2.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster(monsterTile) and getCreatureName (monsterTile) == "Giant Wigglytuff" then doRemoveCreature(monsterTile) end end end end for x = from3.x, to3.x do for y = from3.y, to3.y do for z = from3.z, to3.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster(monsterTile) and getCreatureName (monsterTile) == "Giant Scyther" then doRemoveCreature(monsterTile) end end end end Espero que tenha entendido. =)
Para remover os pokémons automaticamente, adaptei um script de Jamison Collins/IagoNp.
-
Bodak Reborn's post in (Resolvido)Puxar a alavanca c/ item no piso certo , se não , morre was marked as the answerfunction onUse(cid, item, frompos, item2, topos) local pos = {x=828,y=743,z=7} local poss = {x=845,y=745,z=7} local item = 1616 if getTileItemById (pos, item).uid >= 1 then doTeleportThing (cid, poss) elseif getTileItemById (pos, item).uid == 0 then doCreatureAddHealth (cid, -getCreatureMaxHealth (cid)) end return true end
-
Bodak Reborn's post in (Resolvido)Monstro não ataca player com storage was marked as the answermovements/scripts
nome_arquivo.lua
function onStepIn(cid, item, position, fromPosition) local storage = 318926 -- storage da quest. if getPlayerStorageValue (cid, storage) ~= 1 then doCreatureAddHealth (cid, -getCreatureMaxHealth(cid)) end return true end movements.xml
<movevent type="StepIn" actionid="ACTION_ID_DO_PISO" event="script" value="nome_arquivo.lua" />
-
Bodak Reborn's post in (Resolvido)[Master ball] Poketibia was marked as the answerdata/actions/scripts/catch.lua
Procura por "shinys" e adiciona lá os pokémons que você não quer que sejam capturados pela Master Ball.
-
Bodak Reborn's post in (Resolvido)[Dúvida] Nova Porta No Server was marked as the answerlocal function doorEnter(cid, item, toPosition) doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.actionid == ACTION_ID or (item.actionid ~= 0 and getPlayerLevel(cid) >= LEVEL_NECESSÁRIO)) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem o level necessário.") end return false end
-
Bodak Reborn's post in (Resolvido)[PEDIDO] was marked as the answerAh, perdão.
Esse script só funciona para sqms normais, não para TPs. Total desatenção minha.
Vou fazer aqui e te mando.
Pensei em um jeito mais fácil.
Tenta assim, @GuuhMaster:
Crie um portal sem coordenadas, sendo apenas a sprite.
Depois, pegue as coordenadas de onde você quer que o player seja teleportado e coloque onde é indicado.