Ir para conteúdo
  • 0

Pedido Magia Que Sumona Criatura


KennyConrad

Pergunta

@edit

 

ajuda com essa magia de summon ela so sumona 1 zodom queria que pude-se sumona 2

 


function onCastSpell(cid, var)

if #getCreatureSummons(cid) > 0 then
		doPlayerSendCancel(cid, "You can only summon one creature.")
return false
end

local summon, useCreateMonster = 0, false

if type(doSummonMonster) then
		summon = doSummonMonster(cid, "Zodom")
		if summon == 3 then
				doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
		return false
		end
		summon = getCreatureSummons(cid)
		summon = summon[#summon]
		if isCreature(summon) and getCreatureMaster(summon) == cid then
				doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
				return true
		else
				useCreateMonster = true
		end
else
		useCreateMonster = true
end

if useCreateMonster then
		local pos = getThingPos(cid)
		pos.y = pos.y + 1
		summon = doCreateMonster("Zodom", pos, false)
		if summon == true then
				doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
		return false
		end
end

if not isCreature(summon) then return false end
doConvinceCreature(cid, summon)
if getCreatureMaster(summon) ~= cid then
		doRemoveCreature(summon)
return false
end

doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
return true
end

Editado por KennyxD
Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0
function onCastSpell(cid, var)

       if #getCreatureSummons(cid) > 1 then
                       doPlayerSendCancel(cid, "You can only summon one creature.")
       return false
       end

       local summon, useCreateMonster = 0, false

       if type(doSummonMonster) then
                       summon = doSummonMonster(cid, "Zodom")
                       if summon == 3 then
                                       doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
                       return false
                       end
                       summon = getCreatureSummons(cid)
                       summon = summon[#summon]
                       if isCreature(summon) and getCreatureMaster(summon) == cid then
                                       doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
                                       return true
                       else
                                       useCreateMonster = true
                       end
       else
                       useCreateMonster = true
       end

       if useCreateMonster then
                       local pos = getThingPos(cid)
                       pos.y = pos.y + 1
                       summon = doCreateMonster("Zodom", pos, false)
                       if summon == true then
                                       doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
                       return false
                       end
       end

       if not isCreature(summon) then return false end
       doConvinceCreature(cid, summon)
       if getCreatureMaster(summon) ~= cid then
                       doRemoveCreature(summon)
       return false
       end

       doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

function onCastSpell(cid, var)

   if #getCreatureSummons(cid) > 1 then
	    doPlayerSendCancel(cid, "You already have more than 1 summon.")
   return false
   end

   local function doCreateSummon()

    if #getCreatureSummons(cid) > 1 then return end

    local summon, useCreateMonster = 0, false

    if type(doSummonMonster) then
	    summon = doSummonMonster(cid, "Zodom")
	    if summon == 3 then
			    doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
	    return false
	    end
	    summon = getCreatureSummons(cid)
	    summon = summon[#summon]
	    if isCreature(summon) and getCreatureMaster(summon) == cid then
		    doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
		    return true
	    else
		    useCreateMonster = true
	    end
    else
	    useCreateMonster = true
    end

    if useCreateMonster then
	    local pos = getThingPos(cid)
	    pos.y = pos.y + 1
	    summon = doCreateMonster("Zodom", pos, false)
	    if summon == true then
		    doPlayerSendCancel(cid, "There is not enough room to summon a creature.")
	    return false
	    end
    end

    if not isCreature(summon) then return false end
    doConvinceCreature(cid, summon)
    if getCreatureMaster(summon) ~= cid then
		    doRemoveCreature(summon)
    return false
    end

    doSendMagicEffect(getThingPos(summon), CONST_ME_MAGIC_BLUE)
   end

   doCreateSummon()
   doCreateSummon()
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...