Ir para conteúdo

9k22

Membro
  • Registro em

  • Última visita

Tudo que 9k22 postou

  1. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Up!
  2. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Pega o meu que é 100% e sem bugs Uu Em lib coloca cria um arquivo chamado 101-war.lua e coloca: WAR_GUILD = 0 WAR_ENEMY = 1 Em talkaction cria um arquivo chamado war.lua e coloca: function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 3 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 3) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.executeQuery(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end Agora no mesmo lugar, cria um arquivo chamado balance.lua e coloca: local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.executeQuery('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.executeQuery('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end Agora em config.lua coloca (você coloca apenas se seu distro não tiver a função -D_War_System__): WarSystem = true GainExpForKillPlayer = true EnemyTeamIgnorePvpByCommandTalkaction = false Ps: não recomendo colocar no config.lua, aqui no meu projeto (custom RpG) deu uns bugs, ai precisarei criar uma lib, mais estou sem tempo intão.. Fica ao critério de vocês.
  3. local fromPosition = {x = 835, y = 949, z = 7} -- top left cornor of the playground local toPosition = {x = 867, y = 969, z = 7} -- bottom right cornor of the playground if isInArea(getThingPosition(cid), fromPosition, toPosition) then return false, doPlayerSendCancel(cid, "voce nao pode usar essa runa nesta área.") end Ficando assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE) function onCastSpell(cid, var) local fromPosition = {x = 835, y = 949, z = 7} -- top left cornor of the playground local toPosition = {x = 867, y = 969, z = 7} -- bottom right cornor of the playground if isInArea(getThingPosition(cid), fromPosition, toPosition) then return false, doPlayerSendCancel(cid, "voce nao pode usar essa runa nesta área.") end return doCombat(cid, combat, var) end
  4. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Hmm ok! Com isso, tócpi resolvido ;x
  5. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Área errada! -Rep!
  6. 9k22 postou uma resposta no tópico em Playground (Off-topic)
    se for para mim *----*
  7. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Desculpe meu erro! local messages = { "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA.", } } local i = 0 function onThink(interval, lastExecution) local message = messages[(i % #messages) + 1] doBroadcastMessage("Information: " .. message .. "", ("Information: " .. message .. "", MESSAGE_STATUS_CONSOLE_ORANGE) i = i + 1 return TRUE end Ou local messages = { "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA." } local i = 0 function onThink(interval, lastExecution) local message = messages[(i % #messages) + 1] doBroadcastMessage("Information: " .. message .. "", ("Information: " .. message .. "", MESSAGE_STATUS_CONSOLE_ORANGE) i = i + 1 return TRUE end
  8. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    local messages = { "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA.", "MSG QUE SERA ENVIADA.", } local i = 0 function onThink(interval, lastExecution) local message = messages[(i % #messages) + 1] doBroadcastMessage("Information: " .. message .. "", ("Information: " .. message .. "", MESSAGE_STATUS_CONSOLE_ORANGE) i = i + 1 return TRUE end
  9. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    function onThink(interval, lastExecution) MENSAGEM = { "FRASE 1", "FRASE 2", "FRASE 3", "FRASE 4", "FRASE 5", } doBroadcastMessage(MENSAGEM[math.random(1,#MENSAGEM)],CONST_ME_MAGIC_GREEN) return TRUE end
  10. Claro, você faz os mesmos procedimentos... Não mudará nada, mais o problema é que ela ficará como net compartilhada... Ai fica um pouco mais dificil que vocÊ terá que liberar pelo seu moldem
  11. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Up!!
  12. 9k22 postou uma resposta no tópico em Playground (Off-topic)
    kkkkk né aee vo assitir sheldom (penny, penny, penny kkk)
  13. houses_data Houses_auctions
  14. para mim, apenas os itens que estivessem no Depot que iria ficar. Mais já que foi na bp intão...
  15. Complicado, infelismente não sei como resolver, aguarda até que alguém possa lhe ajudar. Desculpe-me por não poder ou não conseguir.
  16. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Cuidado victoroliveira, Você deu um CTRL + C/CTRL + V no meu e colocou... Meu Seu -Rep e que isso não se repita novamente! Leia as regras gerais.
  17. 9k22 postou uma resposta no tópico em Portal
    SKin é o visual do fórum... mudou sim! Olha como era mais sexy antes:
  18. 9k22 postou uma resposta no tópico em Portal
    aa essa skin é muito feia kkkk prefiro a antiga, nessa nova atualização que vai chegar, espero que seja 10x melhor que a antiga (dificil aconteçer).
  19. kkkkkkkkkkkkkk euriviu ksOPAKSpoAKSPOASKaksoa Testa ae, ai vc posta para que eu possa colocar como resolvido ;x
  20. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Rapaz, vc quer muita coisa em um só item kkk function onUse(cid, item, frompos, item2, topos) local pausa = 1800000 -- (1000 = 1 segundos) Tempo que o script vai durar local texto = 'You receive double the experience to kill a monster for 30 minutes.' -- Texto que irá receber ao usar a potion. textofinal = 'Its just minutes.' -- Texto que irá receber quando o efeito da potion acabar. local exp = 2 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server. local drop = 2 -- double loot, por exemplo 2 é 2x o drop loot do seu servidor. expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. dropfinal = 1 -- Não mude, isso é para o drop voltar ao normal. if item.itemid == 7443 then doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,exp) doCreatureSetDropLoot(cid, drop) doPlayerAddStamina(cid,1200000) doSendMagicEffect(frompos,13) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,pausa,cid) end end end end function potion(pos, cid) doPlayerSetExperienceRate(pos,expfinal) doCreatureSetDropLoot(cid, dropfinal) doPlayerSendTextMessage(pos,22,textofinal) end Action.xml vc coloca: <action itemid="XXXX" script="NOMEDOSCRIPT.lua" />
  21. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    function onUse(cid, item) first = "" second = "" third = "" fourth = "" fifth = "" if addPlayerBlessing(cid, 1) then first = "First Bless" end if addPlayerBlessing(cid, 2) then second = "Second Bless" end if addPlayerBlessing(cid, 3) then third = "Third Bless" end if addPlayerBlessing(cid, 4) then fourth = "Fourth Bless" end if addPlayerBlessing(cid, 5) then fifth = "Fifth Bless" end doPlayerPopupFYI(cid,"Voce adicionou todas as bless."") return TRUE end tenta assim...
  22. 9k22 postou uma resposta no tópico em Suporte Tibia OTServer
    Informe a versão do seu servidor e o nome do distro...
  23. 9k22 postou uma resposta no tópico em Playground (Off-topic)
    Senti mesmo não, ta tão abondonado aqui nesse teu tópico, firstt !!! ksOPAKSPOAksopko Ae, como foi lá no inferno? gostou? Agora o tk num vai ser mais alegre como antes kkkkk #Brinksss Senti sua falta sim, senti a falta desse tigrão kkkk
  24. VocÊ já tentou trocar o distro? só para ver se esse erro não aconteçe denovo, se aconteçer, o erro está no distro!

Informação Importante

Confirmação de Termo