
Tudo que mullino postou
-
Usar Item Em Wands
nao consegui colocar o video para vc ver entao vou tentar explicar melhor para vc entender acho q falei tudo errado @Cerberus olha ae agora esta certo!!! o post pq tem um ot que da certo ae o attack fica das duas sword o da dual e o da normal
-
Usar Item Em Wands
isssuuu garotttooooo isssu mesmo vc tem zap tenho um video aki posso ten eviar
-
Usar Item Em Wands
acho q é issu mesmo
-
Usar Item Em Wands
pq tipo a minha ideia é fazer uma bag q tenha 10 % de chance de achar a pedra dual stone essa petra dual stone permite vc equipar 2 armas sendo elas sword club axe bow e wands mas tipo o attack so funcionaria em players no pvp uma sword normal hita 1 k com a dual stone ela vai hitar 2 k e as dual stones terem elementos como dual stone fire e dual stone ice mas que so funcionace em players em monstro nao prescisa !! entendi entao e na pedra que tem q fazer dobra o ataque do item equipado?
-
[Duvida] Função de item equipado
Ajuda eu no meu então Pai Acho q esse é difícil meu!
-
(Resolvido)Summon que cura o Player
intendii obrigadoooo mas tem como fazer por action?? au clicar ne item x sumona o gnomo
-
[Duvida] Função de item equipado
gostei da sua ideia se consegui vc compartilha??
-
(Resolvido)Summon que cura o Player
tem o script do action para sumonar o gnomo vc colocou um id ali local max = 1 local item = 2394 -- id do item para sumonar prescisa de uum action nao?
-
Usar Item Em Wands
Boa noite galerinha do tk Teria como colocar para usar esse item em Wand add a funçao local function isWand(uid) -- Function by Mock the bear. mas nao esta funcionando segue o script local function isWand(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 6 then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 then return true end return false end local function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end if isCreature(itemEx.uid) == TRUE then return false end if isWeapon(itemEx.uid) then if math.random(1,100) < 15 then doItemSetAttribute(itemEx.uid, 'dualwield', true) doPlayerSendCancel(cid, "Item encantado com sucesso!") else doPlayerSendCancel(cid, "Sua pedra quebrou ao tentar encantar o item.") end doRemoveItem(item.uid) elseif isWand(itemEx.uid) then if math.random(1,100) < 15 then doItemSetAttribute(itemEx.uid, 'dualwield', true) doPlayerSendCancel(cid, "Item encantado com sucesso!") else doPlayerSendCancel(cid, "Sua pedra quebrou ao tentar encantar o item.") end doRemoveItem(item.uid) elseif isShield(itemEx.uid) then if math.random(1,100) < 15 then doItemSetAttribute(itemEx.uid, 'dualwield', true) doPlayerSendCancel(cid, "Item encantado com sucesso!") else doPlayerSendCancel(cid, "Sua pedra quebrou ao tentar encantar o item.") end doRemoveItem(item.uid) elseif isBow(itemEx.uid) then if math.random(1,100) < 15 then doItemSetAttribute(itemEx.uid, 'dualwield', true) doPlayerSendCancel(cid, "Item encantado com sucesso!") else doPlayerSendCancel(cid, "Sua pedra quebrou ao tentar encantar o item.") end doRemoveItem(item.uid) else doPlayerSendCancel(cid, "Use a pedra em alguma arma.") end return true end
-
SD De Attack mínimo e máximo
BOA NOITE GALERINHA DO TK Tem como fazer uma SD com attack mínimo e máximo que não seja por magiclevel igual a normal? Porque eu criei uma nova sd no meu ot mas o attack por Magic não serve pra min pq essa todas as vocações vão usar. E O atack varia muito quero uma com attack fixo Alguém pode ajudar galera
-
(Resolvido)Talkactions por Actions
obrigado vc e de mais [Resolvido]
-
(Resolvido)Talkactions por Actions
tem como add uma storage para nao fazer outra vez a quest ?
-
(Resolvido)Talkactions por Actions
nao é item @Vodkart é taslkactions era so falar o comando !revoluctions druid q o players virava a nova vocaçao mas agora quero q quando o players clicar no bau ele ganhe essa vocaçao, nao prescisa ter level so dele clicar no bau ele ganha
-
(Resolvido)Talkactions por Actions
Boa tarde galera do tk tem como trocar esse script de talkactions por action vou colocalo ne uma quest ae se puder add para dar um item tbm agradeço segue o script ele da uma nova vocaçao o players function onSay(cid, words, param) config = { LevelNeed = 15000, vocs = {10}, pid = getPlayerGUID(cid), newlv = 100, life = 1000, mana = 1500, newvoc = 14 } if getPlayerLevel(cid) < config.LevelNeed then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você Precisa Level "..config.LevelNeed.." Para Avançar de Promotion.") elseif not isInArray(config.vocs, getPlayerVocation(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você Não é Revoluction Druid Para Atingir Uma Nova Promotion.") end doBroadcastMessage("O jogador "..getCreatureName(cid).." Virou New Revoluction Druid! Se Virem Ele Fuja!!! ",MESSAGE_STATUS_WARNING) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.query("UPDATE `players` SET `level` = "..config.newlv..", `experience` = "..getExperienceForLevel(config.newlv)..",`manamax` = "..config.mana..",`health` = "..config.life..", `healthmax` = "..config.life..",`mana` = "..config.mana..",`vocation` = "..config.newvoc.." WHERE `id` = "..config.pid) return true end
-
Aura 2 Bugada
boa noite bom dia boa tarde boa madrugada galera estou com um problema na aura2 do meu ot ela reala a quantidade de mana q o player tiver de uma vez eu ja mudei a configuraçao toda coloquei ae 0.1 mas continua realando tudo ae players nao morre no pvp quando ta de aura ativada segue o script alguem pode arrumar pra min ele nao da erro nenhunn so esta realando a mana que o players tem toda de uma vez -- CONFIGURAÇÕES aurastrs = 25943 -- storage da aura estrs = 25813 -- storage para o exhaust porcentagems = 25 -- chance de curar em cada volta da aura, em porcentagems quantheals = 0.1 -- porcentagems do hp máximo que cada cura irá curar. (No caso, irá curar 5% do hp máximo cada cura) tempos = 1180 -- tempos para dar uma volta no player (este tempos foi o que achei mais agradável visualmente, é recomendável não mudar) tipoauras = 59 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo) efeitocuras = 59 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura2s(i,tm,cid) if(isCreature(cid)) then local atuals = getCreaturePosition(cid) local posauras = { {x=(atuals.x)-1, y=(atuals.y)-1, z=atuals.z}, {x=atuals.x, y=(atuals.y)-1, z=atuals.z}, {x=(atuals.x)+1, y=(atuals.y)-1, z=atuals.z}, {x=(atuals.x)+1, y=atuals.y, z=atuals.z}, {x=(atuals.x)+1, y=(atuals.y)+1, z=atuals.z}, {x=atuals.x, y=(atuals.y)+1, z=atuals.z}, {x=(atuals.x)-1, y=(atuals.y)+1, z=atuals.z}, {x=(atuals.x)-1, y=atuals.y, z=atuals.z}, } local chances = math.random(100) if(chances<=porcentagems/8) then doCreatureAddMana(cid, getCreatureMaxMana(cid)/quantheals) if(i<=8 and i>1) then doSendDistanceShoot({x=posauras.x, y=posauras.y, z=posauras.z}, atuals, tipoauras) else doSendDistanceShoot({x=posauras[1].x, y=posauras[1].y, z=posauras[1].z}, atuals, tipoauras) end doSendMagicEffect(atuals, efeitocuras) local direito = {x = getCreaturePosition(cid).x + 1,y = getCreaturePosition(cid).y , z = getCreaturePosition(cid).z} doSendMagicEffect(direito, efeitocura) end if(i<=8 and getPlayerStorageValue(cid, aurastrs)==2) then i = i+1 tm = tempos/8 return addEvent(efeitosAura2s,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastrs)==2) then return efeitosAura2s(1,0,cid) else return TRUE end else return TRUE end end -- Função principal function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 89124) <= 0 then doPlayerSendCancel(cid, "Você precisa ter feito a quest.") return true end if getPlayerStorageValue(cid, 25950) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 1.") return true end if getPlayerStorageValue(cid, 27651) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 3.") return true end if getPlayerStorageValue(cid, 28911) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 4.") return true end if(param=="on") then if getPlayerStorageValue(cid, estrs) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estrs) - os.time()).." segundos para poder habilitar aura level 2 novamente.") else if(getPlayerStorageValue(cid, aurastrs)==2) then doPlayerSendCancel(cid,"Sua Aura Level 2 já está habilitada.") elseif(getPlayerStorageValue(cid, aurastrs)==-1) then doPlayerSendCancel(cid,"Aura Level 2 ligada!") setPlayerStorageValue(cid, aurastrs, 2) efeitosAura2s(1,tempos/8,cid) end end elseif(param=="off") then if(getPlayerStorageValue(cid, aurastrs)== 2) then setPlayerStorageValue(cid, estrs, os.time()+2) setPlayerStorageValue(cid, aurastrs, -1) doPlayerSendCancel(cid,"Aura Level 2 desligada!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite '!aura2 on' para ligar sua aura, e '!aura2 off' para desligá-la.") end return true end
-
(Resolvido)Alavanca Que Teleporta 10 Players
Chego em casa meia noite aí vou testar
-
(Resolvido)Alavanca Que Teleporta 10 Players
[Error - Action Interface] data/actions/scripts/Quest10.lua:onUse Description: attempt to index a nil value stack traceback: [C]: in function 'doTeleportThing' data/actions/scripts/Quest10.lua:26: in function <data/actions/scripts/Quest10.lua:15> deu esse erro ajuda ae
-
Systema de Vip
Fala Galerinha Hoje venho pedir vcs um comando de 1 dia de Vip gratis para players tentei fazer um mas nao estou conseguindo sempre da erro meu systema de vip é do monk esse vip = { name = "VIP System"; author = "Mock"; version = "1.0.0.0"; query="ALTER TABLE `accounts` ADD `vip_time` INTEGER"; query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL" } function vip.setTable() dofile('config.lua') if sqlType == "sqlite" then db.query(vip.query) else db.query(vip.query2) end end function vip.getVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';") if ae:getID() == -1 then return 0 end local retee = ae:getDataInt("vip_time") or 0 ae:free() return retee end function vip.getVipByAcc(acc) assert(acc,'Account is nil') local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';") if a:getID() ~= -1 then return a:getDataInt("vip_time") or 0, a:free() else error('Account don\'t find.') end end function vip.setVip(cid,time) dofile("config.lua") assert(tonumber(cid),'Parameter must be a number') assert(tonumber(time),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; db.query("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';") end function vip.getVipByAccount(acc) assert(acc,'Account is nil') return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0 end function vip.hasVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) or 0 if os.time(day) < t then return TRUE else return FALSE end end function vip.hasVips(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) if os.time(day) < t then return TRUE else return FALSE end end function vip.accountHasVip(acc) assert(acc,'Account is nil') if os.time() < vip.getVipByAccount(acc) then return TRUE else return FALSE end end function vip.getDays(days) return (3600 * 24 * days) end function vip.addVipByAccount(acc,time) assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') local a = vip.getVipByAcc(acc) a = os.difftime(a,os.time()) if a < 0 then a = 0 end; a = a+time return vip.setVipByAccount(acc,a) end function vip.setVipByAccount(acc,time) dofile("config.lua") assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';") return TRUE end function vip.returnVipString(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == TRUE then return os.date("%d %B %Y %X ", vip.getVip(cid)) end end e o da talkaction e esse mas da erro function onSay(cid, words, param, channel) local storage_acc = 15000 local days = 1 local acc = getPlayerAccountId(cid) local time = isVip(cid) and getAccountVipTime(acc) or os.time() if getAccountStorageValue(getPlayerAccountId(cid), storage_acc) <= 0 then setAccountStorageValue(acc, storage_acc, 1) addEvent(setAccountVipTime, 1010, acc, time + 3600*24*days) doSendMagicEffect(getThingPosition(cid),38) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce recebeu "..days.." dia de vip.") addEvent(doRemoveCreature,1000,cid) return true else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce só pode usar esse comando 1 vez por account!") return true end return true end so que quando o player fala o comando !vipgratis da essa erro [Error - TalkAction Interface] data/talkactions/scripts/vipgratis.lua:onSay Description: data/talkactions/scripts/vipgratis.lua:6: attempt to call global 'isVip' (a nil value) stack traceback: data/talkactions/scripts/vipgratis.lua:6: in function <data/talkactions/scripts/vipgratis.lua:1> alguem pode me ajudar? @Vodkart
-
(Resolvido)Alavanca Que Teleporta 10 Players
Obrigado mais uma vez Mestre. Respondido
-
(Resolvido)[RESOLVIDO] Players vs Players
Obrigado @Vodkart Funcionou Perfeitamente... mais uma vez Obrigado por me Ajudar, e um dos poucos que se despoem a ajudar sem cobrar por scripts hoje em dia..... sem contar que é o que eu conheço o melhor scripter... [RESOLVIDO]
-
(Resolvido)[RESOLVIDO] Players vs Players
Olha ae a menssagem que aparece @Vodkart Mesmo com os 8 players nas posiçoes corretas olha o script <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=44, y=279, z=7}, {x=21, y=480, z=7}}, {{x=45, y=279, z=7}, {x=21, y=480, z=7}}, {{x=44, y=280, z=7}, {x=21, y=480, z=7}}, {{x=45, y=280, z=7}, {x=21, y=480, z=7}}, }, positions2 = { {{x=47, y=279, z=7}, {x=78, y=448, z=7}}, {{x=48, y=279, z=7}, {x=78, y=448, z=7}}, {{x=47, y=280, z=7}, {x=78, y=448, z=7}}, {{x=48, y=280, z=7}, {x=78, y=448, z=7}}, }, money = 500,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x = 14, y= 442, z=7}, -- pos começo da arena b = {x = 88, y= 493, z=7}, -- pos final da arena exit_pos = {x=151, y=50, z=7} } function getPlayersWithGuildInArena(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 function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if getCreatureName(cid) ~= "Account Manager" and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="7124" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1]).uid) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid)..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid doTeleportThing(creature, config.positions[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid doTeleportThing(creature, config.positions2[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod>
-
(Resolvido)Alavanca Que Teleporta 10 Players
Boa Tarde Galerinha Do Tk Gostaria De Um Script q teleporta 10 players ao puxar a alavanca para a posiçao x 28 y 779 z 7 Des DE JA Agradeço
-
(Resolvido)[RESOLVIDO] Players vs Players
Ae @Vodkart Funciou ate emtao mas sempre q clicamos na alvanca fala que nao tem player en todas as posiçoes ja confire as posiçoes estao corretas <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=21, y=480, z=7}, {x=44, y=279, z=7}}, {{x=21, y=480, z=7}, {x=45, y=279, z=7}}, {{x=21, y=480, z=7}, {x=44, y=280, z=7}}, {{x=21, y=480, z=7}, {x=45, y=280, z=7}}, }, positions2 = { {{x=78, y=448, z=7}, {x=47, y=279, z=7}}, {{x=78, y=448, z=7}, {x=48, y=279, z=7}}, {{x=78, y=448, z=7}, {x=47, y=280, z=7}}, {{x=78, y=448, z=7}, {x=48, y=280, z=7}}, }, money = 1,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x = 14, y= 442, z=7}, -- pos começo da arena b = {x = 88, y= 493, z=7}, -- pos final da arena exit_pos = {x=151, y=50, z=7} } function getPlayersWithGuildInArena(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 function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if getCreatureName(cid) ~= "Account Manager" and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="7124" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1]).uid) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid)..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid doTeleportThing(creature, config.positions[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid doTeleportThing(creature, config.positions2[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod>
-
(Resolvido)[RESOLVIDO] Players vs Players
add na 032-position.lib ficou asim function isInRange(position, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end function getDistanceBetween(fromPosition, toPosition) local x, y = math.abs(fromPosition.x - toPosition.x), math.abs(fromPosition.y - toPosition.y) local diff = math.max(x, y) if(fromPosition.z ~= toPosition.z) then diff = diff + 9 + 6 end return diff end function getDirectionTo(pos1, pos2) local dir = SOUTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end elseif(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end return dir end function getCreatureLookPosition(cid) return getPositionByDirection(getThingPosition(cid), getCreatureLookDirection(cid)) end function getPositionByDirection(position, direction, size) local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end function doComparePositions(position, positionEx) return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z end function getArea(position, x, y) local t = {} for i = (position.x - x), (position.x + x) do for j = (position.y - y), (position.y + y) do table.insert(t, {x = i, y = j, z = position.z}) end end return t end function Position(x, y, z, stackpos) local position = {x = 0, y = 0, z = 0} if(isNumeric(x .. y .. z)) then position = {x = x, y = y, z = z} if(isNumeric(stackpos)) then position.stackpos = stackpos end end return position end function isValidPosition(position) return (isNumeric(position.x .. position.y .. position.z) and position.x > 0 and position.y > 0 and position.z >= 0 and position.z <= 15) end function isInRange(pos, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end ae esse erro Account Manager has logged in. [Error - CreatureScript Interface] function onLogin(cid) domodlib('arena_config') if isInRange(getCreaturePosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end:onLogin Description: data/lib/032-position.lua:105: attempt to index global 'position' (a nil value) stack traceback: data/lib/032-position.lua:105: in function 'isInRange' [string "LuaInterface::loadBuffer"]:3: in function <[string "LuaInterface::loadBuffer"]:1> Account Manager has logged out. [Error - CreatureScript Interface] In a timer event called from: data/creaturescripts/scripts/antimc.lua:onLogin Description: (internalGetPlayerInfo) Player not found when requesting player info #29 Se trocasse essa função de teleportar os vencedores para o templo por abrir um teleport não resolveria esse bug não? Se trocasse essa função de teleportar os vencedores para o templo por abrir um teleport não resolveria esse bug não?
-
(Resolvido)[RESOLVIDO] Players vs Players
function isInRange(position, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end tem issu na primeira linha pode add o seu asim memo?