Ir para conteúdo

Featured Replies

Postado

Precisa da função setCreatureName: http://www.tibiaking.com/forum/topic/38559-fun%C3%A7%C3%A3o-setcreaturenamecid-name-description/

 

AliOBaT.png

 

spells.xml

    <instant name="Kage Bunshin" words="kage bunshin" lvl="8" mana="20" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="kagebunshin.lua">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="3"/>
        <vocation id="4"/>
        <vocation id="5"/>
        <vocation id="6"/>
        <vocation id="7"/>
        <vocation id="8"/>
    </instant>

spells/scripts/kagebunshin.lua

local function isWalkable(pos)
    if getTileThingByPos(pos).itemid == 0 then
        return false
    end

    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, 2) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end

function onCastSpell(cid, var)
    local anyPos, pos = {x = 0, y = 0, z = 0}, getCreaturePosition(cid)
    local toPos = {
        {x = pos.x + 1, y = pos.y, z = pos.z},
        {x = pos.x - 1, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y + 1, z = pos.z},
        {x = pos.x, y = pos.y - 1, z = pos.z}
    }

    local maxSummons, playerSummons = 4, #getCreatureSummons(cid)
    if maxSummons - playerSummons > 0 then
        for i = 1, maxSummons - playerSummons do
            doCombatAreaHealth(0, 0, anyPos, 0, 0, 0, 255)
            doCreateItem(460, 1, anyPos)

            local bunshin = doCreateMonster("Wild Warrior", anyPos)
            doConvinceCreature(cid, bunshin)
            setCreatureMaxHealth(bunshin, getCreatureMaxHealth(cid))
            doCreatureAddHealth(bunshin, getCreatureHealth(cid))
            doSetCreatureOutfit(bunshin, getCreatureOutfit(cid), -1)
            setCreatureName(bunshin, getCreatureName(cid), "a " .. getCreatureName(cid))

            local toPos = isWalkable(toPos[i]) == false and pos or toPos[i]
            doTeleportThing(bunshin, toPos)
            doSendMagicEffect(toPos, CONST_ME_POFF)
        end
    else
        return false
    end
    return true
end
  • Respostas 5
  • Visualizações 1.8k
  • Created
  • Última resposta

Top Posters In This Topic

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.8k

Informação Importante

Confirmação de Termo