
Tudo que Capitao wyz postou
-
Ajuda simples de sistema de lenhador *
Sim é o mesmo ID, eu tentei com varias outras arvores como no print a baixo e o o problema continua, a arvore só é cortada corretamente quando sumono com o adm =/
-
Ajuda simples de sistema de lenhador *
Ola bom dia, amigo deu certo porem quando eu corto a arvore eu n consigo mais me mover . consegui arrumar aqui amigo muito obg pela ajuda s2 amigo descobri um bug poderia me ajudar ? so esta funcionando quando eu sumono o arvore com o adm, as arvores que estao salva no mapa ainda estao com o mesmo problema que n some quando é cortada
-
Ajuda simples de sistema de lenhador *
Ola galera Bom dia, Boa tarde e Boa noite. Estou com um problema que acredito que pra vcs que ja tem bastante experiencia pode ser bem facil e rapido de resolver, é um sistema de lenhador porem quando eu corto a arvore ela n some mas aparece o toco que era pra ficar no lugar da arvore normalmente, e a segunda coisa que eu queria perdir é que quando vc usa o item para corta a arvore a outfit troca e eu NÃO queria que trocasse, alguem poderia me ajudar PF ??? Você tem o código disponível? Se tiver publique-o aqui: local config = { item = {13048}, -- Itens que poderão ser cortados chance = 70, -- Chance de cortar (1 a 100) madeiras = {26381, 2674}, -- Itens que o player poderá ganhar transformItem = 26147, -- Item o qual a árvore será transformado texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore time = 1, -- Minutos para a arvore crescer novamente outfit = {[0] = 0, [1] = 0}, -- Outfits female e male out_time = 0 -- Tempo em segundos que a outfit estará trocada. } local function checkMove(uid) if isPlayer(uid) then doCreatureSetNoMove(uid, FALSE) end end local function Arvore(pos, t) doCleanTile(pos) doCreateItem(config.transformItem, 1, pos) addEvent(function() doCleanTile(pos) doCreateItem(t, 1, pos) end, config.time * 60 * 1000) end function onUse(cid, item, fromPosition, itemEx, toPosition) local text = config.texts[math.random(1, #config.texts)] local t = nil if isInArray(config.item, itemEx.itemid) then doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000) doCreatureSetNoMove(cid, TRUE) addEvent(checkMove, config.out_time * 1000, cid) if math.random(1,100) >= config.chance then local wood = math.random(3, 7) local prem = config.madeiras[math.random(1, #config.madeiras)] doPlayerAddItem(cid, prem, wood) doSendMagicEffect(toPosition, 1) doSendMagicEffect(fromPosition, 1) doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".") doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE) t = itemEx.itemid Arvore(toPosition, t) else doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE) doSendMagicEffect(toPosition, 1) doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE) end return true end end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
(Resolvido)Ajuda simples de sistema de PET
Cara perfeito, muito obrigado pela atençao ajudou muito s2
-
(Resolvido)Ajuda simples de sistema de PET
Ola boa tarde, nao querendo abusar mas poderia me ajudar fazendo isso pra min pf ?
-
(Resolvido)Ajuda simples de sistema de PET
Ola Bom dia, sim em conta normal tambem esta com o mesmo problema ;-;
-
(Resolvido)Ajuda simples de sistema de PET
Ola boa noite ainda estou com o mesmo problema, consigo sumonar mesmo depois que o pet morre :[ OBRIGADO PELA TENTATIVA !
-
(Resolvido)Ajuda simples de sistema de PET
Bom dia, Boa Tarde e Boa noite galera tudo bem ?, estou com um simples problema. gostaria que o pet depois que morresse levaria 1 minuto para q a pessoa pudesse usa o item para invocar ele novamente, alguem poderia me ajudar PF ???? Você tem o código disponível? Se tiver publique-o aqui: function onUse(cid, item, frompos, item2, topos) local dolls = { [2155] = {pet = "Pet Dalmata"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR [2277] = {pet = "Pet Bode"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR } local go = dolls[item.itemid] local summon = getCreatureSummons(cid) local waittime = 60 -- Tempo de exhaustion em segundos local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc... if exhaustion.check(cid, strtime) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, strtime) .. " segundos para usar esse item novemente.") return true end --------------------------------------------------- if not (getTilePzInfo(getCreaturePosition(cid))) then if #summon >= 1 then for _, pid in ipairs(summon) do doRemoveCreature(pid) doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1) -- MENSAGEM AO REMOVER O PET exhaustion.set(cid, strtime, waittime) -- checar time end return true end if item.itemid == 2155 then -- ID DO ITEM doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) -- MENSAGEM AO SUMONAR O PET doSendAnimatedText(getPlayerPosition(cid), "!!!", 180) end if item.itemid == 2277 then -- ID DO ITEM doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) -- MENSAGEM AO SUMONAR O PET doSendAnimatedText(getPlayerPosition(cid), "!!!", 180) end else doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) return true end end
-
[AJUDA] BUG CASSINO
UP so modificar essa parte e por 400 addEvent(result, (rand + 2) * 400, cid)
- Skin System por comando !skin [8.6]
- Skin System por comando !skin [8.6]
- Skin System por comando !skin [8.6]
-
[PEDIDO-SPELL] magia De Trap
Em area local config = { exhaust_storage = 5750, exhaust_time = 30, -- walls conf walls_time = 10, area_size = 3, walls_pos = { ["vertical"] = 13051, ["horizontal"] = 13051, ["rightcorner"] = 13051, ["leftcorner"] = 13051 } } local function buildWalls(cid) local cid_pos = getThingPosition(cid) local size = config.area_size for x = -size, size do for y = -size, size do if(math.abs(x) == size or math.abs(y) == size) then local target_pos = {x = (cid_pos.x + x), y = (cid_pos.y + y), z = cid_pos.z} if(doTileQueryAdd(cid, target_pos) == 1 and not getTileInfo(target_pos).protection) then local create_item = nil if(x == -size and y == -size) then create_item = config.walls_pos["leftcorner"] elseif(x == size and y == size) then create_item = config.walls_pos["rightcorner"] elseif(math.abs(x) == size and not (x == size and y == -size)) then create_item = config.walls_pos["vertical"] else create_item = config.walls_pos["horizontal"] end doCreateItem(create_item, 1, target_pos) local _time = config.walls_time for i = 0, _time do addEvent(function() local uid = getTileItemById(target_pos, create_item).uid if(uid ~= 0) then if(i < _time) then doSendAnimatedText(target_pos, (_time - i), 180) else doRemoveItem(uid) end end end, 1000 * i) end end end end end end function onCastSpell(cid, var) if(isPlayer(cid) and exhaustion.check(cid, config.exhaust_storage)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, config.exhaust_storage) .. " segundos para usar novamente.") return false end exhaustion.set(cid, config.exhaust_storage, config.exhaust_time) buildWalls(cid) return true end <instant name="Nome da magia" words="Nome da magia" lvl="325" mana="10" aggressive="1" range="5" blockwalls="1" selftarget="1" exhaustion="1900" needlearn="0" event="script" value="EX:Hashirama/Nome da magia.lua"> Em Target local t = { remove_time = 5, -- tempo em segundos para remover as magic wall item_id = 13057, -- id da lavar que vai ficar ao redor effe = 480 -- efeito da lava(fogo- sla) } 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 local creature = getTopCreature(pos) if creature.type > 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 return true end function removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == t.item_id then doRemoveItem(removeTile.uid) end end end end function onCastSpell(cid, var) local waittime = 3 -- Tempo de exhaustion em segundos local storage = 5853 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas! if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.") return false end local pos = getPlayerPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} ---- aqui \/ você configura de acordo com a posição do seu efeito, para centralizar ele local pose = getPlayerPosition(getCreatureTarget(cid)) posTe1 = {x=pose.x+1,y=pose.y+1,z=pose.z} posTe2 = {x=pose.x+1,y=pose.y,z=pose.z} posTe3 = {x=pose.x+1,y=pose.y-1,z=pose.z} posTe4 = {x=pose.x,y=pose.y-1,z=pose.z} posTe5 = {x=pose.x-0,y=pose.y-1,z=pose.z} posTe6 = {x=pose.x-0,y=pose.y,z=pose.z} posTe7 = {x=pose.x-0,y=pose.y+1,z=pose.z} posTe8 = {x=pose.x,y=pose.y+1,z=pose.z} posTall = {posTe1,posTe2,posTe3,posTe4,posTe5,posTe6,posTe7,posTe8} --- fim /\ da configuração for a= 1, #posTall do doSendMagicEffect(posTall[a], t.effe) end addEvent(function() for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(t.item_id, 1, posAll[i]) end end end, 500) addEvent(removeItem, t.remove_time*1000, posAll) exhaustion.set(cid, storage, waittime) return true end <instant name="Nome da magia" words="Nome da magia" lvl="180" mana="10" aggressive="1" range="5" blockwalls="1" needtarget="1" exhaustion="1900" needlearn="0" event="script" value="EX:Hashirama/Nome da magia.lua"> Se ajudei deixe o like e rep se possivel
-
[AJUDA] SPELL
entendi mano, mas no caso se eu quiser q ele consiga dar os hits de 1 a 3 skm teria como ???
-
Npc de task simples
tranquilo mano é q esses esta funcionando aqui no meu peguei direto na base
-
[AJUDA] SPELL
perfeito amigo n sei nem como te agradecer, mas poderia me mostrar em qual parte vc mudou a distancia dos hits caso eu queira mudar ???
-
Npc de task simples
N sei se é oq vc precisa mas isso aqui é um mod q vou enviar, os creditos ja estao no codigo. <?xml version="1.0" encoding="UTF-8"?> <mod name="Simple Task" version="3.0" author="Vodkart" contact="xtibia.com" enabled="yes"> <config name="task_func"><![CDATA[ tasktabble = { ["wolf"] = {monster_race={"wolf"}, storage_start = 200201, storage = 91001,count = 50,exp = 25000000,money = 100000, reward = {{}}}, ["bandit Shinob"] = {monster_race={"bandit Shinob"}, storage_start = 200201, storage = 91002,count = 70,exp = 25000000,money = 100000, reward = {{}}}, ["bandit human"] = {monster_race={"Bandit Human"}, storage_start = 200201, storage = 91003,count = 70,exp = 25000000,money = 100000, reward = {{}}}, ["shinobi of sound"] = {monster_race={"Shinobi Of Sound"}, storage_start = 200201, storage = 91004,count = 100,exp = 25000000,money = 100000, reward = {{}}}, ["bandit gun"] = {monster_race={"Bandit Gun"}, storage_start = 200201, storage = 91005,count = 100,exp = 25000000,money = 100000, reward = {{}}}, ["great snake"] = {monster_race={"Great Snake"}, storage_start = 200201, storage = 91006,count = 120,exp = 25000000,money = 100000, reward = {{}}}, ["bandit swordman"] = {monster_race={"Bandit Swordman"}, storage_start = 200201, storage = 91007,count = 120,exp = 25000000,money = 100000, reward = {{}}}, ["dark snake"] = {monster_race={"Dark Snake"}, storage_start = 200201, storage = 91008,count = 150,exp = 25000000,money = 100000, reward = {{}}}, ["fighter"] = {monster_race={"Fighter"}, storage_start = 200201, storage = 91009,count = 150,exp = 25000000,money = 100000, reward = {{}}}, ["shinobi fire"] = {monster_race={"Shinobi Fire"}, storage_start = 200201, storage = 91010,count = 160,exp = 25000000,money = 100000, reward = {{}}}, ["android"] = {monster_race={"Android"}, storage_start = 200201, storage = 91011,count = 160,exp = 25000000,money = 100000, reward = {{}}}, ["ocult shinobi"] = {monster_race={"Ocult Shinobi"}, storage_start = 200201, storage = 91012,count = 180,exp = 25000000,money = 100000, reward = {{}}}, ["destroyer"] = {monster_race={"destroyer"}, storage_start = 200201, storage = 91013,count = 180,exp = 25000000,money = 100000, reward = {{}}}, ["renegade"] = {monster_race={"renegade"}, storage_start = 200201, storage = 91014,count = 200,exp = 25000000,money = 100000, reward = {{}}}, ["wind elemental"] = {monster_race={"Wind Elemental"}, storage_start = 200201, storage = 91015,count = 200,exp = 25000000,money = 100000, reward = {{}}}, ["nukenin"] = {monster_race={"Nukenin"}, storage_start = 200201, storage = 91016,count = 250,exp = 25000000,money = 100000, reward = {{}}}, } configbosses_task = { {race = "minotaur",Playerpos = {x = 189, y = 57, z = 7}, FromPosToPos = {{x = 186, y = 54, z = 7},{x = 193, y = 60, z = 7}},time = 5}, {race = "necromancer",Playerpos = {x = 196, y = 39, z = 7}, FromPosToPos = {{x = 195, y = 37, z = 7},{x = 198, y = 41, z = 7}}, time = 5}, {race = "dragon",Playerpos = {x = 208, y = 59, z = 7}, FromPosToPos = {{x = 206, y = 56, z = 7},{x = 209, y = 65, z = 7}}, time = 5} } function CheckTask(cid) for k, v in pairs(tasktabble) do if getPlayerStorageValue(cid,v.storage_start) >= 1 then return true end end return false end function finisheAllTask(cid) local config = { exp = {true,10000000}, money = {true,1000000}, items ={true,{{13393,1},{13424,1},{13425,1}}}, premium ={true,7} } local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then setPlayerStorageValue(cid, 521456, 0) local b = getGlobalStorageValue(63005) if b == -1 then b = 1 end setGlobalStorageValue(63005,b+1) doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..' to finish the task!.') doPlayerAddPremiumDays(cid, config.premium[1] == true and config.premium[2] or 0) doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0) doPlayerAddMoney(cid, config.money[1] == true and config.money[2] or 0) if config.items[1] == true then doAddItemsFromList(cid,config.items[2]) end local dolls = { [13401] = "C16 Doll", [13402] = "Goku Doll", [13403] = "Vegeta Doll", [13404] = "Trunks Doll", [13405] = "Majin Boo Doll", [13406] = "Piccolo Doll", [13407] = "Son Gohan Doll", [13408] = "Chibi Gohan Doll", [13409] = "Cell Doll", [13410] = "Uub Doll", [13411] = "C17 Doll", [13412] = "C18 Doll", [13413] = "Cooler Doll", [13414] = "Tsuful Doll", [13415] = "Dende Doll", [13416] = "Gotenks Doll", [13417] = "Freeza Doll", [13418] = "Jenk Doll", [13419] = "Kaio Doll", [13420] = "Bardock Doll", [13421] = "Broly Doll", [13422] = "Saiyan Goten Doll", [13423] = "Saiyan Trunks Doll", } local rand = {} for itemid, _ in pairs(dolls) do table.insert(rand, itemid) end rand = rand[math.random(#rand)] doItemSetAttribute(doPlayerAddItem(cid, rand), "name", ""..dolls[rand].." / "..getCreatureName(cid).." completou todas tasks") end end function HavePlayerPosition(cid, from, to) return isInRange(getPlayerPosition(cid), from, to) and true or false end function getRankStorage(cid, value, max, RankName) -- by vodka local str ="" str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n" local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > max then break end str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]" k = k + 1 until not query:next() end return doShowTextDialog(cid, 2529, str) end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end function getItemsFromList(items) -- by vodka local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function doAddItemsFromList(cid,items) -- by vodka if table.maxn(items) > 0 then for i = 1, table.maxn(items) do local count = items[i][2] while count > 0 do if isItemStackable(items[i][1]) then doPlayerAddItemStacking(cid, items[i][1], 1) else doPlayerAddItem(cid, items[i][1],1) end count = count - 1 end end end end function pairsByKeys(t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 local iter = function () i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end ]]></config> <event type="login" name="TaskLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "KillTask") return true end]]></event> <talkaction words="/task;!task" event="buffer"><![CDATA[ domodlib('task_func') local param = string.lower(param) if param == "rank" then getRankStorage(cid, 521456, 20, "Task Rank Finalizadas") return true end local str = "" str = str .. "Tasks Completadas :\n\n" for k, v in pairsByKeys(tasktabble) do local contagem = getPlayerStorageValue(cid, v.storage) if (contagem == -1) then contagem = 1 end str = str..k.." = ".. (not tonumber(contagem) and "["..contagem.."]" or "["..((contagem)-1).."/"..v.count.."]") .."\n" end str = str .. "" return doShowTextDialog(cid, 12749, str) ]]></talkaction> <event type="kill" name="KillTask" event="script"><![CDATA[ domodlib('task_func') function onKill(cid, target, lastHit) if(isMonster(target) == true) then local n = string.lower(getCreatureName(target)) for race, mob in pairs(tasktabble) do if getPlayerStorageValue(cid,mob .storage_start) >= 1 then for i = 1,#mob.monster_race do if n == mob.monster_race[i] then local contagem = getPlayerStorageValue(cid, mob.storage) if (contagem == -1) then contagem = 1 end if not tonumber(contagem) then return true end if contagem > mob.count then return true end if contagem > mob.count then return true end setPlayerStorageValue(cid, mob.storage, contagem+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Parabéns! Voce finalizou a task de "..race.."." or "Total [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."") end end end end end return true end]]></event> </mod>
-
[AJUDA] SPELL
quase perfeito amigo agora ele n esta puxando mais, mas so q continua batendo de longe
-
[AJUDA] SPELL
quase certo amigo mas agora ele ta hitando de longe e logo apos dar os hits ele puxa o o target pra perto dele, mesmo se o target estando uma boa distancia dele, e no xml ja arrumei pra usar a magia so de perto e mesmo assim continua de longe xml " <instant name="magia" words="magia" lvl="300" mana="10" prem="0" range="1" exhaustion="1000" needlearn="0" event="script" value="zHinata/Kaitem.lua">"
-
[AJUDA] SPELL
Ola amigo deu quase certo mas agora os itens estao aparecendo ao redor do target esse itens tinha q aparecer ao redor do player q usa. imagem ilustrativa d como a magia deve funcionar
-
[AJUDA] SPELL
no player q usa né, se for no player q esta usando a spell pode retirar pf
-
[AJUDA] SPELL
isso mesmo amigo, eu nao quero q o player pule no target ! se puder ajudar agradeço muito
-
[AJUDA] SPELL
. Ola gostaria de uma pequena ajuda em uma spell, ela esta com uma funçao que quando eu uso ela, ela pula no target. {O QUE EU QUERO AFINAL} quero q ela n pule mais no target mas q continue funcionando normalmente ! codigo a baixo ja agradeço !!! Você tem o código disponível? Se tiver publique-o aqui: local quant_hit = 4 -- quantidade de hit's que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_SPEED, -1450) setConditionFormula(condition, 0, 0, 0, 0) setCombatCondition(combat, condition) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(target).x+i, y=getCreaturePosition(target).y+j, z=getCreaturePosition(target).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(target).x+px, y=getCreaturePosition(target).y+py, z=getCreaturePosition(target).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) <= 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then doTeleportThing(cid, position_target) local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end doAddCondition(cid, condition) doAddCondition(target, condition) local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end end 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 local creature = getTopCreature(pos) if creature.type > 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 return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doAddCondition(target, condition) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if isPlayer(cid) then doRemoveCondition(cid, CONDITION_PARALYZE) end if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil doAddCondition(target, condition) if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z} end if positions ~= nil and isWalkable(positions) then doTeleportThing(target, positions) end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then doRemoveCondition(target, CONDITION_PARALYZE) for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Chave q some em 15 dias
Desculpa mas é basicamente isso q ta no titulo mas vou explicar oq eu quero fazer, O player vai compra essa chave com o NPC e essa chave da acesso a um TILE so q esse item n vai sumir quando ele passar no tile { isso eu ja arrumei } oq ta faltando mesmo é fazer o tempo contar pq depois de 15 dias o Item vai sumir e ele teria q comprar outro.
-
Chave q some em 15 dias
Ola amigo eu testei aqui e o tempo n abaixa, é para um derivado de DBO n sei se tem algo aver mas agradeço pela tentativa.