Histórico de Curtidas
-
DouglasVinicius deu reputação a Mathias Kenfi em (Resolvido)[PEDIDO] Spell que aumenta ataque speedAumente o attackspeed da vocacao 7 e simples
Segue o script \/
function onCastSpell (cid, var)
local store,exausted = 156201,30 -- exaust na talk
if getPlayerStorageValue(cid, store) >= os.time() then
doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.")
return true
end
If getPlayerVocation(cid) = 3 then
local voc = doPlayerSetVocation
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "ativado 10 segundos.")
else
doPlayerSendCancel(cid, "Apenas Padins utilizam esta spell")
end
return true
end
-
DouglasVinicius deu reputação a lordzetros em (Resolvido)Tiler que diminuem danoEm data/creaturescripts/scripts/ crie um arquivo chamado castleDano.lua e adicione o seguinte código dentro:
local posicoes_castle = { [1] = {supEsquerdo = {x = 1014, y = 1036, z = 7}, infDireito = {x = 1032, y = 1042, z = 7}}, [2] = {supEsquerdo = {x = 1014, y = 1036, z = 7}, infDireito = {x = 1032, y = 1042, z = 6}}, [3] = {supEsquerdo = {x = 1014, y = 1036, z = 7}, infDireito = {x = 1032, y = 1042, z = 5}}, [4] = {supEsquerdo = {x = 1014, y = 1036, z = 7}, infDireito = {x = 1032, y = 1042, z = 4}}, } local porcento = 0.2 -- 0.2 = 20% function players_area(fromPosition, toPosition) local players = {} for _, pid in ipairs(getPlayersOnline()) do local f = {x = fromPosition.x, y = fromPosition.y, z = fromPosition.z} local t = {x = toPosition.x, y = toPosition.y, z = toPosition.z} local min = (fromPosition.z > toPosition.z and toPosition.z or fromPosition.z) for index = 0, math.abs(toPosition.z - fromPosition.z) do f.z = min + index t.z = min + index if (isInRange(getPlayerPosition(pid), f, t)) then table.insert(players, pid) end end end return players end function onStatsChange(cid, attacker, type, combat, value) if (type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and isPlayer(cid) and getGlobalStorageValue(25580) == 2) then local total = {} for k = 1, #posicoes_castle do table.insert(total, players_area(posicoes_castle[k].supEsquerdo, posicoes_castle[k].infDireito)) end if (isInArray(total, getPlayerPosition(cid)) and isInArray(total, getPlayerPosition(attacker))) then local valor_m = porcento * value doTargetCombatHealth(attacker, cid, combat, valor_m, valor_m, COLOR_NONE) end end return true end
Em data/creaturescripts/creaturescripts.xml adicione a seguinte linha abaixo de uma semelhante:
<event type="statschange" name="reduzCastle" event="script" value="castleDano.lua"/>
Em data/creaturescripts/scripts/login.lua adicione isto abaixo de outro semelhante (registerCreatureEvent):
registerCreatureEvent(cid, "reduzCastle")
Agora modificando seu script, no Teleport.lua
local configuration = { day = "tuesday", to_pos = {x = 3186, y = 568, z = 3}, --Para onde o teleport levará. pos = {x = 3186, y = 574, z = 3}, --Onde o teleport será criado. teleport_id = 1387, --ID do teleport. aid = 3434, --Action ID do teleport. } function onTime() if os.date("%A") == configuration.day then local item = getTileItemById(configuration.pos, configuration.teleport_id).uid if item < 1 then local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos) doItemSetAttribute(tp, "aid", configuration.aid) broadcastMessage("Suba no trono e termine o castle", MESSAGE_STATUS_WARNING) setGlobalStorageValue(25580, 2) end end return true end
E no close1.lua - close1 é igual open1, certo? Se for, adicione isto no close1 mesmo (poderiam ter feito 1 script para as duas coisas, mas tudo bem):
local day = "tuesday" --Mude o dia que o evento será executado aqui. EM INGLÊS. local id = 1547 local posis = { {x = 3084, y = 569, z = 6}, -- posição da barreira {x = 3085, y = 569, z = 6}, -- posição da barreira {x = 3086, y = 569, z = 6}, -- posição da barreira {x = 3087, y = 569, z = 6}, -- posição da barreira {x = 3088, y = 569, z = 6}, -- posição da barreira {x = 3084, y = 567, z = 6}, -- posição da barreira {x = 3085, y = 567, z = 6}, -- posição da barreira {x = 3086, y = 567, z = 6}, -- posição da barreira {x = 3087, y = 567, z = 6}, -- posição da barreira {x = 3088, y = 567, z = 6}, -- posição da barreira } function onTime() if os.date("%A") == day then for i = 1, #posis do local item = getTileItemById(posis, id).uid if item > 0 then doRemoveItem(item, 1) else doCreateItem(id, 1, posis) end end setGlobalStorageValue(25580, 1) end return true end
EXPLICAÇÃO:
A ideia é fazer com que o player que sofreu o ataque ganhe 20% do dano total que recebeu.
Na parte das posicoes_castle do script que fiz, tu vai configurar o canto superior esquerdo e inferior direito da área total de cada andar
Segue imagem para demonstração:
-
DouglasVinicius deu reputação a lordzetros em (Resolvido)Tiler que diminuem dano@DouglasVinicius Ia demorar um pouco, kkk, mas sim, é possível de pegar em massa, agora o seguinte, o seu castle tem outros 'andares'? Ou é só em um plano?
-
DouglasVinicius deu reputação a lordzetros em (Resolvido)Tiler que diminuem danoSem problemas, :]. É TFS 0.4?
-
DouglasVinicius deu reputação a lordzetros em (Resolvido)Tiler que diminuem dano@DouglasVinicius Terminei, colega, no servidor que efetuo testes de scripts está funcional, agora me diz uma coisa, você sabe me dizer se seu castle tem algum globalStorage que salva se o mesmo tá aberto ou não?
-
DouglasVinicius deu reputação a DukeeH em (Resolvido)Paladin erra muito dano@DouglasVinicius
data/items/items.xml
Procura por exemplo a Spear, e adiciona:
<attribute key="hitChance" value="80" /> E ai testa vê se muda algo.
-
DouglasVinicius deu reputação a FlavioHulk em (Resolvido)[AJUDA] Configurando price para itemidlocal bixos = {"Jack Sparrow", "Catatau", "Belmont's Revenge"} local positions = {{x = 386, y = 154, z = 7}, {x = 388, y = 154, z = 7}, {x = 390, y = 154, z = 7}} -- Posicao q os bixos nascem local price = 1 -- Preco para jogar local cassinoCoin = 6527 function onUse(cid, item, fromPosition, itemEx, toPosition) local first = math.random(1, #bixos) local second = math.random(1, #bixos) local third = math.random(1, #bixos) local tab = {} local recheck = 0 if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. price .. " " .. getItemNameById(cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, (#positions) do doSendMagicEffect(positions, 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, cassinoCoin, price) doCreateMonster(bixos[first], positions[1]) doSendMagicEffect(positions[1], 26) addEvent(doSendMagicEffect, 100, positions[1], 37) table.insert(tab, first) setGlobalStorageValue(bixos[first], getGlobalStorageValue(bixos[first])+1) addEvent(function() doCreateMonster(bixos[second], positions[2]) doSendMagicEffect(positions[2], 26) addEvent(doSendMagicEffect, 100, positions[2], 37) table.insert(tab, second) end, 1700) addEvent(function() doCreateMonster(bixos[third], positions[3]) doSendMagicEffect(positions[3], 26) addEvent(doSendMagicEffect, 100, positions[3], 37) setGlobalStorageValue(bixos[third], getGlobalStorageValue(bixos[third])+1) table.insert(tab, third) end, 2000) addEvent(function() doRemoveCreature(getTopCreature(positions[1]).uid) doRemoveCreature(getTopCreature(positions[2]).uid) doRemoveCreature(getTopCreature(positions[3]).uid) doSendMagicEffect(positions[1], 61) doSendMagicEffect(positions[2], 61) doSendMagicEffect(positions[3], 61) if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, cassinoCoin, 10) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) doSendMagicEffect(getThingPos(cid), 30) doSendMagicEffect(positions[1], 30) doSendMagicEffect(positions[2], 30) doSendMagicEffect(positions[3], 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 800, positions[1], 29) addEvent(doSendMagicEffect, 800, positions[2], 29) addEvent(doSendMagicEffect, 800, positions[3], 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) addEvent(doSendMagicEffect, 1600, positions[1], 28) addEvent(doSendMagicEffect, 1600, positions[2], 28) addEvent(doSendMagicEffect, 1600, positions[3], 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end
-
DouglasVinicius deu reputação a FlavioHulk em (Resolvido)[AJUDA] Configurando price para itemidlocal config, tab = { creatures = { [1] = "Jack Sparrow", [2] = "Catatau", [3] = "Belmont's Revenge" }, positions = { [1] = {x = 386, y = 154, z = 7}, [2] = {x = 388, y = 154, z = 7}, [3] = {x = 390, y = 154, z = 7} }, price = 1, amountReward = 10, cassinoCoin = 6527, }, {} local function createMonster(creature, position) doCreateMonster(creature, position) doSendMagicEffect(position, 26) addEvent(doSendMagicEffect, 100, position, 37) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, config.cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. config.price .. " " .. getItemNameById(config.cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, #config.positions do doSendMagicEffect(config.positions[i], 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, config.cassinoCoin, config.price) for i = 1, #config.positions do local pos, random = config.positions[i], math.random(1, #config.creatures) local creature = config.creatures[random] createMonster(creature, pos) tab[#tab + 1] = random if i ~= 1 then if i == 2 then addEvent(createMonster, 1700, creature, pos) else addEvent(createMonster, 2000, creature, pos) end end end addEvent(function() for i = 1, #config.positions do local pos = config.positions[i] doRemoveCreature(getTopCreature(pos).uid) doSendMagicEffect(pos, 61) end if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, config.cassinoCoin, config.amountReward) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) for i = 1, #config.positions do local pos = config.positions[i] doSendMagicEffect(pos, 30) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 800, pos, 29) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 1600, pos, 28) end doSendMagicEffect(getThingPos(cid), 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end Vai testando haha !
-
DouglasVinicius deu reputação a FlavioHulk em (Resolvido)[AJUDA] Configurando price para itemidlocal config, tab = { creatures = { [1] = "Jack Sparrow", [2] = "Catatau", [3] = "Belmont's Revenge" }, positions = { [1] = {x = 386, y = 154, z = 7}, [2] = {x = 388, y = 154, z = 7}, [3] = {x = 390, y = 154, z = 7} }, price = 1, amountReward = 10, cassinoCoin = 6527, }, {} local function createMonster(creature, position) doCreateMonster(creature, position) doSendMagicEffect(position, 26) addEvent(doSendMagicEffect, 100, position, 37) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, config.cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. price .. " " .. getItemNameById(config.cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, #config.positions do doSendMagicEffect(config.positions[i], 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, config.cassinoCoin, config.price) for i = 1, #config.positions do local pos, creature = config.positions[i], math.random(1, #config.creatures) createMonster(creature, pos) tab[#tab + 1] = creature if i ~= 1 then if i == 2 then addEvent(createMonster, 1700, creature, pos) else addEvent(createMonster, 2000, creature, pos) end end end addEvent(function() for i = 1, #config.positions do local pos = config.positions[i] doRemoveCreature(getTopCreature(pos).uid) doSendMagicEffect(pos, 61) end if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, config.cassinoCoin, config.amountReward) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) for i = 1, #config.positions do local pos = config.positions[i] doSendMagicEffect(pos, 30) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 800, pos, 29) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 1600, pos, 28) end doSendMagicEffect(getThingPos(cid), 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end
-
DouglasVinicius deu reputação a FlavioHulk em (Resolvido)[AJUDA] Configurando price para itemidlocal config, tab = { creatures = { [1] = "Jack Sparrow", [2] = "Catatau", [3] = "Belmont's Revenge" }, positions = { [1] = {x = 386, y = 154, z = 7}, [2] = {x = 388, y = 154, z = 7}, [3] = {x = 390, y = 154, z = 7} }, price = 1, amountReward = 10, cassinoCoin = 6527, }, {} local function createMonster(creature, position) doCreateMonster(creature, position) doSendMagicEffect(position, 26) addEvent(doSendMagicEffect, 100, position, 37) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, config.cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. price .. " " .. getItemNameById(config.cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, (#config.positions) do doSendMagicEffect(positions[i], 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, config.cassinoCoin, config.price) for i = 1, #config.positions do local pos, creature = config.positions[i], math.random(1, #config.creatures) createMonster(creature, pos) tab[#tab + 1] = creature if i ~= 1 then if i == 2 then addEvent(createMonster, 1700, creature, pos) else addEvent(createMonster, 2000, creature, pos) end end end addEvent(function() for i = 1, #config.positions do local pos = config.positions[i] doRemoveCreature(getTopCreature(pos).uid) doSendMagicEffect(pos, 61) end if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, config.cassinoCoin, config.amountReward) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) for i = 1, #config.positions do local pos = config.positions[i] doSendMagicEffect(pos, 30) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 800, pos, 29) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 1600, pos, 28) end doSendMagicEffect(getThingPos(cid), 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end
-
DouglasVinicius deu reputação a Mazarati em Autoloot perfect erro creaturescript@DouglasVinicius Apaga os arquivos que voce colocou. E use esse script de mod... só vai ter que colar na pasta mods.
-
DouglasVinicius deu reputação a Mazarati em AUTOLOOT PERFECT DROPANDO ITENS@DouglasVinicius poderia colocar na mensagem do broadcast que anuncia o autoloot ou em algum lugar que o player veja... nao sei se vc usa para anunciar que o server tem o autoloot mas eu fazia assim.
-
DouglasVinicius deu reputação a Dwarfer em [AJUDA]Configurando AutolootO mod ficará assim:
Em data/actions/scripts crie um arquivo.lua e cole isto dentro:
local autoLootPremiumTime = {3, "day"} -- quanto tempo a "premium" durará function onUse(cid, item, fromPosition, itemEx, toPosition) domodlib('Loot_func') local check = getPlayerStorageValue(cid, info.Storages[4]) if check > os.time() then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your Auto Loot premium time ends at " ..os.date("%d %B %Y %X", check)..".") end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations! You received "..getStrTime(autoLootPremiumTime).." of Auto Loot Premium Time!") doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) setPlayerStorageValue(cid, info.Storages[4], mathtime(autoLootPremiumTime) + os.time()) doRemoveItem(item.uid) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return error("Bad declaration in mathtime function.") end function getStrTime(table) -- by dwarfer local unit = {["sec"] = "second",["min"] = "minute",["hour"] = "hour",["day"] = "day"} return tostring(table[1].." "..unit[table[2]]..(table[1] > 1 and "s" or "")) end No actions.xml, adicione a tag abaixo e edite o XXXX para o id do item.
<action itemid="XXXX" script="NOMEDOARQUIVO.lua" />