Ir para conteúdo

Featured Replies

Postado
7 minutos atrás, pergher disse:

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


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()
 

Abre o rme e vê a posição de cada piso que os players vai ficar, assim tu configura como desejar

  • Respostas 13
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Este tópico foi movido para a seção de Suporte Otserv.

  • Abre o rme e vê a posição de cada piso que os players vai ficar, assim tu configura como desejar

  • tenta assim   <attack name="manadrain" interval="1000" chance="7" range="7" min="900" max="10000">     <attribute key="shootEffect" value="energy" />

Postado
  • Autor
2 minutos atrás, Faysal disse:

Abre o rme e vê a posição de cada piso que os players vai ficar, assim tu configura como desejar

Show de bola, obrigado mestre, vou testar. 

Abraço.

Postado
  • Autor
11 minutos atrás, Faysal disse:

Caso não der certo posso tentar ajudar com o método do @Zazeros

Tntei o dele mas por alguma razao ele nao esta reconhecendo o "manadrain"

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

Postado
24 minutos atrás, pergher disse:

Tntei o dele mas por alguma razao ele nao esta reconhecendo o "manadrain"

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

tenta assim
 

<attack name="manadrain" interval="1000" chance="7" range="7" min="900" max="10000">

    <attribute key="shootEffect" value="energy" />

    <attribute key="areaEffect" value="poff" />

</attack>

   
   
 

 

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo