Ir para conteúdo

Featured Replies

Postado

aonde modifica para , que possa fazer a anihi , com 2 , 3 ou 4 players ?  +reppp

 

 

        local room = {     -- room with demons
        fromX = 1069,
        fromY = 807,
        fromZ = 8,

 

        toX = 1075,
        toY = 813,
        toZ = 8
        }

        local monster_pos = {
        [1] = {pos = {1074, 810, 8}, monster = "Demon"},
        [2] = {pos = {1075, 810, 8}, monster = "Demon"},
        [3] = {pos = {1072, 808, 8}, monster = "Demon"},
        [4] = {pos = {1070, 808, 8}, monster = "Demon"},
        [5] = {pos = {1073, 812, 8}, monster = "Demon"},
        [6] = {pos = {1071, 812, 8}, monster = "Demon"}
        }

        local players_pos = {
        {x = 1099, y =842, z = 7, stackpos = 253},
        {x = 1098, y =842, z = 7, stackpos = 253},
        {x = 1097, y =842, z = 7, stackpos = 253},
        {x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1073, y = 810, z = 8},
        {x = 1072, y = 810, z = 8},
        {x = 1071, y = 810, z = 8},
        {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "no"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player = getThingfromPos(players_pos)
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player.uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player = getThingfromPos(players_pos)
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player.uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos, CONST_ME_POFF)
                                                doTeleportThing(player.uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

Postado
Em 10/04/2019 em 17:04, Emooooo disse:

aonde modifica para , que possa fazer a anihi , com 2 , 3 ou 4 players ?  +reppp

 

 

        local room = {     -- room with demons
        fromX = 1069,
        fromY = 807,
        fromZ = 8,

 

        toX = 1075,
        toY = 813,
        toZ = 8
        }

        local monster_pos = {
        [1] = {pos = {1074, 810, 8}, monster = "Demon"},
        [2] = {pos = {1075, 810, 8}, monster = "Demon"},
        [3] = {pos = {1072, 808, 8}, monster = "Demon"},
        [4] = {pos = {1070, 808, 8}, monster = "Demon"},
        [5] = {pos = {1073, 812, 8}, monster = "Demon"},
        [6] = {pos = {1071, 812, 8}, monster = "Demon"}
        }

        local players_pos = {
        {x = 1099, y =842, z = 7, stackpos = 253},
        {x = 1098, y =842, z = 7, stackpos = 253},
        {x = 1097, y =842, z = 7, stackpos = 253},
        {x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1073, y = 810, z = 8},
        {x = 1072, y = 810, z = 8},
        {x = 1071, y = 810, z = 8},
        {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "no"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player = getThingfromPos(players_pos)
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player.uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player = getThingfromPos(players_pos)
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player.uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos, CONST_ME_POFF)
                                                doTeleportThing(player.uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

 

Amigo,
*Para receber ajuda no forum, crie titulos mais especificos, como Por exemplo:
*Ajuda com script da anihi.
*Pois só assim você terá uma chance de te ajudarem ok?
*E sempre use o "CITAR" em seus trechos longos para não demorar o carregamento da pagina.

Agora vamos ao Script:

 

   local room = {     -- room with demons
        fromX = 1069,
        fromY = 807,
        fromZ = 8,
        toX = 1075,
        toY = 813,
        toZ = 8
        }

        local monster_pos = {
        [1] = {pos = {1074, 810, 8}, monster = "Demon"},
        [2] = {pos = {1075, 810, 8}, monster = "Demon"},
        [3] = {pos = {1072, 808, 8}, monster = "Demon"},
        [4] = {pos = {1070, 808, 8}, monster = "Demon"},
        [5] = {pos = {1073, 812, 8}, monster = "Demon"},
        [6] = {pos = {1071, 812, 8}, monster = "Demon"}
        }

        local players_pos = {
        {x = 1099, y =842, z = 7, stackpos = 253},
        {x = 1098, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1073, y = 810, z = 8},
        {x = 1072, y = 810, z = 8}
        }

        local playersOnly = "no"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player = getThingfromPos(players_pos)
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player.uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player = getThingfromPos(players_pos)
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player.uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos, CONST_ME_POFF)
                                                doTeleportThing(player.uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

Veja que nesta parte do script fiz a modificação:

        local players_pos = {
        {x = 1099, y =842, z = 7, stackpos = 253},
        {x = 1098, y =842, z = 7, stackpos = 253},
        {x = 1097, y =842, z = 7, stackpos = 253},
        {x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1073, y = 810, z = 8},
        {x = 1072, y = 810, z = 8},
        {x = 1071, y = 810, z = 8},
        {x = 1070, y = 810, z = 8}
        }

Modifiquei para 
 


        local players_pos = {
        {x = 1099, y =842, z = 7, stackpos = 253},
        {x = 1098, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1073, y = 810, z = 8},
        {x = 1072, y = 810, z = 8}
        }

E assim vc pode ir adicionando ou removendo de acordo com este padrão ai.
Não esquecendo claro de deixar as posições no seu mapa iguais as que estão no script.

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 96k
  • Posts 512.7k

Informação Importante

Confirmação de Termo