• 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 I need help with summoning random pirate boss in my task boss script!

GM Drama

Member
Joined
Mar 13, 2013
Messages
127
Reaction score
6
So basically I just need the random boss spawn between 4 different bosses.

This is my code

Code:
function onStepIn(cid, item, pos)
local config = {
bosspos = {
{x=31984,y=32897,z=0}, -- Position where
},
boss = "lethal lissy", -- I WANT RANDOM BOSS SPAWN HERE 4 different pirate bosses
}



local thais = {x=31974, y=32898, z=0}
local thaiss = {x=31976, y=32853, z=1}

    if item.actionid == 16339 and getPlayerStorageValue (cid, 16710) == 1 and getPlayerStorageValue (cid, 16711) == -1 then 
		doTeleportThing(cid,thais)
        doSendMagicEffect(getCreaturePosition(cid),10)
		doCreatureSay(cid, 'You have ten minutes to kill and loot this boss, else you will lose that chance and will be kicked out.', TALKTYPE_ORANGE_1)
		doPlayerSetStorageValue (cid, 16711, 1)
		doSummonCreature(config.boss, config.bosspos[1])
		elseif getPlayerStorageValue (cid, 16710) == -1 then
		doTeleportThing(cid,thaiss)
		doCreatureSay(cid, 'You did not complete the task Quest!', TALKTYPE_ORANGE_1)
		else
		doTeleportThing(cid,thaiss)
		doCreatureSay(cid, 'You already had a chance to kill Lethal Lissy.', TALKTYPE_ORANGE_1)
		end	
    return 1
end
 
Lua:
local config = {
	bosspos = {x=31984,y=32897,z=0}, 
	thais = {x=31974, y=32898, z=0},
	thaiss = {x=31976, y=32853, z=1}
}
local bosses = {"lethal lissy", "boss2", "boss3", "boss4"}

function onStepIn(cid, item, pos)

   	if item.actionid == 16339 and getPlayerStorageValue (cid, 16710) == 1 and getPlayerStorageValue (cid, 16711) == -1 then 
		doTeleportThing(cid,config.thais)
        	doSendMagicEffect(getCreaturePosition(cid),10)
		doCreatureSay(cid, 'You have ten minutes to kill and loot this boss, else you will lose that chance and will be kicked out.', TALKTYPE_ORANGE_1)
		doPlayerSetStorageValue (cid, 16711, 1)
		doSummonCreature(bosses[math.random(#bosses)], config.bosspos)
	elseif getPlayerStorageValue (cid, 16710) == -1 then
		doTeleportThing(cid,config.thaiss)
		doCreatureSay(cid, 'You did not complete the task Quest!', TALKTYPE_ORANGE_1)
	else
		doTeleportThing(cid,config.thaiss)
		doCreatureSay(cid, 'You already had a chance to kill Lethal Lissy.', TALKTYPE_ORANGE_1)
	end	
    	return 1
end
 
Lua:
local config = {
	bosspos = {x=31984,y=32897,z=0}, 
	thais = {x=31974, y=32898, z=0},
	thaiss = {x=31976, y=32853, z=1}
}
local bosses = {"lethal lissy", "boss2", "boss3", "boss4"}

function onStepIn(cid, item, pos)

   	if item.actionid == 16339 and getPlayerStorageValue (cid, 16710) == 1 and getPlayerStorageValue (cid, 16711) == -1 then 
		doTeleportThing(cid,config.thais)
        	doSendMagicEffect(getCreaturePosition(cid),10)
		doCreatureSay(cid, 'You have ten minutes to kill and loot this boss, else you will lose that chance and will be kicked out.', TALKTYPE_ORANGE_1)
		doPlayerSetStorageValue (cid, 16711, 1)
		doSummonCreature(bosses[math.random(#bosses)], config.bosspos)
	elseif getPlayerStorageValue (cid, 16710) == -1 then
		doTeleportThing(cid,config.thaiss)
		doCreatureSay(cid, 'You did not complete the task Quest!', TALKTYPE_ORANGE_1)
	else
		doTeleportThing(cid,config.thaiss)
		doCreatureSay(cid, 'You already had a chance to kill Lethal Lissy.', TALKTYPE_ORANGE_1)
	end	
    	return 1
end

Won't that make all bosses spawn at the same time? Or will only 1 of them spawn?
 
Back
Top