Tudo que MaTTch postou
-
(Resolvido)[PEDIDO] Baú que usa P Points
troca db.executeQuery para db.query.
-
(Resolvido)O que eu fiz de errado? NPC simples
Posta aqui como esta seu XML
-
(Resolvido)O que eu fiz de errado? NPC simples
Verdade. Tinha me esquecido que minha libs é modificada. @Topic Tenta usar o script que eu editei logo antes do post do Garou, mas deixa como função o callback.
-
(Resolvido)O que eu fiz de errado? NPC simples
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local config = { strg1 = 200201, -- storage começando a task strg2 = 91001, -- storage finalizou a task (ganha qnd matar os monstros) idiom = 8971 } 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 if(not npcHandler:isFocused(cid)) then return false end if(msgcontains(msg:lower(), "task")) then if(getPlayerStorageValue(cid, config.strg2) < 1) then if(getPlayerStorageValue(cid, config.strg1) < 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("That good, one more soul coming from the {portal}! Welcome, I hope you can help.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Que bom, mais uma alma vinda do {portal}! Seja bem vindo, espero que possa nos ajudar.", cid) end talkState[talkUser] = 1 else if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("you have to finish the task.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você tem que terminar a missão.", cid) end talkState[talkUser] = 0 end else if(getPlayerStorageValue(cid, config.strg2) == 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("You have finished the mission! Take it a Sabre, use it until you reach on level 8 and talk with Oracle in the temple.", cid) selfSay("He will send you to Aurea, there talk with !", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você concluiu a missão! Tome aqui um Sabre, use ele ate chegar no nivel 8 e fale com o Oraculo no templo.", cid) selfSay("Ele ira te mandar para Aurea, la fale com !", cid) end doPlayerAddItem(cid, 2385, 1) else if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("You already finished this task.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você já terminou essa task.", cid) end end talkState[talkUser] = 0 end elseif(msgcontains(msg:lower(), "portal") and talkState[talkUser] == 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Crystal, a angel come down here and in Aurea and opened a portal of humans who comes from another dimension for us {save}.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Crystal, uma anja desceu até aqui e em Aurea e abriu um portal de humanos que vem de outra dimensão para nos {salvar}.", cid) end talkState[talkUser] = 2 elseif(msgcontains(msg:lower(), "salvar") or msgcontains(msg:lower(), "save") and talkState[talkUser] == 2) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("We are in an apocalyptic world, at war with several races. And you can be {the chosen}!", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Estamos em um mundo apocalíptico, em guerra com varias raças. E você pode ser o {escolhido}!", cid) end talkState[talkUser] = 3 elseif(msgcontains(msg:lower(), "escolhido") or msgcontains(msg:lower(), "the chosen") and talkState[talkUser] == 3) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Calm down, first we need to train, you have to help us with simple things until you are trained!", cid) selfSay("As for example our plague of {rats} in the city that are rising by storm drains!", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Calma, primeiro precisamos treinar, você deve nos ajudar com coisas simples, até estar bem treinado!", cid) selfSay("Como por exemplo a nossa praga de {rats} na cidade que estão subindo pelos bueiros!", cid) end talkState[talkUser] = 4 elseif(msgcontains(msg:lower(), "rats") and talkState[talkUser] == 4) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Okay, so help us get this over with and kill 10 rats in the storm drain in front here.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Ok, então ajude-nos a acabar com isso e mate 10 ratos no bueiro aqui na frente.", cid) end setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, "creatureSayCallback") npcHandler:addModule(FocusModule:new()) Não testei.
-
[PEDIDO] Vip no nome
Sim
-
[PEDIDO] Vip no nome
Infelizmente eu não entendo de PHP, você vai ter que pedir ajuda a quem mexe com site.
-
(Resolvido)Spell de empurrar
Aé, esqueci kk Aqui: local configSpell = { pushSqms = 3, -- quantos sqm vai empurrar exhaustStorage = 55230, -- se quiser pode mudar exhaustTime = 5 -- exhausted em segundos } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 20) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.3, 0, -7.3, 0) local function isWalkable(pos, creature, pz, proj) if(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end if(getTilePzInfo(pos) and not pz) then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if(tile.itemid ~= 0 and not isCreature(tile.uid)) then if(hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end end if(getTopCreature(pos).uid ~= 0 and not creature) then return false end return true end local function doPushCreature(target, times) if(isCreature(target) and times > 0) then local pos = getCreatureLookPosition(target) if(isWalkable(pos)) then doTeleportThing(target, pos) doSendMagicEffect(getThingPos(target), 2) addEvent(doPushCreature, 1, target, times-1) end end end local function doSpell(cid, target, var) local pos = getThingPos(target) local config = { [NORTH] = {SOUTH, {x=pos.x, y=pos.y+1, z=pos.z}}, [EAST] = {WEST, {x=pos.x-1, y=pos.y, z=pos.z}}, [SOUTH] = {NORTH, {x=pos.x, y=pos.y-1, z=pos.z}}, [WEST] = {EAST, {x=pos.x+1, y=pos.y, z=pos.z}} } local a, b = config[getCreatureLookDirection(target)], getCreatureLookPosition(target) if(isWalkable(a[2]) and isWalkable(b)) then doPushCreature(target, configSpell.pushSqms) doTeleportThing(cid, a[2], false) doCreatureSetLookDirection(cid, getCreatureLookDirection(target)) doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Position blocked.") return false end return true end function onCastSpell(cid, var) if(isPlayer(cid) and exhaustion.check(cid, configSpell.exhaustStorage)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wait "..exhaustion.get(cid, configSpell.exhaustStorage).." second"..(exhaustion.get(cid, configSpell.exhaustStorage) > 1 and "s" or "")..".") return false end exhaustion.set(cid, configSpell.exhaustStorage, configSpell.exhaustTime) return doSpell(cid, getCreatureTarget(cid), var) end
-
(Resolvido)Spell de empurrar
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 20) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.3, 0, -7.3, 0) local function isWalkable(pos, creature, pz, proj) if(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end if(getTilePzInfo(pos) and not pz) then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if(tile.itemid ~= 0 and not isCreature(tile.uid)) then if(hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end end if(getTopCreature(pos).uid ~= 0 and not creature) then return false end return true end local function doPushCreature(target, times) if(isCreature(target) and times > 0) then local pos = getCreatureLookPosition(target) if(isWalkable(pos)) then doTeleportThing(target, pos) doSendMagicEffect(getThingPos(target), 2) addEvent(doPushCreature, 1, target, times-1) end end end local function doSpell(cid, target, var) local pos = getThingPos(target) local config = { [NORTH] = {SOUTH, {x=pos.x, y=pos.y+1, z=pos.z}}, [EAST] = {WEST, {x=pos.x-1, y=pos.y, z=pos.z}}, [SOUTH] = {NORTH, {x=pos.x, y=pos.y-1, z=pos.z}}, [WEST] = {EAST, {x=pos.x+1, y=pos.y, z=pos.z}} } local a, b = config[getCreatureLookDirection(target)], getCreatureLookPosition(target) if(isWalkable(a[2]) and isWalkable(b)) then doPushCreature(target, 3) -- aqui você configura quantos SQMs ele empurra doTeleportThing(cid, a[2], false) doCreatureSetLookDirection(cid, getCreatureLookDirection(target)) doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Position blocked.") return false end return true end function onCastSpell(cid, var) return doSpell(cid, getCreatureTarget(cid), var) end
-
[PEDIDO] Vip no nome
Troca o script por esse: local config = { removeItem = "yes", strInName = "[VIP] ", vipStorage = 13500, vipDays = 15 } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time()) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end depois vá em login.lua e la no final você coloca isso: if(string.find(getCreatureName(cid), "[VIP] ")) then if(getPlayerStorageValue(cid, 13500) < os.time) then local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid) setPlayerStorageValue(cid, 13500, -1) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";") return true end end
-
(Resolvido)Spell de empurrar
Tenta assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 20) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.3, 0, -7.3, 0) local function isWalkable(pos, creature, pz, proj) if(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end if(getTilePzInfo(pos) and not pz) then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if(tile.itemid ~= 0 and not isCreature(tile.uid)) then if(hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end end if(getTopCreature(pos).uid ~= 0 and not creature) then return false end return true end local function doSpell(cid, target, var) local pos = getThingPos(target) local config = { [NORTH] = {SOUTH, {x=pos.x, y=pos.y+1, z=pos.z}}, [EAST] = {WEST, {x=pos.x-1, y=pos.y, z=pos.z}}, [SOUTH] = {NORTH, {x=pos.x, y=pos.y-1, z=pos.z}}, [WEST] = {EAST, {x=pos.x+1, y=pos.y, z=pos.z}} } local a, b = config[getCreatureLookDirection(target)], getCreatureLookPosition(target) if(isWalkable(a[2]) and isWalkable(b)) then doTeleportThing(target, b) doTeleportThing(cid, a[2], false) doCreatureSetLookDirection(cid, getCreatureLookDirection(target)) doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Position blocked.") return false end return true end function onCastSpell(cid, var) return doSpell(cid, getCreatureTarget(cid), var) end
-
(Resolvido)Spell de empurrar
Isso seria um problema, pois e se tivesse um objeto block (walls por exemplo) atras ou na frente do target?
-
[PEDIDO] Vip no nome
Tenta trocar: db.executeQuery por: db.query
-
[PEDIDO] Vip no nome
local config = { removeItem = "yes", strInName = "[VIP] " } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end Agora só adicionar a TAG em actions
-
(Resolvido)Spell de empurrar
http://www.tibiaking.com/forum/topic/39025-puxarempurrar-conjunto-de-spells/ Você pode usar a ferramenta de pesquisa ali no canto superior.
-
[PEDIDO] Vip no nome
local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id` = "..guid..";")
-
Problema no pc!
Deve ser problema no mouse.
-
(Resolvido)[Pedido] Recompensa Aleatória
Tipo isso: local config = { [13401] = "C16 Doll", [13402] = "Goku Doll", [13403] = "Vegeta Doll", } local rand = {} for itemid, _ in pairs(config) do table.insert(rand, itemid) end rand = rand[math.random(#rand)] doItemSetAttribute(doPlayerAddItem(cid, rand), "name", ""..config[rand].." / "..getCreatureName(cid).." completou todas tasks") ?
-
Criando Sprite
Acho que ninguém fará isso de graça, pois da muito trabalho.
-
(Resolvido)Ajuda Spell
Acho que entendi agora, o effect por ser "torto" tem que ter sua posição declarada. Tenta assim: local combat, combat_effect = createCombatObject(), createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.3, 0, -7.3, 0) local arrs = { createCombatArea({ -- combat {1,1,1,1,1}, {1,1,1,1,1}, {1,1,1,1,1}, {1,1,1,1,1}, {1,1,1,1,1}, {1,1,1,1,1}, {0,0,2,0,0} }), createCombatArea({ -- effect {0,0,0,0,0}, {1,0,1,0,1}, {0,0,0,0,0}, {1,0,1,0,1}, {0,0,0,0,0}, {1,0,1,0,1}, {0,0,2,0,0} }) } setCombatArea(combat, arrs[1]) setCombatArea(combat_effect, arrs[2]) function onTargetTile(cid, pos) if(getCreatureLookDirection(cid) == NORTH) then -- (/\) doSendMagicEffect(pos, 98) -- Se o effect for torto, da pra fazer assim "doSendMagicEffect({x=pos.x+1, y=pos.y+1, z=pos.z}, 98)" elseif(getCreatureLookDirection(cid) == EAST) then -- (>>) doSendMagicEffect(pos, 98) elseif(getCreatureLookDirection(cid) == SOUTH) then -- (\/) doSendMagicEffect(pos, 98) elseif(getCreatureLookDirection(cid) == WEST) then -- (<<) doSendMagicEffect(pos, 98) end end setCombatCallback(combat_effect, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) return doCombat(cid, combat, var), doCombat(cid, combat_effect, var) end ali em "arrs" você coloca a area que o dano vai bater e a area que vai aparecer os efeitos, o resto eu acho que você deve saber configurar. OBS: Não se esqueça de colocar junto da TAG nas spell o parâmetro ( direction="1" ).
-
(Resolvido)Ajuda Spell
Não entendi muito bem... Mas fiz um aqui pra ver: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.3, 0, -7.3, 0) local arr = createCombatArea({ {1,1,1}, {1,1,1}, {1,1,1}, {1,3,1} }) setCombatArea(combat, arr) function onTargetTile(cid, pos) local dir = getCreatureLookDirection(cid) if(dir == NORTH) then doSendMagicEffect(pos, 98) -- aqui voce configura os efeitos das direcoes elseif(dir == EAST) then doSendMagicEffect(pos, 96) elseif(dir == SOUTH) then doSendMagicEffect(pos, 99) elseif(dir == WEST) then doSendMagicEffect(pos, 97) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) return doCombat(cid, combat, var) end OBS: Não testei.
-
[Pedido] Magia Exaust
Magia de paralyzar: local config = { storage = 11111, paralyzeTime = 5, -- em segundos } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 100) setConditionFormula(condition, -0.9, 0, -0.9, 0) local function keepParalyze(target) if(isPlayer(target) and exhaustion.check(target, config.storage) or isMonster(target)) then doAddCondition(target, condition) end end function onTargetCreature(cid, target) if(isPlayer(target)) then exhaustion.set(target, config.storage, config.paralyzeTime) end local delay = 0 while(delay <= (config.paralyzeTime*1000)) do addEvent(keepParalyze, delay, target) delay = delay + 100 end end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) return doCombat(cid, combat, var) end magia de remover paralyze: local storage = 11111 function onCastSpell(cid, var) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) return setPlayerStorageValue(cid, storage, -1) end
-
(Resolvido)[Duvida] Metatables
Bom... Já faz um tempo que eu tenho essa duvida sobre metatables, e queria saber como funcionam e o que fazem. Eu resolvi procurar sobre quando eu me deparei com uma delas nas libs do servidor: Mas nunca cheguei a uma conclusão, por isso eu decidi criar esse post pedindo a ajuda de vocês, espero que alguém saiba como isso funciona.
-
(Resolvido)Talkaction que remove 1 frag
function onSay(cid, words, param) if(param == "") then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command need a player name param.") end local pid = getPlayerByNameWildcard(param) if(not pid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not exist or is offline.") end local result, retInt = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");"), result:getDataInt("unjustified") if(result:getID() ~= -1) then if(retInt >= 0) then db.executeQuery("UPDATE `killers` SET `unjustified` = "..(retInt - 1).." WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Frag removed successfully.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player do not have frag.") end result:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Failed.") end return true end Não testei...
-
(Resolvido)Teleport que fala e muda de cor
Vá em globalevents/scripts crie um arquivo LUA e dentro coloque isso: local config = { --["nome do texto"] = {position} -- Lembrando que o texto é limitado para apenas 9 caracteres. ["Texto1"] = {x=160, y=52, z=6}, ["Texto2"] = {x=160, y=52, z=6}, ["Etc..."] = {x=160, y=52, z=6} } function onThink(cid, interval, lastExecution) for text, pos in pairs(config) do doSendAnimatedText(pos, text, math.random(1,255)) end return true end e em globalevents.xml adicione a TAG: <globalevent name="EVENT_NAME" interval="1000" event="script" value="NOME_DO_ARQUIVO.lua"/>
-
Monstro Ataca quem tem Storage
No erro esta falando que sua TAG ainda ta como "target". Coloque como "attack"