
Tudo que MaXwEllDeN postou
- SEM DANOS NA MESMA PARTY
-
(Resolvido)[Pedido] Evolução
Não, ela serve pra se eu logar, e tiver com um amuleto que é de um nível superior(acontece quando você morre), ele trocar o amuleto para um anterior. Vou tentar explicar a minha lógica pra resolver esse problema. Primeiro, eu crio uma variável que vai ter todos os lvls anteriores ao meu(EM ORDEM CRESCENTE). Aqui, eu coloco todos os leveis menores, ou iguais ao meu, na tabela lower_lvls. OBS: Note que eles não vão ser adicionado necessariamente em ordem crescente. Aqui, ele reorganiza a tabela lower_lvls, para que fique em ordem crescente(Meu objetivo é pegar o último level da tabela, para saber qual amuleto eu devo usar). Aqui ele pega o id do meu novo amuleto, baseado no level que eu deveria ter para pegar ele. Acho que ficou um pouco confuso D: Mas, espero que dê para entender '-'
-
(Resolvido)[Pedido] Evolução
local amuletos = { [1] = 7887, [2] = 7888, [5] = 7889, [7] = 7890, [10] = 7891, [13] = 7882, [16] = 7883, [20] = 7885, } function onAdvance(cid, skill, oldlevel, newlevel) if skill == 8 and amuletos[newlevel] then doPlayerSendTextMessage(cid, 22, "You received "..getItemNameById(amuletos[newlevel]).." for reaching level".. newlevel..".") doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, amuletos[newlevel]) end return true end function onLogin(cid) local lower_lvls = {} for level, id in pairs(amuletos) do if level <= getPlayerLevel(cid) then table.insert(lower_lvls, level) end end table.sort(lower_lvls, function(a, b) return a < b end) local amuleto_novo = amuletos[lower_lvls[#lower_lvls]] if amuleto_novo ~= getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid then doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, amuleto_novo) end return true end <event type="advance" name="medal" event="script" value="medal.lua"/> <event type="login" name="medalLogin" event="script" value="medal.lua"/>
-
max ... WTF?
- Arrumando magicdoor nova
Posta aqui o script movements/scripts/closingdoor.lua- Arrumando magicdoor nova
Adiciona isso no seu movements.xml: <movevent type="StepOut" itemid="12165" event="script" value="closingdoor.lua"/>- [TFS 1.0] GuildPoints System - TALKACTIONS
- [TFS 1.0] GuildPoints System - TALKACTIONS
- Surprise, I'm back
Welcome back- LUA Functions
OMG, não sabia que tinha tantos metamétodos agora vou baixar essa versão nova do TFS e começar a dar uma estudada. Muito bom, Bruno- (Resolvido)[Pedido] Evolução
Não não, tipo. A sintaxe para retornar um valor de uma tabela é isso: O Index pode ser tanto numérico como uma string. Note que para ler o valor "Maxwell", eu poderia fazer de duas formas: print(tabela["Max"]) print(tabela.Max) Do mesmo modo que para definir o valor "Maxwell" eu posso colocar o Index de dois modos: local tabela = { Max = "Maxwell", } Que é teoricamente igual a isso: local tabela = { ["Max"] = "Maxwell", } Enfim. Essa é a expressão para retornar o valor de uma tabela: Identificador_da_tabela[Index]- Arrumando magicdoor nova
Exato :B. Acabei esquecendo do movement para fechar, haha. Todos os servidores têm ele xD.- Arrumando magicdoor nova
Para colocar o nome dela, você pode adicionar isso no seu items.xml, antes do </items> <item id="12165" article="a" name="gate of expertise"> <attribute key="type" value="door" /> <attribute key="levelDoor" value="1000" /> <attribute key="blockprojectile" value="1" /> </item> E para funcionar o script você deve adicionar isso ao seu actions.xml: <action itemid="12165" script="other/doors.lua"/>- (Resolvido)[Pedido] Evolução
local amuletos = { [1] = 7887, [2] = 7888 [5] = 7889, [7] = 7890, [10] = 2129, [13] = 2130, [16] = 2131, [20] = 2132, [25] = 2133, [30] = 2134, [35] = 2135, [40] = 7898, [45] = 7899, [50] = 7900, [55] = 7901, [60] = 7902, [65] = 7903, [70] = 7904, [75] = 7905, [80] = 7906, [85] = 7907, [90] = 7908, [95] = 7909, [100] = 7910, [125] = 7911, [150] = 7912, [175] = 7913, [200] = 7914, [250] = 7915, [300] = 7916, } function onAdvance(cid, skill, oldlevel, newlevel) if skill == 8 and amuletos[newlevel] then doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, amuletos[newlevel]) doPlayerSendTextMessage(cid, 22, "You received "..getItemNameById(amuletos[newlevel).." for reaching level".. newlevel..".") end return true end- (Resolvido)[AJUDA] Player não usar !fly.
[paste]kKrFJMwY[/paste]- (Resolvido)Ajuda Spell
local combat = createCombatObject() local meteor = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 41) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -10.3, -47, -10.2, 2) local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, 5000) setConditionFormula(stun, -0.8, 0, -0.9, 0) setCombatCondition(meteor, stun) local combat2 = createCombatObject() local meteor2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -7.3, -47, -6.2, 2) local arr = { {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 3, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} } local arr2 = { {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 3, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} } local area = createCombatArea(arr) local area2 = createCombatArea(arr2) setCombatArea(combat, area) setCombatArea(combat2, area2) local function meteorCast(p) doCombat(p.cid, p.combat, positionToVariant(p.pos)) end local function meteorCast2(p) doCombat(p.cid, p.combat2, positionToVariant(p.pos)) end local function stunEffect(cid) doSendMagicEffect(getThingPos(cid), CONST_ME_STUN) end function onTargetTile(cid, pos) if (math.random(0, 0) == 0) then local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}) if (isInArray(water, ground.itemid) == TRUE) then local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z} doSendDistanceShoot(newpos, pos, CONST_ANI_ICE) addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water}) else local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z} doSendDistanceShoot(newpos, pos, CONST_ANI_ICE) addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor}) end end end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onTargetTile(cid, pos) if (math.random(0, 0) == 0) then local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}) if (isInArray(water, ground.itemid) == TRUE) then local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z} doSendDistanceShoot(newpos, pos, CONST_ANI_ICE) addEvent(meteorCast2, 200, {cid = cid, pos = pos, combat2 = meteor_water2}) else local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z} doSendDistanceShoot(newpos, pos, CONST_ANI_ICE) addEvent(meteorCast2, 200, {cid = cid,pos = pos, combat2 = meteor2}) end end end setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile") local outfits = { [0] = {lookType = 144, lookAddons = 3}, [1] = {lookType = 148, lookAddons = 3} } function onCastSpell(cid, var) local conf = outfits[getPlayerSex(cid)] local outf = getCreatureOutfit(cid) if outf.lookType == conf.lookType and outf.lookAddons == conf.lookAddons then doCombat(cid, combat, var) else doCombat(cid, combat2, var) end return true end- (Resolvido)Zombie event
local function start() local players_on_arena_count = #getZombiesEventPlayers() if players_on_arena_count < 10 then for _, pid in pairs(getZombiesEventPlayers()) do kickPlayerFromZombiesArea(pid) end doBroadcastMessage("Zombie Couldn't Start Because there was few numbers ona rena") doSetStorage(ZE_STATUS, 0) addZombiesEventBlockEnterPosition() return true end setZombiesEventPlayersLimit(players_on_arena_count) addZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started") return true end function onTime(interval, lastExecution) setZombiesEventPlayersLimit(10) doBroadcastMessage("Zombie Event Is Waiting For 10 Players To Join.Zombie Will Start In 8 Minutes") removeZombiesEventBlockEnterPosition() addEvent(start,8*60*1000) doSetStorage(ZE_STATUS, 1) return true end- (Resolvido)[PEDIDO] Estatua virar monstro
Tem sim. <action actionid="ACTIONID" event="script" value="SEUSCRIPT.lua"/>- (Resolvido)[PEDIDO] Estatua virar monstro
local id = 2525 -- ItemId da Estatua local intervalo = 30 -- Tempo em segundos para estatua voltar local criatura = "Hydra" -- Nome do monsto a ser sumonado function onUse(cid, item, fromPosition, itemEx, toPosition) doRemoveItem(item.uid, 1) doCreateMonster(criatura, toPosition) addEvent(function() doCreateItem(id, 1, toPosition) doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) end, intervalo * 1000) return true end- (Resolvido)[Pedido] Evolução
Não cheguei a ver o código fonte dessa função. Mas eu penso nela desse modo:- (Resolvido)Zombie event
local function start() local players_on_arena_count = #getZombiesEventPlayers() if players_on_arena_count <= 1 then for _, pid in pairs(getZombiesEventPlayers()) do kickPlayerFromZombiesArea(pid) end doBroadcastMessage("Zombie Couldn't Start Because there was few numbers ona rena") doSetStorage(ZE_STATUS, 0) addZombiesEventBlockEnterPosition() return true end setZombiesEventPlayersLimit(players_on_arena_count) addZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started") return true end function onTime(interval, lastExecution) setZombiesEventPlayersLimit(10) doBroadcastMessage("Zombie Event Is Waiting For 10 Players To Join.Zombie Will Start In 8 Minutes") removeZombiesEventBlockEnterPosition() addEvent(start,8*60*1000) doSetStorage(ZE_STATUS, 1) return true end- (Resolvido)Item que eu quero aparecem na bag do player quando ele mata tal monstro
Só organizando melhor a ideia do Luan: Primeiro adicione isso no arquivo data/creaturescripts/creaturescripts.xml: <event type="kill" name="Pascoa" script="pascoa.lua"/> Depois, abra o arquivo data/creaurescripts/scripts/login.lua e antes do ÚLTIMO return true, adicione isso: registerCreatureevent(cid, "Pascoa") Ficando, por exemplo assim: registerCreatureevent(cid, "Pascoa") return true end Depois, crie um arquivo de nome pascoa.lua na pasta data/creaturescripts/scripts e adicione isso dentro dele: local config = { -- NOME SEMPRE EM LETRAS MINÚSCULAS ["azerus"] = {item_win = 2160, quantidade = 1}, ["black knight"] = {item_win = 2160, quantidade = 10}, } function onKill(cid, target, damage, flags) local reward = config[getCreatureName(target):lower()] if isMonster(target) and reward then doPlayerAddItem(cid, reward.item_win, reward.quantidade) end return true end- Lista de Sprites úteis
- (Resolvido)[Ajuda] Checa se há player entre coordenadas.
local pos = {x = 855, y = 980, z = 7} local reativar = 10 -- em segundos local check = 4 -- em segundos local from = {x = 860, y = 978, z = 7} local to = {x = 865, y = 982, z = 7} function getPlayersFromArea(from, to) local ret = {} for _, pid in pairs(getSpectatorsFromArea(from, to) or {}) do if isPlayer(pid) then table.insert(ret, pid) end end return ret end function ReAtive() -- linha 38 de erro do Launcher if #getPlayersFromArea(from, to) >= 1 then -- linha 39 de erro do Launcher doBroadcastMessage("Temos intrusos e o item nao foi criado!") addEvent(ReAtive, check * 1000) else doCreateItem(corpse, 1, pos) doBroadcastMessage("Item adicionado com sucesso!") end end- [CTF] Capture The Flag 2.0(Automático)
Simples. Coloque o tile em e a bandeira uma posição diferente. - Arrumando magicdoor nova
Informação Importante
Confirmação de Termo