SI
pedido scripts

Help - Action de Teleporte se estiver com x oufit e bebado!

Por sisifos, 25 de jan. de 2019 em Scripts

21
3.3k
sisifosS
03 de fevereiro de 2019 às 15:03

beleza amigo, tranquilo. 

agradeço demais pela ajuda. 

sisifosS
05 de fevereiro de 2019 às 01:05

oi amigo, perdão pelo double post, e por incomodar, 

mas conseguiu arrumar pro paladino ser teleportado também? 

 

agradeço muito sua atenção, e pelo seu esforço por me ajudar ! 

Kuro o ShinigaK
06 de fevereiro de 2019 às 11:39
Em 05/02/2019 em 01:05, sisifos disse:

oi amigo, perdão pelo double post, e por incomodar, 

mas conseguiu arrumar pro paladino ser teleportado também? 

 

agradeço muito sua atenção, e pelo seu esforço por me ajudar ! 

Me manda msg e vamos resolver por la, o post ta ficando grande demais, quando solucionar a gente posta aqui

sisifosS
06 de fevereiro de 2019 às 15:14

pra já! :)

Kuro o ShinigaK
06 de fevereiro de 2019 às 23:58
local config = { 
 
    level = 120, 

    
    redo = {
        status = true, 
        storageValue = 4535
    },
  
   
    { 
        vocations = {1, 5}, 
        itemId = 2505, 
        playerPos = {x=88, y=332, z=7},
        newPos = {x=84, y=333, z=7},
        itemPos = {x=88, y=333, z=7} 
    }, 
  
    { 
        vocations = {2, 6}, 
        itemId = 7620, 
        playerPos = {x=87, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=87, y=333, z=7} 
    }, 
  
    { 
        vocations = {3, 7}, 
        itemId = 5878, 
        playerPos = {x=86, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=86, y=333, z=7} 
    }, 
  
    { 
        vocations = {4, 8}, 
        itemId = 2150, 
        playerPos = {x=85, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=85, y=333, z=7} 
    } 
} 


function onUse(cid)
    local players = {}
    local items = {}
    for _, v in ipairs(config) do
	 outfit = getCreatureOutfit(cid)
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendCancel(cid, "There are not enough players.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
                table.insert(items, item.uid)
            end
        end
    end

	if getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then
    if players.level then
        doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
    elseif players.vocation then
        doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
    elseif players.done then
        doPlayerSendCancel(cid, "A player in your team has already done this quest.")
    elseif players.item then
        doPlayerSendCancel(cid, "All items must be on the correct positions.")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
		end
        
        for _, item in ipairs(items) do
            doRemoveItem(item)
        end
    end
 
   
end

 

Editado Fevereiro 6 por Kuro o Shiniga

1 ano depois...
KaboFlowK
11 de maio de 2020 às 01:52
Em 06/02/2019 em 19:58, Kuro o Shiniga disse:
local config = { 
 
    level = 120, 

    
    redo = {
        status = true, 
        storageValue = 4535
    },
  
   
    { 
        vocations = {1, 5}, 
        itemId = 2505, 
        playerPos = {x=88, y=332, z=7},
        newPos = {x=84, y=333, z=7},
        itemPos = {x=88, y=333, z=7} 
    }, 
  
    { 
        vocations = {2, 6}, 
        itemId = 7620, 
        playerPos = {x=87, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=87, y=333, z=7} 
    }, 
  
    { 
        vocations = {3, 7}, 
        itemId = 5878, 
        playerPos = {x=86, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=86, y=333, z=7} 
    }, 
  
    { 
        vocations = {4, 8}, 
        itemId = 2150, 
        playerPos = {x=85, y=332, z=7},
        newPos = {x=84, y=333, z=7}, 
        itemPos = {x=85, y=333, z=7} 
    } 
} 


function onUse(cid)
    local players = {}
    local items = {}
    for _, v in ipairs(config) do
	 outfit = getCreatureOutfit(cid)
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendCancel(cid, "There are not enough players.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
                table.insert(items, item.uid)
            end
        end
    end

	if getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then
    if players.level then
        doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
    elseif players.vocation then
        doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
    elseif players.done then
        doPlayerSendCancel(cid, "A player in your team has already done this quest.")
    elseif players.item then
        doPlayerSendCancel(cid, "All items must be on the correct positions.")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
		end
        
        for _, item in ipairs(items) do
            doRemoveItem(item)
        end
    end
 
   
end

 

 

 

pra poketibia mano?

 

tipo 9 clanes

 

vulca

raibolt

naturia

seavell

psy

malefic

iron

oreb

wingeon