Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''sistema''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. Créditos: Jhon & Vodkart Como funciona: É um sistema simples, mostra o rank de maior hit do server, seja de axe, sword, club, wand, etc... Mostra o Nome do player - [Hit] - Nome da weapon imagem de exemplo: rank axe rank club rank sd obs: como o sistema de rank normal, level e etc, para aparecer no rank o jogador tem que relogar ou dar serversalve. MODS: RankHit.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="RankHit" version="1.0" author="Vodkart e Jhon" contact="xtibia.com" enabled="yes"> <config name="rank_func"><![CDATA[ WEAPON_WAND = {2190, 2191, 2188, 8921, 2189, 2187, 8920, 8922, 2184, 7414, 2453} WEAPON_ROD = {2182, 2186, 2185, 8911, 2181, 2183, 8912, 8910, 7958, 12609} storage_mostdamage = { CLUB = {155201,156201}, SWORD = {155202,156202}, AXE = {155203,156203}, WAND = {155204,156204}, ROD = {155205,156205}, DISTANCE = {155206,156206}, MAGIC_SD = {155207,156207,157207} } function setSdHit(cid, damage) if damage > getPlayerStorageValue(cid, storage_mostdamage.MAGIC_SD[1]) then setPlayerStorageValue(cid, storage_mostdamage.MAGIC_SD[1], damage) setPlayerStorageValue(cid, storage_mostdamage.MAGIC_SD[2], 2268) end return true end function setPlayerMostHitMage(cid, damage, weapon) if isInArray(WEAPON_WAND, getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid) == TRUE or isInArray(WEAPON_WAND, getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid) == TRUE then if damage > getPlayerStorageValue(cid, storage_mostdamage.WAND[1]) then setPlayerStorageValue(cid, storage_mostdamage.WAND[1], damage) setPlayerStorageValue(cid, storage_mostdamage.WAND[2], weapon) end elseif isInArray(WEAPON_ROD, getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid) == TRUE or isInArray(WEAPON_ROD, getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid) == TRUE then if damage > getPlayerStorageValue(cid, storage_mostdamage.ROD[1]) then setPlayerStorageValue(cid, storage_mostdamage.ROD[1], damage) setPlayerStorageValue(cid, storage_mostdamage.ROD[2], weapon) end end return true end function getRankHit(cid, value, wvalue, max, RankName) -- by vodka local str,arm ="","" 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 local getweapon = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. query:getDataString("player_id") .." AND `key` = "..wvalue) if (getweapon:getID() ~= -1) then arm = getItemNameById(getweapon:getDataString("value")) end str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "] - "..arm.."" k = k + 1 until not query:next() end return doPlayerPopupFYI(cid, str) end function haveWeapon(cid) -- by vodka local armas = {1,2,3,5,6} if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid > 0 and isInArray(armas, getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_RIGHT).uid)) or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid > 0 and isInArray(armas, getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid)) then return true end return false end function getWeaponType(cid) -- by vodka return getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 0 and getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_RIGHT).uid) or getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid) end ]]></config> <talkaction words="/rankhit;!rankhit" event="buffer"><![CDATA[ domodlib('rank_func') local rank_hit = { ["axe"] = {storage_mostdamage.AXE[1],storage_mostdamage.AXE[2]}, ["sword"] = {storage_mostdamage.SWORD[1],storage_mostdamage.SWORD[2]}, ["club"] = {storage_mostdamage.CLUB[1],storage_mostdamage.CLUB[2]}, ["wand"] = {storage_mostdamage.WAND[1],storage_mostdamage.WAND[2]}, ["rod"] = {storage_mostdamage.ROD[1],storage_mostdamage.ROD[2]}, ["distance"] = {storage_mostdamage.DISTANCE[1],storage_mostdamage.DISTANCE[2]}, ["sd"] = {storage_mostdamage.MAGIC_SD[1],storage_mostdamage.MAGIC_SD[2]} } local param = string.lower(param) if (param == "") then local str = "" str = str .. ""..getCreatureName(cid).." Hit\'s\:\n\n" for hit, item in pairs(rank_hit) do str = str..string.upper(hit)..": ".. (getPlayerStorageValue(cid, item[1]) ~= -1 and "["..getPlayerStorageValue(cid, item[1]).."] - "..getItemNameById(getPlayerStorageValue(cid, item[2])).."" or "None") .."\n" end str = str .. "" doPlayerPopupFYI(cid,str) return true end if not rank_hit[param] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"digite o nome correto.") end return getRankHit(cid, rank_hit[param][1],rank_hit[param][2], 10, "Rank "..param) ]]></talkaction> <event type="login" name="Rank Hit" event="script"><![CDATA[ domodlib('rank_func') function onLogin(cid) registerCreatureEvent(cid, "RankhitCombat") return true end ]]></event> <event type="combat" name="RankhitCombat" event="script"><![CDATA[ domodlib('rank_func') registerCreatureEvent(target, "RankhitStats") return true ]]></event> <event type="statschange" name="RankhitStats" event="script"><![CDATA[ domodlib('rank_func') if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and haveWeapon(attacker) then t = { [1] = {storage_mostdamage.SWORD[1],storage_mostdamage.SWORD[2]}, [2] = {storage_mostdamage.CLUB[1],storage_mostdamage.CLUB[2]}, [3] = {storage_mostdamage.AXE[1],storage_mostdamage.AXE[2]}, [5] = {storage_mostdamage.DISTANCE[1],storage_mostdamage.DISTANCE[2]} } MyWeapon = getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid == 0 and getPlayerSlotItem(attacker, CONST_SLOT_RIGHT).itemid or getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid if (getPlayerStorageValue(attacker, storage_mostdamage.MAGIC_SD[3]) >= os.time()) then setSdHit(attacker,value) elseif t[getWeaponType(attacker)] then if value > getPlayerStorageValue(attacker, t[getWeaponType(attacker)][1]) then setPlayerStorageValue(attacker, t[getWeaponType(attacker)][1], value) setPlayerStorageValue(attacker, t[getWeaponType(attacker)][2], MyWeapon) end else setPlayerMostHitMage(attacker, value, MyWeapon) end end return true ]]></event> </mod> Em data > spells > scripts > attack > sudden death.lua adicione depois de function onCastSpell(cid, var) setPlayerStorageValue(cid, 157207, os.time()+3) ficando assim: function onCastSpell(cid, var) setPlayerStorageValue(cid, 157207, os.time()+3) return doCombat(cid, combat, var) end
  2. Vou postar alguns scripts meus que estiveram engavetados. Faz algum tempo que fiz estes scripts, então não vou postar screenshots ou como configurar, mas as configurações são fáceis de entender, então divirtam-se. Edit: Cuidado, se usar muitas chuvas ao mesmo tempo ou em áreas muito grandes, é muito provável que vá dar lag no seu servidor! Porém, tenho planos de fazer um remake desse sistema, deixando muito melhor e praticamente sem lag numa área imensa, realmente imensa, do porte de 100000x100000 SQMs! Esse é de longe o meu melhor script para open tibia. Fiz todo usando a "orientação à objetos" de Lua, o que torna o sistema altamente customizável, podendo adicionar novos tipos de clima apenas com uma linha de comando. O Weather System é basicamente um sistema de chuva que te permite adicionar o clima que você quiser, como chuva ácida, chuva de meteoros e et cetera. Porém, o maior atrativo deste sistema é que ele não chove aonde há telhado, ou seja, os efeitos só vão acontecer no andar mais alto onde há tiles. Não vai chover embaixo de uma ponte, vai chover em cima dela. Não vai chover dentro da loja daquele NPC, vai chover no telhado da loja. Não vai chover dentro de cavernas, montanhas, ou qualquer lugar onde haja um tile por cima. Você pode criar uma chuva eterna, uma chuva que acontece de vez em quando em algum lugar, ou criar a chuva com o comando /weather com um GM. /data/lib/weather-system.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- base (class) for weather types WeatherType = { effects = CONST_ME_NONE, interval = 10, items = {}, chance = 0, callback = nil, param = {}, } -- base (class) for weathers Weather = { type = nil, topleft = {x=0, y=0}, bottomright = {x=0, y=0}, intensity = 0, } -- create new instances of WeatherType function WeatherType:new(effects, interval, items, chance, callback, ...) local new_weathertype = { effects = effects, interval = interval, items = items, chance = chance, callback = callback, param = {...}, } return setmetatable(new_weathertype, {__index = self}) end -- create new instances of Weather function WeatherType:create(topleft, bottomright, intensity) if bottomright.x < topleft.x then local tmp_x = topleft.x topleft.x = bottomright.x bottomright.x = tmp_x end if bottomright.y < topleft.y then local tmp_y = topleft.y topleft.y = bottomright.y bottomright.y = tmp_y end local new_weather = { type = self, topleft = topleft, bottomright = bottomright, intensity = intensity, } return setmetatable(new_weather, {__index = Weather}) end -- start the weather's main loop function Weather:start(duration) if duration and duration <= 0 then return true end local area = (self.bottomright.x - self.topleft.x) * (self.bottomright.y - self.topleft.y) for i = 1, (area * self.intensity / 40) + 1 do local pos = {} pos.x = math.random(self.topleft.x, self.bottomright.x) pos.y = math.random(self.topleft.y, self.bottomright.y) pos.z = get_roof_tile(pos) if is_walkable(pos) then local send_effect = true -- if the weather type for this weather has a callback, call it if type(self.type.callback) == "function" then send_effect = self.type.callback(self.type, pos) end -- if callback returned true, send effect, no effect otherwise if send_effect then doSendMagicEffect(pos, type(self.type.effects) == "table" and self.type.effects[math.random(1, #self.type.effects)] or self.type.effects) end -- create item based on chance if math.random(1, 100) <= self.type.chance / 40 then doCreateItem(type(self.type.items) == "table" and self.type.items[math.random(1, #self.type.items)] or self.type.items, pos) end end end if not duration then addEvent(self.start, self.type.interval, self, false) else addEvent(self.start, self.type.interval, self, duration - self.type.interval) end return true end -- itemids that count as void when being checked for the top-most tile local include = { 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 3188, 3189, 3218, 3221, 3222, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4514, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4607, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 5827, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 5771, 5772, 5773, 5774, 6211, 6212, 6213, 6214, 6215, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7709, 7710, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7654, 7833, 7834, 7666, 7667, 7668, 7669, 7835, 7671, 7672, 7836, 7837, 477, 478, 487, 488, 8053, 8054, 8055, 8056, 8057, 8117, 8118, 8119, 8120, 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8365, 8030, 8031, 8032, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3225, 3242, 3243, 3244, 3245, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 9233, 9234, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9569, 9570, } -- get the top-most existent tile, and returns its z position function get_roof_tile(pos) pos.stackpos = 0 pos.z = 7 local thing = getTileThingByPos(pos) while pos.z >= 0 do if thing.uid == 0 or isInArray(include, thing.itemid) then return pos.z + 1 end pos.z = pos.z - 1 thing = getTileThingByPos(pos) end return 0 end -- checks if the position is walkable function is_walkable(pos) pos.stackpos = 0 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) while thing.uid ~= 0 and pos.stackpos <= 252 do if not isCreature(thing.uid) and (hasItemProperty(thing.uid, 3) or hasItemProperty(thing.uid, 7)) then return false end pos.stackpos = pos.stackpos + 1 thing = getThingFromPos(pos) end return true end -- simple callback for weathers to heal creatures function weather_heal(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if thing.uid ~= 0 then doCreatureAddHealth(thing.uid, rain_type.param[1]) doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) end return true end -- simple callback for weathers to damage creatures function weather_damage(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if thing.uid ~= 0 then doCreatureAddHealth(thing.uid, -rain_type.param[1]) doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) end return true end -- simple callback for weathers to teleport creatures function weather_teleport(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if isCreature(thing.uid) then local topos = {x=rain_type.param[1], y=rain_type.param[2], z=rain_type.param[3]} doTeleportThing(thing.uid, topos) end return true end -- import the weathers definition's file dofile(getDataDir() .. "/lib/weather-types.lua") Para criar novos tipos de chuva, use o comando "WeatherType:new" como exemplificado no script abaixo: /data/lib/weather-types.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- WeatherType:new(<table|number: effect(s)>, <number: interval>, <table|number: items>, <number: chance>[, function: callback[, ...]]) Rain = WeatherType:new(1, 15, {2016, 2017, 2018}, 60) DivineRain = WeatherType:new(1, 15, {2016, 2017, 2018}, 60, weather_heal, 200) Storm = WeatherType:new({1, 40}, 18, {2016, 2017, 2018}, 60) ThunderStorm = WeatherType:new({1, 40}, 18, {2016, 2017, 2018}, 60, weather_damage, 80) Blizzard = WeatherType:new({42, 43}, 20, {}, 0) AcidRain = WeatherType:new({8, 20}, 18, 1496, 60) MeteorRain = WeatherType:new(36, 18, {1492, 1493, 1494}, 10, weather_damage, 120) Sandstorm = WeatherType:new(34, 20, {}, 0) Snowfall = WeatherType:new(27, 15, {}, 0) Teleporter = WeatherType:new(10, 18, {}, 0, weather_teleport, 100, 100, 7) Fissure = WeatherType:new(6, 18, {1492, 1493, 1494}, 30, weather_damage, 300) StaticEnergy = WeatherType:new({11, 47}, 15, {}, 0, weather_damage, 30) Fireworks = WeatherType:new({28, 29, 30}, 18, {}, 0, weather_heal, 50) IceStorm = WeatherType:new(41, 20, {}, 0) Avalanche = WeatherType:new(44, 20, {}, 0) Para criar uma chuva eterna, altere a tabela "weathers" no script abaixo. /data/globalevents/scripts/weather-eternal.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- erase the two examples and add your own new locations inside this table, so they will start when the server start local weathers = { -- Storm:create({x=100, y=100}, {x=200, y=200}, 0.5), -- Blizzard:create({x=100, y=100}, {x=200, y=200}, 0.3), } -- globalevent's callback event function onStartup() for i, weather in pairs(weathers) do weather:start(false) end return true end Para criar uma chuva aleatória (acontece de vez em quando em uma área), altere a tabela "weathers" no script abaixo. /data/globalevents/scripts/weather.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- erase the two examples and add your own new locations inside this table, so they will be randomized local weathers = { -- Rain:create({x=100, y=100}, {x=200, y=200}, 0.5), -- Storm:create({x=100, y=100}, {x=200, y=200}, 0.3), } -- min and max durations of a weather, the value will be randomized local minduration = 240000 local maxduration = 600000 -- globalevent's callback event function onThink(interval, lastExecution, thinkInterval) if #weathers > 0 then weathers[math.random(1, #weathers)]:start(math.random(minduration, maxduration)) end return true end /data/globalevents/globalevents.xml <!-- Weather System --> <globalevent name="weather-eternal" type="start" event="script" value="weather-eternal.lua"/> <globalevent name="weather" interval="900" event="script" value="weather.lua"/> /data/talkactions/scripts/weather.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- types of weather that can be passed as <weather type> argument to the command local weathers = { ["rain"] = Rain, ["divine-rain"] = DivineRain, ["storm"] = Storm, ["thunder-storm"] = ThunderStorm, ["blizzard"] = Blizzard, ["acid-rain"] = AcidRain, ["meteor-rain"] = MeteorRain, ["sandstorm"] = Sandstorm, ["snowfall"] = Snowfall, ["teleporter"] = Teleporter, ["fissure"] = Fissure, ["static-energy"] = StaticEnergy, ["fireworks"] = Fireworks, ["ice-storm"] = IceStorm, ["avalanche"] = Avalanche, } -- auxiliary function, checks if a given value is an index of a given table local function is_index(t, v) for i in pairs(t) do if i == v then return true end end return false end -- talkaction's callback event function onSay(cid, words, param) local param = string.explode(param, " ") local weather local topleft = {} local bottomright = {} local duration = 1000 local intensity = 0.5 -- number of arguments' validation if #param < 3 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Usage: " .. words .. " <weather type> <top-left position> <bottom-right position> [duration=3000] [intensity=0.5]") return true end -- weather type's validation if not is_index(weathers, string.lower(param[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid weather type.") return true end weather = weathers[param[1]] -- top-left position's validation if not param[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Top-left position must be specified.") return true end -- top-left position's format validation local param_topleft = string.explode(param[2], "x") param_topleft[1] = tonumber(param_topleft[1]) param_topleft[2] = tonumber(param_topleft[2]) if not param_topleft[1] or param_topleft[1] < 0 or not param_topleft[2] or param_topleft[2] < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Top-left position is invalid. Use format <x>x<y> like this: 100x100. Values must be valid positive numbers.") return true end topleft.x = param_topleft[1] topleft.y = param_topleft[2] -- bottom-right position's validation if not param[3] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bottom-right position must be specified.") return true end -- bottom-right position's format validation local param_bottomright = string.explode(param[3], "x") param_bottomright[1] = tonumber(param_bottomright[1]) param_bottomright[2] = tonumber(param_bottomright[2]) if not param_bottomright[1] or param_bottomright[1] < 0 or not param_bottomright[2] or param_bottomright[2] < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bottom-right position is invalid. Use format <x>x<y> like this: 100x100. Values must be valid positive numbers.") return true end bottomright.x = param_bottomright[1] bottomright.y = param_bottomright[2] -- duration's validation param[4] = tonumber(param[4]) if not param[4] then duration = 3000 elseif param[4] <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Weather duration must be a valid number greater than 0.") return true else duration = param[4] end -- intensity's validation param[5] = tonumber(param[5]) if param[5] and param[5] >= 0 and param[5] <= 1 then intensity = param[5] elseif param[5] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Weather intensity must be a valid number between 0 and 1.") return true end -- create and start the weather with the specified arguments weather:create(topleft, bottomright, intensity):start(duration) return true end /data/talkactions/talkactions.xml <!-- Rain System --> <talkaction log="yes" words="/weather" access="3" event="script" value="weather.lua"/>
  3. Cast System 1.0 Como vãao galera? Há quanto tempo não? Hoje eu vim trazer para vocês um sisteminha bem simples e legal, aonde você pode assistir os outros jogadores e vice-versa. Versão testada: TFS 8.6 0.4 and TFS 0.3.6 8.6 Comandos utilizados in-game: !cast on -- Ativa o seu Cast System, e permite os outros jogadores te assistirem; !cast off -- Desativa o seu Cast System; !cast exit -- Você sai do Cast no qual está assistindo; !cast NAME -- Começa a assistir um jogador (NAME). Instalação Vá em data/talkactions/scripts crie um arquivo chamado castSys.lua e adicione o seguinte código dentro do mesmo: --[[ Perfect Cast System 1.0 by Roksas Acesse ja XTibia.com =) ]]-- function onSay(cid, words, param) local player = getPlayerByName(param) if not isInArray({"list", "exit", "off", "on"}, param) and not param or param == "" then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Enter the name of the player, which you want to cast in parameters.") return true end if param == "on" then if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already running ONLINE!") return true end castOn(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You have activated your Cast System, now others can cast you, to disable this feature, use the parameter '!cast off'.") return true end if param == "off" then if getPlayerStorageValue(cid, 10359) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already OFFLINE!") return true end castOff(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You have disabled your Cast System, from now on no one can watch you, unless you turn on the Cast, using the parameter '!cast on'.") return true end if param == "exit" then if getPlayerStorageValue(cid, 12269) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "You no are casting players.") return true end cancelCast(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You stopped casting, use the parameter '!cast list' to see who can be casted.") return true end if param == "list" then if #whoCasted() < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "At this time, no player can be casted, try again later.") return true end doPlayerSendTextMessage(cid, 20, "Players can be casteds:\n\n") for k, v in ipairs(whoCasted()) do doPlayerSendTextMessage(cid, 20, " - "..getCreatureName(v).."") end return true end if not isPlayer(player) then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "This player is offline or does not exist. Use the parameter '!cast list' to see who can be casted.") return true end if getPlayerStorageValue(player, 10359) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "You can only cast one person with the Cast System is activated, use the parameter '!cast list' to see who can be assisted.") return true end if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "To cast a player, you must first disable your Cast System using the parameter '!cast off'.") return true end if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendTextMessage(cid, 20, "You need enter in Protection Zone to use the Cast System.") and true end setPlayerStorageValue(cid, 12269, 1) castPlayer(cid, player) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You are casting the player "..getCreatureName(player)..", to exit just use the command '!cast exit'.") doPlayerSendTextMessage(player, 20, "You are casted by "..getCreatureName(cid).." player to disable your Cast, simply use the parameter '!cast off'.") return true end function cancelCast(uid) mayNotMove(uid, false) doCreatureSetHideHealth(uid, false) setPlayerStorageValue(uid, 12269, -1) doRemoveCondition(uid, CONDITION_OUTFIT) return doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) or doTeleportThing(uid, getPlayerMasterPos(uid)) and true end function castOn(uid) return setPlayerStorageValue(uid, 10359, 1) and true end function castOff(uid) return setPlayerStorageValue(uid, 10359, -1) and true end function castPlayer(uid, player) if not isPlayer(player) then cancelCast(uid) return true end if getPlayerStorageValue(player, 10359) < 1 then cancelCast(uid) return true end if getPlayerStorageValue(uid, 12269) < 1 then cancelCast(uid) return true end mayNotMove(uid, true) doSetItemOutfit(uid, 1934, -1) doCreatureSetHideHealth(uid, true) doTeleportThing(uid, getThingPos(player)) return addEvent(castPlayer, 1 * 1000, uid, player) and true end function whoCasted() local casteds = {} for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, 10359) >= 1 then table.insert(casteds, pid) end end return #casteds > 0 and casteds or {} end Volte uma pasta (data/talkaction) abra com algum editor de texto o arquivo talkactions.xml e adicione essa tag em qualquer lugar: <talkaction words="!cast;/cast" event="script" value="castSys.lua"/> Muito bem, após isso siga para a pasta data/creaturescripts/scripts, faça o mesmo, crie um arquivo chamado castSys.lua e adicione isso dentro: function onLogout(cid) if getPlayerStorageValue(cid, 12269) > 0 then doPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.") return false end setPlayerStorageValue(cid, 10359, -1) return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) then return false end return true end function onAttack(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end if getPlayerStorageValue(cid, 12269) > 0 then doRemoveCondition(cid, CONDITION_INFIGHT) return false end return true end Já no arquivo creaturescripts.xml, você vai adicionar essa tag: <event type="attack" name="castAttack" event="script" value="castSys.lua"/> <event type="statschange" name="castHits" event="script" value="castSys.lua"/> <event type="logout" name="castLogout" event="script" value="castSys.lua"/> E no arquivo login.lua você vai adicionar essas 3 linhas: registerCreatureEvent(cid, "castAttack") registerCreatureEvent(cid, "castHits") registerCreatureEvent(cid, "castLogout") Para que o player que está assitindo ao outro não use magias enquanto está assistindo, coloque essas linhas abaixo dentro de cada script das magias, debaixo da linha: function onCastSpell(cid, var) Coloque: if getPlayerStorageValue(cid, 12269) >= 1 then return doPlayerSendCancel(cid, "You is casting, not is possible.") and false end Faça a mesma coisa com as quests, embaixo de: function onUse(cid, item, frompos, item2, topos) Prontinho galera, basta reiniciar o servidor e usar, é isto por hoje, espero que tenham gostado, ideias/sugestões para futuras versões, bugs ou críticas sobre o sistema, basta deixar um simples comentário aí no tópico, estarei aqui para atendê-los. Obrigado pela atenção, façam bom uso.
  4. Créditos: 100% Draky Lucas O que é? Cada level que você upa, você ganha uma quantidade de pontos configuráveis, que pode ser trocados por skills, vida e mana, porem sendo controlado o que pode ser trocado por vocação (assim. um knight, por exemplo, nao compraria ML) PS: configurem vcs mesmos tudo na LIB Funcionamento: Só colocar e ver oO Video: comandos: /atributos /atributos add, club /atributos add, axe /atributos add, sword /atributos add, fist /atributos add, shielding /atributos add, distance /atributos add, mana /atributos add, vitality /atributos reset /atributos build instalação: em data/lib crie um arquivo chamado atributos.lua e nele adicione isso: agora em data/talkactions/scripts crie uma pasta chamada drakylucas e nela crie um arquivo chamado atributos.lua , colocando isso nele: agora em data/creaturescripts/scripts crie uma pasta chamada drakylucas e nela crie um arquivo chamado atributos.lua (sim, todos arquivos tem o mesmo nome.. cuidado nas pastas) e coloque isso: agora em data/creaturescripts/scripts, abre o login.lua e coloque isso ANTES do último return true: agora em data/talkactions/talkactions.xml coloque isso: <talkaction words="/atributos" event="script" value="drakylucas/atributos.lua"/> agora em data/creaturescripts/creaturescripts.xml coloque isso: <event type="advance" name="avancarGanharPontos" event="script" value="drakylucas/atributos.lua"/> reinicie o servidor e divirta-se. PS: não sei se funciona com sqlite.. eu uso MYSQL como banco de dados. Testado com TFS 0.4 Rev 3887 8.60 Por favor, nao deixem de comentar, desanima criar coisas e a cada 100 visitas, apenas um comentario. EDIT: Arrumado bug do magiclevel!
  5. well96

    Mount

    Eu não sei onde é a área correta, então estou postando aqui. Então galera, eu queria saber como fazer aquele efeito das árvores de ab'dendriel (fireflay), se tornarem montarias, eu queria que ela ficasse em volta do player como se fosse um efeito. Desde já agradeço.
  6. Função: Você pode alterar o seu tipo de pvp, utilizando o comando !pvp on, para conseguirem te atacar e !pvp off para não te atacarem SQL QUERY ALTER TABLE `players` ADD `pvpmode` BOOL NOT NULL ; em data/lib/function.lua function getPlayerPVPMode(uid) local result = db.getResult("SELECT `pvpmode` FROM `players` WHERE `name` = '" .. getPlayerName(uid) .. "' LIMIT 1;") if(result:getID() ~= -1) then local mode = result:getDataInt("pvpmode") return mode else return FALSE end result:free() end function setPlayerPVPMode(uid, value) if (value >= 0 and value <= 1) then if isPlayer(uid) == TRUE then db.executeQuery("UPDATE `players` SET `pvpmode` = " .. value .. " WHERE `name`='" .. getPlayerName(uid) .. "' LIMIT 1;") return TRUE else return FALSE end else return FALSE end end data/talkactions/scripts/pvpmode.lua function onSay(cid, words, param) local mode = getPlayerPVPMode(cid) if mode == 1 then setMode = 0 else setMode = 1 end if isPlayerPzLocked(cid) == FALSE and getCreatureSkullType(cid) == SKULL_NONE then setPlayerPVPMode(cid, setMode) if setMode == 1 then doPlayerSendTextMessage(cid, 19, "Now you set pvp mode to on!") else doPlayerSendTextMessage(cid, 19, "Now you set pvp mode to off!") end else doPlayerSendCancel(cid, "You cannot set pvp mode when you are agressive.") end return TRUE end talkactions.xml <talkaction log="no" words="!pvp" access="0" event="script" value="pvpmode.lua"> login.lua registerCreatureEvent(cid, "PVPMode") data/creaturescripts/scripts/pvpProtection.lua function onCombat(cid, target) if (getPlayerPVPMode(cid) == 1 and getPlayerPVPMode(target) == 1) or isPlayer(target) == FALSE then return TRUE else doPlayerSendCancel(cid, "You cannot attack players which pvp mode is off.") return FALSE end end creaturescripts.xml <event type="combat" name="PVPMode" event="script" value="pvpProtection.lua"> </event></talkaction> Credits Gevox
  7. Bom, esse sistema é requisitado por muitos donos de servidores.. sempre quando pedem as pessoas fazem e enviam por PM, por ser meio dificil... Essa é minha versão desse sistema Créditos 90% Draky Lucas (eu) 10% Vodkart (uma função que utilizei e me explicou como funcionaria o sistema, q os players nao sabem explica direito kk) O que ele é? o GM do servidor digita /arena X, onde o X é o numero de jogadores necessarios para o evento começar.. supondo que o GM digitou /arena 5: o evento criaria um teleport na posição configurada; esperaria 5 players entrarem nesse teleport (não contando os GM's.. também configuravel); assim que o 5º player entrasse, o evento esperaria um delay (configuravel) e sumonaria os bixos de cada level do evento (monstros e leveis configuraveis), e assim que criasse os monstros, contaria o mesmo delay varias veses para ir avançando de nivel (e criando mais monstros), os que sobreviverem ao ultimo nivel (configuravel) ganham premios (configuraveis). Não se morre no evento e não se adquire loot dos monstros, mas ganha exp dos monstros também! [SIM, É CONFUSO DE ENTENDER.. COLOQUE NO SERVIDOR E VEJA VOCÊ MESMO] TESTADO COM The Lost Server 8.6 (Caso dê erro de storage, é pq não sei se no TFS/Baiak tem as funçoes setStorage com esse nome, mas me avise que eu arrumo a versão TFS/BAIAK) Instalando o sistema: Mapa: Script: na pasta onde fica o executavel do server, há uma pasta chamada Mods, entre nela e crie um arquivo chamado arena.xml e nele coloque isso: [PS: Editado 01:39 - 14/07/2012 por correção de um erro ortográfico do forum que comeu um parenteses do script] <?xml version="1.0" encoding="UTF-8"?> <mod name="Arena" version="1.0" author="DrakyLucas" contact="XTibia" enabled="yes"> <config name="arena_config"><![CDATA[ config = { delay = 60, -- tempo de um level para o outro posicaoPlayer = {x = 37,y = 96,z = 7}, -- posição q o player vai cair dps de entra no TP posicaoArena = {{x = 35,y = 94,z = 7},{x = 42,y = 99,z = 7}}, premio = { {2160,70}, {2152,50}, }, -- ID, Quantidade... só aceita de 1 a 100 por vez, e você pode adicionar quantos itens quiser. storage = 15444, -- não mecha.. posicaoTp = {x = 37, y = 91, z = 7}, -- posicao que o teleporte vai aparecer acesso = 3, -- acesso minimo para ser ignorado pelo evento, e o mesmo acesso para poder inicializa-lo } -- você pode adicionar quantos leveis desejar -- [NumeroDoLevel] = {{"Nome",Quantidade},{"Nome",Quantidade},{"Nome",Quantidade},{"Nome",Quantidade},{"Nome",Quantidade}}, leveis = { [1] = {{"Dragon",5}}, [2] = {{"Dragon",5},{"Dragon Lord",2}}, [3] = {{"Dragon Lord",5}}, [4] = {{"Demodras",2},{"Demon",1}}, [5] = {{"Demon",5},{"Orshabaal",1},{"Ferumbras",1}}, } function abrirTeleport(n) doItemSetAttribute(doCreateItem(1387, config.posicaoTp), "aid", 2941) -- cria o tp e deixa aid 2941 doBroadcastMessage("O Evento arena vai começar! teleport foi aberto e faltam ".. n .. " pessoas para o evento iniciar!") doSetStorage(config.storage, n) end function fecharTPeAguardarEvento() doRemoveItem(getTileItemById(config.posicaoTp, 1387).uid,100) doBroadcastMessage("O evento ja concluio " .. #getPlayersInArena() .. " players e começará em " .. config.delay .. " segundos!") addEvent(evento,config.delay*1000,1) end function HaveCreatureArena(area, remove, clean) -- função do Vodkart for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end if clean ~= false then doCleanTile(pos, false) end end end end function resetEvento() doSetStorage(config.storage, -1) end function criarMonstros(lv) local monstro = leveis[lv] local area = {config.posicaoArena[1],config.posicaoArena[2]} for i = 1,#monstro do for k=1,monstro[i][2]do pos = {x=math.random(area[1].x,area[2].x), y=math.random(area[1].y,area[2].y), z=area[1].z} monstrinho = doCreateMonster(monstro[i][1], pos) registerCreatureEvent(monstrinho, "removerCorpse") end end end function evento(i) if #getPlayersInArena() == 0 then doBroadcastMessage("Ninguem sobreviveu a arena =/") doBroadcastMessage("EVENTO TERMINADO!") HaveCreatureArena({config.posicaoArena[1],config.posicaoArena[2]}, true, true) -- remove monstros, itens da arena resetEvento() return true end if i == (#leveis +1) then HaveCreatureArena({config.posicaoArena[1],config.posicaoArena[2]}, true, true) doBroadcastMessage("Evento finalizado, " .. #getPlayersInArena() .. " sobreviveram ao evento!") for _, pid in ipairs(getPlayersInArena()) do doPlayerSendTextMessage(pid,22,"Parabens, você sobreviveu ao evento!") addItens(pid) doTeleportThing(pid,getTownTemplePosition(getPlayerTown(pid))) end resetEvento() return true end for _, pid in ipairs(getPlayersInArena()) do doPlayerSendTextMessage(pid,22,"GoGo Nivel " .. i .. " !!!") end criarMonstros(i) addEvent(evento,config.delay*1000,i+1) end function addItens(pid) for i=1,#config.premio do doPlayerAddItem(pid,config.premio[i][1],config.premio[i][2]) end doPlayerSendTextMessage(pid,22,"Parabens, voce recebeu seus premios!") end function getPlayersInArena() local t = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccess(pid) < config.acesso then if isInRange(getCreaturePosition(pid), config.posicaoArena[1], config.posicaoArena[2]) then table.insert(t, pid) end end end return t end ]]></config> <talkaction words="/arena" event="buffer"><![CDATA[ domodlib('arena_config') if getPlayerAccess(cid) < config.acesso then return doPlayerSendCancel(cid,"Voce nao tem acesso para esse comando") end if tonumber(param) ~= nil then -- se o parametro é numerico if tonumber(param) > 0 then doSetStorage(config.storage, param) abrirTeleport(param) end else doPlayerSendTextMessage(cid,19,"Digite /arena e um numero.. \n exemplo: \n/arena 5") end ]]></talkaction> <movevent type="StepIn" actionid="2941" event="script"><![CDATA[ domodlib('arena_config') if getPlayerAccess(cid) > config.acesso then doTeleportThing(cid, config.posicaoPlayer) return false end -- GM nao conta doSetStorage(config.storage,getStorage(config.storage) - 1) doTeleportThing(cid, config.posicaoPlayer) registerCreatureEvent(cid, "naoAtacarPlayer") registerCreatureEvent(cid, "morrerNaArena") if getStorage(config.storage) <= 0 then fecharTPeAguardarEvento() end return true ]]></movevent> <event type="login" name="VerSeTaNaArenaEExpulsa" event="script"><![CDATA[ domodlib('arena_config') if isInRange(getCreaturePosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true ]]></event> <event type="combat" name="naoAtacarPlayer" event="script"><![CDATA[ domodlib('arena_config') if isPlayer(cid) and isPlayer(target) then if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) and isInRange(getPlayerPosition(target), config.posicaoArena[1], config.posicaoArena[2]) then doPlayerSendCancel(cid, "Nao ataque seus amigos.") return false end end return true ]]></event> <event type="death" name="removerCorpse" event="script"><![CDATA[ domodlib('arena_config') doCreatureSay(cid,"Ninguem terá meu loot! Buaahahahha",1) pos = getCreaturePosition(cid) addEvent(doCleanTile,1,pos, false) return true ]]></event> <event type="statschange" name="morrerNaArena" event="script"><![CDATA[ domodlib('arena_config') if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then if type == STATSCHANGE_HEALTHLOSS then if isPlayer(cid) then if value >= getCreatureHealth(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(pid,22,"Você morreu na arena =/.. veja pelo lado positivo, você nao perdeu nada!") doCreatureAddHealth(cid,getCreatureMaxHealth(cid) - getCreatureHealth(cid)) return false end end end end return true ]]></event> </mod> pronto, sistema adicionado.. agora vamos configurar: Tempo entre cada level Posição que está em branco na foto Posições que estão em azul na foto Premios (copie e cole como está, mude valores, adicione mais itens.. não há um limite de premios) Posição que o TP aparecerá para os players entrarem no event Acesso minimo para dar /arena X Monstros de cada Level (Obs: você pode adicionar quantos leveis desejar para o evento) Possiveis Erros: caso dê erro citado por algumas pessoas no forum (logo abaixo) é porque vocês utilizam uma distro diferente da minha e incompativel com UTF-8 então mudem <?xml version="1.0" encoding="UTF-8"?> por <?xml version="1.0" encoding="ISO-8859-1"?> e tudo deverá funcionar. Correção do erro feita pelo usuario KUNGLOW obrigado pela atenção Obrigado .. EXCLUSIVO XTIBIA
  8. Como funciona? É um sistema aprimorado do Guild Points, onde há uma Loja EXCLUSIVA para Guilds no Website, assim não misturando Doadores e Jogadores Normais. Primeiramente faça o Download abaixo. Download Coloque os arquivos em seus devidos locais. - Os arquivos da pasta "talkactions" coloque em seu OTServer. - Os arquivos da pasta "Parte do Site" coloque no seu xampp, ou lampp se for Linux. Logo após vá no seu site/config/config.php e logo após de: $config['site']['shop_system'] = 1; Adicione: $config['site']['shopguild_system'] = 1; Agora execute as querys da pasta "Parte do Site" em sua database. Logo após vai em layout/tibiacom/layout.php e procure por: <a href='?subtopic=shopsystem'> Logo no final do script após </a> adicione: <a href='?subtopic=guildshop'> <div id='submenu_shopsystem' class='Submenuitem' onmouseover='MouseOverSubmenuItem(this)' onmouseout='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_shopsystem' class='ActiveSubmenuItemIcon' style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color='green'/><b>Shop Guild</b></font></div> <div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> </div> </a> Após isso vá em index.php na pasta principal do seu WebSite, procure por: case "shopsystem"; E logo no final do script após break; adicione: case "shopguild"; $subtopic = "shopsystem"; $topic = "Shop System"; include("shopsystem.php"); break; Pronto! O sistema está perfeitamente instalado. Instruções: - Para adicionar ou remover items do Shop apenas pela database em z_guild_shop_system. - Para configurar a quantidade de pontos e a quantidade de players necessários edite no arquivo lua na parte dos talkactions. Créditos: Hastle Host ChaitoSoft Eduardo Lima
  9. não sei se esta é a area correta mas... No Naruto Shinobi alguem sabe como ativar os eventos? Arena Survival e Guerra Ninja? Eu olho talkactions aparece /tsui < mas esse é tsuki no me /ctf < rouba bandeira /assassin < evento assassin /ctftrap < não conseguir identificar pois n repsondeu a nenhum comando exemplo: /ctftrap on /ctftrap open /ctftrap start Alguem me ajuda obg ^^
  10. Versões: Foi feito para servidores que não tem o market system, mas funciona desde o 8.54 até 9.6+ Suporta: servidores Sqlite e MySql Sobre: O Npc basicamente funciona da seguinte maneira, você "deposita" alguns items neste npc e durante "X" dias ele vende para você, claro que o npc irá cobrar "Y" preço pelo serviço... Para mais informações acessem o link que explica com imagens: http://www.xtibia.co...mo-auction-npc/ Basta fazer o download, executar a query que é pedida e depois disso colocar os arquivos em seus respectivas pastas. Npc Auction.rar
  11. Olá estou fazendo um server de naruto e colocando um sistema de elementos, porém pensei em fazer nas vocações também tipo naruto ser fraco contra fogo e forte contra energia, olhei no vocations.xml mas nao achei nada, alguém pode me ajudar?? (nao sei se aqui é a area correta, se nao for movam por favor.)
  12. Mapa para Zombie Event - Download Via SpeedyShare OBS - Antes de falarem que já existe no fórum, teste os outros scripts. Então começando por informações basícas : Para abrir o evento : /zombiestart numero de players. Exemplo: /zombiestart 2 Para Iniciar o evento sem o numero máximo de players: /zombiestart force. Apos aberto sempre que um player enta no portal do evento e avisado por broadcast. Entrou na arena e o numero de players restantes para o evento ser iniciado. Apos o evento ser iniciado um zombie e sumonado a cada 20 segundos, o player que for infectado e teleportado para o templo vence o ultimo player restante na arena. Ao terminar o evento e anuciado por broadcast o nome do player vencedor tempo que durou na arena e por quantos zombies ele sobreviveu, entrega de premio automatica, premio configuravel. Garantia de funcionabilidade perfeita em TFS 0.4 se configurado corretamente, não testado em outras versões de distros. Vamos ao evento! Como implementar em seu site - Vá ate "C:/xampp/htdcos/" crie um arquivo chamado Zombieevent.php dentro coloque isso - Depois vá na pasta do xampp/htdocs, abra o index.php e em baixo disso - case "buypoints": $topic = "Buy Points"; $subtopic = "buypoints"; include("buypoints.php"); break; Adicione isso - case "zombieevent": $topic = "Zombie event"; $subtopic = "zombieevent"; include("zombieevent.php"); break; Agora vá em "C:/xampp/htdcos/layout/tibiacom/" abra o arquivo layout.php, depois disso - <a href='?subtopic=highscores'> <div id='submenu_highscores' class='Submenuitem' onmouseover='MouseOverSubmenuItem(this)' onmouseout='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_highscores' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Highscores</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Cole isso - <a href='?subtopic=zombieevent'> <div id='submenu_zombieevent' class='Submenuitem' onmouseover='MouseOverSubmenuItem(this)' onmouseout='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_highscores' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon- activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Zombie Event</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Vamos Ao Script! Vá em data/creaturescripts/scripts e crie uma pasta com o nome de zombie. Cria um arquivo .lua com o nome de onattack e adicione isso - Ainda na pasta zombie, crie um arquivo .lua com o nome de ondeath e adicione isso - Agora crie um arquivo .lua com nome de onthink e adicione isso - Agora vá em data/globalevents/scripts e também crie uma pasta com o nome de zombie. Crie um arquivo .lua com o nome de onstratup e adicione isso - Crie um arquivo .lua com o nome de onthink e adicione isso - Agora va na pasta data/lib e crie um arquivo .lua chamado zombie_event, adicione isso - Agora va em data/movements/scripts crie uma pasta chamada zombie. Crie um arquivo .lua com o nome de oneenter e adicione isso - Vá em data/talkactions/scripts e crie uma pasta com o nome de zombie. Crie um arquivo .lua com o nome de onsay e adicione isso - Vá na pasta data/monster e crie um arquivo .xml com o nome de zombie_event, e adicione isso - Agora as tags - Vá em data/creaturescripts, abra creaturescripts.xml e adicione as tag's - <event type="think" name="ZombieThink" event="script" value="zombie/onthink.lua"/> <event type="statschange" name="ZombieAttack" event="script" value="zombie/onattack.lua"/> <event type="death" name="ZombieDeath" event="script" value="zombie/ondeath.lua"/> Vá em data/globalevents, abra globalevents.xml e adicione as tag's - <globalevent name="ZombieGlobalThink" interval="5000" event="script" value="zombie/onthink.lua"/> <globalevent name="ZombieGlobalStartup" type="start" event="script" value="zombie/onstartup.lua"/> Vá em data/movements, abra movements.xml e adicione a tag - <movevent type="StepIn" actionid="5555" event="script" value="zombie/onenter.lua"/> Vá em data/talkactions, abra talkactions.xml e adicione a tag - <talkaction log="yes" words="/zombiestart" access="4" event="script" value="zombie/onsay.lua"/> Vá em data/monster, abra monster.xml e adicione a tag - <monster name="Zombie Event" file="zombie_event.xml"/> Tutorial de como configurar zombie event! data/creturescripts/scripts/zombie/onattack.lua function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.") doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!") end Partes configuraveis no script no caso são os avisos do evento que não recomendo mudar na verdade os premios que no caso são esses: doPlayerAddItem(winner, 2157, 5, true) --/ 2157= ID do item no caso golden nugguets mais você pode por o que quiser, 5= Quatidade do item a ser dado. True= no caso creio que seja para deixar essa premiação ativa ou não true = verdadeira no caso ativa para deixar a premiação inativa apenas mude o true por false ou remova a tag... Para adicionar mais premios e só adicionar mais tags como tá ai no script o outro premio no caso ali e uma boh. Explicando - data/lib/zombie_event.lua -- CONFIG ZE_DEFAULT_NUMBER_OF_PLAYERS = 20 –- Não precisa mexer. ZE_ACCESS_TO_IGNORE_ARENA = 4 –- Não precisa mexer. -- POSITIONS ZE_blockEnterItemPosition = {x=32341, y=32213, z=7} -- onde nasce o teleport? ZE_enterPosition = {x=32154, y=32578, z=7} -- onde os players nascem dentro da arena zombie? ZE_kickPosition = {x=32368, y=32241, z=7} -- quando morre vai para onde? ZE_spawnFromPosition = {x=32140,y=32566,z=7} -- para sumonar zombie (de)/ aqui vc pega no rme na area do seu evento o primeiro tile da arena </\ e copia a position. ZE_spawnToPosition = {x=32168,y=32590,z=7} -- para sumonar zombie (ate) e aqui a mesma coisa mais o tile de\/> só lembrando e o ultimo tile da arena do lado de fora não o ultimo tile do mapa. http://imageshack.us/scaled/landing/854/semttulophp.png É isso ai, espero que tenham gostado! Créditos - Fausto32/Isbigo/AnneMotta
  13. O que ela faz? ao clicar na pedra é salvo a sua posição atual assim quando for usada novamente o jogador será teleportado para a posição salva. ao falar com um npc pode-se resetar a pedra ou então salvar a posição para a cidade atual do npc. se tiver algum bug ou se tiver alguma ideia, sugestão não deixa de comentar
  14. Seguinte galera, tenho um ot aqui, o styller e nele n tem os comandos de guild (!joinguild, !crateguild etc etc..) gostaria de como por esses comandos, quais os scripts e tags para a talkaction. Detalhe tenho tbm junto com o sv o Gesior, nele da pra fazer a guild mas n da pra editar depois q vc sai do primeiro acesso, caso coloque esses scripts da talkaction ira bugar o site ou vice e versa ? Agradeço, dou rep++ a quem me ajudar.
  15. [24/11/2013 12:41:01] [Warning - Actions::registerEvent] Duplicate registered item id: 14058 [24/11/2013 12:41:01] [Error - LuaScriptInterface::loadFile] data/lib/configuration.lua:9275: '}' expected (to close '{' at line 8505) near 'newpokedex' [24/11/2013 12:41:01] [Warning - LuaScriptInterface::initState] Cannot load data/lib/ [24/11/2013 12:41:02] [Error - LuaScriptInterface::loadFile] data/lib/configuration.lua:9275: '}' expected (to close '{' at line 8505) near 'newpokedex' [24/11/2013 12:41:02] [Warning - LuaScriptInterface::initState] Cannot load data/lib/ [24/11/2013 12:41:02] [Error - LuaScriptInterface::loadFile] cannot open data/movements/scripts/PVP/Tile_Pz.lua: No such file or directory [24/11/2013 12:41:02] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/PVP/Tile_Pz.lua) [24/11/2013 12:41:02] cannot open data/movements/scripts/PVP/Tile_Pz.lua: No such file or directory [24/11/2013 12:41:03] [Error - LuaScriptInterface::loadFile] data/lib/configuration.lua:9275: '}' expected (to close '{' at line 8505) near 'newpokedex' [24/11/2013 12:41:03] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
  16. Bom galera, estou (estava) tentando criar um systema de duel eficiente, então fiz o seguinte script na pasta data/lib com nome de DuelSystem Porem Não esta funcionando, Poderiam ver ond que eu errei? Pls pois meu ot está sem systema de Duel e isso é tenso
  17. Gente, estou com um erro aqui no meu script, primeiro vou falar do que eu to tentando fazer, depois vou falar do erro.. Eu to tentando fazer com que possa transformar por exemplo 100 moedas verde, em 1 moeda prata, e vice versa, igual o sistema de troca de gold coins>platinum coins>crystal coins.. Enfim, pra fazer esse script eu basicamente peguei o script do server que é changegold.lua e tentei adicionar somente o que eu queria fazer, abaixo segue o script: Agora o erro: Por favor, se alguem puder me ajudar nisso faz ai . Obrigado
  18. #Introdução Bem, este é um sistema no qual você pode protejer o seu locker(depot) com senha, assim evitando hackers. #Instalação Primeiro faça o download do sistema e cole na sua pasta data. Após ter instalado os arquivos nas suas respectivas pastas adicione as tags: @Actions <action itemid="2589; 2590; 2591; 2592" event="script" value="DPPass.lua"/> <!-- DP Pass --> @Creaturescripts <event type="login" name="LockerPass" event="script" value="DPPass.lua"/> <!-- DPPass --> @Movements <movevent type="StepOut" actionid="96475" event="script" value="DPPass.lua"/> <!-- DPPass --> @Talkactions <talkaction words="!locker" script="DPPass.lua"/> <!-- DP Pass --> Abraço.
  19. #Introdução Este é um sistema de rouba bandeira, no qual tem dois times, que se enfrentam e tentam se infiltrar na fortaleza do inimigo, roubar a bandeira dele e retornar para sua base com ela. #Instalação Faça o download do sistema e cole na pasta do seu servidor. Após ter instalado os arquivos nas suas respectivas pastas abra a pasta do seu servidor, e em seguida abra a pasta spells/scripts/support, e abra o arquivo invisible.lua com algum editor de texto, depois de function onCastSpell(cid, var) cole isso: if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) > 0) then return doPlayerSendCancel(cid, "Você não pode usar invisible durante o CTF!") and doSendMagicEffect(getThingPos(cid), 2) end ficando assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) function onCastSpell(cid, var) if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) > 0) then return doPlayerSendCancel(cid, "Você não pode usar invisible durante o CTF!") and doSendMagicEffect(getThingPos(cid), 2) end return doCombat(cid, combat, var) end #Configuração Como na maioria dos meus códigos: as configurações ficam na lib, então: _CTF_LIB.flags = { [_CTF_LIB.redid] = {pos = {x = 744, y = 638, z = 6}, posEflag = {x = 744, y = 644, z = 6}, id = 1435, color = 180, na = "Vermelho", temple = 3, temple = 3, Esse é o id do templo que os players do time vermelho serão teletransportados. pos = {x = 744, y = 638, z = 6}, Posição de onde a bandeira do time fica posEflag = {x = 744, y = 644, z = 6}, Posição de onde os players do time entregam a bandeira. winp = 2, recompCTF = {{2160, 2}}, nopen = true, -- Precisa usar o comando para abrir? false não true sim TownExit = 1, -- Templo que o player será teletransportado quando acabar o evento ou ele sair dele. price = false, -- Preço para entrar no Evento, caso não precise Digite false. winp = 2, recompCTF = {{2160, 2}}, winp : pontos que um time precisará fazer para ganhar o evento. recompCTF: recompensa que o time ganhará ao vencer o CTF. para adicionar mais só é você fzer assim: recompCTF = {{2160, 2}, {7542, 1}}, 2160 é o id do item que vai adicionar, e 2 é a quantidade. 7542 é o id do item que vai adicionar, e 1, é a quantidade. nopen = true, -- Precisa usar o comando para abrir? false não true sim se precisar usar o comando /ctf open para abrir o evento coloque true, se não precisar coloque false. TownExit = 1, -- Templo que o player será teletransportado quando acabar o evento ou ele sair dele. price = false, -- Preço para entrar no Evento, caso não precise Digite false. TownExit: id do templo que o player será teletransportado quando ele sair do evento ou quando o adm usar /ctf close. price: preço para entrar no evento em gold coins, caso não precise deixe false. Não esqueçam de criar um teleport dentro do evento, com a actionid 47521, caso os players queiram sair do evento E aqui acabamos mais um código.. '-' Flw ae xD . Qualquer bug não se acanhe em falar Abraço.
  20. Boa tarde, gostaria de saber como adiciono pra capturar tal poke e restrição pra nao capturar tal poke. exemplo. Gostaria de bota pra não capturar o Aerodactyl. e Gostaria de bota para capturar o crystal onix que nao está dando. obrigado!
  21. Então vou tentar te explicar um pouco de como funciona esse sistema de SAGA que você esta querendo então vou pegar o do Iruka mesmo so para te explicar: Primeiramente tu vai criar o npc que vai pedir para fazer a saga no meu caso vai ser o Mizuki entao vai na pasta npc e cria o npc.xml e depois na pasta script eu vou criar o script do meu npc: Configurando esse primeiro npc: sempre no script onde estiver: if(msgcontains(msg, 'ajuda')) vai ser a fala do player onde esta em vermelho. ainda no script sempre onde estiver: selfSay('Entao, ouvi falar que tem um "pergaminho" muito poderoso, acredito que se conseguir ele podera aprender qualquer jutsu.', cid) vai ser a fala do npc onde esta em vermelho. onde estiver assim veja: if(doPlayerRemoveItem(cid, 2396, 75) == TRUE) then será a tag do item que o player terá de ter para fazer a saga ou seja o item que o npc vai remover de seu slot onde está em laranja é a id do item que vai remover no meu caso é o pergaminho secreto entao essa é a id do meu pergaminho entao olhe o item que você vai querer. onde esta: doPlayerAddItem(cid,10135,1) isso serve para tipo de recompença caso você queira colocar uma recompença para o player onde está roxo. é a id do item que o player vai receber de recopença e onde esta verde. é a quantidade do item que o player vai receber. doPlayerAddExperience(cid,1000) Aqui é a quantidade de Experiencia que o player vai receber apos a missao ser cumprida. PRONTO O PRIMEIRO NPC ESTÀ PRONTO VAMOS PARA O SEGUNDO. no meu caso vai ser o IRUKA. entao na pasta npc eu vou criar um arquivo.xml e vou colocar o script: depois na pasta script vou criar um arquivo.lua e vou por o seguinte script: Configurando o Segundo NPC: Não irei explicar umas coisas que ja expliquei no primeiro npc como if(msgcontains(msg, 'pergaminho')) e selfSay('Muito bem shinobi, esse pergaminho eh muito antigo e uma {reliquia} secreta de nossa aldeia.', cid) que são as falas do npc e do player. if(doPlayerRemoveItem(cid, 2155, 1) == TRUE) then aqui também ta explicado la em cima. doPlayerAddExperience(cid,7000) aqui também. doPlayerAddItem(cid,10140,1) aqui tabém. é isso ae do que você mais precisa no npc ta explicado ae xD Espero ter ajudado. OBS: Como não tem como criar novo tópico na area de tutoriais de scripting eu coloquei aqui mesmo caso esteja em area errada por favor movam para min xD
  22. Atendendo ao pedido do LourencoTibia (http://www.xtibia.com/forum/topic/221228-peca-aqui-o-seu-sistemaevento/page-2#entry1563530) Explicação: Você cria uma casa. Através dessa casa você dá acesso a um lugar (preferivelmente pequeno). Nesse lugar você coloca uma alavanca e um quadro negro, placa, ou coisa do tipo. Ao puxar a alavanca, será ativado um respawn de um determinado monstro (configurável), limpando todos os outros monstros que existem nessa área, enviando uma msg para o jogador sobre qual respawn está ativado. Ao olhar para a placa/quadro/etc (você escolhe), o jogador receberá uma janela com os monstros que podem ser ativados e qual está ativo no momento. Códigos: Salve em actions/scripts como qgaction1.lua Salve em creaturescripts/scripts como qglook1.lua: TAGs Em creaturescripts.xml, adicione:<event type="look" name="QGboard1" event="script" value="qglook1.lua"/> Em actions.xml, adicione:<action actionid="> actionid de sua escolha <" script="qgaction1.lua"/> Em login.lua, adicione (próximo aos demais registerCreatureEvents)registerCreatureEvent(cid, "QGboard1") Configurações (preste atenção ou não irá funcionar) local aid = 75000 Aqui você deverá adicionar um actionid (diferente para cada QG) no quadro/placa/etc (pelo editor do mapa) e ele deverá ser o mesmo daquilocal monsters = { [1] = 'demon', [2] = 'vampire', [3] = 'dragon lord', [4] = 'hydra', } Aqui você deve configurar, ordenadamente, os monstros que estarão disponíveis do Quartel Generallocal posi = {x=49, y=217, z=7} local posf = {x=90, y=271, z=7} Aqui você deve configurar a posição inicial (canto superior esquerdo) e a posição final (canto inferior direito) do seu QGlocal gstorage1 = 8671 local gstorage2 = 8672 Aqui você deve colocar números aleatórios e diferentes em cada QG (lembre-se de editar nos dois arquivos e deixe assim para o primeiro QG)local respPos = { [1] = {x=57, y=223, z=7}, [2] = {x=79, y=223, z=7}, [3] = {x=56, y=224, z=7}, [4] = {x=82, y=242, z=7}, } Aqui você insere cada uma das posições dos spawns, dentro da área em que os monstros serão criadosO processo deverá ser repetido inteiro para cada novo QG, mudando, além das configurações, os nomes QGboard1, qglook1, qgaction1 para o número do QG que você está fazendo! Screenshot
  23. Boa Tarde amigos do XTIBIA Boa Tarde, estou com 3 probleminhas do meu sistema de informação que eu montei, que seria: Não aparece quantos dias de VIP o player tem. Aparese um ERRO no console quando alguem digita o nome errado do player. Não aparece o sexo do player (exemplo: Masculino ou Feminino) só aparese número, 0 ou 1. E quando atualiza a informação do player (exemplo: o cara upa, skill, magic level, entre outros), acaba multiplicando as informações do player. SCRIPT: ERRO no console quando digita o nome errado: ALGUEM AJUDA, PORFAVOR, VALENDO +REP
  24. Idle-System 1.0 Hello guys, só deboua na lagoua é? Pensei em criar um sisteminha bem legal para OTServ, nele, os jogadores podem se distanciar [ficar AFK] quanto tempo quiserem, sem ser kikados pelo Idle do config.lua. Nenhum jogador gosta de ir comer e quando voltar estar deslogado rsrs. Vá em (data/talkactions/scripts), crie um arquivo chamado idleSys.lua e adicione dentro: --[[ Idle-System 1.0 Criado por Roksas Acesse já - XTibia.com. ]]-- function onSay(cid, words, param) if not param or param == "" then return doPlayerSendCancel(cid, "[Idle-System] Você deve informar o status desejado, [on/off].") and true end if getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "[Idle-System] Você não pode utilizar este recurso caso esteja em batalha.") and true end if param == "on" then if getPlayerStorageValue(cid, 154490) >= 1 then return doPlayerSendCancel(cid, "[Idle-System] O seu idle já havia sido ativado, favor desativar.") and true end doCreatureSetNoMove(cid, true) setPlayerStorageValue(cid, 154490, 1) idleStart(cid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Idle-System] Você ativou o seu idle.") elseif param == "off" then if getPlayerStorageValue(cid, 154490) < 1 then return doPlayerSendCancel(cid, "[Idle-System] O seu idle já havia sido desativado.") and true end doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 154490, -1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Idle-System] Você desativou o seu idle.") return true end return true end --//--// function idleStart(uid) local txts = {"Ausente", "AFK!", "Já volto!", "Aguarde..."} if not isPlayer(uid) then return true end if getPlayerStorageValue(uid, 154490) < 1 then return true end doCreatureSetLookDir(uid, math.random(1, 4)) doSendAnimatedText(getThingPos(uid), txts[math.random(#txts)], math.random(1, 255)) return addEvent(idleStart, 10 * 1000, uid) end Logo em seguida, volte para a pasta (data/talkactions), abra com algum editor de texto o arquivo talkactions.xml e adicione esta seguinte tag: <talkaction words="/afk;!afk;!ausente;/ausente" event="script" value="idleSys.lua"/> É só isto meus anjos, façam bom proveito haha. Obrigado por acessar a comunidade
  25. Forje System Como vai galerinha, tive uma ideia bem legal com a ajuda do vital900, é para dar um pouco mais de RPG ao seu servidor. No caso é um sistema de Forja, no qual um NPC te leva para uma ilha, nela você deve levar junto um minério (Iron Ore) e um Hammer, você vai aquecer o Iron Ore jogando-o no coal basin e clicando no assoprador, em seguida se obter chance vai criar um metal derretido, e aí você deve bater nele, novamente se obter chance poderá ser transformado num item, este item faz com que seus equipamentos subam + 1 de Ataque, Defesa e Armor. Instalação Vá em data/actions/scripts, copie algum arquivo da pasta e cole, ou crie, renomeie para forge_system.lua em seguida adicione isso dentro dele, usando algum editor de texto: Volte para a pasta (data/actions), abra com o bloco de notas o arquivo actions.xml, e dentro dele adicione essa tag: <action actionid="17000" itemid="4846;8299" event="script" value="forje.lua" /> Agora siga para a pasta data/npc, copie algum arquivo da pasta e cole, renomeie para Forger e adicione dentro usando o bloco de notas: <?xml version="1.0" encoding="UTF-8"?> <npc name="Forger" script="forge_npc.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="71" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. If you want forge say {forge}, need HAMMER and IRON ORE!"/> </parameters> </npc> Abra a pasta scripts dentro de data/npc, copie algum arquivo da pasta e cole, renomeie para forge_npc e adicione dentro usando algum editor de texto: Configuração No código de actions forge_system.lua, procure por este trecho e edite conforme citado abaixo: local cfg = { pos = {x = 1021, y = 1032, z = 7, stackpos = 255}, minerioTo = 5880, meltedTo = 5892, burnTo = 12404, hammerId = 4846, refinerId = 8299, secsInterval = 10, } pos = Coordenadas do coal basin do mapa postado para download minerioTo = O itemid do minério que vai ser derretido, (iron ore) meltedTo = ItemId do minério derretido burnTo = itemId do minério queimado hammerId = Item ID do martelo que vai bater na bigorna refinerId = O ID do item final, oque vai refinar os equips secsInterval = A cada quantos segundos pode fazer uma tentativa de forge. Na tag do actions.xml você encontra isso: <action actionid="17000" itemid="4846;8299" event="script" value="forje.lua" /> Mude apenas aonde está itemid, coloque na ordem: (O ItemID do Hammer e do Refiner derretido). No código de NPC, no caso o arquivo forge_npc.lua, você encontra esse trecho: local cfg = { area = {fromx = 1015, fromy = 1028, z = 7, tox = 1028, y = 1019, z = 7}, forgePosition = {x = 1018, y = 1034, z = 7}, templePosition = {x = 999, y = 1018, z = 7}, hammerId = 4846, minerioTo = 5880, needMoney = 1000, maxTime = 1, maxForge = 24, } area = Coloque as coordenadas do canto superior esquerdo da área de forja e do canto inferior direito forgePosition = coloque as coordenadas da sala de forja templePosition = pra aonde vai ser teleportado após acabar o tempo, no caso um Templo hammerId = O mesmo do forge_system.lua, coloque o Item ID do hammer (martelo) minerioTo = Coloque o Item ID do iron ore needMoney = Quanto de dinheiro precisa pra ir pra sala de forja maxTime = Quantos minutos no máximo pode ficar na sala de forja maxForge = A cada quantas horas pode entrar na sala de forja, coloquei 24, ou seja, 1x ao dia. Demonstração Créditos GIF: curruwilliam Finalizações Muito obrigado pela atenção galera e um forte abraço ao vital900 que me ajudou com o mapa e as ideias. Qualquer dúvida e/ou crítica estou aqui para atendê-los. Espero que façam um bom uso do mesmo Download Forge Mapa - Scan Forge Mapa Download Forge System - Scan Forge System
×
×
  • Criar Novo...