Postado Setembro 19, 2020 4 anos Fala galera. Estou usando o TFS 1.3, mapa otservbr-global, última versão. Alguém tem script ou sabe como eu faço para adicionar regeneração de mana nos trainers? Preciso que fique regenerando sempre, para que os mages possam treinar também. Obrigado.
Postado Setembro 19, 2020 4 anos Este tópico foi movido para a seção de Suporte Otserv. Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Setembro 19, 2020 4 anos 10 horas atrás, pergher disse: Fala galera. Estou usando o TFS 1.3, mapa otservbr-global, última versão. Alguém tem script ou sabe como eu faço para adicionar regeneração de mana nos trainers? Preciso que fique regenerando sempre, para que os mages possam treinar também. Obrigado. Tu pode fazer um globalevents (mesmo sistema que foi feito na magia das estatuas da library) porem tu pode tirar o dano e add a linha de add mana Testa esse ai, só configura o fromPosition e o toPosition para a mesma coordenada para assim soltar em 1 lugar só, ai é só repetir para todos os trainers! local effects = { {fromPosition = Position(32526, 32536, 12), toPosition = Position(32526, 32539, 12), effect = CONST_ME_HOLYDAMAGE}, } function onThink(interval, cid) local jolf for i = 1, #effects do local settings = effects[i] fromPosition = settings.fromPosition toPosition = settings.toPosition local spectators = Game.getSpectators(settings.fromPosition, false, true, 7, 7, 5, 5) if #spectators > 0 then if settings.effect then for y = fromPosition.y, toPosition.y do local newPosition = Position(fromPosition.x, y, fromPosition.z) newPosition:sendMagicEffect(settings.effect) jolf = Tile(newPosition):getTopCreature() if jolf and jolf:isPlayer() then doPlayerAddMana(cid, getPlayerMaxMana(cid)) end end for x = fromPosition.x, toPosition.x do local newPosition2 = Position(x, fromPosition.y, fromPosition.z) newPosition2:sendMagicEffect(settings.effect) jolf = Tile(newPosition2):getTopCreature() if jolf and jolf:isPlayer() then doPlayerAddMana(cid, getPlayerMaxMana(cid)) end end end end end return true end Editado Setembro 19, 2020 4 anos por Faysal (veja o histórico de edições)
Postado Setembro 19, 2020 4 anos @pergher Cara, se tu quiser mais simples, põe pros Trainers healar a mana do alvo, só pegar um bicho que bate na mana e trocar o valor pra positivo, ai vai curar a mana do player
Postado Setembro 19, 2020 4 anos Autor 6 horas atrás, Zazeros disse: @pergher Cara, se tu quiser mais simples, põe pros Trainers healar a mana do alvo, só pegar um bicho que bate na mana e trocar o valor pra positivo, ai vai curar a mana do player Que baita ideia haha monster.attacks = { {name = "melee", attack = 130, effect = CONST_ME_DRAWBLOOD, interval = 2*1000, minDamage = -1, maxDamage = -2}; {name= "manadrain", interval = 2*1000, chance="90", range="7", min="10", max="30"} } Adicionei o manadrain aqui, mas por alguma razao está dando 'unknow spell name'. Tem ideia de como pode ser o nome? Jah tentei varios haha 7 horas atrás, Faysal disse: Tu pode fazer um globalevents (mesmo sistema que foi feito na magia das estatuas da library) porem tu pode tirar o dano e add a linha de add mana Testa esse ai, só configura o fromPosition e o toPosition para a mesma coordenada para assim soltar em 1 lugar só, ai é só repetir para todos os trainers! local effects = { {fromPosition = Position(32526, 32536, 12), toPosition = Position(32526, 32539, 12), effect = CONST_ME_HOLYDAMAGE}, } function onThink(interval, cid) local jolf for i = 1, #effects do local settings = effects[i] fromPosition = settings.fromPosition toPosition = settings.toPosition local spectators = Game.getSpectators(settings.fromPosition, false, true, 7, 7, 5, 5) if #spectators > 0 then if settings.effect then for y = fromPosition.y, toPosition.y do local newPosition = Position(fromPosition.x, y, fromPosition.z) newPosition:sendMagicEffect(settings.effect) jolf = Tile(newPosition):getTopCreature() if jolf and jolf:isPlayer() then doPlayerAddMana(cid, getPlayerMaxMana(cid)) end end for x = fromPosition.x, toPosition.x do local newPosition2 = Position(x, fromPosition.y, fromPosition.z) newPosition2:sendMagicEffect(settings.effect) jolf = Tile(newPosition2):getTopCreature() if jolf and jolf:isPlayer() then doPlayerAddMana(cid, getPlayerMaxMana(cid)) end end end end end return true end Meu unico problema é que o char é teleportado até uma room disponível... local config = { -- Position of the first position (line 1 column 1) firstRoomPosition = {x = 1018, y = 1112, z = 7}, -- X distance between each room (on the same line) distancePositionX= 12, -- Y distance between each room (on the same line) distancePositionY= 12, -- Number of columns columns= 7, -- Number of lines lines= 11 } local function isBusyable(position) local player = Tile(position):getTopCreature() if player then if player:isPlayer() then return false end end local tile = Tile(position) if not tile then return false end local ground = tile:getGround() if not ground or ground:hasProperty(CONST_PROP_BLOCKSOLID) then return false end local items = tile:getItems() for i = 1, tile:getItemCount() do local item = items local itemType = item:getType() if itemType:getType() ~= ITEM_TYPE_MAGICFIELD and not itemType:isMovable() and item:hasProperty(CONST_PROP_BLOCKSOLID) then return false end end return true end local function calculatingRoom(uid, position, column, line) local player = Player(uid) if column >= config.columns then column = 0 line = line < (config.lines -1) and line + 1 or false end if line then local room_pos = {x = position.x + (column * config.distancePositionX), y = position.y + (line * config.distancePositionY), z = position.z} if isBusyable(room_pos) then player:teleportTo(room_pos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) else calculatingRoom(uid, position, column + 1, line) end else player:sendCancelMessage("Couldn't find any position for you right now.") end end local trainerEntrance = MoveEvent() function trainerEntrance.onStepIn(creature, item, position, fromPosition) if not creature:isPlayer() then return true end calculatingRoom(creature.uid, config.firstRoomPosition, 0, 0) Game.createMonster("training machine", creature:getPosition(), true, false) Game.createMonster("training machine", creature:getPosition(), true, false) return true end trainerEntrance:position({x = 1116, y = 1092, z = 7}) trainerEntrance:register()
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.