Ir para conteúdo

Featured Replies

Postado

Alguém me ajuda pfr, será que tem como fundir esses 2 script, eles são de fazer clone e de kuchyose, mas queria a script de kuchyose do jeito que ta, só que copiando a roupa !! 

 

Script Clone:

Spoiler

function onCastSpell(cid, var)
local from,to = {x=962, y=885, z=7},{x=973, y=892, z=7} -- começo e final do mapa
local from2,to2 = {x=979, y=901, z=7},{x=991, y=905, z=7} -- começo e final do mapa
local playerpos = getPlayerPosition(cid)
local cloth = getCreatureOutfit(cid)
local health = getCreatureHealth(cid)
local maxhealth = getCreatureMaxHealth(cid)
local MaximoSummon = 3 --- Maximo de Monstros Sumonados!! No Caso So Posso Sumonar 5 Clones

local summons = getCreatureSummons(cid)
if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) then
doPlayerSendCancel(cid, "Você não pode usar esse jutsu aqui!") return true
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
local Clone = doCreateMonster("Clone", playerpos)
doConvinceCreature(cid, Clone)
setCreatureMaxHealth(Clone, maxhealth)
doCreatureAddHealth(Clone, health)
doSetCreatureOutfit(Clone, cloth, -1)
return TRUE
end
end
 

 

Script Kuchyose:

Spoiler

function onCastSpell(cid, var)
local from,to = {x = 941, y = 617, z = 7},{x = 965, y = 640, z = 7}-- começo e final do mapa
local from2,to2 = {x=979, y=901, z=7},{x=991, y=905, z=7} -- começo e final do mapa
local playerpos = getPlayerPosition(cid)
local position1 = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y+1, z=getPlayerPosition(cid).z}
local position2 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
local position3 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
local position4 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
local position5 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
local MaximoSummon = 4 --- Maximo de Monstros Sumonados!! No Caso So Posso Sumonar 5 Clones

local summons = getCreatureSummons(cid)
if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) then
doPlayerSendCancel(cid, "Você não pode usar Summons Aqui!") return true
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
local clone = doCreateMonster("Corvo", playerpos, false, true)
local clone1 = doCreateMonster("Corvo", playerpos, false, true)
local clone2 = doCreateMonster("Corvo", playerpos, false, true)
local clone3 = doCreateMonster("Corvo", playerpos, false, true)
doConvinceCreature(cid, clone)
doConvinceCreature(cid, clone1)
doConvinceCreature(cid, clone2)
doConvinceCreature(cid, clone3)
doSendMagicEffect(position1, 111)
doSendMagicEffect(position2, 111)
doSendMagicEffect(position3, 111)
doSendMagicEffect(position4, 111)
return TRUE
end
end
 

 

Postado
local t = {
    not_allowed_areas = {
        [1] = {from = {x = 941, y = 617, z = 7}, to = {x = 965, y = 640, z = 7}}, -- começo e final do mapa
        [2] = {from = {x = 979, y = 901, z = 7}, to = {x = 991, y = 905, z = 7}}
    },
    max_summons = 4,
    monster = "Corvo",
    effect_on_appear = 111
}

function onCastSpell(cid, var)
    local check = true
    for _, area in pairs(t.not_allowed_areas) do
        if isInRange(getCreaturePosition(cid), area.from, area.to) then
            check = false break
        end
    end
    if not check then
        doPlayerSendCancel(cid, "Você não pode usar summons aqui!")
        return true
    end
    if #getCreatureSummons(cid) >= t.max_summons then
        doPlayerSendCancel(cid, "Máximo número de clones atingido!")
        return true
    end
    local p, sum, out = getCreaturePosition(cid), #getCreatureSummons(cid), getCreatureOutfit(cid)
    repeat
        local clone = doCreateMonster(t.monster, {x = p.x + math.random(-1,1), y = p.y + math.random(-1,1), z = p.z}, false, true)
        if clone then
            local clone_out = getCreatureOutfit(clone)
            clone_out.lookType = out.lookType
            doSetCreatureOutfit(clone, clone_out, -1)
            doSendMagicEffect(getCreaturePosition(clone), t.effect_on_appear)
            doConvinceCreature(cid, clone)
            sum = sum + 1
        end
    until (sum == t.max_summons)
    return true
end

 

Contato:

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.9k

Informação Importante

Confirmação de Termo