
Tudo que Darcio Antonio postou
-
Mostrar Cooldowns na tela
Tem como colocar no otclient para mostrar o Cooldowns da magia na tela ?
-
Um Script e uma duvida
Galera tem de alguma forma fazer um script / spell para que o arqueiro possa acelerar os ataque tipo 2 flechas por segundo algo a sim e minha duvida e a seguinte o arqueiro nível 40 com 70 de skill de distancia esta errando muito os acertos danos onde mudo isso ?.
-
Script para suber soul mais rapido para premios.
Eciste alguma script que se o cara for premio a soul dele sobe mais rapido ? man hp etc... sem ser la no xml ?
-
Action simples
ia ser uma boa também quero saber se tem como .
-
Action simples
vlw man vo testar, muito obrigado pela paciência dês de já. Mano se liga o qeu significa isso if (getPlayerStorageValue(cid, 10001) == 0) then == 0 significa que e exatamente 10001 ? e oque significa isso setPlayerStorageValue(cid, 10001, 1) esse ,1) quer isso ai ele adiciona +1 no storage 10001 ? pra ficar 10002 ? e isso ou ele afirma tipo o storag 10001 é rela agora ? não entendi isso queria entender pra nao encher mais o saco. Ixi mano nao vai coloquei == 0 no 2 script e foi vo ver aq oq faço fiz isso mas nao esta dando local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = msg:lower() if msgcontains(msg, 'sim') then if (getPlayerStorageValue(cid, 10001) == 0) then selfSay('Esse Lucios vive falando que eu sou um mago mau, mas não é bem por ai.', cid) selfSay('Faço meus experimentos para sempre melhorar a qualidade de vida e o balanço da natureza aqui em venture..', cid) selfSay('Falando nisso você poderia me {ajudar} com algumas tarefinhas? Irei recompensa-lo no final.', cid) talkState[talkUser] = 1 else selfSay('Eu não tenho permissão para falar com você.', cid) end elseif msgcontains(msg, 'ajudar') then if talkState[talkUser] == 1 then if (getPlayerStorageValue(cid, 10001) == 1) then selfSay('Precizo de 5 {queijos podres}.', cid) end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Action simples
vou testar aqui Testei aqui mas não foi vo tentar explicar com calma oque quero. preciso de um npc que quando o cara fala com ele a 1x ele da um storage pra o player 10001, agora se o player já estiver com esse storage 10001 ai ele nao vai dar o storage 10001 de novo pra ele, so pega uma vez. tenho isso aqui que eu fiz. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'sim') then if (getPlayerStorageValue(cid,10000) > 0) then selfSay('Eu ja falei com você, vá atras do {Mago Berlino} e descubra oque ele esta fazendo...', cid) else doSendMagicEffect(getCreaturePosition(cid), 30) setPlayerStorageValue(cid,10001) selfSay('Ouvi falar que na montanha mais alta dos ogros vive o Mago Berlino, dizem que esse mago esta tramando alguma coiza para acabar com venture presizo que você vá la {investigar} oque esta acontecendo e me traga um {relatorio}.', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ai quando ele ganhar o storage 10001 ele vai la falar com otro npc. O outro npc só fala com ele se ele estiver com o storage 10001 se não ele fala que não tem permissão pra falar com ele. Aqui está meu outro npc. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'sim') then if (getPlayerStorageValue(cid,10001) < 0) then selfSay('Eu não tenho permissão para falar com você...', cid) else selfSay('Esse Lucios vive falando que eu sou um mago mal, mas não é bem por ai.', cid) selfSay('Faço meus experimentos para sempre melhorar a qualidade de vida e o balanço da natureza aqui em venture..', cid) selfSay('Falando nisso você poderia me {ajudar} com algumas tarefinhas? posso te dar alguma coiza em troca no final disso.', cid) end return true end if msgcontains(msg, "ajudar") and (getPlayerStorageValue(cid, 10001) == 1) then selfSay("Sai pra la!", cid) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Action simples
preciso de uma action simples, se o player estiver com tal storage exatamente aquele estorage acontece algo. Estou tentando algo assim mas não vai. if getPlayerStorageValue(cid, 10001) and msgcontains(msg, 'ajudar') then selfSay('Sai pra la', cid) end
-
Duvida
então no caso se o player estiver com o storange 1000 vai fazer algo if getPlayerStorageValue(cid, 1002) == 0 aqui no caso ele vai checar se o storage via ser 1002 exato == 0 siginifica que vai ser o storage exato que esta na chave correto ?
-
Duvida
Tenho uma duvida a respeito de Storage alguem pode me explicar oque siguinifica to tentando entender mas ta osso... getPlayerStorageValue(cid, 1000) < 0 getPlayerStorageValue(cid, 1000) > 0 getPlayerStorageValue(cid, 1000) < 1 getPlayerStorageValue(cid, 1000) > 1 getPlayerStorageValue(cid, 1000) == 0 getPlayerStorageValue(cid, 1000) == 1 getPlayerStorageValue(cid, 1000) ~= 0 getPlayerStorageValue(cid, 1000) ~= 1
-
Npcs
To bolando uma quest de tipo um char chega e fala com o npc ai ele te da um storange que nao pode ser pego de novo so pega 1 x ai ele pode falar com o otro npc e fazer as tarefas la depois ele vem entrega pro npc o pergaminho e guanha otro storange pra falar com otro npc e ai vai so que nao ta dano se liguem oq fiz de errado ? Primeiro NPC local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'sim')) then selfSay('Fiquei sabendo que no alto da montanha dos ogros vive um mago chamado Mago Berlino, ele é muito perigozo e tem o poder de destruir venture, precizo que você vá la e me traga um {relatorio} do que esta acontecendo.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'relatorio') and talkState[talkUser] == 1) then if (getPlayerStorageValue(cid,1004) < 0) then selfSay('Você ja me ajudou muito obrigado, agora você ja pode falar com meu irmão {Carlos}.', cid) else if(doPlayerRemoveItem(cid, 13057, 1) == TRUE) then setPlayerStorageValue(cid,1004,1) doPlayerAddExperience(cid,5000) selfSay('Agora você ja pode falar com {Carlos}.', cid) else doSendMagicEffect(getCreaturePosition(cid), 30) setPlayerStorageValue(cid,1000,1) selfSay('Precizo do relatorio, por favor vá e fale com o {Mago berlino}.', cid) end end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) SEGUNDO NPC local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'sim') and getPlayerStorageValue(cid, 1001) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Esse Lucios vive falando que eu sou um mago mal, mas não é bem por ai.', cid) selfSay('Faço meus experimentos para sempre melhorar a qualidade de vida e o balanço da natureza aqui em venture..', cid) selfSay('Falando nisso você poderia me {ajudar} com algumas tarefinhas? posso te dar alguma coiza em troca no final disso.', cid) end if msgcontains(msg, 'ajudar') and getPlayerStorageValue(cid, 1001) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Muito bem, precizo que você pegue 5 {queijos podres} que podem ser colotado matando monstros da caverna, quando pegar por favor traga aqui, estarei esperando.', cid) end if msgcontains(msg, 'queijos podres') and getPlayerStorageValue(cid, 1001) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Muito bem, precizo que você pegue 5 {queijos podres} que podem ser colotado matando monstros da caverna, quando pegar por favor traga aqui, estarei esperando.', cid) end if msgcontains(msg, 'ajudar') and getPlayerStorageValue(cid, 1001) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Muito bem, precizo que você pegue 5 {queijos podres} que podem ser colotado matando monstros da caverna, quando pegar por favor traga aqui, estarei esperando.', cid) talkState[talkUser] = 1 if(msgcontains(msg, 'queijos podres') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid, 1001) > 0 then selfSay('Você ja completou esta tarefa.', cid) else if(doPlayerRemoveItem(cid, 2235, 5) == TRUE) then setPlayerStorageValue(cid,1001,1) doPlayerAddExperience(cid,2000) selfSay('Excelente, como faz tempo que não saio daqui, presizo analizar se os peixes estão cresendo corretamente, me traga 5 {tilapias} para eu possa analizar.', cid) else selfSay('Preciso de 5 {queijos podres} não menos :(', cid) end end end return true end if msgcontains(msg, 'tilapias') and getPlayerStorageValue(cid, 1002) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Você me trouxe as 5 {tilapias}?', cid) talkState[talkUser] = 1 if(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid, 1002) > 0 then selfSay('Você ja completou esta tarefa.', cid) else if(doPlayerRemoveItem(cid, 7159, 5) == TRUE) then setPlayerStorageValue(cid,1002,1) doPlayerAddExperience(cid,2000) selfSay('Muito bem, agora presizo de 5 {couros de minotauro}, eles podem ser coletados matando minotauros.', cid) else selfSay('Preciso de 5 {tilapias} não menos :(', cid) end end end return true end if msgcontains(msg, 'couros de minotauro') and getPlayerStorageValue(cid, 1003) < 0 then selfSay('Você não tem permição para falar comigo.', cid) else selfSay('Você me trouxe as 5 {couros de minotauro}?', cid) talkState[talkUser] = 1 if(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid, 1003) > 0 then selfSay('Você ja completou esta tarefa.', cid) else if(doPlayerRemoveItem(cid, 5878, 5) == TRUE) then setPlayerStorageValue(cid,1003,1) doPlayerAddItem(cid,13057,1) doPlayerAddExperience(cid,2000) selfSay('Muito bem, agora leve esse relatorio para o lucios e mostre a ele todo o trabalho que estou fazendo aqui.', cid) else selfSay('Preciso de 5 {couros de minotauro} não menos :(', cid) end end end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Npc Auction Versão 1.0 [Atualizado]
se eu falo demon armor mesmo nao tendo no meu jogo ele aceita agora se falo algum dos meus items nao aceita. Eu estava olhando na lib la tem essa linha aqui local items = io.open("data/items/items.xml", "r"):read("*all") ela ate bate com a minha la só que nao acha os item que eu criei mesmo
-
Anél de Experiência' [Exp Ring]
O Script e top funciona tudo mas tem hora que ele derruba o server oq sera q é ?
-
Npc Auction Versão 1.0 [Atualizado]
<?xml version="1.0"?> <npc name="Zika" script="data/npc/scripts/zika.lua" walkinterval="0" floorchange="0"> <health now="100" max="100"/> <look type="524"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Você Pode {vender} alguns itens para venda, ou {retirar} dinheiro dos seus itens vendidos, pode tambem {verificar} seus depositos e tambem pode comprar itens que os outros jogadores colocaram pra vender falando {troca}."/> </parameters> </npc> ai esta e dentro no script e essa local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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) if(not npcHandler:isFocused(cid)) then return false end local talkUser,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid,string.lower(msg) local weaponsTypes = {"head", "armor", "legs", "feet", "shield", "sword", "wand", "rod", "club", "axe", "distance", "ammunition", "others"} if isInArray({'apprise', 'check', 'items', 'item', 'list'}, msg) then local qry,k,str = db.getResult("SELECT `item_id`, `count`, `price` FROM `shop_npc` WHERE `player_id` = "..getPlayerGUID(cid)),0,"My Items Deposited:\n\n" if(qry:getID() ~= -1) then repeat k = k + 1 str = str..""..qry:getDataInt("count").." "..getItemNameById(qry:getDataInt("item_id")).." - "..qry:getDataInt("price").." Gps "..(tonumber(qry:getDataInt("count")) > 1 and "Each" or "").."\n" until not (qry:next()) or k >= _config_npc_shop.items_limit qry:free() doPlayerPopupFYI(cid, str) else selfSay("Currently you do not have items deposited in shop", cid) end elseif isInArray({'report', 'withdraw'}, msg) then if getDepositNpc(cid) <= 0 then selfSay("Sorry, but your balance is 0.", cid) else selfSay("You have "..getDepositNpc(cid).." gps deposited, you want to remove how many gps?", cid) talkState[talkUser] = 8 end elseif talkState[talkUser] == 8 then if tonumber(msg) and tonumber(msg) > 0 and tonumber(msg) <= getDepositNpc(cid) then setPlayerStorageValue(cid, _config_npc_shop.WithDraw_storage, (getDepositNpc(cid)-tonumber(msg))) doPlayerAddMoney(cid, tonumber(msg)) selfSay("you withdrew "..msg.." gps, now you have "..getDepositNpc(cid).." of balance.", cid) talkState[talkUser] = 0 else selfSay("You can not remove that amount.", cid) talkState[talkUser] = 0 end elseif isInArray({'deposit', 'depositar', 'sell', 'selling','vender'}, msg) then if getRowsShopByPlayer(getPlayerGUID(cid)) < _config_npc_shop.items_limit then selfSay('Which item you want to put for sale?', cid) talkState[talkUser] = 2 else selfSay('Sorry, you can only add '.._config_npc_shop.items_limit..' items per time.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 2 then name,item = msg,getItemByName(msg) if msg == '' or tonumber(msg) or not item then talkState[talkUser] = 0 selfSay("This item does not exist.", cid) return true elseif not isItemMovable(item) or isInArray(_config_npc_shop.items_block, getItemIdByName(name)) then talkState[talkUser] = 0 selfSay("you can not add this item.", cid) return true end item = getItemIdByName(name) selfSay('how many of that item you want to add to the shop?', cid) talkState[talkUser] = 3 elseif talkState[talkUser] == 3 then if tonumber(msg) and tonumber(msg) > 0 and tonumber(msg) <= 100 and getPlayerItemCount(cid, item) >= tonumber(msg) then count = tonumber(msg) selfSay('very well, and that each item will cost how much?', cid) talkState[talkUser] = 4 else selfSay(getPlayerItemCount(cid, item) < tonumber(msg) and 'Sorry, but you not have '..msg..' items to deposit' or 'enter a valid number from 1 to 100.', cid) end elseif talkState[talkUser] == 4 then if tonumber(msg) and tonumber(msg) > 0 and tonumber(msg) < 9999999 then price = msg selfSay('You really want to put {'..count..' '..name..'} per {'..price..'} gps '..(count > 1 and 'each' or '')..' for sale? Will cost '.. _config_npc_shop.each_deposit ..' by deposit, ok? {yes}', cid) talkState[talkUser] = 6 else selfSay('choose a valid number.', cid) end elseif msgcontains(msg, "yes") and talkState[talkUser] == 6 then if doPlayerRemoveMoney(cid, _config_npc_shop.each_deposit) then item,price = getItemIdByName(name),price if doPlayerRemoveItem(cid, item, count) then doAddItemShop(cid, item, count, getItemType(item), tonumber(price)) selfSay('Congratulations, the item was successfully added to the list and will be sold to date: '..os.date("%d %B %Y %X ", (os.time() + _config_npc_shop.days_limit*24*60*60))..'.', cid) talkState[talkUser] = 0 else selfSay('Sorry, but could not be completed because you do not have the items.', cid) talkState[talkUser] = 0 end else selfSay('Sorry, but you do not have gps sufficient to deposit this item.', cid) talkState[talkUser] = 0 end elseif isInArray({'trade', 'comprar', 'buy', 'buying', 'shop'}, msg) then selfSay('What type of item you want to buy: {head}, {armor}, {legs}, {feet}, {shield}, {sword}, {wand}, {rod}, {club}, {axe}, {distance}, {ammunition} ou {others} ?', cid) talkState[talkUser] = 7 elseif talkState[talkUser] == 7 then if isInArray(weaponsTypes, msg) then if msg == "rod" then msg = "wand" end local qry,trade,show = db.getResult("SELECT `id`, `player_id`, `item_id`, `count`, `price` FROM `shop_npc` WHERE `type` = "..db.escapeString(msg)),{},true if(qry:getID() ~= -1) then repeat if not _config_npc_shop.ShowMyItems_shop and qry:getDataInt("player_id") == getPlayerGUID(cid) then show = false end if show == true then table.insert(trade,{id= qry:getDataInt("item_id"), buy= qry:getDataInt("price"), db= qry:getDataInt("id"), name= getItemNameById(qry:getDataInt("item_id")), amount = qry:getDataInt("count")}) end until not(qry:next()) qry:free() else selfSay('Sorry, but there is no such item at the moment.', cid) return true end local items = {} for _, item in ipairs(trade) do items[item.id] = {item_id = item.id, buyPrice = item.buy, changeDb = item.db, subType = item.amount, realName = item.name} end local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if items[item].buyPrice ~= 0 and amount <= items[item].subType then if isItemInShop(items[item].changeDb, amount) then doPlayerRemoveMoney(cid, amount * items[item].buyPrice) if isItemStackable(items[item].item_id) then doPlayerAddItem(cid, items[item].item_id, amount) else for i = 1, amount do doPlayerAddItem(cid, items[item].item_id, 1) end end local player,sell_price = getPlayerByNameWildcard(getPlayerByShopID(items[item].changeDb)),amount*items[item].buyPrice if(not player) then doSetDepositNpc(getPlayerGUIDByName(getPlayerByShopID(items[item].changeDb)), sell_price, "add") local file = io.open(OfflineMessagesConfig.messageSavingDirectory .. getPlayerByShopID(items[item].changeDb) .. '.Gandhi', 'a+') if(not file) then return true end local msgfrom, msgoff = "[Npc Auction]",{"Were sold "..amount.." "..getItemNameById(items[item].item_id).." and you received "..sell_price.." gps by items."} file:write(OfflineMessagesConfig.messageFormatString:format(os.date(OfflineMessagesConfig.dateFormatString), msgfrom, table.concat(msgoff, OfflineMessagesConfig.separatorAfterNickname)) .. '\n') file:close() else setPlayerStorageValue(player,_config_npc_shop.WithDraw_storage, getDepositNpc(player)+sell_price) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE,"[Npc Auction] Were sold "..amount.." "..getItemNameById(items[item].item_id).." and you received "..sell_price.." gps by items.") end if amount == items[item].subType then doDeleteShopItem(items[item].changeDb) else doRemoveShopItem(items[item].changeDb, amount) end closeShopWindow(cid) else selfSay('desculpe mas este item acabou de ser comprado.', cid) closeShopWindow(cid) end else selfSay('you can only buy '..items[item].subType..'x of items.', cid) end end openShopWindow(cid, trade, onBuy, onSell) else selfSay('do not sell this item type.', cid) end elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("tudo bem então.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) eu alterei tipo depositar retirar essas coisas mas não influenciou em nada mesma coisa. @Vodkart
-
Npc Auction Versão 1.0 [Atualizado]
-
Scripts
Procurar por action system asim?
-
Scripts
Precisod e 2 scritp não sei se algum já viu. 1º um script que quando estiver caçando na part um ek e um ed da 10%xp ai se um sorc entra na pt da + 5% 2º Um sistema de loja tipo o player para e escreve !shop Nome do Item o valor e a Quantidade ai coloca pra vender tipo Mu Online. vlw des de já, a e otro como tiro o delay do player tipo nas diagonal pra andar fluido sem aquele delaizinho da diagonal = nos pokemon da vida.
-
Checar item na backpack do player
E se for mais de um item eu tiver que checar ? Consegui ja if(msgcontains(msg, 'Forjar')) then selfSay('Quer forjar 1 {Bau de ouro}?', cid) talkState[talkUser] = 7 elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 7) then if getPlayerItemCount(cid,13099) >= 1 and getPlayerItemCount(cid,13100) >= 1 and getPlayerItemCount(cid,13101) >= 1 then doPlayerRemoveItem(cid, 13099, 1) doPlayerRemoveItem(cid, 13100, 1) doPlayerRemoveItem(cid, 13101, 1) doPlayerAddItem(cid,13086,1) doSendMagicEffect(getCreaturePosition(cid), 30) selfSay('Você recebeu {1 Bau de Ouro.}', cid) else selfSay('È necessário os {Fragmentos de Bau} 1 2 e 3 para poder forjar um Bau de Ouro.', cid) end end
-
Launcher Erro
sim o correto que os cara nao encina e que a pasta do seu game tem q ficar no c:
-
Recompença de item por tarefa
Vlw mano viu te mandei uma msg la no Chiato la na pagina do facebook da uma olhada la pfv.
-
Chave no bau e guanha uma recompença aleatorio
Alguém ai tem um script que tipo uso uma chave e um item no caso um bau que fica no inventario ai quando uso nele some a chave e o bau pode ganhar um item aleatório.
-
Recompença de item por tarefa
Galera tenho esse script aq <?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 = { ["tartaruga gigante"] = {monster_race={"tartaruga gigante"}, storage_start = 200245, storage = 91045,count = 150,exp = 22500,money = 1500}, ["tartaruga"] = {monster_race={"tartaruga"}, storage_start = 200244, storage = 91044,count = 300,exp = 27000,money = 3000}, ["aranha mae"] = {monster_race={"aranha mae"}, storage_start = 200242, storage = 91042,count = 300,exp = 270000,money = 3000}, ["rex"] = {monster_race={"rex"}, storage_start = 200241, storage = 91041,count = 100,exp = 150000,money = 1000}, ["triceratops"] = {monster_race={"triceratops"}, storage_start = 200240, storage = 91040,count = 150,exp = 135000,money = 1500}, ["persona"] = {monster_race={"persona","monstro de agua"}, storage_start = 200239, storage = 91039,count = 200,exp = 60000,money = 2000}, ["golem de lodo"] = {monster_race={"monstro da caverna","golem de lodo"}, storage_start = 200238, storage = 91038,count = 100,exp = 5000,money = 1000}, ["gosma"] = {monster_race={"gosma"}, storage_start = 200237, storage = 91037,count = 50,exp = 5000,money = 500}, ["vesma"] = {monster_race={"vesma"}, storage_start = 200236, storage = 91036,count = 300,exp = 750000,money = 3000}, ["dragao filhote"] = {monster_race={"dragao filhote"}, storage_start = 200235, storage = 91035,count = 500,exp = 175000,money = 5000}, ["monstro"] = {monster_race={"monstro","monstro do pantano"}, storage_start = 200234, storage = 91034,count = 150,exp = 4500,money = 1500}, ["rato"] = {monster_race={"rato","ratazana"}, storage_start = 200233, storage = 91033,count = 50,exp = 400,money = 500}, ["aranha"] = {monster_race={"aranha","aranha venenosa"}, storage_start = 200232, storage = 91032,count = 50,exp = 2000,money = 500}, ["lobo"] = {monster_race={"lobo","lobo assassino","lobo branco"}, storage_start = 200231, storage = 91031,count = 150,exp = 4500,money = 1500}, ["verme"] = {monster_race={"verme"}, storage_start = 200230, storage = 91030,count = 150,exp = 6000,money = 1500}, ["ogro"] = {monster_race={"ogro","ogro guerreiro","ogro alado","ogro barbaro","ogro enfurecido"}, storage_start = 200229, storage = 91029,count = 150,exp = 16500,money = 1500}, ["besouro"] = {monster_race={"besouro"}, storage_start = 200228, storage = 91028,count = 50,exp = 900,money = 500}, ["vespa"] = {monster_race={"vespa"}, storage_start = 200227, storage = 91027,count = 50,exp = 1200,money = 500}, ["centopeia"] = {monster_race={"centopeia"}, storage_start = 200226, storage = 91026,count = 50,exp = 1700,money = 500}, ["serpente"] = {monster_race={"serpente"}, storage_start = 200225, storage = 91025,count = 50,exp = 500,money = 500}, ["escorpiao"] = {monster_race={"escorpiao"}, storage_start = 200224, storage = 91024,count = 50,exp = 2250,money = 500}, ["troll"] = {monster_race={"troll"}, storage_start = 20023, storage = 91023,count = 500,exp = 75000,money = 5000}, ["cyclops"] = {monster_race={"cyclops"}, storage_start = 20022, storage = 91022,count = 500,exp = 100000,money = 5000}, ["ursos"] = {monster_race={"urso"}, storage_start = 200221, storage = 91021,count = 50,exp = 1150,money = 500, item = 7732}, ["minotauros"] = {monster_race={"minotauro","minotauro guarda", "minotauro mago"}, storage_start = 200220, storage = 91020,count = 1000,exp = 80000,money = 10000} } 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,10000}, money = {true,10000}, items ={true,{{000,2},{0000,1}}} } 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 if b < 11 then setGlobalStorageValue(63005,b+1) doBroadcastMessage('[Voce Completou a tarefa] '..getCreatureName(cid)..' was the '..b..' para termina a tarefa!.') 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 doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy "..getCreatureName(cid).." completou todo as tarefas.") end 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="!tarefa" 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 .. "Lista de Tarefas :\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, 8983, 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 "Parabens! Voce terminou a tarefa de "..race.."." or "Criaturas Derrotadas: [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."") end end end end end return true end]]></event> </mod> como coloco pra quando o player terminar a tarefa ele receber alem da xp e da grana um item tipo mato tantos bixos ele guanha um item a xp e a grana @Vodkart
-
Como iniciar um evento sozinho
Vo testar aqui man vlw é que não manjo muito mas to aprendendo vlw mesmo Usei seu script ai mas não inicia o evento coloquei a hora correta e nada
-
Como iniciar um evento sozinho
Galera tenho um evento de paintball mas nao consigio colocalo para iniciar sozinho tipo global events pq ele fica na pasta mods queria um script que em tal hora ou em tal horas do dia tipo 12:00, 00:00 ele inicia-se sozinho nele tenho q dar o comando !pb start com o gm pra poder iniciar se alguem souber como faz da um alo ai. <?xml version="1.0" encoding="UTF-8"?> <mod name="Paintball event" version="1.0" author="Bogart" contact="otland.net" enabled="yes"> <description> </description> <config name="config"><![CDATA[ t = { main = { tfs_version = "0.3", --0.3 or 0.4 positions = { paintball_spawn_area = { top_left = {x = 1215, y = 1004, z = 7}, --Top left pos of spawning area bottom_right = {x = 1231, y = 1020, z = 7}--bottom right pos of spawning area }, waiting_room_area = { top_left = {x = 1222, y = 1009, z = 6}, --Top left pos of the waiting room bottom_right = {x = 1229, y = 1016, z = 6}--bottom right pos of the waiting room }, tp_to_paintball = {x = 973, y = 930, z = 7}, --pos where the tp will be created event_ending_pos = {x = 973, y = 932, z = 6} --pos players will be sent after event ending }, storages = { exhaust = 2455, is_in_event = 2460, score = 2465 }, misc = { status = 'on' }, messages = { event_started = "Paintball foi iniciado! va para o templo e entre no portal para participar!",--Message that will be broadcasted after the event has started event_ended = "Paintball acabou!" --same but when event ends }, event_config = { event_duration = 1, --minutes, 0 if it's an always-open event infinite_ammo = true, winner_gets_item = true, prize_item_id = 7732, decrease_score_on_death = true, points_per_kill = 1, randomize_player_start_pos = true, ammo_per_point = 100, reset_bullets_on_death = true, min_bullets_on_spawn = 100, start_automatically = false, use_waiting_room = true, waiting_time = 1 --minutes } }, onShoot = { storages = { ammo = 2400 }, misc = { walls_id = {9371,9372,9377,9399,9373,9370,9376,9370}, bullets_exhaust = 500, --in ms bullet_speed = 150 }, vars = { shootdir = 0 } } } ]]></config> <movevent type="StepIn" actionid ="2880" event="script"><![CDATA[ domodlib('config') function onStepIn(cid, item, pos) local t_l = t.main.positions.paintball_spawn_area.top_left local b_r = t.main.positions.paintball_spawn_area.bottom_right doTeleportThing(cid, {x=math.random(t_l.x,b_r.x), y=math.random(t_l.y, b_r.y), z=math.random(t_l.z, b_r.z)}) doPlayerSetStorageValue(cid, t.main.storages.is_in_event,1) doPlayerSetStorageValue(cid, t.onShoot.storages.ammo, t.main.event_config.min_bullets_on_spawn) doPlayerSetStorageValue(cid, t.main.storages.score, 0) doPlayerSendTextMessage(cid,27,"Bem Vindo ao evento Paintball, -> Comandos:\n!pb tiro -> Comando para atirar.\n!pb placar -> Mostra o Placar atual dos jogadores.") end ]]></movevent> <globalevent name="StartPaintBall" interval="3600" event="script"><![CDATA[ domodlib('config') function onThink(interval, lastExecution, thinkInterval) if t.main.event_config.start_automatically then doBroadcastMessage(t.main.messages.event_started, MESSAGE_STATUS_WARNING) if t.main.event_config.use_waiting_room then addEvent(moveToEvent, t.main.event_config.waiting_time*1000*60) doCreateTeleport(1387,t.main.positions.waiting_room_area.top_left, t.main.positions.tp_to_paintball) else if t.main.tfs_version == "0.3" then doItemSetAttribute(doCreateItem(1387, t.main.positions.tp_to_paintball), "aid", 2880) else doSetItemActionId(doCreateItem(1387, t.main.positions.tp_to_paintball),2880) end if(t.main.event_config.event_duration > 0) then addEvent(endPaintball, t.main.event_config.event_duration*1000*60) end end end return true end function endPaintball() local score = {} if not t.main.event_config.use_waiting_room then doRemoveItem(getTileItemById(t.main.positions.tp_to_paintball,1387).uid) end for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.main.storages.is_in_event) > 0 then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, t.main.storages.score)}) doPlayerSetStorageValue(pid, t.main.storages.is_in_event, 0) doPlayerSetStorageValue(pid, t.main.storages.score, 0) doPlayerSetStorageValue(pid, t.onShoot.storages.ammo, 0) doTeleportThing(pid, t.main.positions.event_ending_pos) end end table.sort(score, function(a, b) return a[2] > b[2] end) if table.getn(score) > 0 then if t.main.event_config.winner_gets_item then for _, pid in ipairs(getPlayersOnline()) do if getCreatureName(pid) == score[1][1] then doPlayerAddItem(pid, t.main.event_config.prize_item_id) break end end end doBroadcastMessage("Evento Paintball acabou, "..score[1][1].." ganhou o evento com "..score[1][2].." pontos", MESSAGE_STATUS_WARNING) end end local t_l = t.main.positions.paintball_spawn_area.top_left local b_r = t.main.positions.paintball_spawn_area.bottom_right function moveToEvent() for _, pid in ipairs(getPlayersOnline()) do if isInRange(getCreaturePosition(pid), t.main.positions.waiting_room_area.top_left, t.main.positions.waiting_room_area.bottom_right) then doTeleportThing(pid, {x=math.random(t_l.x,b_r.x), y=math.random(t_l.y, b_r.y), z=math.random(t_l.z, b_r.z)}) doPlayerSetStorageValue(pid, t.main.storages.is_in_event,1) doPlayerSetStorageValue(pid, t.onShoot.storages.ammo, t.main.event_config.min_bullets_on_spawn) doPlayerSetStorageValue(pid, t.main.storages.score, 0) doPlayerSendTextMessage(pid,27,"Bem Vindo ao evento Paintball, -> Comandos:\n!pb tiro -> Comando para atirar.\n!pb placar -> Mostra o Placar atual dos jogadores.") end end doRemoveItem(getTileItemById(t.main.positions.tp_to_paintball,1387).uid) addEvent(endPaintball, t.main.event_config.event_duration*1000*60) end ]]></globalevent> <talkaction words="!pb" event="script"><![CDATA[ domodlib('config') function onSay(cid, words, param, channel) local k = string.explode(param, ",") if(k[1] ~= nil) then if(string.upper(k[1]) == 'END') and getPlayerGroupId(cid) >= 3 then endPaintball() end if(string.upper(k[1]) == 'START') and getPlayerGroupId(cid) >= 3 then doBroadcastMessage(t.main.messages.event_started, MESSAGE_STATUS_WARNING) if t.main.event_config.use_waiting_room then addEvent(moveToEvent, t.main.event_config.waiting_time*1000*60) doCreateTeleport(1387,t.main.positions.waiting_room_area.top_left, t.main.positions.tp_to_paintball) else if t.main.tfs_version == "0.3" then doItemSetAttribute(doCreateItem(1387, t.main.positions.tp_to_paintball), "aid", 2880) else doSetItemActionId(doCreateItem(1387, t.main.positions.tp_to_paintball),2880) end if(t.main.event_config.event_duration > 0) then addEvent(endPaintball, t.main.event_config.event_duration*1000*60) end end end if(string.upper(k[1]) == 'PLACAR') then local score = {} local output = "Voce Tem " .. getPlayerStorageValue(cid, t.main.storages.score) .. " pontos.\nVoce tem "..getPlayerStorageValue(cid, t.onShoot.storages.ammo).." munição.\n------------------\nAtual pontuaçao do evento Paintball é:\n" for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.main.storages.is_in_event) then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, t.main.storages.score)}) end end local lx = table.getn(score) if(lx > 3) then lx = 3 end table.sort(score, function(a, b) return a[2] > b[2] end) for k = 1,lx do output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n" end doPlayerPopupFYI(cid, output) end if (string.upper(k[1]) == 'MUNIÇÂO') then if(t.main.event_config.infinite_ammo) then doPlayerSendTextMessage(cid, 27, "Munições infinitas.") else if getPlayerStorageValue(cid, t.main.storages.score) > 0 then doPlayerSetStorageValue(cid, t.main.storages.score, getPlayerStorageValue(cid, t.main.storages.score)-1) doPlayerSetStorageValue(cid, t.onShoot.storages.ammo, getPlayerStorageValue(cid,t.onShoot.storages.ammo)+t.main.event_config.ammo_per_point) doPlayerSendTextMessage(cid, 27, "You have received " .. t.main.event_config.ammo_per_point .. " bullets and you have lost 1 score point.") doSendMagicEffect(getCreaturePosition(cid),4) else doPlayerSendTextMessage(cid, 27, "Você não tem pontos suficientes para comprar munição, você precisa ".. 1-(getPlayerStorageValue(cid, t.main.storages.score)).. " mais.") end end end if (string.upper(k[1]) == 'TIRO') then if(getPlayerStorageValue(cid, t.main.storages.is_in_event) == 1) then if getPlayerStorageValue(cid, t.main.storages.exhaust) <= 1 then if(getPlayerStorageValue(cid, t.onShoot.storages.ammo) > 0) then if t.main.misc.status == 'on' then if(t.main.event_config.infinite_ammo == false) then doPlayerSetStorageValue(cid, t.onShoot.storages.ammo, getPlayerStorageValue(cid, t.onShoot.storages.ammo)-1) end doPlayerSetStorageValue(cid, t.main.storages.exhaust, 2) lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0) addEvent(doPlayerSetStorageValue,t.onShoot.misc.bullets_exhaust, cid, t.main.storages.exhaust,1) end else doPlayerSendCancel(cid, "Você está fora de munição, troca de munição por pontos com munição tiro ou ser morto por uma recarga") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "A arma está em recarga") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Você precisa estar no evento.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end end return true end function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name) local var = fvar local pos = fpos local found = ffound local posV = fposV local check = fcheck local vcid = fvcid local loopCounter = floopCounter local vpid = fvpid local storage = t.main.storages.exhaust if var < 2 then vcid = cid end pos = playerPos if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then doSendDistanceShoot(pos, convert(lookDir,pos),effect) pos = convert(lookDir,pos) var=var+1 posV = convertV(lookDir,playerPos) for _, pid in ipairs(getPlayersOnline()) do if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then --if loopCounter > 2 then vpid = pid --end if (vpid ~= vcid) then if var > 2 then if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then killPlayer(pid,pos,getCreatureName(vcid)) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end killPlayer(pid,pos,vcid) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end loopCounter = loopCounter +1 end if (lookDir == 0) or (lookDir == 2) then if var ~= 6 then addEvent(lineAnimation, t.onShoot.misc.bullet_speed, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end else if var ~= 8 then addEvent(lineAnimation, t.onShoot.misc.bullet_speed, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end end else doSendMagicEffect(convert(lookDir,pos),2) var = 1 end end local ret = {} function convert(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y-1, z = pos.z}, [1] = {x = pos.x+1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y+1, z = pos.z}, [3] = {x = pos.x-1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end local ret = {} function convertV(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y+1, z = pos.z}, [1] = {x = pos.x-1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y-1, z = pos.z}, [3] = {x = pos.x+1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end function killPlayer(cid,pos, killer) local t_l = t.main.positions.paintball_spawn_area.top_left local b_r = t.main.positions.paintball_spawn_area.bottom_right doTeleportThing(cid, {x=math.random(t_l.x,b_r.x), y=math.random(t_l.y, b_r.y), z=math.random(t_l.z, b_r.z)}) doSendMagicEffect(pos,2) doPlayerSendTextMessage(cid, 27, "Voce foi morto por "..getCreatureName(killer)..".") doPlayerSetStorageValue(killer, t.main.storages.score, getPlayerStorageValue(killer, t.main.storages.score)+t.main.event_config.points_per_kill) doPlayerSendTextMessage(killer, 27, "Você matou "..getCreatureName(cid)..".") doBroadcastMessage("[Event] Paintball: "..getCreatureName(killer).." matou "..getCreatureName(cid)..".", MESSAGE_STATUS_WARNING) if t.main.event_config.decrease_score_on_death then doPlayerSetStorageValue(cid, t.main.storages.score, getPlayerStorageValue(cid, t.main.storages.score)-1) end if t.main.event_config.reset_bullets_on_death then doPlayerSetStorageValue(cid, t.onShoot.storages.ammo, t.main.event_config.min_bullets_on_spawn) end end function isInWallArray(pos) for k = 0, table.getn(t.onShoot.misc.walls_id) do if getTileItemById(pos, t.onShoot.misc.walls_id[k]).itemid == t.onShoot.misc.walls_id[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search return true end end return false end function endPaintball() local score = {} if not t.main.event_config.use_waiting_room then doRemoveItem(getTileItemById(t.main.positions.tp_to_paintball,1387).uid) end for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.main.storages.is_in_event) > 0 then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, t.main.storages.score)}) doPlayerSetStorageValue(pid, t.main.storages.is_in_event, 0) doPlayerSetStorageValue(pid, t.main.storages.score, 0) doPlayerSetStorageValue(pid, t.onShoot.storages.ammo, 0) doTeleportThing(pid, t.main.positions.event_ending_pos) end end table.sort(score, function(a, b) return a[2] > b[2] end) if table.getn(score) > 0 then if t.main.event_config.winner_gets_item then for _, pid in ipairs(getPlayersOnline()) do if getCreatureName(pid) == score[1][1] then doPlayerAddItem(pid, t.main.event_config.prize_item_id) break end end end doBroadcastMessage("Evento Painball acabou, "..score[1][1].." ganhou o evento com "..score[1][2].." pontos", MESSAGE_STATUS_WARNING) end end local t_l = t.main.positions.paintball_spawn_area.top_left local b_r = t.main.positions.paintball_spawn_area.bottom_right function moveToEvent() for _, pid in ipairs(getPlayersOnline()) do if isInRange(getCreaturePosition(pid), t.main.positions.waiting_room_area.top_left, t.main.positions.waiting_room_area.bottom_right) then doTeleportThing(pid, {x=math.random(t_l.x,b_r.x), y=math.random(t_l.y, b_r.y), z=math.random(t_l.z, b_r.z)}) doPlayerSetStorageValue(pid, t.main.storages.is_in_event,1) doPlayerSetStorageValue(pid, t.onShoot.storages.ammo, t.main.event_config.min_bullets_on_spawn) doPlayerSetStorageValue(pid, t.main.storages.score, 0) doPlayerSendTextMessage(pid,27,"Bem Vindo ao evento Paintball, -> Comandos:\n!pb tiro -> Comando para atirar.\n!pb placar -> Mostra o Placar atual dos jogadores.") end end doRemoveItem(getTileItemById(t.main.positions.tp_to_paintball,1387).uid) addEvent(endPaintball, t.main.event_config.event_duration*1000*60) end ]]></talkaction> </mod>
- Launcher AutoUpdate C#
-
[OPEN]Launcher(Updater)