Tudo que luanluciano93 postou
-
(Resolvido)Nivel alto não atacar nivel baixo
SE O ATACANTE FOR LEVEL 450 OU MAIS E A VÍTIMA LEVEL MENOR QUE 450, ELE NÃO PODE ATACAR! SE O ATACANTE FOR LEVEL MENOR QUE 450 E A VÍTIMA LEVEL 450 OU MAIOR, ELE NÃO PODE ATACAR!
-
(Resolvido)Memorial
local storage = 9999 function onUse(cid, item, frompos, item2, topos) local result = db.getResult("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;") if(result:getID() ~= -1) then local message = "Em memória de:\n\n" repeat local playerId = result:getDataInt("player_id") local database = db.getResult("SELECT `name` FROM `players` WHERE `id` = " .. db.escapeString(playerId) .. ";") if(database:getID() ~= -1) then local playerName = target:getDataString("name") message = ""..message.."".. playerName ..".\n" target:free() end until not(result:next()) result:free() doPlayerPopupFYI(cid, message) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum nome gravado.") end return true end
-
(Resolvido)Nivel alto não atacar nivel baixo
-- <event type="attack" name="onAttack" script="onAttack.lua"/> local level = 450 function onAttack(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then return false elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then return false end return true end
-
Town Portal System (based Dota 2)
-- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setCustomAttribute("party", playerId:getParty()) else portal:setCustomAttribute("owner", playerId:getName()) end end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getCustomAttribute("party") local itemName = item:getCustomAttribute("name") if itemParty then if player:getParty() == itemParty then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif itemName then if player:getName() == itemName then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
-
[OTX3 8.60] STYLLER 2019
A princípio a ideia é seguir o original (acho difícil usar algo que tenha que mexer nas sources com tantos recursos) e o principal ponto para seguir essa ideia é não ter bugs, a OTX3 é testada milhares de vezes pelos usuários, se sairmos dessa linha vamos virar mais um servidor com bugs e que crash por qualquer coisa.
-
(Resolvido)Adaptar código
Tudo como o @Lyu comentou ... local config = { magic_effect = 15, -- magic effect you want to send when critical hit lands damage_multiplier = 10 -- default damage * 10 = critical damage } function onStatsChange(cid, attacker, type, combat, value) if attacker and value > 0 then if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then local skillSword = getPlayerSkillLevel(attacker, SKILL_SWORD) local chance = (skillSword * 0.1) if math.random(100) <= chance then value = math.floor(value * config.damage_multiplier) doSendMagicEffect(getPlayerPosition(attacker), config.magic_effect) doTargetCombatHealth(attacker, cid, combat, -value, -value, CONST_ME_NONE) end end end return true end
-
(Resolvido)Memorial
A única informação que aparecerá é o nome do jogador?
- [OTX3 8.60] STYLLER 2019
-
(Resolvido)Check de Outfit em spell
local outfit = 267 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true) setCombatParam(combat, COMBAT_PARAM_EFFECT, 64) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 10 return -(skillTotal / 10 + levelTotal), -(skillTotal + levelTotal) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) if getCreatureOutfit(cid).lookType == outfit then return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Você não tem o outfit x.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end
- [OTX3 8.60] STYLLER 2019
-
Town Portal System (based Dota 2)
-- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setCustomAttribute("party", playerId:getParty()) else portal:setCustomAttribute("owner", playerId:getName()) end end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getCustomAttribute("party") local itemName = item:getCustomAttribute("name") if itemParty then if player:getParty() == itemParty or then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif itemName then if player:getName() == itemName then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
-
[TFS 1.2] OnKill Creaturescript
function onKill(creature, target) local p = creature:getPlayer() if not p then return true end if not target:isMonster() or target:getMaster() then return true end local damageMap = target:getDamageMap() for attackerId, damage in pairs(damageMap) do local player = Player(attackerId) if player then ------------------------------------------------ local task = player:getTask() if task then if table.contains(task.monsters_list, target:getName():lower()) then local monstersKilled = player:getStorageValue(task.storage) if monstersKilled < task.amount then player:setStorageValue(task.storage, monstersKilled + 1) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Task Comum System] You killed ['..monstersKilled..'/'..task.amount..'] '..target:getName()..'.') end end end ------------------------------------------------ end end return true end function onLogin(cid) registerCreatureEvent(cid, "taskSystem") return true end
-
[TFS 1.2] OnKill Creaturescript
Teste esse script -- <event type="login" name="TesteLogin" script="teste.lua" /> -- <event type="kill" name="TesteKill" script="teste.lua"/> function onKill(creature, target) local player = creature:getPlayer() if not player then return true end if not target:isMonster() or target:getMaster() then return true end local targetName = target:getName():lower() if targetName ~= "rotworm" then return true end print("") local damageMap = target:getDamageMap() for attackerId, damage in pairs(damageMap) do local uid = Player(attackerId) if uid then print("Player: " .. uid:getName() .. " - Damage: ".. damage.total .. " target: " .. targetName) end end return true end function onLogin(player) player:registerEvent("TesteKill") return true end Só se o seu servidor tive algum bug na função getDamageMap(), aqui deu certinho ...
-
(Resolvido)[PEDIDO] Remover itens do tile através da alavanca
local ALTARES = { {POSITION = Position(106, 984, 6), ITEM_ID = }, -- posicao altar e item 1 {POSITION = Position(106, 985, 6), ITEM_ID = }, -- posicao altar e item 2 {POSITION = Position(106, 986, 6), ITEM_ID = }, -- posicao altar e item 3 {POSITION = Position(106, 987, 6), ITEM_ID = }, -- posicao altar e item 4 {POSITION = Position(106, 987, 6), ITEM_ID = }, -- posicao altar e item 5 {POSITION = Position(106, 987, 6), ITEM_ID = }, -- posicao altar e item 6 } local playerPosition = { Position(106, 987, 6), Position(106, 987, 6), Position(106, 987, 6), Position(106, 987, 6) } local newPosition = { Position(106, 987, 6), Position(106, 987, 6), Position(106, 987, 6), Position(106, 987, 6) } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local ok = true for i = 1, #ALTARES do local tile = Tile(ALTARES[i].POSITION) if tile then local item = tile:getItemById(ALTARES[i].ITEM_ID) if not item then ok = false end end end if ok then local players = {} for _, position in ipairs(playerPosition) do local topPlayer = Tile(position):getTopCreature() if not topPlayer or not topPlayer:isPlayer() then player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end players[#players + 1] = topPlayer end for i, targetPlayer in ipairs(players) do playerPosition[i]:sendMagicEffect(CONST_ME_POFF) targetPlayer:teleportTo(newPosition[i], false) targetPlayer:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) end for i = 1, #ALTARES do local tile = Tile(ALTARES[i].POSITION) if tile then local item = tile:getItemById(ALTARES[i].ITEM_ID) if item then item:remove() end end end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Desculpe, você precisa colocar os items corretos nos altares.") player:getPosition():sendMagicEffect(CONST_ME_POFF) end item:transform(item.itemid == 1945 and 1946 or 1945) return true end
- [OTX3 8.60] STYLLER 2019
-
[OTX3 8.60] STYLLER 2019
Update 16/09/2019 - Adicionado auction system. - Alterado sistema vip para premium. - Reformulado as houses do mapa. - Reformulado função de exhaustion. - Fixado script de level reward. - Adicionada a função removeMoneyNpc que futuramente será usada. - Reajustes no mysql. - Adicionado mapa ao github. - Adicionado server save. - Fixado alguns bugs no mapa.
-
[DUVIDA]como vejo o id de um effect
Qual TFS vc usa? Você tem as sources?
-
[OTX3] Trade Offline / Auction System
Auction System: sistema que disponibiliza uma negociação offline, onde você oferta um item e esse item é divulgado no site do server ou in-game e qualquer player pode comprar o item utilizando um comando especificado, é como se fosse um market para servidores mais antigos. Lembrando que esse sistema também funciona para TFS 1.x Os comandos disponíveis são: !offer add, itemName, itemCount, itemPrice ex: !offer add, plate armor, 1, 500 !offer buy, AuctionID ex: !offer buy, 9 !offer remove, AuctionID ex: !offer remove, 8 !offer list Crie uma arquivo .lua dentro da pasta data/talkactions/scripts com o nome auction_system.lua, dentro do mesmo adicione o code: Em seguida em talkactions.xml adicione a tag: <talkaction words="!offer" separator=" " script="auction_system.lua" /> No banco de dados execute as querys: CREATE TABLE `auction_system` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player_id` int(11) NOT NULL, `item_name` varchar(255) NOT NULL, `item_id` smallint(6) NOT NULL, `count` smallint(5) NOT NULL, `value` int(7) NOT NULL, `date` bigint(20) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8; A base do script foi retirado do script do vDk neste link, e caso alguém queira o PHP deste script pode usar esse:
- Procuro Scripter compromissado para OT 8.6
-
[SOLUCIONADO] [COH] TELEPORTE DE GUILD PERDEDORA DO CASTLE PARA TEMPLO.
cara, tem essa função no script que deveria fazer isso, vc tem as libs desse sistema para eu ver essa função? doCastleRemoveEnemies()
-
[SOLUCIONADO] [COH] TELEPORTE DE GUILD PERDEDORA DO CASTLE PARA TEMPLO.
@leozincorsair substitui pelo outro.
-
Mudar o script de 0.4 para 1.2
@Platinun testei aqui no meu servidor (OTX3) e funcionou certinho.
-
[SOLUCIONADO] [COH] TELEPORTE DE GUILD PERDEDORA DO CASTLE PARA TEMPLO.
local function negativa(uid, posicaoAnterior, texto, temple) if uid then doSendMagicEffect(getThingPos(uid), 2) doPlayerSendCancel(uid, texto) if temple then doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) else doTeleportThing(uid, posicaoAnterior, false) end end end function onStepIn(cid, item, pos, fromPosition) if not isPlayer(cid) then return true end if item.actionid == 16203 then -- TILE PARA PASSAR A GUILD DOMINADORA. if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendAnimatedText(getThingPos(cid), "CoH", 14) else negativa(cid, fromPosition, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".", true) end elseif item.actionid == 16202 then -- TILE PARA QUEM TEM GUILD (QUE NÃO É A DOMINADORA) PARA VIRAR DOMINADORA. if getPlayerGuildId(cid) > 0 then if getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!") end else negativa(cid, fromPosition, "[CoH] Você não possui uma guild.", false) end elseif item.actionid == 16200 then if getPlayerGuildId(cid) > 0 then doSendAnimatedText(getThingPos(cid), "CoH",14) if getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid) and getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid) then setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!") end else negativa(cid, fromPosition, "[CoH] Você não possui uma guild.", false) end elseif item.actionid == 16201 then doSendAnimatedText(getThingPos(cid), "CoH", math.random(1, 255)) if getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid) then setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!") end end return true end
-
Town Portal System (based Dota 2)
-- Town Portal Scroll System based in Dota 2 -- by Nazo (tibiaking.com) local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function removePortal(portal) if portal then portal:remove() portal:getPosition():sendMagicEffect(config.effect) else print("The portal has been undone.") end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then local portal = Game.createItem(config.portalId, 1, player:getPosition()) if player:getParty() then portal:setCustomAttribute("party", player:getParty()) else portal:setCustomAttribute("owner", player:getName()) end addEvent(removePortal, config.portalTime * 1000, portal) item:remove() else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then if item:getCustomAttribute("party") then if player:getParty() == item:getCustomAttribute("party") then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif item:getCustomAttribute("name") and player:getName() == item:getCustomAttribute("name") then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
-
Town Portal System (based Dota 2)
-- Town Portal Scroll System based in Dota 2 -- by Nazo (tibiaking.com) local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function removePortal(portal) if portal then portal:remove() portal:getPosition():sendMagicEffect(config.effect) else print("The portal has been undone.") end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then local portal = Game.createItem(config.portalId, 1, player:getPosition()) if player:getParty() then portal:setCustomAttribute("party", player:getParty()) else portal:setCustomAttribute("owner", player:getName()) end addEvent(removePortal, config.portalTime * 1000, portal) item:remove() else if (not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) then if item:getCustomAttribute("party") then if player:getParty() == item:getCustomAttribute("party") then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif item:getCustomAttribute("name") and player:getName() == item:getCustomAttribute("name")) then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end