• 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 Creaturescript request

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
429
Solutions
1
Reaction score
35
Location
Lo Mochis, Sinaloa
I am using OtservBr
i am looking for a creaturescript like this
Lua:
function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local targetMonster = creature:getMonster()
    if not targetMonster or targetMonster:getName():lower() ~= 'zamulosh' and not targetMonster:getMaster() then
        return true
    end

    local monster = Game.createMonster('Zamulosh3', targetMonster:getPosition(), true, true)
    if not monster then
        return true
    end
    return true
end

function onThink(creature)
    local spectators = Game.getSpectators(Position(33644, 32757, 11), false, false, 10, 10, 10, 10)
    for i = 1, #spectators do
        local master = spectators[i]
        if master:getMaxHealth() == 300000 and not master:getMaster() then
            master:addSummon(creature)
        end
    end
end

But when the original monster, in this case Zamulosh dies, all the clones disappear, in short i am looking for a mechanic in which the clones have the same life and name as the original, but the moment you kill the original, it makes the clones disappear, and another creature appears.
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,678
Solutions
406
Reaction score
3,789
Explain what you want to happen exactly.
Don't give vague information.

The way your request is worded right now is confusing to the reader;
Which renders them unable to help you without asking for further clarifying information.
 
OP
OP
nefinoo

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
429
Solutions
1
Reaction score
35
Location
Lo Mochis, Sinaloa
I'm sorry, my English is very weak and I'm using the translator.
What I am looking for is a script somewhat similar to the previous one, that when you pull a lever and enter the boss room, this script adds four similar creatures, that have the same life, but that only 1 is the original, let's call it Boss1 and the others 3 Boss2 copies, and that when the player kills Boss 1 (the original), he summons another creature or in my case the next boss.
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,678
Solutions
406
Reaction score
3,789
Alright, so what I would do, is

Create the basic lever script to get the player teleported inside the room and also start an addEvent to access a "start the boss fight" function.

Start the boss fight function will..
-> create 4 monsters, choosing their location randomly.
-> give 1 of the monsters a storage value.

Then the rest of the boss fight will be controlled with an onDeath or onKill creaturescript
-> verify that it's a monster
-> check the name of the monster
-> check that the monster is in the correct area of the map
-> check if they have the storage value
-> use getSpectators to find and remove any of the imposter boss's that are still alive, as well as the actual boss

At this point you have an empty room and can re-use the same code from the summoning script to make 'round 2-3-4-5' of the boss battle.
 
Top