• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Summon 2 monsters on this monster spell

  • Thread starter Thread starter Deleted member 141899
  • Start date Start date
D

Deleted member 141899

Guest
Hello,

Can someone help me for put to summon 2 monsters in same time? I'm using TFS 1.1
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_RED)


function onCastSpell(creature, var)
    local summoncount = creature:getSummons()
    if #summoncount < 7 then
        local e, f = math.random(-2, 2), math.random(-2, 2)
        local mid = Game.createMonster("minion of Gaz'haragoth", { x=creature:getPosition().x+e, y=creature:getPosition().y+f, z=creature:getPosition().z })
            if not mid then
           return false
           end
    creature:say("Minions! Follow my call!", TALKTYPE_ORANGE_1)
    mid:setMaster(creature)
    else
    return false
    end
    return combat:execute(creature, var)
end

Thank you!
 
Last edited by a moderator:
Code:
function onCastSpell(creature, var)
    if creature:getSummons() > 7 then
        return false
    end

    local random = math.random
    local rX, rY = random(-2, 2), random(-2, 2)

    local position = creature:getPosition()
    for i = 1, 2 do
        local monster = Game.createMonster("minion of Gaz'haragoth", Position(position.x + rX, position.y + rY, position.z), false, false)
        if not monster then -- If not possible to summon, let's force it
            monster = Game.createMonster("minion of Gaz'haragoth", Position(position.x + rX, position.y + rY, position.z), false, true)
        end
    end

    monster:setMaster(creature)
    creature:say("Minions! Follow my call!", TALKTYPE_MONSTER_SAY)
    position:sendMagicEffect(CONST_ME_SOUND_RED)
    return false
end
 
Back
Top