Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. executa essa query: CREATE TABLE npc_quest ( create INT NOT NULL DEFAULT 0, PRIMARY KEY ( id ) ); e usa o script assim: local pos = {x=875,y=398,z=7} -- Local do NPC local npc = "GoblinAssustadoOesteCidade" function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) and getPlayerAccess(cid) < 3 then if db.getResult("SELECT `create` FROM `npc_quest`;"):getDataInt("create") <= 0 then doCreateNpc(npc, pos) db.executeQuery("UPDATE `npc_quest` SET `create` = 1;") end end return true end futuramente, quando for "remover o npc usa esta linha para voltar para 0 db.executeQuery("UPDATE `npc_quest` SET `create` = 0;") ------------------------------------------------------------- ai para dar sequencia a sua quest, e se ele tiver aparecido alguma vez na vida, você usa assim: if db.getResult("SELECT `create` FROM `npc_quest`;"):getDataInt("create") > 0 then -- sim o npc ja foi criado alguma vez end ----------------------------------------------------------------------------------------------- @Tadelho Conseguiu? fiz exatamente o que descreveu... aguardo respostas!
  2. local time = 600 -- tempo em segundos para usar local monster = "Demon" -- "Monstro" entre aspas local pos = {x=805, y=568, z=7} -- Posição que irá nascer. local from,to = {x=790, y=550, z=7},{x=820, y=575, z=7} -- area total da area onde o monstro vai estar function CheckArea(area) local var = 0 for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) then var = var +1 end end end return var end function onUse(cid, item, frompos, itemex, topos) if getStorage(2111) - os.time() < 1 then if CheckArea({from,to}) == 0 then doSetStorage(2111, os.time() + time) addEvent(function() doCreateMonster(monster, pos) end, 10000) doCreatureSay(cid, "Demon Invocado ! Prepare-se !", TALKTYPE_MONSTER) else doPlayerSendCancel(cid, "ja existe um monstro na area") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end else doPlayerSendCancel(cid, "Voce precisa esperar ".. getStorage(2111) - os.time() .." Segundos restantes") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end doTransformItem(item.uid, item.itemid % 2 == 1 and item.itemid + 1 or item.itemid + -1) return true end
  3. Não precisa usar global storage, pega o cid do npc: local pos = {x=875,y=398,z=7} -- Local do NPC local npc = "GoblinAssustadoOesteCidade" function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) and getPlayerAccess(cid) < 3 then local creature = getCreatureByName(npc) if creature ~= nil then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "O NPC ja esta andando por este mapa!.") else doCreateNpc(npc, pos) end end return true end
  4. UÉ, aumenta a chance de dar certo. por exemplo onde está chance 5, troca por 60 por exemplo kk só ir aumentando
  5. pode usar assim: DELETE FROM player_items WHERE itemtype IN ('2494', '2495', '2646'); ali dentro vc coloca o ID dos itens.
  6. function getResets(cid) local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end function onUse(cid, item, frompos, item2, topos) local reset_need = 5 if getResets(cid) < reset_need then return doPlayerSendTextMessage(cid, 22, "Voce precisa de " .. reset_need .. " resets ou mais para entrar.") end pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,"Fique na frente da porta.") return true end doTeleportThing(cid,pos) doSendMagicEffect(topos,12) return true end
  7. coloca pra quando o monstro morrer na hora que virar o "tile", seja dado um AID e faz um movements para o player n poder passar por cima dele.
  8. vc quer que seja obrigado a entrar 2 players? e ambos com level 420 +?
  9. @Brunds esqueci a função main kkk function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1518, y = 1159, z = 15}, --começo da area to = {x = 1534, y = 1174, z = 15}, -- final da area playerDestiny = {x = 1077, y = 783, z = 6} -- para onde o player vai } function onUse(cid, item, frompos, item2, topos) if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  10. function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1518, y = 1159, z = 15}, --começo da area to = {x = 1534, y = 1174, z = 15}, -- final da area playerDestiny = {x = 1077, y = 783, z = 6} -- para onde o player vai } if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end vc pega o X,Y,Z do "from" até o "to"! obs: é do MENOR pro MAIOR, exemplo aqui: from = {x = 1518, y = 1159, z = 15}, to = {x = 1534, y = 1174, z = 15} nunca assim: to = {x = 1518, y = 1159, z = 15}, from = {x = 1534, y = 1174, z = 15}
  11. local c = { limit = 1, -- Limite de jogadores msgCancel = 'Ainda tem gente la dentro', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1826, y = 1834, z = 7}, -- Coordenada maxima superior esquerda To = {x = 1832, y = 1840, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1825, y = 1837, z = 7}, -- Coordenada onde será teletransportado pos1 = {x = 1834, y = 1837, z = 7}, -- Coordenada onde será teletransportado } local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end local function DoKickPlayerFromArea(cid, delay) local exit = {x = 154, y = 160, z = 7} -- defina para onde ele vai if not isCreature(cid) or not isInRange(getThingPos(cid), c.area.From, c.area.To) then return LUA_ERROR end if delay > 0 then doSendAnimatedText(getThingPos(cid), delay, 145) addEvent(DoKickPlayerFromArea, 1000, cid, delay-1) else doTeleportThing(cid, exit) end return true end function onUse(cid, item, fromPos, itemEx, toPos) if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) DoKickPlayerFromArea(cid, 5) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) end return true end
  12. nesse caso não precisa colocar nada na linha da box, porque o script vai checar se ele está dentro da sala ainda... :D
  13. Ao meu ver você é o meu vagalume, sempre mostrando o brilho e piscando a sua bunda pra mim
  14. local config = { cooldown = 20, -- tempo entre uma magia e outra duration = 10, --- duração storage = 3482101, effect = 34 --- efeito que vai sair } local function effect(cid) if not isCreature(cid) or getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then return LUA_ERROR end local pos = {x=getPlayerPosition(cid).x+2, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(pos, config.effect) addEvent(effect, 400, cid) end function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then setPlayerStorageValue(cid, 55695, os.time()) doPlayerSendTextMessage(cid, 27, "Seu kaiten vai durar ".. config.duration .." segundos.") setPlayerStorageValue(cid, config.storage, os.time() + config.duration) effect(cid) else doPlayerSendChannelMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem que esperar "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." segundos para usar novamente.", TALKTYPE_CHANNEL_O, CHANNEL_SPELL) return false end return true end
  15. local c = { limit = 1, -- Limite de jogadores msgCancel = 'Ainda tem gente la dentro', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1826, y = 1834, z = 7}, -- Coordenada maxima superior esquerda To = {x = 1832, y = 1840, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1825, y = 1837, z = 7}, -- Coordenada onde será teletransportado pos1 = {x = 1834, y = 1837, z = 7}, -- Coordenada onde será teletransportado } local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end local function DoKickPlayerFromArea(cid) local exit = {x = 154, y = 160, z = 7} -- defina para onde ele vai if not isCreature(cid) then return LUA_ERROR end if isInRange(getThingPos(cid), c.area.From, c.area.To) then doTeleportThing(cid, exit) end return true end function onUse(cid, item, fromPos, itemEx, toPos) if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) addEvent(DoKickPlayerFromArea, 5000, cid) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) end return true end
  16. Sim, justamente por isso que perguntei qual seria a ideia dele, ou poderia colocar a storage -1 para qndo entrasse na sala, etc... É esboço;
  17. Mas depois que clicar neste seu "boxevent" o que acontece? ele é teleportado da sala? porque se ele clicar neste box, poderá ficar na área por tempo indeterminado? porque se fosse o caso você poderia usar neste script essas linhas local function DoKickPlayerFromArea(cid) local exit = {x = 154, y = 160, z = 7} if not isCreature(cid) then return LUA_ERROR end if getPlayerStorageValue(cid, 209308) <= 0 then doTeleportThing(cid, exit) end return true end addEvent(DoKickPlayerFromArea, 5000, cid) -- e no script do box vc adicionaria esta linha por exemplo setPlayerStorageValue(cid, 209308, 1) enfim, só um esboço... não entendi muito bem esse evento.
  18. Não achou a lib! No tfs 1.3 já tem a pasta Lib? se tiver, não precisa colocar no "core", joga direto lá!
  19. ---------- CONFIGURE AQUI ---------- local tempo = 5 -- (1 = 1 minuto) Tempo que o script durará local expinicial = 2 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server. local expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. local itemId = 7440 -- Aqui vai o ID do ITEM local texto = "Você receberá " .. expinicial .. "x de xp durante " .. tempo .. " minuto(s)" -- Texto que irá receber ao usar a potion. local textofinal = "Fim do efeito da potion." -- Texto que irá receber quando o efeito da potion acabar. local storage = 171717 -- Storage local level = 8 -- LEVEL para usar o item local rates = getPlayerRates(cid) ---------- FIM DA CONFIGURAÇÃO NÃO ALTERE NADA A BAIXO DISSO ------------- function onUse(cid, item, frompos, item2, topos) tempo = tempo*60*1000 if rates[SKILL__LEVEL] > 1 then rates = rates[SKILL__LEVEL] + expinicial else rates = (rates[SKILL__LEVEL] + expinicial) - 1 end if getPlayerLevel(cid) >= level then if getPlayerStorageValue(cid, storage) <= 0 then if item.itemid == itemId then doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,rates) doSendMagicEffect(frompos,13) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,tempo,cid) setPlayerStorageValue(uid, storage, 1) end else doPlayerSendCancel(cid, "Você já está sob efeito desse item.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Você não tem level suficiente, precisa ser level 1500.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end function potion(pos, cid) if not isCreature(cid) then return LUA_ERROR end if (rates - expinicial) >= 1 then doPlayerSetExperienceRate(pos,rates - expinicial) elseif (rates - expinicial) < 1 then doPlayerSetExperienceRate(pos,expfinal) end setPlayerStorageValue(uid, storage, 0) doPlayerSendTextMessage(pos,22,textofinal) doPlayerSendTextMessage(cid,22,"Bônus de xp: " .. rates .. "x") stopEvent(potion) end
  20. @Gnius @Gnius então tente usar return false ja que é uma action if getPlayerStorageValue(cid, 23233) - os.time() > 0 then doPlayerSendCancel(cid, "Voce nao pode usar um pokemon enquanto estiver com o guardiam") return false end
  21. if getPlayerStorageValue(cid, 23233) - os.time() > 0 then doPlayerSendCancel(cid, "Voce nao pode usar um pokemon enquanto estiver com o guardiam") return true end
  22. O certo é assim: o começo é o "from" e o final é o "to"
  23. @Zazeros Que estanho! <event type="PrepareDeath" name="noDeathArea" event="script" value="event12.lua"/> registerCreatureEvent(cid, "noDeathArea") colocou o registro antes do último "return true" né?
  24. @Zazeros O correto na função isInRange é sempre do MENOR pro MAIOR, tanto X, Y ou Z. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local from, to = {x = 1024, y = 998, z = 7},{x = 1414, y = 1008, z = 7} local pos = {x = 1044, y = 1026, z = 7} if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) then doTeleportThing(cid, pos) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, false) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Teste 3") return false end return true end

Informação Importante

Confirmação de Termo