Ir para conteúdo

Featured Replies

Postado
  • Autor

@MaTTch estou com 1 poblema, fui modificar o script e deu esse erro

coloquei pra ganhar looktype ao usar a spell até ai deboas testei deu certo, coloquei pra sair 1 effect no player e ta dando esse erro

edit2: já resolvi

 

Spoiler


local cfg = {
    items_area = {
        {
            itemid = 11497,
            area = {
                {0,0,0,0,0,0,0},
                {0,1,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,2,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,1,0,0},
                {0,0,0,0,0,0,0}
            }
        },
        {
            itemid = 11498,
            area = {
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,2,0,0,1},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,1,0,0,0}
            }
        },
        {
            itemid = 11499,
            area = {
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,2,0,0,0},
                {0,1,0,0,0,0,0},
                {0,0,0,0,0,0,1},
                {0,0,0,0,0,0,0}
            }
        },
        {
            itemid = 11500,
            area = {
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {1,0,0,2,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0}
            }
        },
        {
            itemid = 11501,
            area = {
                {0,0,0,0,0,0,0},
                {0,0,0,0,1,0,0},
                {0,0,0,0,0,0,0},
                {0,0,0,2,0,0,0},
                {0,0,0,0,0,0,0},
                {0,0,1,0,0,0,0},
                {0,0,0,0,0,0,0}
            }    
        }
    },
    remove_time = 10, -- tempo em segundos para remover
    onuse_message = "Uma area foi atingida pelo Genjutsu de %s" -- message ao usar
}

local combats = {}
for i, t in ipairs(cfg.items_area) do
    combats = createCombatObject()
    setCombatArea(combats, createCombatArea(t.area))
    function onTargetTile(cid, position)
        doCreateItem(t.itemid, 1, position)
        addEvent(function()
            local thing = getTileItemById(position, t.itemid).uid
            if(thing ~= 0) then
                doRemoveItem(thing)
            end
        end, cfg.remove_time * 1000)
    end
    setCombatCallback(combats, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
end

function onCastSpell(cid, var)

local outfit = {lookType = 90, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time1 = 4000 -- segundos que ficará com a outfit
local position1 = {x=getThingPosition(getCreaturePosition(cid)).x+1, y=getThingPosition(getCreaturePosition(cid)).y+1, z=getThingPosition(getCreaturePosition(cid)).z}

    for i = 1, #combats do
        doCombat(cid, combats, var)
        doSetCreatureOutfit(cid, outfit, time1)
        doSendMagicEffect(position1, 193)
    end

    doBroadcastMessage(cfg.onuse_message:format(getCreatureName(cid)), MESSAGE_STATUS_WARNING)
    return true
end

28053908_956132384533946_80375_n.thumb.png.7cbf311097d16f3596ad54d18b086dd4.png

 

Editado por bismarkzika
gagd (veja o histórico de edições)

  • Respostas 31
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado

Vou quebrar seu galho agora, mas quando for assim cria outro tópico.

Spoiler

local cfg = {
	items_area = {
		{
			itemid = 11497,
			area = {
				{0,0,0,0,0,0,0},
				{0,1,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,2,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,1,0,0},
				{0,0,0,0,0,0,0}
			}
		},
		{
			itemid = 11498,
			area = {
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,2,0,0,1},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,1,0,0,0}
			}
		},
		{
			itemid = 11499,
			area = {
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,2,0,0,0},
				{0,1,0,0,0,0,0},
				{0,0,0,0,0,0,1},
				{0,0,0,0,0,0,0}
			}
		},
		{
			itemid = 11500,
			area = {
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{1,0,0,2,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,0,0,0,0}
			}
		},
		{
			itemid = 11501,
			area = {
				{0,0,0,0,0,0,0},
				{0,0,0,0,1,0,0},
				{0,0,0,0,0,0,0},
				{0,0,0,2,0,0,0},
				{0,0,0,0,0,0,0},
				{0,0,1,0,0,0,0},
				{0,0,0,0,0,0,0}
			}
		}
	},
	remove_time = 10, -- tempo em segundos para remover
	onuse_message = "Uma area foi atingida pelo Genjutsu de %s", -- message ao usar
	outfit_gain = {lookType = 90},
	outfit_time = 4000
}

local combats = {}
for i, t in ipairs(cfg.items_area) do
	combats = createCombatObject()
	setCombatArea(combats, createCombatArea(t.area))
	function onTargetTile(cid, position)
		doCreateItem(t.itemid, 1, position)
		addEvent(function()
			local thing = getTileItemById(position, t.itemid).uid
			if(thing ~= 0) then
				doRemoveItem(thing)
			end
		end, cfg.remove_time * 1000)
	end
	setCombatCallback(combats, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
end

function onCastSpell(cid, var)
	local cid_position = getThingPosition(cid)
	doSetCreatureOutfit(cid, cfg.outfit_gain, cfg.outfit_time)
	doSendMagicEffect({x = cid_position.x + 1, y = cid_position.y + 1, z = cid_position.z}, 193)

	for i = 1, #combats do
		doCombat(cid, combats, var)
	end

	doBroadcastMessage(cfg.onuse_message:format(getCreatureName(cid)), MESSAGE_STATUS_WARNING)
	return true
end

 

 

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

Informação Importante

Confirmação de Termo