
Tudo que WooX postou
-
Como diminuir exhaust da SD
Muito estranho, se você possui as sources, posta actions.cpp aqui.
-
Alguem ajuda em sprite de dragon ball (tibia,gba)
Não pegou não, essas sprites foram feitas pelo spriters Royal e Saphron.
-
Como diminuir exhaust da SD
Cara, a solução que postei no outro tópico (já que vocês fizeram 2 tópicos com o mesmo assunto), funcionou perfeitamente aqui. Config.lua timeBetweenExActions = 0 Spells.xml <rune name="Sudden Death" id="2268" allowfaruse="1" charges="3" lvl="45" maglv="15" exhaustion="0" needtarget="1" blocktype="solid" event="script" value="attack/sudden death.lua"/>
-
(Resolvido)Cast System não abre channel!
O Private Chat Channel só é aberto para Players que possuem Premium Account. Altere no seu config.lua. Config.lua freePremium = true Ou faça esta alteração na sua source. Chat.cpp De: if(!player->isPremium() || getPrivateChannel(player)) Para: if(getPrivateChannel(player))
-
(Resolvido)Patente Na Frags E Kill
Testa ai. function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end function onLogin(cid) registerCreatureEvent(cid, "newlook") return true end local patentes = { ["0-9"] = "Iniciante", ["10-49"] = "Matador", ["50-99"] = "Assassino", ["100-149"] = "Heroico", ["150-199"] = "Sanguinario", ["200-9999"] = "Serial Killer" } function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,"\n"..(getPlayerSex(thing.uid) == 0 and "She" or "").." Ele Matou ["..getDeathsAndKills(thing.uid, "kill").."]Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "").." Ele Morreu ["..getDeathsAndKills(thing.uid, "death").."] Veses...") local pKills = getDeathsAndKills(thing.uid, "kill") for k, v in pairs(patentes) do local frags = string.explode(k, "-") if pKills >= tonumber(frags[1]) and pKills <= tonumber(frags[2]) then doPlayerSetSpecialDescription(thing.uid, "Ele é um "..v) end end return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,"\nVoce Matou ["..getDeathsAndKills(cid, "kill").."]Players.\nVoce Morreu ["..getDeathsAndKills(cid, "death").."] Veses...") local pKills = getDeathsAndKills(cid, "kill") for k, v in pairs(patentes) do local frags = string.explode(k, "-") if pKills >= tonumber(frags[1]) and pKills <= tonumber(frags[2]) then doPlayerSetSpecialDescription(cid, "Voce é um "..v) end end local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'\n' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
-
Como diminuir exhaust da SD
Se o exhausted é menor do que o delay para usar itemsEx, vocês vão precisar alterar o delay para este tipo de item no config.lua. Config.lua timeBetweenExActions = 1000
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
Testa ai. local removeTime = 5 -- Segundos local removeMsg = "You're gonna be disconnected in "..removeTime.." seconds for sharring the account." function onLogin(cid) if getCreatureName(cid):lower() ~= "account manager" then for _, pid in pairs(getPlayersByAccountId(getPlayerAccountId(cid))) do if getPlayerIp(cid) ~= getPlayerIp(pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, removeMsg) addEvent(function() doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doRemoveCreature(cid) end, removeTime*1000) break end end end return true end
-
DarkTheme e AutoComplete para Notepad++
Atualização 05/05/2019: Olá a todos, acredito que muitos além de mim utilizam o Notepad++ para trabalhar com códigos, é por isso que hoje venho trazer um tema que eu mesmo fiz e um AutoComplete atualizado para o Notepad++. AutoComplete. Para quem não está familiarizado, o AutoComplete é uma função do Notepad++ que completa funções ou palavras assim que você começa digita-las. Neste AutoComplete que estou disponibilizando, possui todas as funções existentes no TFS 0.3.7 e 0.4. Para instalar o AutoComplete, primeiro você deve ativar a função no seu Notepad++. Para isso vá em Configurações -> Preferencias -> Autocompletar e deixa as configurações como mostra a seguir. Em seguida, basta colocar o arquivo lua.xml no seguinte diretório do Notepad++. Notepad++\plugins\APIs Atualização: Dark Theme. Eu fiz este tema porque detesto o tema original do Notepad++, todo aquele branco chega a arder os olhos e é muito cansativo ficar olhando pra quem programa muito tempo utilizando a ferramenta. Este tema não traz consigo somente a alteração da cor do fundo, mas um destaque de cor verde a cada função existente no AutoComplete. Um código Lua utilizando o tema, fica assim. Além disso, o tema não dá suporte apenas para a Linguagem Lua, mas também para C++, PHP, MySQL, Javascript, XML, HTML, CSS e INI. Para realizar a instalação do tema, basta ir em Configurações -> Importar -> Importar Tema(s) e escolher o arquivo DarkCode.xml. Atualização: Pronto! Após realizado todos os procedimentos, basta reiniciar seu Notepad++ que todas as alterações terão efeito. É isso, acredito que possa ser útil no dia a dia de quem desenvolve em Lua. Ultima atualização: 05/05/2019.
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
local removeTime = 5 -- Segundos local removeMsg = "You're gonna be disconnected in "..removeTime.." seconds for sharring the account." function onLogin(cid) for _, pid in pairs(getPlayersByAccountId(getPlayerAccountId(cid))) do if getPlayerIp(cid) ~= getPlayerIp(pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, removeMsg) addEvent(function() doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doRemoveCreature(cid) end, removeTime*1000) break end end return true end
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
Eu tinha entendido errado o que ele pediu, da maneira que eu fiz não vai dar merda não. Eu achei que ele queria bloquear (banir) quem não fosse o dono oficial da account, da maneira que fiz vai permitir somente 1 pessoa por IP na acc, seja ela o dono ou não. Acho que era isso que ele queria, só resta testar e ver se vai funcionar.
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
Testa ai. function onLogin(cid) for _, pid in pairs(getPlayersByAccountId(getPlayerAccountId(cid))) do if getPlayerIp(cid) ~= getPlayerIp(pid) then return false end end return true end
-
(Resolvido)[ANTI-BOT] Mandar player para cidade natal!
local symbols = {"*", "^", "¿", "%", "&", "$"} local timeBetweenQuestion = 35 * 60 --35 minutes local timeToKick = 2 * 45 --1.5 minutes local timeStorage = 65117 local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 function onThink(cid, interval) if not isPlayer(cid) or getPlayerGroupId(cid) >= 3 then return end if getCreatureStorage(cid, timeStorage) < 1 then doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) end if getCreatureStorage(cid, kickStorage) > 0 and os.time() >= getCreatureStorage(cid, kickStorage) then local tmp = {timeStorage, kickStorage, timesStorage, codeStorage} for i = 1, #tmp do doCreatureSetStorage(cid, tmp, 0) end return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end if os.time() >= getCreatureStorage(cid, timeStorage) then local code, set = "", 0 set = math.random(1, 100000) local s, e = 1, 1 for i = 1, string.len(set) do code = (code == "" and string.sub(set, s, e) or code .. symbols[math.random(#symbols)] .. string.sub(set, s, e)) s, e = s + 1, e + 1 end doCreatureSetStorage(cid, codeStorage, set) doCreatureSetStorage(cid, kickStorage, os.time() + timeToKick) doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Anti-Bot]: Please say !antibot followed by your code without symbols.") doPlayerPopupFYI (cid, "Here is your code! !antibot"..code.." Type in the numbers without symbols.") end return end
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
Mas mesmo utilizando a mesma conta, eles não podem utilizar 2 characters ao mesmo tempo (a não ser que você tenha ativado essa opção). Vou codar algo e já já posto aqui.
-
(Resolvido)Bloquear login se player tiver shareando account (IP diferente na mesma account)
Cara, IPs geralmente não são fixos por padrão, muito provedor não da esse "luxo" pro cliente. Eu consigo fazer pra ti, mas te garanto que isso vai merda.
-
(Resolvido)setplayerlookdirection?
Você tem a source da sua distro? Se tiver, posta luascript.h aqui.
-
(Resolvido)setplayerlookdirection?
doCreatureSetLookDir(cid,dir)
-
[TFS 0.4] Life Steal em monstros!
Deixa um REP+ ai se funcionou. Simplesmente não funcionou ou deu algum erro?
-
[TFS 0.4] Life Steal em monstros!
local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8} } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if(isPlayer(attacker)) then for slot = 5, 6 do -- right & left for id, perc in pairs(config.weapons) do if(getPlayerSlotItem(attacker, slot).itemid == id and math.random(100) <= 10) then return doCreatureAddHealth(attacker, math.ceil(value * perc / 100)) end end end end return true end
-
[TFS 0.4] Life Steal em monstros!
Mas o script é o mesmo, se esta healando toda hora com monstro, provavelmente é porque com players também já estava.
-
[TFS 0.4] Life Steal em monstros!
Se com player a função funcionava, provavelmente ele já estava usando OTX ou outra Distro que a função retorne também como id.
-
[TFS 0.4] Life Steal em monstros!
- Game of Thrones
- [TFS 0.4] Life Steal em monstros!
Então infelizmente não tenho ideia do que possa ser, aqui funcionou tranquilo.- [TFS 0.4] Life Steal em monstros!
Chegou a adicionar isso no login.lua? registerCreatureEvent(cid, "LifeSteal")- [TFS 0.4] Life Steal em monstros!
Cara eu testei aqui e funcionou normalmente. Tenta da seguinte maneira, remove a tag que registra o login do script no creaturescripts.xml e usa o script assim. local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onStatsChange(cid, attacker, type, combat, value) if not isPlayer(attacker) then return true end if not isInArray(config.vocations, getPlayerVocation(attacker)) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end O XML do monstro você usa assim. <?xml version="1.0" encoding="UTF-8"?> <monster name="Trainer Target" nameDescription="trainer target" race="UNDEAD" experience="0" speed="0" manacost="100"> <health now="9999999" max="9999999"/> <look typeex="5787" /> <targetchange interval="5000" chance="8"/> <strategy attack="100" defense="0"/> <script> <event name="LifeSteal"/> </script> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="1"/> <flag convinceable="0"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag canpushcreatures="0"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1000" skill="3" attack="8"/> </attacks> <defenses armor="1" defense="2"> <defense name="healing" interval="2000" chance="25" min="999999" max="99999"> </defense> </defenses> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> <immunity ice="0"/> <immunity holy="0"/> <immunity death="0"/> <immunity earth="0"/> </immunities> <loot> </loot> <script> <event name="LifeSteal"/> </script> </monster> E por ultimo, no seu login.lua, você adiciona a seguinte linha. registerCreatureEvent(cid, "LifeSteal") Para realizar o teste, reinicie o servidor ao invés de dar reload. Tenha certeza também de que o player é da vocação de ID 4 ou 8 (Knight) e também que esteja usando como arma o item de ID 8602.
Informação Importante
Confirmação de Termo